Add Creative Elements templates and update index files
- Introduced new templates for catalog, checkout, contact, and error pages. - Implemented caching headers and redirection in index.php files across various directories. - Enhanced product and layout templates for better integration with Creative Elements. - Added backoffice header styles and scripts for improved UI/UX in the admin panel.
This commit is contained in:
242
modules/creativeelements/views/js/admin.js
Normal file
242
modules/creativeelements/views/js/admin.js
Normal file
@@ -0,0 +1,242 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com
|
||||
*/
|
||||
|
||||
window.ceAdmin && document.addEventListener('DOMContentLoaded', function() {
|
||||
if (ceAdmin.ready) return;
|
||||
else ceAdmin.ready = true;
|
||||
|
||||
// Cancel button fix
|
||||
$('.btn[id$=_form_cancel_btn]')
|
||||
.removeAttr('onclick')
|
||||
.attr('href', location.href.replace(/&id\w*=\d+|&(add|update)\w+(=[^&]*)?/g, ''))
|
||||
;
|
||||
|
||||
// Fix for shortcode
|
||||
$('.ce-shortcode input').on('click.ce', function(e) {
|
||||
this.select();
|
||||
}).parent()
|
||||
.removeAttr('onclick')
|
||||
.removeClass('pointer')
|
||||
;
|
||||
|
||||
// Fix for after ajax save new ybc_blog post update links
|
||||
history.pushState = (function(parent) {
|
||||
return function(data, title, url) {
|
||||
var id = url.match(/&id_post=(\d+)/);
|
||||
|
||||
id && $('.btn-edit-with-ce').each(function() {
|
||||
this.href = this.href.replace('&id_page=0', '&id_page=' + id[1]);
|
||||
});
|
||||
return parent.apply(this, arguments);
|
||||
};
|
||||
})(history.pushState);
|
||||
|
||||
// HiBlog compatibility
|
||||
~location.href.indexOf('configure=hiblog') && $(document).on('ajaxSuccess', function onAjaxSuccess(e, xhr, args) {
|
||||
var idPost = $('#id_post').val();
|
||||
|
||||
idPost && (args.data.get && args.data.get('action') == 'savePost' || ~args.data.indexOf('action=displayPostForm')) && $.post(
|
||||
$('a[href*=AdminCEContent]').prop('href'),
|
||||
{
|
||||
action: 'hideEditor',
|
||||
ajax: true,
|
||||
id: idPost,
|
||||
idType: 16,
|
||||
},
|
||||
function onSuccessHideEditor(data) {
|
||||
ceAdmin.hideEditor = data;
|
||||
ceAdmin.uid = idPost + ceAdmin.uid.slice(-6);
|
||||
ceAdmin.$contents = ceAdmin.getContents('textarea[name^=blog_description_]');
|
||||
|
||||
$('.wrapper-edit-with-ce').prevAll('.mce-tinymce').hide(0);
|
||||
},
|
||||
'json'
|
||||
);
|
||||
});
|
||||
|
||||
// Quick Edit
|
||||
var column = /^1\.7\.[0-7]\./.test(_PS_VERSION_) ? 'td:nth-of-type(2)' : 'td[class*="-id_"]',
|
||||
selectors = [
|
||||
'table.ce_content ' + column,
|
||||
'table.ce_theme ' + column,
|
||||
'table.ce_template ' + column,
|
||||
'table.product td:nth-of-type(2)',
|
||||
'table.category td:nth-of-type(2)',
|
||||
'table.cms td:nth-of-type(2)',
|
||||
'table#product_grid_table td[class*="-id_"]',
|
||||
'table#category_grid_table td[class*="-id_"]',
|
||||
'table#cms_page_grid_table td[class*="-id_"]'
|
||||
];
|
||||
if (ceAdmin.editManufacturers) {
|
||||
selectors.push('table.manufacturer td:nth-of-type(2)');
|
||||
selectors.push('table#manufacturer_grid_table td[class*="-id_"]');
|
||||
}
|
||||
if (ceAdmin.editSuppliers) {
|
||||
selectors.push('table.supplier td:nth-of-type(2)');
|
||||
selectors.push('table#supplier_grid_table td[class*="-id_"]');
|
||||
}
|
||||
$(selectors.join()).get().forEach(function (td) {
|
||||
var id = parseInt( $(td).text() ),
|
||||
idShop = ceAdmin.uid.substr(-2),
|
||||
idType = ceAdmin.uid.substr(-6, 2),
|
||||
$btnGroup = $(td.parentNode).find('.btn-group-action');
|
||||
|
||||
if ($.fn.pstooltip) {
|
||||
$('<div class="btn-group ce-edit" data-toggle="pstooltip" data-original-title="' + ceAdmin.i18n.edit + '" data-placement="left">').html(
|
||||
ceAdmin.languages.length > 1 && ceAdmin.uid !== '0010000'
|
||||
?
|
||||
'<a class="btn dropdown-toggle dropdown-item" data-toggle="dropdown">' +
|
||||
'<i class="material-icons mi-ce"></i>' +
|
||||
'</a>' +
|
||||
'<div class="dropdown-menu dropdown-menu-right">' +
|
||||
ceAdmin.languages.map(function (lang) {
|
||||
return '<a href="' + ceAdmin.editorUrl + id + idType + (0 + lang.id_lang).substr(-2) + idShop + '" class="btn dropdown-item">' + lang.name + '</a>';
|
||||
}).join('') +
|
||||
'</div>'
|
||||
:
|
||||
'<a class="btn dropdown-item" href="' + ceAdmin.editorUrl + id + idType + (0 + ceAdmin.languages[0].id_lang).substr(-2) + idShop + '">' +
|
||||
'<i class="material-icons mi-ce"></i>' +
|
||||
'</a>'
|
||||
).prependTo($btnGroup).pstooltip();
|
||||
} else {
|
||||
$('<div class="btn-group pull-right ce-edit" title="' + ceAdmin.i18n.edit + '">').html(
|
||||
ceAdmin.languages.length > 1 && ceAdmin.uid !== '0010000'
|
||||
?
|
||||
'<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">' +
|
||||
'<i class="icon-AdminParentCEContent"></i>' +
|
||||
'</button>' +
|
||||
'<ul class="dropdown-menu">' +
|
||||
ceAdmin.languages.map(function (lang) {
|
||||
return '<li><a href="' + ceAdmin.editorUrl + id + idType + (0 + lang.id_lang).substr(-2) + idShop + '">' + lang.name + '</a></li>';
|
||||
}).join('') +
|
||||
'</ul>'
|
||||
:
|
||||
'<a class="btn btn-default" href="' + ceAdmin.editorUrl + id + idType + (0 + ceAdmin.languages[0].id_lang).substr(-2) + idShop + '">' +
|
||||
'<i class="icon-AdminParentCEContent"></i>' +
|
||||
'</a>'
|
||||
).prependTo($btnGroup);
|
||||
}
|
||||
});
|
||||
// Minor CSS fix
|
||||
$('.btn-group-action a.product-edit.tooltip-link').addClass('dropdown-item');
|
||||
|
||||
// Import Template
|
||||
var $import = $('.ce-import-panel').removeClass('hide')
|
||||
.parent().slideUp(0).insertBefore('#form-ce_template')
|
||||
;
|
||||
$('.ce-import-panel #file').attr({
|
||||
accept: '.json,.zip',
|
||||
required: true,
|
||||
});
|
||||
|
||||
// Handler functions
|
||||
ceAdmin.onClickImport = function() {
|
||||
$import.hasClass('visible')
|
||||
? $import.removeClass('visible').slideUp(300)
|
||||
: $import.addClass('visible').slideDown(300)
|
||||
;
|
||||
};
|
||||
ceAdmin.onClickBtnBack = function(e) {
|
||||
ceAdmin.checkChanges = true;
|
||||
};
|
||||
ceAdmin.onClickBtnWrapper = function(e) {
|
||||
this.children[0].click();
|
||||
};
|
||||
ceAdmin.onClickBtnEdit = function(e) {
|
||||
e.stopPropagation();
|
||||
ceAdmin.checkChanges = true;
|
||||
|
||||
if (ceAdmin.i18n.error) {
|
||||
ceAdmin.checkChanges = e.preventDefault();
|
||||
return alert(ceAdmin.i18n.error);
|
||||
}
|
||||
if ('0' === ceAdmin.uid[0]) {
|
||||
if (document.body.classList.contains('adminmaintenance')) {
|
||||
return this.href += '&action=addMaintenance';
|
||||
}
|
||||
ceAdmin.checkChanges = e.preventDefault();
|
||||
return alert(ceAdmin.i18n.save);
|
||||
}
|
||||
};
|
||||
|
||||
// Button templates
|
||||
var tmplBtnBack = $('#tmpl-btn-back-to-ps').html(),
|
||||
tmplBtnEdit = $('#tmpl-btn-edit-with-ce').html();
|
||||
|
||||
if (ceAdmin.footerProduct) {
|
||||
var $tf = $('<div class="translationsFields tab-content">').wrap('<div class="translations tabbable">');
|
||||
$tf.parent()
|
||||
.insertAfter('#related-product')
|
||||
.before('<h2 class="ce-product-hook">displayFooterProduct</h2>')
|
||||
;
|
||||
|
||||
$('textarea[id*=description_short_]').each(function(i, el) {
|
||||
var idLang = el.id.split('_').pop(),
|
||||
lang = el.parentNode.className.match(/translation-label-(\w+)/),
|
||||
$btn = $(tmplBtnEdit).click(ceAdmin.onClickBtnEdit);
|
||||
|
||||
if ('0' === ceAdmin.footerProduct[0]) {
|
||||
$btn[0].href += '&action=addFooterProduct&uid=' + (1*ceAdmin.uid + 100*idLang);
|
||||
} else {
|
||||
$btn[0].href += '&uid=' + (1*ceAdmin.footerProduct + 100*idLang) + '&footerProduct=' + ceAdmin.uid.slice(0, -6);
|
||||
}
|
||||
$('<div class="translation-field tab-pane">')
|
||||
.addClass(lang ? 'translation-label-'+lang[1] : '')
|
||||
.addClass(el.parentNode.classList.contains('active') ? 'active' : '')
|
||||
.addClass(el.parentNode.classList.contains('visible') ? 'visible' : '')
|
||||
.append($btn)
|
||||
.appendTo($tf)
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
ceAdmin.getContents = function(selector) {
|
||||
if (!ceAdmin.editSuppliers && $('form[name=supplier]').length ||
|
||||
!ceAdmin.editManufacturers && $('form[name=manufacturer]').length
|
||||
) {
|
||||
return;
|
||||
}
|
||||
return $(selector).each(function(i, el) {
|
||||
var idLang = parseInt(el[el.id ? 'id' : 'name'].split('_').pop()) || 0,
|
||||
$btn = $(tmplBtnEdit).insertBefore(el).click(ceAdmin.onClickBtnEdit);
|
||||
|
||||
$btn[0].href += '&uid=' + (1*ceAdmin.uid + 100*idLang);
|
||||
|
||||
if (~ceAdmin.hideEditor.indexOf(idLang)) {
|
||||
$(tmplBtnBack).insertBefore($btn).click(ceAdmin.onClickBtnBack)[0].href += '&uid=' + (1*ceAdmin.uid + 100*idLang);
|
||||
$btn.wrap('<div class="wrapper-edit-with-ce">').parent().click(ceAdmin.onClickBtnWrapper);
|
||||
$(el).hide().next('.maxLength').hide();
|
||||
} else {
|
||||
$btn.after('<br>');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ceAdmin.$contents = ceAdmin.getContents([
|
||||
'body:not(.adminproducts) textarea[name^=content_]:not([name*=short])',
|
||||
'body:not(.adminproducts) textarea[name*="[content]"]',
|
||||
'body:not(.adminpsblogblogs) textarea[name^=description_]:not([name*=short])',
|
||||
'textarea[name*="[description]"]',
|
||||
'textarea[name^=post_content_]',
|
||||
'textarea[name=content]',
|
||||
'.adminmaintenance textarea'
|
||||
].join());
|
||||
|
||||
ceAdmin.form = ceAdmin.$contents[0] && ceAdmin.$contents[0].form;
|
||||
ceAdmin.formChanged = false;
|
||||
|
||||
$(function() {
|
||||
// run after jQuery's document ready
|
||||
$(ceAdmin.form).one('change', ':input', function() {
|
||||
ceAdmin.formChanged = true;
|
||||
});
|
||||
});
|
||||
$(window).on('beforeunload', function() {
|
||||
if (ceAdmin.checkChanges && ceAdmin.formChanged) {
|
||||
delete ceAdmin.checkChanges;
|
||||
return "Changes you made may not be saved!";
|
||||
}
|
||||
});
|
||||
});
|
||||
12
modules/creativeelements/views/js/backoffice.js
Normal file
12
modules/creativeelements/views/js/backoffice.js
Normal file
@@ -0,0 +1,12 @@
|
||||
/*!
|
||||
* Creative Elements - live PageBuilder [in-stock]
|
||||
* Copyright 2019-2022 WebshopWorks.com
|
||||
*/
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
$('body').on('click', '.module-item[data-tech-name=creativeelements] .module_action_menu_upgrade', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
window.open('https://creativeelements.webshopworks.com/buy-license?utm_source=upgrade&utm_campaign=in-stock&utm_medium=backoffice');
|
||||
});
|
||||
});
|
||||
831
modules/creativeelements/views/js/common-modules.js
Normal file
831
modules/creativeelements/views/js/common-modules.js
Normal file
@@ -0,0 +1,831 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com & Elementor.com
|
||||
*/
|
||||
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 199);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 19:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _module = __webpack_require__(5);
|
||||
|
||||
var _module2 = _interopRequireDefault(_module);
|
||||
|
||||
var _viewModule = __webpack_require__(6);
|
||||
|
||||
var _viewModule2 = _interopRequireDefault(_viewModule);
|
||||
|
||||
var _masonry = __webpack_require__(20);
|
||||
|
||||
var _masonry2 = _interopRequireDefault(_masonry);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
exports.default = window.elementorModules = {
|
||||
Module: _module2.default,
|
||||
ViewModule: _viewModule2.default,
|
||||
utils: {
|
||||
Masonry: _masonry2.default
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 199:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _modules = __webpack_require__(19);
|
||||
|
||||
var _modules2 = _interopRequireDefault(_modules);
|
||||
|
||||
var _layout = __webpack_require__(200);
|
||||
|
||||
var _layout2 = _interopRequireDefault(_layout);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
_modules2.default.common = {
|
||||
views: {
|
||||
modal: {
|
||||
Layout: _layout2.default
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 20:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _viewModule = __webpack_require__(6);
|
||||
|
||||
var _viewModule2 = _interopRequireDefault(_viewModule);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
module.exports = _viewModule2.default.extend({
|
||||
|
||||
getDefaultSettings: function getDefaultSettings() {
|
||||
return {
|
||||
container: null,
|
||||
items: null,
|
||||
columnsCount: 3,
|
||||
verticalSpaceBetween: 30
|
||||
};
|
||||
},
|
||||
|
||||
getDefaultElements: function getDefaultElements() {
|
||||
return {
|
||||
$container: jQuery(this.getSettings('container')),
|
||||
$items: jQuery(this.getSettings('items'))
|
||||
};
|
||||
},
|
||||
|
||||
run: function run() {
|
||||
var heights = [],
|
||||
distanceFromTop = this.elements.$container.position().top,
|
||||
settings = this.getSettings(),
|
||||
columnsCount = settings.columnsCount;
|
||||
|
||||
distanceFromTop += parseInt(this.elements.$container.css('margin-top'), 10);
|
||||
|
||||
this.elements.$items.each(function (index) {
|
||||
var row = Math.floor(index / columnsCount),
|
||||
$item = jQuery(this),
|
||||
itemHeight = $item[0].getBoundingClientRect().height + settings.verticalSpaceBetween;
|
||||
|
||||
if (row) {
|
||||
var itemPosition = $item.position(),
|
||||
indexAtRow = index % columnsCount,
|
||||
pullHeight = itemPosition.top - distanceFromTop - heights[indexAtRow];
|
||||
|
||||
pullHeight -= parseInt($item.css('margin-top'), 10);
|
||||
|
||||
pullHeight *= -1;
|
||||
|
||||
$item.css('margin-top', pullHeight + 'px');
|
||||
|
||||
heights[indexAtRow] += itemHeight;
|
||||
} else {
|
||||
heights.push(itemHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 200:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _header = __webpack_require__(201);
|
||||
|
||||
var _header2 = _interopRequireDefault(_header);
|
||||
|
||||
var _logo = __webpack_require__(202);
|
||||
|
||||
var _logo2 = _interopRequireDefault(_logo);
|
||||
|
||||
var _loading = __webpack_require__(203);
|
||||
|
||||
var _loading2 = _interopRequireDefault(_loading);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_Marionette$LayoutVie) {
|
||||
_inherits(_class, _Marionette$LayoutVie);
|
||||
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'el',
|
||||
value: function el() {
|
||||
return this.getModal().getElements('widget');
|
||||
}
|
||||
}, {
|
||||
key: 'regions',
|
||||
value: function regions() {
|
||||
return {
|
||||
modalHeader: '.dialog-header',
|
||||
modalContent: '.dialog-lightbox-content',
|
||||
modalLoading: '.dialog-lightbox-loading'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'initialize',
|
||||
value: function initialize() {
|
||||
this.modalHeader.show(new _header2.default(this.getHeaderOptions()));
|
||||
}
|
||||
}, {
|
||||
key: 'getModal',
|
||||
value: function getModal() {
|
||||
if (!this.modal) {
|
||||
this.initModal();
|
||||
}
|
||||
|
||||
return this.modal;
|
||||
}
|
||||
}, {
|
||||
key: 'initModal',
|
||||
value: function initModal() {
|
||||
var modalOptions = {
|
||||
className: 'elementor-templates-modal',
|
||||
closeButton: false,
|
||||
draggable: false,
|
||||
hide: {
|
||||
onOutsideClick: false
|
||||
}
|
||||
};
|
||||
|
||||
jQuery.extend(true, modalOptions, this.getModalOptions());
|
||||
|
||||
this.modal = elementorCommon.dialogsManager.createWidget('lightbox', modalOptions);
|
||||
|
||||
this.modal.getElements('message').append(this.modal.addElement('content'), this.modal.addElement('loading'));
|
||||
|
||||
if (modalOptions.draggable) {
|
||||
this.draggableModal();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'showModal',
|
||||
value: function showModal() {
|
||||
this.getModal().show();
|
||||
}
|
||||
}, {
|
||||
key: 'hideModal',
|
||||
value: function hideModal() {
|
||||
this.getModal().hide();
|
||||
}
|
||||
}, {
|
||||
key: 'draggableModal',
|
||||
value: function draggableModal() {
|
||||
var $modalWidgetContent = this.getModal().getElements('widgetContent');
|
||||
|
||||
$modalWidgetContent.draggable({
|
||||
containment: 'parent',
|
||||
stop: function stop() {
|
||||
$modalWidgetContent.height('');
|
||||
}
|
||||
});
|
||||
|
||||
$modalWidgetContent.css('position', 'absolute');
|
||||
}
|
||||
}, {
|
||||
key: 'getModalOptions',
|
||||
value: function getModalOptions() {
|
||||
return {};
|
||||
}
|
||||
}, {
|
||||
key: 'getLogoOptions',
|
||||
value: function getLogoOptions() {
|
||||
return {};
|
||||
}
|
||||
}, {
|
||||
key: 'getHeaderOptions',
|
||||
value: function getHeaderOptions() {
|
||||
return {
|
||||
closeType: 'normal'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'getHeaderView',
|
||||
value: function getHeaderView() {
|
||||
return this.modalHeader.currentView;
|
||||
}
|
||||
}, {
|
||||
key: 'showLoadingView',
|
||||
value: function showLoadingView() {
|
||||
this.modalLoading.show(new _loading2.default());
|
||||
|
||||
this.modalLoading.$el.show();
|
||||
|
||||
this.modalContent.$el.hide();
|
||||
}
|
||||
}, {
|
||||
key: 'hideLoadingView',
|
||||
value: function hideLoadingView() {
|
||||
this.modalContent.$el.show();
|
||||
|
||||
this.modalLoading.$el.hide();
|
||||
}
|
||||
}, {
|
||||
key: 'showLogo',
|
||||
value: function showLogo() {
|
||||
this.getHeaderView().logoArea.show(new _logo2.default(this.getLogoOptions()));
|
||||
}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(Marionette.LayoutView);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 201:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_Marionette$LayoutVie) {
|
||||
_inherits(_class, _Marionette$LayoutVie);
|
||||
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'className',
|
||||
value: function className() {
|
||||
return 'elementor-templates-modal__header';
|
||||
}
|
||||
}, {
|
||||
key: 'getTemplate',
|
||||
value: function getTemplate() {
|
||||
return '#tmpl-elementor-templates-modal__header';
|
||||
}
|
||||
}, {
|
||||
key: 'regions',
|
||||
value: function regions() {
|
||||
return {
|
||||
logoArea: '.elementor-templates-modal__header__logo-area',
|
||||
tools: '#elementor-template-library-header-tools',
|
||||
menuArea: '.elementor-templates-modal__header__menu-area'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'ui',
|
||||
value: function ui() {
|
||||
return {
|
||||
closeModal: '.elementor-templates-modal__header__close'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'events',
|
||||
value: function events() {
|
||||
return {
|
||||
'click @ui.closeModal': 'onCloseModalClick'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'templateHelpers',
|
||||
value: function templateHelpers() {
|
||||
return {
|
||||
closeType: this.getOption('closeType')
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'onCloseModalClick',
|
||||
value: function onCloseModalClick() {
|
||||
this._parent._parent._parent.hideModal();
|
||||
}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(Marionette.LayoutView);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 202:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_Marionette$ItemView) {
|
||||
_inherits(_class, _Marionette$ItemView);
|
||||
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'getTemplate',
|
||||
value: function getTemplate() {
|
||||
return '#tmpl-elementor-templates-modal__header__logo';
|
||||
}
|
||||
}, {
|
||||
key: 'className',
|
||||
value: function className() {
|
||||
return 'elementor-templates-modal__header__logo';
|
||||
}
|
||||
}, {
|
||||
key: 'events',
|
||||
value: function events() {
|
||||
return {
|
||||
click: 'onClick'
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'templateHelpers',
|
||||
value: function templateHelpers() {
|
||||
return {
|
||||
title: this.getOption('title')
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'onClick',
|
||||
value: function onClick() {
|
||||
var clickCallback = this.getOption('click');
|
||||
|
||||
if (clickCallback) {
|
||||
clickCallback();
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(Marionette.ItemView);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 203:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_Marionette$ItemView) {
|
||||
_inherits(_class, _Marionette$ItemView);
|
||||
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'id',
|
||||
value: function id() {
|
||||
return 'elementor-template-library-loading';
|
||||
}
|
||||
}, {
|
||||
key: 'getTemplate',
|
||||
value: function getTemplate() {
|
||||
return '#tmpl-elementor-template-library-loading';
|
||||
}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(Marionette.ItemView);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
var Module = function Module() {
|
||||
var $ = jQuery,
|
||||
instanceParams = arguments,
|
||||
self = this,
|
||||
events = {};
|
||||
|
||||
var settings = void 0;
|
||||
|
||||
var ensureClosureMethods = function ensureClosureMethods() {
|
||||
$.each(self, function (methodName) {
|
||||
var oldMethod = self[methodName];
|
||||
|
||||
if ('function' !== typeof oldMethod) {
|
||||
return;
|
||||
}
|
||||
|
||||
self[methodName] = function () {
|
||||
return oldMethod.apply(self, arguments);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
var initSettings = function initSettings() {
|
||||
settings = self.getDefaultSettings();
|
||||
|
||||
var instanceSettings = instanceParams[0];
|
||||
|
||||
if (instanceSettings) {
|
||||
$.extend(true, settings, instanceSettings);
|
||||
}
|
||||
};
|
||||
|
||||
var init = function init() {
|
||||
self.__construct.apply(self, instanceParams);
|
||||
|
||||
ensureClosureMethods();
|
||||
|
||||
initSettings();
|
||||
|
||||
self.trigger('init');
|
||||
};
|
||||
|
||||
this.getItems = function (items, itemKey) {
|
||||
if (itemKey) {
|
||||
var keyStack = itemKey.split('.'),
|
||||
currentKey = keyStack.splice(0, 1);
|
||||
|
||||
if (!keyStack.length) {
|
||||
return items[currentKey];
|
||||
}
|
||||
|
||||
if (!items[currentKey]) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.getItems(items[currentKey], keyStack.join('.'));
|
||||
}
|
||||
|
||||
return items;
|
||||
};
|
||||
|
||||
this.getSettings = function (setting) {
|
||||
return this.getItems(settings, setting);
|
||||
};
|
||||
|
||||
this.setSettings = function (settingKey, value, settingsContainer) {
|
||||
if (!settingsContainer) {
|
||||
settingsContainer = settings;
|
||||
}
|
||||
|
||||
if ('object' === (typeof settingKey === 'undefined' ? 'undefined' : _typeof(settingKey))) {
|
||||
$.extend(settingsContainer, settingKey);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
var keyStack = settingKey.split('.'),
|
||||
currentKey = keyStack.splice(0, 1);
|
||||
|
||||
if (!keyStack.length) {
|
||||
settingsContainer[currentKey] = value;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
if (!settingsContainer[currentKey]) {
|
||||
settingsContainer[currentKey] = {};
|
||||
}
|
||||
|
||||
return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
|
||||
};
|
||||
|
||||
this.forceMethodImplementation = function (methodArguments) {
|
||||
var functionName = methodArguments.callee.name;
|
||||
|
||||
throw new ReferenceError('The method ' + functionName + ' must to be implemented in the inheritor child.');
|
||||
};
|
||||
|
||||
this.on = function (eventName, callback) {
|
||||
if ('object' === (typeof eventName === 'undefined' ? 'undefined' : _typeof(eventName))) {
|
||||
$.each(eventName, function (singleEventName) {
|
||||
self.on(singleEventName, this);
|
||||
});
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
var eventNames = eventName.split(' ');
|
||||
|
||||
eventNames.forEach(function (singleEventName) {
|
||||
if (!events[singleEventName]) {
|
||||
events[singleEventName] = [];
|
||||
}
|
||||
|
||||
events[singleEventName].push(callback);
|
||||
});
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
this.off = function (eventName, callback) {
|
||||
if (!events[eventName]) {
|
||||
return self;
|
||||
}
|
||||
|
||||
if (!callback) {
|
||||
delete events[eventName];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
var callbackIndex = events[eventName].indexOf(callback);
|
||||
|
||||
if (-1 !== callbackIndex) {
|
||||
delete events[eventName][callbackIndex];
|
||||
}
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
this.trigger = function (eventName) {
|
||||
var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
|
||||
params = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
if (self[methodName]) {
|
||||
self[methodName].apply(self, params);
|
||||
}
|
||||
|
||||
var callbacks = events[eventName];
|
||||
|
||||
if (!callbacks) {
|
||||
return self;
|
||||
}
|
||||
|
||||
$.each(callbacks, function (index, callback) {
|
||||
callback.apply(self, params);
|
||||
});
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
Module.prototype.__construct = function () {};
|
||||
|
||||
Module.prototype.getDefaultSettings = function () {
|
||||
return {};
|
||||
};
|
||||
|
||||
Module.extendsCount = 0;
|
||||
|
||||
Module.extend = function (properties) {
|
||||
var $ = jQuery,
|
||||
parent = this;
|
||||
|
||||
var child = function child() {
|
||||
return parent.apply(this, arguments);
|
||||
};
|
||||
|
||||
$.extend(child, parent);
|
||||
|
||||
child.prototype = Object.create($.extend({}, parent.prototype, properties));
|
||||
|
||||
child.prototype.constructor = child;
|
||||
|
||||
/*
|
||||
* Constructor ID is used to set an unique ID
|
||||
* to every extend of the Module.
|
||||
*
|
||||
* It's useful in some cases such as unique
|
||||
* listener for frontend handlers.
|
||||
*/
|
||||
var constructorID = ++Module.extendsCount;
|
||||
|
||||
child.prototype.getConstructorID = function () {
|
||||
return constructorID;
|
||||
};
|
||||
|
||||
child.__super__ = parent.prototype;
|
||||
|
||||
return child;
|
||||
};
|
||||
|
||||
module.exports = Module;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _module = __webpack_require__(5);
|
||||
|
||||
var _module2 = _interopRequireDefault(_module);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
module.exports = _module2.default.extend({
|
||||
elements: null,
|
||||
|
||||
getDefaultElements: function getDefaultElements() {
|
||||
return {};
|
||||
},
|
||||
|
||||
bindEvents: function bindEvents() {},
|
||||
|
||||
onInit: function onInit() {
|
||||
this.initElements();
|
||||
|
||||
this.bindEvents();
|
||||
},
|
||||
|
||||
initElements: function initElements() {
|
||||
this.elements = this.getDefaultElements();
|
||||
}
|
||||
});
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
5
modules/creativeelements/views/js/common-modules.min.js
vendored
Normal file
5
modules/creativeelements/views/js/common-modules.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
821
modules/creativeelements/views/js/common.js
Normal file
821
modules/creativeelements/views/js/common.js
Normal file
@@ -0,0 +1,821 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com & Elementor.com
|
||||
*/
|
||||
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 167);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 1:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var userAgent = navigator.userAgent;
|
||||
|
||||
exports.default = {
|
||||
webkit: -1 !== userAgent.indexOf('AppleWebKit'),
|
||||
firefox: -1 !== userAgent.indexOf('Firefox'),
|
||||
ie: /Trident|MSIE/.test(userAgent),
|
||||
edge: -1 !== userAgent.indexOf('Edge'),
|
||||
mac: -1 !== userAgent.indexOf('Macintosh')
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 15:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_elementorModules$Mod) {
|
||||
_inherits(_class, _elementorModules$Mod);
|
||||
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'get',
|
||||
value: function get(key, options) {
|
||||
options = options || {};
|
||||
|
||||
var storage = void 0;
|
||||
|
||||
try {
|
||||
storage = options.session ? sessionStorage : localStorage;
|
||||
} catch (e) {
|
||||
return key ? undefined : {};
|
||||
}
|
||||
|
||||
var elementorStorage = storage.getItem('elementor');
|
||||
|
||||
if (elementorStorage) {
|
||||
elementorStorage = JSON.parse(elementorStorage);
|
||||
} else {
|
||||
elementorStorage = {};
|
||||
}
|
||||
|
||||
if (!elementorStorage.__expiration) {
|
||||
elementorStorage.__expiration = {};
|
||||
}
|
||||
|
||||
var expiration = elementorStorage.__expiration;
|
||||
|
||||
var expirationToCheck = [];
|
||||
|
||||
if (key) {
|
||||
if (expiration[key]) {
|
||||
expirationToCheck = [key];
|
||||
}
|
||||
} else {
|
||||
expirationToCheck = Object.keys(expiration);
|
||||
}
|
||||
|
||||
var entryExpired = false;
|
||||
|
||||
expirationToCheck.forEach(function (expirationKey) {
|
||||
if (new Date(expiration[expirationKey]) < new Date()) {
|
||||
delete elementorStorage[expirationKey];
|
||||
|
||||
delete expiration[expirationKey];
|
||||
|
||||
entryExpired = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (entryExpired) {
|
||||
this.save(elementorStorage, options.session);
|
||||
}
|
||||
|
||||
if (key) {
|
||||
return elementorStorage[key];
|
||||
}
|
||||
|
||||
return elementorStorage;
|
||||
}
|
||||
}, {
|
||||
key: 'set',
|
||||
value: function set(key, value, options) {
|
||||
options = options || {};
|
||||
|
||||
var elementorStorage = this.get(null, options);
|
||||
|
||||
elementorStorage[key] = value;
|
||||
|
||||
if (options.lifetimeInSeconds) {
|
||||
var date = new Date();
|
||||
|
||||
date.setTime(date.getTime() + options.lifetimeInSeconds * 1000);
|
||||
|
||||
elementorStorage.__expiration[key] = date.getTime();
|
||||
}
|
||||
|
||||
this.save(elementorStorage, options.session);
|
||||
}
|
||||
}, {
|
||||
key: 'save',
|
||||
value: function save(object, session) {
|
||||
var storage = void 0;
|
||||
|
||||
try {
|
||||
storage = session ? sessionStorage : localStorage;
|
||||
} catch (e) {
|
||||
return;
|
||||
}
|
||||
|
||||
storage.setItem('elementor', JSON.stringify(object));
|
||||
}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(elementorModules.Module);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 16:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _environment = __webpack_require__(1);
|
||||
|
||||
var _environment2 = _interopRequireDefault(_environment);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var HotKeys = function () {
|
||||
function HotKeys() {
|
||||
_classCallCheck(this, HotKeys);
|
||||
|
||||
this.hotKeysHandlers = {};
|
||||
}
|
||||
|
||||
_createClass(HotKeys, [{
|
||||
key: 'applyHotKey',
|
||||
value: function applyHotKey(event) {
|
||||
var handlers = this.hotKeysHandlers[event.which];
|
||||
|
||||
if (!handlers) {
|
||||
return;
|
||||
}
|
||||
|
||||
jQuery.each(handlers, function (key, handler) {
|
||||
if (handler.isWorthHandling && !handler.isWorthHandling(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fix for some keyboard sources that consider alt key as ctrl key
|
||||
if (!handler.allowAltKey && event.altKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
handler.handle(event);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'isControlEvent',
|
||||
value: function isControlEvent(event) {
|
||||
return event[_environment2.default.mac ? 'metaKey' : 'ctrlKey'];
|
||||
}
|
||||
}, {
|
||||
key: 'addHotKeyHandler',
|
||||
value: function addHotKeyHandler(keyCode, handlerName, handler) {
|
||||
if (!this.hotKeysHandlers[keyCode]) {
|
||||
this.hotKeysHandlers[keyCode] = {};
|
||||
}
|
||||
|
||||
this.hotKeysHandlers[keyCode][handlerName] = handler;
|
||||
}
|
||||
}, {
|
||||
key: 'bindListener',
|
||||
value: function bindListener($listener) {
|
||||
$listener.on('keydown', this.applyHotKey.bind(this));
|
||||
}
|
||||
}]);
|
||||
|
||||
return HotKeys;
|
||||
}();
|
||||
|
||||
exports.default = HotKeys;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 167:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
|
||||
|
||||
var _helpers = __webpack_require__(168);
|
||||
|
||||
var _helpers2 = _interopRequireDefault(_helpers);
|
||||
|
||||
var _storage = __webpack_require__(15);
|
||||
|
||||
var _storage2 = _interopRequireDefault(_storage);
|
||||
|
||||
var _hotKeys = __webpack_require__(16);
|
||||
|
||||
var _hotKeys2 = _interopRequireDefault(_hotKeys);
|
||||
|
||||
var _ajax = __webpack_require__(169);
|
||||
|
||||
var _ajax2 = _interopRequireDefault(_ajax);
|
||||
|
||||
// var _finder = __webpack_require__(170);
|
||||
|
||||
// var _finder2 = _interopRequireDefault(_finder);
|
||||
|
||||
// var _connect = __webpack_require__(177);
|
||||
|
||||
// var _connect2 = _interopRequireDefault(_connect);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var ElementorCommonApp = function (_elementorModules$Vie) {
|
||||
_inherits(ElementorCommonApp, _elementorModules$Vie);
|
||||
|
||||
function ElementorCommonApp() {
|
||||
_classCallCheck(this, ElementorCommonApp);
|
||||
|
||||
return _possibleConstructorReturn(this, (ElementorCommonApp.__proto__ || Object.getPrototypeOf(ElementorCommonApp)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(ElementorCommonApp, [{
|
||||
key: 'setMarionetteTemplateCompiler',
|
||||
value: function setMarionetteTemplateCompiler() {
|
||||
Marionette.TemplateCache.prototype.compileTemplate = function (rawTemplate, options) {
|
||||
options = {
|
||||
evaluate: /<#([\s\S]+?)#>/g,
|
||||
interpolate: /{{{([\s\S]+?)}}}/g,
|
||||
escape: /{{([^}]+?)}}(?!})/g
|
||||
};
|
||||
|
||||
return _.template(rawTemplate, options);
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'getDefaultElements',
|
||||
value: function getDefaultElements() {
|
||||
return {
|
||||
$window: jQuery(window),
|
||||
$document: jQuery(document),
|
||||
$body: jQuery(document.body)
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'initComponents',
|
||||
value: function initComponents() {
|
||||
this.helpers = new _helpers2.default();
|
||||
|
||||
this.storage = new _storage2.default();
|
||||
|
||||
this.hotKeys = new _hotKeys2.default();
|
||||
|
||||
this.hotKeys.bindListener(this.elements.$window);
|
||||
|
||||
this.dialogsManager = new DialogsManager.Instance();
|
||||
|
||||
this.initModules();
|
||||
}
|
||||
}, {
|
||||
key: 'initModules',
|
||||
value: function initModules() {
|
||||
var _this2 = this;
|
||||
|
||||
var activeModules = this.config.activeModules;
|
||||
|
||||
|
||||
var modules = {
|
||||
ajax: _ajax2.default,
|
||||
// finder: _finder2.default,
|
||||
// connect: _connect2.default
|
||||
};
|
||||
|
||||
activeModules.forEach(function (name) {
|
||||
if (modules[name]) {
|
||||
_this2[name] = new modules[name](_this2.config[name]);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'translate',
|
||||
value: function translate(stringKey, context, templateArgs, i18nStack) {
|
||||
if (context) {
|
||||
i18nStack = this.config[context] && this.config[context].i18n;
|
||||
}
|
||||
|
||||
if (!i18nStack) {
|
||||
i18nStack = this.config.i18n;
|
||||
}
|
||||
|
||||
var string = i18nStack && i18nStack[stringKey];
|
||||
|
||||
if (undefined === string) {
|
||||
string = stringKey;
|
||||
}
|
||||
|
||||
if (templateArgs) {
|
||||
string = string.replace(/%(?:(\d+)\$)?s/g, function (match, number) {
|
||||
if (!number) {
|
||||
number = 1;
|
||||
}
|
||||
|
||||
number--;
|
||||
|
||||
return undefined !== templateArgs[number] ? templateArgs[number] : match;
|
||||
});
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
}, {
|
||||
key: 'onInit',
|
||||
value: function onInit() {
|
||||
_get(ElementorCommonApp.prototype.__proto__ || Object.getPrototypeOf(ElementorCommonApp.prototype), 'onInit', this).call(this);
|
||||
|
||||
this.config = elementorCommonConfig;
|
||||
|
||||
this.setMarionetteTemplateCompiler();
|
||||
}
|
||||
}]);
|
||||
|
||||
return ElementorCommonApp;
|
||||
}(elementorModules.ViewModule);
|
||||
|
||||
window.elementorCommon = new ElementorCommonApp();
|
||||
|
||||
elementorCommon.initComponents();
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 168:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var Helpers = function () {
|
||||
function Helpers() {
|
||||
_classCallCheck(this, Helpers);
|
||||
}
|
||||
|
||||
_createClass(Helpers, [{
|
||||
key: 'deprecatedMethod',
|
||||
value: function deprecatedMethod(methodName, version, replacement) {
|
||||
var message = '%c %c`' + methodName + '` is deprecated since ' + version;
|
||||
|
||||
var style = 'font-size: 12px; background-image: url("' + elementorCommon.config.urls.assets + 'images/logo-icon.png"); background-repeat: no-repeat; background-size: contain;';
|
||||
|
||||
if (replacement) {
|
||||
message += ' - Use `' + replacement + '` instead';
|
||||
}
|
||||
|
||||
console.warn(message, style, ''); // eslint-disable-line no-console
|
||||
}
|
||||
}, {
|
||||
key: 'cloneObject',
|
||||
value: function cloneObject(object) {
|
||||
return JSON.parse(JSON.stringify(object));
|
||||
}
|
||||
}, {
|
||||
key: 'firstLetterUppercase',
|
||||
value: function firstLetterUppercase(string) {
|
||||
return string[0].toUpperCase() + string.slice(1);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Helpers;
|
||||
}();
|
||||
|
||||
exports.default = Helpers;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 169:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_elementorModules$Mod) {
|
||||
_inherits(_class, _elementorModules$Mod);
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'getDefaultSettings',
|
||||
value: function getDefaultSettings() {
|
||||
return {
|
||||
ajaxParams: {
|
||||
type: 'POST',
|
||||
url: elementorCommon.config.ajax.url,
|
||||
data: {},
|
||||
dataType: 'json'
|
||||
},
|
||||
actionPrefix: 'elementor_'
|
||||
};
|
||||
}
|
||||
}]);
|
||||
|
||||
function _class() {
|
||||
var _ref;
|
||||
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
var _this = _possibleConstructorReturn(this, (_ref = _class.__proto__ || Object.getPrototypeOf(_class)).call.apply(_ref, [this].concat(args)));
|
||||
|
||||
_this.requests = {};
|
||||
|
||||
_this.cache = {};
|
||||
|
||||
_this.initRequestConstants();
|
||||
|
||||
_this.debounceSendBatch = _.debounce(_this.sendBatch.bind(_this), 500);
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'initRequestConstants',
|
||||
value: function initRequestConstants() {
|
||||
this.requestConstants = {
|
||||
_nonce: this.getSettings('nonce')
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'addRequestConstant',
|
||||
value: function addRequestConstant(key, value) {
|
||||
this.requestConstants[key] = value;
|
||||
}
|
||||
}, {
|
||||
key: 'getCacheKey',
|
||||
value: function getCacheKey(request) {
|
||||
return JSON.stringify({
|
||||
unique_id: request.unique_id,
|
||||
data: request.data
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'loadObjects',
|
||||
value: function loadObjects(options) {
|
||||
var _this2 = this;
|
||||
|
||||
var dataCollection = {};
|
||||
|
||||
var deferredArray = [];
|
||||
|
||||
if (options.before) {
|
||||
options.before();
|
||||
}
|
||||
|
||||
options.ids.forEach(function (objectId) {
|
||||
deferredArray.push(_this2.load({
|
||||
action: options.action,
|
||||
unique_id: options.data.unique_id + objectId,
|
||||
data: jQuery.extend({ id: objectId }, options.data)
|
||||
}).done(function (data) {
|
||||
return dataCollection = jQuery.extend(dataCollection, data);
|
||||
}));
|
||||
});
|
||||
|
||||
jQuery.when.apply(jQuery, deferredArray).done(function () {
|
||||
return options.success(dataCollection);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'load',
|
||||
value: function load(request) {
|
||||
var _this3 = this;
|
||||
|
||||
if (!request.unique_id) {
|
||||
request.unique_id = request.action;
|
||||
}
|
||||
|
||||
if (request.before) {
|
||||
request.before();
|
||||
}
|
||||
|
||||
var deferred = void 0;
|
||||
|
||||
var cacheKey = this.getCacheKey(request);
|
||||
|
||||
if (_.has(this.cache, cacheKey)) {
|
||||
deferred = jQuery.Deferred().done(request.success).resolve(this.cache[cacheKey]);
|
||||
} else {
|
||||
deferred = this.addRequest(request.action, {
|
||||
data: request.data,
|
||||
unique_id: request.unique_id,
|
||||
success: function success(data) {
|
||||
return _this3.cache[cacheKey] = data;
|
||||
}
|
||||
}).done(request.success);
|
||||
}
|
||||
|
||||
return deferred;
|
||||
}
|
||||
}, {
|
||||
key: 'addRequest',
|
||||
value: function addRequest(action, options, immediately) {
|
||||
options = options || {};
|
||||
|
||||
if (!options.unique_id) {
|
||||
options.unique_id = action;
|
||||
}
|
||||
|
||||
options.deferred = jQuery.Deferred().done(options.success).fail(options.error).always(options.complete);
|
||||
|
||||
var request = {
|
||||
action: action,
|
||||
options: options
|
||||
};
|
||||
|
||||
if (immediately) {
|
||||
var requests = {};
|
||||
|
||||
requests[options.unique_id] = request;
|
||||
|
||||
options.deferred.jqXhr = this.sendBatch(requests);
|
||||
} else {
|
||||
this.requests[options.unique_id] = request;
|
||||
|
||||
this.debounceSendBatch();
|
||||
}
|
||||
|
||||
return options.deferred;
|
||||
}
|
||||
}, {
|
||||
key: 'sendBatch',
|
||||
value: function sendBatch(requests) {
|
||||
var actions = {};
|
||||
|
||||
if (!requests) {
|
||||
requests = this.requests;
|
||||
|
||||
// Empty for next batch.
|
||||
this.requests = {};
|
||||
}
|
||||
|
||||
Object.entries(requests).forEach(function (_ref2) {
|
||||
var _ref3 = _slicedToArray(_ref2, 2),
|
||||
id = _ref3[0],
|
||||
request = _ref3[1];
|
||||
|
||||
return actions[id] = {
|
||||
action: request.action,
|
||||
data: request.options.data
|
||||
};
|
||||
});
|
||||
|
||||
return this.send('ajax', {
|
||||
data: {
|
||||
actions: JSON.stringify(actions)
|
||||
},
|
||||
success: function success(data) {
|
||||
Object.entries(data.responses).forEach(function (_ref4) {
|
||||
var _ref5 = _slicedToArray(_ref4, 2),
|
||||
id = _ref5[0],
|
||||
response = _ref5[1];
|
||||
|
||||
var options = requests[id].options;
|
||||
|
||||
if (options) {
|
||||
if (response.success) {
|
||||
options.deferred.resolve(response.data);
|
||||
} else if (!response.success) {
|
||||
options.deferred.reject(response.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
error: function error(data) {
|
||||
return Object.values(requests).forEach(function (args) {
|
||||
if (args.options) {
|
||||
args.options.deferred.reject(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'send',
|
||||
value: function send(action, options) {
|
||||
var _this4 = this;
|
||||
|
||||
var settings = this.getSettings(),
|
||||
ajaxParams = elementorCommon.helpers.cloneObject(settings.ajaxParams);
|
||||
|
||||
options = options || {};
|
||||
|
||||
action = settings.actionPrefix + action;
|
||||
|
||||
jQuery.extend(ajaxParams, options);
|
||||
|
||||
var requestConstants = elementorCommon.helpers.cloneObject(this.requestConstants);
|
||||
|
||||
requestConstants.action = action;
|
||||
|
||||
var isFormData = ajaxParams.data instanceof FormData;
|
||||
|
||||
Object.entries(requestConstants).forEach(function (_ref6) {
|
||||
var _ref7 = _slicedToArray(_ref6, 2),
|
||||
key = _ref7[0],
|
||||
value = _ref7[1];
|
||||
|
||||
if (isFormData) {
|
||||
ajaxParams.data.append(key, value);
|
||||
} else {
|
||||
ajaxParams.data[key] = value;
|
||||
}
|
||||
});
|
||||
|
||||
var successCallback = ajaxParams.success,
|
||||
errorCallback = ajaxParams.error;
|
||||
|
||||
if (successCallback || errorCallback) {
|
||||
ajaxParams.success = function (response) {
|
||||
if (response.success && successCallback) {
|
||||
successCallback(response.data);
|
||||
}
|
||||
|
||||
if (!response.success && errorCallback) {
|
||||
errorCallback(response.data);
|
||||
}
|
||||
};
|
||||
|
||||
if (errorCallback) {
|
||||
ajaxParams.error = function (data) {
|
||||
return errorCallback(data);
|
||||
};
|
||||
} else {
|
||||
ajaxParams.error = function (xmlHttpRequest) {
|
||||
if (xmlHttpRequest.readyState || 'abort' !== xmlHttpRequest.statusText) {
|
||||
_this4.trigger('request:unhandledError', xmlHttpRequest);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return jQuery.ajax(ajaxParams);
|
||||
}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(elementorModules.Module);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
5
modules/creativeelements/views/js/common.min.js
vendored
Normal file
5
modules/creativeelements/views/js/common.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
578
modules/creativeelements/views/js/custom-fonts.js
Normal file
578
modules/creativeelements/views/js/custom-fonts.js
Normal file
@@ -0,0 +1,578 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com & Elementor.com
|
||||
*/
|
||||
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 56);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 56:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var modules = {
|
||||
AssetsManager: __webpack_require__(61)
|
||||
};
|
||||
|
||||
window.ceAdmin = {
|
||||
assetsManager: new modules.AssetsManager()
|
||||
};
|
||||
|
||||
jQuery(function () {
|
||||
ceAdmin.assetsManager.fontManager.init();
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 61:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
module.exports = function () {
|
||||
var FontManager = __webpack_require__(62);
|
||||
|
||||
this.fontManager = new FontManager();
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 62:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
module.exports = function () {
|
||||
var self = this;
|
||||
|
||||
self.fields = {
|
||||
upload: __webpack_require__(63),
|
||||
repeater: __webpack_require__(64)
|
||||
};
|
||||
|
||||
self.selectors = {
|
||||
title: '#family',
|
||||
repeaterBlock: '.repeater-block',
|
||||
repeaterTitle: '.repeater-title',
|
||||
removeRowBtn: '.remove-repeater-row',
|
||||
editRowBtn: '.toggle-repeater-row',
|
||||
closeRowBtn: '.close-repeater-row',
|
||||
styleInput: '.font_style',
|
||||
weightInput: '.font_weight',
|
||||
customFontsMetaBox: '#elementor-font-custommetabox',
|
||||
closeHandle: 'button.handlediv',
|
||||
toolbar: '.elementor-field-toolbar',
|
||||
inlinePreview: '.inline-preview',
|
||||
fileUrlInput: '.elementor-field-file input[type="text"]'
|
||||
};
|
||||
|
||||
self.fontLabelTemplate = '<ul class="row-font-label"><li class="row-font-weight">{{weight}}</li><li class="row-font-style">{{style}}</li><li class="row-font-preview">{{preview}}</li>{{toolbar}}</ul>';
|
||||
|
||||
self.renderTemplate = function (tpl, data) {
|
||||
var re = /{{([^}}]+)?}}/g,
|
||||
match;
|
||||
while (match = re.exec(tpl)) {
|
||||
// eslint-disable-line no-cond-assign
|
||||
tpl = tpl.replace(match[0], data[match[1]]);
|
||||
}
|
||||
return tpl;
|
||||
};
|
||||
|
||||
self.ucFirst = function (string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
};
|
||||
|
||||
self.getPreviewStyle = function ($table) {
|
||||
var fontFamily = "'" + jQuery(self.selectors.title).val() + "'",
|
||||
style = $table.find('select' + self.selectors.styleInput).first().val(),
|
||||
weight = $table.find('select' + self.selectors.weightInput).first().val();
|
||||
|
||||
return {
|
||||
style: self.ucFirst(style),
|
||||
weight: self.ucFirst(weight),
|
||||
styleAttribute: 'font-family: ' + fontFamily + '; font-style: ' + style + '; font-weight: ' + weight + ';'
|
||||
};
|
||||
};
|
||||
|
||||
self.updateRowLabel = function (event, $table) {
|
||||
var $block = $table.closest(self.selectors.repeaterBlock),
|
||||
$deleteBtn = $block.find(self.selectors.removeRowBtn).first(),
|
||||
$editBtn = $block.find(self.selectors.editRowBtn).first(),
|
||||
$closeBtn = $block.find(self.selectors.closeRowBtn).first(),
|
||||
$toolbar = $table.find(self.selectors.toolbar).last().clone(),
|
||||
previewStyle = self.getPreviewStyle($table),
|
||||
toolbarHtml;
|
||||
|
||||
if ($editBtn.length > 0) {
|
||||
$editBtn.not(self.selectors.toolbar + ' ' + self.selectors.editRowBtn).remove();
|
||||
}
|
||||
|
||||
if ($closeBtn.length > 0) {
|
||||
$closeBtn.not(self.selectors.toolbar + ' ' + self.selectors.closeRowBtn).remove();
|
||||
}
|
||||
|
||||
if ($deleteBtn.length > 0) {
|
||||
$deleteBtn.not(self.selectors.toolbar + ' ' + self.selectors.removeRowBtn).remove();
|
||||
}
|
||||
|
||||
toolbarHtml = jQuery('<li class="row-font-actions">').append($toolbar)[0].outerHTML;
|
||||
|
||||
return self.renderTemplate(self.fontLabelTemplate, {
|
||||
weight: '<span class="label">Weight:</span>' + previewStyle.weight,
|
||||
style: '<span class="label">Style:</span>' + previewStyle.style,
|
||||
preview: '<span style="' + previewStyle.styleAttribute + '">Creative Elements Module Is Making The Web Beautiful!</span>',
|
||||
toolbar: toolbarHtml
|
||||
});
|
||||
};
|
||||
|
||||
self.onRepeaterToggleVisible = function (event, $btn, $table) {
|
||||
var $previewElement = $table.find(self.selectors.inlinePreview),
|
||||
previewStyle = self.getPreviewStyle($table);
|
||||
|
||||
$previewElement.attr('style', previewStyle.styleAttribute);
|
||||
};
|
||||
|
||||
self.onRepeaterNewRow = function (event, $btn, $block) {
|
||||
$block.find(self.selectors.removeRowBtn).first().remove();
|
||||
$block.find(self.selectors.editRowBtn).first().remove();
|
||||
$block.find(self.selectors.closeRowBtn).first().remove();
|
||||
};
|
||||
|
||||
self.maybeToggle = function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (jQuery(this).is(':visible') && !jQuery(event.target).hasClass(self.selectors.editRowBtn)) {
|
||||
jQuery(this).find(self.selectors.editRowBtn).click();
|
||||
}
|
||||
};
|
||||
|
||||
self.onInputChange = function (event) {
|
||||
var $el = jQuery(event.target).next();
|
||||
|
||||
self.fields.upload.setFields($el);
|
||||
self.fields.upload.setLabels($el);
|
||||
self.fields.upload.replaceButtonClass($el);
|
||||
};
|
||||
|
||||
self.bind = function () {
|
||||
jQuery(document).on('repeaterComputedLabel', this.updateRowLabel).on('onRepeaterToggleVisible', this.onRepeaterToggleVisible).on('onRepeaterNewRow', this.onRepeaterNewRow).on('click', this.selectors.repeaterTitle, this.maybeToggle).on('input', this.selectors.fileUrlInput, this.onInputChange.bind(this));
|
||||
};
|
||||
|
||||
self.removeCloseHandle = function () {
|
||||
jQuery(this.selectors.closeHandle).remove();
|
||||
jQuery(this.selectors.customFontsMetaBox).removeClass('closed').removeClass('postbox');
|
||||
};
|
||||
|
||||
self.titleRequired = function () {
|
||||
jQuery(self.selectors.title).prop('required', true);
|
||||
};
|
||||
|
||||
self.init = function () {
|
||||
if (!jQuery('#ce_font_form #files').length) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.removeCloseHandle();
|
||||
this.titleRequired();
|
||||
this.bind();
|
||||
this.fields.upload.init();
|
||||
this.fields.repeater.init();
|
||||
|
||||
// Init font URLs
|
||||
var fonts = JSON.parse($('#files').val() || '[]');
|
||||
|
||||
fonts.forEach(function(font, i) {
|
||||
$('.add-repeater-row').click();
|
||||
|
||||
$('select[name="font_face['+ i +'][font_weight]"]').val(font.font_weight);
|
||||
$('select[name="font_face['+ i +'][font_style]"]').val(font.font_style);
|
||||
$('input[name="font_face['+ i +'][woff][url]"]').val(font.woff && font.woff.url || '').trigger('input');
|
||||
$('input[name="font_face['+ i +'][woff2][url]"]').val(font.woff2 && font.woff2.url || '').trigger('input');
|
||||
$('input[name="font_face['+ i +'][ttf][url]"]').val(font.ttf && font.ttf.url || '').trigger('input');
|
||||
$('input[name="font_face['+ i +'][otf][url]"]').val(font.otf && font.otf.url || '').trigger('input');
|
||||
|
||||
$('.close-repeater-row:last').click();
|
||||
});
|
||||
|
||||
// Cancel button fix
|
||||
$('.btn[id$=_form_cancel_btn]')
|
||||
.removeAttr('onclick')
|
||||
.attr('href', location.href.replace(/&id\w*=\d+|&(add|update)\w+(=[^&]*)?/g, ''))
|
||||
;
|
||||
};
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 63:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
module.exports = {
|
||||
$btn: null,
|
||||
fileFont: null,
|
||||
fileUrl: null,
|
||||
fileFrame: [],
|
||||
|
||||
selectors: {
|
||||
uploadBtnClass: 'elementor-upload-btn',
|
||||
clearBtnClass: 'elementor-upload-clear-btn',
|
||||
uploadBtn: '.elementor-upload-btn',
|
||||
clearBtn: '.elementor-upload-clear-btn'
|
||||
},
|
||||
|
||||
hasValue: function hasValue() {
|
||||
return '' !== jQuery(this.fileUrl).val();
|
||||
},
|
||||
|
||||
setLabels: function setLabels($el) {
|
||||
if (!this.hasValue()) {
|
||||
$el.val($el.data('upload_text'));
|
||||
} else {
|
||||
$el.val($el.data('remove_text'));
|
||||
}
|
||||
},
|
||||
|
||||
setFields: function setFields(el) {
|
||||
var self = this;
|
||||
self.fileUrl = jQuery(el).prev();
|
||||
self.fileFont = jQuery(self.fileUrl).prev();
|
||||
},
|
||||
|
||||
replaceButtonClass: function replaceButtonClass(el) {
|
||||
if (this.hasValue()) {
|
||||
jQuery(el).removeClass(this.selectors.uploadBtnClass).addClass(this.selectors.clearBtnClass);
|
||||
} else {
|
||||
jQuery(el).removeClass(this.selectors.clearBtnClass).addClass(this.selectors.uploadBtnClass);
|
||||
}
|
||||
this.setLabels(el);
|
||||
},
|
||||
|
||||
updatePreview: function updatePreview(el) {
|
||||
var self = this,
|
||||
$ul = jQuery(el).parent().find('ul'),
|
||||
$li = jQuery('<li>'),
|
||||
showUrlType = jQuery(el).data('preview_anchor') || 'full';
|
||||
|
||||
$ul.html('');
|
||||
|
||||
if (self.hasValue() && 'none' !== showUrlType) {
|
||||
var anchor = jQuery(self.fileUrl).val();
|
||||
if ('full' !== showUrlType) {
|
||||
anchor = anchor.substring(anchor.lastIndexOf('/') + 1);
|
||||
}
|
||||
|
||||
$li.html('<a href="' + jQuery(self.fileUrl).val() + '" download>' + anchor + '</a>');
|
||||
$ul.append($li);
|
||||
}
|
||||
},
|
||||
|
||||
setup: function setup() {
|
||||
var self = this;
|
||||
jQuery(self.selectors.uploadBtn + ', ' + self.selectors.clearBtn).each(function () {
|
||||
self.setFields(jQuery(this));
|
||||
self.updatePreview(jQuery(this));
|
||||
self.setLabels(jQuery(this));
|
||||
self.replaceButtonClass(jQuery(this));
|
||||
});
|
||||
},
|
||||
|
||||
init: function init() {
|
||||
var self = this;
|
||||
|
||||
jQuery(document).on('click', self.selectors.uploadBtn, function (event) {
|
||||
event.preventDefault();
|
||||
self.setFields(jQuery(this));
|
||||
self.fileFont[0].click();
|
||||
});
|
||||
|
||||
jQuery(document).on('click', self.selectors.clearBtn, function (event) {
|
||||
event.preventDefault();
|
||||
self.setFields(jQuery(this));
|
||||
jQuery(self.fileUrl).val('')
|
||||
.removeAttr('readonly');
|
||||
jQuery(self.fileFont).val('');
|
||||
|
||||
self.updatePreview(jQuery(this));
|
||||
self.replaceButtonClass(jQuery(this));
|
||||
});
|
||||
|
||||
jQuery(document).on('change', '.font_face input[type=file]', function (event) {
|
||||
var el = jQuery(this).next().next(),
|
||||
ext = el.data('ext');
|
||||
|
||||
self.setFields(el);
|
||||
|
||||
if (this.files[0] && this.files[0].name && this.files[0].name.endsWith('.' + ext)) {
|
||||
jQuery(self.fileUrl)
|
||||
.val(this.files[0].name)
|
||||
.attr('readonly', true)
|
||||
;
|
||||
self.replaceButtonClass(el);
|
||||
self.updatePreview(el);
|
||||
} else {
|
||||
jQuery(self.fileFont).val('');
|
||||
}
|
||||
});
|
||||
|
||||
this.setup();
|
||||
|
||||
jQuery(document).on('onRepeaterNewRow', function () {
|
||||
self.setup();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 64:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
module.exports = {
|
||||
selectors: {
|
||||
add: '.add-repeater-row',
|
||||
remove: '.remove-repeater-row',
|
||||
toggle: '.toggle-repeater-row',
|
||||
close: '.close-repeater-row',
|
||||
sort: '.sort-repeater-row',
|
||||
table: '.form-table',
|
||||
block: '.repeater-block',
|
||||
repeaterLabel: '.repeater-title',
|
||||
repeaterField: '.elementor-field-repeater'
|
||||
},
|
||||
|
||||
counters: [],
|
||||
|
||||
trigger: function trigger(eventName, params) {
|
||||
jQuery(document).trigger(eventName, params);
|
||||
},
|
||||
|
||||
triggerHandler: function triggerHandler(eventName, params) {
|
||||
return jQuery(document).triggerHandler(eventName, params);
|
||||
},
|
||||
|
||||
countBlocks: function countBlocks($btn) {
|
||||
return $btn.closest(this.selectors.repeaterField).find(this.selectors.block).length || 0;
|
||||
},
|
||||
|
||||
add: function add(btn) {
|
||||
var self = this,
|
||||
$btn = jQuery(btn),
|
||||
id = $btn.data('template-id'),
|
||||
repeaterBlock;
|
||||
if (!self.counters.hasOwnProperty(id)) {
|
||||
self.counters[id] = self.countBlocks($btn);
|
||||
}
|
||||
repeaterBlock = jQuery('#' + id).html();
|
||||
repeaterBlock = self.replaceAll('__counter__', self.counters[id], repeaterBlock);
|
||||
self.counters[id] += 1;
|
||||
$btn.before(repeaterBlock);
|
||||
self.trigger('onRepeaterNewRow', [$btn, $btn.prev()]);
|
||||
},
|
||||
|
||||
remove: function remove(btn) {
|
||||
var self = this;
|
||||
jQuery(btn).closest(self.selectors.block).remove();
|
||||
},
|
||||
|
||||
toggle: function toggle(btn) {
|
||||
var self = this,
|
||||
$btn = jQuery(btn),
|
||||
$table = $btn.closest(self.selectors.block).find(self.selectors.table),
|
||||
$toggleLabel = $btn.closest(self.selectors.block).find(self.selectors.repeaterLabel);
|
||||
|
||||
$table.toggle();
|
||||
|
||||
if ($table.is(':visible')) {
|
||||
$table.closest(self.selectors.block).addClass('block-visible');
|
||||
self.trigger('onRepeaterToggleVisible', [$btn, $table, $toggleLabel]);
|
||||
} else {
|
||||
$table.closest(self.selectors.block).removeClass('block-visible');
|
||||
self.trigger('onRepeaterToggleHidden', [$btn, $table, $toggleLabel]);
|
||||
}
|
||||
|
||||
$toggleLabel.toggle();
|
||||
|
||||
// Update row label
|
||||
self.updateRowLabel(btn);
|
||||
},
|
||||
|
||||
close: function close(btn) {
|
||||
var self = this,
|
||||
$btn = jQuery(btn),
|
||||
$table = $btn.closest(self.selectors.block).find(self.selectors.table),
|
||||
$toggleLabel = $btn.closest(self.selectors.block).find(self.selectors.repeaterLabel);
|
||||
|
||||
$table.closest(self.selectors.block).removeClass('block-visible');
|
||||
$table.hide();
|
||||
self.trigger('onRepeaterToggleHidden', [$btn, $table, $toggleLabel]);
|
||||
$toggleLabel.show();
|
||||
self.updateRowLabel(btn);
|
||||
},
|
||||
|
||||
updateRowLabel: function updateRowLabel(btn) {
|
||||
var self = this,
|
||||
$btn = jQuery(btn),
|
||||
$table = $btn.closest(self.selectors.block).find(self.selectors.table),
|
||||
$toggleLabel = $btn.closest(self.selectors.block).find(self.selectors.repeaterLabel);
|
||||
|
||||
var selector = $toggleLabel.data('selector');
|
||||
// For some browsers, `attr` is undefined; for others, `attr` is false. Check for both.
|
||||
if ((typeof selector === 'undefined' ? 'undefined' : _typeof(selector)) !== ( true ? 'undefined' : undefined) && false !== selector) {
|
||||
var value = false,
|
||||
std = $toggleLabel.data('default');
|
||||
|
||||
if ($table.find(selector).length) {
|
||||
value = $table.find(selector).val();
|
||||
}
|
||||
|
||||
//filter hook
|
||||
var computedLabel = self.triggerHandler('repeaterComputedLabel', [$table, $toggleLabel, value]);
|
||||
|
||||
// For some browsers, `attr` is undefined; for others, `attr` is false. Check for both.
|
||||
if (undefined !== computedLabel && false !== computedLabel) {
|
||||
value = computedLabel;
|
||||
}
|
||||
|
||||
// Fallback to default row label
|
||||
if (undefined === value || false === value) {
|
||||
value = std;
|
||||
}
|
||||
|
||||
$toggleLabel.html(value);
|
||||
}
|
||||
},
|
||||
|
||||
replaceAll: function replaceAll(search, replace, string) {
|
||||
return string.replace(new RegExp(search, 'g'), replace);
|
||||
},
|
||||
|
||||
init: function init() {
|
||||
var self = this;
|
||||
jQuery(document).on('click', this.selectors.add, function (event) {
|
||||
event.preventDefault();
|
||||
self.add(jQuery(this), event);
|
||||
}).on('click', this.selectors.remove, function (event) {
|
||||
event.preventDefault();
|
||||
var result = confirm(jQuery(this).data('confirm').toString());
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
self.remove(jQuery(this), event);
|
||||
}).on('click', this.selectors.toggle, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
self.toggle(jQuery(this), event);
|
||||
}).on('click', this.selectors.close, function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
self.close(jQuery(this), event);
|
||||
});
|
||||
|
||||
jQuery(this.selectors.toggle).each(function () {
|
||||
self.updateRowLabel(jQuery(this));
|
||||
});
|
||||
|
||||
this.trigger('onRepeaterLoaded', [this]);
|
||||
}
|
||||
};
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
661
modules/creativeelements/views/js/editor-ce.js
Normal file
661
modules/creativeelements/views/js/editor-ce.js
Normal file
@@ -0,0 +1,661 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com
|
||||
*/
|
||||
|
||||
$(window).on('elementor:init', function onElementorInit() {
|
||||
if ('product-miniature' === elementor.config.document.type) {
|
||||
var pageModel = elementor.settings.page.model;
|
||||
|
||||
$('#elementor-preview-responsive-wrapper').css({
|
||||
height: '100%',
|
||||
margin: '0 auto',
|
||||
padding: 0,
|
||||
transitionDuration: '0s',
|
||||
});
|
||||
elementor.on('preview:loaded', function () {
|
||||
var minWidth = pageModel.getControl('preview_width').min,
|
||||
controlView;
|
||||
$(elementor.$previewContents[0].body).css({
|
||||
width: pageModel.get('preview_width'),
|
||||
minWidth: minWidth,
|
||||
}).resizable({
|
||||
handles: 'e, w',
|
||||
start: function () {
|
||||
var pageView = elementor.getPanelView().getCurrentPageView(),
|
||||
device = ceFrontend.getCurrentDeviceMode();
|
||||
controlView = 'preview_settings' !== pageView.activeSection ? null : pageView.getControlViewByName(
|
||||
'desktop' === device ? 'preview_width' : 'preview_width_' + device
|
||||
);
|
||||
elementor.$previewContents[0].documentElement.style.cursor = 'ew-resize';
|
||||
},
|
||||
resize: function (e, ui) {
|
||||
var device = ceFrontend.getCurrentDeviceMode(),
|
||||
width = 2 * (ui.size.width - ui.originalSize.width) + ui.originalSize.width;
|
||||
if (width < minWidth) {
|
||||
width = minWidth;
|
||||
}
|
||||
this.style.width = width + 'px';
|
||||
this.style.left = '';
|
||||
this.style.right = '';
|
||||
|
||||
pageModel.set('desktop' === device ? 'preview_width' : 'preview_width_' + device, width);
|
||||
|
||||
controlView && controlView.render();
|
||||
},
|
||||
stop: function () {
|
||||
elementor.$previewContents[0].documentElement.style.cursor = '';
|
||||
elementor.$previewContents.children().on('click.ce-resize', function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
setTimeout(function () {
|
||||
elementor.$previewContents.children().off('click.ce-resize');
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
elementor.settings.page.model.on('change', function onChangePreviewWidth() {
|
||||
var device = ceFrontend.getCurrentDeviceMode(),
|
||||
preview_width = 'desktop' === device ? 'preview_width' : 'preview_width_' + device;
|
||||
if (preview_width in this.changed) {
|
||||
elementor.$previewContents[0].body.style.width = this.changed[preview_width] + 'px';
|
||||
}
|
||||
});
|
||||
elementor.channels.deviceMode.on('change', function onChangeDeviceMode() {
|
||||
var width = ceFrontend.getCurrentDeviceSetting(pageModel.attributes, 'preview_width');
|
||||
|
||||
elementor.$previewContents[0].body.style.width = width + 'px';
|
||||
});
|
||||
}
|
||||
|
||||
elementor.channels.editor.on('section:activated', function onSectionActivated(sectionName, editor) {
|
||||
var editedElement = editor.getOption('editedElementView'),
|
||||
widgetType = editedElement.model.get('widgetType');
|
||||
|
||||
if ('flip-box' === widgetType) {
|
||||
// init flip box back
|
||||
var isSideB = ['section_b', 'section_style_b', 'section_style_button'].indexOf(sectionName) > -1,
|
||||
$backLayer = editedElement.$el.find('.elementor-flip-box-back');
|
||||
|
||||
editedElement.$el.toggleClass('elementor-flip-box--flipped', isSideB);
|
||||
|
||||
if (isSideB) {
|
||||
$backLayer.css('transition', 'none');
|
||||
} else {
|
||||
setTimeout(function () {
|
||||
$backLayer.css('transition', '');
|
||||
}, 10);
|
||||
}
|
||||
} else if ('ajax-search' === widgetType) {
|
||||
// init search results
|
||||
editedElement.$el.find('.elementor-search__products').css({
|
||||
display: ['section_results_style', 'section_products_style'].indexOf(sectionName) < 0 ? 'none' : ''
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
var tabNumber = '<span class="ce-tab-num"></span>';
|
||||
// Refresh Tabbed Section
|
||||
elementor.hooks.addAction('panel/open_editor/column', function (panel, model, column) {
|
||||
if (column._parent.model.get('settings').get('tabs')) {
|
||||
var index = column.$el.index(),
|
||||
$items = column.$el.parent().prev().find('a');
|
||||
|
||||
ceFrontend.elements.window.jQuery($items[index]).click();
|
||||
|
||||
elementor.$previewContents[0].activeElement && elementor.$previewContents[0].activeElement.blur();
|
||||
}
|
||||
});
|
||||
function addTabbedColumn(event, attributes) {
|
||||
var $column = elementor.$previewElementorEl.find('[data-id=' + attributes.id + ']'),
|
||||
$litems = $column.parent().prev().find('li'),
|
||||
index = $column.index(),
|
||||
settings = attributes.settings || attributes,
|
||||
isNew = $.isEmptyObject(settings);
|
||||
|
||||
isNew || 'history:after:add' === event ? index-- : $litems.find('a').removeClass('elementor-item-active');
|
||||
|
||||
var $a = $litems.eq(0).clone().insertAfter($litems[index])
|
||||
.find('a').html(settings._title || tabNumber);
|
||||
|
||||
isNew || 'history:after:add' === event ? $a.removeClass('elementor-item-active').click() : $a.addClass('elementor-item-active');
|
||||
}
|
||||
elementor.channels.data.on('element:after:add', function (model) {
|
||||
if (!model) return;
|
||||
|
||||
var attributes = model.attributes || model;
|
||||
|
||||
'column' === attributes.elType && addTabbedColumn('element:after:add', attributes);
|
||||
});
|
||||
elementor.channels.data.on('history:after:add', function (model) {
|
||||
if (!model) return;
|
||||
|
||||
var attributes = model.attributes || model;
|
||||
|
||||
'column' === attributes.elType && addTabbedColumn('history:after:add', attributes);
|
||||
});
|
||||
elementor.channels.data.on('element:before:remove history:before:remove', function (model) {
|
||||
var attributes = model.attributes || model;
|
||||
|
||||
if ('column' === attributes.elType) {
|
||||
var $column = elementor.$previewElementorEl.find('[data-id=' + attributes.id + ']');
|
||||
$items = $column.parent().prev().find('a');
|
||||
|
||||
$items.eq($column.index()).parent().remove();
|
||||
$items.eq(0).click();
|
||||
}
|
||||
});
|
||||
// Sort Tabs
|
||||
elementor.channels.data.on('drag:after:update', function (model) {
|
||||
var attributes = model.attributes || model;
|
||||
|
||||
if ('column' === attributes.elType) {
|
||||
var view = elementor.channels.data.request('dragging:parent:view');
|
||||
if (view.model.get('settings').get('tabs')) {
|
||||
var columns = view.model.get('elements').models;
|
||||
|
||||
view.$el.find('> .elementor-container > .elementor-nav-tabs a').each(function (i) {
|
||||
$(this).html(columns[i].get('settings').get('_title') || tabNumber);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// Change Tab Title
|
||||
elementor.channels.editor.on('change:column:_title', function (control, column) {
|
||||
var index = column.$el.index();
|
||||
|
||||
column.$el.parent().prev().find('a').eq(index).html(
|
||||
control.options.elementSettingsModel.get('_title') || tabNumber
|
||||
);
|
||||
});
|
||||
elementor.channels.data.on('history:after:change', function (model, changed, isRedo) {
|
||||
var attributes = model.attributes || model;
|
||||
|
||||
if ('column' === attributes.elType && changed._title) {
|
||||
var $column = elementor.$previewElementorEl.find('[data-id=' + attributes.id + ']');
|
||||
$items = $column.parent().prev().find('a'),
|
||||
index = $column.index();
|
||||
|
||||
$items.eq(index).html(changed._title[isRedo ? 'new' : 'old'] || tabNumber);
|
||||
}
|
||||
});
|
||||
elementor.channels.editor.on('enter:column:_title', function (model) {
|
||||
var $column = elementor.$previewElementorEl.find('.elementor-element-editable'),
|
||||
$items = $column.parent().prev().find('a'),
|
||||
index = $column.index();
|
||||
|
||||
$items.eq(index).html(model.get('_title') || '<span class="ce-tab-num"></span>');
|
||||
$('.elementor-control-_title input[data-setting="_title"]').val(model.get('_title'));
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {elementor.on('preview:loaded', function () {
|
||||
// init widgets
|
||||
ceFrontend.hooks.addAction('frontend/element_ready/widget', function ($widget, $) {
|
||||
// remote render fix
|
||||
if ($widget.find('.ce-remote-render').length) {
|
||||
var render = elementor.helpers.renderWidgets,
|
||||
widget = elementor.helpers.getModelById('' + $widget.data('id')),
|
||||
data = widget.toJSON();
|
||||
|
||||
if (Date.now() - render.timestamp > render.delay) {
|
||||
render.actions = {};
|
||||
}
|
||||
render.actions['render_' + data.id] = {
|
||||
action: 'render_' + data.id,
|
||||
data: data
|
||||
};
|
||||
clearTimeout(render.timeout);
|
||||
render.timeout = setTimeout(function() {
|
||||
render.xhr = $.post(elementor.config.document.urls.preview, {
|
||||
render: 'widget',
|
||||
editor_post_id: elementor.config.document.id,
|
||||
actions: JSON.stringify(render.actions),
|
||||
}, null, 'json').always(function (arg, status) {
|
||||
var data = 'success' === status ? arg : arg.responseJSON || {};
|
||||
for (var action in data) {
|
||||
elementor.helpers.getModelById(action.split('_')[1]).onRemoteGetHtml(data);
|
||||
}
|
||||
});
|
||||
}, render.delay);
|
||||
render.timestamp = Date.now();
|
||||
}
|
||||
});
|
||||
// Auto open Library for Theme Builder
|
||||
if (elementor.config.post_id.substr(-6, 2) == 17 && !elementor.config.data.length) {
|
||||
elementor.templates.startModal()
|
||||
}
|
||||
// Theme Builder
|
||||
elementor.channels.editor.on('elementorThemeBuilder:ApplyPreview', function saveAndReload() {
|
||||
elementor.saver.saveAutoSave({
|
||||
onSuccess: function onSuccess() {
|
||||
elementor.saver.setFlagEditorChange(false);
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
// Play entrance animations for tabs in editor
|
||||
elementor.$previewElementorEl.on('mouseup.ce', '.elementor-nav-tabs a', function () {
|
||||
if (~this.className.indexOf('elementor-item-active')) {
|
||||
return;
|
||||
}
|
||||
var index = $(this.parentNode).index(),
|
||||
$col = $(this).closest('.elementor-container').find('> .elementor-row > .elementor-column').eq(index),
|
||||
$animated = $col.find('.animated').addBack('.animated');
|
||||
|
||||
$animated.each(function () {
|
||||
var id = $(this).data('id'),
|
||||
settings = elementor.helpers.getModelById(id).get('settings').attributes;
|
||||
$(this).removeClass(settings.animation || settings._animation);
|
||||
});
|
||||
$animated.length && setTimeout(function() {
|
||||
$animated.each(function () {
|
||||
var id = $(this).data('id'),
|
||||
settings = elementor.helpers.getModelById(id).get('settings').attributes;
|
||||
$(this).addClass(settings.animation || settings._animation);
|
||||
});
|
||||
});
|
||||
});
|
||||
})});
|
||||
|
||||
$(function onReady() {
|
||||
// init page custom CSS
|
||||
var addPageCustomCss = function() {
|
||||
var customCSS = elementor.settings.page.model.get('custom_css');
|
||||
|
||||
if (customCSS) {
|
||||
customCSS = customCSS.replace(/selector/g, elementor.config.settings.page.cssWrapperSelector);
|
||||
|
||||
elementor.settings.page.getControlsCSS().elements.$stylesheetElement.append(customCSS);
|
||||
}
|
||||
};
|
||||
elementor.on('preview:loaded', addPageCustomCss);
|
||||
elementor.settings.page.model.on('change', function () {
|
||||
if ('custom_css' in this.changed) {
|
||||
addPageCustomCss();
|
||||
}
|
||||
});
|
||||
|
||||
// init element custom CSS
|
||||
elementor.hooks.addFilter('editor/style/styleText', function addCustomCss(css, view) {
|
||||
var model = view.getEditModel(),
|
||||
customCSS = model.get('settings').get('custom_css');
|
||||
|
||||
if (customCSS) {
|
||||
css += customCSS.replace(/selector/g, '.elementor-element.elementor-element-' + view.model.id);
|
||||
}
|
||||
|
||||
return css;
|
||||
});
|
||||
|
||||
// init Products Cache
|
||||
elementor.productsCache = {};
|
||||
elementor.getProductName = function (id) {
|
||||
return this.productsCache[id] ? this.productsCache[id].name : '';
|
||||
};
|
||||
elementor.getProductImage = function (id) {
|
||||
return this.productsCache[id] ? this.productsCache[id].image : '';
|
||||
};
|
||||
|
||||
// init File Manager
|
||||
elementor.fileManager = elementor.dialogsManager.createWidget('lightbox', {
|
||||
id: 'ce-file-manager-modal',
|
||||
closeButton: true,
|
||||
headerMessage: window.tinyMCE ? tinyMCE.i18n.translate('File manager') : 'File manager',
|
||||
|
||||
onReady: function() {
|
||||
var $message = this.getElements('message').html(
|
||||
'<iframe id="ce-file-manager" width="100%" height="750"></iframe>'
|
||||
);
|
||||
this.iframe = $message.children()[0];
|
||||
this.url = baseAdminDir + 'filemanager/dialog.php?type=1&field_id=3';
|
||||
|
||||
this.open = function(fieldId) {
|
||||
this.fieldId = fieldId;
|
||||
|
||||
if (this.iframe.contentWindow) {
|
||||
this.initFrame();
|
||||
this.getElements('widget').appendTo = function() {
|
||||
return this;
|
||||
};
|
||||
this.show();
|
||||
} else {
|
||||
$message.prepend(
|
||||
$('#tmpl-elementor-template-library-loading').html()
|
||||
);
|
||||
this.iframe.src = this.url + '&fldr=' + (localStorage.ceImgFldr || '');
|
||||
this.show(0);
|
||||
}
|
||||
};
|
||||
this.initFrame = function() {
|
||||
var $doc = $(this.iframe).contents();
|
||||
|
||||
localStorage.ceImgFldr = $doc.find('#fldr_value').val();
|
||||
|
||||
$doc.find('a.link').attr('data-field_id', this.fieldId);
|
||||
|
||||
this.iframe.contentWindow.close_window = this.hide.bind(this);
|
||||
|
||||
// WEBP
|
||||
$doc.find('li[data-name$=".webp"], li[data-name$=".WEBP"]').each(function () {
|
||||
$(this).find('.img-container img').attr({
|
||||
src: $(this).find('a.preview').data('url'),
|
||||
}).css({
|
||||
height: '100%',
|
||||
objectFit: 'cover',
|
||||
});
|
||||
$(this).find('.filetype').css('background', 'rgba(0,0,0,0.2)');
|
||||
$(this).find('.cover').remove();
|
||||
|
||||
var $form = $(this).find('.download-form').attr('onsubmit', 'event.preventDefault()');
|
||||
$form.find('a[onclick*=submit]').attr({
|
||||
href: $form.find('.preview').data('url'),
|
||||
download: $form[0].elements.name.value,
|
||||
});
|
||||
$form.find('.rename-file, .delete-file').attr('data-path', '');
|
||||
});
|
||||
};
|
||||
this.iframe.onload = this.initFrame.bind(this);
|
||||
},
|
||||
|
||||
onHide: function() {
|
||||
var $input = $('#' + this.fieldId);
|
||||
|
||||
$input.val(
|
||||
$input.val().replace(location.origin, '')
|
||||
).trigger('input');
|
||||
},
|
||||
});
|
||||
|
||||
// helper for get model by id
|
||||
elementor.helpers.getModelById = function(id, models) {
|
||||
models = models || elementor.elements.models;
|
||||
|
||||
for (var i = models.length; i--;) {
|
||||
if (models[i].id === id) {
|
||||
return models[i];
|
||||
}
|
||||
if (models[i].attributes.elements.models.length) {
|
||||
var model = this.getModelById(id, models[i].attributes.elements.models);
|
||||
|
||||
if (model) {
|
||||
return model;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
elementor.helpers.renderWidgets = {
|
||||
delay: 100,
|
||||
timestamp: 0,
|
||||
timeout: null,
|
||||
actions: {},
|
||||
};
|
||||
|
||||
elementor.helpers.getParentSectionModel = function(id, sections) {
|
||||
sections = sections || elementor.elements.models;
|
||||
|
||||
for (var i = sections.length; i--;) {
|
||||
if ('section' !== sections[i].attributes.elType) {
|
||||
continue;
|
||||
}
|
||||
var sectionModel = sections[i].attributes.settings;
|
||||
|
||||
if (sections[i].attributes.elements.models.length) {
|
||||
var columns = sections[i].attributes.elements.models;
|
||||
|
||||
for (var j = columns.length; j--;) {
|
||||
if (columns[j].id === id) {
|
||||
return sectionModel;
|
||||
}
|
||||
if (columns[j].attributes.settings.cid === id) {
|
||||
return sectionModel;
|
||||
}
|
||||
if (columns[j].attributes.elements.models.length) {
|
||||
var result = this.getParentSectionModel(id, columns[j].attributes.elements.models);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// fix: add home_url to relative image path
|
||||
elementor.imagesManager.getImageUrl = function(image) {
|
||||
var url = image.url;
|
||||
|
||||
if (url && url.indexOf('://') < 0) {
|
||||
url = elementor.config.home_url + url;
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
elementor.on('preview:loaded', function onPreviewLoaded() {
|
||||
// fix for View Page in force edit mode
|
||||
var href = elementor.$preview[0].contentWindow.location.href;
|
||||
|
||||
if (~href.indexOf('&force=1&')) {
|
||||
elementor.config.post_permalink = href.replace(/&force=1&.*/, '');
|
||||
}
|
||||
|
||||
// scroll to content area
|
||||
var contentTop = elementor.$previewContents.find('#elementor .elementor-section-wrap').offset().top;
|
||||
if (contentTop > $(window).height() * 0.66) {
|
||||
elementor.$previewContents.find('html, body').animate({
|
||||
scrollTop: contentTop - 30
|
||||
}, 400);
|
||||
}
|
||||
|
||||
// fix for multiple Global colors / fonts
|
||||
elementor.$previewContents.find('#elementor-global-css, link[href*="css/ce/global-"]').remove();
|
||||
|
||||
// init Edit with CE buttons
|
||||
elementor.$previewContents.find('.ce-edit-btn').on('click.ce', function() {
|
||||
location.href = this.href;
|
||||
});
|
||||
|
||||
// init Read More link
|
||||
elementor.$previewContents.find('.ce-read-more').on('click.ce', function() {
|
||||
window.open(this.href);
|
||||
});
|
||||
|
||||
// fix for redirecting preview
|
||||
elementor.$previewContents.find('a[href]').on('click.ce', function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(window).on('load.ce', function onLoadWindow() {
|
||||
// init language switcher
|
||||
var $context = $('#ce-context'),
|
||||
$langs = $('#ce-langs'),
|
||||
$languages = $langs.children().remove(),
|
||||
built = $langs.data('built'),
|
||||
lang = $langs.data('lang');
|
||||
|
||||
elementor.shopContext = $context.length
|
||||
? $context.val()
|
||||
: 's-' + parseInt(elementor.config.post_id.slice(-2))
|
||||
;
|
||||
if ('s' !== elementor.shopContext[0]) {
|
||||
var showToast = elementor.notifications.showToast.bind(elementor.notifications, {
|
||||
message: elementor.translate('multistore_notification'),
|
||||
buttons: [{
|
||||
name: 'view_languages',
|
||||
text: $context.find(':selected').html().split('★')[0],
|
||||
callback: function callback() {
|
||||
$('#elementor-panel-footer-lang').click();
|
||||
}
|
||||
}]
|
||||
}),
|
||||
toast = elementor.notifications.getToast();
|
||||
if (toast.isVisible()) {
|
||||
toast.on('hide', function onHideToast() {
|
||||
toast.off('hide', onHideToast);
|
||||
setTimeout(showToast, 350);
|
||||
});
|
||||
} else {
|
||||
showToast();
|
||||
}
|
||||
}
|
||||
elementor.helpers.filterLangs = function() {
|
||||
var ctx = $context.length ? $context.val() : elementor.shopContext,
|
||||
id_group = 'g' === ctx[0] ? parseInt(ctx.substr(2)) : 0,
|
||||
id_shop = 's' === ctx[0] ? parseInt(ctx.substr(2)) : 0,
|
||||
dirty = elementor.shopContext != ctx;
|
||||
|
||||
$langs.empty();
|
||||
|
||||
var id_shops = id_group ? $context.find(':selected').nextUntil('[value^=g]').map(function() {
|
||||
return parseInt(this.value.substr(2));
|
||||
}).get() : [id_shop];
|
||||
|
||||
$languages.each(function() {
|
||||
if (!ctx || $(this).data('shops').filter(function(id) { return ~id_shops.indexOf(id) }).length) {
|
||||
var $lang = $(this).clone().appendTo($langs),
|
||||
id_lang = $lang.data('lang'),
|
||||
active = !dirty && lang == id_lang;
|
||||
|
||||
var uid = elementor.config.post_id.replace(/\d\d(\d\d)$/, function(m, shop) {
|
||||
return ('0' + id_lang).slice(-2) + ('0' + id_shop).slice(-2);
|
||||
});
|
||||
$lang.attr('data-uid', uid).data('uid', uid);
|
||||
|
||||
active && $lang.addClass('active');
|
||||
|
||||
if (active || !id_shop || !built[id_shop] || !built[id_shop][id_lang]) {
|
||||
$lang.find('.elementor-button').remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
elementor.helpers.filterLangs();
|
||||
$context.on('click.ce-ctx', function onClickContext(e) {
|
||||
// prevent closing languages
|
||||
e.stopPropagation();
|
||||
}).on('change.ce-ctx', elementor.helpers.filterLangs);
|
||||
|
||||
$langs.on('click.ce-lang', '.ce-lang', function onChangeLanguage() {
|
||||
var uid = $(this).data('uid'),
|
||||
href = location.href.replace(/uid=\d+/, 'uid=' + uid);
|
||||
|
||||
if ($context.length && $context.val() != elementor.shopContext) {
|
||||
document.context.action = href;
|
||||
document.context.submit();
|
||||
} else if (uid != elementor.config.post_id) {
|
||||
location = href;
|
||||
}
|
||||
}).on('click.ce-lang-get', '.elementor-button', function onGetLanguageContent(e) {
|
||||
e.stopImmediatePropagation();
|
||||
var $icon = $('i', this);
|
||||
|
||||
if ($icon.hasClass('fa-spin')) {
|
||||
return;
|
||||
}
|
||||
$icon.attr('class', 'fa fa-spin fa-circle-o-notch');
|
||||
|
||||
elementorCommon.ajax.addRequest('get_language_content', {
|
||||
data: {
|
||||
uid: $(this).closest('[data-uid]').data('uid')
|
||||
},
|
||||
success: function(data) {
|
||||
$icon.attr('class', 'eicon-file-download');
|
||||
|
||||
elementor.getRegion('sections').currentView.addChildModel(data);
|
||||
},
|
||||
error: function(data) {
|
||||
elementor.templates.showErrorDialog(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// handle permission errors for AJAX requests
|
||||
$(document).ajaxSuccess(function onAjaxSuccess(e, xhr, conf, res) {
|
||||
if (false === res.success && res.data && res.data.permission) {
|
||||
NProgress.done();
|
||||
$('.elementor-button-state').removeClass('elementor-button-state');
|
||||
|
||||
try {
|
||||
elementor.templates.showTemplates();
|
||||
} catch (ex) {}
|
||||
|
||||
elementor.templates.getErrorDialog()
|
||||
.setMessage('<center>' + res.data.permission + '</center>')
|
||||
.show()
|
||||
;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// init layerslider widget
|
||||
$('#elementor-panel').on('change.ls', '.ls-selector select', function onChangeSlider() {
|
||||
var $ = elementor.$previewContents[0].defaultView.jQuery;
|
||||
|
||||
$('.elementor-element-' + elementor.panel.currentView.content.currentView.model.id)
|
||||
.addClass('elementor-widget-empty')
|
||||
.append('<i class="elementor-widget-empty-icon eicon-insert-image">')
|
||||
.find('.ls-container').layerSlider('destroy').remove()
|
||||
;
|
||||
}).on('click.ls-new', '.elementor-control-ls-new button', function addSlider(e) {
|
||||
var title = prompt(ls.NameYourSlider);
|
||||
|
||||
null === title || $.post(ls.url, {
|
||||
'ls-add-new-slider': 1,
|
||||
'title': title
|
||||
}, function onSuccessNewSlider(data) {
|
||||
var id = (data.match(/name="slider_id" value="(\d+)"/) || []).pop();
|
||||
if (id) {
|
||||
var option = '#' + id + ' - ' + title;
|
||||
elementor.config.widgets['ps-widget-LayerSlider'].controls.slider.options[id] = option;
|
||||
$('.ls-selector select')
|
||||
.append('<option value="' + id + '">' + option + '</option>')
|
||||
.val(id)
|
||||
.change()
|
||||
;
|
||||
$('.elementor-control-ls-edit button').trigger('click.ls-edit');
|
||||
}
|
||||
});
|
||||
}).on('click.ls-edit', '.elementor-control-ls-edit button', function editSlider(e) {
|
||||
var lsUpdate,
|
||||
lsId = $('.ls-selector select').val();
|
||||
|
||||
$.fancybox({
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
padding: 0,
|
||||
href: ls.url + '&action=edit&id=' + lsId,
|
||||
type: 'iframe',
|
||||
afterLoad: function onAfterLoadSlider() {
|
||||
var win = $('.fancybox-iframe').contents()[0].defaultView;
|
||||
|
||||
win.jQuery(win.document).ajaxSuccess(function(e, xhr, args, res) {
|
||||
if (args.data && args.data.indexOf('action=ls_save_slider') === 0 && '{"status":"ok"}' === res) {
|
||||
lsUpdate = true;
|
||||
}
|
||||
});
|
||||
$(win.document.head).append('<style>\
|
||||
#header, #nav-sidebar, .add-new-h2, .ls-save-shortcode { display: none; }\
|
||||
#main { padding-top: 0; }\
|
||||
#main #content { margin-left: 0; }\
|
||||
</style>');
|
||||
},
|
||||
beforeClose: function onBeforeCloseSlider() {
|
||||
var win = $('.fancybox-iframe').contents()[0].defaultView,
|
||||
close = win.LS_editorIsDirty ? confirm(ls.ChangesYouMadeMayNotBeSaved) : true;
|
||||
|
||||
if (close && win.LS_editorIsDirty) {
|
||||
win.LS_editorIsDirty = false;
|
||||
}
|
||||
return close;
|
||||
},
|
||||
afterClose: function onAfterCloseSlider() {
|
||||
lsUpdate && $('.ls-selector select')
|
||||
.val(0).change()
|
||||
.val(lsId).change()
|
||||
;
|
||||
}
|
||||
});
|
||||
});
|
||||
949
modules/creativeelements/views/js/editor-modules.js
Normal file
949
modules/creativeelements/views/js/editor-modules.js
Normal file
@@ -0,0 +1,949 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com & Elementor.com
|
||||
*/
|
||||
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 204);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 12:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var InnerTabsBehavior;
|
||||
|
||||
InnerTabsBehavior = Marionette.Behavior.extend({
|
||||
|
||||
onRenderCollection: function onRenderCollection() {
|
||||
this.handleInnerTabs(this.view);
|
||||
},
|
||||
|
||||
handleInnerTabs: function handleInnerTabs(parent) {
|
||||
var closedClass = 'elementor-tab-close',
|
||||
activeClass = 'elementor-tab-active',
|
||||
tabsWrappers = parent.children.filter(function (view) {
|
||||
return 'tabs' === view.model.get('type');
|
||||
});
|
||||
|
||||
_.each(tabsWrappers, function (view) {
|
||||
view.$el.find('.elementor-control-content').remove();
|
||||
|
||||
var tabsId = view.model.get('name'),
|
||||
tabs = parent.children.filter(function (childView) {
|
||||
return 'tab' === childView.model.get('type') && childView.model.get('tabs_wrapper') === tabsId;
|
||||
});
|
||||
|
||||
_.each(tabs, function (childView, index) {
|
||||
view._addChildView(childView);
|
||||
|
||||
var tabId = childView.model.get('name'),
|
||||
controlsUnderTab = parent.children.filter(function (controlView) {
|
||||
return tabId === controlView.model.get('inner_tab');
|
||||
});
|
||||
|
||||
if (0 === index) {
|
||||
childView.$el.addClass(activeClass);
|
||||
} else {
|
||||
_.each(controlsUnderTab, function (controlView) {
|
||||
controlView.$el.addClass(closedClass);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onChildviewControlTabClicked: function onChildviewControlTabClicked(childView) {
|
||||
var closedClass = 'elementor-tab-close',
|
||||
activeClass = 'elementor-tab-active',
|
||||
tabClicked = childView.model.get('name'),
|
||||
childrenUnderTab = this.view.children.filter(function (view) {
|
||||
return 'tab' !== view.model.get('type') && childView.model.get('tabs_wrapper') === view.model.get('tabs_wrapper');
|
||||
}),
|
||||
siblingTabs = this.view.children.filter(function (view) {
|
||||
return 'tab' === view.model.get('type') && childView.model.get('tabs_wrapper') === view.model.get('tabs_wrapper');
|
||||
});
|
||||
|
||||
_.each(siblingTabs, function (view) {
|
||||
view.$el.removeClass(activeClass);
|
||||
});
|
||||
|
||||
childView.$el.addClass(activeClass);
|
||||
|
||||
_.each(childrenUnderTab, function (view) {
|
||||
if (view.model.get('inner_tab') === tabClicked) {
|
||||
view.$el.removeClass(closedClass);
|
||||
} else {
|
||||
view.$el.addClass(closedClass);
|
||||
}
|
||||
});
|
||||
|
||||
elementor.getPanelView().updateScrollbar();
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = InnerTabsBehavior;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 204:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _module = __webpack_require__(205);
|
||||
|
||||
var _module2 = _interopRequireDefault(_module);
|
||||
|
||||
var _introduction = __webpack_require__(206);
|
||||
|
||||
var _introduction2 = _interopRequireDefault(_introduction);
|
||||
|
||||
var _controlsStack = __webpack_require__(207);
|
||||
|
||||
var _controlsStack2 = _interopRequireDefault(_controlsStack);
|
||||
|
||||
var _baseSettings = __webpack_require__(208);
|
||||
|
||||
var _baseSettings2 = _interopRequireDefault(_baseSettings);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
elementorModules.editor = {
|
||||
elements: {
|
||||
models: {
|
||||
BaseSettings: _baseSettings2.default
|
||||
}
|
||||
},
|
||||
utils: {
|
||||
Module: _module2.default,
|
||||
Introduction: _introduction2.default
|
||||
},
|
||||
views: {
|
||||
ControlsStack: _controlsStack2.default
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 205:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var EditorModule = elementorModules.Module.extend({
|
||||
|
||||
onInit: function onInit() {
|
||||
jQuery(window).on('elementor:init', this.onElementorReady);
|
||||
},
|
||||
|
||||
getEditorControlView: function getEditorControlView(name) {
|
||||
var editor = elementor.getPanelView().getCurrentPageView();
|
||||
|
||||
return editor.children.findByModelCid(this.getEditorControlModel(name).cid);
|
||||
},
|
||||
|
||||
getEditorControlModel: function getEditorControlModel(name) {
|
||||
var editor = elementor.getPanelView().getCurrentPageView();
|
||||
|
||||
return editor.collection.findWhere({ name: name });
|
||||
},
|
||||
|
||||
onElementorReady: function onElementorReady() {
|
||||
this.onElementorInit();
|
||||
|
||||
elementor.on('frontend:init', this.onElementorFrontendInit.bind(this)).on('preview:loaded', this.onElementorPreviewLoaded.bind(this));
|
||||
}
|
||||
});
|
||||
|
||||
EditorModule.prototype.onElementorInit = function () {};
|
||||
|
||||
EditorModule.prototype.onElementorPreviewLoaded = function () {};
|
||||
|
||||
EditorModule.prototype.onElementorFrontendInit = function () {};
|
||||
|
||||
module.exports = EditorModule;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 206:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_elementorModules$Mod) {
|
||||
_inherits(_class, _elementorModules$Mod);
|
||||
|
||||
function _class() {
|
||||
var _ref;
|
||||
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
|
||||
var _this = _possibleConstructorReturn(this, (_ref = _class.__proto__ || Object.getPrototypeOf(_class)).call.apply(_ref, [this].concat(args)));
|
||||
|
||||
_this.initDialog();
|
||||
return _this;
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'getDefaultSettings',
|
||||
value: function getDefaultSettings() {
|
||||
return {
|
||||
dialogType: 'buttons',
|
||||
dialogOptions: {
|
||||
effects: {
|
||||
hide: 'hide',
|
||||
show: 'show'
|
||||
},
|
||||
hide: {
|
||||
onBackgroundClick: false
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'initDialog',
|
||||
value: function initDialog() {
|
||||
var _this2 = this;
|
||||
|
||||
var dialog = void 0;
|
||||
|
||||
this.getDialog = function () {
|
||||
if (!dialog) {
|
||||
var settings = _this2.getSettings();
|
||||
|
||||
dialog = elementorCommon.dialogsManager.createWidget(settings.dialogType, settings.dialogOptions);
|
||||
|
||||
if (settings.onDialogInitCallback) {
|
||||
settings.onDialogInitCallback.call(_this2, dialog);
|
||||
}
|
||||
}
|
||||
|
||||
return dialog;
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'show',
|
||||
value: function show(target) {
|
||||
if (this.introductionViewed) {
|
||||
return;
|
||||
}
|
||||
|
||||
var dialog = this.getDialog();
|
||||
|
||||
if (target) {
|
||||
dialog.setSettings('position', {
|
||||
of: target
|
||||
});
|
||||
}
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
}, {
|
||||
key: 'setViewed',
|
||||
value: function setViewed() {
|
||||
this.introductionViewed = true;
|
||||
|
||||
elementorCommon.ajax.addRequest('introduction_viewed', {
|
||||
data: {
|
||||
introductionKey: this.getSettings('introductionKey')
|
||||
}
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(elementorModules.Module);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 207:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var ControlsStack;
|
||||
|
||||
ControlsStack = Marionette.CompositeView.extend({
|
||||
classes: {
|
||||
popover: 'elementor-controls-popover'
|
||||
},
|
||||
|
||||
activeTab: null,
|
||||
|
||||
activeSection: null,
|
||||
|
||||
className: function className() {
|
||||
return 'elementor-controls-stack';
|
||||
},
|
||||
|
||||
templateHelpers: function templateHelpers() {
|
||||
return {
|
||||
elementData: elementor.getElementData(this.model)
|
||||
};
|
||||
},
|
||||
|
||||
childViewOptions: function childViewOptions() {
|
||||
return {
|
||||
elementSettingsModel: this.model
|
||||
};
|
||||
},
|
||||
|
||||
ui: function ui() {
|
||||
return {
|
||||
tabs: '.elementor-panel-navigation-tab',
|
||||
reloadButton: '.elementor-update-preview-button'
|
||||
};
|
||||
},
|
||||
|
||||
events: function events() {
|
||||
return {
|
||||
'click @ui.tabs': 'onClickTabControl',
|
||||
'click @ui.reloadButton': 'onReloadButtonClick'
|
||||
};
|
||||
},
|
||||
|
||||
modelEvents: {
|
||||
destroy: 'onModelDestroy'
|
||||
},
|
||||
|
||||
behaviors: {
|
||||
HandleInnerTabs: {
|
||||
behaviorClass: __webpack_require__(12)
|
||||
}
|
||||
},
|
||||
|
||||
initialize: function initialize() {
|
||||
this.initCollection();
|
||||
|
||||
this.listenTo(elementor.channels.deviceMode, 'change', this.onDeviceModeChange);
|
||||
},
|
||||
|
||||
initCollection: function initCollection() {
|
||||
this.collection = new Backbone.Collection(_.values(elementor.mergeControlsSettings(this.getOption('controls'))));
|
||||
},
|
||||
|
||||
filter: function filter(controlModel) {
|
||||
if (controlModel.get('tab') !== this.activeTab) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('section' === controlModel.get('type')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
var section = controlModel.get('section');
|
||||
|
||||
return !section || section === this.activeSection;
|
||||
},
|
||||
|
||||
getControlViewByModel: function getControlViewByModel(model) {
|
||||
return this.children.findByModelCid(model.cid);
|
||||
},
|
||||
|
||||
getControlViewByName: function getControlViewByName(name) {
|
||||
return this.getControlViewByModel(this.getControlModel(name));
|
||||
},
|
||||
|
||||
getControlModel: function getControlModel(name) {
|
||||
return this.collection.findWhere({ name: name });
|
||||
},
|
||||
|
||||
isVisibleSectionControl: function isVisibleSectionControl(sectionControlModel) {
|
||||
return this.activeTab === sectionControlModel.get('tab');
|
||||
},
|
||||
|
||||
activateTab: function activateTab(tabName) {
|
||||
this.activeTab = tabName;
|
||||
|
||||
this.ui.tabs.removeClass('elementor-active').filter('[data-tab="' + tabName + '"]').addClass('elementor-active');
|
||||
|
||||
this.activateFirstSection();
|
||||
},
|
||||
|
||||
activateSection: function activateSection(sectionName) {
|
||||
this.activeSection = sectionName;
|
||||
},
|
||||
|
||||
activateFirstSection: function activateFirstSection() {
|
||||
var self = this;
|
||||
|
||||
var sectionControls = self.collection.filter(function (controlModel) {
|
||||
return 'section' === controlModel.get('type') && self.isVisibleSectionControl(controlModel);
|
||||
});
|
||||
|
||||
if (!sectionControls[0]) {
|
||||
return;
|
||||
}
|
||||
|
||||
var preActivatedSection = sectionControls.filter(function (controlModel) {
|
||||
return self.activeSection === controlModel.get('name');
|
||||
});
|
||||
|
||||
if (preActivatedSection[0]) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.activateSection(sectionControls[0].get('name'));
|
||||
},
|
||||
|
||||
getChildView: function getChildView(item) {
|
||||
var controlType = item.get('type');
|
||||
|
||||
return elementor.getControlView(controlType);
|
||||
},
|
||||
|
||||
handlePopovers: function handlePopovers() {
|
||||
var self = this,
|
||||
popoverStarted = false,
|
||||
$popover;
|
||||
|
||||
self.removePopovers();
|
||||
|
||||
self.children.each(function (child) {
|
||||
if (popoverStarted) {
|
||||
$popover.append(child.$el);
|
||||
}
|
||||
|
||||
var popover = child.model.get('popover');
|
||||
|
||||
if (!popover) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (popover.start) {
|
||||
popoverStarted = true;
|
||||
|
||||
$popover = jQuery('<div>', { class: self.classes.popover });
|
||||
|
||||
child.$el.before($popover);
|
||||
|
||||
$popover.append(child.$el);
|
||||
}
|
||||
|
||||
if (popover.end) {
|
||||
popoverStarted = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
removePopovers: function removePopovers() {
|
||||
this.$el.find('.' + this.classes.popover).remove();
|
||||
},
|
||||
|
||||
getNamespaceArray: function getNamespaceArray() {
|
||||
return [elementor.getPanelView().getCurrentPageName()];
|
||||
},
|
||||
|
||||
openActiveSection: function openActiveSection() {
|
||||
var activeSection = this.activeSection,
|
||||
activeSectionView = this.children.filter(function (view) {
|
||||
return activeSection === view.model.get('name');
|
||||
});
|
||||
|
||||
if (activeSectionView[0]) {
|
||||
activeSectionView[0].$el.addClass('elementor-open');
|
||||
|
||||
var eventNamespace = this.getNamespaceArray();
|
||||
|
||||
eventNamespace.push(activeSection, 'activated');
|
||||
|
||||
elementor.channels.editor.trigger(eventNamespace.join(':'), this);
|
||||
}
|
||||
},
|
||||
|
||||
onRenderCollection: function onRenderCollection() {
|
||||
this.openActiveSection();
|
||||
|
||||
this.handlePopovers();
|
||||
},
|
||||
|
||||
onRenderTemplate: function onRenderTemplate() {
|
||||
this.activateTab(this.activeTab || this.ui.tabs.eq(0).data('tab'));
|
||||
},
|
||||
|
||||
onModelDestroy: function onModelDestroy() {
|
||||
this.destroy();
|
||||
},
|
||||
|
||||
onClickTabControl: function onClickTabControl(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $tab = this.$(event.currentTarget),
|
||||
tabName = $tab.data('tab');
|
||||
|
||||
if (this.activeTab === tabName) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.activateTab(tabName);
|
||||
|
||||
this._renderChildren();
|
||||
},
|
||||
|
||||
onReloadButtonClick: function onReloadButtonClick() {
|
||||
elementor.reloadPreview();
|
||||
},
|
||||
|
||||
onDeviceModeChange: function onDeviceModeChange() {
|
||||
if ('desktop' === elementor.channels.deviceMode.request('currentMode')) {
|
||||
this.$el.removeClass('elementor-responsive-switchers-open');
|
||||
}
|
||||
},
|
||||
|
||||
onChildviewControlSectionClicked: function onChildviewControlSectionClicked(childView) {
|
||||
var isSectionOpen = childView.$el.hasClass('elementor-open');
|
||||
|
||||
this.activateSection(isSectionOpen ? null : childView.model.get('name'));
|
||||
|
||||
this._renderChildren();
|
||||
},
|
||||
|
||||
onChildviewResponsiveSwitcherClick: function onChildviewResponsiveSwitcherClick(childView, device) {
|
||||
if ('desktop' === device) {
|
||||
this.$el.toggleClass('elementor-responsive-switchers-open');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = ControlsStack;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 208:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
var BaseSettingsModel;
|
||||
|
||||
BaseSettingsModel = Backbone.Model.extend({
|
||||
options: {},
|
||||
|
||||
initialize: function initialize(data, options) {
|
||||
var self = this;
|
||||
|
||||
// Keep the options for cloning
|
||||
self.options = options;
|
||||
|
||||
self.controls = elementor.mergeControlsSettings(options.controls);
|
||||
|
||||
self.validators = {};
|
||||
|
||||
if (!self.controls) {
|
||||
return;
|
||||
}
|
||||
|
||||
var attrs = data || {},
|
||||
defaults = {};
|
||||
|
||||
_.each(self.controls, function (control) {
|
||||
var isUIControl = -1 !== control.features.indexOf('ui');
|
||||
|
||||
if (isUIControl) {
|
||||
return;
|
||||
}
|
||||
var controlName = control.name;
|
||||
|
||||
if ('object' === _typeof(control.default)) {
|
||||
defaults[controlName] = elementorCommon.helpers.cloneObject(control.default);
|
||||
} else {
|
||||
defaults[controlName] = control.default;
|
||||
}
|
||||
|
||||
var isDynamicControl = control.dynamic && control.dynamic.active,
|
||||
hasDynamicSettings = isDynamicControl && attrs.__dynamic__ && attrs.__dynamic__[controlName];
|
||||
|
||||
if (isDynamicControl && !hasDynamicSettings && control.dynamic.default) {
|
||||
if (!attrs.__dynamic__) {
|
||||
attrs.__dynamic__ = {};
|
||||
}
|
||||
|
||||
attrs.__dynamic__[controlName] = control.dynamic.default;
|
||||
|
||||
hasDynamicSettings = true;
|
||||
}
|
||||
|
||||
// Check if the value is a plain object ( and not an array )
|
||||
var isMultipleControl = jQuery.isPlainObject(control.default);
|
||||
|
||||
if (undefined !== attrs[controlName] && isMultipleControl && !_.isObject(attrs[controlName]) && !hasDynamicSettings) {
|
||||
elementor.debug.addCustomError(new TypeError('An invalid argument supplied as multiple control value'), 'InvalidElementData', 'Element `' + (self.get('widgetType') || self.get('elType')) + '` got <' + attrs[controlName] + '> as `' + controlName + '` value. Expected array or object.');
|
||||
|
||||
delete attrs[controlName];
|
||||
}
|
||||
|
||||
if (undefined === attrs[controlName]) {
|
||||
attrs[controlName] = defaults[controlName];
|
||||
}
|
||||
});
|
||||
|
||||
self.defaults = defaults;
|
||||
|
||||
self.handleRepeaterData(attrs);
|
||||
|
||||
self.set(attrs);
|
||||
},
|
||||
|
||||
handleRepeaterData: function handleRepeaterData(attrs) {
|
||||
_.each(this.controls, function (field) {
|
||||
if (field.is_repeater) {
|
||||
// TODO: Apply defaults on each field in repeater fields
|
||||
if (!(attrs[field.name] instanceof Backbone.Collection)) {
|
||||
attrs[field.name] = new Backbone.Collection(attrs[field.name], {
|
||||
model: function model(attributes, options) {
|
||||
options = options || {};
|
||||
|
||||
options.controls = field.fields;
|
||||
|
||||
if (!attributes._id) {
|
||||
attributes._id = elementor.helpers.getUniqueID();
|
||||
}
|
||||
|
||||
return new BaseSettingsModel(attributes, options);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getFontControls: function getFontControls() {
|
||||
return _.filter(this.getActiveControls(), function (control) {
|
||||
return 'font' === control.type;
|
||||
});
|
||||
},
|
||||
|
||||
getStyleControls: function getStyleControls(controls, attributes) {
|
||||
var self = this;
|
||||
|
||||
controls = elementorCommon.helpers.cloneObject(self.getActiveControls(controls, attributes));
|
||||
|
||||
var styleControls = [];
|
||||
|
||||
jQuery.each(controls, function () {
|
||||
var control = this,
|
||||
controlDefaultSettings = elementor.config.controls[control.type];
|
||||
|
||||
control = jQuery.extend({}, controlDefaultSettings, control);
|
||||
|
||||
if (control.fields) {
|
||||
var styleFields = [];
|
||||
|
||||
self.attributes[control.name].each(function (item) {
|
||||
styleFields.push(self.getStyleControls(control.fields, item.attributes));
|
||||
});
|
||||
|
||||
control.styleFields = styleFields;
|
||||
}
|
||||
|
||||
if (control.fields || control.dynamic && control.dynamic.active || self.isStyleControl(control.name, controls)) {
|
||||
styleControls.push(control);
|
||||
}
|
||||
});
|
||||
|
||||
return styleControls;
|
||||
},
|
||||
|
||||
isStyleControl: function isStyleControl(attribute, controls) {
|
||||
controls = controls || this.controls;
|
||||
|
||||
var currentControl = _.find(controls, function (control) {
|
||||
return attribute === control.name;
|
||||
});
|
||||
|
||||
return currentControl && !_.isEmpty(currentControl.selectors);
|
||||
},
|
||||
|
||||
getClassControls: function getClassControls(controls) {
|
||||
controls = controls || this.controls;
|
||||
|
||||
return _.filter(controls, function (control) {
|
||||
return !_.isUndefined(control.prefix_class);
|
||||
});
|
||||
},
|
||||
|
||||
isClassControl: function isClassControl(attribute) {
|
||||
var currentControl = _.find(this.controls, function (control) {
|
||||
return attribute === control.name;
|
||||
});
|
||||
|
||||
return currentControl && !_.isUndefined(currentControl.prefix_class);
|
||||
},
|
||||
|
||||
getControl: function getControl(id) {
|
||||
return _.find(this.controls, function (control) {
|
||||
return id === control.name;
|
||||
});
|
||||
},
|
||||
|
||||
getActiveControls: function getActiveControls(controls, attributes) {
|
||||
var activeControls = {};
|
||||
|
||||
if (!controls) {
|
||||
controls = this.controls;
|
||||
}
|
||||
|
||||
if (!attributes) {
|
||||
attributes = this.attributes;
|
||||
}
|
||||
|
||||
_.each(controls, function (control, controlKey) {
|
||||
if (elementor.helpers.isActiveControl(control, attributes)) {
|
||||
activeControls[controlKey] = control;
|
||||
}
|
||||
});
|
||||
|
||||
return activeControls;
|
||||
},
|
||||
|
||||
clone: function clone() {
|
||||
return new BaseSettingsModel(elementorCommon.helpers.cloneObject(this.attributes), elementorCommon.helpers.cloneObject(this.options));
|
||||
},
|
||||
|
||||
setExternalChange: function setExternalChange(key, value) {
|
||||
var self = this,
|
||||
settingsToChange;
|
||||
|
||||
if ('object' === (typeof key === 'undefined' ? 'undefined' : _typeof(key))) {
|
||||
settingsToChange = key;
|
||||
} else {
|
||||
settingsToChange = {};
|
||||
|
||||
settingsToChange[key] = value;
|
||||
}
|
||||
|
||||
self.set(settingsToChange);
|
||||
|
||||
jQuery.each(settingsToChange, function (changedKey, changedValue) {
|
||||
self.trigger('change:external:' + changedKey, changedValue);
|
||||
});
|
||||
},
|
||||
|
||||
parseDynamicSettings: function parseDynamicSettings(settings, options, controls) {
|
||||
var self = this;
|
||||
|
||||
settings = elementorCommon.helpers.cloneObject(settings || self.attributes);
|
||||
|
||||
options = options || {};
|
||||
|
||||
controls = controls || this.controls;
|
||||
|
||||
jQuery.each(controls, function () {
|
||||
var control = this,
|
||||
valueToParse;
|
||||
|
||||
if ('repeater' === control.type) {
|
||||
valueToParse = settings[control.name];
|
||||
valueToParse.forEach(function (value, key) {
|
||||
valueToParse[key] = self.parseDynamicSettings(value, options, control.fields);
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
valueToParse = settings.__dynamic__ && settings.__dynamic__[control.name];
|
||||
|
||||
if (!valueToParse) {
|
||||
return;
|
||||
}
|
||||
|
||||
var dynamicSettings = control.dynamic;
|
||||
|
||||
if (undefined === dynamicSettings) {
|
||||
dynamicSettings = elementor.config.controls[control.type].dynamic;
|
||||
}
|
||||
|
||||
if (!dynamicSettings || !dynamicSettings.active) {
|
||||
return;
|
||||
}
|
||||
|
||||
var dynamicValue;
|
||||
|
||||
try {
|
||||
dynamicValue = elementor.dynamicTags.parseTagsText(valueToParse, dynamicSettings, elementor.dynamicTags.getTagDataContent);
|
||||
} catch (error) {
|
||||
if (elementor.dynamicTags.CACHE_KEY_NOT_FOUND_ERROR !== error.message) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
dynamicValue = '';
|
||||
|
||||
if (options.onServerRequestStart) {
|
||||
options.onServerRequestStart();
|
||||
}
|
||||
|
||||
elementor.dynamicTags.refreshCacheFromServer(function () {
|
||||
if (options.onServerRequestEnd) {
|
||||
options.onServerRequestEnd();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (dynamicSettings.property) {
|
||||
settings[control.name][dynamicSettings.property] = dynamicValue;
|
||||
} else {
|
||||
settings[control.name] = dynamicValue;
|
||||
}
|
||||
});
|
||||
|
||||
return settings;
|
||||
},
|
||||
|
||||
toJSON: function toJSON(options) {
|
||||
var data = Backbone.Model.prototype.toJSON.call(this);
|
||||
|
||||
options = options || {};
|
||||
|
||||
delete data.widgetType;
|
||||
delete data.elType;
|
||||
delete data.isInner;
|
||||
|
||||
_.each(data, function (attribute, key) {
|
||||
if (attribute && attribute.toJSON) {
|
||||
data[key] = attribute.toJSON();
|
||||
}
|
||||
});
|
||||
|
||||
// TODO: `options.removeDefault` is a bc since 2.5.14
|
||||
if (options.remove && -1 !== options.remove.indexOf('default') || options.removeDefault) {
|
||||
var controls = this.controls;
|
||||
|
||||
_.each(data, function (value, key) {
|
||||
var control = controls[key];
|
||||
|
||||
if (!control) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: use `save_default` in text|textarea controls.
|
||||
if (control.save_default || ('text' === control.type || 'textarea' === control.type) && data[key]) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_.isEqual(data[key], control.default)) {
|
||||
delete data[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return elementorCommon.helpers.cloneObject(data);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = BaseSettingsModel;
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
5
modules/creativeelements/views/js/editor-modules.min.js
vendored
Normal file
5
modules/creativeelements/views/js/editor-modules.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
modules/creativeelements/views/js/editor-preview.js
Normal file
8
modules/creativeelements/views/js/editor-preview.js
Normal file
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com
|
||||
*/
|
||||
if (!$('#elementor').length && location.search.indexOf('&force=1&') < 0) {
|
||||
// redirect to preview page when content area doesn't exist
|
||||
location.href = cePreview + '&force=1&ver=' + Date.now();
|
||||
}
|
||||
18055
modules/creativeelements/views/js/editor.js
Normal file
18055
modules/creativeelements/views/js/editor.js
Normal file
File diff suppressed because it is too large
Load Diff
5
modules/creativeelements/views/js/editor.min.js
vendored
Normal file
5
modules/creativeelements/views/js/editor.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
20
modules/creativeelements/views/js/frontend-edit.js
Normal file
20
modules/creativeelements/views/js/frontend-edit.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com
|
||||
*/
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var prev;
|
||||
$('.elementor').each(function() {
|
||||
var uid = (this.className.match(/elementor-(\d+)/) || '')[1];
|
||||
if (uid && uid !== prev) {
|
||||
prev = uid;
|
||||
$(this).addClass('ce-edit-wrapper');
|
||||
$('<a class="ce-edit-btn"><i class="ce-icon">').attr({
|
||||
href: ceFrontendEdit.editor_url + '&uid=' + uid,
|
||||
title: ceFrontendEdit.edit_title,
|
||||
}).appendTo(this);
|
||||
$('<div class="ce-edit-outline">').appendTo(this);
|
||||
}
|
||||
});
|
||||
});
|
||||
900
modules/creativeelements/views/js/frontend-modules.js
Normal file
900
modules/creativeelements/views/js/frontend-modules.js
Normal file
@@ -0,0 +1,900 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com & Elementor.com
|
||||
*/
|
||||
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // define __esModule on exports
|
||||
/******/ __webpack_require__.r = function(exports) {
|
||||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||||
/******/ }
|
||||
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // create a fake namespace object
|
||||
/******/ // mode & 1: value is a module id, require it
|
||||
/******/ // mode & 2: merge all properties of value into the ns
|
||||
/******/ // mode & 4: return value when already ns object
|
||||
/******/ // mode & 8|1: behave like require
|
||||
/******/ __webpack_require__.t = function(value, mode) {
|
||||
/******/ if(mode & 1) value = __webpack_require__(value);
|
||||
/******/ if(mode & 8) return value;
|
||||
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||||
/******/ var ns = Object.create(null);
|
||||
/******/ __webpack_require__.r(ns);
|
||||
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||||
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||||
/******/ return ns;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 209);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 17:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
||||
|
||||
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
||||
|
||||
var _class = function (_elementorModules$Vie) {
|
||||
_inherits(_class, _elementorModules$Vie);
|
||||
|
||||
function _class() {
|
||||
_classCallCheck(this, _class);
|
||||
|
||||
return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments));
|
||||
}
|
||||
|
||||
_createClass(_class, [{
|
||||
key: 'getDefaultSettings',
|
||||
value: function getDefaultSettings() {
|
||||
return {
|
||||
selectors: {
|
||||
elements: '.elementor-element',
|
||||
nestedDocumentElements: '.elementor .elementor-element'
|
||||
},
|
||||
classes: {
|
||||
editMode: 'elementor-edit-mode'
|
||||
}
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'getDefaultElements',
|
||||
value: function getDefaultElements() {
|
||||
var selectors = this.getSettings('selectors');
|
||||
|
||||
return {
|
||||
$elements: this.$element.find(selectors.elements).not(this.$element.find(selectors.nestedDocumentElements))
|
||||
};
|
||||
}
|
||||
}, {
|
||||
key: 'getDocumentSettings',
|
||||
value: function getDocumentSettings(setting) {
|
||||
var elementSettings = void 0;
|
||||
|
||||
if (this.isEdit) {
|
||||
elementSettings = {};
|
||||
|
||||
var settings = elementor.settings.page.model;
|
||||
|
||||
jQuery.each(settings.getActiveControls(), function (controlKey) {
|
||||
elementSettings[controlKey] = settings.attributes[controlKey];
|
||||
});
|
||||
} else {
|
||||
elementSettings = this.$element.data('elementor-settings') || {};
|
||||
}
|
||||
|
||||
return this.getItems(elementSettings, setting);
|
||||
}
|
||||
}, {
|
||||
key: 'runElementsHandlers',
|
||||
value: function runElementsHandlers() {
|
||||
this.elements.$elements.each(function (index, element) {
|
||||
return ceFrontend.elementsHandler.runReadyTrigger(element);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'onInit',
|
||||
value: function onInit() {
|
||||
this.$element = this.getSettings('$element');
|
||||
|
||||
_get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'onInit', this).call(this);
|
||||
|
||||
this.isEdit = this.$element.hasClass(this.getSettings('classes.editMode'));
|
||||
|
||||
if (this.isEdit) {
|
||||
elementor.settings.page.model.on('change', this.onSettingsChange.bind(this));
|
||||
} else {
|
||||
this.runElementsHandlers();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: 'onSettingsChange',
|
||||
value: function onSettingsChange() {}
|
||||
}]);
|
||||
|
||||
return _class;
|
||||
}(elementorModules.ViewModule);
|
||||
|
||||
exports.default = _class;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 19:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _module = __webpack_require__(5);
|
||||
|
||||
var _module2 = _interopRequireDefault(_module);
|
||||
|
||||
var _viewModule = __webpack_require__(6);
|
||||
|
||||
var _viewModule2 = _interopRequireDefault(_viewModule);
|
||||
|
||||
var _masonry = __webpack_require__(20);
|
||||
|
||||
var _masonry2 = _interopRequireDefault(_masonry);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
exports.default = window.elementorModules = {
|
||||
Module: _module2.default,
|
||||
ViewModule: _viewModule2.default,
|
||||
utils: {
|
||||
Masonry: _masonry2.default
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 20:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _viewModule = __webpack_require__(6);
|
||||
|
||||
var _viewModule2 = _interopRequireDefault(_viewModule);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
module.exports = _viewModule2.default.extend({
|
||||
|
||||
getDefaultSettings: function getDefaultSettings() {
|
||||
return {
|
||||
container: null,
|
||||
items: null,
|
||||
columnsCount: 3,
|
||||
verticalSpaceBetween: 30
|
||||
};
|
||||
},
|
||||
|
||||
getDefaultElements: function getDefaultElements() {
|
||||
return {
|
||||
$container: jQuery(this.getSettings('container')),
|
||||
$items: jQuery(this.getSettings('items'))
|
||||
};
|
||||
},
|
||||
|
||||
run: function run() {
|
||||
var heights = [],
|
||||
distanceFromTop = this.elements.$container.position().top,
|
||||
settings = this.getSettings(),
|
||||
columnsCount = settings.columnsCount;
|
||||
|
||||
distanceFromTop += parseInt(this.elements.$container.css('margin-top'), 10);
|
||||
|
||||
this.elements.$items.each(function (index) {
|
||||
var row = Math.floor(index / columnsCount),
|
||||
$item = jQuery(this),
|
||||
itemHeight = $item[0].getBoundingClientRect().height + settings.verticalSpaceBetween;
|
||||
|
||||
if (row) {
|
||||
var itemPosition = $item.position(),
|
||||
indexAtRow = index % columnsCount,
|
||||
pullHeight = itemPosition.top - distanceFromTop - heights[indexAtRow];
|
||||
|
||||
pullHeight -= parseInt($item.css('margin-top'), 10);
|
||||
|
||||
pullHeight *= -1;
|
||||
|
||||
$item.css('margin-top', pullHeight + 'px');
|
||||
|
||||
heights[indexAtRow] += itemHeight;
|
||||
} else {
|
||||
heights.push(itemHeight);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 209:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _modules = __webpack_require__(19);
|
||||
|
||||
var _modules2 = _interopRequireDefault(_modules);
|
||||
|
||||
var _document = __webpack_require__(17);
|
||||
|
||||
var _document2 = _interopRequireDefault(_document);
|
||||
|
||||
var _stretchElement = __webpack_require__(210);
|
||||
|
||||
var _stretchElement2 = _interopRequireDefault(_stretchElement);
|
||||
|
||||
var _base = __webpack_require__(211);
|
||||
|
||||
var _base2 = _interopRequireDefault(_base);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
_modules2.default.frontend = {
|
||||
Document: _document2.default,
|
||||
tools: {
|
||||
StretchElement: _stretchElement2.default
|
||||
},
|
||||
handlers: {
|
||||
Base: _base2.default
|
||||
}
|
||||
};
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 210:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
module.exports = elementorModules.ViewModule.extend({
|
||||
getDefaultSettings: function getDefaultSettings() {
|
||||
return {
|
||||
element: null,
|
||||
direction: ceFrontend.config.is_rtl ? 'right' : 'left',
|
||||
selectors: {
|
||||
container: window
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
getDefaultElements: function getDefaultElements() {
|
||||
return {
|
||||
$element: jQuery(this.getSettings('element'))
|
||||
};
|
||||
},
|
||||
|
||||
stretch: function stretch() {
|
||||
// CE fix for nav menu
|
||||
if (!this.elements.$element.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
var containerSelector = this.getSettings('selectors.container'),
|
||||
$container;
|
||||
|
||||
try {
|
||||
$container = jQuery(containerSelector);
|
||||
} catch (e) {}
|
||||
|
||||
if (!$container || !$container.length) {
|
||||
$container = jQuery(this.getDefaultSettings().selectors.container);
|
||||
}
|
||||
|
||||
this.reset();
|
||||
|
||||
var $element = this.elements.$element,
|
||||
containerWidth = $container.outerWidth(),
|
||||
elementOffset = $element.offset().left,
|
||||
isFixed = 'fixed' === $element.css('position'),
|
||||
correctOffset = isFixed ? 0 : elementOffset;
|
||||
|
||||
if (window !== $container[0]) {
|
||||
var containerOffset = $container.offset().left;
|
||||
|
||||
if (isFixed) {
|
||||
correctOffset = containerOffset;
|
||||
}
|
||||
if (elementOffset > containerOffset) {
|
||||
correctOffset = elementOffset - containerOffset;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFixed) {
|
||||
if (ceFrontend.config.is_rtl) {
|
||||
correctOffset = containerWidth - ($element.outerWidth() + correctOffset);
|
||||
}
|
||||
|
||||
correctOffset = -correctOffset;
|
||||
}
|
||||
|
||||
var css = {};
|
||||
|
||||
css.width = containerWidth + 'px';
|
||||
|
||||
css[this.getSettings('direction')] = correctOffset + 'px';
|
||||
|
||||
$element.css(css);
|
||||
},
|
||||
|
||||
reset: function reset() {
|
||||
var css = {};
|
||||
|
||||
css.width = '';
|
||||
|
||||
css[this.getSettings('direction')] = '';
|
||||
|
||||
this.elements.$element.css(css);
|
||||
}
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 211:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
module.exports = elementorModules.ViewModule.extend({
|
||||
$element: null,
|
||||
|
||||
editorListeners: null,
|
||||
|
||||
onElementChange: null,
|
||||
|
||||
onEditSettingsChange: null,
|
||||
|
||||
onGeneralSettingsChange: null,
|
||||
|
||||
onPageSettingsChange: null,
|
||||
|
||||
isEdit: null,
|
||||
|
||||
__construct: function __construct(settings) {
|
||||
this.$element = settings.$element;
|
||||
|
||||
this.isEdit = this.$element.hasClass('elementor-element-edit-mode');
|
||||
|
||||
if (this.isEdit) {
|
||||
this.addEditorListeners();
|
||||
}
|
||||
},
|
||||
|
||||
findElement: function findElement(selector) {
|
||||
var $mainElement = this.$element;
|
||||
|
||||
return $mainElement.find(selector).filter(function () {
|
||||
return jQuery(this).closest('.elementor-element').is($mainElement);
|
||||
});
|
||||
},
|
||||
|
||||
getUniqueHandlerID: function getUniqueHandlerID(cid, $element) {
|
||||
if (!cid) {
|
||||
cid = this.getModelCID();
|
||||
}
|
||||
|
||||
if (!$element) {
|
||||
$element = this.$element;
|
||||
}
|
||||
|
||||
return cid + $element.attr('data-element_type') + this.getConstructorID();
|
||||
},
|
||||
|
||||
initEditorListeners: function initEditorListeners() {
|
||||
var self = this;
|
||||
|
||||
self.editorListeners = [{
|
||||
event: 'element:destroy',
|
||||
to: elementor.channels.data,
|
||||
callback: function callback(removedModel) {
|
||||
if (removedModel.cid !== self.getModelCID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.onDestroy();
|
||||
}
|
||||
}];
|
||||
|
||||
if (self.onElementChange) {
|
||||
var elementType = self.getWidgetType() || self.getElementType();
|
||||
|
||||
var eventName = 'change';
|
||||
|
||||
if ('global' !== elementType) {
|
||||
eventName += ':' + elementType;
|
||||
}
|
||||
|
||||
self.editorListeners.push({
|
||||
event: eventName,
|
||||
to: elementor.channels.editor,
|
||||
callback: function callback(controlView, elementView) {
|
||||
var elementViewHandlerID = self.getUniqueHandlerID(elementView.model.cid, elementView.$el);
|
||||
|
||||
if (elementViewHandlerID !== self.getUniqueHandlerID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.onElementChange(controlView.model.get('name'), controlView, elementView);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (self.onEditSettingsChange) {
|
||||
self.editorListeners.push({
|
||||
event: 'change:editSettings',
|
||||
to: elementor.channels.editor,
|
||||
callback: function callback(changedModel, view) {
|
||||
if (view.model.cid !== self.getModelCID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.onEditSettingsChange(Object.keys(changedModel.changed)[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
['page', 'general'].forEach(function (settingsType) {
|
||||
var listenerMethodName = 'on' + settingsType[0].toUpperCase() + settingsType.slice(1) + 'SettingsChange';
|
||||
|
||||
if (self[listenerMethodName]) {
|
||||
self.editorListeners.push({
|
||||
event: 'change',
|
||||
to: elementor.settings[settingsType].model,
|
||||
callback: function callback(model) {
|
||||
self[listenerMethodName](model.changed);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getEditorListeners: function getEditorListeners() {
|
||||
if (!this.editorListeners) {
|
||||
this.initEditorListeners();
|
||||
}
|
||||
|
||||
return this.editorListeners;
|
||||
},
|
||||
|
||||
addEditorListeners: function addEditorListeners() {
|
||||
var uniqueHandlerID = this.getUniqueHandlerID();
|
||||
|
||||
this.getEditorListeners().forEach(function (listener) {
|
||||
ceFrontend.addListenerOnce(uniqueHandlerID, listener.event, listener.callback, listener.to);
|
||||
});
|
||||
},
|
||||
|
||||
removeEditorListeners: function removeEditorListeners() {
|
||||
var uniqueHandlerID = this.getUniqueHandlerID();
|
||||
|
||||
this.getEditorListeners().forEach(function (listener) {
|
||||
ceFrontend.removeListeners(uniqueHandlerID, listener.event, null, listener.to);
|
||||
});
|
||||
},
|
||||
|
||||
getElementType: function getElementType() {
|
||||
return this.$element.data('element_type');
|
||||
},
|
||||
|
||||
getWidgetType: function getWidgetType() {
|
||||
var widgetType = this.$element.data('widget_type');
|
||||
|
||||
if (!widgetType) {
|
||||
return;
|
||||
}
|
||||
|
||||
return widgetType.split('.')[0];
|
||||
},
|
||||
|
||||
getID: function getID() {
|
||||
return this.$element.data('id');
|
||||
},
|
||||
|
||||
getModelCID: function getModelCID() {
|
||||
return this.$element.data('model-cid');
|
||||
},
|
||||
|
||||
getElementSettings: function getElementSettings(setting) {
|
||||
var elementSettings = {};
|
||||
|
||||
var modelCID = this.getModelCID();
|
||||
|
||||
if (this.isEdit && modelCID) {
|
||||
var settings = ceFrontend.config.elements.data[modelCID],
|
||||
attributes = settings.attributes;
|
||||
|
||||
var type = attributes.widgetType || attributes.elType;
|
||||
|
||||
if (attributes.isInner) {
|
||||
type = 'inner-' + type;
|
||||
}
|
||||
|
||||
var settingsKeys = ceFrontend.config.elements.keys[type];
|
||||
|
||||
if (!settingsKeys) {
|
||||
settingsKeys = ceFrontend.config.elements.keys[type] = [];
|
||||
|
||||
jQuery.each(settings.controls, function (name, control) {
|
||||
if (control.frontend_available) {
|
||||
settingsKeys.push(name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
jQuery.each(settings.getActiveControls(), function (controlKey) {
|
||||
if (-1 !== settingsKeys.indexOf(controlKey)) {
|
||||
elementSettings[controlKey] = attributes[controlKey];
|
||||
}
|
||||
});
|
||||
} else {
|
||||
elementSettings = this.$element.data('settings') || {};
|
||||
}
|
||||
|
||||
return this.getItems(elementSettings, setting);
|
||||
},
|
||||
|
||||
getEditSettings: function getEditSettings(setting) {
|
||||
var attributes = {};
|
||||
|
||||
if (this.isEdit) {
|
||||
attributes = ceFrontend.config.elements.editSettings[this.getModelCID()].attributes;
|
||||
}
|
||||
|
||||
return this.getItems(attributes, setting);
|
||||
},
|
||||
|
||||
getCurrentDeviceSetting: function getCurrentDeviceSetting(settingKey) {
|
||||
return ceFrontend.getCurrentDeviceSetting(this.getElementSettings(), settingKey);
|
||||
},
|
||||
|
||||
onDestroy: function onDestroy() {
|
||||
this.removeEditorListeners();
|
||||
|
||||
if (this.unbindEvents) {
|
||||
this.unbindEvents();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
||||
|
||||
var Module = function Module() {
|
||||
var $ = jQuery,
|
||||
instanceParams = arguments,
|
||||
self = this,
|
||||
events = {};
|
||||
|
||||
var settings = void 0;
|
||||
|
||||
var ensureClosureMethods = function ensureClosureMethods() {
|
||||
$.each(self, function (methodName) {
|
||||
var oldMethod = self[methodName];
|
||||
|
||||
if ('function' !== typeof oldMethod) {
|
||||
return;
|
||||
}
|
||||
|
||||
self[methodName] = function () {
|
||||
return oldMethod.apply(self, arguments);
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
var initSettings = function initSettings() {
|
||||
settings = self.getDefaultSettings();
|
||||
|
||||
var instanceSettings = instanceParams[0];
|
||||
|
||||
if (instanceSettings) {
|
||||
$.extend(true, settings, instanceSettings);
|
||||
}
|
||||
};
|
||||
|
||||
var init = function init() {
|
||||
self.__construct.apply(self, instanceParams);
|
||||
|
||||
ensureClosureMethods();
|
||||
|
||||
initSettings();
|
||||
|
||||
self.trigger('init');
|
||||
};
|
||||
|
||||
this.getItems = function (items, itemKey) {
|
||||
if (itemKey) {
|
||||
var keyStack = itemKey.split('.'),
|
||||
currentKey = keyStack.splice(0, 1);
|
||||
|
||||
if (!keyStack.length) {
|
||||
return items[currentKey];
|
||||
}
|
||||
|
||||
if (!items[currentKey]) {
|
||||
return;
|
||||
}
|
||||
|
||||
return this.getItems(items[currentKey], keyStack.join('.'));
|
||||
}
|
||||
|
||||
return items;
|
||||
};
|
||||
|
||||
this.getSettings = function (setting) {
|
||||
return this.getItems(settings, setting);
|
||||
};
|
||||
|
||||
this.setSettings = function (settingKey, value, settingsContainer) {
|
||||
if (!settingsContainer) {
|
||||
settingsContainer = settings;
|
||||
}
|
||||
|
||||
if ('object' === (typeof settingKey === 'undefined' ? 'undefined' : _typeof(settingKey))) {
|
||||
$.extend(settingsContainer, settingKey);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
var keyStack = settingKey.split('.'),
|
||||
currentKey = keyStack.splice(0, 1);
|
||||
|
||||
if (!keyStack.length) {
|
||||
settingsContainer[currentKey] = value;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
if (!settingsContainer[currentKey]) {
|
||||
settingsContainer[currentKey] = {};
|
||||
}
|
||||
|
||||
return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
|
||||
};
|
||||
|
||||
this.forceMethodImplementation = function (methodArguments) {
|
||||
var functionName = methodArguments.callee.name;
|
||||
|
||||
throw new ReferenceError('The method ' + functionName + ' must to be implemented in the inheritor child.');
|
||||
};
|
||||
|
||||
this.on = function (eventName, callback) {
|
||||
if ('object' === (typeof eventName === 'undefined' ? 'undefined' : _typeof(eventName))) {
|
||||
$.each(eventName, function (singleEventName) {
|
||||
self.on(singleEventName, this);
|
||||
});
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
var eventNames = eventName.split(' ');
|
||||
|
||||
eventNames.forEach(function (singleEventName) {
|
||||
if (!events[singleEventName]) {
|
||||
events[singleEventName] = [];
|
||||
}
|
||||
|
||||
events[singleEventName].push(callback);
|
||||
});
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
this.off = function (eventName, callback) {
|
||||
if (!events[eventName]) {
|
||||
return self;
|
||||
}
|
||||
|
||||
if (!callback) {
|
||||
delete events[eventName];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
var callbackIndex = events[eventName].indexOf(callback);
|
||||
|
||||
if (-1 !== callbackIndex) {
|
||||
delete events[eventName][callbackIndex];
|
||||
}
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
this.trigger = function (eventName) {
|
||||
var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
|
||||
params = Array.prototype.slice.call(arguments, 1);
|
||||
|
||||
if (self[methodName]) {
|
||||
self[methodName].apply(self, params);
|
||||
}
|
||||
|
||||
var callbacks = events[eventName];
|
||||
|
||||
if (!callbacks) {
|
||||
return self;
|
||||
}
|
||||
|
||||
$.each(callbacks, function (index, callback) {
|
||||
callback.apply(self, params);
|
||||
});
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
Module.prototype.__construct = function () {};
|
||||
|
||||
Module.prototype.getDefaultSettings = function () {
|
||||
return {};
|
||||
};
|
||||
|
||||
Module.extendsCount = 0;
|
||||
|
||||
Module.extend = function (properties) {
|
||||
var $ = jQuery,
|
||||
parent = this;
|
||||
|
||||
var child = function child() {
|
||||
return parent.apply(this, arguments);
|
||||
};
|
||||
|
||||
$.extend(child, parent);
|
||||
|
||||
child.prototype = Object.create($.extend({}, parent.prototype, properties));
|
||||
|
||||
child.prototype.constructor = child;
|
||||
|
||||
/*
|
||||
* Constructor ID is used to set an unique ID
|
||||
* to every extend of the Module.
|
||||
*
|
||||
* It's useful in some cases such as unique
|
||||
* listener for frontend handlers.
|
||||
*/
|
||||
var constructorID = ++Module.extendsCount;
|
||||
|
||||
child.prototype.getConstructorID = function () {
|
||||
return constructorID;
|
||||
};
|
||||
|
||||
child.__super__ = parent.prototype;
|
||||
|
||||
return child;
|
||||
};
|
||||
|
||||
module.exports = Module;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var _module = __webpack_require__(5);
|
||||
|
||||
var _module2 = _interopRequireDefault(_module);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
module.exports = _module2.default.extend({
|
||||
elements: null,
|
||||
|
||||
getDefaultElements: function getDefaultElements() {
|
||||
return {};
|
||||
},
|
||||
|
||||
bindEvents: function bindEvents() {},
|
||||
|
||||
onInit: function onInit() {
|
||||
this.initElements();
|
||||
|
||||
this.bindEvents();
|
||||
},
|
||||
|
||||
initElements: function initElements() {
|
||||
this.elements = this.getDefaultElements();
|
||||
}
|
||||
});
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
||||
5
modules/creativeelements/views/js/frontend-modules.min.js
vendored
Normal file
5
modules/creativeelements/views/js/frontend-modules.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6924
modules/creativeelements/views/js/frontend.js
Normal file
6924
modules/creativeelements/views/js/frontend.js
Normal file
File diff suppressed because it is too large
Load Diff
3950
modules/creativeelements/views/js/frontend.min.js
vendored
Normal file
3950
modules/creativeelements/views/js/frontend.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8
modules/creativeelements/views/js/index.php
Normal file
8
modules/creativeelements/views/js/index.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
header('Expires: Thu, 28 Feb 2019 00:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
header('Location: ../../../../');
|
||||
die;
|
||||
105
modules/creativeelements/views/js/migrate.js
Normal file
105
modules/creativeelements/views/js/migrate.js
Normal file
@@ -0,0 +1,105 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com
|
||||
*/
|
||||
|
||||
ceMigrate.init = function() {
|
||||
this.moveCount = 6;
|
||||
this.ajaxDelay = 333;
|
||||
|
||||
$('<link>', {
|
||||
href: this.baseDir + 'modules/creativeelements/views/css/migrate.css',
|
||||
rel: 'stylesheet'
|
||||
}).appendTo('head');
|
||||
|
||||
$('<link>', {
|
||||
href: this.baseDir + 'js/jquery/plugins/fancybox/jquery.fancybox.css',
|
||||
rel: 'stylesheet'
|
||||
}).one('load', function() {
|
||||
$.ajax({
|
||||
url: ceMigrate.baseDir + 'js/jquery/plugins/fancybox/jquery.fancybox.js',
|
||||
cache: true,
|
||||
dataType: 'script',
|
||||
success: $.proxy(ceMigrate, 'open')
|
||||
});
|
||||
}).appendTo('head');
|
||||
};
|
||||
|
||||
ceMigrate.open = function() {
|
||||
$.fancybox({
|
||||
padding: 5,
|
||||
minWidth: 500,
|
||||
maxWidth: 500,
|
||||
minHeight: 16,
|
||||
maxHeight: 16,
|
||||
closeBtn: false,
|
||||
helpers: {
|
||||
overlay: {closeClick: false},
|
||||
title: true
|
||||
},
|
||||
title: 'Creative Elements - Upgrade',
|
||||
content: '\
|
||||
<div id="ce-progress" class="progress">\
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated"></div>\
|
||||
</div>\
|
||||
',
|
||||
afterShow: function() {
|
||||
ceMigrate.updateProgress();
|
||||
ceMigrate.move();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ceMigrate.updateProgress = function() {
|
||||
var p = 100 - (this.ids.content.length + this.ids.template.length) / this.count * 100;
|
||||
|
||||
$('#ce-progress .progress-bar').css('width', p.toFixed(2) + '%');
|
||||
};
|
||||
|
||||
ceMigrate.move = function() {
|
||||
var type = this.ids.content.length ? 'content' : 'template';
|
||||
|
||||
$.ajax(this.ajaxUrl[type], {
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
action: 'migrate',
|
||||
ids: this.ids[type].slice(0, this.moveCount),
|
||||
},
|
||||
success: $.proxy(this, 'onSuccess'),
|
||||
error: $.proxy(this, 'onError')
|
||||
});
|
||||
};
|
||||
|
||||
ceMigrate.onSuccess = function(data, status, xhr) {
|
||||
if (data && data.done && data.done.length) {
|
||||
var diff = [];
|
||||
|
||||
this.ids[data.type].forEach(function(id) {
|
||||
data.done.indexOf(id) < 0 && diff.push(id);
|
||||
});
|
||||
this.ids[data.type] = diff;
|
||||
this.updateProgress();
|
||||
|
||||
if (this.ids.content.length + this.ids.template.length) {
|
||||
setTimeout($.proxy(this, 'move'), this.ajaxDelay);
|
||||
} else {
|
||||
setTimeout(function onFinish() {
|
||||
location.href = ceMigrate.ajaxUrl.content.replace('&ajax=1', '');
|
||||
}, 600);
|
||||
}
|
||||
} else {
|
||||
this.onError(xhr, 'unknown error');
|
||||
}
|
||||
};
|
||||
|
||||
ceMigrate.onError = function(xhr, status) {
|
||||
alert(status + '\nPlease contact us on product support.');
|
||||
$.fancybox.close();
|
||||
$('<div>' + xhr.responseText + '</div>').prependTo('#content');
|
||||
};
|
||||
|
||||
window.$
|
||||
? $(document).ready($.proxy(ceMigrate, 'init'))
|
||||
: document.addEventListener('DOMContentLoaded', ceMigrate.init.bind(ceMigrate))
|
||||
;
|
||||
90
modules/creativeelements/views/js/settings.js
Normal file
90
modules/creativeelements/views/js/settings.js
Normal file
@@ -0,0 +1,90 @@
|
||||
/*!
|
||||
* Creative Elements - live Theme & Page Builder
|
||||
* Copyright 2019-2022 WebshopWorks.com
|
||||
*/
|
||||
|
||||
jQuery(function ($) {
|
||||
if ('#license' === location.hash) {
|
||||
history.pushState('', document.title, location.pathname + location.search);
|
||||
|
||||
$('#modal_license').modal();
|
||||
}
|
||||
|
||||
var $regenerate = $('#page-header-desc-configuration-regenerate-css'),
|
||||
$replace = $(document.replace_url);
|
||||
|
||||
$regenerate
|
||||
.attr({
|
||||
title: '<p style="margin:0 -10px; width:182px;">' + $regenerate.attr('onclick').substr(2) + '</p>',
|
||||
})
|
||||
.tooltip({
|
||||
html: true,
|
||||
placement: 'bottom',
|
||||
})
|
||||
.on('click.ce', function onClickRegenerateCss() {
|
||||
if ($regenerate.find('.icon-spin').length) {
|
||||
return;
|
||||
}
|
||||
$regenerate.find('i').attr('class', 'process-icon-reload icon-rotate-right icon-spin');
|
||||
|
||||
$.post(
|
||||
location.href,
|
||||
{
|
||||
ajax: true,
|
||||
action: 'regenerate_css',
|
||||
},
|
||||
function onSuccessRegenerateCss(resp) {
|
||||
$regenerate.find('i').attr('class', 'process-icon-ok');
|
||||
},
|
||||
'json'
|
||||
);
|
||||
})
|
||||
.removeAttr('onclick')
|
||||
;
|
||||
$replace.on('submit.ce', function onSubmitReplaceUrl(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if ($replace.find('.icon-spin').length) {
|
||||
return;
|
||||
}
|
||||
$replace.find('i').attr('class', 'icon-circle-o-notch icon-spin');
|
||||
|
||||
$.post(
|
||||
location.href,
|
||||
$(this).serialize(),
|
||||
function onSuccessReplaceUrl(resp) {
|
||||
if (resp.success) {
|
||||
document.replace_url.reset();
|
||||
}
|
||||
$replace.find('i').attr('class', 'icon-refresh');
|
||||
|
||||
$replace.find('.alert').attr({
|
||||
'class': 'alert alert-' + (resp.success ? 'success' : 'danger')
|
||||
}).html(resp.data);
|
||||
},
|
||||
'json'
|
||||
);
|
||||
});
|
||||
|
||||
$('input[name=elementor_container_width]').attr({
|
||||
type: 'number',
|
||||
min: 300,
|
||||
});
|
||||
$('input[name=elementor_space_between_widgets]').attr({
|
||||
type: 'number',
|
||||
min: 0,
|
||||
});
|
||||
$('input[name=elementor_stretched_section_container]').attr({
|
||||
placeholder: 'body',
|
||||
});
|
||||
$('input[name=elementor_viewport_lg]').attr({
|
||||
type: 'number',
|
||||
min: 769,
|
||||
max: 1439,
|
||||
});
|
||||
$('input[name=elementor_viewport_md]').attr({
|
||||
type: 'number',
|
||||
min: 481,
|
||||
max: 1024,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user