primo commit
This commit is contained in:
15
media/fef/js/Ajax.min.js
vendored
Normal file
15
media/fef/js/Ajax.min.js
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
/*
|
||||
Akeeba Frontend Framework (FEF)
|
||||
|
||||
@package fef
|
||||
@copyright (c) 2017-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
|
||||
@license GNU General Public License version 3, or later
|
||||
*/
|
||||
window.akeeba=window.akeeba||{};window.akeeba.Ajax=window.akeebaAjax||{xhrSuccessStatus:{0:200,1223:204},requestArray:[],processingQueue:!1};
|
||||
akeeba.Ajax.ajax=function(b,a){"undefined"==typeof a&&(a=b,b=a.url);var c="undefined"==typeof a.type?"POST":a.type;c=c.toUpperCase();var e="undefined"==typeof a.data?{}:a.data,h=null,k="undefined"==typeof a.success?null:a.success,f="undefined"==typeof a.error?null:a.error;if("undefined"==typeof a.cache||!a.url){var l=(new Date).getTime()/1E3,m=parseInt(l,10);e._cacheBustingJunk=Math.round(1E3*(l-m))/1E3}"POST"==c||"PUT"==c?h=this.interpolateParameters(e):(b+=-1==b.indexOf("?")?"?":"&",b+=this.interpolateParameters(e));
|
||||
var d=new XMLHttpRequest;d.open(c,b);"POST"!=c&&"PUT"!=c||d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");d.onload=function(g){g=akeeba.Ajax.xhrSuccessStatus[d.status]||d.status;var n=d.statusText,p="text"!==(d.responseType||"text")||"string"!==typeof d.responseText?d.response:d.responseText;d.getAllResponseHeaders();200===g?null!=k&&akeeba.Ajax.triggerCallbacks(k,p,n,d):f&&akeeba.Ajax.triggerCallbacks(f,d,"error",null)};d.onerror=function(g){f&&akeeba.Ajax.triggerCallbacks(f,
|
||||
d,"error",null)};window.attachEvent&&!window.addEventListener&&(d.onreadystatechange=function(){if(4===this.readyState){var g=akeeba.Ajax.xhrSuccessStatus[this.status]||this.status;if(200<=g&&400>g)d.onload();else d.onerror()}});d.ontimeout=function(){f&&akeeba.Ajax.triggerCallbacks(f,d,"timeout",null)};d.onabort=function(){f&&akeeba.Ajax.triggerCallbacks(f,d,"abort",null)};b="undefined"==typeof a.timeout?6E5:a.timeout;0<b&&(d.timeout=b);"undefined"!=typeof a.beforeSend&&!1===a.beforeSend(d,a)||d.send(h)};
|
||||
akeeba.Ajax.enqueue=function(b,a){"undefined"==typeof a&&(a=b,b=a.url);a.url=b;akeeba.Ajax.requestArray.push(a);akeeba.Ajax.processQueue()};akeeba.Ajax.interpolateParameters=function(b,a){a=a||"";var c="",e;for(e in b)b.hasOwnProperty(e)&&(0<c.length&&(c+="&"),c="object"!==typeof b[e]?""===a?c+(encodeURIComponent(e)+"="+encodeURIComponent(b[e])):c+(encodeURIComponent(a)+"["+encodeURIComponent(e)+"]="+encodeURIComponent(b[e])):c+akeeba.Ajax.interpolateParameters(b[e],e));return c};
|
||||
akeeba.Ajax.triggerCallbacks=function(){var b=Array.prototype.slice.call(arguments),a=b.shift();if("function"==typeof a)return a.apply(null,b);if(a instanceof Array)for(var c=0;c<a.length;c++)if(!1===a[c].apply(null,b))return!1;return null};akeeba.Ajax.processQueueHelper=function(){akeeba.Ajax.processingQueue=!1;setTimeout(akeeba.Ajax.processQueue,50)};
|
||||
akeeba.Ajax.processQueue=function(){if(!akeeba.Ajax.requestArray.length)akeeba.Ajax.processingQueue=!1;else if(!akeeba.Ajax.processingQueue){var b=akeeba.Ajax.requestArray.shift(),a=b.url,c="undefined"==typeof b.success?[]:b.success,e="undefined"==typeof b.error?[]:b.error;"object"==typeof c&&c instanceof Array||(c=[c]);"object"==typeof e&&e instanceof Array||(e=[e]);c.unshift(akeeba.Ajax.processQueueHelper);e.unshift(akeeba.Ajax.processQueueHelper);b.success=c;b.error=e;akeeba.Ajax.processingQueue=
|
||||
!0;akeeba.Ajax.ajax(a,b)}}; //# sourceMappingURL=Ajax.map
|
||||
Reference in New Issue
Block a user