r42520 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42519‎ | r42520 | r42521 >
Date:00:07, 25 October 2008
Author:aaron
Status:old
Tags:
Comment:
Use POST request so it goes through properly, or at all ;)
Modified paths:
  • /trunk/extensions/Drafts/Drafts.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Drafts/Drafts.js
@@ -93,11 +93,14 @@
9494 wgAjaxSaveDraft.inprogress = true;
9595
9696 // Perform Ajax call
 97+ var old = sajax_request_type;
 98+ sajax_request_type = "POST";
9799 sajax_do_call(
98100 "DraftHooks::AjaxSave",
99101 [ dtoken, etoken, id, title, section, starttime, edittime, scrolltop, text, summary, minoredit ],
100102 wgAjaxSaveDraft.processResult
101103 );
 104+ sajax_request_type = old;
102105
103106 // Reallow request if it is not done in 2 seconds
104107 wgAjaxSaveDraft.timeoutID = window.setTimeout( function() {
@@ -110,8 +113,7 @@
111114 if( request.responseText > -1 ) {
112115 wgAjaxSaveDraft.setControlsSaved();
113116 document.editform.wpDraftID.value = request.responseText;
114 - }
115 - else {
 117+ } else {
116118 wgAjaxSaveDraft.setControlsError();
117119 }
118120

Status & tagging log