( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/tmpr/..//tmpr/../tmpr/..//tmpr/../tmpr/..//elementsMachine/simple-xhr-uploader.min.js
/*!
 * simple-xhr-uploader v0.1.0
 * https://github.com/cihadtekin/simple-xhr-uploader
 * 
 * Copyright 2016 Cihad Tekin <cihadtekin@gmail.com>
 * Licensed under MIT
 */
!function(a,b){"use strict";function c(a,b,d,f){var g,h;if(b?void 0===d&&(d=[]):void 0===d&&(d=new FormData),"object"!==e(a)&&("array"===!e(a)||!f))return d;if("number"===e(f)&&(f+=""),"object"===e(a))for(var i in a)if("object"===e(a[i])||"array"===e(a[i]))g=f?f+"["+i+"]":i,d=c(a[i],b,d,g);else{if("string"!==e(a[i])&&"number"!==e(a[i]))continue;g=i,f&&(g=f+"["+i+"]"),b?d.push(g+"="+a[i]):d.append(g,a[i])}else{for(var j=0;j<a.length;j++)"object"!==e(a[j])&&"array"!==e(a[j])||(h=!0);for(var j=0;j<a.length;j++)if("object"===e(a[j])||"array"===e(a[j]))g=f?f+"["+j+"]":j,d=c(a[j],b,d,g);else{if("string"!==e(a[j])&&"number"!==e(a[j]))continue;g=i,f&&(g=h?f+"["+j+"]":f+"[]"),b?d.push(g+"="+a[j]):d.append(g,a[j])}}return void 0===f&&b?d.join("&"):d}function d(a){var b=a.getResponseHeader("content-type"),c=a.responseText;switch(b){case"application/javascript":case"application/json":try{c=JSON.parse(c)}catch(d){}return c;default:return c}}function e(a){return Object.prototype.toString.apply(a).replace(/\[object (.*?)\]/,"$1").toLowerCase()}var f="uploader",g="XMLHttpRequest"in a&&"FormData"in a;a[f]=function(a,c){var d=this,g="";if(c=b.extend({},b.fn[f].defaults,{name:a.attr("name")||a.data("name")||void 0,url:a.data("url")||void 0,multiple:!!a.data("multiple")||a.prop("multiple")||void 0,accept:a.attr("accept")||a.data("accept")||void 0},c||{}),void 0===c.url)throw new Error('"url" is required');"object"!==e(c.xhr)&&(c.xhr={}),c.multiple&&(g="multiple"),c.accept&&("string"===e(c.accept)?g+=' accept="'+c.accept+'"':"array"===e(c.accept)&&c.accept.length>0&&(g+=' accept=".'+c.accept.join(",.")+'"')),d.el=a,d.name=c.name,d.input=a.is('input[type="file"]')?a:b('<input type="file" '+g+" />"),d.url=c.url,d.data=c.data||{},d.files=[],d.queue=0,d.loaded=0,d.total=0,d.uploading=!1,d.start=c.start?[c.start]:[],d.progress=c.progress?[c.progress]:[],d.complete=c.complete?[c.complete]:[],d.xhr={before:c.xhr.before?[c.xhr.before]:[],start:c.xhr.start?[c.xhr.start]:[],progress:c.xhr.progress?[c.xhr.progress]:[],success:c.xhr.success?[c.xhr.success]:[],error:c.xhr.error?[c.xhr.error]:[],complete:c.complete?[c.complete]:[]},d.input.change(function(a){this.files.length>0&&!this.uploading&&(d.files=this.files,d.send())}),d.el.click(function(){d.uploading||d.input===d.el||d.input.click()}),c.defaultProgressBar&&b.fn[f].defaultProgressBar.call(this)},a[f].prototype.send=function(){var a,b=this,e=new XMLHttpRequest,f=b.files[b.queue];if(!f)return!1;if(0===b.queue){if(b.uploading)return!1;b.total=0,b.loaded=0;for(var g=0;g<b.files.length;g++)b.total+=b.files[g].size;this.trigger("start",[b.total]),b.uploading=!0}b.trigger("xhr.before",[f,e]),a=c(b.data),a.append(b.name,f),e.onreadystatechange=function(a){var c;1===this.readyState?b.trigger("xhr.start",[b.queue,f,e,a]):4===this.readyState&&(c=[d(this),b.queue,f,e,a],200===this.status?b.trigger("xhr.success",c):b.trigger("xhr.error",c),b.trigger("xhr.complete",c),b.files[++b.queue]?b.send():(b.trigger("complete",[b.queue-1,f]),b.input.wrap("<form />").parents("form")[0].reset(),b.input.unwrap(),b.loaded=0,b.total=0,b.queue=0,b.uploading=!1))},e.upload.addEventListener("progress",function(a){var c=a.loaded*f.size/a.total;b.loaded+=c,b.trigger("xhr.progress",[c,f.size,b.queue,f,e,a]),b.trigger("progress",[b.loaded,b.total,b.queue,f,e,a])},!1),e.open("POST",b.url),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.send(a)},a[f].prototype.bind=function(a,b){var c=a.match(/^xhr\.(\w+)/);return c?this.xhr[c[1]].push(b):this[a].push(b),this},a[f].prototype.trigger=function(a,b){var c,d=a.match(/^xhr\.(\w+)/);c=d?this.xhr[d[1]]:this[a];for(var e=0;e<c.length;e++)c[e].apply(this,b);return this},b.fn[f]=function(c,d){var e=[];return g?(b(this).each(function(){var g=b(this);if("string"==typeof c){var h=g.data(f),i=c,j=null;void 0!==h&&void 0!==h[i]&&(j=h[i](d))&&e.push(j)}else if(!g.data(f)){var h;h=new a[f](g,c),g.data(f,h),e.push(h)}}),1===e.length?e[0]:e):!1},b.fn[f].support=g,b.fn[f].defaults={url:"",name:"file",data:{},multiple:!1,accept:[],defaultProgressBar:!0,start:null,progress:null,complete:null,xhr:{start:null,progress:null,success:null,error:null,complete:null}},b.fn[f].defaultProgressBar=function(c){var c,d;this.bind("start",function(){d&&a.clearTimeout(d),c||("string"===e(c)||"object"===e(c)?(c=b(c),0===c.length&&(c=void 0)):c=void 0,c=b('<div class="simple-xhr" />').append('<div class="simple-xhr-progress" />').append('<div class="simple-xhr-files" />').insertAfter(c||this.el).hide()),c.show(),c.find(".simple-xhr-files").html(""),c.find(".simple-xhr-progress").html("");for(var f=0;f<this.files.length;f++)c.find(".simple-xhr-files").append('<div class="simple-xhr-file-item">'+this.files[f].name+' <span class="result">queued</span></div>')}),this.bind("xhr.start",function(a,b){c.find(".simple-xhr-progress").append('<div class="simple-xhr-progress-bar" />'),c.find(".simple-xhr-files .simple-xhr-file-item:eq("+a+") .result").html("loaded. Refresh page");/* location.reload();*/}),this.bind("xhr.progress",function(a,b,d){Math.round(100*a/b);c.find(".simple-xhr-progress .simple-xhr-progress-bar:eq("+d+")").css("width",100*a/this.total+"%")}),this.bind("xhr.success",function(a,b){c.find(".simple-xhr-progress .simple-xhr-progress-bar:eq("+b+")").addClass("simple-xhr-progress-bar-success"),c.find(".simple-xhr-files .simple-xhr-file-item:eq("+b+") .result").html("completed")}),this.bind("xhr.error",function(a,b){c.find(".simple-xhr-progress .simple-xhr-progress-bar:eq("+b+")").addClass("simple-xhr-progress-bar-error"),c.find(".simple-xhr-files .simple-xhr-file-item:eq("+b+") .result").html("Error: "+a.message)}),this.bind("complete",function(){c.find(".filename").html("Completed"),d=a.setTimeout(function(){c.hide(),c.find(".filename").html(""),c.find(".simple-xhr-progress").html("")},5e3)})}}(window,jQuery);