- md5
- ec84a324feff538670b5a58ef8d864e0
- sha1
- 4e3562d94c5ca3cf0636ec736ccc7038a11600e9
- sha256
- cb00ad0e61ef4df3b2de353170abf6b9ade5ff19812787994abe791eef345655
!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t),t}:r(jQuery)}(function(e){!function(I){"use strict";var d=/\r?\n/g,g={},X=(g.fileapi=void 0!==I('<input type="file">').get(0).files,g.formdata=void 0!==window.FormData,!!I.fn.prop),H=Object.prototype.hasOwnProperty,N=document.createElement("form");function p(e){return"string"==typeof e.tagName?e.tagName.toLowerCase():""}function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),I(e.target).closest("form").ajaxSubmit(t))}function i(e){var t,r=I(e.target).closest("button,input"),a=r[0];!a||"submit"!==a.type&&"image"!==a.type||(t=a.form)&&("image"===(t.clk=a).type&&(void 0!==e.offsetX?(t.clk_x=e.offsetX,t.clk_y=e.offsetY):"function"==typeof I.fn.offset?(r=r.offset(),t.clk_x=e.pageX-r.left,t.clk_y=e.pageY-r.top):(t.clk_x=e.pageX-a.offsetLeft,t.clk_y=e.pageY-a.offsetTop)),setTimeout(function(){t.clk=t.clk_x=t.clk_y=null},100))}function R(){var e;I.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}I.fn.attr2=function(){var e;return X&&((e=this.prop.apply(this,arguments))&&e.jquery||"string"==typeof e)?e:this.attr.apply(this,arguments)},I.fn.ajaxSubmit=function(l,e,t,r){if(this.length){var O,q=this,e=("function"==typeof l?l={success:l}:"string"==typeof l||!1===l&&0<arguments.length?(l={url:l,data:e,dataType:t},"function"==typeof r&&(l.success=r)):void 0===l&&(l={}),O=l.method||l.type||this.attr2("method"),t=(t="string"==typeof(e=l.url||this.attr2("action"))?e.trim():"").split("#")[0]||window.location.href.split("#")[0],r=/(MSIE|Trident)/.test(navigator.userAgent||"")&&/^https/i.test(document.URL)?"javascript:false":"about:blank",l=I.extend(!0,{url:t,success:I.ajaxSettings.success,type:O||I.ajaxSettings.type,iframeSrc:r},l),{});if(this.trigger("form-pre-serialize",[this,l,e]),e.veto)R("ajaxSubmit: submit vetoed via form-pre-serialize trigger");else if(l.beforeSerialize&&!1===l.beforeSerialize(this,l))R("ajaxSubmit: submit aborted via beforeSerialize callback");else{var i=l.traditional,C=(void 0===i&&(i=I.ajaxSettings.traditional),[]),t=this.formToArray(l.semantic,C,l.filtering);if(l.data&&(r="function"==typeof l.data?l.data(t):l.data,l.extraData=r,u=I.param(r,i)),l.beforeSubmit&&!1===l.beforeSubmit(t,this,l))R("ajaxSubmit: submit aborted via beforeSubmit callback");else if(this.trigger("form-submit-validate",[t,this,l,e]),e.veto)R("ajaxSubmit: submit vetoed via form-submit-validate trigger");else{var s,n,a,r=I.param(t,i),c=(u&&(r=r?r+"&"+u:u),"GET"===l.type.toUpperCase()?(u=(e=l.url.indexOf("#"))<0?l.url:l.url.slice(0,e),l.url=u+(0<=u.indexOf("?")?"&":"?")+r+l.url.slice(u.length),l.data=null):l.data=r,[]);l.resetForm&&c.push(function(){q.resetForm()}),l.clearForm&&c.push(function(){q.clearForm(l.includeHidden)}),!l.dataType&&l.target?(s=l.success||function(){},c.push(function(e,t,r){var a=arguments,n=l.replaceTarget?"replaceWith":"html",o=I(l.target);"string"==typeof e?o[n](e):R("target: the response was parsed by jQuery, so it is not inserted"),o.each(function(){s.apply(this,a)})})):l.success&&(Array.isArray(l.success)?I.merge(c,l.success):c.push(l.success)),l.success=function(e,t,r){for(var a=l.context||this,n=0,o=c.length;n<o;n++)c[n].apply(a,[e,t,r||q,q])},l.error&&(n=l.error,l.error=function(e,t,r){var a=l.context||this;n.apply(a,[e,t,r,q])}),l.complete&&(a=l.complete,l.complete=function(e,t){var r=l.context||this;a.apply(r,[e,t,q])});var o,e=0<I("input[type=file]:enabled",this).filter(function(){return""!==I(this).val()}).length,u="multipart/form-data",r=q.attr("enctype")===u||q.attr("encoding")===u,u=g.fileapi&&g.formdata;R("fileAPI :"+u),!1!==l.iframe&&(l.iframe||(e||r)&&!u)?l.closeKeepAlive?I.get(l.closeKeepAlive,function(){o=d()}):o=d():o=(e||r)&&u?function(e){for(var r=new FormData,t=0;t<e.length;t++)r.append(e[t].name,e[t].value);if(l.extraData){var a=_(l.extraData);for(t=0;t<a.length;t++)r.append(a[t][0],a[t][1])}l.data=null;var n=I.extend(!0,{},I.ajaxSettings,l,{contentType:!1,processData:!1,cache:!1,type:O||"POST"});l.uploadProgress&&(n.xhr=function(){var e=I.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=0,r=e.loaded||e.position,a=e.total;e.lengthComputable&&(t=Math.ceil(r/a*100)),l.uploadProgress(e,r,a,t)},!1),e});n.data=null;var o=n.beforeSend;return n.beforeSend=function(e,t){l.formData?t.data=l.formData:t.data=r,o&&o.call(this,e,t)},I.ajax(n)}(t):I.ajax(l),q.removeData("jqxhr").data("jqxhr",o);for(var f=0;f<C.length;f++)C[f]=null;this.trigger("form-submit-notify",[this,l])}}}else R("ajaxSubmit: skipping submit process - no element selected");return this;function _(e){for(var t,e=I.param(e,i),r=e?e.split("&"):[],a=r.length,n=[],o=0;o<a;o++)r[o]=r[o].replace(/\+/g," "),t=r[o].split("="),n.push([decodeURIComponent(t[0]),decodeURIComponent(t[1])]);return n}function d(){var e,t,u,c,f,d,p,m,h,g=q[0],v=I.Deferred();for(v.abort=function(e){p.abort(e)},t=0;t<C.length;t++)e=I(C[t]),X?e.prop("disabled",!1):e.removeAttr("disabled");(u=I.extend(!0,{},I.ajaxSettings,l)).context=u.context||u;var y,x,r,a,n,o,i,b,T,j,S,w="jqFormIO"+(new Date).getTime(),k=g.ownerDocument,D=q.closest("body");function E(e,t){var r="timeout"===e?"timeout":"aborted";if(!p.aborted&&!h){R("aborting upload... "+r),p.aborted=1;try{d.contentWindow.document.execCommand&&d.contentWindow.document.execCommand("Stop")}catch(e){}f.attr("src",u.iframeSrc),p.error=r,u.error&&u.error.call(u.context,p,r,e),v.reject.apply(v,t),c&&I.event.trigger("ajaxError",[p,u,r]),A(r)}}function A(e){c&&I.event.trigger("ajaxComplete",[p,u]),c&&!--I.active&&I.event.trigger("ajaxStop"),u.complete&&u.complete.call(u.context,p,e),u.timeout&&clearTimeout(m),setTimeout(function(){u.iframeTarget?f.attr("src",u.iframeSrc):f.remove(),p.responseXML=null},100)}return u.iframeTarget?(a=(f=I(u.iframeTarget,k)).attr2("name"))?w=a:f.attr2("name",w):((d=k.createElement("iframe")).setAttribute("name",w),d.setAttribute("src",u.iframeSrc),(f=I(d)).css({position:"absolute",top:"-1000px",left:"-1000px"})),d=f[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){E(e,[p,"aborted",e])}},(c=u.global)&&0==I.active++&&I.event.trigger("ajaxStart"),c&&I.event.trigger("ajaxSend",[p,u]),u.beforeSend&&!1===u.beforeSend.call(u.context,p,u)?(u.global&&I.active--,v.reject()):p.aborted||((r=g.clk)&&(a=r.name)&&!r.disabled&&(u.extraData=u.extraData||{},u.extraData[a]=r.value,"image"===r.type)&&(u.extraData[a+".x"]=g.clk_x,u.extraData[a+".y"]=g.clk_y),y=1,x=2,r=I("meta[name=csrf-token]").attr("content"),a=I("meta[name=csrf-param]").attr("content"),n=!O||/post/i.test(O)||/post/i.test(q.attr2("method")),a&&r&&n&&(n=u.url,o=document.createElement("a"),i=document.createElement("a"),o.href=window.location.href,i.href=n,i.href=i.href,o.protocol+"//"+o.host==i.protocol+"//"+i.host)&&(u.extraData=u.extraData||{},u.extraData[a]=r),u.forceSync?s():setTimeout(s,10),j=50,S=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),e=n?e.responseXML:e.responseText;return n&&"parsererror"===e.documentElement.nodeName&&I.error&&I.error("parsererror"),"string"==typeof(e=r&&r.dataFilter?r.dataFilter(e,t):e)&&(("json"===t||!t)&&0<=a.indexOf("json")?e=JSON.parse(e):"script"===t&&I.globalEval(e)),e}),v;function F(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){R("cannot get iframe.contentWindow document: "+e)}if(!r)try{r=t.contentDocument||t.document}catch(e){R("cannot get iframe.contentDocument: "+e),r=t.document}return r}function L(e,t){N.setAttribute.call(g,e,t)}function s(){var e=q.attr2("target"),t=q.attr2("action"),r="multipart/form-data",a=q.attr("enctype")||q.attr("encoding")||r;L("target",w),O&&!/post/i.test(O)||L("method","POST"),t!==u.url&&L("action",u.url),u.skipEncodingOverride||O&&!/post/i.test(O)||(L("encoding",r),L("enctype",r)),u.timeout&&(m=setTimeout(function(){M(y)},u.timeout));var n=[];function o(e,t){var r=k.createElement("input");r.type="hidden",r.name=e,n.push(I(r).val(t).appendTo(g)[0])}try{if(u.extraData)for(var i in u.extraData)if(H.call(u.extraData,i))if(I.isPlainObject(u.extraData[i])&&H.call(u.extraData[i],"name")&&H.call(u.extraData[i],"value"))o(u.extraData[i].name,u.extraData[i].value);else for(var s={},l=(s[i]=u.extraData[i],_(s)),c=0;c<l.length;c++)o(l[c][0],l[c][1]);u.iframeTarget||f.appendTo(D),d.attachEvent?d.attachEvent("onload",M):d.addEventListener("load",M,!1),setTimeout(function e(){try{var t=F(d).readyState;R("state = "+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){R("Server abort: ",e," (",e.name,")"),M(x),m&&clearTimeout(m),m=void 0}},15);try{g.submit()}catch(e){N.submit.call(g)}}finally{"string"==typeof t?L("action",t):N.removeAttribute.call(g,"action"),L("enctype",a),e?L("target",e):N.removeAttribute.call(g,"target"),I(n).remove()}}function M(t){if(!p.aborted&&!h)if((T=F(d))||(R("cannot access response document"),t=x),t===y&&p)E("timeout",[p,"timeout"]);else if(t===x&&p)E("server abort",[p,"error","server abort"]);else if(T.location.href!==u.iframeSrc){d.detachEvent?d.detachEvent("onload",M):d.removeEventListener("load",M,!1);var r,t="success";try{var e="xml"===u.dataType||T.XMLDocument||I.isXMLDoc(T);if(R("isXml="+e),!e&&window.opera&&(null===T.body||!T.body.innerHTML)&&--j)return R("requeing onLoad callback, DOM not available"),void setTimeout(M,250);var a,n,o,i=T.body||T.documentElement,s=(p.responseText=i?i.innerHTML:null,p.responseXML=T.XMLDocument||T,e&&(u.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":u.dataType}[e.toLowerCase()]},i&&(p.status=Number(i.getAttribute("status"))||p.status,p.statusText=i.getAttribute("statusText")||p.statusText),(u.dataType||"").toLowerCase()),l=/(json|script|text)/.test(s);(l||u.textarea)&&((a=T.getElementsByTagName("textarea")[0])?(p.responseText=a.value,p.status=Number(a.getAttribute("status"))||p.status,p.statusText=a.getAttribute("statusText")||p.statusText):l&&(n=T.getElementsByTagName("pre")[0],o=T.getElementsByTagName("body")[0],n?p.responseText=n.textContent||n.innerText:o&&(p.responseText=o.textContent||o.innerText)));try{b=S(p,s,u)}catch(e){t="parsererror",p.error=r=e||t}}catch(e){R("error caught: ",e),t="error",p.error=r=e}p.aborted?R("upload aborted"):(p.status&&!(200<=p.status&&p.status<300||304===p.status)&&(t="error"),h=!0,"success"===t?(u.success.call(u.context,b,"success",p),v.resolve(p.responseText,"success",p),c&&I.event.trigger("ajaxSuccess",[p,u])):(void 0===r&&(r=p.statusText),u.error&&u.error.call(u.context,p,t,r),v.reject(p,"error",r),c&&I.event.trigger("ajaxError",[p,u,r])),A(t))}}}},I.fn.ajaxForm=function(e,t,r,a){var n;return("string"==typeof e||!1===e&&0<arguments.length)&&(e={url:e,data:t,dataType:r},"function"==typeof a)&&(e.success=a),(e=e||{}).delegation=e.delegation&&"function"==typeof I.fn.on,e.delegation||0!==this.length?e.delegation?(I(document).off("submit.form-plugin",this.selector,o).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,e,o).on("click.form-plugin",this.selector,e,i),this):(e.beforeFormUnbind&&e.beforeFormUnbind(this,e),this.ajaxFormUnbind().on("submit.form-plugin",e,o).on("click.form-plugin",e,i)):(n={s:this.selector,c:this.context},!I.isReady&&n.s?(R("DOM not ready, queuing ajaxForm"),I(function(){I(n.s,n.c).ajaxForm(e)})):R("terminating; zero elements found by selector"+(I.isReady?"":" (DOM not ready)")),this)},I.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},I.fn.formToArray=function(e,t,r){var a=[];if(0!==this.length){var n=this[0],o=this.attr("id"),i=(i=e||void 0===n.elements?n.getElementsByTagName("*"):function(t){var e=(e=window.HTMLFormElement&&window.HTMLFormElement.prototype)&&Object.getOwnPropertyDescriptor(e,"elements");try{return e.get.call(t)}catch(e){return t.elements}}(n))&&I.makeArray(i);if((i=o&&(e||/(Edge|Trident)\//.test(navigator.userAgent))&&(f=I(":input[form]").filter(function(){return this.getAttribute("form")===o}).get()).length?i.concat(f):i)&&i.length){for(var s,l,c,u,f,d,p=0,m=(i="function"==typeof r?I.map(i,r):i).length;p<m;p++)if((d=(c=i[p]).name)&&!c.disabled)if(e&&n.clk&&"image"===c.type)n.clk===c&&(a.push({name:d,value:I(c).val(),type:c.type}),a.push({name:d+".x",value:n.clk_x},{name:d+".y",value:n.clk_y}));else if((l=I.fieldValue(c,!0))&&l.constructor===Array)for(t&&t.push(c),s=0,u=l.length;s<u;s++)a.push({name:d,value:l[s]});else if(g.fileapi&&"file"===c.type){t&&t.push(c);var h=c.files;if(h.length)for(s=0;s<h.length;s++)a.push({name:d,value:h[s],type:c.type});else a.push({name:d,value:"",type:c.type})}else null!=l&&(t&&t.push(c),a.push({name:d,value:l,type:c.type,required:c.required}));!e&&n.clk&&(d=(r=(f=I(n.clk))[0]).name)&&!r.disabled&&"image"===r.type&&(a.push({name:d,value:f.val()}),a.push({name:d+".x",value:n.clk_x},{name:d+".y",value:n.clk_y}))}}return a},I.fn.formSerialize=function(e){return I.param(this.formToArray(e))},I.fn.fieldSerialize=function(n){var o=[];return this.each(function(){var e=this.name;if(e){var t=I.fieldValue(this,n);if(t&&t.constructor===Array)for(var r=0,a=t.length;r<a;r++)o.push({name:e,value:t[r]});else null!=t&&o.push({name:this.name,value:t})}}),I.param(o)},I.fn.fieldValue=function(e){for(var t=[],r=0,a=this.length;r<a;r++){var n=this[r],n=I.fieldValue(n,e);null==n||n.constructor===Array&&!n.length||(n.constructor===Array?I.merge(t,n):t.push(n))}return t},I.fieldValue=function(e,t){var r=e.name,a=e.type,n=p(e);if((t=void 0===t?!0:t)&&(!r||e.disabled||"reset"===a||"button"===a||("checkbox"===a||"radio"===a)&&!e.checked||("submit"===a||"image"===a)&&e.form&&e.form.clk!==e||"select"===n&&-1===e.selectedIndex))return null;if("select"!==n)return I(e).val().replace(d,"\r\n");t=e.selectedIndex;if(t<0)return null;for(var o=[],i=e.options,s="select-one"===a,l=s?t+1:i.length,c=s?t:0;c<l;c++){var u=i[c];if(u.selected&&!u.disabled){var f=(f=u.value)||(u.attributes&&u.attributes.value&&!u.attributes.value.specified?u.text:u.value);if(s)return f;o.push(f)}}return o},I.fn.clearForm=function(e){return this.each(function(){I("input,select,textarea",this).clearFields(e)})},I.fn.clearFields=I.fn.clearInputs=function(r){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var e=this.type,t=p(this);a.test(e)||"textarea"===t?this.value="":"checkbox"===e||"radio"===e?this.checked=!1:"select"===t?this.selectedIndex=-1:"file"===e?/MSIE/.test(navigator.userAgent)?I(this).replaceWith(I(this).clone(!0)):I(this).val(""):r&&(!0===r&&/hidden/.test(e)||"string"==typeof r&&I(this).is(r))&&(this.value="")})},I.fn.resetForm=function(){return this.each(function(){var t=I(this),e=p(this);switch(e){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var r=t.parents("select");return r.length&&r[0].multiple?"option"===e?this.selected=this.defaultSelected:t.find("option").resetForm():r.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":r=this.htmlFor&&this.ownerDocument.getElementById(this.htmlFor);return t.find("input,select,textarea").add(r).filter("input,select,textarea").resetForm(),!0;case"form":return"function"!=typeof this.reset&&("object"!=typeof this.reset||this.reset.nodeType)||this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},I.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},I.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var e=this.type;"checkbox"===e||"radio"===e?this.checked=t:"option"===p(this)&&(e=I(this).parent("select"),t&&e[0]&&"select-one"===e[0].type&&e.find("option").selected(!1),this.selected=t)})},I.fn.ajaxSubmit.debug=!1}(e)});
No other release has this exact content. See every version of this file.