PageSourceSearch

https://www.paris-prix.com/modules/pm_advancedsearch4/views/js/jquery.form.js

js paris-prix.com collected 2026-09-29 23:03:17 UTC 12,127 bytes, 11 lines download raw bytes

1/*!
2 * jQuery Form Plugin
3 * version: 2.73 (03-MAY-2011)
4 * @requires jQuery v1.3.2 or later
5 *
6 * Examples and documentation at: http://malsup.com/jquery/form/
7 * Dual licensed under the MIT and GPL licenses:
8 *   http://www.opensource.org/licenses/mit-license.php
9 *   http://www.gnu.org/licenses/gpl.html
10 */
11!function($){function log(){if($.fn.ajaxSubmit.debug){var msg="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(msg):window.opera&&window.opera.postError&&window.opera.postError(msg)}}$.fn.ajaxSubmit=function(options){if(!this.length)return log("ajaxSubmit: skipping submit process - no element selected"),this;"function"==typeof options&&(options={success:options});var action=this.attr("action"),url="string"==typeof action?$.trim(action):"";url&&(url=(url.match(/^([^#]+)/)||[])[1]),url=url||window.location.href||"",options=$.extend(!0,{url:url,success:$.ajaxSettings.success,type:this[0].getAttribute("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},options);var veto={};if(this.trigger("form-pre-serialize",[this,options,veto]),veto.veto)return log("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(options.beforeSerialize&&!1===options.beforeSerialize(this,options))return log("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var n,v,a=this.formToArray(options.semantic);if(options.data)for(n in options.extraData=options.data,options.data)if(options.data[n]instanceof Array)for(var k in options.data[n])a.push({name:n,value:options.data[n][k]});else v=options.data[n],v=$.isFunction(v)?v():v,a.push({name:n,value:v});if(options.beforeSubmit&&!1===options.beforeSubmit(a,this,options))return log("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[a,this,options,veto]),veto.veto)return log("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var q=$.param(a);"GET"==options.type.toUpperCase()?(options.url+=(options.url.indexOf("?")>=0?"&":"?")+q,options.data=null):options.data=q;var $form=this,callbacks=[];if(options.resetForm&&callbacks.push(function(){$form.resetForm()}),options.clearForm&&callbacks.push(function(){$form.clearForm()}),!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?"replaceWith":"html";$(options.target)[fn](data).each(oldSuccess,arguments)})}else options.success&&callbacks.push(options.success);options.success=function(data,status,xhr){for(var context=options.context||options,i=0,max=callbacks.length;i<max;i++)callbacks[i].apply(context,[data,status,xhr||$form,$form])};var fileInputs=$("input:file",this).length>0,mp="multipart/form-data",multipart=$form.attr("enctype")==mp||$form.attr("encoding")==mp;return!1!==options.iframe&&(fileInputs||options.iframe||multipart)?options.closeKeepAlive?$.get(options.closeKeepAlive,fileUpload):fileUpload():$.ajax(options),this.trigger("form-submit-notify",[this,options]),this;function fileUpload(){var form=$form[0];if($(":input[name=submit],:input[id=submit]",form).length)alert('Error: Form elements must not have name or id of "submit".');else{var s=$.extend(!0,{},$.ajaxSettings,options);s.context=s.context||s;var id="jqFormIO"+(new Date).getTime(),$io=$('<iframe id="'+id+'" name="'+id+'" src="'+s.iframeSrc+'" />'),io=$io[0];$io.css({position:"absolute",top:"-1000px",left:"-1000px"});var xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e="timeout"===status?"timeout":"aborted";log("aborting upload... "+e),this.aborted=1,$io.attr("src",s.iframeSrc),xhr.error=e,s.error&&s.error.call(s.context,xhr,e,e),g&&$.event.trigger("ajaxError",[xhr,s,e]),s.complete&&s.complete.call(s.context,xhr,e)}},g=s.global;if(g&&!$.active++&&$.event.trigger("ajaxStart"),g&&$.event.trigger("ajaxSend",[xhr,s]),s.beforeSend&&!1===s.beforeSend.call(s.context,xhr,s))s.global&&$.active--;else if(!xhr.aborted){var timeoutHandle,timedOut=0,sub=form.clk;if(sub){var n=sub.name;n&&!sub.disabled&&(s.extraData=s.extraData||{},s.extraData[n]=sub.value,"image"==sub.type&&(s.extraData[n+".x"]=form.clk_x,s.extraData[n+".y"]=form.clk_y))}s.forceSync?doSubmit():setTimeout(doSubmit,10);var data,callbackProcessed,domCheckCount=50,toXml=$.parseXML||function(s,doc){return window.ActiveXObject?((doc=new ActiveXObject("Microsoft.XMLDOM")).async="false",doc.loadXML(s)):doc=(new DOMParser).parseFromString(s,"text/xml"),doc&&doc.documentElement&&"parsererror"!=doc.documentElement.nodeName?doc:null},parseJSON=$.parseJSON||function(s){return window.eval("("+s+")")},httpData=function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml="xml"===type||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;return xml&&"parsererror"===data.documentElement.nodeName&&$.error&&$.error("parsererror"),s&&s.dataFilter&&(data=s.dataFilter(data,type)),"string"==typeof data&&("json"===type||!type&&ct.indexOf("json")>=0?data=parseJSON(data):("script"===type||!type&&ct.indexOf("javascript")>=0)&&$.globalEval(data)),data}}}function doSubmit(){var t=$form.attr("target"),a=$form.attr("action");form.setAttribute("target",id),"POST"!=form.getAttribute("method")&&form.setAttribute("method","POST"),form.getAttribute("action")!=s.url&&form.setAttribute("action",s.url),s.skipEncodingOverride||$form.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),s.timeout&&(timeoutHandle=setTimeout(function(){timedOut=!0,cb(!0)},s.timeout));var extraInputs=[];try{if(s.extraData)for(var n in s.extraData)extraInputs.push($('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />').appendTo(form)[0]);$io.appendTo("body"),io.attachEvent?io.attachEvent("onload",cb):io.addEventListener("load",cb,!1),form.submit()}finally{form.setAttribute("action",a),t?form.setAttribute("target",t):$form.removeAttr("target"),$(extraInputs).remove()}}function cb(e){if(!xhr.aborted&&!callbackProcessed)if(!0===e&&xhr)xhr.abort("timeout");else{var doc=io.contentWindow?io.contentWindow.document:io.contentDocument?io.contentDocument:io.document;if(doc&&doc.location.href!=s.iframeSrc||timedOut){io.detachEvent?io.detachEvent("onload",cb):io.removeEventListener("load",cb,!1);var ok=!0;try{if(timedOut)throw"timeout";var isXml="xml"==s.dataType||doc.XMLDocument||$.isXMLDoc(doc);if(log("isXml="+isXml),!isXml&&window.opera&&(null==doc.body||""==doc.body.innerHTML)&&--domCheckCount)return log("requeing onLoad callback, DOM not available"),void setTimeout(cb,250);xhr.responseText=doc.body?doc.body.innerHTML:doc.documentElement?doc.documentElement.innerHTML:null,xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc,isXml&&(s.dataType="xml"),xhr.getResponseHeader=function(header){return{"content-type":s.dataType}[header]};var scr=/(json|script|text)/.test(s.dataType);if(scr||s.textarea){var ta=doc.getElementsByTagName("textarea")[0];if(ta)xhr.responseText=ta.value;else if(scr){var pre=doc.getElementsByTagName("pre")[0],b=doc.getElementsByTagName("body")[0];pre?xhr.responseText=pre.textContent:b&&(xhr.responseText=b.innerHTML)}}else"xml"!=s.dataType||xhr.responseXML||null==xhr.responseText||(xhr.responseXML=toXml(xhr.responseText));data=httpData(xhr,s.dataType,s)}catch(e){log("error caught:",e),ok=!1,xhr.error=e,s.error&&s.error.call(s.context,xhr,"error",e),g&&$.event.trigger("ajaxError",[xhr,s,e])}xhr.aborted&&(log("upload aborted"),ok=!1),ok&&(s.success&&s.success.call(s.context,data,"success",xhr),g&&$.event.trigger("ajaxSuccess",[xhr,s])),g&&$.event.trigger("ajaxComplete",[xhr,s]),g&&! 
11--$.active&&$.event.trigger("ajaxStop"),s.complete&&s.complete.call(s.context,xhr,ok?"success":"error"),callbackProcessed=!0,s.timeout&&clearTimeout(timeoutHandle),setTimeout(function(){$io.removeData("form-plugin-onload"),$io.remove(),xhr.responseXML=null},100)}}}}},$.fn.ajaxForm=function(options){if(0===this.length){var o={s:this.selector,c:this.context};return!$.isReady&&o.s?(log("DOM not ready, queuing ajaxForm"),$(function(){$(o.s,o.c).ajaxForm(options)}),this):(log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)")),this)}return this.ajaxFormUnbind().bind("submit.form-plugin",function(e){e.isDefaultPrevented()||(e.preventDefault(),$(this).ajaxSubmit(options))}).bind("click.form-plugin",function(e){var target=e.target,$el=$(target);if(!$el.is(":submit,input:image")){var t=$el.closest(":submit");if(0==t.length)return;target=t[0]}var form=this;if(form.clk=target,"image"==target.type)if(null!=e.offsetX)form.clk_x=e.offsetX,form.clk_y=e.offsetY;else if("function"==typeof $.fn.offset){var offset=$el.offset();form.clk_x=e.pageX-offset.left,form.clk_y=e.pageY-offset.top}else form.clk_x=e.pageX-target.offsetLeft,form.clk_y=e.pageY-target.offsetTop;setTimeout(function(){form.clk=form.clk_x=form.clk_y=null},100)})},$.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},$.fn.formToArray=function(semantic){var a=[];if(0===this.length)return a;var i,j,n,v,el,max,jmax,form=this[0],els=semantic?form.getElementsByTagName("*"):form.elements;if(!els)return a;for(i=0,max=els.length;i<max;i++)if(n=(el=els[i]).name)if(semantic&&form.clk&&"image"==el.type)el.disabled||form.clk!=el||(a.push({name:n,value:$(el).val()}),a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y}));else if((v=$.fieldValue(el,!0))&&v.constructor==Array)for(j=0,jmax=v.length;j<jmax;j++)a.push({name:n,value:v[j]});else null!=v&&a.push({name:n,value:v});if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];(n=input.name)&&!input.disabled&&"image"==input.type&&(a.push({name:n,value:$input.val()}),a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y}))}return a},$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic))},$.fn.fieldSerialize=function(successful){var a=[];return this.each(function(){var n=this.name;if(n){var v=$.fieldValue(this,ful);if(v&&v.constructor==Array)for(var i=0,max=v.length;i<max;i++)a.push({name:n,value:v[i]});else null!=v&&a.push({name:this.name,value:v})}}),$.param(a)},$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i],v=$.fieldValue(el,successful);null==v||v.constructor==Array&&!v.length||(v.constructor==Array?$.merge(val,v):val.push(v))}return val},$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(void 0===successful&&(successful=!0),successful&&(!n||el.disabled||"reset"==t||"button"==t||("checkbox"==t||"radio"==t)&&!el.checked||("submit"==t||"image"==t)&&el.form&&el.form.clk!=el||"select"==tag&&-1==el.selectedIndex))return null;if("select"==tag){var index=el.selectedIndex;if(index<0)return null;for(var a=[],ops=el.options,one="select-one"==t,max=one?index+1:ops.length,i=one?index:0;i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(v||(v=op.attributes&&op.attributes.value&&!op.attributes.value.specified?op.text:op.value),one)return v;a.push(v)}}return a}return $(el).val()},$.fn.clearForm=function(){return this.each(function(){$("input,select,textarea",this).clearFields()})},$.fn.clearFields=$.fn.clearInputs=function(){return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();"text"==t||"password"==t||"textarea"==tag?this.value="":"checkbox"==t||"radio"==t?this.checked=!1:"select"==tag&&(this.selectedIndex=-1)})},$.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},$.fn.enable=function(b){return void 0===b&&(b=!0),this.each(function(){this.disabled=!b})},$.fn.selected=function(select){return void 0===select&&(select=!0),this.each(function(){var t=this.t
11ype;if("checkbox"==t||"radio"==t)this.checked=select;else if("option"==this.tagName.toLowerCase()){var $sel=$(this).parent("select");select&&$sel[0]&&"select-one"==$sel[0].type&&$sel.find("option").selected(!1),this.selected=select}})}}($);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.