Index: branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | |
238 | 238 | /* Public Methods */ |
239 | 239 | |
240 | | - /* |
| 240 | + /** |
241 | 241 | * Generates a random user session ID (32 alpha-numeric characters). |
242 | 242 | * |
243 | 243 | * This information would potentially be stored in a cookie to identify a user during a |
— | — | @@ -254,7 +254,7 @@ |
255 | 255 | return id; |
256 | 256 | } |
257 | 257 | |
258 | | - /* |
| 258 | + /** |
259 | 259 | * Gets the current user's name. |
260 | 260 | * |
261 | 261 | * @return mixed user name string or null if users is anonymous |
— | — | @@ -263,7 +263,16 @@ |
264 | 264 | return mediaWiki.config.get( 'wgUserName' ); |
265 | 265 | }; |
266 | 266 | |
267 | | - /* |
| 267 | + /** |
| 268 | + * Checks if the current user is anonymous. |
| 269 | + * |
| 270 | + * @return boolean |
| 271 | + */ |
| 272 | + this.anonymous = function() { |
| 273 | + return that.name() ? false : true; |
| 274 | + }; |
| 275 | + |
| 276 | + /** |
268 | 277 | * Gets a random session ID automatically generated and kept in a cookie. |
269 | 278 | * |
270 | 279 | * This ID is ephemeral for everyone, staying in their browser only until they close |
— | — | @@ -284,7 +293,7 @@ |
285 | 294 | return sessionId; |
286 | 295 | }; |
287 | 296 | |
288 | | - /* |
| 297 | + /** |
289 | 298 | * Gets the current user's name or a random ID automatically generated and kept in a cookie. |
290 | 299 | * |
291 | 300 | * This ID is persistent for anonymous users, staying in their browser up to 1 year. The |
Property changes on: branches/wmf/1.17wmf1/resources/mediawiki/mediawiki.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
292 | 301 | Merged /trunk/phase3/resources/mediawiki/mediawiki.js:r78544 |