Index: trunk/phase3/resources/mediawiki/mediawiki.user.js |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | * |
31 | 31 | * @return String: Random set of 32 alpha-numeric characters |
32 | 32 | */ |
33 | | - this.generateId = function() { |
| 33 | + function generateId() { |
34 | 34 | var id = ''; |
35 | 35 | var seed = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
36 | 36 | for ( var i = 0, r; i < 32; i++ ) { |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | id += seed.substring( r, r + 1 ); |
39 | 39 | } |
40 | 40 | return id; |
41 | | - }; |
| 41 | + } |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Gets the current user's name. |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | this.sessionId = function () { |
70 | 70 | var sessionId = $.cookie( 'mediaWiki.user.sessionId' ); |
71 | 71 | if ( typeof sessionId == 'undefined' || sessionId === null ) { |
72 | | - sessionId = that.generateId(); |
| 72 | + sessionId = generateId(); |
73 | 73 | $.cookie( 'mediaWiki.user.sessionId', sessionId, { 'expires': null, 'path': '/' } ); |
74 | 74 | } |
75 | 75 | return sessionId; |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | } |
92 | 92 | var id = $.cookie( 'mediaWiki.user.id' ); |
93 | 93 | if ( typeof id == 'undefined' || id === null ) { |
94 | | - id = that.generateId(); |
| 94 | + id = generateId(); |
95 | 95 | } |
96 | 96 | // Set cookie if not set, or renew it if already set |
97 | 97 | $.cookie( 'mediaWiki.user.id', id, { 'expires': 365, 'path': '/' } ); |