https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112723
Revision: 112723
Author: hashar
Date: 2012-02-29 20:56:39 +0000 (Wed, 29 Feb 2012)
Log Message:
-----------
MFT to 1.19wmf1 r112721
(bug 34790) Pressing "Make Request" shouldn't make two requests to api.php
Which is a regression.
Modified Paths:
--------------
branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
Property Changed:
----------------
branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
Modified: branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
===================================================================
--- branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
2012-02-29 20:54:46 UTC (rev 112722)
+++ branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
2012-02-29 20:56:39 UTC (rev 112723)
@@ -516,6 +516,10 @@
.appendTo( '#api-sandbox-parameters' )
.add( $submit )
.click( function ( e ) {
+ // Don't do default action (crawl up to <form>
and trigger a submit).
+ // That would submit it twice (bug 34790)
+ e.preventDefault();
+
$form.submit();
} )
.button({ disabled: true });
@@ -602,6 +606,9 @@
$form.submit( function ( e ) {
var url, params, mustBePosted;
+ // Prevent browser from submitting the form
+ // and reloading the page to the action-url.
+ // We're doing it with AJAX instead, below.
e.preventDefault();
if ( $submit.button( 'option', 'disabled' ) === true ) {
Property changes on:
branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/JSTesting/extensions/ApiSandbox/ext.apiSandbox.js:100352-107913
/branches/REL1_15/phase3/extensions/ApiSandbox/ext.apiSandbox.js:51646
/branches/REL1_17/phase3/extensions/ApiSandbox/ext.apiSandbox.js:81445,81448
/branches/new-installer/phase3/extensions/ApiSandbox/ext.apiSandbox.js:43664-66004
/branches/sqlite/extensions/ApiSandbox/ext.apiSandbox.js:58211-58321
/branches/wmf/1.18wmf1/extensions/ApiSandbox/ext.apiSandbox.js:97508
/trunk/extensions/ApiSandbox/ext.apiSandbox.js:111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112114,112153,112160,112166,112260,112282,112360,112517,112571,112613,112628,112721
/trunk/phase3/extensions/ApiSandbox/ext.apiSandbox.js:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs