diff --git a/src/public/mix-manifest.json b/src/public/mix-manifest.json index 3be275d..cb5c584 100644 --- a/src/public/mix-manifest.json +++ b/src/public/mix-manifest.json @@ -1,8 +1,8 @@ { - "/mediamanager.min.css": "/mediamanager.min.css?id=ee160f6ca2948e84f0c8", - "/select-media.min.css": "/select-media.min.css?id=84be2402d305e787180c", - "/mediamanager.min.js": "/mediamanager.min.js?id=5a22e5918c660ebfffe8", - "/select-media.min.js": "/select-media.min.js?id=c20adba93a405640a462", - "/vendor/blueimp-file-upload/jquery.fileupload.min.js": "/vendor/blueimp-file-upload/jquery.fileupload.min.js?id=6ba1a0dc7dfbc68ab793", - "/vendor/jquery-lazy/jquery.lazy.plugins.js": "/vendor/jquery-lazy/jquery.lazy.plugins.js?id=4b64116baf997898d259" + "/mediamanager.min.css": "/mediamanager.min.css?id=ee160f6ca2948e84f0c853ed37981e33", + "/select-media.min.css": "/select-media.min.css?id=84be2402d305e787180c25ef33f72714", + "/mediamanager.min.js": "/mediamanager.min.js?id=5a22e5918c660ebfffe8b36c77c74615", + "/select-media.min.js": "/select-media.min.js?id=6b3d13fe529b2c44579f2fc3177f1e9f", + "/vendor/blueimp-file-upload/jquery.fileupload.min.js": "/vendor/blueimp-file-upload/jquery.fileupload.min.js?id=892d0df4836b425e48d63825b3545f28", + "/vendor/jquery-lazy/jquery.lazy.plugins.js": "/vendor/jquery-lazy/jquery.lazy.plugins.js?id=4b64116baf997898d259ce38bef708d0" } diff --git a/src/public/select-media.min.js b/src/public/select-media.min.js index 792e7f8..4386072 100644 --- a/src/public/select-media.min.js +++ b/src/public/select-media.min.js @@ -1 +1 @@ -$((function(){$(document).on("change",'[data-action="setMediaFile"]',(function(){$(this).next().addClass("d-none"),$(this).prev().val(""),""!==$(this).val()&&($(this).next().removeClass("d-none"),$(this).prev().val($(this).val().replace(/.*\/(.*)\?.*$/,"$1")))})),$(document).on("click",'[data-action="clearMediaFile"]',(function(e){e.preventDefault(),$(this).prev().val("").trigger("change")})),$(document).on("click",".btn-select-image, .btn-select-file",(function(){$("body").css("overflow","hidden").append('
File manager
')})),$(document).on("click","#select-media-close span",(function(){$("body").css("overflow",""),$("#select-media-bg").remove()})),$(document).on("click",".select-image-view",(function(e){e.preventDefault(),window.open($(this).closest(".select-image-wrapper").find("input").val())})),$(document).on("click",".select-image-edit",(function(e){e.preventDefault(),$(this).closest(".select-image-wrapper").find(".btn-select-image").trigger("click")})),$(document).on("click",".select-image-delete",(function(e){e.preventDefault();var a=$(this).closest(".select-image-wrapper");bootbox.confirm(selectMediaLocales.confirm,(function(e){!1!==e&&(a.removeClass("editable"),a.find("input").val("").trigger("change"),a.find(".btn-select-image").html(''))}))})),window.onmessage=function(e){"insertMedia"===e.data.action&&($("input[data-id="+e.data.field+"]").val(e.data.url).trigger("change"),"image"===e.data.type&&($("button[data-field="+e.data.field+"]").html(''),$("button[data-field="+e.data.field+"]").parent().addClass("editable")),$("#select-media-bg").remove(),$("body").css("overflow","auto"))}})); +$((function(){$(document).on("change",'[data-action="setMediaFile"]',(function(){$(this).next().addClass("d-none"),$(this).prev().val(""),""!==$(this).val()&&($(this).next().removeClass("d-none"),$(this).prev().val($(this).val().replace(/.*\/(.*)\?.*$/,"$1")))})),$(document).on("click",'[data-action="clearMediaFile"]',(function(e){e.preventDefault(),$(this).prev().val("").trigger("change")})),$(document).on("click",".btn-select-image, .btn-select-file",(function(){$("body").css("overflow","hidden").append('
File manager
')})),$(document).on("click","#select-media-close span",(function(){$("body").css("overflow",""),$("#select-media-bg").remove()})),$(document).on("click",".select-image-view",(function(e){e.preventDefault(),window.open($(this).closest(".select-image-wrapper").find("input").val())})),$(document).on("click",".select-image-edit",(function(e){e.preventDefault(),$(this).closest(".select-image-wrapper").find(".btn-select-image").trigger("click")})),$(document).on("click",".select-image-delete",(function(e){e.preventDefault();var t=$(this).closest(".select-image-wrapper");bootbox.confirm(selectMediaLocales.confirm,(function(e){!1!==e&&(t.removeClass("editable"),t.find("input").val("").trigger("change"),t.find(".btn-select-image").html(''))}))})),window.addEventListener("message",(function(e){"insertMedia"===e.data.action&&($("input[data-id="+e.data.field+"]").val(e.data.url).trigger("change"),"image"===e.data.type&&($("button[data-field="+e.data.field+"]").html(''),$("button[data-field="+e.data.field+"]").parent().addClass("editable")),$("#select-media-bg").remove(),$("body").css("overflow","auto"))}))})); diff --git a/src/public/vendor/blueimp-file-upload/jquery.fileupload.min.js b/src/public/vendor/blueimp-file-upload/jquery.fileupload.min.js index c8bd50f..326b09a 100644 --- a/src/public/vendor/blueimp-file-upload/jquery.fileupload.min.js +++ b/src/public/vendor/blueimp-file-upload/jquery.fileupload.min.js @@ -1 +1 @@ -!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){"use strict";var t,i=0,n=Array.prototype.hasOwnProperty,r=Array.prototype.slice;return e.cleanData=(t=e.cleanData,function(i){var n,r,s;for(s=0;null!=(r=i[s]);s++)(n=e._data(r,"events"))&&n.remove&&e(r).triggerHandler("remove");t(i)}),e.widget=function(t,i,n){var r,s,o,a={},l=t.split(".")[0],u=l+"-"+(t=t.split(".")[1]);return n||(n=i,i=e.Widget),Array.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr.pseudos[u.toLowerCase()]=function(t){return!!e.data(t,u)},e[l]=e[l]||{},r=e[l][t],s=e[l][t]=function(e,t){if(!this._createWidget)return new s(e,t);arguments.length&&this._createWidget(e,t)},e.extend(s,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),(o=new i).options=e.widget.extend({},o.options),e.each(n,(function(e,t){a[e]="function"==typeof t?function(){function n(){return i.prototype[e].apply(this,arguments)}function r(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,s=this._superApply;return this._super=n,this._superApply=r,e=t.apply(this,arguments),this._super=i,this._superApply=s,e}}():t})),s.prototype=e.widget.extend(o,{widgetEventPrefix:r&&o.widgetEventPrefix||t},a,{constructor:s,namespace:l,widgetName:t,widgetFullName:u}),r?(e.each(r._childConstructors,(function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,s,i._proto)})),delete r._childConstructors):i._childConstructors.push(s),e.widget.bridge(t,s),s},e.widget.extend=function(t){for(var i,s,o=r.call(arguments,1),a=0,l=o.length;a",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,i){t._removeClass(i,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,r,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},n=t.split("."),t=n.shift(),n.length){for(r=o[t]=e.widget.extend({},this.options[t]),s=0;s')).attr("accept-charset",i.formAcceptCharset),s=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+s+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+s+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+s+"_method=PATCH",i.type="POST"),r=e('').bind("load",(function(){var t,s=e.isArray(i.paramName)?i.paramName:[i.paramName];r.unbind("load").bind("load",(function(){var t;try{if(!(t=r.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('').appendTo(n),window.setTimeout((function(){n.remove()}),0)})),n.prop("target",r.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,(function(t,i){e('').prop("name",i.name).val(i.value).appendTo(n)})),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after((function(e){return t[e]})),i.paramName&&i.fileInput.each((function(t){e(this).prop("name",s[t]||i.paramName)})),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),n.submit(),t&&t.length&&i.fileInput.each((function(i,n){var r=e(t[i]);e(n).prop("name",r.prop("name")).attr("form",r.attr("form")),r.replaceWith(n)}))})),n.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src",o),n&&n.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&i[n](e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}((function(e){"use strict";function t(t){var i="dragover"===t;return function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var r=n.dataTransfer;r&&-1!==e.inArray("Files",r.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:n}))&&(n.preventDefault(),i&&(r.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,(function(e,i){t=t.replace("{"+e+"}",i)})),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done((function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,(function(e,t){i.push({name:e,value:t})})),i):[]},_getTotal:function(t){var i=0;return e.each(t,(function(e,t){i+=t.size||1})),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,r=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&r-i._time").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each((function(){for(var t=e(this),i=t.prop("name")||"files[]",r=(t.prop("files")||[1]).length;r;)n.push(i),r-=1})),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var r=e.Deferred(),s=r.promise();return i=i||this.options.context||s,!0===t?r.resolveWith(i,n):!1===t&&r.rejectWith(i,n),s.abort=r.promise,this._enhancePromise(s)},_addConvenienceMethods:function(t,i){var n=this,r=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,s){return(t||s)&&(i._processQueue=this._processQueue=(this._processQueue||r([this])).then((function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():r(arguments)})).then(t,s)),this._processQueue||r([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,r,s=this,o=t.files[0],a=o.size,l=t.uploadedBytes,u=t.maxChunkSize||a,p=this._blobSlice,d=e.Deferred(),c=d.promise();return!(!(this._isXHRUpload(t)&&p&&(l||("function"===e.type(u)?u(t):u)=a?(o.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",o.error])):(r=function(){var i=e.extend({},t),c=i._progress.loaded;i.blob=p.call(o,l,l+("function"===e.type(u)?u(i):u),o.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+a,s._trigger("chunkbeforesend",null,i),s._initXHRData(i),s._initProgressListener(i),n=(!1!==s._trigger("chunksend",null,i)&&e.ajax(i)||s._getXHRPromise(!1,i.context)).done((function(n,o,u){l=s._getUploadedBytes(u)||l+i.chunkSize,c+i.chunkSize-i._progress.loaded&&s._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=o,i.jqXHR=u,s._trigger("chunkdone",null,i),s._trigger("chunkalways",null,i),la._sending)for(var n=a._slots.shift();n;){if("pending"===a._getDeferredState(n)){n.resolve();break}n=a._slots.shift()}0===a._active&&a._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(s=e.Deferred(),this._slots.push(s),o=s.then(u)):(this._sequence=this._sequence.then(u,u),o=this._sequence),o.abort=function(){return r=[void 0,"abort","abort"],n?n.abort():(s&&s.rejectWith(l.context,r),u())},this._enhancePromise(o)):u()},_onAdd:function(t,i){var n,r,s,o,a=this,l=!0,u=e.extend({},this.options,i),p=i.files,d=p.length,c=u.limitMultiFileUploads,h=u.limitMultiFileUploadSize,f=u.limitMultiFileUploadSizeOverhead,g=0,m=this._getParamName(u),_=0;if(!d)return!1;if(h&&void 0===p[0].size&&(h=void 0),(u.singleFileUploads||c||h)&&this._isXHRUpload(u))if(u.singleFileUploads||h||!c)if(!u.singleFileUploads&&h)for(s=[],n=[],o=0;oh||c&&o+1-_>=c)&&(s.push(p.slice(_,o+1)),(r=m.slice(_,o+1)).length||(r=m),n.push(r),_=o+1,g=0);else n=m;else for(s=[],n=[],o=0;o").append(n)[0].reset(),i.after(n).detach(),r&&n.focus(),e.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===i[0]?n[0]:t})),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,r=this,s=e.Deferred(),o=[],a=function(e){e&&!e.entry&&(e.entry=t),s.resolve([e])},l=function(){n.readEntries((function(e){e.length?(o=o.concat(e),l()):function(e){r._handleFileTreeEntries(e,i+t.name+"/").done((function(e){s.resolve(e)})).fail(a)}(o)}),a)};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,s.resolve(t._file)):t.file((function(e){e.relativePath=i,s.resolve(e)}),a):t.isDirectory?(n=t.createReader(),l()):s.resolve([]),s.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,(function(e){return n._handleFileTreeEntry(e,i)}))).then((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,r=(t=e(t)).prop("webkitEntries")||t.prop("entries");if(r&&r.length)return this._handleFileTreeEntries(r);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).then((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always((function(r){n.files=r,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,(function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,r={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always((function(n){r.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),r)&&i._onAdd(t,r)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,(function(e,r){var s,o=r.name.toLowerCase();/^data-/.test(o)&&(o=o.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),s=n[o],t._isRegExpOption(o,s)&&(s=t._getRegExp(s)),i[o]=s)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,i._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,r=this,s=e.Deferred(),o=s.promise();return o.abort=function(){return n=!0,i?i.abort():(s.reject(null,"abort","abort"),o)},this._getFileInputFiles(t.fileInput).always((function(e){n||(e.length?(t.files=e,(i=r._onSend(null,t)).then((function(e,t,i){s.resolve(e,t,i)}),(function(e,t,i){s.reject(e,t,i)}))):s.reject())})),this._enhancePromise(o)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})); +!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./version"],e):e(jQuery)}((function(e){"use strict";var t,i=0,n=Array.prototype.hasOwnProperty,r=Array.prototype.slice;return e.cleanData=(t=e.cleanData,function(i){var n,r,s;for(s=0;null!=(r=i[s]);s++)(n=e._data(r,"events"))&&n.remove&&e(r).triggerHandler("remove");t(i)}),e.widget=function(t,i,n){var r,s,o,a={},l=t.split(".")[0],u=l+"-"+(t=t.split(".")[1]);return n||(n=i,i=e.Widget),Array.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr.pseudos[u.toLowerCase()]=function(t){return!!e.data(t,u)},e[l]=e[l]||{},r=e[l][t],s=e[l][t]=function(e,t){if(!this||!this._createWidget)return new s(e,t);arguments.length&&this._createWidget(e,t)},e.extend(s,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),(o=new i).options=e.widget.extend({},o.options),e.each(n,(function(e,t){a[e]="function"==typeof t?function(){function n(){return i.prototype[e].apply(this,arguments)}function r(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,s=this._superApply;return this._super=n,this._superApply=r,e=t.apply(this,arguments),this._super=i,this._superApply=s,e}}():t})),s.prototype=e.widget.extend(o,{widgetEventPrefix:r&&o.widgetEventPrefix||t},a,{constructor:s,namespace:l,widgetName:t,widgetFullName:u}),r?(e.each(r._childConstructors,(function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,s,i._proto)})),delete r._childConstructors):i._childConstructors.push(s),e.widget.bridge(t,s),s},e.widget.extend=function(t){for(var i,s,o=r.call(arguments,1),a=0,l=o.length;a",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,(function(e,i){t._removeClass(i,e)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,r,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},n=t.split("."),t=n.shift(),n.length){for(r=o[t]=e.widget.extend({},this.options[t]),s=0;s')).attr("accept-charset",i.formAcceptCharset),s=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+s+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+s+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+s+"_method=PATCH",i.type="POST"),r=e('').bind("load",(function(){var t,s=e.isArray(i.paramName)?i.paramName:[i.paramName];r.unbind("load").bind("load",(function(){var t;try{if(!(t=r.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('').appendTo(n),window.setTimeout((function(){n.remove()}),0)})),n.prop("target",r.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,(function(t,i){e('').prop("name",i.name).val(i.value).appendTo(n)})),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after((function(e){return t[e]})),i.paramName&&i.fileInput.each((function(t){e(this).prop("name",s[t]||i.paramName)})),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),n.submit(),t&&t.length&&i.fileInput.each((function(i,n){var r=e(t[i]);e(n).prop("name",r.prop("name")).attr("form",r.attr("form")),r.replaceWith(n)}))})),n.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src",o),n&&n.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&i[n](e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}((function(e){"use strict";function t(t){var i="dragover"===t;return function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var r=n.dataTransfer;r&&-1!==e.inArray("Files",r.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:n}))&&(n.preventDefault(),i&&(r.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,(function(e,i){t=t.replace("{"+e+"}",i)})),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done((function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,(function(e,t){i.push({name:e,value:t})})),i):[]},_getTotal:function(t){var i=0;return e.each(t,(function(e,t){i+=t.size||1})),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,r=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&r-i._time").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each((function(){for(var t=e(this),i=t.prop("name")||"files[]",r=(t.prop("files")||[1]).length;r;)n.push(i),r-=1})),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var r=e.Deferred(),s=r.promise();return i=i||this.options.context||s,!0===t?r.resolveWith(i,n):!1===t&&r.rejectWith(i,n),s.abort=r.promise,this._enhancePromise(s)},_addConvenienceMethods:function(t,i){var n=this,r=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,s){return(t||s)&&(i._processQueue=this._processQueue=(this._processQueue||r([this])).then((function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():r(arguments)})).then(t,s)),this._processQueue||r([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,r,s=this,o=t.files[0],a=o.size,l=t.uploadedBytes,u=t.maxChunkSize||a,p=this._blobSlice,d=e.Deferred(),c=d.promise();return!(!(this._isXHRUpload(t)&&p&&(l||("function"===e.type(u)?u(t):u)=a?(o.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",o.error])):(r=function(){var i=e.extend({},t),c=i._progress.loaded;i.blob=p.call(o,l,l+("function"===e.type(u)?u(i):u),o.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+a,s._trigger("chunkbeforesend",null,i),s._initXHRData(i),s._initProgressListener(i),n=(!1!==s._trigger("chunksend",null,i)&&e.ajax(i)||s._getXHRPromise(!1,i.context)).done((function(n,o,u){l=s._getUploadedBytes(u)||l+i.chunkSize,c+i.chunkSize-i._progress.loaded&&s._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=o,i.jqXHR=u,s._trigger("chunkdone",null,i),s._trigger("chunkalways",null,i),la._sending)for(var n=a._slots.shift();n;){if("pending"===a._getDeferredState(n)){n.resolve();break}n=a._slots.shift()}0===a._active&&a._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(s=e.Deferred(),this._slots.push(s),o=s.then(u)):(this._sequence=this._sequence.then(u,u),o=this._sequence),o.abort=function(){return r=[void 0,"abort","abort"],n?n.abort():(s&&s.rejectWith(l.context,r),u())},this._enhancePromise(o)):u()},_onAdd:function(t,i){var n,r,s,o,a=this,l=!0,u=e.extend({},this.options,i),p=i.files,d=p.length,c=u.limitMultiFileUploads,h=u.limitMultiFileUploadSize,f=u.limitMultiFileUploadSizeOverhead,g=0,m=this._getParamName(u),_=0;if(!d)return!1;if(h&&void 0===p[0].size&&(h=void 0),(u.singleFileUploads||c||h)&&this._isXHRUpload(u))if(u.singleFileUploads||h||!c)if(!u.singleFileUploads&&h)for(s=[],n=[],o=0;oh||c&&o+1-_>=c)&&(s.push(p.slice(_,o+1)),(r=m.slice(_,o+1)).length||(r=m),n.push(r),_=o+1,g=0);else n=m;else for(s=[],n=[],o=0;o").append(n)[0].reset(),i.after(n).detach(),r&&n.focus(),e.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===i[0]?n[0]:t})),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,r=this,s=e.Deferred(),o=[],a=function(e){e&&!e.entry&&(e.entry=t),s.resolve([e])},l=function(){n.readEntries((function(e){e.length?(o=o.concat(e),l()):function(e){r._handleFileTreeEntries(e,i+t.name+"/").done((function(e){s.resolve(e)})).fail(a)}(o)}),a)};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,s.resolve(t._file)):t.file((function(e){e.relativePath=i,s.resolve(e)}),a):t.isDirectory?(n=t.createReader(),l()):s.resolve([]),s.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,(function(e){return n._handleFileTreeEntry(e,i)}))).then((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,r=(t=e(t)).prop("webkitEntries")||t.prop("entries");if(r&&r.length)return this._handleFileTreeEntries(r);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).then((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always((function(r){n.files=r,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,(function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,r={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always((function(n){r.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),r)&&i._onAdd(t,r)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,(function(e,r){var s,o=r.name.toLowerCase();/^data-/.test(o)&&(o=o.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),s=n[o],t._isRegExpOption(o,s)&&(s=t._getRegExp(s)),i[o]=s)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,i._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,r=this,s=e.Deferred(),o=s.promise();return o.abort=function(){return n=!0,i?i.abort():(s.reject(null,"abort","abort"),o)},this._getFileInputFiles(t.fileInput).always((function(e){n||(e.length?(t.files=e,(i=r._onSend(null,t)).then((function(e,t,i){s.resolve(e,t,i)}),(function(e,t,i){s.reject(e,t,i)}))):s.reject())})),this._enhancePromise(o)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})); diff --git a/src/resources/js/select-media.js b/src/resources/js/select-media.js index 009b210..efcadb9 100644 --- a/src/resources/js/select-media.js +++ b/src/resources/js/select-media.js @@ -56,7 +56,7 @@ $(function () { }) }); - window.onmessage = function (e) { + window.addEventListener('message', function (e) { if (e.data.action === 'insertMedia') { $('input[data-id=' + e.data.field + ']').val(e.data.url).trigger('change'); @@ -68,5 +68,5 @@ $(function () { $('#select-media-bg').remove(); $('body').css('overflow', 'auto'); } - }; + }); });