From 035a1113ab897a1366165c2d5691a3a28adaba1a Mon Sep 17 00:00:00 2001 From: Iwona Just Date: Wed, 28 Feb 2024 09:49:54 +0000 Subject: [PATCH 1/3] trigger element thumb loader for widgets --- src/web/assets/dashboard/dist/Dashboard.js | 2 +- src/web/assets/dashboard/dist/Dashboard.js.map | 2 +- src/web/assets/dashboard/src/Dashboard.js | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/web/assets/dashboard/dist/Dashboard.js b/src/web/assets/dashboard/dist/Dashboard.js index f560dfa7291..ae8207327e9 100644 --- a/src/web/assets/dashboard/dist/Dashboard.js +++ b/src/web/assets/dashboard/dist/Dashboard.js @@ -1,3 +1,3 @@ /*! For license information please see Dashboard.js.LICENSE.txt */ -(function(){var __webpack_modules__={242:function(){},277:function(t,e,n){var i=n(242);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals),(0,n(673).Z)("32dd7842",i,!0,{})},673:function(t,e,n){"use strict";function i(t,e){for(var n=[],i={},r=0;rn.parts.length&&(i.parts.length=n.parts.length)}else{var s=[];for(r=0;r=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var d=i.call(s,"catchLoc"),l=i.call(s,"finallyLoc");if(d&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;x(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:B(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),m}},e}function asyncGeneratorStep(t,e,n,i,r,a,s){try{var o=t[a](s),d=o.value}catch(t){return void n(t)}o.done?e(d):Promise.resolve(d).then(i,r)}function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var a=t.apply(e,n);function s(t){asyncGeneratorStep(a,i,r,s,o,"next",t)}function o(t){asyncGeneratorStep(a,i,r,s,o,"throw",t)}s(void 0)}))}}(function($){Craft.Dashboard=Garnish.Base.extend({$grid:null,$widgetManagerBtn:null,$newWidgetBtn:null,widgetTypes:null,grid:null,widgets:null,widgetManager:null,widgetAdminTable:null,widgetSettingsModal:null,init:function(t){var e=this;this.widgetTypes=t,this.widgets={},this.$widgetManagerBtn=$("#widgetManagerBtn"),this.$newWidgetBtn=$("#newwidgetmenubtn"),this.addListener(this.$widgetManagerBtn,"click","showWidgetManager"),Garnish.$doc.ready((function(){e.$grid=$("#dashboard-grid"),e.grid=e.$grid.data("grid"),e.addListener("#new-widget-menu a","click",(function(t){t.preventDefault(),e.handleNewWidgetOptionSelect(t)})),e.addListener("#new-widget-menu a","keydown",(function(t){t.keyCode!==Garnish.SPACE_KEY&&t.keyCode!==Garnish.RETURN_KEY||(t.preventDefault(),e.handleNewWidgetOptionSelect(t))}))}))},getTypeInfo:function(t,e,n){return e?void 0===this.widgetTypes[t][e]?n:this.widgetTypes[t][e]:this.widgetTypes[t]},handleNewWidgetOptionSelect:function(t){this.$newWidgetBtn.data("trigger").hide();var e=$(t.target);this.createWidget(e.data("type"),e.data("name"))},createWidget:function createWidget(type,name,responseData){var settingsNamespace=void 0===responseData?"newwidget".concat(Math.floor(1e9*Math.random()),"-settings"):"widget".concat(responseData.id,"-settings"),settingsHtml=void 0===responseData?this.getTypeInfo(type,"settingsHtml","").replace(/__NAMESPACE__/g,settingsNamespace):null,settingsJs=void 0===responseData?this.getTypeInfo(type,"settingsJs","").replace(/__NAMESPACE__/g,settingsNamespace):null,$gridItem=$('
'),$container=$("
",{class:"widget new loading-new scaleout","data-type":type}).addClass(type.toLowerCase()).append($("
",{class:"front"}).append($("
",{class:"pane"}).append($("
",{class:"spinner body-loading"})).append($("
",{class:"widget-heading"}).append("

").append("

")).append($("
",{class:"body"})).append($("
",{class:"settings icon hidden"})))).append($("
",{class:"back"}).append($("
",{class:"pane"}).append($("",{type:"hidden",name:"type",value:type})).append($("",{type:"hidden",name:"settingsNamespace",value:settingsNamespace})).append($("

",{class:"first",text:Craft.t("app","{type} Settings",{type:name})})).append($("
",{class:"settings"})).append("
").append($("
",{class:"buttons clearafter"}).append(Craft.ui.createSubmitButton({label:Craft.t("app","Save"),spinner:!0})).append($("