Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php |
— | — | @@ -36,6 +36,7 @@ |
37 | 37 | //$vars['sfgBadIntegerErrorStr'] = wfMsg( 'sf_bad_integer_error' ); |
38 | 38 | $vars['sfgBadDateErrorStr'] = wfMsg( 'sf_bad_date_error' ); |
39 | 39 | $vars['sfgAnonEditWarning'] = wfMsg( 'sf_autoedit_anoneditwarning' ); |
| 40 | + $vars['sfgSaveAndContinueSummary'] = wfMsg( 'sf_formedit_saveandcontinue_summary', wfMsg( 'sf_formedit_saveandcontinueediting' ) ); |
40 | 41 | |
41 | 42 | return true; |
42 | 43 | } |
Index: trunk/extensions/SemanticForms/languages/SF_Messages.php |
— | — | @@ -140,6 +140,7 @@ |
141 | 141 | 'sf_formedit_emptytitle' => 'Error: The inserted data results in an empty page title.', |
142 | 142 | 'sf_formedit_hookerror' => 'Error: A MediaWiki extension prevented the modification of the target page.', |
143 | 143 | 'sf_formedit_saveandcontinueediting' => 'Save and continue', |
| 144 | + 'sf_formedit_saveandcontinue_summary'=> 'Saved using "$1" button in form', |
144 | 145 | 'sf_formedit_tooltip_saveandcontinueediting' => 'Save data and continue editing', |
145 | 146 | 'sf_formedit_accesskey_saveandcontinueediting' => 'a', |
146 | 147 | '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 @@ |
60 | 60 | |
61 | 61 | sajax_request_type = 'POST'; |
62 | 62 | var form = $('#sfForm'); |
| 63 | + var formdata = collectData( form ); |
63 | 64 | |
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 ){ |
65 | 66 | |
66 | 67 | if ( ajaxHeader.status == 200 ) { |
67 | 68 | |
— | — | @@ -111,7 +112,29 @@ |
112 | 113 | function collectData( form ) { |
113 | 114 | |
114 | 115 | 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 | + } |
115 | 127 | |
| 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 | + |
116 | 139 | if (wgAction == "formedit") { |
117 | 140 | params += "&target=" + encodeURIComponent( wgPageName ); |
118 | 141 | } else if ( wgCanonicalSpecialPageName == "FormEdit") { |
— | — | @@ -143,7 +166,7 @@ |
144 | 167 | } |
145 | 168 | |
146 | 169 | params += "&wpMinoredit=1"; |
147 | | - |
| 170 | + |
148 | 171 | return params; |
149 | 172 | } |
150 | 173 | |