Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.php |
— | — | @@ -43,4 +43,4 @@ |
44 | 44 | |
45 | 45 | // Registers Hooks |
46 | 46 | $wgHooks['AjaxAddScript'][] = 'UsabilityInitiativeHooks::addJs'; |
47 | | -$wgHooks['BeforePageDisplay'][] = 'UsabilityInitiativeHooks::addCss'; |
\ No newline at end of file |
| 47 | +$wgHooks['BeforePageDisplay'][] = 'UsabilityInitiativeHooks::addCss'; |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php |
— | — | @@ -51,6 +51,3 @@ |
52 | 52 | // Registers Hooks |
53 | 53 | $wgHooks['EditPageBeforeEditToolbar'][] = 'EditToolbarHooks::intercept'; |
54 | 54 | $wgHooks['GetPreferences'][] = 'EditToolbarHooks::addPreferences'; |
55 | | - |
56 | | -// Registers Hooks |
57 | | -$wgHooks['AjaxAddScript'][] = 'EditToolbarHooks::initialize'; |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.hooks.php |
— | — | @@ -37,6 +37,15 @@ |
38 | 38 | } |
39 | 39 | // Replaces stock toolbar with new toolbar container |
40 | 40 | $toolbar = '<div id="edittoolbar"></div>'; |
| 41 | + |
| 42 | + // Add JS and CSS |
| 43 | + global $wgEditToolbarStyleVersion; |
| 44 | + UsabilityInitiativeHooks::addScript( |
| 45 | + 'EditToolbar/EditToolbar.js', $wgEditToolbarStyleVersion |
| 46 | + ); |
| 47 | + UsabilityInitiativeHooks::addStyle( |
| 48 | + 'EditToolbar/EditToolbar.css', $wgEditToolbarStyleVersion |
| 49 | + ); |
41 | 50 | // Internationalization |
42 | 51 | wfLoadExtensionMessages( 'EditToolbar' ); |
43 | 52 | // Adds messages to page |
— | — | @@ -190,23 +199,4 @@ |
191 | 200 | } |
192 | 201 | return true; |
193 | 202 | } |
194 | | - |
195 | | - /** |
196 | | - * AjaxAddScript hook |
197 | | - * Initializes the component |
198 | | - */ |
199 | | - public static function initialize() { |
200 | | - global $wgEditToolbarStyleVersion; |
201 | | - |
202 | | - // Add script to document |
203 | | - UsabilityInitiativeHooks::addScript( |
204 | | - 'EditToolbar/EditToolbar.js', $wgEditToolbarStyleVersion |
205 | | - ); |
206 | | - // Add style to document |
207 | | - UsabilityInitiativeHooks::addStyle( |
208 | | - 'EditToolbar/EditToolbar.css', $wgEditToolbarStyleVersion |
209 | | - ); |
210 | | - // Continue |
211 | | - return true; |
212 | | - } |
213 | 203 | } |