Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php |
— | — | @@ -85,11 +85,4 @@ |
86 | 86 | public function getGroup() { |
87 | 87 | return 'private'; |
88 | 88 | } |
89 | | - |
90 | | - /** |
91 | | - * @return array |
92 | | - */ |
93 | | - public function getDependencies() { |
94 | | - return array( 'mediawiki.user' ); |
95 | | - } |
96 | 89 | } |
Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserTokensModule.php |
— | — | @@ -60,11 +60,4 @@ |
61 | 61 | public function getGroup() { |
62 | 62 | return 'private'; |
63 | 63 | } |
64 | | - |
65 | | - /** |
66 | | - * @return array |
67 | | - */ |
68 | | - public function getDependencies() { |
69 | | - return array( 'mediawiki.user' ); |
70 | | - } |
71 | 64 | } |
Index: trunk/phase3/resources/mediawiki/mediawiki.user.js |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | /** |
9 | 9 | * User object |
10 | 10 | */ |
11 | | - function User() { |
| 11 | + function User( options, tokens ) { |
12 | 12 | |
13 | 13 | /* Private Members */ |
14 | 14 | |
— | — | @@ -15,9 +15,9 @@ |
16 | 16 | |
17 | 17 | /* Public Members */ |
18 | 18 | |
19 | | - this.options = new mw.Map(); |
| 19 | + this.options = options || new mw.Map(); |
20 | 20 | |
21 | | - this.tokens = new mw.Map(); |
| 21 | + this.tokens = tokens || new mw.Map(); |
22 | 22 | |
23 | 23 | /* Public Methods */ |
24 | 24 | |
— | — | @@ -176,6 +176,8 @@ |
177 | 177 | }; |
178 | 178 | } |
179 | 179 | |
180 | | - mw.user = new User(); |
| 180 | + // Extend the skeleton mw.user from mediawiki.js |
| 181 | + // This is kind of ugly but we're stuck with this for b/c reasons |
| 182 | + mw.user = new User( mw.user.options, mw.user.tokens ); |
181 | 183 | |
182 | 184 | })(jQuery); |
\ No newline at end of file |
Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -1419,7 +1419,13 @@ |
1420 | 1420 | return s; |
1421 | 1421 | } |
1422 | 1422 | }; |
1423 | | - }() ) |
| 1423 | + }() ), |
| 1424 | + |
| 1425 | + // Skeleton user object. mediawiki.user.js extends this |
| 1426 | + user: { |
| 1427 | + options: new Map(), |
| 1428 | + tokens: new Map() |
| 1429 | + } |
1424 | 1430 | }; |
1425 | 1431 | |
1426 | 1432 | })( jQuery ); |