fileinput.min.js 40 KB

123456789101112
  1. /*!
  2. * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2015
  3. * @package bootstrap-fileinput
  4. * @version 4.1.7
  5. *
  6. * File input styling for Bootstrap 3.0
  7. * Built for Yii Framework 2.0
  8. * Author: Kartik Visweswaran
  9. * Year: 2015
  10. * For more Yii related demos visit http://demos.krajee.com
  11. */!function(a){"use strict";String.prototype.repl=function(a,b){return this.split(a).join(b)};var b=function(a){var c,b=document.createElement("div");return b.innerHTML="<!--[if IE "+a+"]><i></i><![endif]-->",c=1===b.getElementsByTagName("i").length,document.body.appendChild(b),b.parentNode.removeChild(b),c},c=function(){return window.File&&window.FileReader},d=function(){var a=document.createElement("div");return!b(9)&&(void 0!==a.draggable||void 0!==a.ondragstart&&void 0!==a.ondrop)},e=function(){return c&&window.FormData},f=function(a,b){a.removeClass(b).addClass(b)},g='style="width:{width};height:{height};"',h=' <param name="controller" value="true" />\n <param name="allowFullScreen" value="true" />\n <param name="allowScriptAccess" value="always" />\n <param name="autoPlay" value="false" />\n <param name="autoStart" value="false" />\n <param name="quality" value="high" />\n',i='<div class="file-preview-other">\n <i class="glyphicon glyphicon-file"></i>\n </div>',j={removeIcon:'<i class="glyphicon glyphicon-trash text-danger"></i>',removeClass:"btn btn-xs btn-default",removeTitle:"Remove file",uploadIcon:'<i class="glyphicon glyphicon-upload text-info"></i>',uploadClass:"btn btn-xs btn-default",uploadTitle:"Upload file",indicatorNew:'<i class="glyphicon glyphicon-hand-down text-warning"></i>',indicatorSuccess:'<i class="glyphicon glyphicon-ok-sign file-icon-large text-success"></i>',indicatorError:'<i class="glyphicon glyphicon-exclamation-sign text-danger"></i>',indicatorLoading:'<i class="glyphicon glyphicon-hand-up text-muted"></i>',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading ..."},k='{preview}\n<div class="kv-upload-progress hide"></div>\n<div class="input-group {class}">\n {caption}\n <div class="input-group-btn">\n {remove}\n {cancel}\n {upload}\n {browse}\n </div>\n</div>',l='{preview}\n<div class="kv-upload-progress hide"></div>\n{remove}\n{cancel}\n{upload}\n{browse}\n',m='<div class="file-preview {class}">\n <div class="close fileinput-remove">&times;</div>\n <div class="{dropClass}">\n <div class="file-preview-thumbnails">\n </div>\n <div class="clearfix"></div> <div class="file-preview-status text-center text-success"></div>\n <div class="kv-fileinput-error"></div>\n </div>\n</div>',n='<span class="glyphicon glyphicon-file kv-caption-icon"></span>',o='<div tabindex="-1" class="form-control file-caption {class}">\n <span class="file-caption-ellipsis">&hellip;</span>\n <div class="file-caption-name"></div>\n</div>',p='<div id="{id}" class="modal fade">\n <div class="modal-dialog modal-lg">\n <div class="modal-content">\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>\n <h3 class="modal-title">Detailed Preview <small>{title}</small></h3>\n </div>\n <div class="modal-body">\n <textarea class="form-control" style="font-family:Monaco,Consolas,monospace; height: {height}px;" readonly>{body}</textarea>\n </div>\n </div>\n </div>\n</div>',q='<div class="progress">\n <div class="{class}" role="progressbar" aria-valuenow="{percent}" aria-valuemin="0" aria-valuemax="100" style="width:{percent}%;">\n {percent}%\n </div>\n</div>',r='<div class="file-thumbnail-footer">\n <div class="file-caption-name">{caption}</div>\n {actions}\n</div>',s='<div class="file-actions">\n <div class="file-footer-buttons">\n {upload}{delete}{other} </div>\n <div class="file-upload-indicator" tabindex="-1" title="{indicatorTitle}">{indicator}</div>\n <div class="clearfix"></div>\n</div>',t='<button type="button" class="kv-file-remove {removeClass}" title="{removeTitle}"{dataUrl}{dataKey}>{removeIcon}</button>\n',u='<button type="button" class="kv-file-upload {uploadClass}" title="{uploadTitle}"> {uploadIcon}\n</button>\n',v='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}">\n {content}\n {footer}\n</div>\n',w='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}">\n <object data="{data}" type="{type}" width="{width}" height="{height}">\n '+i+"\n"+" </object>\n"+" {footer}\n"+"</div>",x='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}">\n <img src="{data}" class="file-preview-image" title="{caption}" alt="{caption}" '+g+">\n"+" {footer}\n"+"</div>\n",y='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}">\n <div class="file-preview-text" title="{caption}" '+g+">\n"+" {data}\n"+" </div>\n"+" {footer}\n"+"</div>",z='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}" title="{caption}" '+g+">\n"+' <video width="{width}" height="{height}" controls>\n'+' <source src="{data}" type="{type}">\n'+" "+i+"\n"+" </video>\n"+" {footer}\n"+"</div>\n",A='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}" title="{caption}" '+g+">\n"+" <audio controls>\n"+' <source src="'+"{data}"+'" type="{type}">\n'+" "+i+"\n"+" </audio>\n"+" {footer}\n"+"</div>",B='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}" title="{caption}" '+g+">\n"+' <object type="application/x-shockwave-flash" width="{width}" height="{height}" data="{data}">\n'+h+" "+i+"\n"+" </object>\n"+" {footer}\n"+"</div>\n",C='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}" title="{caption}" '+g+">\n"+' <object data="{data}" type="{type}" width="{width}" height="{height}">\n'+' <param name="movie" value="{caption}" />\n'+h+" "+i+"\n"+" </object>\n"+" {footer}\n"+"</div>",D='<div class="file-preview-frame{frameClass}" id="{previewId}" data-fileindex="{fileindex}" title="{caption}" '+g+">\n"+" "+i+"\n"+" {footer}\n"+"</div>",E={main1:k,main2:l,preview:m,icon:n,caption:o,modal:p,progress:q,footer:r,actions:s,actionDelete:t,actionUpload:u},F={generic:v,html:w,image:x,text:y,video:z,audio:A,flash:B,object:C,other:D},G=["image","html","text","video","audio","flash","object"],H={image:{width:"auto",height:"160px"},html:{width:"213px",height:"160px"},text:{width:"160px",height:"160px"},video:{width:"213px",height:"160px"},audio:{width:"213px",height:"80px"},flash:{width:"213px",height:"160px"},object:{width:"160px",height:"160px"},other:{width:"160px",height:"160px"}},I={image:function(a,b){return void 0!==a?a.match("image.*"):b.match(/\.(gif|png|jpe?g)$/i)},html:function(a,b){return void 0!==a?"text/html"===a:b.match(/\.(htm|html)$/i)},text:function(a,b){return void 0!==a&&a.match("text.*")||b.match(/\.(txt|md|csv|nfo|php|ini)$/i)},video:function(a,b){return void 0!==a&&a.match(/\.video\/(ogg|mp4|webm)$/i)||b.match(/\.(og?|mp4|webm)$/i)},audio:function(a,b){return void 0!==a&&a.match(/\.audio\/(ogg|mp3|wav)$/i)||b.match(/\.(ogg|mp3|wav)$/i)},flash:function(a,b){return void 0!==a&&"application/x-shockwave-flash"===a||b.match(/\.(swf)$/i)},object:function(){return!0},other:function(){return!0}},J=function(b,c){return null===b||void 0===b||0===b.length||c&&""===a.trim(b)},K=function(a){return Array.isArray(a)||"[object Array]"===Object.prototype.toString.call(a)},L=function(a,b){return"object"==typeof b&&a in b},M=function(b,c,d){return J(b)||J(b[c])?d:a(b[c])},N=function(){return Math.round((new Date).getTime()+100*Math.random())},O=function(a){return String(a).repl("&","&amp;").repl('"',"&quot;").repl("'","&#39;").repl("<","&lt;").repl(">","&gt;")},P=function(b,c){var d=b;return a.each(c,function(a,b){"function"==typeof b&&(b=b()),d=d.repl(a,b)}),d},Q=window.URL||window.webkitURL,R=function(d,e){this.$element=a(d),c()||b(9)?(this.init(e),this.listen()):this.$element.removeClass("file-loading")};R.prototype={constructor:R,init:function(c){var i,k,g=this,h=g.$element;a.each(c,function(a,b){g[a]=b}),J(g.allowedPreviewTypes)&&(g.allowedPreviewTypes=G),g.uploadFileAttr=J(h.attr("name"))?"file_data":h.attr("name"),g.reader=null,g.formdata={},g.isIE9=b(9),g.isIE10=b(10),g.filestack=[],g.ajaxRequests=[],g.isError=!1,g.dropZoneEnabled=d()&&g.dropZoneEnabled,g.isDisabled=g.$element.attr("disabled")||g.$element.attr("readonly"),g.isUploadable=e&&!J(g.uploadUrl),g.slug="function"==typeof c.slugCallback?c.slugCallback:g.slugDefault,g.mainTemplate=g.showCaption?g.getLayoutTemplate("main1"):g.getLayoutTemplate("main2"),g.captionTemplate=g.getLayoutTemplate("caption"),g.previewGenericTemplate=g.getPreviewTemplate("generic"),J(g.$element.attr("id"))&&g.$element.attr("id",N()),void 0===g.$container?g.$container=g.createContainer():g.refreshContainer(),g.$progress=g.$container.find(".kv-upload-progress"),g.$btnUpload=g.$container.find(".kv-fileinput-upload"),g.$captionContainer=M(c,"elCaptionContainer",g.$container.find(".file-caption")),g.$caption=M(c,"elCaptionText",g.$container.find(".file-caption-name")),g.$previewContainer=M(c,"elPreviewContainer",g.$container.find(".file-preview")),g.$preview=M(c,"elPreviewImage",g.$container.find(".file-preview-thumbnails")),g.$previewStatus=M(c,"elPreviewStatus",g.$container.find(".file-preview-status")),g.$errorContainer=M(c,"elErrorContainer",g.$previewContainer.find(".kv-fileinput-error")),J(g.msgErrorClass)||f(g.$errorContainer,g.msgErrorClass),g.$errorContainer.hide(),g.initialPreviewContent="",i=g.initialPreview,g.initialPreviewCount=K(i)?i.length:i.length>0?i.split(g.initialPreviewDelimiter).length:0,g.fileActionSettings=a.extend(j,c.fileActionSettings),g.previewInitId="preview-"+N(),g.initPreview(),g.initPreviewDeletes(),g.original={preview:g.$preview.html(),caption:g.$caption.html()},g.options=c,g.setFileDropZoneTitle(),g.uploadCount=0,g.uploadPercent=0,g.$element.removeClass("file-loading"),k=g.getLayoutTemplate("progress"),g.progressTemplate=k.replace("{class}",g.progressClass),g.progressCompleteTemplate=k.replace("{class}",g.progressCompleteClass),g.setEllipsis()},raise:function(a,b){var c=this;void 0!==b?c.$element.trigger(a,b):c.$element.trigger(a)},getLayoutTemplate:function(a){var b=this,c=L(a,b.layoutTemplates)?b.layoutTemplates[a]:E[a];return J(b.customLayoutTags)?c:P(c,b.customLayoutTags)},getPreviewTemplate:function(a){var b=this,c=L(a,b.previewTemplates)?b.previewTemplates[a]:F[a];return J(b.customPreviewTags)?c:P(c,b.customPreviewTags)},getOutData:function(a,b,c){var d=this;return a=a||{},b=b||{},c=c||d.filestack,{form:d.formdata,files:c,extra:d.getExtraData(),response:b,reader:d.reader,jqXHR:a}},setEllipsis:function(){var a=this,b=a.$captionContainer,c=a.$caption,d=c.clone().css("height","auto").hide();b.parent().before(d),b.removeClass("kv-has-ellipsis"),d.outerWidth()>c.outerWidth()&&b.addClass("kv-has-ellipsis"),d.remove()},listen:function(){var b=this,c=b.$element,d=b.$captionContainer,e=b.$btnFile;c.on("change",a.proxy(b.change,b)),a(window).on("resize",function(){b.setEllipsis()}),e.off("click").on("click",function(){b.raise("filebrowse"),b.isError&&!b.isUploadable&&b.clear(!0),d.focus()}),c.closest("form").off("reset").on("reset",a.proxy(b.reset,b)),b.$container.off("click").on("click",".fileinput-remove:not([disabled])",a.proxy(b.clear,b)).on("click",".fileinput-cancel",a.proxy(b.cancel,b)),b.isUploadable&&b.dropZoneEnabled&&b.showPreview&&b.initDragDrop(),b.isUploadable&&b.$container.find(".kv-fileinput-upload").off("click").on("click",function(c){b.isUploadable&&(c.preventDefault(),!a(this).hasClass("disabled")&&J(a(this).attr("disabled"))&&b.upload())})},setProgress:function(a){var b=this,c=Math.min(a,100),d=100>c?b.progressTemplate:b.progressCompleteTemplate;b.$progress.html(d.repl("{percent}",c))},upload:function(){var c,d,e,a=this,b=a.getFileStack().length;if(a.isUploadable&&!a.isDisabled&&0!==b)if(a.resetUpload(),a.$progress.removeClass("hide"),a.uploadCount=0,a.uploadPercent=0,a.lock(),a.setProgress(0),e=a.filestack.length,!a.uploadAsync&&1!==b||!a.showPreview)a.uploadBatch();else for(d=a.getOutData(),a.raise("filebatchpreupload",[d]),c=0;e>c;c+=1)void 0!==a.filestack[c]&&a.uploadSingle(c,a.filestack,!0)},lock:function(){var a=this;a.resetErrors(),a.disable(),a.showRemove&&f(a.$container.find(".fileinput-remove"),"hide"),a.showCancel&&a.$container.find(".fileinput-cancel").removeClass("hide"),a.raise("filelock",[a.filestack,a.getExtraData()])},unlock:function(a){var b=this;void 0===a&&(a=!0),b.enable(),b.showCancel&&f(b.$container.find(".fileinput-cancel"),"hide"),b.showRemove&&b.$container.find(".fileinput-remove").removeClass("hide"),a&&b.resetFileStack(),b.raise("fileunlock",[b.filestack,b.getExtraData()])},resetFileStack:function(){var b=this,c=0,d=[];b.$preview.find(".file-preview-frame").each(function(){var e=a(this),f=e.attr("data-fileindex"),g=b.filestack[f];-1!=f&&(void 0!==g?(d[c]=g,e.attr({id:b.previewInitId+"-"+c,"data-fileindex":c}),c+=1):e.attr({id:"uploaded-"+N(),"data-fileindex":"-1"}))}),b.filestack=d},refresh:function(b){var e,c=this,d=c.$element,f=arguments.length?a.extend(c.options,b):c.options;d.off(),c.init(f),e=c.$container.find(".file-drop-zone"),e.off("dragenter dragover drop"),a(document).off("dragenter dragover drop"),c.listen(),c.setFileDropZoneTitle()},initDragDrop:function(){var b=this,c=b.$container.find(".file-drop-zone");c.off("dragenter dragover drop"),a(document).off("dragenter dragover drop"),c.on("dragenter dragover",function(c){c.stopPropagation(),c.preventDefault(),b.isDisabled||f(a(this),"highlighted")}),c.on("dragleave",function(c){c.stopPropagation(),c.preventDefault(),b.isDisabled||a(this).removeClass("highlighted")}),c.on("drop",function(c){c.preventDefault(),b.isDisabled||(b.change(c,"dragdrop"),a(this).removeClass("highlighted"))}),a(document).on("dragenter dragover drop",function(a){a.stopPropagation(),a.preventDefault()})},setFileDropZoneTitle:function(){var a=this,b=a.$container.find(".file-drop-zone");b.find("."+a.dropZoneTitleClass).remove(),a.isUploadable&&a.showPreview&&0!==b.length&&!(a.getFileStack().length>0)&&a.dropZoneEnabled&&(0===b.find(".file-preview-frame").length&&b.prepend('<div class="'+a.dropZoneTitleClass+'">'+a.dropZoneTitle+"</div>"),a.$container.removeClass("file-input-new"),f(a.$container,"file-input-ajax-new"))},initFileActions:function(){var b=this;b.$preview.find(".kv-file-remove").each(function(){var f,g,c=a(this),d=c.closest(".file-preview-frame"),e=d.attr("data-fileindex");c.off("click").on("click",function(){d.fadeOut("slow",function(){b.filestack[e]=void 0,b.clearObjects(d),d.remove();var a=b.getFileStack(),c=a.length,h=b.$container.find(".file-preview-initial").length;0===c&&0===h?(b.original.preview="",b.reset()):(f=b.initialPreviewCount+c,g=f>1?b.msgSelected.repl("{n}",f):a[0].name,b.setCaption(g))})})}),b.$preview.find(".kv-file-upload").each(function(){var c=a(this);c.off("click").on("click",function(){var a=c.closest(".file-preview-frame"),d=a.attr("data-fileindex");b.uploadSingle(d,b.filestack,!1)})})},renderInitFileFooter:function(a){if(0===this.initialPreviewConfig.length||J(this.initialPreviewConfig[a]))return"";var b=this,c=b.getLayoutTemplate("footer"),d=b.initialPreviewConfig[a],e=L("caption",d)?d.caption:"",f=L("width",d)?d.width:"auto",g=L("url",d)?d.url:!1,h=L("key",d)?d.key:null,i=g===!1,j=b.initialPreviewShowDelete?b.renderFileActions(!1,!0,i,g,h):"",k=c.repl("{actions}",j);return k.repl("{caption}",e).repl("{width}",f).repl("{indicator}","").repl("{indicatorTitle}","")},renderFileFooter:function(a,b){var e,c=this,d=c.fileActionSettings,f=c.getLayoutTemplate("footer");return c.isUploadable?(e=f.repl("{actions}",c.renderFileActions(!0,!0,!1,!1,!1)),e.repl("{caption}",a).repl("{width}",b).repl("{indicator}",d.indicatorNew).repl("{indicatorTitle}",d.indicatorNewTitle)):f.repl("{actions}","").repl("{caption}",a).repl("{width}",b).repl("{indicator}","").repl("{indicatorTitle}","")},renderFileActions:function(a,b,c,d,e){if(!a&&!b)return"";var f=this,g=d===!1?"":' data-url="'+d+'"',h=e===!1?"":' data-key="'+e+'"',i=f.getLayoutTemplate("actionDelete"),j="",k=f.getLayoutTemplate("actions"),l=f.otherActionButtons.repl("{dataKey}",h),m=f.fileActionSettings,n=c?m.removeClass+" disabled":m.removeClass;return i=i.repl("{removeClass}",n).repl("{removeIcon}",m.removeIcon).repl("{removeTitle}",m.removeTitle).repl("{dataUrl}",g).repl("{dataKey}",h),a&&(j=f.getLayoutTemplate("actionUpload").repl("{uploadClass}",m.uploadClass).repl("{uploadIcon}",m.uploadIcon).repl("{uploadTitle}",m.uploadTitle)),k.repl("{delete}",i).repl("{upload}",j).repl("{other}",l)},getInitialPreview:function(a,b,c){var d=this,e="init_"+c,f=d.previewInitId+"-"+e,g=d.renderInitFileFooter(c,!1);return a.repl("{previewId}",f).repl("{frameClass}"," file-preview-initial").repl("{fileindex}",e).repl("{content}",b).repl("{footer}",g)},initPreview:function(){var f,g,a=this,b="",c=a.initialPreview,d=a.initialPreviewCount,e=a.initialCaption.length,h=e>0?a.initialCaption:a.msgSelected.repl("{n}",d);if(K(c)&&d>0){for(f=0;d>f;f+=1)b+=a.getInitialPreview(a.previewGenericTemplate,c[f],f);d>1&&0===e&&(h=a.msgSelected.repl("{n}",d))}else{if(!(d>0))return e>0&&a.setCaption(h),void 0;for(g=c.split(a.initialPreviewDelimiter),f=0;d>f;f+=1)b+=a.getInitialPreview(a.previewGenericTemplate,g[f],f);d>1&&0===e&&(h=a.msgSelected.repl("{n}",d))}a.initialPreviewContent=b,a.$preview.html(b),a.setCaption(h),a.$container.removeClass("file-input-new")},initPreviewDeletes:function(){var b=this,c=function(){0===b.$preview.find(".kv-file-remove").length&&b.reset()};b.$preview.find(".kv-file-remove").each(function(){var i,d=a(this),e=d.closest(".file-preview-frame"),g=d.attr("data-url"),h=d.attr("data-key");void 0!==g&&void 0!==h&&d.off("click").on("click",function(){a.ajax({url:g,type:"POST",dataType:"json",data:{key:h},beforeSend:function(a){f(e,"file-uploading"),f(d,"disabled"),b.raise("filepredelete",[h,a])},success:function(f,g,j){void 0===f.error?b.raise("filedeleted",[h,j]):(b.showError(f.error,null,d.attr("id"),h,"filedeleteerror",j),c()),e.removeClass("file-uploading").addClass("file-deleted"),e.fadeOut("slow",function(){b.clearObjects(e),e.remove(),i=a(document.createElement("div")).html(b.original.preview),i.find(".file-preview-frame").each(function(){var b=a(this);b.find(".kv-file-remove").attr("data-key")==h&&b.remove()}),b.initialPreviewContent=i.html(),b.initialPreviewCount>0&&(b.initialPreviewCount-=1);var d=b.initialCaption;0===b.initialCaption.length&&(d=b.msgSelected.repl("{n}",b.initialPreviewCount)),b.original.preview=i.html(),b.setCaption(d),b.original.caption=b.$caption.html(),i.remove(),c()})},error:function(a,f,g){b.showError(g,null,d.attr("id"),h,"filedeleteerror",a),e.removeClass("file-uploading"),c()}})})})},clearObjects:function(b){b.find("video audio").each(function(){this.pause(),a(this).remove()}),b.find("img object div").each(function(){a(this).remove()})},clearFileInput:function(){var d,e,f,b=this,c=b.$element;J(c.val())||(b.isIE9||b.isIE10?(d=c.closest("form"),e=a(document.createElement("form")),f=a(document.createElement("div")),c.before(f),d.length?d.after(e):f.after(e),e.append(c).trigger("reset"),f.before(c).remove(),e.remove()):c.val(""))},resetUpload:function(){var a=this;a.uploadCount=0,a.uploadPercent=0,a.$btnUpload.removeAttr("disabled"),a.setProgress(0),f(a.$progress,"hide"),a.resetErrors(!1),a.ajaxRequests=[]},cancel:function(){var e,b=this,c=b.ajaxRequests,d=c.length;if(d>0)for(e=0;d>e;e+=1)c[e].abort();b.$preview.find(".file-preview-frame").each(function(){var c=a(this),d=c.attr("data-fileindex");c.removeClass("file-uploading"),void 0!==b.filestack[d]&&(c.find(".kv-file-upload").removeClass("disabled").removeAttr("disabled"),c.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")),b.unlock()})},clear:function(b){var d,c=this;!c.isIE9&&c.reader instanceof FileReader&&c.reader.abort(),c.$btnUpload.removeAttr("disabled"),c.resetUpload(),c.filestack=[],c.clearFileInput(),c.resetErrors(!0),b!==!0&&(c.raise("change"),c.raise("fileclear")),c.overwriteInitial&&(c.initialPreviewCount=0,c.initialPreviewContent=""),!c.overwriteInitial&&c.initialPreviewContent.length>0?(c.showFileIcon(),c.$preview.html(c.original.preview),c.$caption.html(c.original.caption),c.setEllipsis(),c.initPreviewDeletes(),c.$container.removeClass("file-input-new")):(c.$preview.find(".file-preview-frame").each(function(){c.clearObjects(a(this))}),c.$preview.html(""),d=!c.overwriteInitial&&c.initialCaption.length>0?c.original.caption:"",c.$caption.html(d),c.setEllipsis(),c.$caption.attr("title",""),f(c.$container,"file-input-new")),0===c.$container.find(".file-preview-frame").length&&(c.initialCaption="",c.original.caption="",c.$caption.html(""),c.setEllipsis(),c.$captionContainer.find(".kv-caption-icon").hide()),c.hideFileIcon(),c.raise("filecleared"),c.$captionContainer.focus(),c.setFileDropZoneTitle()},reset:function(){var a=this;a.clear(!0),a.$preview.html(a.original.preview),a.$caption.html(a.original.caption),a.setEllipsis(),a.$container.find(".fileinput-filename").text(""),a.raise("filereset"),a.initialPreview.length>0&&a.$container.removeClass("file-input-new"),a.setFileDropZoneTitle(),a.isUploadable&&a.resetUpload(),a.filestack=[],a.formdata={}},disable:function(){var a=this;a.isDisabled=!0,a.raise("filedisabled"),a.$element.attr("disabled","disabled"),a.$container.find(".kv-fileinput-caption").addClass("file-caption-disabled"),a.$container.find(".btn-file, .fileinput-remove, .kv-fileinput-upload").attr("disabled",!0),a.initDragDrop()},enable:function(){var a=this;a.isDisabled=!1,a.raise("fileenabled"),a.$element.removeAttr("disabled"),a.$container.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),a.$container.find(".btn-file, .fileinput-remove, .kv-fileinput-upload").removeAttr("disabled"),a.initDragDrop()},getExtraData:function(){var a=this,b=a.uploadExtraData;return"function"==typeof a.uploadExtraData&&(b=a.uploadExtraData()),b},uploadExtra:function(){var b=this,c=b.getExtraData();0!==c.length&&a.each(c,function(a,c){b.formdata.append(a,c)})},initXhr:function(a,b){var c=this;return a.upload&&a.upload.addEventListener("progress",function(a){var d=0,e=a.loaded||a.position,f=a.total;a.lengthComputable&&(d=Math.ceil(e/f*b)),c.uploadPercent=Math.max(d,c.uploadPercent),c.setProgress(c.uploadPercent)},!1),a},ajaxSubmit:function(b,c,d,e){var f=this;f.uploadExtra(),f.ajaxRequests.push(a.ajax({xhr:function(){var b=a.ajaxSettings.xhr();return f.initXhr(b,98)},url:f.uploadUrl,type:"POST",dataType:"json",data:f.formdata,cache:!1,processData:!1,contentType:!1,beforeSend:b,success:c,complete:d,error:e}))},uploadSingle:function(b,c,d){var i,l,m,n,t,u,v,w,x,y,z,e=this,g=e.getFileStack().length,h=new FormData,j=e.previewInitId+"-"+b,k=a("#"+j),o=k.find(".kv-file-upload"),p=k.find(".kv-file-remove"),q=k.find(".file-upload-indicator"),r=e.fileActionSettings,s=e.filestack.length>0||!a.isEmptyObject(e.uploadExtraData);e.formdata=h,0!==g&&s&&!o.hasClass("disabled")&&(n=function(){var a=e.$preview.find(".file-preview-frame.file-uploading"),b=a.length;b>0||(e.setProgress(100),e.unlock(),e.clearFileInput(),e.raise("filebatchuploadcomplete",[e.filestack,e.getExtraData()]))},t=function(a,b){q.html(r[a]),q.attr("title",r[b])},u=function(){!d||0===g||e.uploadPercent>=100||(e.uploadCount+=1,m=80+Math.ceil(20*e.uploadCount/g),e.uploadPercent=Math.max(m,e.uploadPercent),e.setProgress(e.uploadPercent),e.initPreviewDeletes())},v=function(){o.removeAttr("disabled"),p.removeAttr("disabled"),k.removeClass("file-uploading")},w=function(a){i=e.getOutData(a),t("indicatorLoading","indicatorLoadingTitle"),f(k,"file-uploading"),o.attr("disabled",!0),p.attr("disabled",!0),d||e.lock(),e.raise("filepreupload",[i,j,b])},x=function(a,c,f){i=e.getOutData(f,a),setTimeout(function(){void 0===a.error?(t("indicatorSuccess","indicatorSuccessTitle"),o.hide(),p.hide(),e.filestack[b]=void 0,d||e.resetFileStack(),e.raise("fileuploaded",[i,j,b])):(t("indicatorError","indicatorErrorTitle"),e.showUploadError(a.error,i,j,b))},100)},y=function(){setTimeout(function(){u(),v(),d?n():e.unlock(!1)},100)},z=function(a,f,g){t("indicatorError","indicatorErrorTitle"),i=e.getOutData(a),d?(l=c[b].name,e.showUploadError("<b>"+l+"</b>: "+g,i,j,b)):e.showUploadError(g,i,j,b)},h.append(e.uploadFileAttr,c[b]),h.append("file_id",b),e.ajaxSubmit(w,x,y,z))},uploadBatch:function(){var e,h,i,j,k,l,m,n,b=this,c=b.filestack,d=c.length,g=b.filestack.length>0||!a.isEmptyObject(b.uploadExtraData);b.formdata=new FormData,0!==d&&g&&(e=b.fileActionSettings,h=function(c,d,f){var g=a("#"+b.previewInitId+"-"+c).find(".file-upload-indicator");g.html(e[d]),g.attr("title",e[f])},j=function(c){var d=a("#"+b.previewInitId+"-"+c),e=d.find(".kv-file-upload"),f=d.find(".kv-file-delete");d.removeClass("file-uploading"),e.removeAttr("disabled"),f.removeAttr("disabled")},i=function(){a.each(c,function(a){b.filestack[a]=void 0}),b.clearFileInput()},k=function(c){b.lock();var d=b.getOutData(c);b.showPreview&&(b.$preview.find(".file-preview-frame").each(function(){var b=a(this),c=b.find(".kv-file-upload"),d=b.find(".kv-file-remove");f(b,"file-uploading"),c.attr("disabled",!0),d.attr("disabled",!0)}),b.raise("filebatchpreupload",[d]))},l=function(c,d,e){var f=b.getOutData(e,c),g=J(c.errorkeys)?[]:c.errorkeys;void 0===c.error||J(c.error)?(b.raise("filebatchuploadsuccess",[f]),i(),b.showPreview?(b.$preview.find(".kv-file-upload").hide(),b.$preview.find(".kv-file-remove").hide(),b.$preview.find(".file-preview-frame").each(function(){var b=a(this),c=b.attr("data-fileindex");h(c,"indicatorSuccess","indicatorSuccessTitle"),j(c)})):b.reset()):(b.$preview.find(".file-preview-frame").each(function(){var c=a(this),d=parseInt(c.attr("data-fileindex"),10);return j(d),0===g.length?(h(d,"indicatorError","indicatorErrorTitle"),void 0):(-1!==a.inArray(d,g)?h(d,"indicatorError","indicatorErrorTitle"):(c.find(".kv-file-upload").hide(),c.find(".kv-file-remove").hide(),h(d,"indicatorSuccess","indicatorSuccessTitle"),b.filestack[d]=void 0),void 0)}),b.showUploadError(c.error,f,null,null,"filebatchuploaderror"))},m=function(){b.setProgress(100),b.unlock(),b.raise("filebatchuploadcomplete",[b.filestack,b.getExtraData()]),b.clearFileInput()},n=function(c,e,f){var g=b.getOutData(c);b.showUploadError(f,g,null,null,"filebatchuploaderror"),b.uploadFileCount=d-1,b.$preview.find(".file-preview-frame").each(function(){var c=a(this),d=c.attr("data-fileindex");c.removeClass("file-uploading"),void 0!==b.filestack[d]&&h(d,"indicatorError","indicatorErrorTitle")}),b.$preview.find(".file-preview-frame").removeClass("file-uploading"),b.$preview.find(".file-preview-frame kv-file-upload").removeAttr("disabled"),b.$preview.find(".file-preview-frame kv-file-delete").removeAttr("disabled")},a.each(c,function(a,d){J(c[a])||b.formdata.append(b.uploadFileAttr,d)}),b.ajaxSubmit(k,l,m,n))},hideFileIcon:function(){this.overwriteInitial&&this.$captionContainer.find(".kv-caption-icon").hide()},showFileIcon:function(){this.$captionContainer.find(".kv-caption-icon").show()},resetErrors:function(a){var b=this,c=b.$errorContainer;b.isError=!1,b.$container.removeClass("has-error"),c.html(""),a?c.fadeOut("slow"):c.hide()},showUploadError:function(a,b,c,d,e){var g=this,h=g.$errorContainer;return e=e||"fileuploaderror",0===h.find("ul").length?h.html('<ul class="text-left"><li>'+a+"</li></ul>"):h.find("ul").append("<li>"+a+"</li>"),h.fadeIn(800),g.raise(e,[b,c,d,g.reader]),f(g.$container,"has-error"),!0},showError:function(a,b,c,d,e,g){var h=this,i=h.$errorContainer;return e=e||"fileerror",g=g||{},i.html(a),i.fadeIn(800),h.raise(e,[b,c,d,h.reader,g]),h.isUploadable||h.clearFileInput(),f(h.$container,"has-error"),h.$btnUpload.attr("disabled",!0),!0},errorHandler:function(a,b){var c=this,d=a.target.error;switch(d.code){case d.NOT_FOUND_ERR:c.addError(c.msgFileNotFound.repl("{name}",b));break;case d.SECURITY_ERR:c.addError(c.msgFileSecured.repl("{name}",b));break;case d.NOT_READABLE_ERR:c.addError(c.msgFileNotReadable.repl("{name}",b));break;case d.ABORT_ERR:c.addError(c.msgFilePreviewAborted.repl("{name}",b));break;default:c.addError(c.msgFilePreviewError.repl("{name}",b))}},parseFileType:function(a){var c,d,e,f,b=this;for(f=0;f<G.length;f+=1)if(e=G[f],c=L(e,b.fileTypeSettings)?b.fileTypeSettings[e]:I[e],d=c(a.type,a.name)?e:"",!J(d))return d;return"other"},previewDefault:function(b,c,d){if(this.showPreview){var e=this,f=Q.createObjectURL(b),g=a("#"+c),h=e.previewSettings.other,i=e.renderFileFooter(b.name,h.width),j=e.getPreviewTemplate("other"),k=c.slice(c.lastIndexOf("-")+1),l="";d===!0&&(l=" btn disabled",i+='<div class="file-other-error text-danger"><i class="glyphicon glyphicon-exclamation-sign"></i></div>'),e.$preview.append("\n"+j.repl("{previewId}",c).repl("{frameClass}",l).repl("{fileindex}",k).repl("{caption}",e.slug(b.name)).repl("{width}",h.width).repl("{height}",h.height).repl("{type}",b.type).repl("{data}",f).repl("{footer}",i)),g.on("load",function(){Q.revokeObjectURL(g.attr("data"))})}},previewFile:function(a,b,c,d){if(this.showPreview){var h,i,q,r,e=this,f=e.parseFileType(a),g=e.slug(a.name),j=e.allowedPreviewTypes,k=e.allowedPreviewMimeTypes,l=L(f,e.previewTemplates)?e.previewTemplates[f]:F[f],m=L(f,e.previewSettings)?e.previewSettings[f]:H[f],n=parseInt(e.wrapTextLength,10),o=e.wrapIndicator,p=j.indexOf(f)>=0,s=J(k)||!J(k)&&L(a.type,k),t=e.renderFileFooter(g,m.width),u="",v=c.slice(c.lastIndexOf("-")+1);p&&s?("text"===f?(i=O(b.target.result),Q.revokeObjectURL(d),i.length>n&&(q="text-"+N(),r=.75*window.innerHeight,u=e.getLayoutTemplate("modal").repl("{id}",q).repl("{title}",g).repl("{height}",r).repl("{body}",i),o=o.repl("{title}",g).repl("{dialog}","$('#"+q+"').modal('show')"),i=i.substring(0,n-1)+o),h=l.repl("{previewId}",c).repl("{caption}",g).repl("{frameClass}","").repl("{type}",a.type).repl("{width}",m.width).repl("{height}",m.height).repl("{data}",i).repl("{footer}",t).repl("{fileindex}",v)+u):h=l.repl("{previewId}",c).repl("{caption}",g).repl("{frameClass}","").repl("{type}",a.type).repl("{data}",d).repl("{width}",m.width).repl("{height}",m.height).repl("{footer}",t).repl("{fileindex}",v),e.$preview.append("\n"+h),e.autoSizeImage(c)):e.previewDefault(a,c)}},slugDefault:function(a){return J(a)?"":a.split(/(\\|\/)/g).pop().replace(/[^\w\-.\\\/ ]+/g,"")},getFileStack:function(){var a=this;return a.filestack.filter(function(a){return void 0!==a})},readFiles:function(a){function o(p){if(J(c.attr("multiple"))&&(k=1),p>=k)return f.removeClass("loading"),g.html(""),void 0;var s,w,A,B,C,D,q=m+p,r=j+"-"+q,t=a[p],u=b.slug(t.name),v=(t.size||0)/1e3,x="",y=Q.createObjectURL(t),z=0,E=b.allowedFileTypes,F=J(E)?"":E.join(", "),G=b.allowedFileExtensions,H=J(G)?"":G.join(", ");if(J(G)||(x=new RegExp("\\.("+G.join("|")+")$","i")),v=v.toFixed(2),b.maxFileSize>0&&v>b.maxFileSize)return B=b.msgSizeTooLarge.repl("{name}",u).repl("{size}",v).repl("{maxSize}",b.maxFileSize),b.isError=n(B,t,r,p),void 0;if(!J(E)&&K(E)){for(A=0;A<E.length;A+=1)C=E[A],w=l[C],D=void 0!==w&&w(t.type,u),z+=J(D)?0:D.length;if(0===z)return B=b.msgInvalidFileType.repl("{name}",u).repl("{types}",F),b.isError=n(B,t,r,p),void 0}return 0!==z||J(G)||!K(G)||J(x)||(D=u.match(x),z+=J(D)?0:D.length,0!==z)?b.showPreview?(d.length>0&&void 0!==FileReader?(g.html(h.repl("{index}",p+1).repl("{files}",k)),f.addClass("loading"),e.onerror=function(a){b.errorHandler(a,u)},e.onload=function(a){b.previewFile(t,a,r,y),b.initFileActions()},e.onloadend=function(){B=i.repl("{index}",p+1).repl("{files}",k).repl("{percent}",50).repl("{name}",u),setTimeout(function(){g.html(B),Q.revokeObjectURL(y)},100),setTimeout(function(){o(p+1),b.updateFileDetails(k)},100),b.raise("fileloaded",[t,r,p,e])},e.onprogress=function(a){if(a.lengthComputable){var b=100*(a.loaded/a.total),c=Math.ceil(b);B=i.repl("{index}",p+1).repl("{files}",k).repl("{percent}",c).repl("{name}",u),setTimeout(function(){g.html(B)},100)}},s=L("text",l)?l.text:I.text,s(t.type,u)?e.readAsText(t,b.textEncoding):e.readAsArrayBuffer(t)):(b.previewDefault(t,r),setTimeout(function(){o(p+1),b.updateFileDetails(k)
  12. },100),b.raise("fileloaded",[t,r,p,e])),b.filestack.push(t),void 0):(b.filestack.push(t),setTimeout(o(p+1),100),b.raise("fileloaded",[t,r,p,e]),void 0):(B=b.msgInvalidFileExtension.repl("{name}",u).repl("{extensions}",H),b.isError=n(B,t,r,p),void 0)}this.reader=new FileReader;var b=this,c=b.$element,d=b.$preview,e=b.reader,f=b.$previewContainer,g=b.$previewStatus,h=b.msgLoading,i=b.msgProgress,j=b.previewInitId,k=a.length,l=b.fileTypeSettings,m=b.filestack.length,n=function(c,d,e,f){b.previewDefault(d,e,!0);var g=b.getOutData({},{},a);return b.isUploadable?b.showUploadError(c,g,e,f):b.showError(c,d,e,f)};o(0),b.updateFileDetails(k,!1)},updateFileDetails:function(a){var b=this,c=b.msgSelected,d=b.$element,e=b.getFileStack(),f=d.val()||e.length&&e[0].name||"",g=b.slug(f),h=b.isUploadable?e.length:a,i=b.initialPreviewCount+h,j=h>1?c.repl("{n}",i):g;b.isError?(b.$previewContainer.removeClass("loading"),b.$previewStatus.html(""),b.$captionContainer.find(".kv-caption-icon").hide(),j=b.msgValidationError):b.showFileIcon(),b.setCaption(j),b.$container.removeClass("file-input-new file-input-ajax-new"),1===arguments.length&&b.raise("fileselect",[a,g])},change:function(a){var d,e,f,b=this,c=b.$element,g=b.$preview,h=arguments.length>1,i=h?a.originalEvent.dataTransfer.files:c.get(0).files,j=J(c.attr("multiple")),k=b.filestack.length,l=b.isUploadable&&0!==k,m=function(a,c,d,e){var f=b.getOutData({},{},i);return b.isUploadable?b.showUploadError(a,f,d,e):b.showError(a,c,d,e)};return b.resetUpload(),b.hideFileIcon(),b.$container.find(".file-drop-zone ."+b.dropZoneTitleClass).remove(),d=h?i:void 0===a.target.files?a.target&&a.target.value?[{name:a.target.value.replace(/^.+\\/,"")}]:[]:a.target.files,J(d)||0===d.length?(l||b.clear(!0),b.raise("fileselectnone"),void 0):(b.resetErrors(),(!l||j&&k>0)&&(b.overwriteInitial?g.html(""):g.html(b.initialPreviewContent),j&&k>0&&(b.filestack=[])),f=b.isUploadable?b.getFileStack().length+d.length:d.length,b.maxFileCount>0&&f>b.maxFileCount?(e=b.msgFilesTooMany.repl("{m}",b.maxFileCount).repl("{n}",f),b.isError=m(e,null,null,null),b.$captionContainer.find(".kv-caption-icon").hide(),b.$caption.html(b.msgValidationError),b.setEllipsis(),b.$container.removeClass("file-input-new file-input-ajax-new"),void 0):(b.isIE9?b.updateFileDetails(1):b.readFiles(i),l?b.raise("filebatchselected",[b.getFileStack()]):b.raise("filebatchselected",[d]),b.reader=null,void 0))},autoSizeImage:function(a){var f,g,h,b=this,c=b.$preview,d=c.find("#"+a),e=d.find("img");e.length&&e.on("load",function(){f=d.width(),g=c.width(),f>g&&(e.css("width","100%"),d.css("width","97%")),h=e.closest(".file-preview-frame").find(".file-caption-name"),h.length&&(h.width(e.width()),h.attr("title",h.text())),b.raise("fileimageloaded",a)})},setCaption:function(b){var c=this,d=a("<div>"+b+"</div>").text(),e=c.getLayoutTemplate("icon"),f=e+d;0!==c.$caption.length&&(c.$caption.html(f),c.$caption.attr("title",d),c.$captionContainer.find(".file-caption-ellipsis").attr("title",d),c.setEllipsis())},initBrowse:function(a){var b=this;b.$btnFile=a.find(".btn-file"),b.$btnFile.append(b.$element)},createContainer:function(){var b=this,c=a(document.createElement("span")).attr({"class":"file-input file-input-new"}).html(b.renderMain());return b.$element.before(c),b.initBrowse(c),c},refreshContainer:function(){var a=this,b=a.$container;b.before(a.$element),b.html(a.renderMain()),a.initBrowse(b)},renderMain:function(){var a=this,b=a.isUploadable&&a.dropZoneEnabled?" file-drop-zone":"",c=a.showPreview?a.getLayoutTemplate("preview").repl("{class}",a.previewClass).repl("{dropClass}",b):"",d=a.isDisabled?a.captionClass+" file-caption-disabled":a.captionClass,e=a.captionTemplate.repl("{class}",d+" kv-fileinput-caption");return a.mainTemplate.repl("{class}",a.mainClass).repl("{preview}",c).repl("{caption}",e).repl("{upload}",a.renderUpload()).repl("{remove}",a.renderRemove()).repl("{cancel}",a.renderCancel()).repl("{browse}",a.renderBrowse())},renderBrowse:function(){var a=this,b=a.browseClass+" btn-file",c="";return a.isDisabled&&(c=" disabled "),'<div class="'+b+'"'+c+"> "+a.browseIcon+a.browseLabel+" </div>"},renderRemove:function(){var a=this,b=a.removeClass+" fileinput-remove fileinput-remove-button",c="";return a.showRemove?(a.isDisabled&&(c=" disabled "),'<button type="button" title="'+a.removeTitle+'" class="'+b+'"'+c+">"+a.removeIcon+a.removeLabel+"</button>"):""},renderCancel:function(){var a=this,b=a.cancelClass+" fileinput-cancel fileinput-cancel-button";return a.showCancel?"":'<button type="button" title="'+a.cancelTitle+'" class="hide '+b+'">'+a.cancelIcon+a.cancelLabel+"</button>"},renderUpload:function(){var a=this,b=a.uploadClass+" kv-fileinput-upload fileinput-upload-button",c="",d="";return a.showUpload?(a.isDisabled&&(d=" disabled "),c=!a.isUploadable||a.isDisabled?'<button type="submit" title="'+a.uploadTitle+'"class="'+b+'"'+d+">"+a.uploadIcon+a.uploadLabel+"</button>":'<a href="'+a.uploadUrl+'" title="'+a.uploadTitle+'" class="'+b+'"'+d+">"+a.uploadIcon+a.uploadLabel+"</a>"):""}},a.fn.fileinput=function(d){if(c()||b(9)){var e=Array.apply(null,arguments);return e.shift(),this.each(function(){var b=a(this),c=b.data("fileinput"),f="object"==typeof d&&d;c||(c=new R(this,a.extend({},a.fn.fileinput.defaults,f,a(this).data())),b.data("fileinput",c)),"string"==typeof d&&c[d].apply(c,e)})}},a.fn.fileinput.defaults={showCaption:!0,showPreview:!0,showRemove:!0,showUpload:!0,showCancel:!0,mainClass:"",previewClass:"",captionClass:"",mainTemplate:null,initialCaption:"",initialPreview:"",initialPreviewCount:0,initialPreviewDelimiter:"*$$*",initialPreviewConfig:[],initialPreviewShowDelete:!0,overwriteInitial:!0,layoutTemplates:E,previewTemplates:F,allowedPreviewTypes:G,allowedPreviewMimeTypes:null,allowedFileTypes:null,allowedFileExtensions:null,customLayoutTags:{},customPreviewTags:{},previewSettings:H,fileTypeSettings:I,browseLabel:"Browse &hellip;",browseIcon:'<i class="glyphicon glyphicon-folder-open"></i> &nbsp;',browseClass:"btn btn-primary",removeLabel:"Remove",removeTitle:"Clear selected files",removeIcon:'<i class="glyphicon glyphicon-trash"></i> ',removeClass:"btn btn-default",cancelLabel:"Cancel",cancelTitle:"Abort ongoing upload",cancelIcon:'<i class="glyphicon glyphicon-ban-circle"></i> ',cancelClass:"btn btn-default",uploadLabel:"Upload",uploadTitle:"Upload selected files",uploadIcon:'<i class="glyphicon glyphicon-upload"></i> ',uploadClass:"btn btn-default",uploadUrl:null,uploadExtraData:[],uploadAsync:!0,maxFileSize:0,maxFileCount:0,msgSizeTooLarge:'File "{name}" (<b>{size} KB</b>) exceeds maximum allowed upload size of <b>{maxSize} KB</b>. Please retry your upload!',msgFilesTooMany:"Number of files selected for upload <b>({n})</b> exceeds maximum allowed limit of <b>{m}</b>. Please retry your upload!",msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgValidationError:'<span class="text-danger"><i class="glyphicon glyphicon-exclamation-sign"></i> File Upload Error</span>',msgErrorClass:"file-error-message",msgLoading:"Loading file {index} of {files} &hellip;",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} files selected",progressClass:"progress-bar progress-bar-success progress-bar-striped active",progressCompleteClass:"progress-bar progress-bar-success",previewFileType:"image",wrapTextLength:250,wrapIndicator:' <span class="wrap-indicator" title="{title}" onclick="{dialog}">[&hellip;]</span>',elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,slugCallback:null,dropZoneEnabled:!0,dropZoneTitle:"Drag & drop files here &hellip;",dropZoneTitleClass:"file-drop-zone-title",fileActionSettings:{},otherActionButtons:"",textEncoding:"UTF-8"},a.fn.fileinput.Constructor=R,a(document).ready(function(){var b=a("input.file[type=file]"),c=b.attr("type")?b.length:0;c>0&&b.fileinput()})}(window.jQuery);