]> jfr.im git - irc/h9k/magirc.git/commitdiff
Update jQuery cookie and form plugins
authorHal9000 <redacted>
Fri, 31 Aug 2012 18:52:11 +0000 (20:52 +0200)
committerHal9000 <redacted>
Fri, 31 Aug 2012 18:52:11 +0000 (20:52 +0200)
js/jquery.cookie.js
js/jquery.form.js

index b2f61d450b2650e9d0da7a303eb5bcbf55cba182..0fca6bd4dfbcc951dfd6db0834f569111f2801ff 100644 (file)
@@ -1 +1 @@
-(function(a){a.cookie=function(b,c,d){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(c))||c===null||c===undefined)){d=a.extend({},d);if(c===null||c===undefined)d.expires=-1;if(typeof d.expires=="number"){var e=d.expires,f=d.expires=new Date;f.setDate(f.getDate()+e)}return c=String(c),document.cookie=[encodeURIComponent(b),"=",d.raw?c:encodeURIComponent(c),d.expires?"; expires="+d.expires.toUTCString():"",d.path?"; path="+d.path:"",d.domain?"; domain="+d.domain:"",d.secure?"; secure":""].join("")}d=c||{};var g=d.raw?function(a){return a}:decodeURIComponent,h=document.cookie.split("; ");for(var i=0,j;j=h[i]&&h[i].split("=");i++)if(g(j[0])===b)return g(j[1]||"");return null}})(jQuery)
\ No newline at end of file
+(function(e,t,n){function i(e){return e}function s(e){return decodeURIComponent(e.replace(r," "))}var r=/\+/g,o=e.cookie=function(r,u,a){if(u!==n){a=e.extend({},o.defaults,a),u===null&&(a.expires=-1);if(typeof a.expires=="number"){var f=a.expires,l=a.expires=new Date;l.setDate(l.getDate()+f)}return u=o.json?JSON.stringify(u):String(u),t.cookie=[encodeURIComponent(r),"=",o.raw?u:encodeURIComponent(u),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+a.domain:"",a.secure?"; secure":""].join("")}var c=o.raw?i:s,h=t.cookie.split("; ");for(var p=0,d;d=h[p]&&h[p].split("=");p++)if(c(d.shift())===r){var v=c(d.join("="));return o.json?JSON.parse(v):v}return null};o.defaults={},e.removeCookie=function(t,n){return e.cookie(t,n)!==null?(e.cookie(t,null,n),!0):!1}})(jQuery,document)
\ No newline at end of file
index bb4fc585553e5aefca22b5eeedc54d0632845956..9ac3a2b8d544b78e0770e42bcd583c12c4126a25 100644 (file)
@@ -1 +1 @@
-(function(a){function c(b){var c=b.data;b.isDefaultPrevented()||(b.preventDefault(),a(this).ajaxSubmit(c))}function d(b){var c=b.target,d=a(c);if(!d.is(":submit,input:image")){var e=d.closest(":submit");if(e.length===0)return;c=e[0]}var f=this;f.clk=c;if(c.type=="image")if(b.offsetX!==undefined)f.clk_x=b.offsetX,f.clk_y=b.offsetY;else if(typeof a.fn.offset=="function"){var g=d.offset();f.clk_x=b.pageX-g.left,f.clk_y=b.pageY-g.top}else f.clk_x=b.pageX-c.offsetLeft,f.clk_y=b.pageY-c.offsetTop;setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)}function e(){if(!a.fn.ajaxSubmit.debug)return;var b="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(b):window.opera&&window.opera.postError&&window.opera.postError(b)}"use strict";var b={};b.fileapi=a("<input type='file'/>").get(0).files!==undefined,b.formdata=window.FormData!==undefined,a.fn.ajaxSubmit=function(c){function x(b){var d=new FormData;for(var e=0;e<b.length;e++)d.append(b[e].name,b[e].value);if(c.extraData)for(var f in c.extraData)c.extraData.hasOwnProperty(f)&&d.append(f,c.extraData[f]);c.data=null;var g=a.extend(!0,{},a.ajaxSettings,c,{contentType:!1,processData:!1,cache:!1,type:"POST"});c.uploadProgress&&(g.xhr=function(){var a=jQuery.ajaxSettings.xhr();return a.upload&&(a.upload.onprogress=function(a){var b=0,d=a.loaded||a.position,e=a.total;a.lengthComputable&&(b=Math.ceil(d/e*100)),c.uploadProgress(a,d,e,b)}),a}),g.data=null;var h=g.beforeSend;g.beforeSend=function(a,b){b.data=d,h&&h.call(b,a,c)},a.ajax(g)}function y(b){function x(a){var b=a.contentWindow?a.contentWindow.document:a.contentDocument?a.contentDocument:a.document;return b}function A(){function g(){try{var a=x(o).readyState;e("state = "+a),a&&a.toLowerCase()=="uninitialized"&&setTimeout(g,50)}catch(b){e("Server abort: ",b," (",b.name,")"),F(w),t&&clearTimeout(t),t=undefined}}var b=h.attr("target"),c=h.attr("action");f.setAttribute("target",m),d||f.setAttribute("method","POST"),c!=j.url&&f.setAttribute("action",j.url),!j.skipEncodingOverride&&(!d||/post/i.test(d))&&h.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),j.timeout&&(t=setTimeout(function(){s=!0,F(v)},j.timeout));var i=[];try{if(j.extraData)for(var k in j.extraData)j.extraData.hasOwnProperty(k)&&i.push(a('<input type="hidden" name="'+k+'">').attr("value",j.extraData[k]).appendTo(f)[0]);j.iframeTarget||(n.appendTo("body"),o.attachEvent?o.attachEvent("onload",F):o.addEventListener("load",F,!1)),setTimeout(g,15),f.submit()}finally{f.setAttribute("action",c),b?f.setAttribute("target",b):h.removeAttr("target"),a(i).remove()}}function F(b){if(p.aborted||E)return;try{C=x(o)}catch(c){e("cannot access response document: ",c),b=w}if(b===v&&p){p.abort("timeout");return}if(b==w&&p){p.abort("server abort");return}if(!C||C.location.href==j.iframeSrc)if(!s)return;o.detachEvent?o.detachEvent("onload",F):o.removeEventListener("load",F,!1);var d="success",f;try{if(s)throw"timeout";var g=j.dataType=="xml"||C.XMLDocument||a.isXMLDoc(C);e("isXml="+g);if(!g&&window.opera&&(C.body===null||!C.body.innerHTML)&&--D){e("requeing onLoad callback, DOM not available"),setTimeout(F,250);return}var h=C.body?C.body:C.documentElement;p.responseText=h?h.innerHTML:null,p.responseXML=C.XMLDocument?C.XMLDocument:C,g&&(j.dataType="xml"),p.getResponseHeader=function(a){var b={"content-type":j.dataType};return b[a]},h&&(p.status=Number(h.getAttribute("status"))||p.status,p.statusText=h.getAttribute("statusText")||p.statusText);var i=(j.dataType||"").toLowerCase(),k=/(json|script|text)/.test(i);if(k||j.textarea){var m=C.getElementsByTagName("textarea")[0];if(m)p.responseText=m.value,p.status=Number(m.getAttribute("status"))||p.status,p.statusText=m.getAttribute("statusText")||p.statusText;else if(k){var q=C.getElementsByTagName("pre")[0],r=C.getElementsByTagName("body")[0];q?p.responseText=q.textContent?q.textContent:q.innerText:r&&(p.responseText=r.textContent?r.textContent:r.innerText)}}else i=="xml"&&!p.responseXML&&p.responseText&&(p.responseXML=G(p.responseText));try{B=I(p,i,j)}catch(b){d="parsererror",p.error=f=b||d}}catch(b){e("error caught: ",b),d="error",p.error=f=b||d}p.aborted&&(e("upload aborted"),d=null),p.status&&(d=p.status>=200&&p.status<300||p.status===304?"success":"error"),d==="success"?(j.success&&j.success.call(j.context,B,"success",p),l&&a.event.trigger("ajaxSuccess",[p,j])):d&&(f===undefined&&(f=p.statusText),j.error&&j.error.call(j.context,p,d,f),l&&a.event.trigger("ajaxError",[p,j,f])),l&&a.event.trigger("ajaxComplete",[p,j]),l&&!--a.active&&a.event.trigger("ajaxStop"),j.complete&&j.complete.call(j.context,p,d),E=!0,j.timeout&&clearTimeout(t),setTimeout(function(){j.iframeTarget||n.remove(),p.responseXML=null},100)}var f=h[0],g,i,j,l,m,n,o,p,q,r,s,t,u=!!a.fn.prop;if(a(":input[name=submit],:input[id=submit]",f).length){alert('Error: Form elements must not have name or id of "submit".');return}if(b)for(i=0;i<k.length;i++)g=a(k[i]),u?g.prop("disabled",!1):g.removeAttr("disabled");j=a.extend(!0,{},a.ajaxSettings,c),j.context=j.context||j,m="jqFormIO"+(new Date).getTime(),j.iframeTarget?(n=a(j.iframeTarget),r=n.attr("name"),r?m=r:n.attr("name",m)):(n=a('<iframe name="'+m+'" src="'+j.iframeSrc+'" />'),n.css({position:"absolute",top:"-1000px",left:"-1000px"})),o=n[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c=b==="timeout"?"timeout":"aborted";e("aborting upload... "+c),this.aborted=1,n.attr("src",j.iframeSrc),p.error=c,j.error&&j.error.call(j.context,p,c,b),l&&a.event.trigger("ajaxError",[p,j,c]),j.complete&&j.complete.call(j.context,p,c)}},l=j.global,l&&0===a.active++&&a.event.trigger("ajaxStart"),l&&a.event.trigger("ajaxSend",[p,j]);if(j.beforeSend&&j.beforeSend.call(j.context,p,j)===!1){j.global&&a.active--;return}if(p.aborted)return;q=f.clk,q&&(r=q.name,r&&!q.disabled&&(j.extraData=j.extraData||{},j.extraData[r]=q.value,q.type=="image"&&(j.extraData[r+".x"]=f.clk_x,j.extraData[r+".y"]=f.clk_y)));var v=1,w=2,y=a("meta[name=csrf-token]").attr("content"),z=a("meta[name=csrf-param]").attr("content");z&&y&&(j.extraData=j.extraData||{},j.extraData[z]=y),j.forceSync?A():setTimeout(A,10);var B,C,D=50,E,G=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&b.documentElement.nodeName!="parsererror"?b:null},H=a.parseJSON||function(a){return window.eval("("+a+")")},I=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f=c==="xml"||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&g.documentElement.nodeName==="parsererror"&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),typeof g=="string"&&(c==="json"||!c&&e.indexOf("json")>=0?g=H(g):(c==="script"||!c&&e.indexOf("javascript")>=0)&&a.globalEval(g)),g}}if(!this.length)return e("ajaxSubmit: skipping submit process - no element selected"),this;var d,f,g,h=this;typeof c=="function"&&(c={success:c}),d=this.attr("method"),f=this.attr("action"),g=typeof f=="string"?a.trim(f):"",g=g||window.location.href||"",g&&(g=(g.match(/^([^#]+)/)||[])[1]),c=a.extend(!0,{url:g,success:a.ajaxSettings.success,type:d||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},c);var i={};this.trigger("form-pre-serialize",[this,c,i]);if(i.veto)return e("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(c.beforeSerialize&&c.beforeSerialize(this,c)===!1)return e("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var j=c.traditional;j===undefined&&(j=a.ajaxSettings.traditional);var k=[],l,m=this.formToArray(c.semantic,k);c.data&&(c.extraData=c.data,l=a.param(c.data,j));if(c.beforeSubmit&&c.beforeSubmit(m,this,c)===!1)return e("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[m,this,c,i]);if(i.veto)return e("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var n=a.param(m,j);l&&(n=n?n+"&"+l:l),c.type.toUpperCase()=="GET"?(c.url+=(c.url.indexOf("?")>=0?"&":"?")+n,c.data=null):c.data=n;var o=[];c.resetForm&&o.push(function(){h.resetForm()}),c.clearForm&&o.push(function(){h.clearForm(c.includeHidden)});if(!c.dataType&&c.target){var p=c.success||function(){};o.push(function(b){var d=c.replaceTarget?"replaceWith":"html";a(c.target)[d](b).each(p,arguments)})}else c.success&&o.push(c.success);c.success=function(a,b,d){var e=c.context||c;for(var f=0,g=o.length;f<g;f++)o[f].apply(e,[a,b,d||h,h])};var q=a("input:file:enabled[value]",this),r=q.length>0,s="multipart/form-data",t=h.attr("enctype")==s||h.attr("encoding")==s,u=b.fileapi&&b.formdata;e("fileAPI :"+u);var v=(r||t)&&!u;c.iframe!==!1&&(c.iframe||v)?c.closeKeepAlive?a.get(c.closeKeepAlive,function(){y(m)}):y(m):(r||t)&&u?x(m):a.ajax(c);for(var w=0;w<k.length;w++)k[w]=null;return this.trigger("form-submit-notify",[this,c]),this},a.fn.ajaxForm=function(b){b=b||{},b.delegation=b.delegation&&a.isFunction(a.fn.on);if(!b.delegation&&this.length===0){var f={s:this.selector,c:this.context};return!a.isReady&&f.s?(e("DOM not ready, queuing ajaxForm"),a(function(){a(f.s,f.c).ajaxForm(b)}),this):(e("terminating; zero elements found by selector"+(a.isReady?"":" (DOM not ready)")),this)}return b.delegation?(a(document).off("submit.form-plugin",this.selector,c).off("click.form-plugin",this.selector,d).on("submit.form-plugin",this.selector,b,c).on("click.form-plugin",this.selector,b,d),this):this.ajaxFormUnbind().bind("submit.form-plugin",b,c).bind("click.form-plugin",b,d)},a.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},a.fn.formToArray=function(c,d){var e=[];if(this.length===0)return e;var f=this[0],g=c?f.getElementsByTagName("*"):f.elements;if(!g)return e;var h,i,j,k,l,m,n;for(h=0,m=g.length;h<m;h++){l=g[h],j=l.name;if(!j)continue;if(c&&f.clk&&l.type=="image"){!l.disabled&&f.clk==l&&(e.push({name:j,value:a(l).val(),type:l.type}),e.push({name:j+".x",value:f.clk_x},{name:j+".y",value:f.clk_y}));continue}k=a.fieldValue(l,!0);if(k&&k.constructor==Array){d&&d.push(l);for(i=0,n=k.length;i<n;i++)e.push({name:j,value:k[i]})}else if(b.fileapi&&l.type=="file"&&!l.disabled){d&&d.push(l);var o=l.files;if(o.length)for(i=0;i<o.length;i++)e.push({name:j,value:o[i],type:l.type});else e.push({name:j,value:"",type:l.type})}else k!==null&&typeof k!="undefined"&&(d&&d.push(l),e.push({name:j,value:k,type:l.type,required:l.required}))}if(!c&&f.clk){var p=a(f.clk),q=p[0];j=q.name,j&&!q.disabled&&q.type=="image"&&(e.push({name:j,value:p.val()}),e.push({name:j+".x",value:f.clk_x},{name:j+".y",value:f.clk_y}))}return e},a.fn.formSerialize=function(b){return a.param(this.formToArray(b))},a.fn.fieldSerialize=function(b){var c=[];return this.each(function(){var d=this.name;if(!d)return;var e=a.fieldValue(this,b);if(e&&e.constructor==Array)for(var f=0,g=e.length;f<g;f++)c.push({name:d,value:e[f]});else e!==null&&typeof e!="undefined"&&c.push({name:this.name,value:e})}),a.param(c)},a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;d<e;d++){var f=this[d],g=a.fieldValue(f,b);if(g===null||typeof g=="undefined"||g.constructor==Array&&!g.length)continue;g.constructor==Array?a.merge(c,g):c.push(g)}return c},a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();c===undefined&&(c=!0);if(c&&(!d||b.disabled||e=="reset"||e=="button"||(e=="checkbox"||e=="radio")&&!b.checked||(e=="submit"||e=="image")&&b.form&&b.form.clk!=b||f=="select"&&b.selectedIndex==-1))return null;if(f=="select"){var g=b.selectedIndex;if(g<0)return null;var h=[],i=b.options,j=e=="select-one",k=j?g+1:i.length;for(var l=j?g:0;l<k;l++){var m=i[l];if(m.selected){var n=m.value;n||(n=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value);if(j)return n;h.push(n)}}return h}return a(b).val()},a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})},a.fn.clearFields=a.fn.clearInputs=function(b){var c=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var d=this.type,e=this.tagName.toLowerCase();c.test(d)||e=="textarea"?this.value="":d=="checkbox"||d=="radio"?this.checked=!1:e=="select"?this.selectedIndex=-1:b&&(b===!0&&/hidden/.test(d)||typeof b=="string"&&a(this).is(b))&&(this.value="")})},a.fn.resetForm=function(){return this.each(function(){(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)&&this.reset()})},a.fn.enable=function(a){return a===undefined&&(a=!0),this.each(function(){this.disabled=!a})},a.fn.selected=function(b){return b===undefined&&(b=!0),this.each(function(){var c=this.type;if(c=="checkbox"||c=="radio")this.checked=b;else if(this.tagName.toLowerCase()=="option"){var d=a(this).parent("select");b&&d[0]&&d[0].type=="select-one"&&d.find("option").selected(!1),this.selected=b}})},a.fn.ajaxSubmit.debug=!1})(jQuery)
\ No newline at end of file
+(function(e){"use strict";function n(t){var n=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(this).ajaxSubmit(n))}function r(t){var n=t.target,r=e(n);if(!r.is(":submit,input:image")){var i=r.closest(":submit");if(i.length===0)return;n=i[0]}var s=this;s.clk=n;if(n.type=="image")if(t.offsetX!==undefined)s.clk_x=t.offsetX,s.clk_y=t.offsetY;else if(typeof e.fn.offset=="function"){var o=r.offset();s.clk_x=t.pageX-o.left,s.clk_y=t.pageY-o.top}else s.clk_x=t.pageX-n.offsetLeft,s.clk_y=t.pageY-n.offsetTop;setTimeout(function(){s.clk=s.clk_x=s.clk_y=null},100)}function i(){if(!e.fn.ajaxSubmit.debug)return;var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}var t={};t.fileapi=e("<input type='file'/>").get(0).files!==undefined,t.formdata=window.FormData!==undefined,e.fn.ajaxSubmit=function(n){function x(t){var r=new FormData;for(var i=0;i<t.length;i++)r.append(t[i].name,t[i].value);if(n.extraData)for(var s in n.extraData)n.extraData.hasOwnProperty(s)&&r.append(s,n.extraData[s]);n.data=null;var o=e.extend(!0,{},e.ajaxSettings,n,{contentType:!1,processData:!1,cache:!1,type:"POST"});n.uploadProgress&&(o.xhr=function(){var e=jQuery.ajaxSettings.xhr();return e.upload&&(e.upload.onprogress=function(e){var t=0,r=e.loaded||e.position,i=e.total;e.lengthComputable&&(t=Math.ceil(r/i*100)),n.uploadProgress(e,r,i,t)}),e}),o.data=null;var u=o.beforeSend;o.beforeSend=function(e,t){t.data=r,u&&u.call(this,e,t)},e.ajax(o)}function T(t){function x(e){var t=e.contentWindow?e.contentWindow.document:e.contentDocument?e.contentDocument:e.document;return t}function C(){function o(){try{var e=x(d).readyState;i("state = "+e),e&&e.toLowerCase()=="uninitialized"&&setTimeout(o,50)}catch(t){i("Server abort: ",t," (",t.name,")"),M(S),b&&clearTimeout(b),b=undefined}}var t=u.attr("target"),n=u.attr("action");s.setAttribute("target",h),r||s.setAttribute("method","POST"),n!=f.url&&s.setAttribute("action",f.url),!f.skipEncodingOverride&&(!r||/post/i.test(r))&&u.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),f.timeout&&(b=setTimeout(function(){y=!0,M(E)},f.timeout));var a=[];try{if(f.extraData)for(var l in f.extraData)f.extraData.hasOwnProperty(l)&&(e.isPlainObject(f.extraData[l])&&f.extraData[l].hasOwnProperty("name")&&f.extraData[l].hasOwnProperty("value")?a.push(e('<input type="hidden" name="'+f.extraData[l].name+'">').attr("value",f.extraData[l].value).appendTo(s)[0]):a.push(e('<input type="hidden" name="'+l+'">').attr("value",f.extraData[l]).appendTo(s)[0]));f.iframeTarget||(p.appendTo("body"),d.attachEvent?d.attachEvent("onload",M):d.addEventListener("load",M,!1)),setTimeout(o,15),s.submit()}finally{s.setAttribute("action",n),t?s.setAttribute("target",t):u.removeAttr("target"),e(a).remove()}}function M(t){if(v.aborted||O)return;try{L=x(d)}catch(n){i("cannot access response document: ",n),t=S}if(t===E&&v){v.abort("timeout");return}if(t==S&&v){v.abort("server abort");return}if(!L||L.location.href==f.iframeSrc)if(!y)return;d.detachEvent?d.detachEvent("onload",M):d.removeEventListener("load",M,!1);var r="success",s;try{if(y)throw"timeout";var o=f.dataType=="xml"||L.XMLDocument||e.isXMLDoc(L);i("isXml="+o);if(!o&&window.opera&&(L.body===null||!L.body.innerHTML)&&--A){i("requeing onLoad callback, DOM not available"),setTimeout(M,250);return}var u=L.body?L.body:L.documentElement;v.responseText=u?u.innerHTML:null,v.responseXML=L.XMLDocument?L.XMLDocument:L,o&&(f.dataType="xml"),v.getResponseHeader=function(e){var t={"content-type":f.dataType};return t[e]},u&&(v.status=Number(u.getAttribute("status"))||v.status,v.statusText=u.getAttribute("statusText")||v.statusText);var a=(f.dataType||"").toLowerCase(),l=/(json|script|text)/.test(a);if(l||f.textarea){var h=L.getElementsByTagName("textarea")[0];if(h)v.responseText=h.value,v.status=Number(h.getAttribute("status"))||v.status,v.statusText=h.getAttribute("statusText")||v.statusText;else if(l){var m=L.getElementsByTagName("pre")[0],g=L.getElementsByTagName("body")[0];m?v.responseText=m.textContent?m.textContent:m.innerText:g&&(v.responseText=g.textContent?g.textContent:g.innerText)}}else a=="xml"&&!v.responseXML&&v.responseText&&(v.responseXML=_(v.responseText));try{k=P(v,a,f)}catch(t){r="parsererror",v.error=s=t||r}}catch(t){i("error caught: ",t),r="error",v.error=s=t||r}v.aborted&&(i("upload aborted"),r=null),v.status&&(r=v.status>=200&&v.status<300||v.status===304?"success":"error"),r==="success"?(f.success&&f.success.call(f.context,k,"success",v),c&&e.event.trigger("ajaxSuccess",[v,f])):r&&(s===undefined&&(s=v.statusText),f.error&&f.error.call(f.context,v,r,s),c&&e.event.trigger("ajaxError",[v,f,s])),c&&e.event.trigger("ajaxComplete",[v,f]),c&&!--e.active&&e.event.trigger("ajaxStop"),f.complete&&f.complete.call(f.context,v,r),O=!0,f.timeout&&clearTimeout(b),setTimeout(function(){f.iframeTarget||p.remove(),v.responseXML=null},100)}var s=u[0],o,a,f,c,h,p,d,v,m,g,y,b,w=!!e.fn.prop;if(e(":input[name=submit],:input[id=submit]",s).length){alert('Error: Form elements must not have name or id of "submit".');return}if(t)for(a=0;a<l.length;a++)o=e(l[a]),w?o.prop("disabled",!1):o.removeAttr("disabled");f=e.extend(!0,{},e.ajaxSettings,n),f.context=f.context||f,h="jqFormIO"+(new Date).getTime(),f.iframeTarget?(p=e(f.iframeTarget),g=p.attr("name"),g?h=g:p.attr("name",h)):(p=e('<iframe name="'+h+'" src="'+f.iframeSrc+'" />'),p.css({position:"absolute",top:"-1000px",left:"-1000px"})),d=p[0],v={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var n=t==="timeout"?"timeout":"aborted";i("aborting upload... "+n),this.aborted=1;if(d.contentWindow.document.execCommand)try{d.contentWindow.document.execCommand("Stop")}catch(r){}p.attr("src",f.iframeSrc),v.error=n,f.error&&f.error.call(f.context,v,n,t),c&&e.event.trigger("ajaxError",[v,f,n]),f.complete&&f.complete.call(f.context,v,n)}},c=f.global,c&&0===e.active++&&e.event.trigger("ajaxStart"),c&&e.event.trigger("ajaxSend",[v,f]);if(f.beforeSend&&f.beforeSend.call(f.context,v,f)===!1){f.global&&e.active--;return}if(v.aborted)return;m=s.clk,m&&(g=m.name,g&&!m.disabled&&(f.extraData=f.extraData||{},f.extraData[g]=m.value,m.type=="image"&&(f.extraData[g+".x"]=s.clk_x,f.extraData[g+".y"]=s.clk_y)));var E=1,S=2,T=e("meta[name=csrf-token]").attr("content"),N=e("meta[name=csrf-param]").attr("content");N&&T&&(f.extraData=f.extraData||{},f.extraData[N]=T),f.forceSync?C():setTimeout(C,10);var k,L,A=50,O,_=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&t.documentElement.nodeName!="parsererror"?t:null},D=e.parseJSON||function(e){return window.eval("("+e+")")},P=function(t,n,r){var i=t.getResponseHeader("content-type")||"",s=n==="xml"||!n&&i.indexOf("xml")>=0,o=s?t.responseXML:t.responseText;return s&&o.documentElement.nodeName==="parsererror"&&e.error&&e.error("parsererror"),r&&r.dataFilter&&(o=r.dataFilter(o,n)),typeof o=="string"&&(n==="json"||!n&&i.indexOf("json")>=0?o=D(o):(n==="script"||!n&&i.indexOf("javascript")>=0)&&e.globalEval(o)),o}}if(!this.length)return i("ajaxSubmit: skipping submit process - no element selected"),this;var r,s,o,u=this;typeof n=="function"&&(n={success:n}),r=this.attr("method"),s=this.attr("action"),o=typeof s=="string"?e.trim(s):"",o=o||window.location.href||"",o&&(o=(o.match(/^([^#]+)/)||[])[1]),n=e.extend(!0,{url:o,success:e.ajaxSettings.success,type:r||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},n);var a={};this.trigger("form-pre-serialize",[this,n,a]);if(a.veto)return i("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(n.beforeSerialize&&n.beforeSerialize(this,n)===!1)return i("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var f=n.traditional;f===undefined&&(f=e.ajaxSettings.traditional);var l=[],c,h=this.formToArray(n.semantic,l);n.data&&(n.extraData=n.data,c=e.param(n.data,f));if(n.beforeSubmit&&n.beforeSubmit(h,this,n)===!1)return i("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[h,this,n,a]);if(a.veto)return i("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var p=e.param(h,f);c&&(p=p?p+"&"+c:c),n.type.toUpperCase()=="GET"?(n.url+=(n.url.indexOf("?")>=0?"&":"?")+p,n.data=null):n.data=p;var d=[];n.resetForm&&d.push(function(){u.resetForm()}),n.clearForm&&d.push(function(){u.clearForm(n.includeHidden)});if(!n.dataType&&n.target){var v=n.success||function(){};d.push(function(t){var r=n.replaceTarget?"replaceWith":"html";e(n.target)[r](t).each(v,arguments)})}else n.success&&d.push(n.success);n.success=function(e,t,r){var i=n.context||this;for(var s=0,o=d.length;s<o;s++)d[s].apply(i,[e,t,r||u,u])};var m=e("input:file:enabled[value]",this),g=m.length>0,y="multipart/form-data",b=u.attr("enctype")==y||u.attr("encoding")==y,w=t.fileapi&&t.formdata;i("fileAPI :"+w);var E=(g||b)&&!w;n.iframe!==!1&&(n.iframe||E)?n.closeKeepAlive?e.get(n.closeKeepAlive,function(){T(h)}):T(h):(g||b)&&w?x(h):e.ajax(n);for(var S=0;S<l.length;S++)l[S]=null;return this.trigger("form-submit-notify",[this,n]),this},e.fn.ajaxForm=function(t){t=t||{},t.delegation=t.delegation&&e.isFunction(e.fn.on);if(!t.delegation&&this.length===0){var s={s:this.selector,c:this.context};return!e.isReady&&s.s?(i("DOM not ready, queuing ajaxForm"),e(function(){e(s.s,s.c).ajaxForm(t)}),this):(i("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return t.delegation?(e(document).off("submit.form-plugin",this.selector,n).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,t,n).on("click.form-plugin",this.selector,t,r),this):this.ajaxFormUnbind().bind("submit.form-plugin",t,n).bind("click.form-plugin",t,r)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(n,r){var i=[];if(this.length===0)return i;var s=this[0],o=n?s.getElementsByTagName("*"):s.elements;if(!o)return i;var u,a,f,l,c,h,p;for(u=0,h=o.length;u<h;u++){c=o[u],f=c.name;if(!f)continue;if(n&&s.clk&&c.type=="image"){!c.disabled&&s.clk==c&&(i.push({name:f,value:e(c).val(),type:c.type}),i.push({name:f+".x",value:s.clk_x},{name:f+".y",value:s.clk_y}));continue}l=e.fieldValue(c,!0);if(l&&l.constructor==Array){r&&r.push(c);for(a=0,p=l.length;a<p;a++)i.push({name:f,value:l[a]})}else if(t.fileapi&&c.type=="file"&&!c.disabled){r&&r.push(c);var d=c.files;if(d.length)for(a=0;a<d.length;a++)i.push({name:f,value:d[a],type:c.type});else i.push({name:f,value:"",type:c.type})}else l!==null&&typeof l!="undefined"&&(r&&r.push(c),i.push({name:f,value:l,type:c.type,required:c.required}))}if(!n&&s.clk){var v=e(s.clk),m=v[0];f=m.name,f&&!m.disabled&&m.type=="image"&&(i.push({name:f,value:v.val()}),i.push({name:f+".x",value:s.clk_x},{name:f+".y",value:s.clk_y}))}return i},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var n=[];return this.each(function(){var r=this.name;if(!r)return;var i=e.fieldValue(this,t);if(i&&i.constructor==Array)for(var s=0,o=i.length;s<o;s++)n.push({name:r,value:i[s]});else i!==null&&typeof i!="undefined"&&n.push({name:this.name,value:i})}),e.param(n)},e.fn.fieldValue=function(t){for(var n=[],r=0,i=this.length;r<i;r++){var s=this[r],o=e.fieldValue(s,t);if(o===null||typeof o=="undefined"||o.constructor==Array&&!o.length)continue;o.constructor==Array?e.merge(n,o):n.push(o)}return n},e.fieldValue=function(t,n){var r=t.name,i=t.type,s=t.tagName.toLowerCase();n===undefined&&(n=!0);if(n&&(!r||t.disabled||i=="reset"||i=="button"||(i=="checkbox"||i=="radio")&&!t.checked||(i=="submit"||i=="image")&&t.form&&t.form.clk!=t||s=="select"&&t.selectedIndex==-1))return null;if(s=="select"){var o=t.selectedIndex;if(o<0)return null;var u=[],a=t.options,f=i=="select-one",l=f?o+1:a.length;for(var c=f?o:0;c<l;c++){var h=a[c];if(h.selected){var p=h.value;p||(p=h.attributes&&h.attributes.value&&!h.attributes.value.specified?h.text:h.value);if(f)return p;u.push(p)}}return u}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var n=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var r=this.type,i=this.tagName.toLowerCase();n.test(r)||i=="textarea"?this.value="":r=="checkbox"||r=="radio"?this.checked=!1:i=="select"?this.selectedIndex=-1:t&&(t===!0&&/hidden/.test(r)||typeof t=="string"&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return e===undefined&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return t===undefined&&(t=!0),this.each(function(){var n=this.type;if(n=="checkbox"||n=="radio")this.checked=t;else if(this.tagName.toLowerCase()=="option"){var r=e(this).parent("select");t&&r[0]&&r[0].type=="select-one"&&r.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1})(jQuery)
\ No newline at end of file