r101187 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101186‎ | r101187 | r101188 >
Date:20:14, 28 October 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
bugfix ('popup' parameter broken in formlink)
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SF_popupform.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/libs/SF_popupform.js
@@ -16,25 +16,7 @@
1717 });
1818
1919 // register formlink with button
20 - jQuery( 'form.popupformlink[method!="post"] input' ).each(function() {
21 -
22 - var input = jQuery(this);
23 -
24 - // Yay, IE 4 lines, FF 0 lines
25 - var target = String (this.getAttribute("onclick"));
26 - var start = target.indexOf("window.location.href='") + 22;
27 - var stop = target.indexOf("'", start);
28 - target = target.substring( start, stop );
29 -
30 - input.data( "target", target ) // extract link target from event handler
31 - .attr( "onclick", null ) // and remove event handler
32 - .click( function( evt ){
33 - return ext.popupform.handlePopupFormLink( jQuery( this ).data( "target" ), this);
34 - });
35 - })
36 -
37 - // register formlink with post button
38 - jQuery( 'form.popupformlink[method="post"]' ).submit(function(evt){
 20+ jQuery( 'form.popupformlink' ).submit(function(evt){
3921 return ext.popupform.handlePopupFormLink( this.getAttribute( 'action' ), this );
4022 });
4123
@@ -460,7 +442,7 @@
461443 // Send the form data off, we do not care for the returned data
462444 var innerformdata = innerform.serialize();
463445 jQuery.post( innerform.attr("action"), innerformdata );
464 -
 446+
465447 // build new url for outer page (we have to ask for a purge)
466448
467449 var url = location.href;