diff --git a/CHANGELOG.md b/CHANGELOG.md index 7492f57ae..2137fd34b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * Fix for showing empty drop-down with only one supported language [#522](https://github.com/getgrav/grav-plugin-admin/issues/522) * Fix for visibility toggle on new page not working [#551](https://github.com/getgrav/grav-plugin-admin/issues/551) * Page tooltips usability issue [#496](https://github.com/getgrav/grav-plugin-admin/issues/496) + * Fix removed title attribute from editor toolbar buttons [#539](https://github.com/getgrav/grav-plugin-admin/issues/539) # v1.1.0-beta.2 ## 04/27/2016 diff --git a/themes/grav/app/forms/fields/editor.js b/themes/grav/app/forms/fields/editor.js index 5a6c9724c..f0b0b24f1 100644 --- a/themes/grav/app/forms/fields/editor.js +++ b/themes/grav/app/forms/fields/editor.js @@ -191,7 +191,7 @@ export class Toolbar { let obj = button[key]; if (!obj.modes) { obj.modes = []; } if (!~this.codemirror.options.ignore.indexOf(key) && (!obj.modes.length || obj.modes.indexOf(this.codemirror.options.mode) > -1)) { - let hint = obj.title ? `data-hint="${obj.title}" title="${obj.title}"` : ''; + let hint = obj.title ? `data-hint="${obj.title}"` : ''; let element = $(`
"+e.stack+"
"),console.error(e.message+" at "+e.stack)}Object.defineProperty(t,"__esModule",{value:!0}),t.parseStatus=i,t.parseJSON=o,t.userFeedback=a,t.userFeedbackError=s;var u=n(302),c=r(u),l=n(305),f=function d(e){var d=new Error(e.statusText||e||"");return d.response=e,d}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(303),o=r(i);o["default"].options.positionClass="toast-top-right",o["default"].options.preventDuplicates=!0,t["default"]=o["default"]},,,function(e,t){e.exports=GravAdmin},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],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(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments));
-}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){(function(e){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n"+n+"
")}return(0,s["default"])("#grav-update-button").on("click",function(){(0,s["default"])(this).html(u.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,l["default"])(e.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload.resources.total)return this.maintenance("hide");var e=["plugins","themes"],t=["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=e[r];(0,s["default"])('#admin-menu a[href$="/'+e[r]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(i);var a=o.charAt(0).toUpperCase()+o.substr(1).toLowerCase(),c=(0,s["default"])(".grav-update."+o);c.css("display","block").html('\n\n '+u.translations.PLUGIN_ADMIN.UPDATE+" All "+a+'\n \n '+i+" "+u.translations.PLUGIN_ADMIN.OF_YOUR+" "+o+" "+u.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+"\n
\n ");var l=(0,s["default"])("[data-update-packages]").attr("data-packages-slugs")||"";l=l?l.split(","):[],(0,s["default"])("[data-update-packages]").attr("data-packages-slugs",""+l.concat(Object.keys(n)).join()),Object.keys(n).forEach(function(e){var i=(0,s["default"])("[data-gpm-"+t[r]+'="'+e+'"]'),a=i.find(".gpm-name"),c=a.find("a");if("plugins"!==o||a.find(".badge.update").length?"themes"===o&&a.append('"):a.append(''+u.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!"),i.length){var l=(0,s["default"])(".grav-update."+t[r]);if(l.length){var f="testing"===n[e].type?'test release':"";l.html('\n\n \n v'+n[e].available+" "+f+" "+u.translations.PLUGIN_ADMIN.OF_THIS+" "+t[r]+" "+u.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+'!\n '+u.translations.PLUGIN_ADMIN.UPDATE+" "+(t[r].charAt(0).toUpperCase()+t[r].substr(1).toLowerCase())+"\n
\n ").css("display","block")}}})}}):this}}]),e}();t["default"]=d;var h=new d;t.Instance=h,f.Instance.on("fetched",function(e,t){h.setPayload(e.payload||{}),h.grav().resources()}),"1"===u.config.enable_auto_updates_check&&f.Instance.fetch()},function(e,t){"use strict";function n(e,t){if(0===e)return"0 Byte";var n=1e3,i=Math.floor(Math.log(e)/Math.log(n)),o=t+1||3;return(e/Math.pow(n,i)).toPrecision(o)+" "+r[i]}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n;var r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),o=r(i),a=n(2),s=n(305),u=n(302),c=r(u);(0,o["default"])("[data-gpm-checkupdates]").on("click",function(){var e=(0,o["default"])(this);e.find("i").addClass("fa-spin"),a.Instance.fetch(function(t){e.find("i").removeClass("fa-spin");var n=t.payload;if(n)if(n.grav.isUpdatable||n.resources.total){var r=n.grav.isUpdatable?"Grav v"+n.grav.available:"",i=n.resources.total?n.resources.total+" "+s.translations.PLUGIN_ADMIN.UPDATES_ARE_AVAILABLE:"";i||(r+=" "+s.translations.PLUGIN_ADMIN.IS_AVAILABLE_FOR_UPDATE),c["default"].info(r+(r&&i?" "+s.translations.PLUGIN_ADMIN.AND+" ":"")+i)}else c["default"].success(s.translations.PLUGIN_ADMIN.EVERYTHING_UP_TO_DATE)},!0)})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),o=r(i),a=n(312),s=r(a);(0,o["default"])("body").on("click","[data-maintenance-update]",function(){var e=(0,o["default"])(this),t=e.data("maintenanceUpdate");e.attr("disabled","disabled").find("> .fa").removeClass("fa-cloud-download").addClass("fa-refresh fa-spin"),(0,s["default"])(t,function(t){"updategrav"===t.type&&((0,o["default"])("[data-gpm-grav]").remove(),(0,o["default"])("#footer .grav-version").html(t.version)),e.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-cloud-download")})})},function(e,t,n){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(301),i=n(305),o=void 0,a=function(t){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 e=new FormData;n.body=Object.assign({"admin-nonce":i.config.admin_nonce},n.body),Object.keys(n.body).map(function(t){return e.append(t,n.body[t])}),n.body=e}(),n=Object.assign({credentials:"same-origin",headers:{Accept:"application/json"}},n),e(t,n).then(function(e){return o=e,e}).then(r.parseStatus).then(r.parseJSON).then(r.userFeedback).then(function(e){return a(e,o)})["catch"](r.userFeedbackError)};t["default"]=a}).call(t,n(3))},function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),i=t(r),o=n(312),a=t(o),s=(0,i["default"])('input[type="radio"][name="channel-switch"]');s&&s.on("change",function(t){var n=(0,i["default"])(t.target),r=""+n.parent("[data-url]").data("url");(0,a["default"])(r,{method:"post",body:{task:"gpmRelease",release:n.val()}},function(t){t.reload&&e.location.reload()})})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(315),o=r(i),a=n(317);n(318),t["default"]={Chart:{Chart:o["default"],UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:a.Instance}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=t.UpdatesChart=t.defaults=void 0;var s=function k(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var i=Object.getPrototypeOf(e);return null===i?void 0:k(i,t,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},u=function(){function e(e,t){for(var n=0;n"+h.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+t.name+"
\n"+n.message+""})}},{key:"onDropzoneComplete",value:function(t){if(!t.accepted){var n={status:"error",message:h.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+t.name.match(/\..+/).join("")};return this.handleError({file:t,data:n,mode:"removeFile",msg:"
"+h.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+t.name+"
\n"+n.message+""})}(0,u["default"])(".dz-preview").prop("draggable","true"),this.options.reloadPage&&e.location.reload()}},{key:"onDropzoneRemovedFile",value:function(e){if(e.accepted&&!e.rejected){var t=this.form.data("media-url")+"/task"+h.config.param_sep+"delmedia";(0,d["default"])(t,{method:"post",body:{filename:e.name}})}}},{key:"onDropzoneError",value:function(e,t,n){var r=n?t.error.message:t;return(0,u["default"])(e.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:e,data:{status:"error"},msg:"
"+r+""})}},{key:"handleError",value:function(e){var t=e.file,n=e.data,r=e.mode,i=e.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":t instanceof File?this.dropzone.addFile.call(this.dropzone,t):(this.dropzone.files.push(t),this.dropzone.options.addedfile.call(this.dropzone,t),this.dropzone.options.thumbnail.call(this.dropzone,t,t.extras.url));break;case"removeFile":t.rejected=!0,this.dropzone.removeFile.call(this.dropzone,t)}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 e=this;this.container.delegate("[data-dz-insert]","click",function(e){var t=(0,u["default"])(e.currentTarget).parent(".dz-preview").find(".dz-filename"),n=p.Instance.editors.filter(function(e,t){return"data[content]"===(0,u["default"])(t).attr("name")});if(n.length){n=n.data("codemirror"),n.focus();var r=encodeURI(t.text()),i=o(r);n.doc.replaceSelection(i)}}),this.container.delegate(".dz-preview","dragstart",function(t){var n=(0,u["default"])(t.currentTarget),r=encodeURI(n.find(".dz-filename").text()),i=o(r);e.dropzone.disable(),n.addClass("hide-backface"),t.originalEvent.dataTransfer.effectAllowed="copy",t.originalEvent.dataTransfer.setData("text",i)}),this.container.delegate(".dz-preview","dragend",function(t){var n=(0,u["default"])(t.currentTarget);e.dropzone.enable(),n.removeClass("hide-backface")})}}]),t}();t["default"]=v;t.Instance=new v}).call(t,function(){return this}())},,,function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=t.Toolbar=void 0;var o=function(){function e(e,t){for(var n=0;n
"+e.stack+"
"),console.error(e.message+" at "+e.stack)}Object.defineProperty(t,"__esModule",{value:!0}),t.parseStatus=i,t.parseJSON=o,t.userFeedback=a,t.userFeedbackError=s;var u=n(296),c=r(u),l=n(299),f=function d(e){var d=new Error(e.statusText||e||"");return d.response=e,d}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(297),o=r(i);o["default"].options.positionClass="toast-top-right",o["default"].options.preventDuplicates=!0,t["default"]=o["default"]},,,function(e,t){e.exports=GravAdmin},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],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(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){
+var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){(function(e){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n"+n+"
")}return(0,s["default"])("#grav-update-button").on("click",function(){(0,s["default"])(this).html(u.translations.PLUGIN_ADMIN.UPDATING_PLEASE_WAIT+" "+(0,l["default"])(e.assets["grav-update"].size)+"..")}),this}},{key:"resources",value:function(){if(!this.payload.resources.total)return this.maintenance("hide");var e=["plugins","themes"],t=["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=e[r];(0,s["default"])('#admin-menu a[href$="/'+e[r]+'"]').find(".badges").addClass("with-updates").find(".badge.updates").text(i);var a=o.charAt(0).toUpperCase()+o.substr(1).toLowerCase(),c=(0,s["default"])(".grav-update."+o);c.css("display","block").html('\n\n '+u.translations.PLUGIN_ADMIN.UPDATE+" All "+a+'\n \n '+i+" "+u.translations.PLUGIN_ADMIN.OF_YOUR+" "+o+" "+u.translations.PLUGIN_ADMIN.HAVE_AN_UPDATE_AVAILABLE+"\n
\n ");var l=(0,s["default"])("[data-update-packages]").attr("data-packages-slugs")||"";l=l?l.split(","):[],(0,s["default"])("[data-update-packages]").attr("data-packages-slugs",""+l.concat(Object.keys(n)).join()),Object.keys(n).forEach(function(e){var i=(0,s["default"])("[data-gpm-"+t[r]+'="'+e+'"]'),a=i.find(".gpm-name"),c=a.find("a");if("plugins"!==o||a.find(".badge.update").length?"themes"===o&&a.append('"):a.append(''+u.translations.PLUGIN_ADMIN.UPDATE_AVAILABLE+"!"),i.length){var l=(0,s["default"])(".grav-update."+t[r]);if(l.length){var f="testing"===n[e].type?'test release':"";l.html('\n\n \n v'+n[e].available+" "+f+" "+u.translations.PLUGIN_ADMIN.OF_THIS+" "+t[r]+" "+u.translations.PLUGIN_ADMIN.IS_NOW_AVAILABLE+'!\n '+u.translations.PLUGIN_ADMIN.UPDATE+" "+(t[r].charAt(0).toUpperCase()+t[r].substr(1).toLowerCase())+"\n
\n ").css("display","block")}}})}}):this}}]),e}();t["default"]=d;var h=new d;t.Instance=h,f.Instance.on("fetched",function(e,t){h.setPayload(e.payload||{}),h.grav().resources()}),"1"===u.config.enable_auto_updates_check&&f.Instance.fetch()},function(e,t){"use strict";function n(e,t){if(0===e)return"0 Byte";var n=1e3,i=Math.floor(Math.log(e)/Math.log(n)),o=t+1||3;return(e/Math.pow(n,i)).toPrecision(o)+" "+r[i]}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n;var r=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),o=r(i),a=n(2),s=n(299),u=n(296),c=r(u);(0,o["default"])("[data-gpm-checkupdates]").on("click",function(){var e=(0,o["default"])(this);e.find("i").addClass("fa-spin"),a.Instance.fetch(function(t){e.find("i").removeClass("fa-spin");var n=t.payload;if(n)if(n.grav.isUpdatable||n.resources.total){var r=n.grav.isUpdatable?"Grav v"+n.grav.available:"",i=n.resources.total?n.resources.total+" "+s.translations.PLUGIN_ADMIN.UPDATES_ARE_AVAILABLE:"";i||(r+=" "+s.translations.PLUGIN_ADMIN.IS_AVAILABLE_FOR_UPDATE),c["default"].info(r+(r&&i?" "+s.translations.PLUGIN_ADMIN.AND+" ":"")+i)}else c["default"].success(s.translations.PLUGIN_ADMIN.EVERYTHING_UP_TO_DATE)},!0)})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=n(1),o=r(i),a=n(306),s=r(a);(0,o["default"])("body").on("click","[data-maintenance-update]",function(){var e=(0,o["default"])(this),t=e.data("maintenanceUpdate");e.attr("disabled","disabled").find("> .fa").removeClass("fa-cloud-download").addClass("fa-refresh fa-spin"),(0,s["default"])(t,function(t){"updategrav"===t.type&&((0,o["default"])("[data-gpm-grav]").remove(),(0,o["default"])("#footer .grav-version").html(t.version)),e.removeAttr("disabled").find("> .fa").removeClass("fa-refresh fa-spin").addClass("fa-cloud-download")})})},function(e,t,n){(function(e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(295),i=n(299),o=void 0,a=function(t){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 e=new FormData;n.body=Object.assign({"admin-nonce":i.config.admin_nonce},n.body),Object.keys(n.body).map(function(t){return e.append(t,n.body[t])}),n.body=e}(),n=Object.assign({credentials:"same-origin",headers:{Accept:"application/json"}},n),e(t,n).then(function(e){return o=e,e}).then(r.parseStatus).then(r.parseJSON).then(r.userFeedback).then(function(e){return a(e,o)})["catch"](r.userFeedbackError)};t["default"]=a}).call(t,n(3))},function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),i=t(r),o=n(306),a=t(o),s=(0,i["default"])('input[type="radio"][name="channel-switch"]');s&&s.on("change",function(t){var n=(0,i["default"])(t.target),r=""+n.parent("[data-url]").data("url");(0,a["default"])(r,{method:"post",body:{task:"gpmRelease",release:n.val()}},function(t){t.reload&&e.location.reload()})})}).call(t,function(){return this}())},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(309),o=r(i),a=n(311);n(312),t["default"]={Chart:{Chart:o["default"],UpdatesChart:i.UpdatesChart,Instances:i.Instances},Cache:a.Instance}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=t.UpdatesChart=t.defaults=void 0;var s=function k(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r){var i=Object.getPrototypeOf(e);return null===i?void 0:k(i,t,n)}if("value"in r)return r.value;var o=r.get;if(void 0!==o)return o.call(n)},u=function(){function e(e,t){for(var n=0;n"+h.translations.PLUGIN_ADMIN.FILE_ERROR_UPLOAD+" "+t.name+"
\n"+n.message+""})}},{key:"onDropzoneComplete",value:function(t){if(!t.accepted){var n={status:"error",message:h.translations.PLUGIN_ADMIN.FILE_UNSUPPORTED+": "+t.name.match(/\..+/).join("")};return this.handleError({file:t,data:n,mode:"removeFile",msg:"
"+h.translations.PLUGIN_ADMIN.FILE_ERROR_ADD+" "+t.name+"
\n"+n.message+""})}(0,u["default"])(".dz-preview").prop("draggable","true"),this.options.reloadPage&&e.location.reload()}},{key:"onDropzoneRemovedFile",value:function(e){if(e.accepted&&!e.rejected){var t=this.form.data("media-url")+"/task"+h.config.param_sep+"delmedia";(0,d["default"])(t,{method:"post",body:{filename:e.name}})}}},{key:"onDropzoneError",value:function(e,t,n){var r=n?t.error.message:t;return(0,u["default"])(e.previewElement).find("[data-dz-errormessage]").html(r),this.handleError({file:e,data:{status:"error"},msg:"
"+r+""})}},{key:"handleError",value:function(e){var t=e.file,n=e.data,r=e.mode,i=e.msg;if("error"===n.status||"unauthorized"===n.status){switch(r){case"addBack":t instanceof File?this.dropzone.addFile.call(this.dropzone,t):(this.dropzone.files.push(t),this.dropzone.options.addedfile.call(this.dropzone,t),this.dropzone.options.thumbnail.call(this.dropzone,t,t.extras.url));break;case"removeFile":t.rejected=!0,this.dropzone.removeFile.call(this.dropzone,t)}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 e=this;this.container.delegate("[data-dz-insert]","click",function(e){var t=(0,u["default"])(e.currentTarget).parent(".dz-preview").find(".dz-filename"),n=p.Instance.editors.filter(function(e,t){return"data[content]"===(0,u["default"])(t).attr("name")});if(n.length){n=n.data("codemirror"),n.focus();var r=encodeURI(t.text()),i=o(r);n.doc.replaceSelection(i)}}),this.container.delegate(".dz-preview","dragstart",function(t){var n=(0,u["default"])(t.currentTarget),r=encodeURI(n.find(".dz-filename").text()),i=o(r);e.dropzone.disable(),n.addClass("hide-backface"),t.originalEvent.dataTransfer.effectAllowed="copy",t.originalEvent.dataTransfer.setData("text",i)}),this.container.delegate(".dz-preview","dragend",function(t){var n=(0,u["default"])(t.currentTarget);e.dropzone.enable(),n.removeClass("hide-backface")})}}]),t}();t["default"]=v;t.Instance=new v}).call(t,function(){return this}())},,,function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.Instance=t.Toolbar=void 0;var o=function(){function e(e,t){for(var n=0;n
"+this.options.dictFallbackText+"
"),i+='