From 3e220a138a40d2c1c25a8c8d1cbdb91b917efae7 Mon Sep 17 00:00:00 2001 From: renato <renato@rezo.net> Date: Thu, 30 Nov 2006 10:51:56 +0000 Subject: [PATCH] jquery library and its extension are now built by the template jquery.js.html; fix bug http://jquery.com/dev/bugs/bug/446/ --- .gitattributes | 5 +- dist/javascript/ajaxCallback.js | 58 +++ dist/javascript/form.js | 368 +++++++++++++++ dist/javascript/jquery-1.0.3-forms.pack.js | 1 - ...{jquery-1.0.3-forms.js => jquery-1.0.3.js} | 428 +----------------- dist/jquery.js.html | 4 +- 6 files changed, 433 insertions(+), 431 deletions(-) create mode 100644 dist/javascript/ajaxCallback.js create mode 100644 dist/javascript/form.js delete mode 100644 dist/javascript/jquery-1.0.3-forms.pack.js rename dist/javascript/{jquery-1.0.3-forms.js => jquery-1.0.3.js} (76%) diff --git a/.gitattributes b/.gitattributes index 23377fd530..31b4bd4952 100644 --- a/.gitattributes +++ b/.gitattributes @@ -216,11 +216,12 @@ dist/inc-petition.html -text dist/inc-pied.html -text dist/inc-rss-item.html -text dist/inc-rubriques.html -text +dist/javascript/ajaxCallback.js -text dist/javascript/articles_tous_edite.js -text dist/javascript/async_upload.js -text dist/javascript/dragdrop_interface.js -text -dist/javascript/jquery-1.0.3-forms.js -text -dist/javascript/jquery-1.0.3-forms.pack.js -text +dist/javascript/form.js -text +dist/javascript/jquery-1.0.3.js -text dist/javascript/pause.js -text dist/jquery.js.html -text dist/modeles/article_mots.html -text diff --git a/dist/javascript/ajaxCallback.js b/dist/javascript/ajaxCallback.js new file mode 100644 index 0000000000..4edd3fdd7c --- /dev/null +++ b/dist/javascript/ajaxCallback.js @@ -0,0 +1,58 @@ +// A plugin that wraps all ajax calls introducing a fixed callback function on ajax complete + +var load_handlers = new Array(); +// +// Add a function to the list of those to be executed on ajax load complete +// +function onAjaxLoad(f) { + load_handlers.push(f); +}; + +// +// Call the functions that have been added to onAjaxLoad +// +function triggerAjaxLoad(root) { + for ( var i = 0; i < load_handlers.length; i++ ) + load_handlers[i].apply( root ); +}; + +jQuery.fn._load = jQuery.fn.load; + +jQuery.fn.load = function( url, params, callback, ifModified ) { + + callback = callback || function(){}; + + // If the second parameter was provided + if ( params ) { + // If it's a function + if ( params.constructor == Function ) { + // We assume that it's the callback + callback = params; + params = null; + } + } + var callback2 = function(res,status) {triggerAjaxLoad(this);callback(res,status);}; + + return this._load( url, params, callback2, ifModified ); +}; + + +jQuery._ajax = jQuery.ajax; + +jQuery.ajax = function( type, url, data, ret, ifModified ) { + + //If called by _load exit now because the callback has already been set + if (jQuery.ajax.caller==jQuery.fn._load) return jQuery._ajax( type, url, data, ret, ifModified ); + // If only a single argument was passed in, + // assume that it is a object of key/value pairs + if ( !url ) { + var orig_complete = type.complete || function() {}; + type.complete = function(res,status) {triggerAjaxLoad(document);orig_complete(res,status);}; + } else { + var orig_ret = ret || function() {}; + ret = function(res,status) {triggerAjaxLoad(document);orig_ret(res,status);}; + } + + return jQuery._ajax( type, url, data, ret, ifModified ); + +}; diff --git a/dist/javascript/form.js b/dist/javascript/form.js new file mode 100644 index 0000000000..a0893f94bf --- /dev/null +++ b/dist/javascript/form.js @@ -0,0 +1,368 @@ +// +// The :input selection expression was added in jQuery v1.0.2. +// Add it automatically here if it doesn't exist +// +if (!jQuery.expr[':']['input']) + jQuery.extend(jQuery.expr[':'], {input: "a.nodeName.toLowerCase().match(/input|select|textarea|button/)" }); + + +/** + * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX. + * + * Options are provided via an options object. The following options are supported: + * + * target: Identifies the element(s) in the page to be updated with the server response. + * This value may be specified as a jQuery selection string, a jQuery object, + * or a DOM element. + * default value: null + * + * url: URL to which the form data will be submitted. + * default value: value of form's 'action' attribute + * + * method: The method in which the form data should be submitted, 'GET' or 'POST'. + * default value: value of form's 'method' attribute (or 'GET' if none found) + * + * before: Callback method to be invoked before the form is submitted. + * default value: null + * + * after: Callback method to be invoked after the form has been successfully submitted. + * default value: null + * + * dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json' + * default value: null + * + * semantic: Boolean flag indicating whether data must be submitted in semantic order (slower). + * default value: false + * + * + * The 'before' callback can be provided as a hook for running pre-submit logic or for + * validating the form data. If the 'before' callback returns false then the form will + * not be submitted. The 'before' callback is invoked with two arguments: the form data + * in array format, and the jQuery object. The form data array takes the following form: + * + * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] + * + * If an 'after' callback method is provided it is invoked after the response has been returned + * from the server. It is passed the responseText or responseXML value (depending on dataType). + * See jQuery.ajax for further details. + * + * + * The dataType option provides a means for specifying how the server response should be handled. + * This maps directly to the jQuery.httpData method. The following values are supported as of + * jQuery verions 1.0.2: + * 'xml': if dataType == 'xml' the server response is treated as XML and the 'after' + * callback method, if specified, will be passed the responseXML value + * 'json': if dataType == 'json' the server response will be evaluted and passed to + * the 'after' callback, if specified + * 'script': if dataType == 'script' the server response is evaluated in the global context + * + * + * Note that it does not make sense to use both the 'target' and 'dataType' options. If both + * are provided the target will be ignored. + * + * The semantic argument can be used to force form serialization in semantic order. If your + * form must be submitted with name/value pairs in semantic order then pass true for this arg, + * otherwise pass false (or nothing) to avoid the overhead for this logic (which can be + * significant for very large forms). + * + * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this: + * + * $("#form-id").submit(function() { + * $(this).ajaxSubmit(options); + * return false; // cancel conventional submit + * }); + * + * When using ajaxForm(), however, this is done for you. + * + * + * Notes for using form.js with jQuery versions prior to 1.0.2 + * ----------------------------------------------------------- + * 1. When using jQuery version < 1.0.2 if you do not specify a 'target' option then the 'after' + * callback method is passed the XMLHttpRequest object instead of the response data. + * This quirk was fixed in jQuery 1.0.2. + * + * 2. When using jQuery version < 1.0.1 the 'json' dataType value is not supported. + * + * + * + * @example + * var options = { + * target: '#myTargetDiv' + * }; + * $('#myForm').ajaxSubmit(options); + * @desc Submit form and update page element with server response + * + * + * @example + * var options = { + * after: function(responseText) { + * alert(responseText); + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc Submit form and alert the server response + * + * + * @example + * var options = { + * before: function(formArray, jqForm) { + * if (formArray.length == 0) { + * alert('Please enter data.'); + * return false; + * } + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc Pre-submit validation which aborts the submit operation if form data is empty + * + * + * @example + * var options = { + * url: myJsonUrl.php, + * dataType: 'json', + * after: function(data) { + * // 'data' is an object representing the the evaluated json data + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc json data returned and evaluated + * + * + * @example + * var options = { + * url: myXmlUrl.php, + * dataType: 'xml', + * after: function(responseXML) { + * // responseXML is XML document object + * var data = $('myElement', responseXML).text(); + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc XML data returned from server + * + * + * @example + * $('#myForm).submit(function() { + * $(this).ajaxSubmit(); + * return false; + * }); + * @desc Bind form's submit event to use ajaxSubmit + * + * + * @name ajaxSubmit + * @type jQuery + * @param options object literal containing options which control the form submission process + * @cat Plugins/Form + * @return jQuery + * @see formToArray + * @see ajaxForm + * @see load + * @see $.ajax + * @author jQuery Community + */ +jQuery.fn.ajaxSubmit = function(options) { + options = jQuery.extend({ + target: null, + url: this.attr('action') || '', + method: this.attr('method') || 'GET', + before: null, + after: null, + dataType: null, // 'xml', 'script', or 'json' (@see jQuery.httpData) + semantic: false + }, options || {}); + + var a = this.formToArray(options.semantic); + + // give pre-submit callback an opportunity to abort the submit + if (options.before && options.before(a, this) === false) return; + + var q = jQuery.param(a); + var get = (options.method && options.method.toUpperCase() == 'GET'); + + if (get) + // if url already has a '?' then append args after '&' + options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; + + // perform a load on the target only if dataType is not provided + if (!options.dataType && options.target) + jQuery(options.target).load(options.url, get ? null : a, options.after); + else + jQuery.ajax({ + url: options.url, + success: options.after, + type: options.method, + dataType: options.dataType, + data: get ? null : q // data is null for 'get' or the query string for 'post' + }); + return this; +}; + + +/** + * ajaxForm() provides a mechanism for fully automating form submission. + * + * The advantages of using this method instead of ajaxSubmit() are: + * + * 1: This method will include coordinates for <input type="image" /> elements (if the element + * is used to submit the form). + * 2. This method will include the submit element's name/value data (for the element that was + * used to submit the form). + * 3. This method binds the submit() method to the form for you. + * + * Note that for accurate x/y coordinates of image submit elements in all browsers + * you need to also use the "dimensions" plugin (this method will auto-detect its presence). + * + * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely + * passes the options argument along after properly binding events for submit elements and + * the form itself. See ajaxSubmit for a full description of the options argument and for + * notes on usage with down-rev versions of jQuery. + * + * + * @example + * var options = { + * target: '#myTargetDiv' + * }; + * $('#myForm').ajaxSForm(options); + * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response + * when the form is submitted. + * + * + * @example + * var options = { + * after: function(responseText) { + * alert(responseText); + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc Bind form's submit event so that server response is alerted after the form is submitted. + * + * + * @example + * var options = { + * before: function(formArray, jqForm) { + * if (formArray.length == 0) { + * alert('Please enter data.'); + * return false; + * } + * } + * }; + * $('#myForm').ajaxSubmit(options); + * @desc Bind form's submit event so that pre-submit callback is invoked before the form + * is submitted. + * + * + * @name ajaxForm + * @param options object literal containing options which control the form submission process + * @return jQuery + * @cat Plugins/Form + * @type jQuery + * @see ajaxSubmit + * @author jQuery Community + */ +jQuery.fn.ajaxForm = function(options) { + return this.each(function() { + jQuery("input:submit,input:image", this).click(function(ev) { + this.form.clk = this; + + if (ev.offsetX != undefined) { + this.form.clk_x = ev.offsetX; + this.form.clk_y = ev.offsetY; + } else if (typeof jQuery.fn.offset == 'function') { // try to use dimensions plugin + var offset = $(this).offset(); + this.form.clk_x = ev.pageX - offset.left; + this.form.clk_y = ev.pageY - offset.top; + } else { + this.form.clk_x = ev.pageX - this.offsetLeft; + this.form.clk_y = ev.pageY - this.offsetTop; + } + }) + }).submit(function(e) { + jQuery(this).ajaxSubmit(options); + return false; + }); +}; + + +/** + * formToArray() gathers form element data into an array of objects that can + * be passed to any of the following ajax functions: $.get, $.post, or load. + * Each object in the array has both a 'name' and 'value' property. An example of + * an array for a simple login form might be: + * + * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] + * + * It is this array that is passed to pre-submit callback functions provided to the + * ajaxSubmit() and ajaxForm() methods. + * + * The semantic argument can be used to force form serialization in semantic order. + * If your form must be submitted with name/value pairs in semantic order then pass + * true for this arg, otherwise pass false (or nothing) to avoid the overhead for + * this logic (which can be significant for very large forms). + * + * @example var data = $("#myForm").formToArray(); + * $.post( "myscript.cgi", data ); + * @desc Collect all the data from a form and submit it to the server. + * + * @name formToArray + * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) + * @type Array<Object> + * @cat Plugins/Form + * @see ajaxForm + * @see ajaxSubmit + * @author jQuery Community + */ +jQuery.fn.formToArray = function(semantic) { + var a = []; + var q = semantic ? ':input' : 'input,textarea,select,button'; + + jQuery(q, this).each(function() { + var n = this.name; + var t = this.type; + + if ( !n || this.disabled || t == 'reset' || + (t == 'checkbox' || t == 'radio') && !this.checked || + (t == 'submit' || t == 'image' || t == 'button') && this.form && this.form.clk != this || + this.tagName.toLowerCase() == 'select' && this.selectedIndex == -1) + return; + + if (t == 'image' && this.form.clk_x != undefined) + return a.push( + {name: n+'_x', value: this.form.clk_x}, + {name: n+'_y', value: this.form.clk_y} + ); + + if (t == 'select-multiple') { + for(var i=0; i < this.options.length; i++) + if (this.options[i].selected) + a.push({name: n, value: this.options[i].value}); + return; + } + a.push({name: n, value: this.value}); + }); + return a; +}; + +/** + * Serializes form data into a 'submittable' string. This method will return a string + * in the format: name1=value1&name2=value2 + * + * The semantic argument can be used to force form serialization in semantic order. + * If your form must be submitted with name/value pairs in semantic order then pass + * true for this arg, otherwise pass false (or nothing) to avoid the overhead for + * this logic (which can be significant for very large forms). + * + * @example var data = $("#myForm").formSerialize(); + * $.ajax('POST', "myscript.cgi", data); + * @desc Collect all the data from a form into a single string + * + * @name formSerialize + * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) + * @type String + * @cat Plugins/Form + * @see formToArray + * @author jQuery Community + */ +jQuery.fn.formSerialize = function(semantic) { + //hand off to jQuery.param for proper encoding + return jQuery.param(this.formToArray(semantic)); +}; diff --git a/dist/javascript/jquery-1.0.3-forms.pack.js b/dist/javascript/jquery-1.0.3-forms.pack.js deleted file mode 100644 index 495fb4bd24..0000000000 --- a/dist/javascript/jquery-1.0.3-forms.pack.js +++ /dev/null @@ -1 +0,0 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('l(1W 1J.6=="Q"){1J.Q=1J.Q;v 6=u(a,c){l(a&&1W a=="u"&&6.D.20)B 6(16).20(a);a=a||6.1p||16;l(a.3I)B 6(6.1X(a,[]));l(c&&c.3I)B 6(c).1Z(a);l(1J==7)B 1j 6(a,c);l(a.P==1N){v m=/^[^<]*(<.+>)[^>]*$/.3D(a);l(m)a=6.44([m[1]])}7.1d(a.P==2y||a.E&&!a.1P&&a[0]!=Q&&a[0].1P?6.1X(a,[]):6.1Z(a,c));v D=1c[1c.E-1];l(D&&1W D=="u")7.11(D);B 7};l(1W $!="Q")6.4k$=$;v $=6;6.D=6.8u={3I:"1.0.3",6n:u(){B 7.E},1d:u(27){l(27&&27.P==2y){7.E=0;[].1e.1b(7,27);B 7}F B 27==Q?6.1X(7,[]):7[27]},11:u(D,1l){B 6.11(7,D,1l)},8v:u(18){v 2v=-1;7.11(u(i){l(7==18)2v=i});B 2v},1s:u(1Q,U,C){B 1Q.P!=1N||U!=Q?7.11(u(){l(U==Q)J(v H 1x 1Q)6.1s(C?7.1g:7,H,1Q[H]);F 6.1s(C?7.1g:7,1Q,U)}):6[C||"1s"](7[0],1Q)},1m:u(1Q,U){B 7.1s(1Q,U,"29")},2L:u(e){e=e||7;v t="";J(v j=0;j<e.E;j++){v r=e[j].2t;J(v i=0;i<r.E;i++)l(r[i].1P!=8)t+=r[i].1P!=1?r[i].5g:6.D.2L([r[i]])}B t},22:u(){v a=6.44(1c);B 7.11(u(){v b=a[0].45(12);7.1n.3g(b,7);2m(b.2k)b=b.2k;b.4X(7)})},5y:u(){B 7.3j(1c,12,1,u(a){7.4X(a)})},5z:u(){B 7.3j(1c,12,-1,u(a){7.3g(a,7.2k)})},36:u(){B 7.3j(1c,V,1,u(a){7.1n.3g(a,7)})},2Y:u(){B 7.3j(1c,V,-1,u(a){7.1n.3g(a,7.8w)})},4n:u(){B 7.1d(7.3J.8x())},1Z:u(t){B 7.2q(6.2J(7,u(a){B 6.1Z(t,a)}),1c)},4z:u(4U){B 7.2q(6.2J(7,u(a){B a.45(4U!=Q?4U:12)}),1c)},1h:u(t){B 7.2q(t.P==2y&&6.2J(7,u(a){J(v i=0;i<t.E;i++)l(6.1h(t[i],[a]).r.E)B a;B V})||t.P==8y&&(t?7.1d():[])||1W t=="u"&&6.34(7,t)||6.1h(t,7).r,1c)},2T:u(t){B 7.2q(t.P==1N?6.1h(t,7,V).r:6.34(7,u(a){B a!=t}),1c)},2A:u(t){B 7.2q(6.1X(7,t.P==1N?6.1Z(t):t.P==2y?t:[t]),1c)},4O:u(2e){B 2e?6.1h(2e,7).r.E>0:V},3j:u(1l,25,35,D){v 4z=7.6n()>1;v a=6.44(1l);B 7.11(u(){v 18=7;l(25&&7.2C.2g()=="8z"&&a[0].2C.2g()!="8A"){v 2i=7.5e("2i");l(!2i.E){18=16.58("2i");7.4X(18)}F 18=2i[0]}J(v i=(35<0?a.E-1:0);i!=(35<0?35:a.E);i+=35){D.1b(18,[4z?a[i].45(12):a[i]])}})},2q:u(a,1l){v D=1l&&1l[1l.E-1];v 2w=1l&&1l[1l.E-2];l(D&&D.P!=1w)D=M;l(2w&&2w.P!=1w)2w=M;l(!D){l(!7.3J)7.3J=[];7.3J.1e(7.1d());7.1d(a)}F{v 21=7.1d();7.1d(a);l(2w&&a.E||!2w)7.11(2w||D).1d(21);F 7.1d(21).11(D)}B 7}};6.1y=6.D.1y=u(18,H){l(1c.E>1&&(H===M||H==Q))B 18;l(!H){H=18;18=7}J(v i 1x H)18[i]=H[i];B 18};6.1y({5M:u(){6.8B=12;6.11(6.2o.5H,u(i,n){6.D[i]=u(a){v O=6.2J(7,n);l(a&&a.P==1N)O=6.1h(a,O).r;B 7.2q(O,1c)}});6.11(6.2o.2N,u(i,n){6.D[i]=u(){v a=1c;B 7.11(u(){J(v j=0;j<a.E;j++)6(a[j])[n](7)})}});6.11(6.2o.11,u(i,n){6.D[i]=u(){B 7.11(n,1c)}});6.11(6.2o.1h,u(i,n){6.D[n]=u(27,D){B 7.1h(":"+n+"("+27+")",D)}});6.11(6.2o.1s,u(i,n){n=n||i;6.D[i]=u(h){B h==Q?7.E?7[0][n]:M:7.1s(n,h)}});6.11(6.2o.1m,u(i,n){6.D[n]=u(h){B h==Q?(7.E?6.1m(7[0],n):M):7.1m(n,h)}})},11:u(18,D,1l){l(18.E==Q)J(v i 1x 18)D.1b(18[i],1l||[i,18[i]]);F J(v i=0;i<18.E;i++)l(D.1b(18[i],1l||[i,18[i]])===V)4x;B 18},1k:{2A:u(o,c){l(6.1k.3C(o,c))B;o.1k+=(o.1k?" ":"")+c},28:u(o,c){l(!c){o.1k=""}F{v 3e=o.1k.3z(" ");J(v i=0;i<3e.E;i++){l(3e[i]==c){3e.8D(i,1);4x}}o.1k=3e.5j(\' \')}},3C:u(e,a){l(e.1k!=Q)e=e.1k;B 1j 4A("(^|\\\\s)"+a+"(\\\\s|$)").2b(e)}},4W:u(e,o,f){J(v i 1x o){e.1g["21"+i]=e.1g[i];e.1g[i]=o[i]}f.1b(e,[]);J(v i 1x o)e.1g[i]=e.1g["21"+i]},1m:u(e,p){l(p=="1L"||p=="2x"){v 21={},42,43,d=["8E","8F","6N","8G"];J(v i 1x d){21["6H"+d[i]]=0;21["8H"+d[i]+"8J"]=0}6.4W(e,21,u(){l(6.1m(e,"1B")!="2d"){42=e.8K;43=e.8N}F{e=6(e.45(12)).1Z(":3T").5J("2S").4n().1m({4e:"24",32:"8O",1B:"3i",8P:"0",4v:"0"}).5x(e.1n)[0];v 3k=6.1m(e.1n,"32");l(3k==""||3k=="48")e.1n.1g.32="8Q";42=e.8R;43=e.8S;l(3k==""||3k=="48")e.1n.1g.32="48";e.1n.3N(e)}});B p=="1L"?42:43}B 6.29(e,p)},29:u(I,H,52){v O;l(H==\'1q\'&&6.17.1u)B 6.1s(I.1g,\'1q\');l(H=="3A"||H=="2O")H=6.17.1u?"3s":"2O";l(!52&&I.1g[H]){O=I.1g[H]}F l(I.3U){v 55=H.1G(/\\-(\\w)/g,u(m,c){B c.2g()});O=I.3U[H]||I.3U[55]}F l(16.40&&16.40.4a){l(H=="2O"||H=="3s")H="3A";H=H.1G(/([A-Z])/g,"-$1").3c();v 1o=16.40.4a(I,M);l(1o)O=1o.57(H);F l(H==\'1B\')O=\'2d\';F 6.4W(I,{1B:\'3i\'},u(){O=16.40.4a(7,M).57(H)})}B O},44:u(a){v r=[];J(v i=0;i<a.E;i++){v 1O=a[i];l(1O.P==1N){v s=6.2W(1O),2a=16.58("2a"),22=[0,"",""];l(!s.1f("<6s"))22=[1,"<2c>","</2c>"];F l(!s.1f("<6t")||!s.1f("<2i"))22=[1,"<25>","</25>"];F l(!s.1f("<4c"))22=[2,"<25>","</25>"];F l(!s.1f("<6u")||!s.1f("<6v"))22=[3,"<25><2i><4c>","</4c></2i></25>"];2a.2X=22[1]+s+22[2];2m(22[0]--)2a=2a.2k;J(v j=0;j<2a.2t.E;j++)r.1e(2a.2t[j])}F l(1O.E!=Q&&!1O.1P)J(v n=0;n<1O.E;n++)r.1e(1O[n]);F r.1e(1O.1P?1O:16.6w(1O.6y()))}B r},2e:{"":"m[2]== \'*\'||a.2C.2g()==m[2].2g()","#":"a.3F(\'3M\')&&a.3F(\'3M\')==m[2]",":":{5C:"i<m[3]-0",5D:"i>m[3]-0",59:"m[3]-0==i",5B:"m[3]-0==i",2s:"i==0",1S:"i==r.E-1",5l:"i%2==0",5m:"i%2","59-3p":"6.1E(a,m[3]).1o","2s-3p":"6.1E(a,0).1o","1S-3p":"6.1E(a,0).1S","6z-3p":"6.1E(a).E==1",5I:"a.2t.E",5L:"!a.2t.E",5F:"6.D.2L.1b([a]).1f(m[3])>=0",6A:"a.C!=\'24\'&&6.1m(a,\'1B\')!=\'2d\'&&6.1m(a,\'4e\')!=\'24\'",24:"a.C==\'24\'||6.1m(a,\'1B\')==\'2d\'||6.1m(a,\'4e\')==\'24\'",6B:"!a.2I",2I:"a.2I",2S:"a.2S",3w:"a.3w || 6.1s(a, \'3w\')",2L:"a.C==\'2L\'",3T:"a.C==\'3T\'",4P:"a.C==\'4P\'",4Q:"a.C==\'4Q\'",5b:"a.C==\'5b\'",2E:"a.C==\'2E\'",3h:"a.C==\'3h\'",3Q:"a.C==\'3Q\'",2U:"a.C==\'2U\'",1Y:"a.2C.3c().4t(/1Y|2c|4H|2U/)"},".":"6.1k.3C(a,m[2])","@":{"=":"z==m[4]","!=":"z!=m[4]","^=":"z && !z.1f(m[4])","$=":"z && z.3b(z.E - m[4].E,m[4].E)==m[4]","*=":"z && z.1f(m[4])>=0","":"z"},"[":"6.1Z(m[2],a).E"},3L:["\\\\.\\\\.|/\\\\.\\\\.","a.1n",">|/","6.1E(a.2k)","\\\\+","6.1E(a).3r","~",u(a){v r=[];v s=6.1E(a);l(s.n>0)J(v i=s.n;i<s.E;i++)r.1e(s[i]);B r}],1Z:u(t,1p){l(1p&&1p.1P==Q)1p=M;1p=1p||6.1p||16;l(t.P!=1N)B[t];l(!t.1f("//")){1p=1p.5c;t=t.3b(2,t.E)}F l(!t.1f("/")){1p=1p.5c;t=t.3b(1,t.E);l(t.1f("/")>=1)t=t.3b(t.1f("/"),t.E)}v O=[1p];v 1U=[];v 1S=M;2m(t.E>0&&1S!=t){v r=[];1S=t;t=6.2W(t).1G(/^\\/\\//i,"");v 3q=V;J(v i=0;i<6.3L.E;i+=2){l(3q)5k;v 2P=1j 4A("^("+6.3L[i]+")");v m=2P.3D(t);l(m){r=O=6.2J(O,6.3L[i+1]);t=6.2W(t.1G(2P,""));3q=12}}l(!3q){l(!t.1f(",")||!t.1f("|")){l(O[0]==1p)O.4T();1U=6.1X(1U,O);r=O=[1p];t=" "+t.3b(1,t.E)}F{v 4f=/^([#.]?)([a-5i-9\\\\*4k-]*)/i;v m=4f.3D(t);l(m[1]=="#"){v 4L=16.62(m[2]);r=O=4L?[4L]:[];t=t.1G(4f,"")}F{l(!m[2]||m[1]==".")m[2]="*";J(v i=0;i<O.E;i++)r=6.1X(r,m[2]=="*"?6.4g(O[i]):O[i].5e(m[2]))}}}l(t){v 1M=6.1h(t,r);O=r=1M.r;t=6.2W(1M.t)}}l(O&&O[0]==1p)O.4T();1U=6.1X(1U,O);B 1U},4g:u(o,r){r=r||[];v s=o.2t;J(v i=0;i<s.E;i++)l(s[i].1P==1){r.1e(s[i]);6.4g(s[i],r)}B r},1s:u(I,15,U){v 2D={"J":"6D","6E":"1k","3A":6.17.1u?"3s":"2O",2O:6.17.1u?"3s":"2O",2X:"2X",1k:"1k",U:"U",2I:"2I",2S:"2S",6F:"6G"};l(15=="1q"&&6.17.1u&&U!=Q){I[\'6I\']=1;l(U==1)B I["1h"]=I["1h"].1G(/3O\\([^\\)]*\\)/5T,"");F B I["1h"]=I["1h"].1G(/3O\\([^\\)]*\\)/5T,"")+"3O(1q="+U*5R+")"}F l(15=="1q"&&6.17.1u){B I["1h"]?4Y(I["1h"].4t(/3O\\(1q=(.*)\\)/)[1])/5R:1}l(15=="1q"&&6.17.38&&U==1)U=0.7Y;l(2D[15]){l(U!=Q)I[2D[15]]=U;B I[2D[15]]}F l(U==Q&&6.17.1u&&I.2C&&I.2C.2g()==\'6K\'&&(15==\'5n\'||15==\'2K\')){B I.6L(15).5g}F l(I.3F!=Q&&I.6p){l(U!=Q)I.6O(15,U);B I.3F(15)}F{15=15.1G(/-([a-z])/6P,u(z,b){B b.2g()});l(U!=Q)I[15]=U;B I[15]}},5h:["\\\\[ *(@)S *([!*$^=]*) *(\'?\\"?)(.*?)\\\\4 *\\\\]","(\\\\[)\\s*(.*?)\\s*\\\\]","(:)S\\\\(\\"?\'?([^\\\\)]*?)\\"?\'?\\\\)","([:.#]*)S"],1h:u(t,r,2T){v g=2T!==V?6.34:u(a,f){B 6.34(a,f,12)};2m(t&&/^[a-z[({<*:.#]/i.2b(t)){v p=6.5h;J(v i=0;i<p.E;i++){v 2P=1j 4A("^"+p[i].1G("S","([a-z*4k-][a-5i-6Q-]*)"),"i");v m=2P.3D(t);l(m){l(!i)m=["",m[1],m[3],m[2],m[5]];t=t.1G(2P,"");4x}}l(m[1]==":"&&m[2]=="2T")r=6.1h(m[3],r,V).r;F{v f=6.2e[m[1]];l(f.P!=1N)f=6.2e[m[1]][m[2]];3P("f = u(a,i){"+(m[1]=="@"?"z=6.1s(a,m[3]);":"")+"B "+f+"}");r=g(r,f)}}B{r:r,t:t}},2W:u(t){B t.1G(/^\\s+|\\s+$/g,"")},3v:u(I){v 4m=[];v 1o=I.1n;2m(1o&&1o!=16){4m.1e(1o);1o=1o.1n}B 4m},1E:u(I,2v,2T){v 1a=[];l(I){v 2r=I.1n.2t;J(v i=0;i<2r.E;i++){l(2T===12&&2r[i]==I)5k;l(2r[i].1P==1)1a.1e(2r[i]);l(2r[i]==I)1a.n=1a.E-1}}B 6.1y(1a,{1S:1a.n==1a.E-1,1o:2v=="5l"&&1a.n%2==0||2v=="5m"&&1a.n%2||1a[2v]==I,4r:1a[1a.n-1],3r:1a[1a.n+1]})},1X:u(2s,3B){v 1F=[];J(v k=0;k<2s.E;k++)1F[k]=2s[k];J(v i=0;i<3B.E;i++){v 4s=12;J(v j=0;j<2s.E;j++)l(3B[i]==2s[j])4s=V;l(4s)1F.1e(3B[i])}B 1F},34:u(1a,D,4o){l(D.P==1N)D=1j 1w("a","i","B "+D);v 1F=[];J(v i=0;i<1a.E;i++)l(!4o&&D(1a[i],i)||4o&&!D(1a[i],i))1F.1e(1a[i]);B 1F},2J:u(1a,D){l(D.P==1N)D=1j 1w("a","B "+D);v 1F=[];J(v i=0;i<1a.E;i++){v 1M=D(1a[i],i);l(1M!==M&&1M!=Q){l(1M.P!=2y)1M=[1M];1F=6.1X(1F,1M)}}B 1F},N:{2A:u(W,C,1H){l(6.17.1u&&W.4Z!=Q)W=1J;l(!1H.2M)1H.2M=7.2M++;l(!W.1I)W.1I={};v 33=W.1I[C];l(!33){33=W.1I[C]={};l(W["2Z"+C])33[0]=W["2Z"+C]}33[1H.2M]=1H;W["2Z"+C]=7.5r;l(!7.1i[C])7.1i[C]=[];7.1i[C].1e(W)},2M:1,1i:{},28:u(W,C,1H){l(W.1I)l(C&&W.1I[C])l(1H)5q W.1I[C][1H.2M];F J(v i 1x W.1I[C])5q W.1I[C][i];F J(v j 1x W.1I)7.28(W,j)},1R:u(C,L,W){L=L||[];l(!W){v g=7.1i[C];l(g)J(v i=0;i<g.E;i++)7.1R(C,L,g[i])}F l(W["2Z"+C]){L.5s(7.2D({C:C,2f:W}));W["2Z"+C].1b(W,L)}},5r:u(N){l(1W 6=="Q")B V;N=N||6.N.2D(1J.N);l(!N)B V;v 3y=12;v c=7.1I[N.C];v 1l=[].6X.4V(1c,1);1l.5s(N);J(v j 1x c){l(c[j].1b(7,1l)===V){N.4y();N.5u();3y=V}}B 3y},2D:u(N){l(6.17.1u){N=1J.N;N.2f=N.70}F l(6.17.3a&&N.2f.1P==3){N=6.1y({},N);N.2f=N.2f.1n}N.4y=u(){7.3y=V};N.5u=u(){7.71=12};B N}}});1j u(){v b=5o.5p.3c();6.17={3a:/5v/.2b(b),39:/39/.2b(b),1u:/1u/.2b(b)&&!/39/.2b(b),38:/38/.2b(b)&&!/(72|5v)/.2b(b)};6.73=!6.17.1u||16.75=="76"};6.2o={2N:{5x:"5y",78:"5z",3g:"36",7a:"2Y"},1m:"2x,1L,5P,4v,32,3A,3n,7c,7e".3z(","),1h:["5B","5C","5D","5F"],1s:{1M:"U",47:"2X",3M:M,7h:M,15:M,7i:M,3t:M,7k:M},5H:{5I:"a.1n",7m:6.3v,3v:6.3v,3r:"6.1E(a).3r",4r:"6.1E(a).4r",2r:"6.1E(a, M, 12)",7r:"6.1E(a.2k)"},11:{5J:u(1Q){7.7t(1Q)},1K:u(){7.1g.1B=7.2G?7.2G:"";l(6.1m(7,"1B")=="2d")7.1g.1B="3i"},1z:u(){7.2G=7.2G||6.1m(7,"1B");l(7.2G=="2d")7.2G="3i";7.1g.1B="2d"},4S:u(){6(7)[6(7).4O(":24")?"1K":"1z"].1b(6(7),1c)},7w:u(c){6.1k.2A(7,c)},7x:u(c){6.1k.28(7,c)},7A:u(c){6.1k[6.1k.3C(7,c)?"28":"2A"](7,c)},28:u(a){l(!a||6.1h(a,[7]).r)7.1n.3N(7)},5L:u(){2m(7.2k)7.3N(7.2k)},31:u(C,D){l(D.P==1N)D=1j 1w("e",(!D.1f(".")?"6(7)":"B ")+D);6.N.2A(7,C,D)},4F:u(C,D){6.N.28(7,C,D)},1R:u(C,L){6.N.1R(C,L,7)}}};6.5M();6.D.1y({5N:6.D.4S,4S:u(a,b){B a&&b&&a.P==1w&&b.P==1w?7.4q(u(e){7.1S=7.1S==a?b:a;e.4y();B 7.1S.1b(7,[e])||V}):7.5N.1b(7,1c)},7H:u(f,g){u 4B(e){v p=(e.C=="3H"?e.7I:e.7K)||e.7L;2m(p&&p!=7)3V{p=p.1n}41(e){p=7};l(p==7)B V;B(e.C=="3H"?f:g).1b(7,[e])}B 7.3H(4B).5V(4B)},20:u(f){l(6.3R)f.1b(16);F{6.2H.1e(f)}B 7}});6.1y({3R:V,2H:[],20:u(){l(!6.3R){6.3R=12;l(6.2H){J(v i=0;i<6.2H.E;i++)6.2H[i].1b(16);6.2H=M}l(6.17.38||6.17.39)16.7N("61",6.20,V)}}});1j u(){v e=("7O,7R,2l,7S,7U,4K,4q,7V,"+"7W,7X,7Z,3H,5V,80,3Q,2c,"+"2E,81,82,84,2z").3z(",");J(v i=0;i<e.E;i++)1j u(){v o=e[i];6.D[o]=u(f){B f?7.31(o,f):7.1R(o)};6.D["85"+o]=u(f){B 7.4F(o,f)};6.D["86"+o]=u(f){v W=6(7);v 1H=u(){W.4F(o,1H);W=M;f.1b(7,1c)};B 7.31(o,1H)}};l(6.17.38||6.17.39){16.88("61",6.20,V)}F l(6.17.1u){16.89("<8a"+"8b 3M=63 8c=12 "+"3t=//:><\\/2j>");v 2j=16.62("63");2j.2R=u(){l(7.3Z!="1A")B;7.1n.3N(7);6.20()};2j=M}F l(6.17.3a){6.4I=4Z(u(){l(16.3Z=="8e"||16.3Z=="1A"){56(6.4I);6.4I=M;6.20()}},10)}6.N.2A(1J,"2l",6.20)};l(6.17.1u)6(1J).4K(u(){v N=6.N,1i=N.1i;J(v C 1x 1i){v 4M=1i[C],i=4M.E;l(i>0)8g l(C!=\'4K\')N.28(4M[i-1],C);2m(--i)}});6.D.1y({66:6.D.1K,1K:u(19,G){B 19?7.23({1L:"1K",2x:"1K",1q:"1K"},19,G):7.66()},67:6.D.1z,1z:u(19,G){B 19?7.23({1L:"1z",2x:"1z",1q:"1z"},19,G):7.67()},8i:u(19,G){B 7.23({1L:"1K"},19,G)},8j:u(19,G){B 7.23({1L:"1z"},19,G)},8k:u(19,G){B 7.11(u(){v 69=6(7).4O(":24")?"1K":"1z";6(7).23({1L:69},19,G)})},8m:u(19,G){B 7.23({1q:"1K"},19,G)},8o:u(19,G){B 7.23({1q:"1z"},19,G)},8p:u(19,2N,G){B 7.23({1q:2N},19,G)},23:u(H,19,G){B 7.1D(u(){7.3d=6.1y({},H);J(v p 1x H){v e=1j 6.3l(7,6.19(19,G),p);l(H[p].P==6h)e.46(e.1o(),H[p]);F e[H[p]](H)}})},1D:u(C,D){l(!D){D=C;C="3l"}B 7.11(u(){l(!7.1D)7.1D={};l(!7.1D[C])7.1D[C]=[];7.1D[C].1e(D);l(7.1D[C].E==1)D.1b(7)})}});6.1y({5d:u(e,p){l(e.6e)B;l(p=="1L"&&e.6a!=3X(6.29(e,p)))B;l(p=="2x"&&e.6c!=3X(6.29(e,p)))B;v a=e.1g[p];v o=6.29(e,p,1);l(p=="1L"&&e.6a!=o||p=="2x"&&e.6c!=o)B;e.1g[p]=e.3U?"":"6d";v n=6.29(e,p,1);l(o!=n&&n!="6d"){e.1g[p]=a;e.6e=12}},19:u(s,o){o=o||{};l(o.P==1w)o={1A:o};v 6i={8r:8s,8t:6b};o.37=(s&&s.P==6h?s:6i[s])||6m;o.3o=o.1A;o.1A=u(){6.6j(7,"3l");l(o.3o&&o.3o.P==1w)o.3o.1b(7)};B o},1D:{},6j:u(I,C){C=C||"3l";l(I.1D&&I.1D[C]){I.1D[C].4T();v f=I.1D[C][0];l(f)f.1b(I)}},3l:u(I,R,H){v z=7;z.o={37:R.37||6m,1A:R.1A,2Q:R.2Q};z.14=I;v y=z.14.1g;z.a=u(){l(R.2Q)R.2Q.1b(I,[z.2n]);l(H=="1q")6.1s(y,"1q",z.2n);F l(3X(z.2n))y[H]=3X(z.2n)+"5a";y.1B="3i"};z.6q=u(){B 4Y(6.1m(z.14,H))};z.1o=u(){v r=4Y(6.29(z.14,H));B r&&r>-8C?r:z.6q()};z.46=u(50,2N){z.4D=(1j 53()).54();z.2n=50;z.a();z.49=4Z(u(){z.2Q(50,2N)},13)};z.1K=u(){l(!z.14.1V)z.14.1V={};z.14.1V[H]=7.1o();z.46(0,z.14.1V[H]);l(H!="1q")y[H]="8L"};z.1z=u(){l(!z.14.1V)z.14.1V={};z.14.1V[H]=7.1o();z.o.1z=12;z.46(z.14.1V[H],0)};l(!z.14.4b)z.14.4b=6.1m(z.14,"3n");y.3n="24";z.2Q=u(4j,4i){v t=(1j 53()).54();l(t>z.o.37+z.4D){56(z.49);z.49=M;z.2n=4i;z.a();z.14.3d[H]=12;v 1U=12;J(v i 1x z.14.3d)l(z.14.3d[i]!==12)1U=V;l(1U){y.3n=z.14.4b;l(z.o.1z)y.1B=\'2d\';l(z.o.1z){J(v p 1x z.14.3d){l(p=="1q")6.1s(y,p,z.14.1V[p]);F y[p]=z.14.1V[p]+"5a";l(p==\'1L\'||p==\'2x\')6.5d(z.14,p)}}}l(1U&&z.o.1A&&z.o.1A.P==1w)z.o.1A.1b(z.14)}F{v p=(t-7.4D)/z.o.37;z.2n=((-5S.6J(p*5S.6M)/2)+0.5)*(4i-4j)+4j;z.a()}}}});6.D.1y({6R:u(K,1t,G){7.2l(K,1t,G,1)},2l:u(K,1t,G,1r){l(K.P==1w)B 7.31("2l",K);G=G||u(){};v C="30";l(1t){l(1t.P==1w){G=1t;1t=M}F{1t=6.2u(1t);C="5A"}}v 4l=7;6.26(C,K,1t,u(1T,Y){l(Y=="2p"||!1r&&Y=="5W"){4l.47(1T.3m).4G().11(G,[1T.3m,Y])}F G.1b(4l,[1T.3m,Y])},1r);B 7},6S:u(){B 6.2u(7)},4G:u(){B 7.1Z(\'2j\').11(u(){l(7.3t)6.5w(7.3t,u(){});F 3P.4V(1J,7.2L||7.6T||7.2X||"")}).4n()}});l(6.17.1u&&1W 3S=="Q")3S=u(){B 1j 6V(5o.5p.1f("6W 5")>=0?"6Y.5t":"6Z.5t")};1j u(){v e="5E,64,60,5Y,5X".3z(",");J(v i=0;i<e.E;i++)1j u(){v o=e[i];6.D[o]=u(f){B 7.31(o,f)}}};6.1y({1d:u(K,L,G,C,1r){l(L&&L.P==1w){C=G;G=L;L=M}l(L)K+=((K.1f("?")>-1)?"&":"?")+6.2u(L);6.26("30",K,M,u(r,Y){l(G)G(6.3u(r,C),Y)},1r)},74:u(K,L,G,C){6.1d(K,L,G,C,1)},5w:u(K,G){l(G)6.1d(K,M,G,"2j");F{6.1d(K,M,M,"2j")}},77:u(K,L,G){l(G)6.1d(K,L,G,"4d");F{6.1d(K,L,"4d")}},79:u(K,L,G,C){6.26("5A",K,6.2u(L),u(r,Y){l(G)G(6.3u(r,C),Y)})},1v:0,7b:u(1v){6.1v=1v},3Y:{},26:u(C,K,L,O,1r){v 1i=12;v 1v=6.1v;l(!K){O=C.1A;v 2p=C.2p;v 2z=C.2z;v 2B=C.2B;v 1i=1W C.1i=="7d"?C.1i:12;v 1v=1W C.1v=="7f"?C.1v:6.1v;1r=C.1r||V;L=C.L;K=C.K;C=C.C}l(1i&&!6.4N++)6.N.1R("5E");v 4J=V;v T=1j 3S();T.7g(C||"30",K,12);l(L)T.3E("7j-7l","7n/x-7p-1C-7s");l(1r)T.3E("7u-4R-7v",6.3Y[K]||"7y, 7B 7C 7D 4w:4w:4w 7E");T.3E("X-7G-7J","3S");l(T.7M)T.3E("7P","7T");v 2R=u(4C){l(T&&(T.3Z==4||4C=="1v")){4J=12;v Y=6.68(T)&&4C!="1v"?1r&&6.6f(T,K)?"5W":"2p":"2z";l(Y!="2z"){v 3K;3V{3K=T.4h("6g-4R")}41(e){}l(1r&&3K)6.3Y[K]=3K;l(2p)2p(6.3u(T,2B),Y);l(1i)6.N.1R("5X")}F{l(2z)2z(T,Y);l(1i)6.N.1R("5Y")}l(1i)6.N.1R("60");l(1i&&!--6.4N)6.N.1R("64");l(O)O(T,Y);T.2R=u(){};T=M}};T.2R=2R;l(1v>0)8d(u(){l(T){T.8f();l(!4J)2R("1v");T=M}},1v);T.8h(L);B T},4N:0,68:u(r){3V{B!r.Y&&8l.8n=="4Q:"||(r.Y>=6b&&r.Y<8q)||r.Y==6k||6.17.3a&&r.Y==Q}41(e){}B V},6f:u(T,K){3V{v 6l=T.4h("6g-4R");B T.Y==6k||6l==6.3Y[K]||6.17.3a&&T.Y==Q}41(e){}B V},3u:u(r,C){v 51=r.4h("8I-C");v L=!C&&51&&51.1f("T")>=0;L=C=="T"||L?r.8T:r.3m;l(C=="2j")3P.4V(1J,L);l(C=="4d")3P("L = "+L);l(C=="47")$("<2a>").47(L).4G();B L},2u:u(a){v s=[];l(a.P==2y||a.3I){J(v i=0;i<a.E;i++)s.1e(a[i].15+"="+5f(a[i].U))}F{J(v j 1x a)s.1e(j+"="+5f(a[j]))}B s.5j("&")}})}l(!6.2e[\':\'][\'1Y\'])6.1y(6.2e[\':\'],{1Y:"a.2C.3c().4t(/1Y|2c|4H|2U/)"});6.D.5Z=u(R){R=6.1y({2f:M,K:7.1s(\'5n\')||\'\',2K:7.1s(\'2K\')||\'30\',36:M,2Y:M,2B:M,2F:V},R||{});v a=7.4u(R.2F);l(R.36&&R.36(a,7)===V)B;v q=6.2u(a);v 1d=(R.2K&&R.2K.2g()==\'30\');l(1d)R.K+=(R.K.1f(\'?\')>=0?\'&\':\'?\')+q;l(!R.2B&&R.2f)6(R.2f).2l(R.K,1d?M:a,R.2Y);F 6.26({K:R.K,2p:R.2Y,C:R.2K,2B:R.2B,L:1d?M:q});B 7};6.D.7o=u(R){B 7.11(u(){6("1Y:2E,1Y:3h",7).4q(u(2h){7.1C.65=7;l(2h.5K!=Q){7.1C.2V=2h.5K;7.1C.3G=2h.7z}F l(1W 6.D.3f==\'u\'){v 3f=$(7).3f();7.1C.2V=2h.5Q-3f.4v;7.1C.3G=2h.5U-3f.5P}F{7.1C.2V=2h.5Q-7.7Q;7.1C.3G=2h.5U-7.83}})}).2E(u(e){6(7).5Z(R);B V})};6.D.4u=u(2F){v a=[];v q=2F?\':1Y\':\'1Y,4H,2c,2U\';6(q,7).11(u(){v n=7.15;v t=7.C;l(!n||7.2I||t==\'3Q\'||(t==\'4P\'||t==\'3T\')&&!7.2S||(t==\'2E\'||t==\'3h\'||t==\'2U\')&&7.1C&&7.1C.65!=7||7.6p.3c()==\'2c\'&&7.8M==-1)B;l(t==\'3h\'&&7.1C.2V!=Q)B a.1e({15:n+\'6x\',U:7.1C.2V},{15:n+\'6C\',U:7.1C.3G});l(t==\'2c-6U\'){J(v i=0;i<7.R.E;i++)l(7.R[i].3w)a.1e({15:n,U:7.R[i].U});B}a.1e({15:n,U:7.U})});B a};6.D.7q=u(2F){B 6.2u(7.4u(2F))};v 3W=1j 2y();u 87(f){3W.1e(f)};u 3x(6r){J(v i=0;i<3W.E;i++)3W[i].1b(6r)};6.D.4E=6.D.2l;6.D.2l=u(K,1t,G,1r){G=G||u(){};l(1t){l(1t.P==1w){G=1t;1t=M}}v 5G=u(1T,Y){3x(7);G(1T,Y)};B 7.4E(K,1t,5G,1r)};6.4p=6.26;6.26=u(C,K,L,O,1r){l(6.26.7F==6.D.4E)B 6.4p(C,K,L,O,1r);l(!K){v 6o=C.1A||u(){};C.1A=u(1T,Y){3x(16);6o(1T,Y)}}F{v 5O=O||u(){};O=u(1T,Y){3x(16);5O(1T,Y)}}B 6.4p(C,K,L,O,1r)};',62,552,'||||||jQuery|this||||||||||||||if|||||||||function|var||||||return|type|fn|length|else|callback|prop|elem|for|url|data|null|event|ret|constructor|undefined|options||xml|value|false|element||status|||each|true||el|name|document|browser|obj|speed|elems|apply|arguments|get|push|indexOf|style|filter|global|new|className|args|css|parentNode|cur|context|opacity|ifModified|attr|params|msie|timeout|Function|in|extend|hide|complete|display|form|queue|sibling|result|replace|handler|events|window|show|height|val|String|arg|nodeType|key|trigger|last|res|done|orig|typeof|merge|input|find|ready|old|wrap|animate|hidden|table|ajax|num|remove|curCSS|div|test|select|none|expr|target|toUpperCase|ev|tbody|script|firstChild|load|while|now|macros|success|pushStack|siblings|first|childNodes|param|pos|fn2|width|Array|error|add|dataType|nodeName|fix|submit|semantic|oldblock|readyList|disabled|map|method|text|guid|to|cssFloat|re|step|onreadystatechange|checked|not|button|clk_x|trim|innerHTML|after|on|GET|bind|position|handlers|grep|dir|before|duration|mozilla|opera|safari|substr|toLowerCase|curAnim|classes|offset|insertBefore|image|block|domManip|parPos|fx|responseText|overflow|oldComplete|child|foundToken|next|styleFloat|src|httpData|parents|selected|triggerAjaxLoad|returnValue|split|float|second|has|exec|setRequestHeader|getAttribute|clk_y|mouseover|jquery|stack|modRes|token|id|removeChild|alpha|eval|reset|isReady|XMLHttpRequest|radio|currentStyle|try|load_handlers|parseInt|lastModified|readyState|defaultView|catch|oHeight|oWidth|clean|cloneNode|custom|html|static|timer|getComputedStyle|oldOverflow|tr|json|visibility|re2|getAll|getResponseHeader|lastNum|firstNum|_|self|matched|end|inv|_ajax|click|prev|noCollision|match|formToArray|left|00|break|preventDefault|clone|RegExp|handleHover|istimeout|startTime|_load|unbind|evalScripts|textarea|safariTimer|requestDone|unload|oid|els|active|is|checkbox|file|Modified|toggle|shift|deep|call|swap|appendChild|parseFloat|setInterval|from|ct|force|Date|getTime|newProp|clearInterval|getPropertyValue|createElement|nth|px|password|documentElement|setAuto|getElementsByTagName|encodeURIComponent|nodeValue|parse|z0|join|continue|even|odd|action|navigator|userAgent|delete|handle|unshift|XMLHTTP|stopPropagation|webkit|getScript|appendTo|append|prepend|POST|eq|lt|gt|ajaxStart|contains|callback2|axis|parent|removeAttr|offsetX|empty|init|_toggle|orig_ret|top|pageX|100|Math|gi|pageY|mouseout|notmodified|ajaxSuccess|ajaxError|ajaxSubmit|ajaxComplete|DOMContentLoaded|getElementById|__ie_init|ajaxStop|clk|_show|_hide|httpSuccess|state|scrollHeight|200|scrollWidth|auto|notAuto|httpNotModified|Last|Number|ss|dequeue|304|xmlRes|400|size|orig_complete|tagName|max|root|opt|thead|td|th|createTextNode|_x|toString|only|visible|enabled|_y|htmlFor|class|readonly|readOnly|padding|zoom|cos|FORM|getAttributeNode|PI|Right|setAttribute|ig|9_|loadIfModified|serialize|textContent|multiple|ActiveXObject|MSIE|slice|Microsoft|Msxml2|srcElement|cancelBubble|compatible|boxModel|getIfModified|compatMode|CSS1Compat|getJSON|prependTo|post|insertAfter|ajaxTimeout|color|boolean|background|number|open|title|href|Content|rel|Type|ancestors|application|ajaxForm|www|formSerialize|children|urlencoded|removeAttribute|If|Since|addClass|removeClass|Thu|offsetY|toggleClass|01|Jan|1970|GMT|caller|Requested|hover|fromElement|With|toElement|relatedTarget|overrideMimeType|removeEventListener|blur|Connection|offsetLeft|focus|resize|close|scroll|dblclick|mousedown|mouseup|9999|mousemove|change|keydown|keypress|offsetTop|keyup|un|one|onAjaxLoad|addEventListener|write|scr|ipt|defer|setTimeout|loaded|abort|do|send|slideDown|slideUp|slideToggle|location|fadeIn|protocol|fadeOut|fadeTo|300|slow|600|fast|prototype|index|nextSibling|pop|Boolean|TABLE|THEAD|initDone|10000|splice|Top|Bottom|Left|border|content|Width|offsetHeight|1px|selectedIndex|offsetWidth|absolute|right|relative|clientHeight|clientWidth|responseXML'.split('|'),0,{})) diff --git a/dist/javascript/jquery-1.0.3-forms.js b/dist/javascript/jquery-1.0.3.js similarity index 76% rename from dist/javascript/jquery-1.0.3-forms.js rename to dist/javascript/jquery-1.0.3.js index 2691bcf3ed..a4425c0962 100644 --- a/dist/javascript/jquery-1.0.3-forms.js +++ b/dist/javascript/jquery-1.0.3.js @@ -208,7 +208,7 @@ jQuery.fn = jQuery.prototype = { for ( var i = 0; i < t.length; i++ ) if ( jQuery.filter(t[i],[a]).r.length ) return a; - return false; + return null; }) || t.constructor == Boolean && @@ -1960,429 +1960,3 @@ jQuery.extend({ }); } // close: if(typeof window.jQuery == "undefined") { -// -// The :input selection expression was added in jQuery v1.0.2. -// Add it automatically here if it doesn't exist -// -if (!jQuery.expr[':']['input']) - jQuery.extend(jQuery.expr[':'], {input: "a.nodeName.toLowerCase().match(/input|select|textarea|button/)" }); - - -/** - * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX. - * - * Options are provided via an options object. The following options are supported: - * - * target: Identifies the element(s) in the page to be updated with the server response. - * This value may be specified as a jQuery selection string, a jQuery object, - * or a DOM element. - * default value: null - * - * url: URL to which the form data will be submitted. - * default value: value of form's 'action' attribute - * - * method: The method in which the form data should be submitted, 'GET' or 'POST'. - * default value: value of form's 'method' attribute (or 'GET' if none found) - * - * before: Callback method to be invoked before the form is submitted. - * default value: null - * - * after: Callback method to be invoked after the form has been successfully submitted. - * default value: null - * - * dataType: Expected dataType of the response. One of: null, 'xml', 'script', or 'json' - * default value: null - * - * semantic: Boolean flag indicating whether data must be submitted in semantic order (slower). - * default value: false - * - * - * The 'before' callback can be provided as a hook for running pre-submit logic or for - * validating the form data. If the 'before' callback returns false then the form will - * not be submitted. The 'before' callback is invoked with two arguments: the form data - * in array format, and the jQuery object. The form data array takes the following form: - * - * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] - * - * If an 'after' callback method is provided it is invoked after the response has been returned - * from the server. It is passed the responseText or responseXML value (depending on dataType). - * See jQuery.ajax for further details. - * - * - * The dataType option provides a means for specifying how the server response should be handled. - * This maps directly to the jQuery.httpData method. The following values are supported as of - * jQuery verions 1.0.2: - * 'xml': if dataType == 'xml' the server response is treated as XML and the 'after' - * callback method, if specified, will be passed the responseXML value - * 'json': if dataType == 'json' the server response will be evaluted and passed to - * the 'after' callback, if specified - * 'script': if dataType == 'script' the server response is evaluated in the global context - * - * - * Note that it does not make sense to use both the 'target' and 'dataType' options. If both - * are provided the target will be ignored. - * - * The semantic argument can be used to force form serialization in semantic order. If your - * form must be submitted with name/value pairs in semantic order then pass true for this arg, - * otherwise pass false (or nothing) to avoid the overhead for this logic (which can be - * significant for very large forms). - * - * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this: - * - * $("#form-id").submit(function() { - * $(this).ajaxSubmit(options); - * return false; // cancel conventional submit - * }); - * - * When using ajaxForm(), however, this is done for you. - * - * - * Notes for using form.js with jQuery versions prior to 1.0.2 - * ----------------------------------------------------------- - * 1. When using jQuery version < 1.0.2 if you do not specify a 'target' option then the 'after' - * callback method is passed the XMLHttpRequest object instead of the response data. - * This quirk was fixed in jQuery 1.0.2. - * - * 2. When using jQuery version < 1.0.1 the 'json' dataType value is not supported. - * - * - * - * @example - * var options = { - * target: '#myTargetDiv' - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Submit form and update page element with server response - * - * - * @example - * var options = { - * after: function(responseText) { - * alert(responseText); - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Submit form and alert the server response - * - * - * @example - * var options = { - * before: function(formArray, jqForm) { - * if (formArray.length == 0) { - * alert('Please enter data.'); - * return false; - * } - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Pre-submit validation which aborts the submit operation if form data is empty - * - * - * @example - * var options = { - * url: myJsonUrl.php, - * dataType: 'json', - * after: function(data) { - * // 'data' is an object representing the the evaluated json data - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc json data returned and evaluated - * - * - * @example - * var options = { - * url: myXmlUrl.php, - * dataType: 'xml', - * after: function(responseXML) { - * // responseXML is XML document object - * var data = $('myElement', responseXML).text(); - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc XML data returned from server - * - * - * @example - * $('#myForm).submit(function() { - * $(this).ajaxSubmit(); - * return false; - * }); - * @desc Bind form's submit event to use ajaxSubmit - * - * - * @name ajaxSubmit - * @type jQuery - * @param options object literal containing options which control the form submission process - * @cat Plugins/Form - * @return jQuery - * @see formToArray - * @see ajaxForm - * @see load - * @see $.ajax - * @author jQuery Community - */ -jQuery.fn.ajaxSubmit = function(options) { - options = jQuery.extend({ - target: null, - url: this.attr('action') || '', - method: this.attr('method') || 'GET', - before: null, - after: null, - dataType: null, // 'xml', 'script', or 'json' (@see jQuery.httpData) - semantic: false - }, options || {}); - - var a = this.formToArray(options.semantic); - - // give pre-submit callback an opportunity to abort the submit - if (options.before && options.before(a, this) === false) return; - - var q = jQuery.param(a); - var get = (options.method && options.method.toUpperCase() == 'GET'); - - if (get) - // if url already has a '?' then append args after '&' - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) - jQuery(options.target).load(options.url, get ? null : a, options.after); - else - jQuery.ajax({ - url: options.url, - success: options.after, - type: options.method, - dataType: options.dataType, - data: get ? null : q // data is null for 'get' or the query string for 'post' - }); - return this; -}; - - -/** - * ajaxForm() provides a mechanism for fully automating form submission. - * - * The advantages of using this method instead of ajaxSubmit() are: - * - * 1: This method will include coordinates for <input type="image" /> elements (if the element - * is used to submit the form). - * 2. This method will include the submit element's name/value data (for the element that was - * used to submit the form). - * 3. This method binds the submit() method to the form for you. - * - * Note that for accurate x/y coordinates of image submit elements in all browsers - * you need to also use the "dimensions" plugin (this method will auto-detect its presence). - * - * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely - * passes the options argument along after properly binding events for submit elements and - * the form itself. See ajaxSubmit for a full description of the options argument and for - * notes on usage with down-rev versions of jQuery. - * - * - * @example - * var options = { - * target: '#myTargetDiv' - * }; - * $('#myForm').ajaxSForm(options); - * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response - * when the form is submitted. - * - * - * @example - * var options = { - * after: function(responseText) { - * alert(responseText); - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Bind form's submit event so that server response is alerted after the form is submitted. - * - * - * @example - * var options = { - * before: function(formArray, jqForm) { - * if (formArray.length == 0) { - * alert('Please enter data.'); - * return false; - * } - * } - * }; - * $('#myForm').ajaxSubmit(options); - * @desc Bind form's submit event so that pre-submit callback is invoked before the form - * is submitted. - * - * - * @name ajaxForm - * @param options object literal containing options which control the form submission process - * @return jQuery - * @cat Plugins/Form - * @type jQuery - * @see ajaxSubmit - * @author jQuery Community - */ -jQuery.fn.ajaxForm = function(options) { - return this.each(function() { - jQuery("input:submit,input:image", this).click(function(ev) { - this.form.clk = this; - - if (ev.offsetX != undefined) { - this.form.clk_x = ev.offsetX; - this.form.clk_y = ev.offsetY; - } else if (typeof jQuery.fn.offset == 'function') { // try to use dimensions plugin - var offset = $(this).offset(); - this.form.clk_x = ev.pageX - offset.left; - this.form.clk_y = ev.pageY - offset.top; - } else { - this.form.clk_x = ev.pageX - this.offsetLeft; - this.form.clk_y = ev.pageY - this.offsetTop; - } - }) - }).submit(function(e) { - jQuery(this).ajaxSubmit(options); - return false; - }); -}; - - -/** - * formToArray() gathers form element data into an array of objects that can - * be passed to any of the following ajax functions: $.get, $.post, or load. - * Each object in the array has both a 'name' and 'value' property. An example of - * an array for a simple login form might be: - * - * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] - * - * It is this array that is passed to pre-submit callback functions provided to the - * ajaxSubmit() and ajaxForm() methods. - * - * The semantic argument can be used to force form serialization in semantic order. - * If your form must be submitted with name/value pairs in semantic order then pass - * true for this arg, otherwise pass false (or nothing) to avoid the overhead for - * this logic (which can be significant for very large forms). - * - * @example var data = $("#myForm").formToArray(); - * $.post( "myscript.cgi", data ); - * @desc Collect all the data from a form and submit it to the server. - * - * @name formToArray - * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) - * @type Array<Object> - * @cat Plugins/Form - * @see ajaxForm - * @see ajaxSubmit - * @author jQuery Community - */ -jQuery.fn.formToArray = function(semantic) { - var a = []; - var q = semantic ? ':input' : 'input,textarea,select,button'; - - jQuery(q, this).each(function() { - var n = this.name; - var t = this.type; - - if ( !n || this.disabled || t == 'reset' || - (t == 'checkbox' || t == 'radio') && !this.checked || - (t == 'submit' || t == 'image' || t == 'button') && this.form && this.form.clk != this || - this.tagName.toLowerCase() == 'select' && this.selectedIndex == -1) - return; - - if (t == 'image' && this.form.clk_x != undefined) - return a.push( - {name: n+'_x', value: this.form.clk_x}, - {name: n+'_y', value: this.form.clk_y} - ); - - if (t == 'select-multiple') { - for(var i=0; i < this.options.length; i++) - if (this.options[i].selected) - a.push({name: n, value: this.options[i].value}); - return; - } - a.push({name: n, value: this.value}); - }); - return a; -}; - -/** - * Serializes form data into a 'submittable' string. This method will return a string - * in the format: name1=value1&name2=value2 - * - * The semantic argument can be used to force form serialization in semantic order. - * If your form must be submitted with name/value pairs in semantic order then pass - * true for this arg, otherwise pass false (or nothing) to avoid the overhead for - * this logic (which can be significant for very large forms). - * - * @example var data = $("#myForm").formSerialize(); - * $.ajax('POST', "myscript.cgi", data); - * @desc Collect all the data from a form into a single string - * - * @name formSerialize - * @param semantic true if serialization must maintain strict semantic ordering of elements (slower) - * @type String - * @cat Plugins/Form - * @see formToArray - * @author jQuery Community - */ -jQuery.fn.formSerialize = function(semantic) { - //hand off to jQuery.param for proper encoding - return jQuery.param(this.formToArray(semantic)); -}; -// A plugin that wraps all ajax calls introducing a fixed callback function on ajax complete - -var load_handlers = new Array(); -// -// Add a function to the list of those to be executed on ajax load complete -// -function onAjaxLoad(f) { - load_handlers.push(f); -}; - -// -// Call the functions that have been added to onAjaxLoad -// -function triggerAjaxLoad(root) { - for ( var i = 0; i < load_handlers.length; i++ ) - load_handlers[i].apply( root ); -}; - -jQuery.fn._load = jQuery.fn.load; - -jQuery.fn.load = function( url, params, callback, ifModified ) { - - callback = callback || function(){}; - - // If the second parameter was provided - if ( params ) { - // If it's a function - if ( params.constructor == Function ) { - // We assume that it's the callback - callback = params; - params = null; - } - } - var callback2 = function(res,status) {triggerAjaxLoad(this);callback(res,status);}; - - return this._load( url, params, callback2, ifModified ); -}; - - -jQuery._ajax = jQuery.ajax; - -jQuery.ajax = function( type, url, data, ret, ifModified ) { - - //If called by _load exit now because the callback has already been set - if (jQuery.ajax.caller==jQuery.fn._load) return jQuery._ajax( type, url, data, ret, ifModified ); - // If only a single argument was passed in, - // assume that it is a object of key/value pairs - if ( !url ) { - var orig_complete = type.complete || function() {}; - type.complete = function(res,status) {triggerAjaxLoad(document);orig_complete(res,status);}; - } else { - var orig_ret = ret || function() {}; - ret = function(res,status) {triggerAjaxLoad(document);orig_ret(res,status);}; - } - - return jQuery._ajax( type, url, data, ret, ifModified ); - -}; diff --git a/dist/jquery.js.html b/dist/jquery.js.html index ce0ada39f6..12158703d3 100644 --- a/dist/jquery.js.html +++ b/dist/jquery.js.html @@ -6,4 +6,6 @@ #CACHE{7*24*3600,cache-client} #HTTP_HEADER{'Content-Type: text/javascript'} -[(#CHEMIN{javascript/jquery-1.0.3-forms.js}|spip_file_get_contents)] +[(#CHEMIN{javascript/jquery-1.0.3.js}|spip_file_get_contents)] +[(#CHEMIN{javascript/form.js}|spip_file_get_contents)] +[(#CHEMIN{javascript/ajaxCallback.js}|spip_file_get_contents)] -- GitLab