From 64da40b93f48e17a460496fbed740c6285c15a83 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 3 Jan 2011 02:11:27 +0000 Subject: #969456 follow-up by effulgentsia, threewestwinds: Upgrade jQuery Form library to 2.52. --- misc/jquery.form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'misc/jquery.form.js') diff --git a/misc/jquery.form.js b/misc/jquery.form.js index 2ba2dd54f..b0089b67f 100644 --- a/misc/jquery.form.js +++ b/misc/jquery.form.js @@ -2,7 +2,7 @@ /*! * jQuery Form Plugin - * version: 2.49 (18-OCT-2010) + * version: 2.52 (07-DEC-2010) * @requires jQuery v1.3.2 or later * * Examples and documentation at: http://malsup.com/jquery/form/ @@ -10,4 +10,4 @@ * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ -;(function(b){function q(){if(b.fn.ajaxSubmit.debug){var a="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log)window.console.log(a);else window.opera&&window.opera.postError&&window.opera.postError(a)}}b.fn.ajaxSubmit=function(a){function f(){function t(){var p=i.attr("target"),m=i.attr("action");l.setAttribute("target",u);l.getAttribute("method")!="POST"&&l.setAttribute("method","POST");l.getAttribute("action")!=e.url&&l.setAttribute("action",e.url);e.skipEncodingOverride|| i.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});e.timeout&&setTimeout(function(){F=true;s()},e.timeout);var v=[];try{if(e.extraData)for(var w in e.extraData)v.push(b('').appendTo(l)[0]);r.appendTo("body");r.data("form-plugin-onload",s);l.submit()}finally{l.setAttribute("action",m);p?l.setAttribute("target",p):i.removeAttr("target");b(v).remove()}}function s(){if(!G){r.removeData("form-plugin-onload");var p=true; try{if(F)throw"timeout";o=x.contentWindow?x.contentWindow.document:x.contentDocument?x.contentDocument:x.document;var m=e.dataType=="xml"||o.XMLDocument||b.isXMLDoc(o);q("isXml="+m);if(!m&&window.opera&&(o.body==null||o.body.innerHTML==""))if(--K){q("requeing onLoad callback, DOM not available");setTimeout(s,250);return}G=true;j.responseText=o.documentElement?o.documentElement.innerHTML:null;j.responseXML=o.XMLDocument?o.XMLDocument:o;j.getResponseHeader=function(L){return{"content-type":e.dataType}[L]}; var v=/(json|script)/.test(e.dataType);if(v||e.textarea){var w=o.getElementsByTagName("textarea")[0];if(w)j.responseText=w.value;else if(v){var H=o.getElementsByTagName("pre")[0],I=o.getElementsByTagName("body")[0];if(H)j.responseText=H.innerHTML;else if(I)j.responseText=I.innerHTML}}else if(e.dataType=="xml"&&!j.responseXML&&j.responseText!=null)j.responseXML=C(j.responseText);J=b.httpData(j,e.dataType)}catch(D){q("error caught:",D);p=false;j.error=D;b.handleError(e,j,"error",D)}if(p){e.success.call(e.context, J,"success",j);y&&b.event.trigger("ajaxSuccess",[j,e])}y&&b.event.trigger("ajaxComplete",[j,e]);y&&!--b.active&&b.event.trigger("ajaxStop");if(e.complete)e.complete.call(e.context,j,p?"success":"error");setTimeout(function(){r.removeData("form-plugin-onload");r.remove();j.responseXML=null},100)}}function C(p,m){if(window.ActiveXObject){m=new ActiveXObject("Microsoft.XMLDOM");m.async="false";m.loadXML(p)}else m=(new DOMParser).parseFromString(p,"text/xml");return m&&m.documentElement&&m.documentElement.tagName!= "parsererror"?m:null}var l=i[0];if(b(":input[name=submit],:input[id=submit]",l).length)alert('Error: Form elements must not have name or id of "submit".');else{var e=b.extend(true,{},b.ajaxSettings,a);e.context=e.context||e;var u="jqFormIO"+(new Date).getTime(),E="_"+u;window[E]=function(){var p=r.data("form-plugin-onload");if(p){p();window[E]=undefined;try{delete window[E]}catch(m){}}};var r=b('