Index: trunk/extensions/CleanChanges/CleanChanges.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | |
21 | 21 | /* Hook into code */ |
22 | 22 | $wgHooks['FetchChangesList'][] = 'NCL::hook'; |
| 23 | +$wgHooks['MakeGlobalVariablesScript'][] = 'NCL::addScriptVariables'; |
23 | 24 | |
24 | 25 | /* Extension information */ |
25 | 26 | $wgExtensionCredits['other'][] = array( |
Index: trunk/extensions/CleanChanges/CleanChanges_body.php |
— | — | @@ -28,8 +28,8 @@ |
29 | 29 | } |
30 | 30 | |
31 | 31 | if ( $list instanceof NCL ) { |
32 | | - global $wgOut, $wgScriptPath; |
33 | | - $wgOut->addScriptFile( "$wgScriptPath/extensions/CleanChanges/cleanchanges.js" ); |
| 32 | + global $wgOut, $wgExtensionAssetsPath; |
| 33 | + $wgOut->addScriptFile( "$wgExtensionAssetsPath/CleanChanges/cleanchanges.js" ); |
34 | 34 | } |
35 | 35 | |
36 | 36 | /* If some list was specified, stop processing */ |
— | — | @@ -37,13 +37,18 @@ |
38 | 38 | |
39 | 39 | } |
40 | 40 | |
| 41 | + protected static $userinfo = array(); |
41 | 42 | |
| 43 | + public static function addScriptVariables( &$vars ) { |
| 44 | + $vars += self::$userinfo; |
| 45 | + return true; |
| 46 | + } |
| 47 | + |
42 | 48 | /** |
43 | 49 | * String that comes between page details and the user details. By default |
44 | 50 | * only larger space. |
45 | 51 | */ |
46 | 52 | protected $userSeparator = "\xc2\xa0 \xc2\xa0"; |
47 | | - protected $userinfo = array(); |
48 | 53 | |
49 | 54 | /** |
50 | 55 | * Text direction, true for ltr and false for rtl |
— | — | @@ -69,11 +74,6 @@ |
70 | 75 | } |
71 | 76 | |
72 | 77 | function endRecentChangesList() { |
73 | | - /* |
74 | | - * Have to output the accumulated javascript stuff before any output is send. |
75 | | - */ |
76 | | - global $wgOut; |
77 | | - $wgOut->addScript( Skin::makeVariablesScript( $this->userinfo ) ); |
78 | 78 | return parent::endRecentChangesList() . '</div>'; |
79 | 79 | } |
80 | 80 | |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | |
178 | 178 | $stuff = $this->userToolLinks( $rc->getAttribute( 'rc_user' ), |
179 | 179 | $rc->getAttribute( 'rc_user_text' ) ); |
180 | | - $this->userinfo += $stuff[1]; |
| 180 | + self::$userinfo += $stuff[1]; |
181 | 181 | |
182 | 182 | $rc->_user = $this->skin->userLink( $rc->getAttribute( 'rc_user' ), |
183 | 183 | $rc->getAttribute( 'rc_user_text' ) ); |