| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | /******/ (() => { // webpackBootstrap |
| 2 | 2 | /******/ "use strict"; |
| 3 | 3 | /******/ var __webpack_modules__ = ({ |
| 4 | 4 | |
| @@ -11,13 +11,13 @@ | ||
| 11 | 11 | __webpack_require__.r(__webpack_exports__); |
| 12 | 12 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 13 | 13 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 14 | 14 | /* harmony export */ }); |
| 15 | -/** | |
| 16 | - * List API on backend | |
| 17 | - * | |
| 18 | - * @since 4.2.6 | |
| 19 | - * @version 1.0.2 | |
| 15 | +/** | |
| 16 | + * List API on backend | |
| 17 | + * | |
| 18 | + * @since 4.2.6 | |
| 19 | + * @version 1.0.2 | |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | 22 | const lplistAPI = {}; |
| 23 | 23 | let lp_rest_url; |
| @@ -56,19 +56,19 @@ | ||
| 56 | 56 | |
| 57 | 57 | /******/ }); |
| 58 | 58 | /************************************************************************/ |
| 59 | 59 | /******/ // The module cache |
| 60 | -/******/ var __webpack_module_cache__ = {}; | |
| 60 | +/******/ const __webpack_module_cache__ = {}; | |
| 61 | 61 | /******/ |
| 62 | 62 | /******/ // The require function |
| 63 | 63 | /******/ function __webpack_require__(moduleId) { |
| 64 | 64 | /******/ // Check if module is in cache |
| 65 | -/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 65 | +/******/ const cachedModule = __webpack_module_cache__[moduleId]; | |
| 66 | 66 | /******/ if (cachedModule !== undefined) { |
| 67 | 67 | /******/ return cachedModule.exports; |
| 68 | 68 | /******/ } |
| 69 | 69 | /******/ // Create a new module (and put it into the cache) |
| 70 | -/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 70 | +/******/ const module = __webpack_module_cache__[moduleId] = { | |
| 71 | 71 | /******/ // no module.id needed |
| 72 | 72 | /******/ // no module.loaded needed |
| 73 | 73 | /******/ exports: {} |
| 74 | 74 | /******/ }; |
| @@ -75,9 +75,9 @@ | ||
| 75 | 75 | /******/ |
| 76 | 76 | /******/ // Execute the module function |
| 77 | 77 | /******/ if (!(moduleId in __webpack_modules__)) { |
| 78 | 78 | /******/ delete __webpack_module_cache__[moduleId]; |
| 79 | -/******/ var e = new Error("Cannot find module '" + moduleId + "'"); | |
| 79 | +/******/ const e = new Error("Cannot find module '" + moduleId + "'"); | |
| 80 | 80 | /******/ e.code = 'MODULE_NOT_FOUND'; |
| 81 | 81 | /******/ throw e; |
| 82 | 82 | /******/ } |
| 83 | 83 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| @@ -88,14 +88,29 @@ | ||
| 88 | 88 | /******/ |
| 89 | 89 | /************************************************************************/ |
| 90 | 90 | /******/ /* webpack/runtime/define property getters */ |
| 91 | 91 | /******/ (() => { |
| 92 | -/******/ // define getter functions for harmony exports | |
| 92 | +/******/ // define getter/value functions for harmony exports | |
| 93 | 93 | /******/ __webpack_require__.d = (exports, definition) => { |
| 94 | -/******/ for(var key in definition) { | |
| 95 | -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 96 | -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 94 | +/******/ if(Array.isArray(definition)) { | |
| 95 | +/******/ var i = 0; | |
| 96 | +/******/ while(i < definition.length) { | |
| 97 | +/******/ var key = definition[i++]; | |
| 98 | +/******/ var binding = definition[i++]; | |
| 99 | +/******/ if(!__webpack_require__.o(exports, key)) { | |
| 100 | +/******/ if(binding === 0) { | |
| 101 | +/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] }); | |
| 102 | +/******/ } else { | |
| 103 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding }); | |
| 104 | +/******/ } | |
| 105 | +/******/ } else if(binding === 0) { i++; } | |
| 97 | 106 | /******/ } |
| 107 | +/******/ } else { | |
| 108 | +/******/ for(var key in definition) { | |
| 109 | +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 110 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 111 | +/******/ } | |
| 112 | +/******/ } | |
| 98 | 113 | /******/ } |
| 99 | 114 | /******/ }; |
| 100 | 115 | /******/ })(); |
| 101 | 116 | /******/ |
| @@ -100,9 +115,9 @@ | ||
| 100 | 115 | /******/ })(); |
| 101 | 116 | /******/ |
| 102 | 117 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 103 | 118 | /******/ (() => { |
| 104 | -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | |
| 119 | +/******/ __webpack_require__.o = (obj, prop) => (Object.hasOwn(obj, prop)) | |
| 105 | 120 | /******/ })(); |
| 106 | 121 | /******/ |
| 107 | 122 | /******/ /* webpack/runtime/make namespace object */ |
| 108 | 123 | /******/ (() => { |
| @@ -107,9 +122,9 @@ | ||
| 107 | 122 | /******/ /* webpack/runtime/make namespace object */ |
| 108 | 123 | /******/ (() => { |
| 109 | 124 | /******/ // define __esModule on exports |
| 110 | 125 | /******/ __webpack_require__.r = (exports) => { |
| 111 | -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 126 | +/******/ if(Symbol.toStringTag) { | |
| 112 | 127 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 113 | 128 | /******/ } |
| 114 | 129 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 115 | 130 | /******/ }; |
| @@ -115,9 +130,9 @@ | ||
| 115 | 130 | /******/ }; |
| 116 | 131 | /******/ })(); |
| 117 | 132 | /******/ |
| 118 | 133 | /************************************************************************/ |
| 119 | -var __webpack_exports__ = {}; | |
| 134 | +let __webpack_exports__ = {}; | |
| 120 | 135 | // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. |
| 121 | 136 | (() => { |
| 122 | 137 | /*!***************************************!*\ |
| 123 | 138 | !*** ./assets/src/js/admin/addons.js ***! |
| @@ -123,13 +138,13 @@ | ||
| 123 | 138 | !*** ./assets/src/js/admin/addons.js ***! |
| 124 | 139 | \***************************************/ |
| 125 | 140 | __webpack_require__.r(__webpack_exports__); |
| 126 | 141 | /* harmony import */ var _api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../api */ "./assets/src/js/api.js"); |
| 127 | -/** | |
| 128 | - * Script handle admin notices. | |
| 129 | - * | |
| 130 | - * @since 4.1.7.3.2 | |
| 131 | - * @version 1.0.1 | |
| 142 | +/** | |
| 143 | + * Script handle admin notices. | |
| 144 | + * | |
| 145 | + * @since 4.1.7.3.2 | |
| 146 | + * @version 1.0.1 | |
| 132 | 147 | */ |
| 133 | 148 | |
| 134 | 149 | let elAddonsPage; |
| 135 | 150 | let dataHtml; |
| @@ -289,49 +304,47 @@ | ||
| 289 | 304 | } |
| 290 | 305 | } |
| 291 | 306 | |
| 292 | 307 | // Events actions: activate, deactivate. |
| 293 | - /*if ( el.classList.contains( 'lp-toggle-switch-label' ) ) { | |
| 294 | - //e.preventDefault(); | |
| 295 | - | |
| 296 | - const elAddonItem = el.closest( '.lp-addon-item' ); | |
| 297 | - const idLabel = el.getAttribute( 'for' ); | |
| 298 | - const elInput = document.querySelector( `#${ idLabel }` ); | |
| 299 | - const action = elInput.getAttribute( 'data-action' ); | |
| 300 | - const addon = dataAddons[ elAddonItem.dataset.slug ]; | |
| 301 | - const addonSlug = addon.slug; | |
| 302 | - const parent = el.closest( '.lp-toggle-switch' ); | |
| 303 | - const label = parent.querySelector( `label[for=${ idLabel }]` ); | |
| 304 | - const dashicons = parent.querySelector( '.dashicons-update' ); | |
| 305 | - dashicons.style.display = 'inline-block'; | |
| 306 | - label.style.display = 'none'; | |
| 307 | - const data = { action, addon }; | |
| 308 | - addonsAction( data, function( status, message, data ) { | |
| 309 | - const elAddon = document.querySelector( `#${ addonSlug }` ); | |
| 310 | - if ( elAddon ) { | |
| 311 | - const parent = elAddon.closest( '.lp-toggle-switch' ); | |
| 312 | - if ( parent ) { | |
| 313 | - const dashicons = parent.querySelector( '.dashicons-update' ); | |
| 314 | - dashicons.style.display = 'none'; | |
| 315 | - if ( action === 'deactivate' ) { | |
| 316 | - elAddon.setAttribute( 'data-action', 'activate' ); | |
| 317 | - } else if ( action === 'activate' ) { | |
| 318 | - elAddon.setAttribute( 'data-action', 'deactivate' ); | |
| 319 | - } | |
| 320 | - const label = parent.querySelector( `label[for=${ addonSlug }]` ); | |
| 321 | - label.style.display = 'inline-flex'; | |
| 322 | - } | |
| 323 | - } | |
| 324 | - | |
| 325 | - if ( status === 'success' ) { | |
| 326 | - if ( action === 'deactivate' ) { | |
| 327 | - elAddonItem.classList.remove( 'activated' ); | |
| 328 | - } | |
| 329 | - if ( action === 'activate' ) { | |
| 330 | - elAddonItem.classList.add( 'activated' ); | |
| 331 | - } | |
| 332 | - } | |
| 333 | - } ); | |
| 308 | + /*if ( el.classList.contains( 'lp-toggle-switch-label' ) ) { | |
| 309 | + //e.preventDefault(); | |
| 310 | + const elAddonItem = el.closest( '.lp-addon-item' ); | |
| 311 | + const idLabel = el.getAttribute( 'for' ); | |
| 312 | + const elInput = document.querySelector( `#${ idLabel }` ); | |
| 313 | + const action = elInput.getAttribute( 'data-action' ); | |
| 314 | + const addon = dataAddons[ elAddonItem.dataset.slug ]; | |
| 315 | + const addonSlug = addon.slug; | |
| 316 | + const parent = el.closest( '.lp-toggle-switch' ); | |
| 317 | + const label = parent.querySelector( `label[for=${ idLabel }]` ); | |
| 318 | + const dashicons = parent.querySelector( '.dashicons-update' ); | |
| 319 | + dashicons.style.display = 'inline-block'; | |
| 320 | + label.style.display = 'none'; | |
| 321 | + const data = { action, addon }; | |
| 322 | + addonsAction( data, function( status, message, data ) { | |
| 323 | + const elAddon = document.querySelector( `#${ addonSlug }` ); | |
| 324 | + if ( elAddon ) { | |
| 325 | + const parent = elAddon.closest( '.lp-toggle-switch' ); | |
| 326 | + if ( parent ) { | |
| 327 | + const dashicons = parent.querySelector( '.dashicons-update' ); | |
| 328 | + dashicons.style.display = 'none'; | |
| 329 | + if ( action === 'deactivate' ) { | |
| 330 | + elAddon.setAttribute( 'data-action', 'activate' ); | |
| 331 | + } else if ( action === 'activate' ) { | |
| 332 | + elAddon.setAttribute( 'data-action', 'deactivate' ); | |
| 333 | + } | |
| 334 | + const label = parent.querySelector( `label[for=${ addonSlug }]` ); | |
| 335 | + label.style.display = 'inline-flex'; | |
| 336 | + } | |
| 337 | + } | |
| 338 | + if ( status === 'success' ) { | |
| 339 | + if ( action === 'deactivate' ) { | |
| 340 | + elAddonItem.classList.remove( 'activated' ); | |
| 341 | + } | |
| 342 | + if ( action === 'activate' ) { | |
| 343 | + elAddonItem.classList.add( 'activated' ); | |
| 344 | + } | |
| 345 | + } | |
| 346 | + } ); | |
| 334 | 347 | }*/ |
| 335 | 348 | |
| 336 | 349 | // Events actions: install, update, delete. |
| 337 | 350 | if (el.closest('.btn-addon-action')) { |
| @@ -383,9 +396,9 @@ | ||
| 383 | 396 | if (action === 'install') { |
| 384 | 397 | elAddonItem.classList.add('installed', 'activated'); |
| 385 | 398 | elAddonItem.classList.remove('not_installed'); |
| 386 | 399 | elItemPurchase.style.display = 'none'; |
| 387 | - /*elToggleSwitchInput.setAttribute( 'checked', 'checked' ); | |
| 400 | + /*elToggleSwitchInput.setAttribute( 'checked', 'checked' ); | |
| 388 | 401 | elToggleSwitchInput.setAttribute( 'data-action', 'deactivate' );*/ |
| 389 | 402 | const elNavInstalled = document.querySelector('.nav-tab[data-tab=installed] span'); |
| 390 | 403 | elNavInstalled.textContent = parseInt(elNavInstalled.textContent) + 1; |
| 391 | 404 | const elNavNoInstalled = document.querySelector('.nav-tab[data-tab=not_installed] span'); |