PluginProbe
Elementor Website Builder – more than just a page builder / 3.22.2
Elementor Website Builder – more than just a page builder v3.22.2
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | assets/js/new-template.js +401 -290 4.3.1 → 3.22.2 View file →
@@ -1,303 +1,414 @@
1 -(function(_wordpress_i18n) {
1 +/*! elementor - v3.22.0 - 24-06-2024 */
2 +/******/ (() => { // webpackBootstrap
3 +/******/ var __webpack_modules__ = ({
2 4
3 -//#region \0rolldown/runtime.js
4 - var __defProp = Object.defineProperty;
5 - var __name = (target, value) => __defProp(target, "name", {
6 - value,
7 - configurable: true
8 - });
9 - var __esmMin = (fn, res, err) => () => {
10 - if (err) throw err[0];
11 - try {
12 - return fn && (res = fn(fn = 0)), res;
13 - } catch (e) {
14 - throw err = [e], e;
15 - }
16 - };
17 - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
5 +/***/ "../assets/dev/js/admin/new-template/behaviors/lock-pro.js":
6 +/*!*****************************************************************!*\
7 + !*** ../assets/dev/js/admin/new-template/behaviors/lock-pro.js ***!
8 + \*****************************************************************/
9 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
18 10
19 -//#endregion
11 +"use strict";
20 12
21 -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
22 - function _classCallCheck(a, n) {
23 - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
24 - }
25 - var init_classCallCheck = __esmMin((() => {}));
26 13
27 -//#endregion
28 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
29 - function _typeof(o) {
30 - "@babel/helpers - typeof";
31 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
32 - return typeof o;
33 - } : function(o) {
34 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
35 - }, _typeof(o);
36 - }
37 - var init_typeof = __esmMin((() => {}));
14 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
15 +Object.defineProperty(exports, "__esModule", ({
16 + value: true
17 +}));
18 +exports["default"] = void 0;
19 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
20 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
21 +var LockPro = /*#__PURE__*/function () {
22 + function LockPro(elements) {
23 + (0, _classCallCheck2.default)(this, LockPro);
24 + this.elements = elements;
25 + }
26 + (0, _createClass2.default)(LockPro, [{
27 + key: "bindEvents",
28 + value: function bindEvents() {
29 + var _this$elements = this.elements,
30 + form = _this$elements.form,
31 + templateType = _this$elements.templateType;
32 + form.addEventListener('submit', this.onFormSubmit.bind(this));
33 + templateType.addEventListener('change', this.onTemplateTypeChange.bind(this));
38 34
39 -//#endregion
40 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
41 - function toPrimitive(t, r) {
42 - if ("object" != _typeof(t) || !t) return t;
43 - var e = t[Symbol.toPrimitive];
44 - if (void 0 !== e) {
45 - var i = e.call(t, r || "default");
46 - if ("object" != _typeof(i)) return i;
47 - throw new TypeError("@@toPrimitive must return a primitive value.");
48 - }
49 - return ("string" === r ? String : Number)(t);
50 - }
51 - var init_toPrimitive = __esmMin((() => {
52 - init_typeof();
53 - }));
35 + // Force checking on render, to make sure that default values are also checked.
36 + this.onTemplateTypeChange();
37 + }
38 + }, {
39 + key: "onFormSubmit",
40 + value: function onFormSubmit(e) {
41 + var lockOptions = this.getCurrentLockOptions();
42 + if (lockOptions.is_locked) {
43 + e.preventDefault();
44 + }
45 + }
46 + }, {
47 + key: "onTemplateTypeChange",
48 + value: function onTemplateTypeChange() {
49 + var lockOptions = this.getCurrentLockOptions();
50 + if (lockOptions.is_locked) {
51 + this.lock(lockOptions);
52 + } else {
53 + this.unlock();
54 + }
55 + }
56 + }, {
57 + key: "getCurrentLockOptions",
58 + value: function getCurrentLockOptions() {
59 + var templateType = this.elements.templateType,
60 + currentOption = templateType.options[templateType.selectedIndex];
61 + return JSON.parse(currentOption.dataset.lock || '{}');
62 + }
63 + }, {
64 + key: "lock",
65 + value: function lock(lockOptions) {
66 + this.showLockBadge(lockOptions.badge);
67 + this.showLockButton(lockOptions.button);
68 + this.hideSubmitButton();
69 + }
70 + }, {
71 + key: "unlock",
72 + value: function unlock() {
73 + this.hideLockBadge();
74 + this.hideLockButton();
75 + this.showSubmitButton();
76 + }
77 + }, {
78 + key: "showLockBadge",
79 + value: function showLockBadge(badgeConfig) {
80 + var _this$elements2 = this.elements,
81 + lockBadge = _this$elements2.lockBadge,
82 + lockBadgeText = _this$elements2.lockBadgeText,
83 + lockBadgeIcon = _this$elements2.lockBadgeIcon;
84 + lockBadgeText.innerText = badgeConfig.text;
85 + lockBadgeIcon.className = badgeConfig.icon;
86 + lockBadge.classList.remove('e-hidden');
87 + }
88 + }, {
89 + key: "hideLockBadge",
90 + value: function hideLockBadge() {
91 + this.elements.lockBadge.classList.add('e-hidden');
92 + }
93 + }, {
94 + key: "showLockButton",
95 + value: function showLockButton(buttonConfig) {
96 + var lockButton = this.elements.lockButton;
97 + lockButton.href = this.replaceLockLinkPlaceholders(buttonConfig.url);
98 + lockButton.innerText = buttonConfig.text;
99 + lockButton.classList.remove('e-hidden');
100 + }
101 + }, {
102 + key: "hideLockButton",
103 + value: function hideLockButton() {
104 + this.elements.lockButton.classList.add('e-hidden');
105 + }
106 + }, {
107 + key: "showSubmitButton",
108 + value: function showSubmitButton() {
109 + this.elements.submitButton.classList.remove('e-hidden');
110 + }
111 + }, {
112 + key: "hideSubmitButton",
113 + value: function hideSubmitButton() {
114 + this.elements.submitButton.classList.add('e-hidden');
115 + }
116 + }, {
117 + key: "replaceLockLinkPlaceholders",
118 + value: function replaceLockLinkPlaceholders(link) {
119 + return link.replace(/%%utm_source%%/g, 'wp-add-new').replace(/%%utm_medium%%/g, 'wp-dash');
120 + }
121 + }]);
122 + return LockPro;
123 +}();
124 +exports["default"] = LockPro;
54 125
55 -//#endregion
56 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
57 - function toPropertyKey(t) {
58 - var i = toPrimitive(t, "string");
59 - return "symbol" == _typeof(i) ? i : i + "";
60 - }
61 - var init_toPropertyKey = __esmMin((() => {
62 - init_typeof();
63 - init_toPrimitive();
64 - }));
126 +/***/ }),
65 127
66 -//#endregion
67 -//#region node_modules/@babel/runtime/helpers/esm/createClass.js
68 - function _defineProperties(e, r) {
69 - for (var t = 0; t < r.length; t++) {
70 - var o = r[t];
71 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
72 - }
73 - }
74 - function _createClass(e, r, t) {
75 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
76 - }
77 - var init_createClass = __esmMin((() => {
78 - init_toPropertyKey();
79 - }));
128 +/***/ "../assets/dev/js/admin/new-template/layout.js":
129 +/*!*****************************************************!*\
130 + !*** ../assets/dev/js/admin/new-template/layout.js ***!
131 + \*****************************************************/
132 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
80 133
81 -//#endregion
82 -//#region assets/dev/js/admin/new-template/behaviors/lock-pro.js
83 - var LockPro;
84 - var init_lock_pro = __esmMin((() => {
85 - init_classCallCheck();
86 - init_createClass();
87 - LockPro = /*#__PURE__*/ function() {
88 - function LockPro(elements) {
89 - _classCallCheck(this, LockPro);
90 - this.elements = elements;
91 - }
92 - return _createClass(LockPro, [
93 - {
94 - key: "bindEvents",
95 - value: function bindEvents() {
96 - var _this$elements = this.elements;
97 - var form = _this$elements.form;
98 - var templateType = _this$elements.templateType;
99 - form.addEventListener("submit", this.onFormSubmit.bind(this));
100 - templateType.addEventListener("change", this.onTemplateTypeChange.bind(this));
101 - this.onTemplateTypeChange();
102 - }
103 - },
104 - {
105 - key: "onFormSubmit",
106 - value: function onFormSubmit(e) {
107 - if (this.getCurrentLockOptions().is_locked) e.preventDefault();
108 - }
109 - },
110 - {
111 - key: "onTemplateTypeChange",
112 - value: function onTemplateTypeChange() {
113 - var lockOptions = this.getCurrentLockOptions();
114 - if (lockOptions.is_locked) this.lock(lockOptions);
115 - else this.unlock();
116 - }
117 - },
118 - {
119 - key: "getCurrentLockOptions",
120 - value: function getCurrentLockOptions() {
121 - var templateType = this.elements.templateType;
122 - var currentOption = templateType.options[templateType.selectedIndex];
123 - return JSON.parse(currentOption.dataset.lock || "{}");
124 - }
125 - },
126 - {
127 - key: "lock",
128 - value: function lock(lockOptions) {
129 - this.showLockBadge(lockOptions.badge);
130 - this.showLockButton(lockOptions.button);
131 - this.hideSubmitButton();
132 - }
133 - },
134 - {
135 - key: "unlock",
136 - value: function unlock() {
137 - this.hideLockBadge();
138 - this.hideLockButton();
139 - this.showSubmitButton();
140 - }
141 - },
142 - {
143 - key: "showLockBadge",
144 - value: function showLockBadge(badgeConfig) {
145 - var _this$elements2 = this.elements;
146 - var lockBadge = _this$elements2.lockBadge;
147 - var lockBadgeText = _this$elements2.lockBadgeText;
148 - var lockBadgeIcon = _this$elements2.lockBadgeIcon;
149 - lockBadgeText.innerText = badgeConfig.text;
150 - lockBadgeIcon.className = badgeConfig.icon;
151 - lockBadge.classList.remove("e-hidden");
152 - }
153 - },
154 - {
155 - key: "hideLockBadge",
156 - value: function hideLockBadge() {
157 - this.elements.lockBadge.classList.add("e-hidden");
158 - }
159 - },
160 - {
161 - key: "showLockButton",
162 - value: function showLockButton(buttonConfig) {
163 - var lockButton = this.elements.lockButton;
164 - lockButton.href = this.replaceLockLinkPlaceholders(buttonConfig.url);
165 - lockButton.innerText = buttonConfig.text;
166 - lockButton.classList.remove("e-hidden");
167 - }
168 - },
169 - {
170 - key: "hideLockButton",
171 - value: function hideLockButton() {
172 - this.elements.lockButton.classList.add("e-hidden");
173 - }
174 - },
175 - {
176 - key: "showSubmitButton",
177 - value: function showSubmitButton() {
178 - this.elements.submitButton.classList.remove("e-hidden");
179 - }
180 - },
181 - {
182 - key: "hideSubmitButton",
183 - value: function hideSubmitButton() {
184 - this.elements.submitButton.classList.add("e-hidden");
185 - }
186 - },
187 - {
188 - key: "replaceLockLinkPlaceholders",
189 - value: function replaceLockLinkPlaceholders(link) {
190 - return link.replace(/%%utm_source%%/g, "wp-add-new").replace(/%%utm_medium%%/g, "wp-dash");
191 - }
192 - }
193 - ]);
194 - }();
195 - }));
134 +"use strict";
135 +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
196 136
197 -//#endregion
198 -//#region assets/dev/js/admin/new-template/view.js
199 - var require_view = /* @__PURE__ */ __commonJSMin(((exports, module) => {
200 - module.exports = Marionette.ItemView.extend({
201 - id: "elementor-new-template-dialog-content",
202 - template: "#tmpl-elementor-new-template",
203 - ui: {},
204 - events: {},
205 - onRender: function onRender() {}
206 - });
207 - }));
208 137
209 -//#endregion
210 -//#region assets/dev/js/admin/new-template/layout.js
211 - var require_layout = /* @__PURE__ */ __commonJSMin(((exports, module) => {
212 - init_lock_pro();
213 - var NewTemplateView = require_view();
214 - module.exports = elementorModules.common.views.modal.Layout.extend({
215 - getModalOptions: function getModalOptions() {
216 - return { id: "elementor-new-template-modal" };
217 - },
218 - getLogoOptions: function getLogoOptions() {
219 - return { title: (0, _wordpress_i18n.__)("New Template", "elementor") };
220 - },
221 - initialize: function initialize() {
222 - elementorModules.common.views.modal.Layout.prototype.initialize.apply(this, arguments);
223 - this.showLogo();
224 - this.showContentView();
225 - this.initElements();
226 - this.lockProBehavior = new LockPro(this.elements);
227 - this.lockProBehavior.bindEvents();
228 - this.setupDynamicControlsVisibility();
229 - },
230 - setupDynamicControlsVisibility: function setupDynamicControlsVisibility() {
231 - if (!("undefined" !== typeof elementor_new_template_form_controls)) return;
232 - var CONTROL_ID_PREFIX = "elementor-new-template__form__";
233 - var templateTypeSelectId = "".concat(CONTROL_ID_PREFIX, "template-type");
234 - var dynamicControlsVisibilityListener = function dynamicControlsVisibilityListener() {
235 - elementorAdmin.templateControls.setDynamicControlsVisibility(CONTROL_ID_PREFIX, elementor_new_template_form_controls);
236 - };
237 - this.getModal().onShow = function() {
238 - dynamicControlsVisibilityListener();
239 - document.getElementById(templateTypeSelectId).addEventListener("change", dynamicControlsVisibilityListener);
240 - };
241 - this.getModal().onHide = function() {
242 - document.getElementById(templateTypeSelectId).removeEventListener("change", dynamicControlsVisibilityListener);
243 - };
244 - },
245 - initElements: function initElements() {
246 - var container = this.$el[0];
247 - var root = "#elementor-new-template__form";
248 - this.elements = {
249 - form: container.querySelector(root),
250 - submitButton: container.querySelector("".concat(root, "__submit")),
251 - lockButton: container.querySelector("".concat(root, "__lock_button")),
252 - templateType: container.querySelector("".concat(root, "__template-type")),
253 - lockBadge: container.querySelector("".concat(root, "__template-type-badge")),
254 - lockBadgeText: container.querySelector("".concat(root, "__template-type-badge__text")),
255 - lockBadgeIcon: container.querySelector("".concat(root, "__template-type-badge__icon"))
256 - };
257 - },
258 - showContentView: function showContentView() {
259 - this.modalContent.show(new NewTemplateView());
260 - }
261 - });
262 - }));
138 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
139 +var _lockPro = _interopRequireDefault(__webpack_require__(/*! ./behaviors/lock-pro */ "../assets/dev/js/admin/new-template/behaviors/lock-pro.js"));
140 +var NewTemplateView = __webpack_require__(/*! elementor-admin/new-template/view */ "../assets/dev/js/admin/new-template/view.js");
141 +module.exports = elementorModules.common.views.modal.Layout.extend({
142 + getModalOptions: function getModalOptions() {
143 + return {
144 + id: 'elementor-new-template-modal'
145 + };
146 + },
147 + getLogoOptions: function getLogoOptions() {
148 + return {
149 + title: __('New Template', 'elementor')
150 + };
151 + },
152 + initialize: function initialize() {
153 + elementorModules.common.views.modal.Layout.prototype.initialize.apply(this, arguments);
154 + var lookupControlIdPrefix = 'elementor-new-template__form__';
155 + var templateTypeSelectId = "".concat(lookupControlIdPrefix, "template-type");
156 + this.showLogo();
157 + this.showContentView();
158 + this.initElements();
159 + this.lockProBehavior = new _lockPro.default(this.elements);
160 + this.lockProBehavior.bindEvents();
161 + var dynamicControlsVisibilityListener = function dynamicControlsVisibilityListener() {
162 + elementorAdmin.templateControls.setDynamicControlsVisibility(lookupControlIdPrefix, elementor_new_template_form_controls);
163 + };
164 + this.getModal().onShow = function () {
165 + dynamicControlsVisibilityListener();
166 + document.getElementById(templateTypeSelectId).addEventListener('change', dynamicControlsVisibilityListener);
167 + };
168 + this.getModal().onHide = function () {
169 + document.getElementById(templateTypeSelectId).removeEventListener('change', dynamicControlsVisibilityListener);
170 + };
171 + },
172 + initElements: function initElements() {
173 + var container = this.$el[0],
174 + root = '#elementor-new-template__form';
175 + this.elements = {
176 + form: container.querySelector(root),
177 + submitButton: container.querySelector("".concat(root, "__submit")),
178 + lockButton: container.querySelector("".concat(root, "__lock_button")),
179 + templateType: container.querySelector("".concat(root, "__template-type")),
180 + lockBadge: container.querySelector("".concat(root, "__template-type-badge")),
181 + lockBadgeText: container.querySelector("".concat(root, "__template-type-badge__text")),
182 + lockBadgeIcon: container.querySelector("".concat(root, "__template-type-badge__icon"))
183 + };
184 + },
185 + showContentView: function showContentView() {
186 + this.modalContent.show(new NewTemplateView());
187 + }
188 +});
263 189
264 -//#endregion
265 -//#region assets/dev/js/admin/new-template/new-template.js
266 - var NewTemplateLayout = require_layout();
267 - var NewTemplateModule = elementorModules.ViewModule.extend({
268 - getDefaultSettings: function getDefaultSettings() {
269 - return { selectors: { addButton: "a.page-title-action[href*=\"post-new.php?post_type=elementor_library\"], #elementor-template-library-add-new" } };
270 - },
271 - getDefaultElements: function getDefaultElements() {
272 - var selectors = this.getSettings("selectors");
273 - return { $addButton: jQuery(selectors.addButton) };
274 - },
275 - bindEvents: function bindEvents() {
276 - this.elements.$addButton.on("click", this.onAddButtonClick);
277 - elementorCommon.elements.$window.on("hashchange", this.showModalByHash.bind(this));
278 - },
279 - showModalByHash: function showModalByHash() {
280 - if ("#add_new" === location.hash) {
281 - var _this$layout;
282 - (_this$layout = this.layout) === null || _this$layout === void 0 || _this$layout.showModal();
283 - location.hash = "";
284 - }
285 - },
286 - onInit: function onInit() {
287 - elementorModules.ViewModule.prototype.onInit.apply(this, arguments);
288 - this.layout = new NewTemplateLayout();
289 - this.showModalByHash();
290 - },
291 - onAddButtonClick: function onAddButtonClick(event) {
292 - var _this$layout2;
293 - event.preventDefault();
294 - (_this$layout2 = this.layout) === null || _this$layout2 === void 0 || _this$layout2.showModal();
295 - }
296 - });
297 - jQuery(function() {
298 - window.elementorNewTemplate = new NewTemplateModule();
299 - });
190 +/***/ }),
300 191
301 -//#endregion
302 -})(wp.i18n);
192 +/***/ "../assets/dev/js/admin/new-template/view.js":
193 +/*!***************************************************!*\
194 + !*** ../assets/dev/js/admin/new-template/view.js ***!
195 + \***************************************************/
196 +/***/ ((module) => {
197 +
198 +"use strict";
199 +
200 +
201 +module.exports = Marionette.ItemView.extend({
202 + id: 'elementor-new-template-dialog-content',
203 + template: '#tmpl-elementor-new-template',
204 + ui: {},
205 + events: {},
206 + onRender: function onRender() {}
207 +});
208 +
209 +/***/ }),
210 +
211 +/***/ "@wordpress/i18n":
212 +/*!**************************!*\
213 + !*** external "wp.i18n" ***!
214 + \**************************/
215 +/***/ ((module) => {
216 +
217 +"use strict";
218 +module.exports = wp.i18n;
219 +
220 +/***/ }),
221 +
222 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
223 +/*!****************************************************************!*\
224 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
225 + \****************************************************************/
226 +/***/ ((module) => {
227 +
228 +function _classCallCheck(instance, Constructor) {
229 + if (!(instance instanceof Constructor)) {
230 + throw new TypeError("Cannot call a class as a function");
231 + }
232 +}
233 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
234 +
235 +/***/ }),
236 +
237 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
238 +/*!*************************************************************!*\
239 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
240 + \*************************************************************/
241 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
242 +
243 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
244 +function _defineProperties(target, props) {
245 + for (var i = 0; i < props.length; i++) {
246 + var descriptor = props[i];
247 + descriptor.enumerable = descriptor.enumerable || false;
248 + descriptor.configurable = true;
249 + if ("value" in descriptor) descriptor.writable = true;
250 + Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
251 + }
252 +}
253 +function _createClass(Constructor, protoProps, staticProps) {
254 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
255 + if (staticProps) _defineProperties(Constructor, staticProps);
256 + Object.defineProperty(Constructor, "prototype", {
257 + writable: false
258 + });
259 + return Constructor;
260 +}
261 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
262 +
263 +/***/ }),
264 +
265 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
266 +/*!***********************************************************************!*\
267 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
268 + \***********************************************************************/
269 +/***/ ((module) => {
270 +
271 +function _interopRequireDefault(obj) {
272 + return obj && obj.__esModule ? obj : {
273 + "default": obj
274 + };
275 +}
276 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
277 +
278 +/***/ }),
279 +
280 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
281 +/*!*************************************************************!*\
282 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
283 + \*************************************************************/
284 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
285 +
286 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
287 +function toPrimitive(t, r) {
288 + if ("object" != _typeof(t) || !t) return t;
289 + var e = t[Symbol.toPrimitive];
290 + if (void 0 !== e) {
291 + var i = e.call(t, r || "default");
292 + if ("object" != _typeof(i)) return i;
293 + throw new TypeError("@@toPrimitive must return a primitive value.");
294 + }
295 + return ("string" === r ? String : Number)(t);
296 +}
297 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
298 +
299 +/***/ }),
300 +
301 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
302 +/*!***************************************************************!*\
303 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
304 + \***************************************************************/
305 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
306 +
307 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
308 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
309 +function toPropertyKey(t) {
310 + var i = toPrimitive(t, "string");
311 + return "symbol" == _typeof(i) ? i : String(i);
312 +}
313 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
314 +
315 +/***/ }),
316 +
317 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
318 +/*!********************************************************!*\
319 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
320 + \********************************************************/
321 +/***/ ((module) => {
322 +
323 +function _typeof(o) {
324 + "@babel/helpers - typeof";
325 +
326 + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
327 + return typeof o;
328 + } : function (o) {
329 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
330 + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
331 +}
332 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
333 +
334 +/***/ })
335 +
336 +/******/ });
337 +/************************************************************************/
338 +/******/ // The module cache
339 +/******/ var __webpack_module_cache__ = {};
340 +/******/
341 +/******/ // The require function
342 +/******/ function __webpack_require__(moduleId) {
343 +/******/ // Check if module is in cache
344 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
345 +/******/ if (cachedModule !== undefined) {
346 +/******/ return cachedModule.exports;
347 +/******/ }
348 +/******/ // Create a new module (and put it into the cache)
349 +/******/ var module = __webpack_module_cache__[moduleId] = {
350 +/******/ // no module.id needed
351 +/******/ // no module.loaded needed
352 +/******/ exports: {}
353 +/******/ };
354 +/******/
355 +/******/ // Execute the module function
356 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
357 +/******/
358 +/******/ // Return the exports of the module
359 +/******/ return module.exports;
360 +/******/ }
361 +/******/
362 +/************************************************************************/
363 +var __webpack_exports__ = {};
364 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
365 +(() => {
366 +"use strict";
367 +/*!***********************************************************!*\
368 + !*** ../assets/dev/js/admin/new-template/new-template.js ***!
369 + \***********************************************************/
370 +
371 +
372 +var NewTemplateLayout = __webpack_require__(/*! elementor-admin/new-template/layout */ "../assets/dev/js/admin/new-template/layout.js");
373 +var NewTemplateModule = elementorModules.ViewModule.extend({
374 + getDefaultSettings: function getDefaultSettings() {
375 + return {
376 + selectors: {
377 + addButton: '.page-title-action:first, #elementor-template-library-add-new'
378 + }
379 + };
380 + },
381 + getDefaultElements: function getDefaultElements() {
382 + var selectors = this.getSettings('selectors');
383 + return {
384 + $addButton: jQuery(selectors.addButton)
385 + };
386 + },
387 + bindEvents: function bindEvents() {
388 + this.elements.$addButton.on('click', this.onAddButtonClick);
389 + elementorCommon.elements.$window.on('hashchange', this.showModalByHash.bind(this));
390 + },
391 + showModalByHash: function showModalByHash() {
392 + if ('#add_new' === location.hash) {
393 + this.layout.showModal();
394 + location.hash = '';
395 + }
396 + },
397 + onInit: function onInit() {
398 + elementorModules.ViewModule.prototype.onInit.apply(this, arguments);
399 + this.layout = new NewTemplateLayout();
400 + this.showModalByHash();
401 + },
402 + onAddButtonClick: function onAddButtonClick(event) {
403 + event.preventDefault();
404 + this.layout.showModal();
405 + }
406 +});
407 +jQuery(function () {
408 + window.elementorNewTemplate = new NewTemplateModule();
409 +});
410 +})();
411 +
412 +/******/ })()
413 +;
303 414 //# sourceMappingURL=new-template.js.map