r100090 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100089‎ | r100090 | r100091 >
Date:21:28, 17 October 2011
Author:foxtrott
Status:deferred (Comments)
Tags:
Comment:
summary for save-and-continue
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormUtils.php (modified) (history)
  • /trunk/extensions/SemanticForms/languages/SF_Messages.php (modified) (history)
  • /trunk/extensions/SemanticForms/libs/SF_submit.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php
@@ -36,6 +36,7 @@
3737 //$vars['sfgBadIntegerErrorStr'] = wfMsg( 'sf_bad_integer_error' );
3838 $vars['sfgBadDateErrorStr'] = wfMsg( 'sf_bad_date_error' );
3939 $vars['sfgAnonEditWarning'] = wfMsg( 'sf_autoedit_anoneditwarning' );
 40+ $vars['sfgSaveAndContinueSummary'] = wfMsg( 'sf_formedit_saveandcontinue_summary', wfMsg( 'sf_formedit_saveandcontinueediting' ) );
4041
4142 return true;
4243 }
Index: trunk/extensions/SemanticForms/languages/SF_Messages.php
@@ -140,6 +140,7 @@
141141 'sf_formedit_emptytitle' => 'Error: The inserted data results in an empty page title.',
142142 'sf_formedit_hookerror' => 'Error: A MediaWiki extension prevented the modification of the target page.',
143143 'sf_formedit_saveandcontinueediting' => 'Save and continue',
 144+ 'sf_formedit_saveandcontinue_summary'=> 'Saved using "$1" button in form',
144145 'sf_formedit_tooltip_saveandcontinueediting' => 'Save data and continue editing',
145146 'sf_formedit_accesskey_saveandcontinueediting' => 'a',
146147 'sf_autoedit_anoneditwarning' => 'Warning: You are not logged in. Your IP address will be recorded in this page\'s edit history.',
Index: trunk/extensions/SemanticForms/libs/SF_submit.js
@@ -59,8 +59,9 @@
6060
6161 sajax_request_type = 'POST';
6262 var form = $('#sfForm');
 63+ var formdata = collectData( form );
6364
64 - sajax_do_call( 'SFAutoeditAPI::handleAutoEdit', new Array(collectData( form ), false), function( ajaxHeader ){
 65+ sajax_do_call( 'SFAutoeditAPI::handleAutoEdit', new Array(formdata, false), function( ajaxHeader ){
6566
6667 if ( ajaxHeader.status == 200 ) {
6768
@@ -111,7 +112,29 @@
112113 function collectData( form ) {
113114
114115 var params = form.serialize();
 116+
 117+ var summaryfield = jQuery("#wpSummary", form);
 118+ if ( summaryfield.length > 0 ) {
 119+
 120+ var oldsummary = summaryfield.attr("value");
 121+
 122+ if ( oldsummary != "" ) {
 123+ summaryfield.attr("value", oldsummary + " (" + sfgSaveAndContinueSummary + ")");
 124+ } else {
 125+ summaryfield.attr("value", sfgSaveAndContinueSummary);
 126+ }
115127
 128+ var params = form.serialize();
 129+
 130+ summaryfield.attr("value", oldsummary );
 131+
 132+ } else {
 133+
 134+ var params = form.serialize();
 135+ params += "&wpSummary=" + sfgSaveAndContinueSummary;
 136+
 137+ }
 138+
116139 if (wgAction == "formedit") {
117140 params += "&target=" + encodeURIComponent( wgPageName );
118141 } else if ( wgCanonicalSpecialPageName == "FormEdit") {
@@ -143,7 +166,7 @@
144167 }
145168
146169 params += "&wpMinoredit=1";
147 -
 170+
148171 return params;
149172 }
150173

Follow-up revisions

RevisionCommit summaryAuthorDate
r100091followup r100090: remove some unnecessary codefoxtrott21:31, 17 October 2011
r100156followup r100090, followup r100081: Message doc for new messagesfoxtrott20:37, 18 October 2011

Comments

#Comment by Raymond (talk | contribs)   12:37, 18 October 2011

Please read translatewiki:Thread:Support/About MediaWiki:Sf formedit saveandcontinue summary for a translator question.

Please add message documentation for the newly added messages. Thanks.

#Comment by F.trott (talk | contribs)   20:39, 18 October 2011

Fixed in r100156.

Status & tagging log