芝麻web文件管理V1.00
编辑当前文件:/home/p/r/i/prismawe/clients/_asap-ingenierie.fr/wp-content/plugins/elementor/assets/js/editor.js
/*! elementor - v2.5.16 - 28-05-2019 */ /******/ (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 = 43); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ControlBaseView = __webpack_require__(3), TagsBehavior = __webpack_require__(57), Validator = __webpack_require__(9), ControlBaseDataView; ControlBaseDataView = ControlBaseView.extend({ ui: function ui() { var ui = ControlBaseView.prototype.ui.apply(this, arguments); _.extend(ui, { input: 'input[data-setting][type!="checkbox"][type!="radio"]', checkbox: 'input[data-setting][type="checkbox"]', radio: 'input[data-setting][type="radio"]', select: 'select[data-setting]', textarea: 'textarea[data-setting]', responsiveSwitchers: '.elementor-responsive-switcher', contentEditable: '[contenteditable="true"]', tooltipTarget: '.tooltip-target' }); return ui; }, templateHelpers: function templateHelpers() { var controlData = ControlBaseView.prototype.templateHelpers.apply(this, arguments); controlData.data.controlValue = this.getControlValue(); return controlData; }, events: function events() { return { 'input @ui.input': 'onBaseInputChange', 'change @ui.checkbox': 'onBaseInputChange', 'change @ui.radio': 'onBaseInputChange', 'input @ui.textarea': 'onBaseInputChange', 'change @ui.select': 'onBaseInputChange', 'input @ui.contentEditable': 'onBaseInputChange', 'click @ui.responsiveSwitchers': 'onResponsiveSwitchersClick' }; }, behaviors: function behaviors() { var behaviors = {}, dynamicSettings = this.options.model.get('dynamic'); if (dynamicSettings && dynamicSettings.active) { var tags = _.filter(elementor.dynamicTags.getConfig('tags'), function (tag) { return _.intersection(tag.categories, dynamicSettings.categories).length; }); if (tags.length) { behaviors.tags = { behaviorClass: TagsBehavior, tags: tags, dynamicSettings: dynamicSettings }; } } return behaviors; }, initialize: function initialize() { ControlBaseView.prototype.initialize.apply(this, arguments); this.registerValidators(); this.listenTo(this.elementSettingsModel, 'change:external:' + this.model.get('name'), this.onAfterExternalChange); }, getControlValue: function getControlValue() { return this.elementSettingsModel.get(this.model.get('name')); }, setValue: function setValue(value) { this.setSettingsModel(value); }, setSettingsModel: function setSettingsModel(value) { this.elementSettingsModel.set(this.model.get('name'), value); this.triggerMethod('settings:change'); }, applySavedValue: function applySavedValue() { this.setInputValue('[data-setting="' + this.model.get('name') + '"]', this.getControlValue()); }, getEditSettings: function getEditSettings(setting) { var settings = this.getOption('elementEditSettings').toJSON(); if (setting) { return settings[setting]; } return settings; }, setEditSetting: function setEditSetting(settingKey, settingValue) { var settings = this.getOption('elementEditSettings'); settings.set(settingKey, settingValue); }, getInputValue: function getInputValue(input) { var $input = this.$(input); if ($input.is('[contenteditable="true"]')) { return $input.html(); } var inputValue = $input.val(), inputType = $input.attr('type'); if (-1 !== ['radio', 'checkbox'].indexOf(inputType)) { return $input.prop('checked') ? inputValue : ''; } if ('number' === inputType && _.isFinite(inputValue)) { return +inputValue; } // Temp fix for jQuery (< 3.0) that return null instead of empty array if ('SELECT' === input.tagName && $input.prop('multiple') && null === inputValue) { inputValue = []; } return inputValue; }, setInputValue: function setInputValue(input, value) { var $input = this.$(input), inputType = $input.attr('type'); if ('checkbox' === inputType) { $input.prop('checked', !!value); } else if ('radio' === inputType) { $input.filter('[value="' + value + '"]').prop('checked', true); } else { $input.val(value); } }, addValidator: function addValidator(validator) { this.validators.push(validator); }, registerValidators: function registerValidators() { this.validators = []; var validationTerms = {}; if (this.model.get('required')) { validationTerms.required = true; } if (!jQuery.isEmptyObject(validationTerms)) { this.addValidator(new Validator({ validationTerms: validationTerms })); } }, onRender: function onRender() { ControlBaseView.prototype.onRender.apply(this, arguments); if (this.model.get('responsive')) { this.renderResponsiveSwitchers(); } this.applySavedValue(); this.triggerMethod('ready'); this.toggleControlVisibility(); this.addTooltip(); }, onBaseInputChange: function onBaseInputChange(event) { clearTimeout(this.correctionTimeout); var input = event.currentTarget, value = this.getInputValue(input), validators = this.validators.slice(0), settingsValidators = this.elementSettingsModel.validators[this.model.get('name')]; if (settingsValidators) { validators = validators.concat(settingsValidators); } if (validators) { var oldValue = this.getControlValue(input.dataset.setting); var isValidValue = validators.every(function (validator) { return validator.isValid(value, oldValue); }); if (!isValidValue) { this.correctionTimeout = setTimeout(this.setInputValue.bind(this, input, oldValue), 1200); return; } } this.updateElementModel(value, input); this.triggerMethod('input:change', event); }, onResponsiveSwitchersClick: function onResponsiveSwitchersClick(event) { var device = jQuery(event.currentTarget).data('device'); this.triggerMethod('responsive:switcher:click', device); elementor.changeDeviceMode(device); }, renderResponsiveSwitchers: function renderResponsiveSwitchers() { var templateHtml = Marionette.Renderer.render('#tmpl-elementor-control-responsive-switchers', this.model.attributes); this.ui.controlTitle.after(templateHtml); }, onAfterExternalChange: function onAfterExternalChange() { this.hideTooltip(); this.applySavedValue(); }, addTooltip: function addTooltip() { if (!this.ui.tooltipTarget) { return; } // Create tooltip on controls this.ui.tooltipTarget.tipsy({ gravity: function gravity() { // `n` for down, `s` for up var gravity = jQuery(this).data('tooltip-pos'); if (undefined !== gravity) { return gravity; } return 'n'; }, title: function title() { return this.getAttribute('data-tooltip'); } }); }, hideTooltip: function hideTooltip() { if (this.ui.tooltipTarget) { this.ui.tooltipTarget.tipsy('hide'); } }, updateElementModel: function updateElementModel(value) { this.setValue(value); } }, { // Static methods getStyleValue: function getStyleValue(placeholder, controlValue, controlData) { if ('DEFAULT' === placeholder) { return controlData.default; } return controlValue; }, onPasteStyle: function onPasteStyle() { return true; } }); module.exports = ControlBaseDataView; /***/ }), /* 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') }; /***/ }), /* 2 */ /***/ (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 ControlBaseDataView = __webpack_require__(0), ControlBaseMultipleItemView; ControlBaseMultipleItemView = ControlBaseDataView.extend({ applySavedValue: function applySavedValue() { var values = this.getControlValue(), $inputs = this.$('[data-setting]'), self = this; _.each(values, function (value, key) { var $input = $inputs.filter(function () { return key === this.dataset.setting; }); self.setInputValue($input, value); }); }, getControlValue: function getControlValue(key) { var values = this.elementSettingsModel.get(this.model.get('name')); if (!jQuery.isPlainObject(values)) { return {}; } if (key) { var value = values[key]; if (undefined === value) { value = ''; } return value; } return elementorCommon.helpers.cloneObject(values); }, setValue: function setValue(key, value) { var values = this.getControlValue(); if ('object' === (typeof key === 'undefined' ? 'undefined' : _typeof(key))) { _.each(key, function (internalValue, internalKey) { values[internalKey] = internalValue; }); } else { values[key] = value; } this.setSettingsModel(values); }, updateElementModel: function updateElementModel(value, input) { var key = input.dataset.setting; this.setValue(key, value); } }, { // Static methods getStyleValue: function getStyleValue(placeholder, controlValue) { if (!_.isObject(controlValue)) { return ''; // invalid } return controlValue[placeholder.toLowerCase()]; } }); module.exports = ControlBaseMultipleItemView; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ControlBaseView; ControlBaseView = Marionette.CompositeView.extend({ ui: function ui() { return { controlTitle: '.elementor-control-title' }; }, behaviors: function behaviors() { var behaviors = {}; return elementor.hooks.applyFilters('controls/base/behaviors', behaviors, this); }, getBehavior: function getBehavior(name) { return this._behaviors[Object.keys(this.behaviors()).indexOf(name)]; }, className: function className() { // TODO: Any better classes for that? var classes = 'elementor-control elementor-control-' + this.model.get('name') + ' elementor-control-type-' + this.model.get('type'), modelClasses = this.model.get('classes'), responsive = this.model.get('responsive'); if (!_.isEmpty(modelClasses)) { classes += ' ' + modelClasses; } if (!_.isEmpty(responsive)) { classes += ' elementor-control-responsive-' + responsive.max; } return classes; }, templateHelpers: function templateHelpers() { var controlData = { _cid: this.model.cid }; return { data: _.extend({}, this.model.toJSON(), controlData) }; }, getTemplate: function getTemplate() { return Marionette.TemplateCache.get('#tmpl-elementor-control-' + this.model.get('type') + '-content'); }, initialize: function initialize(options) { this.elementSettingsModel = options.elementSettingsModel; var controlType = this.model.get('type'), controlSettings = jQuery.extend(true, {}, elementor.config.controls[controlType], this.model.attributes); this.model.set(controlSettings); this.listenTo(this.elementSettingsModel, 'change', this.toggleControlVisibility); }, toggleControlVisibility: function toggleControlVisibility() { var isVisible = elementor.helpers.isActiveControl(this.model, this.elementSettingsModel.attributes); this.$el.toggleClass('elementor-hidden-control', !isVisible); elementor.getPanelView().updateScrollbar(); }, onRender: function onRender() { var layoutType = this.model.get('label_block') ? 'block' : 'inline', showLabel = this.model.get('show_label'), elClasses = 'elementor-label-' + layoutType; elClasses += ' elementor-control-separator-' + this.model.get('separator'); if (!showLabel) { elClasses += ' elementor-control-hidden-label'; } this.$el.addClass(elClasses); this.toggleControlVisibility(); } }); module.exports = ControlBaseView; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ControlBaseDataView = __webpack_require__(0), ControlSelect2ItemView; ControlSelect2ItemView = ControlBaseDataView.extend({ getSelect2Placeholder: function getSelect2Placeholder() { return this.ui.select.children('option:first[value=""]').text(); }, getSelect2DefaultOptions: function getSelect2DefaultOptions() { return { allowClear: true, placeholder: this.getSelect2Placeholder(), dir: elementorCommon.config.isRTL ? 'rtl' : 'ltr' }; }, getSelect2Options: function getSelect2Options() { return jQuery.extend(this.getSelect2DefaultOptions(), this.model.get('select2options')); }, onReady: function onReady() { this.ui.select.select2(this.getSelect2Options()); }, onBeforeDestroy: function onBeforeDestroy() { if (this.ui.select.data('select2')) { this.ui.select.select2('destroy'); } this.$el.remove(); } }); module.exports = ControlSelect2ItemView; /***/ }), /* 5 */, /* 6 */, /* 7 */ /***/ (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 _environment = __webpack_require__(1); var _environment2 = _interopRequireDefault(_environment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ControlsCSSParser = __webpack_require__(10), Validator = __webpack_require__(9), BaseContainer = __webpack_require__(26), BaseElementView; BaseElementView = BaseContainer.extend({ tagName: 'div', controlsCSSParser: null, allowRender: true, toggleEditTools: false, renderAttributes: {}, className: function className() { var classes = 'elementor-element elementor-element-edit-mode ' + this.getElementUniqueID(); if (this.toggleEditTools) { classes += ' elementor-element--toggle-edit-tools'; } return classes; }, attributes: function attributes() { return { 'data-id': this.getID(), 'data-element_type': this.model.get('elType') }; }, ui: function ui() { return { tools: '> .elementor-element-overlay > .elementor-editor-element-settings', editButton: '> .elementor-element-overlay .elementor-editor-element-edit', duplicateButton: '> .elementor-element-overlay .elementor-editor-element-duplicate', addButton: '> .elementor-element-overlay .elementor-editor-element-add', removeButton: '> .elementor-element-overlay .elementor-editor-element-remove' }; }, behaviors: function behaviors() { var groups = elementor.hooks.applyFilters('elements/' + this.options.model.get('elType') + '/contextMenuGroups', this.getContextMenuGroups(), this); var behaviors = { contextMenu: { behaviorClass: __webpack_require__(8), groups: groups } }; return elementor.hooks.applyFilters('elements/base/behaviors', behaviors, this); }, getBehavior: function getBehavior(name) { return this._behaviors[Object.keys(this.behaviors()).indexOf(name)]; }, events: function events() { return { mousedown: 'onMouseDown', 'click @ui.editButton': 'onEditButtonClick', 'click @ui.duplicateButton': 'onDuplicateButtonClick', 'click @ui.addButton': 'onAddButtonClick', 'click @ui.removeButton': 'onRemoveButtonClick' }; }, getElementType: function getElementType() { return this.model.get('elType'); }, getIDInt: function getIDInt() { return parseInt(this.getID(), 16); }, getChildType: function getChildType() { return elementor.helpers.getElementChildType(this.getElementType()); }, getChildView: function getChildView(model) { var ChildView, elType = model.get('elType'); if ('section' === elType) { ChildView = __webpack_require__(27); } else if ('column' === elType) { ChildView = __webpack_require__(96); } else { ChildView = elementor.modules.elements.views.Widget; } return elementor.hooks.applyFilters('element/view', ChildView, model, this); }, getTemplateType: function getTemplateType() { return 'js'; }, getEditModel: function getEditModel() { return this.model; }, getContextMenuGroups: function getContextMenuGroups() { var controlSign = _environment2.default.mac ? '⌘' : '^'; return [{ name: 'general', actions: [{ name: 'edit', icon: 'eicon-edit', title: elementor.translate('edit_element', [this.options.model.getTitle()]), callback: this.options.model.trigger.bind(this.options.model, 'request:edit') }, { name: 'duplicate', icon: 'eicon-clone', title: elementor.translate('duplicate'), shortcut: controlSign + '+D', callback: this.duplicate.bind(this) }] }, { name: 'transfer', actions: [{ name: 'copy', title: elementor.translate('copy'), shortcut: controlSign + '+C', callback: this.copy.bind(this) }, { name: 'paste', title: elementor.translate('paste'), shortcut: controlSign + '+V', callback: this.paste.bind(this), isEnabled: this.isPasteEnabled.bind(this) }, { name: 'pasteStyle', title: elementor.translate('paste_style'), shortcut: controlSign + '+⇧+V', callback: this.pasteStyle.bind(this), isEnabled: function isEnabled() { return !!elementorCommon.storage.get('transfer'); } }, { name: 'resetStyle', title: elementor.translate('reset_style'), callback: this.resetStyle.bind(this) }] }, { name: 'delete', actions: [{ name: 'delete', icon: 'eicon-trash', title: elementor.translate('delete'), shortcut: '⌦', callback: this.removeElement.bind(this) }] }]; }, initialize: function initialize() { BaseContainer.prototype.initialize.apply(this, arguments); if (this.collection) { this.listenTo(this.collection, 'add remove reset', this.onCollectionChanged, this); } var editModel = this.getEditModel(); this.listenTo(editModel.get('settings'), 'change', this.onSettingsChanged).listenTo(editModel.get('editSettings'), 'change', this.onEditSettingsChanged).listenTo(this.model, 'request:edit', this.onEditRequest).listenTo(this.model, 'request:toggleVisibility', this.toggleVisibility); this.initControlsCSSParser(); }, startTransport: function startTransport(type) { elementorCommon.storage.set('transfer', { type: type, elementsType: this.getElementType(), elements: [this.model.toJSON({ copyHtmlCache: true })] }); }, copy: function copy() { this.startTransport('copy'); }, cut: function cut() { this.startTransport('cut'); }, paste: function paste() { this.trigger('request:paste'); }, isPasteEnabled: function isPasteEnabled() { var transferData = elementorCommon.storage.get('transfer'); if (!transferData || this.isCollectionFilled()) { return false; } return this.getElementType() === transferData.elementsType; }, isStyleTransferControl: function isStyleTransferControl(control) { if (undefined !== control.style_transfer) { return control.style_transfer; } return 'content' !== control.tab || control.selectors || control.prefix_class; }, duplicate: function duplicate() { var oldTransport = elementorCommon.storage.get('transfer'); this.copy(); this.paste(); elementorCommon.storage.set('transfer', oldTransport); }, pasteStyle: function pasteStyle() { var self = this, transferData = elementorCommon.storage.get('transfer'), sourceElement = transferData.elements[0], sourceSettings = sourceElement.settings, editModel = self.getEditModel(), settings = editModel.get('settings'), settingsAttributes = settings.attributes, controls = settings.controls, diffSettings = {}; jQuery.each(controls, function (controlName, control) { if (!self.isStyleTransferControl(control)) { return; } var sourceValue = sourceSettings[controlName], targetValue = settingsAttributes[controlName]; if (undefined === sourceValue || undefined === targetValue) { return; } if ('object' === (typeof sourceValue === 'undefined' ? 'undefined' : _typeof(sourceValue)) ^ 'object' === (typeof targetValue === 'undefined' ? 'undefined' : _typeof(targetValue))) { return; } if ('object' === (typeof sourceValue === 'undefined' ? 'undefined' : _typeof(sourceValue))) { var isEqual = true; jQuery.each(sourceValue, function (propertyKey) { if (sourceValue[propertyKey] !== targetValue[propertyKey]) { return isEqual = false; } }); if (isEqual) { return; } } if (sourceValue === targetValue) { return; } var ControlView = elementor.getControlView(control.type); if (!ControlView.onPasteStyle(control, sourceValue)) { return; } diffSettings[controlName] = sourceValue; }); self.allowRender = false; elementor.channels.data.trigger('element:before:paste:style', editModel); editModel.setSetting(diffSettings); elementor.channels.data.trigger('element:after:paste:style', editModel); self.allowRender = true; self.renderOnChange(); }, resetStyle: function resetStyle() { var self = this, editModel = self.getEditModel(), controls = editModel.get('settings').controls, defaultValues = {}; self.allowRender = false; elementor.channels.data.trigger('element:before:reset:style', editModel); jQuery.each(controls, function (controlName, control) { if (!self.isStyleTransferControl(control)) { return; } defaultValues[controlName] = control.default; }); editModel.setSetting(defaultValues); elementor.channels.data.trigger('element:after:reset:style', editModel); self.allowRender = true; self.renderOnChange(); }, toggleVisibility: function toggleVisibility() { this.model.set('hidden', !this.model.get('hidden')); this.toggleVisibilityClass(); }, toggleVisibilityClass: function toggleVisibilityClass() { this.$el.toggleClass('elementor-edit-hidden', !!this.model.get('hidden')); }, addElementFromPanel: function addElementFromPanel(options) { options = options || {}; var elementView = elementor.channels.panelElements.request('element:selected'); var itemData = { elType: elementView.model.get('elType') }; if ('widget' === itemData.elType) { itemData.widgetType = elementView.model.get('widgetType'); } else if ('section' === itemData.elType) { itemData.isInner = true; } else { return; } var customData = elementView.model.get('custom'); if (customData) { jQuery.extend(itemData, customData); } options.trigger = { beforeAdd: 'element:before:add', afterAdd: 'element:after:add' }; options.onAfterAdd = function (newModel, newView) { if ('section' === newView.getElementType() && newView.isInner()) { newView.addChildElement(); } }; this.addChildElement(itemData, options); }, addControlValidator: function addControlValidator(controlName, validationCallback) { validationCallback = validationCallback.bind(this); var validator = new Validator({ customValidationMethod: validationCallback }), validators = this.getEditModel().get('settings').validators; if (!validators[controlName]) { validators[controlName] = []; } validators[controlName].push(validator); }, addRenderAttribute: function addRenderAttribute(element, key, value, overwrite) { var self = this; if ('object' === (typeof element === 'undefined' ? 'undefined' : _typeof(element))) { jQuery.each(element, function (elementKey) { self.addRenderAttribute(elementKey, this, null, overwrite); }); return self; } if ('object' === (typeof key === 'undefined' ? 'undefined' : _typeof(key))) { jQuery.each(key, function (attributeKey) { self.addRenderAttribute(element, attributeKey, this, overwrite); }); return self; } if (!self.renderAttributes[element]) { self.renderAttributes[element] = {}; } if (!self.renderAttributes[element][key]) { self.renderAttributes[element][key] = []; } if (!Array.isArray(value)) { value = [value]; } if (overwrite) { self.renderAttributes[element][key] = value; } else { self.renderAttributes[element][key] = self.renderAttributes[element][key].concat(value); } }, getRenderAttributeString: function getRenderAttributeString(element) { if (!this.renderAttributes[element]) { return ''; } var renderAttributes = this.renderAttributes[element], attributes = []; jQuery.each(renderAttributes, function (attributeKey) { attributes.push(attributeKey + '="' + _.escape(this.join(' ')) + '"'); }); return attributes.join(' '); }, isInner: function isInner() { return !!this.model.get('isInner'); }, initControlsCSSParser: function initControlsCSSParser() { this.controlsCSSParser = new ControlsCSSParser({ id: this.model.cid, settingsModel: this.getEditModel().get('settings'), dynamicParsing: this.getDynamicParsingSettings() }); }, enqueueFonts: function enqueueFonts() { var editModel = this.getEditModel(), settings = editModel.get('settings'); _.each(settings.getFontControls(), function (control) { var fontFamilyName = editModel.getSetting(control.name); if (_.isEmpty(fontFamilyName)) { return; } elementor.helpers.enqueueFont(fontFamilyName); }); }, renderStyles: function renderStyles(settings) { if (!settings) { settings = this.getEditModel().get('settings'); } this.controlsCSSParser.stylesheet.empty(); this.controlsCSSParser.addStyleRules(settings.getStyleControls(), settings.attributes, this.getEditModel().get('settings').controls, [/{{ID}}/g, /{{WRAPPER}}/g], [this.getID(), '#elementor .' + this.getElementUniqueID()]); this.controlsCSSParser.addStyleToDocument(); var extraCSS = elementor.hooks.applyFilters('editor/style/styleText', '', this); if (extraCSS) { this.controlsCSSParser.elements.$stylesheetElement.append(extraCSS); } }, renderCustomClasses: function renderCustomClasses() { var self = this; var settings = self.getEditModel().get('settings'), classControls = settings.getClassControls(); // Remove all previous classes _.each(classControls, function (control) { var previousClassValue = settings.previous(control.name); if (control.classes_dictionary) { if (undefined !== control.classes_dictionary[previousClassValue]) { previousClassValue = control.classes_dictionary[previousClassValue]; } } self.$el.removeClass(control.prefix_class + previousClassValue); }); // Add new classes _.each(classControls, function (control) { var value = settings.attributes[control.name], classValue = value; if (control.classes_dictionary) { if (undefined !== control.classes_dictionary[value]) { classValue = control.classes_dictionary[value]; } } var isVisible = elementor.helpers.isActiveControl(control, settings.attributes); if (isVisible && (classValue || 0 === classValue)) { self.$el.addClass(control.prefix_class + classValue); } }); self.$el.addClass(_.result(self, 'className')); self.toggleVisibilityClass(); }, renderCustomElementID: function renderCustomElementID() { var customElementID = this.getEditModel().get('settings').get('_element_id'); this.$el.attr('id', customElementID); }, renderUI: function renderUI() { this.renderStyles(); this.renderCustomClasses(); this.renderCustomElementID(); this.enqueueFonts(); }, runReadyTrigger: function runReadyTrigger() { var self = this; _.defer(function () { elementorFrontend.elementsHandler.runReadyTrigger(self.el); if (!elementorFrontend.isEditMode()) { return; } // In edit mode - handle an external elements that loaded by another elements like shortcode etc. self.$el.find('.elementor-element.elementor-' + self.model.get('elType') + ':not(.elementor-element-edit-mode)').each(function () { elementorFrontend.elementsHandler.runReadyTrigger(this); }); }); }, getID: function getID() { return this.model.get('id'); }, getElementUniqueID: function getElementUniqueID() { return 'elementor-element-' + this.getID(); }, renderOnChange: function renderOnChange(settings) { if (!this.allowRender) { return; } // Make sure is correct model if (settings instanceof elementorModules.editor.elements.models.BaseSettings) { var hasChanged = settings.hasChanged(), isContentChanged = !hasChanged, isRenderRequired = !hasChanged; _.each(settings.changedAttributes(), function (settingValue, settingKey) { var control = settings.getControl(settingKey); if ('_column_size' === settingKey) { isRenderRequired = true; return; } if (!control) { isRenderRequired = true; isContentChanged = true; return; } if ('none' !== control.render_type) { isRenderRequired = true; } if (-1 !== ['none', 'ui'].indexOf(control.render_type)) { return; } if ('template' === control.render_type || !settings.isStyleControl(settingKey) && !settings.isClassControl(settingKey) && '_element_id' !== settingKey) { isContentChanged = true; } }); if (!isRenderRequired) { return; } if (!isContentChanged) { this.renderUI(); return; } } // Re-render the template var templateType = this.getTemplateType(), editModel = this.getEditModel(); if ('js' === templateType) { this.getEditModel().setHtmlCache(); this.render(); editModel.renderOnLeave = true; } else { editModel.renderRemoteServer(); } }, getDynamicParsingSettings: function getDynamicParsingSettings() { var self = this; return { onServerRequestStart: function onServerRequestStart() { self.$el.addClass('elementor-loading'); }, onServerRequestEnd: function onServerRequestEnd() { self.render(); self.$el.removeClass('elementor-loading'); } }; }, serializeData: function serializeData() { var data = BaseContainer.prototype.serializeData.apply(this, arguments); data.settings = this.getEditModel().get('settings').parseDynamicSettings(data.settings, this.getDynamicParsingSettings()); return data; }, save: function save() { var model = this.model; elementor.templates.startModal({ onReady: function onReady() { elementor.templates.getLayout().showSaveTemplateView(model); } }); }, removeElement: function removeElement() { elementor.channels.data.trigger('element:before:remove', this.model); var parent = this._parent; parent.isManualRemoving = true; this.model.destroy(); parent.isManualRemoving = false; elementor.channels.data.trigger('element:after:remove', this.model); }, onBeforeRender: function onBeforeRender() { this.renderAttributes = {}; }, onRender: function onRender() { this.renderUI(); this.runReadyTrigger(); if (this.toggleEditTools) { var editButton = this.ui.editButton; this.ui.tools.hoverIntent(function () { editButton.addClass('elementor-active'); }, function () { editButton.removeClass('elementor-active'); }, { timeout: 500 }); } }, onCollectionChanged: function onCollectionChanged() { elementor.saver.setFlagEditorChange(true); }, onEditSettingsChanged: function onEditSettingsChanged(changedModel) { elementor.channels.editor.trigger('change:editSettings', changedModel, this); }, onSettingsChanged: function onSettingsChanged(changedModel) { elementor.saver.setFlagEditorChange(true); this.renderOnChange(changedModel); }, onEditButtonClick: function onEditButtonClick() { this.model.trigger('request:edit'); }, onEditRequest: function onEditRequest() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if ('edit' !== elementor.channels.dataEditMode.request('activeMode')) { return; } var model = this.getEditModel(), panel = elementor.getPanelView(); if ('editor' === panel.getCurrentPageName() && panel.getCurrentPageView().model === model) { return; } if (options.scrollIntoView) { elementor.helpers.scrollToView(this.$el, 200); } panel.openEditor(model, this); }, onDuplicateButtonClick: function onDuplicateButtonClick(event) { event.stopPropagation(); this.duplicate(); }, onRemoveButtonClick: function onRemoveButtonClick(event) { event.stopPropagation(); this.removeElement(); }, /* jQuery ui sortable preventing any `mousedown` event above any element, and as a result is preventing the `blur` * event on the currently active element. Therefor, we need to blur the active element manually. */ onMouseDown: function onMouseDown(event) { if (jQuery(event.target).closest('.elementor-inline-editing').length) { return; } elementorFrontend.elements.window.document.activeElement.blur(); }, onDestroy: function onDestroy() { this.controlsCSSParser.removeStyleFromDocument(); this.getEditModel().get('settings').validators = {}; elementor.channels.data.trigger('element:destroy', this.model); } }); module.exports = BaseElementView; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ContextMenu = __webpack_require__(94); module.exports = Marionette.Behavior.extend({ defaults: { groups: [], eventTargets: ['el'] }, events: function events() { var events = {}; this.getOption('eventTargets').forEach(function (eventTarget) { var eventName = 'contextmenu'; if ('el' !== eventTarget) { eventName += ' ' + eventTarget; } events[eventName] = 'onContextMenu'; }); return events; }, initialize: function initialize() { this.listenTo(this.view.options.model, 'request:contextmenu', this.onRequestContextMenu); }, initContextMenu: function initContextMenu() { var contextMenuGroups = this.getOption('groups'), deleteGroup = _.findWhere(contextMenuGroups, { name: 'delete' }), afterGroupIndex = contextMenuGroups.indexOf(deleteGroup); if (-1 === afterGroupIndex) { afterGroupIndex = contextMenuGroups.length; } contextMenuGroups.splice(afterGroupIndex, 0, { name: 'tools', actions: [{ name: 'navigator', title: elementor.translate('navigator'), callback: elementor.navigator.open.bind(elementor.navigator, this.view.model) }] }); this.contextMenu = new ContextMenu({ groups: contextMenuGroups }); this.contextMenu.getModal().on('hide', this.onContextMenuHide); }, getContextMenu: function getContextMenu() { if (!this.contextMenu) { this.initContextMenu(); } return this.contextMenu; }, onContextMenu: function onContextMenu(event) { if (elementorCommon.hotKeys.isControlEvent(event) || !elementor.userCan('design')) { return; } if ('edit' !== elementor.channels.dataEditMode.request('activeMode')) { return; } event.preventDefault(); event.stopPropagation(); this.getContextMenu().show(event); elementor.channels.editor.reply('contextMenu:targetView', this.view); }, onRequestContextMenu: function onRequestContextMenu(event) { var modal = this.getContextMenu().getModal(), iframe = modal.getSettings('iframe'), toolsGroup = _.findWhere(this.contextMenu.getSettings('groups'), { name: 'tools' }); toolsGroup.isVisible = false; modal.setSettings('iframe', null); this.onContextMenu(event); toolsGroup.isVisible = true; modal.setSettings('iframe', iframe); }, onContextMenuHide: function onContextMenuHide() { elementor.channels.editor.reply('contextMenu:targetView', null); }, onDestroy: function onDestroy() { if (this.contextMenu) { this.contextMenu.destroy(); } } }); /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = elementorModules.Module.extend({ errors: [], __construct: function __construct(settings) { var customValidationMethod = settings.customValidationMethod; if (customValidationMethod) { this.validationMethod = customValidationMethod; } }, getDefaultSettings: function getDefaultSettings() { return { validationTerms: {} }; }, isValid: function isValid() { var validationErrors = this.validationMethod.apply(this, arguments); if (validationErrors.length) { this.errors = validationErrors; return false; } return true; }, validationMethod: function validationMethod(newValue) { var validationTerms = this.getSettings('validationTerms'), errors = []; if (validationTerms.required) { if (!('' + newValue).length) { errors.push('Required value is empty'); } } return errors; } }); /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var Stylesheet = __webpack_require__(22), ControlsCSSParser; ControlsCSSParser = elementorModules.ViewModule.extend({ stylesheet: null, getDefaultSettings: function getDefaultSettings() { return { id: 0, settingsModel: null, dynamicParsing: {} }; }, getDefaultElements: function getDefaultElements() { return { $stylesheetElement: jQuery('