Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.php |
— | — | @@ -68,3 +68,4 @@ |
69 | 69 | // Register Hooks |
70 | 70 | $wgHooks['EditPageBeforeEditToolbar'][] = 'WikiEditorHooks::addModules'; |
71 | 71 | $wgHooks['GetPreferences'][] = 'WikiEditorHooks::addPreferences'; |
| 72 | +$wgHooks['LiquidThreadsShowThread'][] = 'WikiEditorHooks::addModulesForThread'; |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -473,6 +473,18 @@ |
474 | 474 | return true; |
475 | 475 | } |
476 | 476 | |
| 477 | + function addModulesForThread( $thread, $levelNum, $totalInLevel, $options ) { |
| 478 | + static $firstRun = true; |
| 479 | + |
| 480 | + if( $firstRun ) { |
| 481 | + $temp = null; |
| 482 | + WikiEditorHooks::addModules( $temp ); |
| 483 | + $firstRun = false; |
| 484 | + } |
| 485 | + |
| 486 | + return true; |
| 487 | + } |
| 488 | + |
477 | 489 | /** |
478 | 490 | * GetPreferences hook |
479 | 491 | * Add module-releated items to the preferences |
Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -1212,11 +1212,6 @@ |
1213 | 1213 | $wgOut->addScriptFile( "$wgLiquidThreadsExtensionPath/js/lqt.toolbar.js" ); |
1214 | 1214 | $wgOut->addExtensionStyle( "$wgLiquidThreadsExtensionPath/lqt.css?{$wgStyleVersion}" ); |
1215 | 1215 | |
1216 | | - if ( class_exists( 'WikiEditorHooks' ) ) { |
1217 | | - $temp = null; |
1218 | | - WikiEditorHooks::addModules( $temp ); |
1219 | | - } |
1220 | | - |
1221 | 1216 | self::$stylesAndScriptsDone = true; |
1222 | 1217 | } |
1223 | 1218 | |
— | — | @@ -1963,6 +1958,10 @@ |
1964 | 1959 | ) |
1965 | 1960 | ); |
1966 | 1961 | |
| 1962 | + if ( wfRunHooks( 'LiquidThreadsShowThread', array( $thread, $levelNum, $totalInLevel, $options ) ) ) { |
| 1963 | + self::addJSandCSS(); |
| 1964 | + } |
| 1965 | + |
1967 | 1966 | // Flush output to display thread |
1968 | 1967 | $this->output->addHTML( $html ); |
1969 | 1968 | $this->output->addHTML( Xml::openElement( 'div', |
Index: trunk/extensions/LiquidThreads/pages/TalkpageHistoryView.php |
— | — | @@ -5,7 +5,6 @@ |
6 | 6 | function show() { |
7 | 7 | global $wgUser; |
8 | 8 | |
9 | | - self::addJSandCSS(); |
10 | 9 | wfLoadExtensionMessages( 'LiquidThreads' ); |
11 | 10 | |
12 | 11 | $sk = $wgUser->getSkin(); |
Index: trunk/extensions/LiquidThreads/pages/ThreadPermalinkView.php |
— | — | @@ -232,7 +232,6 @@ |
233 | 233 | $this->output->addFeedLink( $format, $url ); |
234 | 234 | } |
235 | 235 | |
236 | | - self::addJSandCSS(); |
237 | 236 | $this->output->setSubtitle( $this->getSubtitle() ); |
238 | 237 | |
239 | 238 | if ( $this->methodApplies( 'summarize' ) ) |
Index: trunk/extensions/LiquidThreads/pages/NewUserMessagesView.php |
— | — | @@ -83,8 +83,6 @@ |
84 | 84 | } |
85 | 85 | |
86 | 86 | function showOnce() { |
87 | | - self::addJSandCSS(); |
88 | | - |
89 | 87 | NewMessages::recacheMessageCount( $this->user->getId() ); |
90 | 88 | |
91 | 89 | static $scriptDone = false; |
Index: trunk/extensions/LiquidThreads/pages/SpecialHotTopics.php |
— | — | @@ -14,8 +14,6 @@ |
15 | 15 | $wgOut->setPageTitle( wfMsg( 'lqt-hot-topics' ) ); |
16 | 16 | $view = LqtView::getView(); |
17 | 17 | |
18 | | - LqtView::addJsAndCss(); |
19 | | - |
20 | 18 | // Get hot topics |
21 | 19 | $topics = LqtHotTopicsController::getHotThreads(); |
22 | 20 | |
Index: trunk/extensions/LiquidThreads/pages/ThreadHistoryListingView.php |
— | — | @@ -7,7 +7,6 @@ |
8 | 8 | $this->showMissingThreadPage(); |
9 | 9 | return false; |
10 | 10 | } |
11 | | - self::addJSandCSS(); |
12 | 11 | wfLoadExtensionMessages( 'LiquidThreads' ); |
13 | 12 | |
14 | 13 | $this->thread->updateHistory(); |
Index: trunk/extensions/LiquidThreads/pages/TalkpageView.php |
— | — | @@ -229,7 +229,6 @@ |
230 | 230 | wfLoadExtensionMessages( 'LiquidThreads' ); |
231 | 231 | |
232 | 232 | $this->output->setPageTitle( $this->title->getPrefixedText() ); |
233 | | - self::addJSandCSS(); |
234 | 233 | |
235 | 234 | // Expose feed links. |
236 | 235 | global $wgFeedClasses, $wgScriptPath, $wgServer; |