r61963 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61962‎ | r61963 | r61964 >
Date:00:10, 4 February 2010
Author:werdna
Status:resolved (Comments)
Tags:
Comment:
Fix bug in AJAX saving that broke non-AJAX saving of post edits
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -843,25 +843,50 @@
844844 return;
845845 }
846846
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+ }
851862
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 -
864863 self::$stylesAndScriptsDone = true;
865864 }
 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+ }
866891
867892 static function exportJSLocalisation() {
868893 wfLoadExtensionMessages( 'LiquidThreads' );
Index: trunk/extensions/LiquidThreads/lqt.js
@@ -875,7 +875,6 @@
876876 },
877877
878878 'handleAJAXSave' : function( e ) {
879 - e.preventDefault();
880879 var editform = $j(this).closest('.lqt-edit-form');
881880 var type = editform.find('input[name=lqt_method]').val();
882881

Follow-up revisions

RevisionCommit summaryAuthorDate
r61964Revert stuff accidentally committed in r61963werdna00:11, 4 February 2010

Comments

#Comment by Tim Starling (talk | contribs)   03:39, 19 February 2010

You might want to try running "svn diff" before each commit.

Status & tagging log