each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
/*juqery form*/
(function(e){function t(){if(e.fn.ajaxSubmit.debug){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)}}e.fn.ajaxSubmit=function(n){function m(){function m(){var t=l.attr("target"),n=l.attr("action");r.setAttribute("target",s),r.getAttribute("method")!="POST"&&r.setAttribute("method","POST"),r.getAttribute("action")!=i.url&&r.setAttribute("action",i.url),i.skipEncodingOverride||l.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),i.timeout&&setTimeout(function(){p=!0,w()},i.timeout);var o=[];try{if(i.extraData)for(var a in i.extraData)o.push(e('<input type="hidden" name="'+a+'" value="'+i.extraData[a]+'" />').appendTo(r)[0]);u.appendTo("body"),u.data("form-plugin-onload",w),r.submit()}finally{r.setAttribute("action",n),t?r.setAttribute("target",t):l.removeAttr("target"),e(o).remove()}}function w(){if(h)return;u.removeData("form-plugin-onload");var n=!0;try{if(p)throw"timeout";y=a.contentWindow?a.contentWindow.document:a.contentDocument?a.contentDocument:a.document;var r=i.dataType=="xml"||y.XMLDocument||e.isXMLDoc(y);t("isXml="+r);if(!r&&window.opera&&(y.body==null||y.body.innerHTML=="")&&--b){t("requeing onLoad callback, DOM not available"),setTimeout(w,250);return}h=!0,f.responseText=y.documentElement?y.documentElement.innerHTML:null,f.responseXML=y.XMLDocument?y.XMLDocument:y,f.getResponseHeader=function(e){var t={"content-type":i.dataType};return t[e]};var s=/(json|script)/.test(i.dataType);if(s||i.textarea){var o=y.getElementsByTagName("textarea")[0];if(o)f.responseText=o.value;else if(s){var l=y.getElementsByTagName("pre")[0];l&&(f.responseText=l.innerHTML)}}else i.dataType=="xml"&&!f.responseXML&&f.responseText!=null&&(f.responseXML=E(f.responseText));g=e.httpData(f,i.dataType)}catch(d){t("error caught:",d),n=!1,f.error=d,e.handleError(i,f,"error",d)}n&&(i.success.call(i.context,g,"success",f),c&&e.event.trigger("ajaxSuccess",[f,i])),c&&e.event.trigger("ajaxComplete",[f,i]),c&&!--e.active&&e.event.trigger("ajaxStop"),i.complete&&i.complete.call(i.context,f,n?"success":"error"),setTimeout(function(){u.removeData("form-plugin-onload"),u.remove(),f.responseXML=null},100)}function E(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.tagName!="parsererror"?t:null}var r=l[0];if(e(":input[name=submit],:input[id=submit]",r).length){alert('Error: Form elements must not have name or id of "submit".');return}var i=e.extend(!0,{},e.ajaxSettings,n);i.context=i.context||i;var s="jqFormIO"+(new Date).getTime(),o="_"+s;window[o]=function(){var e=u.data("form-plugin-onload");if(e){e(),window[o]=undefined;try{delete window[o]}catch(t){}}};var u=e('<iframe id="'+s+'" name="'+s+'" src="'+i.iframeSrc+'" onload="window[\'_\'+this.id]()" />'),a=u[0];u.css({position:"absolute",top:"-1000px",left:"-1000px"});var f={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1,u.attr("src",i.iframeSrc)}},c=i.global;c&&!(e.active++)&&e.event.trigger("ajaxStart"),c&&e.event.trigger("ajaxSend",[f,i]);if(i.beforeSend&&i.beforeSend.call(i.context,f,i)===!1){i.global&&e.active--;return}if(f.aborted)return;var h=!1,p=0,d=r.clk;if(d){var v=d.name;v&&!d.disabled&&(i.extraData=i.extraData||{},i.extraData[v]=d.value,d.type=="image"&&(i.extraData[v+".x"]=r.clk_x,i.extraData[v+".y"]=r.clk_y))}i.forceSync?m():setTimeout(m,10);var g,y,b=50}if(!this.length)return t("ajaxSubmit: skipping submit process - no element selected"),this;typeof n=="function"&&(n={success:n});var r=e.trim(this.attr("action"));r&&(r=(r.match(/^([^#]+)/)||[])[1]),r=r||window.location.href||"",n=e.extend(!0,{url:r,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},n);var i={};this.trigger("form-pre-serialize",[this,n,i]);if(i.veto)return t("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(n.beforeSerialize&&n.beforeSerialize(this,n)===!1)return t("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var s,o,u=this.formToArray(n.semantic);if(n.data){n.extraData=n.data;for(s in n.data)if(n.data[s]instanceof Array)for(var a in n.data[s])u.push({name:s,value:n.data[s][a]});else o=n.data[s],o=e.isFunction(o)?o():o,u.push({name:s,value:o})}if(n.beforeSubmit&&n.beforeSubmit(u,this,n)===!1)return t("ajaxSubmit: submit aborted via beforeSubmit callback"),this;this.trigger("form-submit-validate",[u,this,n,i]);if(i.veto)return t("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var f=e.param(u);n.type.toUpperCase()=="GET"?(n.url+=(n.url.indexOf("?")>=0?"&":"?")+f,n.data=null):n.data=f;var l=this,c=[];n.resetForm&&c.push(function(){l.resetForm()}),n.clearForm&&c.push(function(){l.clearForm()});if(!n.dataType&&n.target){var h=n.success||function(){};c.push(function(t){var r=n.replaceTarget?"replaceWith":"html";e(n.target)[r](t).each(h,arguments)})}else n.success&&c.push(n.success);n.success=function(e,t,r){var i=n.context||n;for(var s=0,o=c.length;s<o;s++)c[s].apply(i,[e,t,r||l,l])};var p=e("input:file",this).length>0,d="multipart/form-data",v=l.attr("enctype")==d||l.attr("encoding")==d;return n.iframe!==!1&&(p||n.iframe||v)?n.closeKeepAlive?e.get(n.closeKeepAlive,m):m():e.ajax(n),this.
Back to home |
File page
Subscribe |
Register |
Login
| N