Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -843,50 +843,25 @@ |
844 | 844 | return; |
845 | 845 | } |
846 | 846 | |
847 | | - global $wgOut; |
848 | | - |
849 | | - $info = self::getScriptsAndStyles(); |
850 | | - |
851 | | - foreach( $info['inlineScripts'] as $script ) { |
852 | | - $wgOut->addInlineScript( $script ); |
853 | | - } |
854 | | - |
855 | | - foreach( $info['scripts'] as $script ) { |
856 | | - $wgOut->addScriptFile( $script ); |
857 | | - } |
858 | | - |
859 | | - foreach( $info['styles'] as $style ) { |
860 | | - $wgOut->addExtensionStyle( $style ); |
861 | | - } |
| 847 | + global $wgOut, $wgStylePath; |
| 848 | + global $wgScriptPath, $wgStyleVersion; |
| 849 | + global $wgEnableJS2system; |
| 850 | + global $wgLiquidThreadsExtensionName; |
862 | 851 | |
| 852 | + $wgOut->addInlineScript( 'var wgLqtMessages = ' . self::exportJSLocalisation() . ';' ); |
| 853 | + |
| 854 | + $basePath = "$wgScriptPath/extensions/$wgLiquidThreadsExtensionName"; |
| 855 | + |
| 856 | + $wgOut->addScriptFile( "$basePath/jquery/js2.combined.js" ); |
| 857 | + $wgOut->addExtensionStyle( "$basePath/jquery/jquery-ui-1.7.2.css" ); |
| 858 | + |
| 859 | + $wgOut->addScriptFile( "$basePath/jquery/jquery.autogrow.js" ); |
| 860 | + |
| 861 | + $wgOut->addScriptFile( "$basePath/lqt.js" ); |
| 862 | + $wgOut->addExtensionStyle( "$basePath/lqt.css?{$wgStyleVersion}" ); |
| 863 | + |
863 | 864 | self::$stylesAndScriptsDone = true; |
864 | 865 | } |
865 | | - |
866 | | - static function getScriptsAndStyles() { |
867 | | - global $wgLiquidThreadsExtensionName, $wgStylePath, $wgScriptPath, $wgStyleVersion; |
868 | | - $basePath = "$wgScriptPath/extensions/$wgLiquidThreadsExtensionName"; |
869 | | - |
870 | | - $inlineScripts = array( |
871 | | - 'var wgLqtMessages = ' . self::exportJSLocalisation() . ';', |
872 | | - ); |
873 | | - |
874 | | - $scripts = array( |
875 | | - "$basePath/jquery/js2.combined.js", |
876 | | - "$basePath/jquery/jquery.autogrow.js", |
877 | | - "$basePath/lqt.js", |
878 | | - ); |
879 | | - |
880 | | - $styles = array( |
881 | | - "$basePath/jquery/jquery-ui-1.7.2.css", |
882 | | - "$basePath/lqt.css?{$wgStyleVersion}", |
883 | | - ); |
884 | | - |
885 | | - return array( |
886 | | - 'inlineScripts' => $inlineScripts, |
887 | | - 'scripts' => $scripts, |
888 | | - 'styles' => $styles, |
889 | | - ); |
890 | | - } |
891 | 866 | |
892 | 867 | static function exportJSLocalisation() { |
893 | 868 | wfLoadExtensionMessages( 'LiquidThreads' ); |