Index: trunk/extensions/LiquidThreads/classes/View.php |
— | — | @@ -843,25 +843,50 @@ |
844 | 844 | return; |
845 | 845 | } |
846 | 846 | |
847 | | - global $wgOut, $wgStylePath; |
848 | | - global $wgScriptPath, $wgStyleVersion; |
849 | | - global $wgEnableJS2system; |
850 | | - global $wgLiquidThreadsExtensionName; |
| 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 | + } |
851 | 862 | |
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 | | - |
864 | 863 | self::$stylesAndScriptsDone = true; |
865 | 864 | } |
| 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 | + } |
866 | 891 | |
867 | 892 | static function exportJSLocalisation() { |
868 | 893 | wfLoadExtensionMessages( 'LiquidThreads' ); |
Index: trunk/extensions/LiquidThreads/lqt.js |
— | — | @@ -875,7 +875,6 @@ |
876 | 876 | }, |
877 | 877 | |
878 | 878 | 'handleAJAXSave' : function( e ) { |
879 | | - e.preventDefault(); |
880 | 879 | var editform = $j(this).closest('.lqt-edit-form'); |
881 | 880 | var type = editform.find('input[name=lqt_method]').val(); |
882 | 881 | |