File: public/assets/fileuploader/fileuploader.min.js

Recommend this page to a friend!
  Classes of Aby Dahana  >  Aksara  >  public/assets/fileuploader/fileuploader.min.js  >  Download  
File: public/assets/fileuploader/fileuploader.min.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Aksara
A CodeIgniter based API and CRUD generator
Author: By
Last change: Update of public/assets/fileuploader/fileuploader.min.js
Date: 3 months ago
Size: 28,546 bytes
 

Contents

Class file image Download
/**
 * FileUploader
 * Copyright (c) 2017 Innostudio.de
 * Website: http://innostudio.de/fileuploader/
 * Version: 1.0 (15-Mar-2017)
 * Requires: jQuery v1.7.1 or later
 * License: GPLv3 license
 */
!function($){$.fn.fileuploader=function(q){return this.each(function(t,r){var s=$(r),p=null,o=null,l=null,sl=[],n=$.extend(!0,{},$.fn.fileuploader.defaults,q),f={init:function(){return s.closest(".fileuploader").length||s.wrap('<div class="fileuploader"></div>'),p=s.closest(".fileuploader"),f.set("attrOpts"),f.isSupported()?(!n.beforeRender||!$.isFunction(n.beforeRender)||!1!==n.beforeRender(p,s))&&(f.redesign(),n.files&&f.files.append(n.files),f.rendered=!0,n.afterRender&&$.isFunction(n.afterRender)&&n.afterRender(l,p,o,s),void(f.disabled||f.bindUnbindEvents(!0))):(n.onSupportError&&$.isFunction(n.onSupportError)&&n.onSupportError(p,s),!1)},bindUnbindEvents:function(e){return 0==$("[role=uploader]").length?void window.alert("warning!!!"):(e&&f.bindUnbindEvents(!1),s[e?"on":"off"](f._assets.getAllEvents(),f.onEvent),n.changeInput&&o!==s&&o[e?"on":"off"]("click",f.clickHandler),n.dragDrop&&f.isUploadMode()&&n.dragDrop.container.length&&(n.dragDrop.container[e?"on":"off"]("drag dragstart dragend dragover dragenter dragleave drop",function(e){e.preventDefault()}),n.dragDrop.container[e?"on":"off"]("drop",f.dragDrop.onDrop),n.dragDrop.container[e?"on":"off"]("dragover",f.dragDrop.onDragEnter),n.dragDrop.container[e?"on":"off"]("dragleave",f.dragDrop.onDragLeave)),f.isUploadMode()&&n.clipboardPaste&&$(window)[e?"on":"off"]("paste",f.clipboard.paste),void s.closest("form")[e?"on":"off"]("reset",f.reset))},redesign:function(){if(o=s,n.theme&&p.addClass("fileuploader-theme-"+n.theme),n.changeInput){switch((typeof n.changeInput).toLowerCase()){case"boolean":o=$('<div class="fileuploader-input"><div class="fileuploader-input-caption"><span>'+f._assets.textParse(n.captions.feedback)+'</span></div><div class="fileuploader-input-button"><span>'+f._assets.textParse(n.captions.button)+"</span></div></div>");break;case"string":" "!=n.changeInput&&(o=$(f._assets.textParse(n.changeInput,n)));break;case"object":o=$(n.changeInput);break;case"function":o=$(n.changeInput(s,p,n,f._assets.textParse))}s.after(o),s.css({position:"absolute","z-index":"-9999",height:"0",width:"0",padding:"0",margin:"0","line-height":"0",outline:"0",border:"0",opacity:"0"})}n.thumbnails&&f.thumbnails.create(),n.dragDrop&&(n.dragDrop="object"!=typeof n.dragDrop?{container:null}:n.dragDrop,n.dragDrop.container=n.dragDrop.container?$(n.dragDrop.container):o)},clickHandler:function(e){return e.preventDefault(),f.clipboard._timer?void f.clipboard.clean():void s.click()},onEvent:function(e){switch(e.type){case"focus":p&&p.addClass("fileuploader-focused");break;case"blur":p&&p.removeClass("fileuploader-focused");break;case"change":f.onChange.call(this)}n.listeners&&$.isFunction(n.listeners[e.type])&&n.listeners[e.type].call(s,p)},set:function(e,t){switch(e){case"attrOpts":var i=["limit","maxSize","fileMaxSize","extensions","changeInput","theme","addMore","listInput","files"];for(var a in i){var l="data-fileuploader-"+i[a];if(f._assets.hasAttr(l))switch(i[a]){case"changeInput":case"addMore":case"listInput":n[i[a]]=-1<["true","false"].indexOf(s.attr(l))?"true"==s.attr(l):s.attr(l);break;case"extensions":n[i[a]]=s.attr(l).replace(/ /g,"").split(",");break;case"files":n[i[a]]=JSON.parse(s.attr(l));break;default:n[i[a]]=s.attr(l)}s.removeAttr(l)}null==s.attr("disabled")&&null==s.attr("readonly")&&0!==n.limit||(f.disabled=!0),(!n.limit||n.limit&&2<=n.limit)&&(s.attr("multiple","multiple"),n.inputNameBrackets&&"[]"!=s.attr("name").slice(-2)&&s.attr("name",s.attr("name")+"[]")),!0===n.listInput&&(n.listInput=$('<input type="hidden" name="fileuploader-list-'+s.attr("name").replace("[]","").split("[").pop().replace("]","")+'">').insertBefore(s)),"string"==typeof n.listInput&&0==$(n.listInput).length&&(n.listInput=$('<input type="hidden" name="'+n.listInput+'">').insertBefore(s)),f.set("disabled",f.disabled),!n.fileMaxSize&&n.maxSize&&(n.fileMaxSize=n.maxSize);break;case"disabled":f.disabled=t,p[f.disabled?"addClass":"removeClass"]("fileuploader-disabled"),s[f.disabled?"attr":"removeAttr"]("disabled","disabled"),f.rendered&&f.bindUnbindEvents(!t);break;case"feedback":t||(t=f._assets.textParse(0<f._itFl.length?n.captions.feedback2:n.captions.feedback,{length:f._itFl.length})),$(!o.is(":file"))&&o.find(".fileuploader-input-caption span").html(t);break;case"input":r=f._assets.copyAllAttributes($('<input type="file">'),s,!0),f.bindUnbindEvents(!1),s.after(s=r).remove(),f.bindUnbindEvents(!0);break;case"prevInput":0<sl.length&&(f.bindUnbindEvents(!1),sl[t].remove(),sl.splice(t,1),s=sl[sl.length-1],f.bindUnbindEvents(!0));break;case"nextInput":var r=f._assets.copyAllAttributes($('<input type="file">'),s);f.bindUnbindEvents(!1),0<sl.length&&0==sl[sl.length-1].get(0).files.length?s=sl[sl.length-1]:(-1==sl.indexOf(s)&&sl.push(s),sl.push(r),s.after(s=r)),f.bindUnbindEvents(!0);break;case"listInput":n.listInput&&n.listInput.val(null===t?f.files.list(!0):t)}},onChange:function(e,t){var i=s.get(0).files;if(t){if(!t.length)return f.set("input",""),f.files.clear(),!1;i=t}if(f.clipboard._timer&&f.clipboard.clean(),!f.isDefaultMode()||(f.reset(),0!=i.length)){if(n.beforeSelect&&$.isFunction(n.beforeSelect)&&0==n.beforeSelect(i,l,p,o,s))return!1;for(var a=0,r=0;r<i.length;r++){var d=i[r],u=f._itFl[f.files.add(d,"choosed")],c=f.files.check(u,i,0==r);if(!0===c)n.thumbnails&&f.thumbnails.item(u),f.isUploadMode()&&f.upload.prepare(u),n.onSelect&&$.isFunction(n.onSelect)&&n.onSelect(u,l,p,o,s),a++;else if(f.files.remove(u,!0),c[2]||(f.isDefaultMode()&&(f.set("input",""),f.reset(),c[3]=!0),c[1]&&n.dialogs.alert(c[1])),c[3])break}f.isUploadMode()&&0<a&&f.set("input",""),f.set("feedback",null),f.isAddMoreMode()&&0<a&&f.set("nextInput"),f.set("listInput",null),n.afterSelect&&$.isFunction(n.afterSelect)&&n.afterSelect(l,p,o,s)}},thumbnails:{create:function(){null!=n.thumbnails.beforeShow&&$.isFunction(n.thumbnails.beforeShow)&&n.thumbnails.beforeShow(p,o,s);var e=$(f._assets.textParse(n.thumbnails.box)).appendTo(n.thumbnails.boxAppendTo?n.thumbnails.boxAppendTo:p);l=e.is(n.thumbnails._selectors.list)?e:e.find(n.thumbnails._selectors.list),f.isUploadMode()&&n.thumbnails._selectors.start&&l.on("click",n.thumbnails._selectors.start,function(e){if(e.preventDefault(),f.locked)return!1;var t=$(this).closest(n.thumbnails._selectors.item),i=f.files.find(t);i&&f.upload.send(i,!0)}),f.isUploadMode()&&n.thumbnails._selectors.retry&&l.on("click",n.thumbnails._selectors.retry,function(e){if(e.preventDefault(),f.locked)return!1;var t=$(this).closest(n.thumbnails._selectors.item),i=f.files.find(t);i&&f.upload.retry(i)}),n.thumbnails._selectors.remove&&l.on("click",n.thumbnails._selectors.remove,function(e){if(e.preventDefault(),f.locked)return!1;var t=$(this).closest(n.thumbnails._selectors.item),i=f.files.find(t),a=function(e){f.files.remove(i)};i&&(i.upload&&"successful"!=i.upload.status?f.upload.cancel(i):n.thumbnails.removeConfirmation?n.dialogs.confirm(f._assets.textParse(n.captions.removeConfirmation,i),a):a())})},clear:function(){l&&l.html("")},item:function(e){e.icon=f.thumbnails.generateFileIcon(e.format,e.extension),e.image='<div class="fileuploader-item-image fileuploader-loading"></div>',e.progressBar=f.isUploadMode()?'<div class="fileuploader-progressbar"><div class="bar"></div></div>':"",e.html=$(f._assets.textParse(e.appended&&-1!=$.inArray(e.ext.toLowerCase(),["jpg","jpeg","gif","png"])&&n.thumbnails.item2?n.thumbnails.item2:n.thumbnails.item,e,!0)),e.progressBar=e.html.find(".fileuploader-progressbar"),e.html.addClass("file-type-"+(e.format?e.format:"no")+" file-ext-"+(e.extension?e.extension:"no")),e.html[n.thumbnails.itemPrepend?"prependTo":"appendTo"](l),e.renderImage=function(){f.thumbnails.renderImage(e,!0)},f.thumbnails.renderImage(e),null!=n.thumbnails.onItemShow&&$.isFunction(n.thumbnails.onItemShow)&&n.thumbnails.onItemShow(e,l,p,o,s)},generateFileIcon:function(e,n){var t='<div style="${style}" class="fileuploader-item-icon${class}"><i>'+(n||"")+"</i></div>",i=f._assets.textToColor(n);return i&&(f._assets.isBrightColor(i)&&(t=t.replace("${class}"," is-bright-color")),t=t.replace("${style}","background-color: "+i)),t.replace("${style}","").replace("${class}","")},renderImage:function(i,e){var v=i.html.find(".fileuploader-item-image"),b=function(e){var t=$(e);t.is("img")&&t.on("load error",function(e){"error"==e.type&&x(),_(),null!=n.thumbnails.onImageLoaded&&$.isFunction(n.thumbnails.onImageLoaded)&&n.thumbnails.onImageLoaded(i,l,p,o,s)}),t.is("canvas")&&null!=n.thumbnails.onImageLoaded&&$.isFunction(n.thumbnails.onImageLoaded)&&n.thumbnails.onImageLoaded(i,l,p,o,s),v.removeClass("fileupload-no-thumbnail fileuploader-loading").html(t)},x=function(){v.addClass("fileupload-no-thumbnail"),v.removeClass("fileuploader-loading").html(i.icon)},_=function(){var e=0;if(i&&-1<f._pfrL.indexOf(i))for(f._pfrL.splice(f._pfrL.indexOf(i),1);e<f._pfrL.length;){if(-1<f._itFl.indexOf(f._pfrL[e])){f.thumbnails.renderImage(f._pfrL[e],!0);break}f._pfrL.splice(e,1),e++}};if(v.length){if(i.image=v,"image"==i.format&&f.isFileReaderSupported()&&(i.appended||n.thumbnails.startImageRenderer||e)){if(n.thumbnails.synchronImages&&(-1!=f._pfrL.indexOf(i)||e||f._pfrL.push(i),1<f._pfrL.length&&!e))return;var t=new FileReader,a=function(e){if(n.thumbnails.canvasImage){var m=document.createElement("canvas"),h=m.getContext("2d"),g=new Image;g.onload=function(){var e=n.thumbnails.canvasImage.height?n.thumbnails.canvasImage.height:v.height(),t=n.thumbnails.canvasImage.width?n.thumbnails.canvasImage.width:v.width(),i=g.height/e,a=g.width/t,l=i<a?i:a,o=g.height/l,s=g.width/l,r=Math.ceil(Math.log(g.width/s)/Math.log(2));if(m.height=e,m.width=t,g.width<m.width||g.height<m.height||r<=1){var d=g.width<m.width?m.width/2-g.width/2:g.width>m.width?-(g.width-m.width)/2:0,u=g.height<m.height?m.height/2-g.height/2:0;h.drawImage(g,d,u,g.width,g.height)}else{var p=document.createElement("canvas"),c=p.getContext("2d");p.width=.5*g.width,p.height=.5*g.height,c.fillStyle="#fff",c.fillRect(0,0,p.width,p.height),c.drawImage(g,0,0,p.width,p.height),c.drawImage(p,0,0,.5*p.width,.5*p.height),h.drawImage(p,s>m.width?s-m.width:0,0,.5*p.width,.5*p.height,0,0,s,o)}g=null,f._assets.isBlankCanvas(m)?x():b(m),_()},g.onerror=function(e){x(),_()},g.src=e.target.result}else b('<img src="'+e.target.result+'" draggable="false">')};return void("string"==typeof i.file?a({target:{result:i.file}}):(t.onload=a,t.readAsDataURL(i.file)))}x()}else _()}},upload:{prepare:function(e,t){e.upload={url:n.upload.url,data:n.upload.data||{},formData:new FormData,type:n.upload.type||"POST",enctype:n.upload.enctype||"multipart/form-data",cache:!1,contentType:!1,processData:!1,status:null,send:function(){f.upload.send(e,!0)},cancel:function(){f.upload.cancel(e)},retry:function(){f.upload.retry(e)}},e.upload.formData.append(s.attr("name"),e.file,!!e.name&&e.name),(n.upload.start||t)&&f.upload.send(e,t)},send:function(a,e){if(a.upload){var r=function(e){a.html.removeClass("upload-pending upload-loading upload-cancelled upload-failed upload-success").addClass("upload-"+(e||a.upload.status))},d=function(){var e=0;if(0<f._pfuL.length)for(-1<f._pfuL.indexOf(a)&&f._pfuL.splice(f._pfuL.indexOf(a),1);e<f._pfuL.length;){if(-1<f._itFl.indexOf(f._pfuL[e])&&f._pfuL[e].upload&&!f._pfuL[e].upload.$ajax){f.upload.send(f._pfuL[e],!0);break}f._pfuL.splice(e,1),e++}};if(n.upload.synchron)if(a.upload.status="pending",a.html&&r(),e)-1<f._pfuL.indexOf(a)&&f._pfuL.splice(f._pfuL.indexOf(a),1);else if(-1==f._pfuL.indexOf(a)&&f._pfuL.push(a),1<f._pfuL.length)return;if(n.upload.beforeSend&&$.isFunction(n.upload.beforeSend)&&!1===n.upload.beforeSend(a,l,p,o,s))return r(),void d();if(p.addClass("fileuploader-is-uploading"),a.upload.$ajax&&a.upload.$ajax.abort(),delete a.upload.$ajax,delete a.upload.send,a.upload.status="loading",a.html&&(n.thumbnails._selectors.start&&a.html.find(n.thumbnails._selectors.start).remove(),r()),a.upload.data)for(var t in a.upload.data)a.upload.formData.append(t,a.upload.data[t]);a.upload.data=a.upload.formData,a.upload.xhr=function(){var e=$.ajaxSettings.xhr(),n=new Date;return e.upload&&e.upload.addEventListener("progress",function(e){f.upload.progressHandling(e,a,n)},!1),e},a.upload.complete=function(e,t){d();var i=!0;$.each(f._itFl,function(e,n){n.upload&&n.upload.$ajax&&(i=!1)}),i&&(p.removeClass("fileuploader-is-uploading"),null!=n.upload.onComplete&&"function"==typeof n.upload.onComplete&&n.upload.onComplete(l,p,o,s,e,t))},a.upload.success=function(e,t,i){a.uploaded=!0,delete a.upload,a.upload={status:"successful"},a.html&&r(),f.set("listInput",null),null!=n.upload.onSuccess&&$.isFunction(n.upload.onSuccess)&&n.upload.onSuccess(e,a,l,p,o,s,t,i)},a.upload.error=function(e,t,i){a.uploaded=!1,a.upload.status="cancelled"==a.upload.status?a.upload.status:"failed",delete a.upload.$ajax,a.html&&r(),null!=n.upload.onError&&$.isFunction(n.upload.onError)&&n.upload.onError(a,l,p,o,s,e,t,i)},a.upload.$ajax=$.ajax(a.upload)}},cancel:function(e){e&&e.upload&&(e.upload.status="cancelled",e.upload.$ajax&&e.upload.$ajax.abort(),delete e.upload.$ajax,f.files.remove(e))},retry:function(e){e&&e.upload&&(e.html&&n.thumbnails._selectors.retry&&e.html.find(n.thumbnails._selectors.retry).remove(),f.upload.prepare(e,!0))},progressHandling:function(e,t,i){if(e.lengthComputable){var a=e.loaded,r=e.total,d=Math.round(100*a/r),u=((new Date).getTime()-i.getTime())/1e3,c=u?a/u:0,m=r-a,h=u?m/c:null,g={loaded:a,loadedInFormat:f._assets.bytesToText(a),total:r,totalInFormat:f._assets.bytesToText(r),percentage:d,secondsElapsed:u,secondsElapsedInFormat:f._assets.secondsToText(u,!0),bytesPerSecond:c,bytesPerSecondInFormat:f._assets.bytesToText(c)+"/s",remainingBytes:m,remainingBytesInFormat:f._assets.bytesToText(m),secondsRemaining:h,secondsRemainingInFormat:f._assets.secondsToText(h,!0)};n.upload.onProgress&&$.isFunction(n.upload.onProgress)&&n.upload.onProgress(g,t,l,p,o,s)}}},dragDrop:{onDragEnter:function(e){clearTimeout(f.dragDrop._timer),n.dragDrop.container.addClass("fileuploader-dragging"),f.set("feedback",f._assets.textParse(n.captions.drop)),null!=n.dragDrop.onDragEnter&&$.isFunction(n.dragDrop.onDragEnter)&&n.dragDrop.onDragEnter(e,l,p,o,s)},onDragLeave:function(e){clearTimeout(f.dragDrop._timer),f.dragDrop._timer=setTimeout(function(e){return!!f.dragDrop._dragLeaveCheck(e)&&(n.dragDrop.container.removeClass("fileuploader-dragging"),f.set("feedback",null),void(null!=n.dragDrop.onDragLeave&&$.isFunction(n.dragDrop.onDragLeave)&&n.dragDrop.onDragLeave(e,l,p,o,s)))},100,e)},onDrop:function(e){clearTimeout(f.dragDrop._timer),n.dragDrop.container.removeClass("fileuploader-dragging"),f.set("feedback",null),e&&e.originalEvent&&e.originalEvent.dataTransfer&&e.originalEvent.dataTransfer.files&&e.originalEvent.dataTransfer.files.length&&f.onChange(e,e.originalEvent.dataTransfer.files),null!=n.dragDrop.onDrop&&$.isFunction(n.dragDrop.onDrop)&&n.dragDrop.onDrop(e,l,p,o,s)},_dragLeaveCheck:function(e){var t=$(e.currentTarget);return!(!t.is(n.dragDrop.container)&&n.dragDrop.container.find(t).length)}},clipboard:{paste:function(e){if(f._assets.isIntoView(o)&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.items&&e.originalEvent.clipboardData.items.length){var t=e.originalEvent.clipboardData.items;f.clipboard.clean();for(var i=0;i<t.length;i++)if(-1!==t[i].type.indexOf("image")||-1!==t[i].type.indexOf("text/uri-list")){var a=t[i].getAsFile(),l=new Date,s=function(e){return e<10&&(e="0"+e),e},r=1<n.clipboardPaste?n.clipboardPaste:2e3;a&&(a.name="Clipboard "+l.getFullYear()+"-"+s(l.getMonth()+1)+"-"+s(l.getDate())+" "+s(l.getHours())+"-"+s(l.getMinutes())+"-"+s(l.getSeconds()),a.name+=-1!=a.type.indexOf("/")?"."+(""+a.type.split("/")[1]).toLowerCase():".png",f.set("feedback",f._assets.textParse(n.captions.paste,{ms:r/1e3})),f.clipboard._timer=setTimeout(function(){f.set("feedback",null),f.onChange(e,[a])},r-2))}}},clean:function(){f.clipboard._timer&&(clearTimeout(f.clipboard._timer),delete f.clipboard._timer,f.set("feedback",null))}},files:{add:function(e,n){var t,i,a=e.name,l=e.size,o=f._assets.bytesToText(l),r=e.type,d=r?(""+r.split("/",1)).toLowerCase():"",u=-1!=a.indexOf(".")?a.split(".").pop().toLowerCase():"",p=a.substr(0,a.length-(-1!=a.indexOf(".")?u.length+1:u.length)),c=e.data,m=(e=e.file?e.file:e.name,(m=void 0!==c&&void 0!==c.url&&null!==c.url?c.url:e).replace(/\/(?=[^\/]*$)/,"/icons/"));return f._itFl.push({name:a,title:p,label:q.addMore?s[0].name.replace("[]","_label["+f._itFl.length+"]"):s[0].name+"_label",size:l,size2:o,type:r,format:d,extension:u,data:c,url:void 0!==c&&void 0!==c.url&&null!==c.url?c.url:e,file:e,img:m,ext:a.split(".").pop().toLowerCase(),input:"choosed"==n?s:null,html:null,upload:null,choosed:"choosed"==n,appended:"appended"==n,uploaded:"uploaded"==n}),t=f._itFl.length-1,(i=f._itFl[t]).remove=function(){f.files.remove(i)},t},list:function(i,a,e){var r=[];return $.each(f._itFl,function(e,n){if(!n.upload||n.uploaded){var t=n;(i||a)&&(t.choosed,t=""+(a&&null!==f.files.getItemAttr(n,a)?f.files.getItemAttr(n,a):n["string"==typeof n.file?"file":"name"])),r.push(t)}}),r=n.onListInput&&$.isFunction(n.onListInput)&&!e?n.onListInput(f._itFl,n.listInput,l,p,o,s):r,i?JSON.stringify(r):r},check:function(i,e,t){var a=["warning",null,!1,!1];if(null!=n.limit&&t&&e.length+f._itFl.length-1>n.limit)return a[1]=f._assets.textParse(n.captions.errors.filesLimit),a[3]=!0,a;if(null!=n.maxSize&&t&&(r=0,$.each(f._itFl,function(e,n){r+=n.size}),r-=i.size,$.each(e,function(e,n){r+=n.size}),r>Math.round(1e6*n.maxSize)))return a[1]=f._assets.textParse(n.captions.errors.filesSizeAll),a[3]=!0,a;if(null!=n.onFilesCheck&&$.isFunction(n.onFilesCheck)&&t&&!1===n.onFilesCheck(e,n,l,p,o,s))return a[3]=!0,a;if(null!=n.extensions&&-1==$.inArray(i.extension,n.extensions)&&-1==$.inArray(i.type,n.extensions))return a[1]=f._assets.textParse(n.captions.errors.filesType,i),a;if(null!=n.fileMaxSize&&i.size>1e6*n.fileMaxSize)return a[1]=f._assets.textParse(n.captions.errors.fileSize,i),a;if(4096==i.size&&""==i.type)return a[1]=f._assets.textParse(n.captions.errors.folderUpload,i),a;var r=!1;return $.each(f._itFl,function(e,t){if(t!=i&&1==t.choosed&&t.file&&t.file.name==i.name)return r=!0,t.file.size!=i.size||t.file.type!=i.type||i.file.lastModified&&t.file.lastModified&&t.file.lastModified!=i.file.lastModified?(a[1]=f._assets.textParse(n.captions.errors.fileName,i),a[2]=!1):a[2]=!0,!1}),!r||a},append:function(e){if((e=$.isArray(e)?e:[e]).length){for(var t,i=0;i<e.length;i++)t=f._itFl[f.files.add(e[i],"appended")],n.thumbnails&&f.thumbnails.item(t);return f.set("feedback",null),f.set("listInput",null),n.afterSelect&&$.isFunction(n.afterSelect)&&n.afterSelect(l,p,o,s),1!=e.length||t}},find:function(t){var i=null;return $.each(f._itFl,function(e,n){if(n.html&&n.html.is(t))return i=n,!1}),i},remove:function(t,i){if(i||!n.onRemove||!$.isFunction(n.onRemove)||!1!==n.onRemove(t,l,p,o,s)){if(t.html&&(n.thumbnails.onItemRemove&&$.isFunction(n.thumbnails.onItemRemove)&&!i?n.thumbnails.onItemRemove(t.html,l,p,o,s):t.html.remove()),t.upload&&t.upload.$ajax&&t.upload.cancel&&t.upload.cancel(),t.input){var a=!0;$.each(f._itFl,function(e,n){if(t!=n&&(t.input==n.input||i&&1<t.input.get(0).files.length))return a=!1}),a&&(f.isAddMoreMode()&&1<sl.length?(sl.splice(sl.indexOf(t.input),1),t.input.remove(),f.set("nextInput")):f.set("input",""))}-1<f._pfrL.indexOf(t)&&f._pfrL.splice(f._pfrL.indexOf(t),1),-1<f._pfuL.indexOf(t)&&f._pfuL.splice(f._pfuL.indexOf(t),1),-1<f._itFl.indexOf(t)&&f._itFl.splice(f._itFl.indexOf(t),1),t=null,0==f._itFl.length&&f.reset(),f.set("feedback",null),f.set("listInput",null)}},getItemAttr:function(e,n){var t=null;return e&&(void 0!==e[n]?t=e[n]:e.data&&void 0!==e.data[n]&&(t=e.data[n])),t},clear:function(e){for(var t=0;t<f._itFl.length;){var i=f._itFl[t];e||!i.appended?(i.html&&i.html&&f._itFl[t].html.remove(),i.upload&&i.upload.$ajax&&f.upload.cancel(i),f._itFl.splice(t,1)):t++}f.set("feedback",null),f.set("listInput",null),0==f._itFl.length&&n.onEmpty&&($.isFunction(n.onEmpty),1)&&n.onEmpty(l,p,o,s)}},reset:function(e){e&&(f.clipboard._timer&&f.clipboard.clean(),$.each(sl,function(e,n){e<sl.length&&n.remove()}),sl=[],f.set("input","")),f._itRl=[],f._pfuL=[],f._pfrL=[],f.files.clear(e)},destroy:function(){f.reset(!0),f.bindUnbindEvents(!1),s.removeAttr("style"),s.insertBefore(".fileuploader"),s.prop("FileUploader",null),p.remove(),p=o=l=null},_assets:{bytesToText:function(e){if(0==e)return"0 Byte";var n=Math.floor(Math.log(e)/Math.log(1e3));return(e/Math.pow(1e3,n)).toPrecision(3)+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},secondsToText:function(e,n){e=parseInt(Math.round(e),10);var t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),a="";return(0<t||!n)&&(a+=(t<10?"0":"")+t+(n?"h ":":")),(0<i||!n)&&(a+=(i<10&&!n?"0":"")+i+(n?"m ":":")),a+((e=e-3600*t-60*i)<10&&!n?"0":"")+e+(n?"s":"")},hasAttr:function(e,n){var t=(n=n||s).attr(e);return!(!t||void 0===t)},copyAllAttributes:function(e,n){return $.each(n.get(0).attributes,function(){"required"!=this.name&&e.attr(this.name,this.value)}),n.get(0).FileUploader&&(e.get(0).FileUploader=n.get(0).FileUploader),e},getAllEvents:function(e){var n=[];for(var t in e=(e=e||s).get?e.get(0):e)0===t.indexOf("on")&&n.push(t.slice(2));return-1==n.indexOf("change")&&n.push("change"),n.join(" ")},isIntoView:function(e){var n=$(window).scrollTop(),t=n+window.innerHeight,i=e.offset().top,a=i+e.outerHeight();return n<i&&a<t},isBlankCanvas:function(e){var n,t=document.createElement("canvas");return t.width=e.width,t.height=e.height,n=e.toDataURL()==t.toDataURL(),t=null,n},textParse:function(text,opts,noOptions){switch(opts=noOptions?opts||{}:$.extend({},{limit:n.limit,maxSize:n.maxSize,fileMaxSize:n.fileMaxSize,extensions:n.extensions?n.extensions.join(", "):null},opts),typeof text){case"string":text=text.replace(/\$\{(.*?)\}/g,function(match,a){var a=a.replace(/ /g,""),r=void 0!==opts[a]&&null!=opts[a]?opts[a]:"";if(-1<a.indexOf(".")||-1<a.indexOf("[]")){var x=a.substr(0,-1<a.indexOf(".")?a.indexOf("."):-1<a.indexOf("[")?a.indexOf("["):a.length),y=a.substring(x.length);if(opts[x])try{r=eval('opts["'+x+'"]'+y)}catch(e){r=""}}return(r=$.isFunction(r)?f._assets.textParse(r):r)||""});break;case"function":text=text(opts)}return opts=null,text},textToColor:function(e){if(!e||0==e.length)return!1;for(var n=0,t=0;n<e.length;t=e.charCodeAt(n++)+((t<<5)-t));n=0;for(var i="#";n<3;i+=("00"+(t>>2*n++&255).toString(16)).slice(-2));return i},isBrightColor:function(e){var n,t,i;return 194<((i=(n=e)&&n.constructor==Array&&3==n.length?n:(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(n))?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:(t=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(n))?[2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3])]:(t=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(n))?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:(t=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(n))?[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]:"undefined"!=typeof colors?colors[$.trim(n).toLowerCase()]:null)?.2126*i[0]+.7152*i[1]+.0722*i[2]:null)}},isSupported:function(){return s&&s.get(0).files},isFileReaderSupported:function(){return window.File&&window.FileList&&window.FileReader},isDefaultMode:function(){return!n.upload&&!n.addMore},isAddMoreMode:function(){return!n.upload&&n.addMore},isUploadMode:function(){return n.upload},_itFl:[],_pfuL:[],_pfrL:[],disabled:!1,locked:!1,rendered:!1};return n.enableApi&&s.prop("FileUploader",{open:function(){s.trigger("click")},getOptions:function(){return n},getParentEl:function(){return p},getInputEl:function(){return s},getNewInputEl:function(){return o},getListEl:function(){return l},getListInputEl:function(){return n.listInput},getFiles:function(){return f._itFl},getChoosedFiles:function(){return f._itFl.filter(function(e){return e.choosed})},getAppendedFiles:function(){return f._itFl.filter(function(e){return e.appended})},getUploadedFiles:function(){return f._itFl.filter(function(e){return e.uploaded})},getFileList:function(e,n){return f.files.list(e,n,!0)},setOption:function(e,t){return n[e]=t,!0},findFile:function(e){return f.files.find(e)},append:function(e){return f.files.append(e)},remove:function(e){return e=e.jquery?f.files.find(e):e,-1<f._itFl.indexOf(e)&&(f.files.remove(e),!0)},reset:function(){return f.reset(!0),!0},disable:function(e){return f.set("disabled",!0),e&&(f.locked=!0),!0},enable:function(){return f.set("disabled",!1),!(f.locked=!1)},destroy:function(){return f.destroy(),!0},isEmpty:function(){return 0==f._itFl.length},isDisabled:function(){return f.disabled},isRendered:function(){return f.rendered},assets:f._assets,getPluginMode:function(){return f.isDefaultMode()?"default":f.isAddMoreMode()?"addMore":f.isUploadMode()?"upload":void 0}}),f.init(),this})},window.$.fileuploader={getInstance:function(e){return(e.prop?e:$(e)).prop("FileUploader")}},$.fn.fileuploader.defaults={limit:null,maxSize:null,fileMaxSize:null,extensions:null,changeInput:!0,inputNameBrackets:!0,theme:"default",thumbnails:{box:'<div class="fileuploader-items"><ul class="fileuploader-items-list"></ul></div>',boxAppendTo:null,item:'<li class="fileuploader-item row"><div class="col-2"><div class="column-thumbnail">${image}</div></div><div class="col-10"><div class="column-title"><div title="${name}"><div class="input-group input-group-sm"><input type="text" name="${label}" class="form-control" value="${name}" /><div class="input-group-append"><a href="${url}" class="btn btn-primary fileuploader-action-download" title="Download" download="${name}"><i class="mdi mdi-download"></i></a><a class="btn btn-danger fileuploader-action-remove" title="Remove"><i class="mdi mdi-trash-can-outline"></i></a></div></div></div></div></div></li>',item2:'<li class="fileuploader-item row"><div class="col-2"><div class="column-thumbnail"><a href="${url}" target="_blank" data-toggle="tooltip" title="${size2}"><img src="${img}" class="img-fluid rounded" alt="${ext}" /></a></div></div><div class="col-10"><div class="column-title"><div title="${name}"><div class="input-group input-group-sm"><input type="text" name="${label}" class="form-control" value="${name}" /><div class="input-group-append"><a href="${url}" class="btn btn-primary fileuploader-action-download" title="Download" download="${name}"><i class="mdi mdi-download"></i></a><a class="btn btn-danger fileuploader-action-remove" title="Remove"><i class="mdi mdi-trash-can-outline"></i></a></div></div></div></div></div></li>',itemPrepend:!1,removeConfirmation:!0,startImageRenderer:!0,synchronImages:!0,canvasImage:!0,_selectors:{list:".fileuploader-items-list",item:".fileuploader-item",start:".fileuploader-action-start",retry:".fileuploader-action-retry",remove:".fileuploader-action-remove"},beforeShow:null,onItemShow:null,onItemRemove:function(e){e.children().animate({opacity:0},200,function(){setTimeout(function(){e.slideUp(200,function(){e.remove()})},100)})},onImageLoaded:null},files:null,upload:null,dragDrop:!0,addMore:!1,clipboardPaste:!0,listInput:!0,enableApi:!1,listeners:null,onSupportError:null,beforeRender:null,afterRender:null,beforeSelect:null,onFilesCheck:null,onSelect:null,afterSelect:null,onListInput:null,onRemove:null,onEmpty:null,dialogs:{alert:function(e){return alert(e)},confirm:function(e,n){confirm(e)&&n()}},captions:{button:function(e){return"Choose "+(e.limit,"File")},feedback:function(e){return"Choose "+(e.limit,"file")+" to upload"},feedback2:function(e){return e.length+" "+(1<e.length?" files":"file")+" choosen"},drop:"Drop your file to upload",paste:'<div class="fileuploader-pending-loader"><div class="left-half" style="animation-duration: ${ms}s"></div><div class="spinner" style="animation-duration: ${ms}s"></div><div class="right-half" style="animation-duration: ${ms}s"></div></div>Copying file. Click here to cancel.',removeConfirmation:"Are you sure want to remove this file?",errors:{filesLimit:"Maximum file size is ${limit}.",filesType:"Allowed file extension is ${extensions}.",fileSize:"${name} too large! Maximum file size must be less than ${fileMaxSize}MB.",filesSizeAll:"The file you choosen is too large! All files size must be less than ${maxSize} MB.",fileName:"File ${name} has been choosen.",folderUpload:"You may not uploading folder."}}}}(jQuery);
For more information send a message to info at phpclasses dot org.