diff --git a/admin.php b/admin.php index c1cc0b2b..53b41434 100644 --- a/admin.php +++ b/admin.php @@ -695,7 +695,12 @@ class AdminPlugin extends Plugin 'ROUTABLE', 'NON_ROUTABLE', 'PUBLISHED', - 'NON_PUBLISHED' + 'NON_PUBLISHED', + 'PLUGINS', + 'THEMES', + 'ALL', + 'FROM', + 'TO' ]; foreach($strings as $string) { diff --git a/languages/en.yaml b/languages/en.yaml index 344cbe7c..16b8461f 100644 --- a/languages/en.yaml +++ b/languages/en.yaml @@ -561,9 +561,12 @@ PLUGIN_ADMIN: TYPE: "Type" FILE_EXTENSION: "File Extension" LEGEND: "Page Legend" - MEMCACHE_SERVER: Memcache server - MEMCACHE_PORT: Memcache port - MEMCACHED_SERVER: Memcache server - MEMCACHED_PORT: Memcache port - REDIS_SERVER: Redis server - REDIS_PORT: Redis port \ No newline at end of file + MEMCACHE_SERVER: "Memcache server" + MEMCACHE_PORT: "Memcache port" + MEMCACHED_SERVER: "Memcache server" + MEMCACHED_PORT: "Memcache port" + REDIS_SERVER: "Redis server" + REDIS_PORT: "Redis port" + ALL: "All" + FROM: "from" + TO: "to" \ No newline at end of file diff --git a/themes/grav/app/updates/index.js b/themes/grav/app/updates/index.js index b7a2b497..18ec00f6 100644 --- a/themes/grav/app/updates/index.js +++ b/themes/grav/app/updates/index.js @@ -85,12 +85,19 @@ export default class Updates { .addClass('with-updates') .find('.badge.updates').text(length); + var type_translation = ''; // update all - let title = type.charAt(0).toUpperCase() + type.substr(1).toLowerCase(); + + if (type === 'plugins') { + type_translation = translations.PLUGIN_ADMIN.PLUGINS; + } else { + type_translation = translations.PLUGIN_ADMIN.THEMES; + } + let updateAll = $(`.grav-update.${type}`); updateAll.css('display', 'block').html(`
- ${translations.PLUGIN_ADMIN.UPDATE} All ${title} + ${translations.PLUGIN_ADMIN.UPDATE} ${translations.PLUGIN_ADMIN.ALL} ${type_translation} ${length} ${translations.PLUGIN_ADMIN.OF_YOUR} ${type} ${translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE}
diff --git a/themes/grav/app/utils/packages.js b/themes/grav/app/utils/packages.js index f9422101..a476a79a 100644 --- a/themes/grav/app/utils/packages.js +++ b/themes/grav/app/utils/packages.js @@ -1,5 +1,5 @@ import $ from 'jquery'; -import { config } from 'grav-config'; +import { config, translations } from 'grav-config'; import request from '../utils/request'; import { Instance as gpm } from '../utils/gpm'; @@ -121,7 +121,7 @@ class Packages { name = resources.themes[slug].name; } - list.append(`"+t.stack+""),console.error(t.message+" at "+t.stack)}Object.defineProperty(e,"__esModule",{value:!0}),e.parseStatus=i,e.parseJSON=o,e.userFeedback=a,e.userFeedbackError=s;var u=n(303),c=r(u),l=n(306),f=function d(t){var d=new Error(t.statusText||t||"");return d.response=t,d}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(304),o=r(i);o["default"].options.positionClass="toast-top-right",o["default"].options.preventDuplicates=!0,e["default"]=o["default"]},,,function(t,e){t.exports=GravAdmin},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,s,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,s);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],a=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(s=a;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(function(t){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n"+n+"
")}return(0,s["default"])("#grav-update-button").on("click",function(){(0,s["default"])(this).html(l.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,d["default"])(t.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload.resources.total)return this.maintenance("hide");var t=["plugins","themes"],e=["plugin","theme"],n=this.payload.resources,r=n.plugins,i=n.themes;return this.payload.resources.total?void[r,i].forEach(function(n,r){if(n&&!Array.isArray(n)){var i=Object.keys(n).length,o=t[r];(0,s["default"])('#admin-menu a[href$="/'+t[r]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(i);var a=o.charAt(0).toUpperCase()+o.substr(1).toLowerCase(),u=(0,s["default"])(".grav-update."+o);u.css("display","block").html('\n\n '+l.translations.PLUGIN_ADMIN.UPDATE+" All "+a+'\n \n '+i+" "+l.translations.PLUGIN_ADMIN.OF_YOUR+" "+o+" "+l.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+"\n
\n ");var f=(0,s["default"])("[data-update-packages]").attr("data-packages-slugs")||"";f=f?f.split(","):[];var d=(0,c["default"])(f.concat(Object.keys(n))).join();(0,s["default"])("[data-update-packages]").attr("data-packages-slugs",""+d),Object.keys(n).forEach(function(t){var i=(0,s["default"])("[data-gpm-"+e[r]+'="'+t+'"]'),a=i.find(".gpm-name"),u=a.find("a");if("plugins"!==o||a.find(".badge.update").length?"themes"===o&&a.append('"):a.append(''+l.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!"),i.length){var c=(0,s["default"])(".grav-update."+e[r]);if(c.length){var f="testing"===n[t].type?'test release':"";c.html('\n\n '+l.translations.PLUGIN_ADMIN.UPDATE+" "+(e[r].charAt(0).toUpperCase()+e[r].substr(1).toLowerCase())+'\n \n v'+n[t].available+" "+f+" "+l.translations.PLUGIN_ADMIN.OF_THIS+" "+e[r]+" "+l.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+"!\n
\n ").css("display","block")}}}),(0,s["default"])("[data-update-packages]").removeClass("hidden")}}):this}}]),t}();e["default"]=p;var m=new p;e.Instance=m,h.Instance.on("fetched",function(t,e){m.setPayload(t.payload||{}),m.grav().resources()}),"1"===l.config.enable_auto_updates_check&&h.Instance.fetch()},function(t,e,n){function r(t,e){return e=e||i,o(t,function(t,n,r){for(var i=r.length;++n .fa").removeClass("fa-cloud-download").addClass("fa-refresh fa-spin"),(0,s["default"])(e,function(e){"updategrav"===e.type&&((0,o["default"])("[data-gpm-grav]").remove(),(0,o["default"])("#footer .grav-version").html(e.version)),t.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-cloud-download")})})},function(t,e,n){(function(t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(302),i=n(306),o=void 0,a=function(e){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=arguments.length<=2||void 0===arguments[2]?function(){return!0}:arguments[2];return"function"==typeof n&&(a=n,n={}),n.method&&"post"===n.method&&n.body&&!function(){var t=new FormData;n.body=Object.assign({"admin-nonce":i.config.admin_nonce},n.body),Object.keys(n.body).map(function(e){return t.append(e,n.body[e])}),n.body=t}(),n=Object.assign({credentials:"same-origin",headers:{Accept:"application/json"}},n),t(e,n).then(function(t){return o=t,t}).then(r.parseStatus).then(r.parseJSON).then(r.userFeedback).then(function(t){return a(t,o)})["catch"](r.userFeedbackError)};e["default"]=a}).call(e,n(3))},function(t,e,n){(function(t){"use strict";function e(t){return t&&t.__esModule?t:{"default":t}}var r=n(1),i=e(r),o=n(325),a=e(o),s=(0,i["default"])('input[type="radio"][name="channel-switch"]');s&&s.on("change",function(e){var n=(0,i["default"])(e.target),r=""+n.parent("[data-url]").data("url");(0,a["default"])(r,{method:"post",body:{task:"gpmRelease",release:n.val()}},function(e){e.reload&&t.location.reload()})})}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(328),o=r(i),a=n(330);n(331),e["default"]={Chart:{Chart:o["default"],UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:a.Instance}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instances=e.UpdatesChart=e.defaults=void 0;var s=function k(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:k(i,e,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},u=function(){function t(t,e){for(var n=0;n"+h.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+e.name+"
\n"+n.message+""})}},{key:"onDropzoneComplete",value:function(e){if(!e.accepted){var n={status:"error",message:h.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+e.name.match(/\..+/).join("")};return this.handleError({file:e,data:n,mode:"removeFile",msg:"
"+h.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+e.name+"
\n"+n.message+""})}(0,u["default"])(".dz-preview").prop("draggable","true"),this.options.reloadPage&&t.location.reload()}},{key:"onDropzoneRemovedFile",value:function(t){if(t.accepted&&!t.rejected){var e=this.form.data("media-url")+"/task"+h.config.param_sep+"delmedia";(0,d["default"])(e,{method:"post",body:{filename:t.name}})}}},{key:"onDropzoneError",value:function(t,e,n){var r=n?e.error.message:e;return(0,u["default"])(t.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:t,data:{status:"error"},msg:"
"+r+""})}},{key:"handleError",value:function(t){var e=t.file,n=t.data,r=t.mode,i=t.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":e instanceof File?this.dropzone.addFile.call(this.dropzone,e):(this.dropzone.files.push(e),this.dropzone.options.addedfile.call(this.dropzone,e),this.dropzone.options.thumbnail.call(this.dropzone,e,e.extras.url));break;case"removeFile":e.rejected=!0,this.dropzone.removeFile.call(this.dropzone,e)}var o=(0,u["default"])('[data-remodal-id="generic"]');o.find(".error-content").html(i),u["default"].remodal.lookup[o.data("remodal")].open()}}},{key:"attachDragDrop",value:function(){var t=this;this.container.delegate("[data-dz-insert]","click",function(t){var e=(0,u["default"])(t.currentTarget).parent(".dz-preview").find(".dz-filename"),n=p.Instance.editors.filter(function(t,e){return"data[content]"===(0,u["default"])(e).attr("name")});if(n.length){n=n.data("codemirror"),n.focus();var r=encodeURI(e.text()),i=o(r);n.doc.replaceSelection(i)}}),this.container.delegate(".dz-preview","dragstart",function(e){var n=(0,u["default"])(e.currentTarget),r=encodeURI(n.find(".dz-filename").text()),i=o(r);t.dropzone.disable(),n.addClass("hide-backface"),e.originalEvent.dataTransfer.effectAllowed="copy",e.originalEvent.dataTransfer.setData("text",i)}),this.container.delegate(".dz-preview","dragend",function(e){var n=(0,u["default"])(e.currentTarget);t.dropzone.enable(),n.removeClass("hide-backface")})}}]),e}();e["default"]=v;e.Instance=new v}).call(e,function(){return this}())},,,function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=e.Toolbar=void 0;var o=function(){function t(t,e){for(var n=0;n
"+t.stack+""),console.error(t.message+" at "+t.stack)}Object.defineProperty(e,"__esModule",{value:!0}),e.parseStatus=i,e.parseJSON=o,e.userFeedback=a,e.userFeedbackError=s;var u=n(303),c=r(u),l=n(306),f=function d(t){var d=new Error(t.statusText||t||"");return d.response=t,d}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(304),o=r(i);o["default"].options.positionClass="toast-top-right",o["default"].options.preventDuplicates=!0,e["default"]=o["default"]},,,function(t,e){t.exports=GravAdmin},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function a(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,s,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),c=n.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,s);return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,a,s;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],a=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(s=a;s-- >0;)if(n[s]===e||n[s].listener&&n[s].listener===e){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(r(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){(function(t){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n"+n+"
")}return(0,s["default"])("#grav-update-button").on("click",function(){(0,s["default"])(this).html(l.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,d["default"])(t.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload.resources.total)return this.maintenance("hide");var t=["plugins","themes"],e=["plugin","theme"],n=this.payload.resources,r=n.plugins,i=n.themes;return this.payload.resources.total?void[r,i].forEach(function(n,r){if(n&&!Array.isArray(n)){var i=Object.keys(n).length,o=t[r];(0,s["default"])('#admin-menu a[href$="/'+t[r]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(i);var a="";a="plugins"===o?l.translations.PLUGIN_ADMIN.PLUGINS:l.translations.PLUGIN_ADMIN.THEMES;var u=(0,s["default"])(".grav-update."+o);u.css("display","block").html('\n\n '+l.translations.PLUGIN_ADMIN.UPDATE+" "+l.translations.PLUGIN_ADMIN.ALL+" "+a+'\n \n '+i+" "+l.translations.PLUGIN_ADMIN.OF_YOUR+" "+o+" "+l.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+"\n
\n ");var f=(0,s["default"])("[data-update-packages]").attr("data-packages-slugs")||"";f=f?f.split(","):[];var d=(0,c["default"])(f.concat(Object.keys(n))).join();(0,s["default"])("[data-update-packages]").attr("data-packages-slugs",""+d),Object.keys(n).forEach(function(t){var i=(0,s["default"])("[data-gpm-"+e[r]+'="'+t+'"]'),a=i.find(".gpm-name"),u=a.find("a");if("plugins"!==o||a.find(".badge.update").length?"themes"===o&&a.append('"):a.append(''+l.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!"),i.length){var c=(0,s["default"])(".grav-update."+e[r]);if(c.length){var f="testing"===n[t].type?'test release':"";c.html('\n\n '+l.translations.PLUGIN_ADMIN.UPDATE+" "+(e[r].charAt(0).toUpperCase()+e[r].substr(1).toLowerCase())+'\n \n v'+n[t].available+" "+f+" "+l.translations.PLUGIN_ADMIN.OF_THIS+" "+e[r]+" "+l.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+"!\n
\n ").css("display","block")}}}),(0,s["default"])("[data-update-packages]").removeClass("hidden")}}):this}}]),t}();e["default"]=p;var m=new p;e.Instance=m,h.Instance.on("fetched",function(t,e){m.setPayload(t.payload||{}),m.grav().resources()}),"1"===l.config.enable_auto_updates_check&&h.Instance.fetch()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(311),o=r(i),a=n(313);n(315),e["default"]={Chart:{Chart:o["default"],UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:a.Instance}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instances=e.UpdatesChart=e.defaults=void 0;var s=function k(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:k(i,e,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},u=function(){function t(t,e){for(var n=0;n"+h.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+e.name+"
\n"+n.message+""})}},{key:"onDropzoneComplete",value:function(e){if(!e.accepted){var n={status:"error",message:h.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+e.name.match(/\..+/).join("")};return this.handleError({file:e,data:n,mode:"removeFile",msg:"
"+h.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+e.name+"
\n"+n.message+""})}(0,u["default"])(".dz-preview").prop("draggable","true"),this.options.reloadPage&&t.location.reload()}},{key:"onDropzoneRemovedFile",value:function(t){if(t.accepted&&!t.rejected){var e=this.form.data("media-url")+"/task"+h.config.param_sep+"delmedia";(0,d["default"])(e,{method:"post",body:{filename:t.name}})}}},{key:"onDropzoneError",value:function(t,e,n){var r=n?e.error.message:e;return(0,u["default"])(t.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:t,data:{status:"error"},msg:"
"+r+""})}},{key:"handleError",value:function(t){var e=t.file,n=t.data,r=t.mode,i=t.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":e instanceof File?this.dropzone.addFile.call(this.dropzone,e):(this.dropzone.files.push(e),this.dropzone.options.addedfile.call(this.dropzone,e),this.dropzone.options.thumbnail.call(this.dropzone,e,e.extras.url));break;case"removeFile":e.rejected=!0,this.dropzone.removeFile.call(this.dropzone,e)}var o=(0,u["default"])('[data-remodal-id="generic"]');o.find(".error-content").html(i),u["default"].remodal.lookup[o.data("remodal")].open()}}},{key:"attachDragDrop",value:function(){var t=this;this.container.delegate("[data-dz-insert]","click",function(t){var e=(0,u["default"])(t.currentTarget).parent(".dz-preview").find(".dz-filename"),n=p.Instance.editors.filter(function(t,e){return"data[content]"===(0,u["default"])(e).attr("name")});if(n.length){n=n.data("codemirror"),n.focus();var r=encodeURI(e.text()),i=o(r);n.doc.replaceSelection(i)}}),this.container.delegate(".dz-preview","dragstart",function(e){var n=(0,u["default"])(e.currentTarget),r=encodeURI(n.find(".dz-filename").text()),i=o(r);t.dropzone.disable(),n.addClass("hide-backface"),e.originalEvent.dataTransfer.effectAllowed="copy",e.originalEvent.dataTransfer.setData("text",i)}),this.container.delegate(".dz-preview","dragend",function(e){var n=(0,u["default"])(e.currentTarget);t.dropzone.enable(),n.removeClass("hide-backface")})}}]),e}();e["default"]=v;e.Instance=new v}).call(e,function(){return this}())},,,function(t,e,n){(function(t){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Instance=e.Toolbar=void 0;var o=function(){function t(t,e){for(var n=0;n
"+this.options.dictFallbackText+"
"),i+='