r112723 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112722‎ | r112723 | r112724 >
Date:20:56, 29 February 2012
Author:hashar
Status:ok
Tags:
Comment:
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 (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
@@ -516,6 +516,10 @@
517517 .appendTo( '#api-sandbox-parameters' )
518518 .add( $submit )
519519 .click( function ( e ) {
 520+ // Don't do default action (crawl up to <form> and trigger a submit).
 521+ // That would submit it twice (bug 34790)
 522+ e.preventDefault();
 523+
520524 $form.submit();
521525 } )
522526 .button({ disabled: true });
@@ -602,6 +606,9 @@
603607 $form.submit( function ( e ) {
604608 var url, params, mustBePosted;
605609
 610+ // Prevent browser from submitting the form
 611+ // and reloading the page to the action-url.
 612+ // We're doing it with AJAX instead, below.
606613 e.preventDefault();
607614
608615 if ( $submit.button( 'option', 'disabled' ) === true ) {
Property changes on: branches/wmf/1.19wmf1/extensions/ApiSandbox/ext.apiSandbox.js
___________________________________________________________________
Added: svn:mergeinfo
609616 Merged /branches/new-installer/phase3/extensions/ApiSandbox/ext.apiSandbox.js:r43664-66004
610617 Merged /branches/JSTesting/extensions/ApiSandbox/ext.apiSandbox.js:r100352-107913
611618 Merged /branches/REL1_15/phase3/extensions/ApiSandbox/ext.apiSandbox.js:r51646
612619 Merged /branches/wmf/1.18wmf1/extensions/ApiSandbox/ext.apiSandbox.js:r97508
613620 Merged /branches/REL1_17/phase3/extensions/ApiSandbox/ext.apiSandbox.js:r81445,81448
614621 Merged /trunk/extensions/ApiSandbox/ext.apiSandbox.js:r111043,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
615622 Merged /branches/sqlite/extensions/ApiSandbox/ext.apiSandbox.js:r58211-58321
616623 Merged /trunk/phase3/extensions/ApiSandbox/ext.apiSandbox.js:r111002,111029,111034,111062,111067,111076,111085,111128,111144,111251

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112702[ApiSandbox] Prevent duplicate submission of the form when clicking "Make Req...krinkle18:03, 29 February 2012
r112721[ApiSandbox] Prevent duplicate submission of the form when clicking "Make Req...krinkle20:52, 29 February 2012

Status & tagging log