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