File manager - Edit - /home/theblueo/tv/fb4e3b/admin.js.tar
Back
home/theblueo/tv/wp-content/plugins/elementor/assets/js/admin.js 0000604 00000156232 15214167431 0021062 0 ustar 00 /*! elementor - v2.9.8 - 21-04-2020 */ /******/ (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 = 592); /******/ }) /************************************************************************/ /******/ ({ /***/ 10: /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(60)('wks'); var uid = __webpack_require__(61); var Symbol = __webpack_require__(13).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; /***/ }), /***/ 100: /***/ (function(module, exports, __webpack_require__) { "use strict"; var at = __webpack_require__(168)(true); // `AdvanceStringIndex` abstract operation // https://tc39.github.io/ecma262/#sec-advancestringindex module.exports = function (S, index, unicode) { return index + (unicode ? at(S, index).length : 1); }; /***/ }), /***/ 101: /***/ (function(module, exports, __webpack_require__) { "use strict"; // 21.2.5.3 get RegExp.prototype.flags var anObject = __webpack_require__(18); module.exports = function () { var that = anObject(this); var result = ''; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.unicode) result += 'u'; if (that.sticky) result += 'y'; return result; }; /***/ }), /***/ 108: /***/ (function(module, exports, __webpack_require__) { module.exports = !__webpack_require__(23) && !__webpack_require__(25)(function () { return Object.defineProperty(__webpack_require__(92)('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /***/ 113: /***/ (function(module, exports, __webpack_require__) { // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = __webpack_require__(56); var IObject = __webpack_require__(97); var toObject = __webpack_require__(64); var toLength = __webpack_require__(37); var asc = __webpack_require__(130); module.exports = function (TYPE, $create) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; var create = $create || asc; return function ($this, callbackfn, that) { var O = toObject($this); var self = IObject(O); var f = ctx(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var val, res; for (;length > index; index++) if (NO_HOLES || index in self) { val = self[index]; res = f(val, index, O); if (TYPE) { if (IS_MAP) result[index] = res; // map else if (res) switch (TYPE) { case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; /***/ }), /***/ 114: /***/ (function(module, exports, __webpack_require__) { // 7.2.8 IsRegExp(argument) var isObject = __webpack_require__(24); var cof = __webpack_require__(34); var MATCH = __webpack_require__(10)('match'); module.exports = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); }; /***/ }), /***/ 119: /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(60)('native-function-to-string', Function.toString); /***/ }), /***/ 13: /***/ (function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /***/ }), /***/ 130: /***/ (function(module, exports, __webpack_require__) { // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = __webpack_require__(131); module.exports = function (original, length) { return new (speciesConstructor(original))(length); }; /***/ }), /***/ 131: /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(24); var isArray = __webpack_require__(132); var SPECIES = __webpack_require__(10)('species'); module.exports = function (original) { var C; if (isArray(original)) { C = original.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? Array : C; }; /***/ }), /***/ 132: /***/ (function(module, exports, __webpack_require__) { // 7.2.2 IsArray(argument) var cof = __webpack_require__(34); module.exports = Array.isArray || function isArray(arg) { return cof(arg) == 'Array'; }; /***/ }), /***/ 133: /***/ (function(module, exports, __webpack_require__) { // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = __webpack_require__(18); var aFunction = __webpack_require__(62); var SPECIES = __webpack_require__(10)('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; /***/ }), /***/ 15: /***/ (function(module, exports, __webpack_require__) { "use strict"; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var $export = __webpack_require__(29); var $find = __webpack_require__(113)(5); var KEY = 'find'; var forced = true; // Shouldn't skip holes if (KEY in []) Array(1)[KEY](function () { forced = false; }); $export($export.P + $export.F * forced, 'Array', { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); __webpack_require__(75)(KEY); /***/ }), /***/ 168: /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(48); var defined = __webpack_require__(33); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; /***/ }), /***/ 169: /***/ (function(module, exports, __webpack_require__) { "use strict"; var regexpExec = __webpack_require__(80); __webpack_require__(29)({ target: 'RegExp', proto: true, forced: regexpExec !== /./.exec }, { exec: regexpExec }); /***/ }), /***/ 18: /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(24); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; /***/ }), /***/ 23: /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty module.exports = !__webpack_require__(25)(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), /***/ 24: /***/ (function(module, exports) { module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; /***/ }), /***/ 25: /***/ (function(module, exports) { module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; /***/ }), /***/ 264: /***/ (function(module, exports, __webpack_require__) { "use strict"; var anObject = __webpack_require__(18); var sameValue = __webpack_require__(313); var regExpExec = __webpack_require__(85); // @@search logic __webpack_require__(86)('search', 1, function (defined, SEARCH, $search, maybeCallNative) { return [ // `String.prototype.search` method // https://tc39.github.io/ecma262/#sec-string.prototype.search function search(regexp) { var O = defined(this); var fn = regexp == undefined ? undefined : regexp[SEARCH]; return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, // `RegExp.prototype[@@search]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search function (regexp) { var res = maybeCallNative($search, regexp, this); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var previousLastIndex = rx.lastIndex; if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; var result = regExpExec(rx, S); if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; return result === null ? -1 : result.index; } ]; }); /***/ }), /***/ 28: /***/ (function(module, exports, __webpack_require__) { var dP = __webpack_require__(40); var createDesc = __webpack_require__(87); module.exports = __webpack_require__(23) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /***/ 29: /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(13); var core = __webpack_require__(41); var hide = __webpack_require__(28); var redefine = __webpack_require__(31); var ctx = __webpack_require__(56); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); var key, own, out, exp; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // extend global if (target) redefine(target, key, out, type & $export.U); // export if (exports[key] != out) hide(exports, key, exp); if (IS_PROTO && expProto[key] != out) expProto[key] = out; } }; global.core = core; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; /***/ }), /***/ 31: /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(13); var hide = __webpack_require__(28); var has = __webpack_require__(51); var SRC = __webpack_require__(61)('src'); var $toString = __webpack_require__(119); var TO_STRING = 'toString'; var TPL = ('' + $toString).split(TO_STRING); __webpack_require__(41).inspectSource = function (it) { return $toString.call(it); }; (module.exports = function (O, key, val, safe) { var isFunction = typeof val == 'function'; if (isFunction) has(val, 'name') || hide(val, 'name', key); if (O[key] === val) return; if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); if (O === global) { O[key] = val; } else if (!safe) { delete O[key]; hide(O, key, val); } else if (O[key]) { O[key] = val; } else { hide(O, key, val); } // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, TO_STRING, function toString() { return typeof this == 'function' && this[SRC] || $toString.call(this); }); /***/ }), /***/ 313: /***/ (function(module, exports) { // 7.2.9 SameValue(x, y) module.exports = Object.is || function is(x, y) { // eslint-disable-next-line no-self-compare return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; /***/ }), /***/ 33: /***/ (function(module, exports) { // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; /***/ }), /***/ 34: /***/ (function(module, exports) { var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; /***/ }), /***/ 37: /***/ (function(module, exports, __webpack_require__) { // 7.1.15 ToLength var toInteger = __webpack_require__(48); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; /***/ }), /***/ 40: /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(18); var IE8_DOM_DEFINE = __webpack_require__(108); var toPrimitive = __webpack_require__(99); var dP = Object.defineProperty; exports.f = __webpack_require__(23) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /***/ 41: /***/ (function(module, exports) { var core = module.exports = { version: '2.6.10' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), /***/ 48: /***/ (function(module, exports) { // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; /***/ }), /***/ 50: /***/ (function(module, exports, __webpack_require__) { "use strict"; var anObject = __webpack_require__(18); var toObject = __webpack_require__(64); var toLength = __webpack_require__(37); var toInteger = __webpack_require__(48); var advanceStringIndex = __webpack_require__(100); var regExpExec = __webpack_require__(85); var max = Math.max; var min = Math.min; var floor = Math.floor; var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; var maybeToString = function (it) { return it === undefined ? it : String(it); }; // @@replace logic __webpack_require__(86)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { return [ // `String.prototype.replace` method // https://tc39.github.io/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = defined(this); var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; return fn !== undefined ? fn.call(searchValue, O, replaceValue) : $replace.call(String(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace function (regexp, replaceValue) { var res = maybeCallNative($replace, regexp, this, replaceValue); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var functionalReplace = typeof replaceValue === 'function'; if (!functionalReplace) replaceValue = String(replaceValue); var global = rx.global; if (global) { var fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; while (true) { var result = regExpExec(rx, S); if (result === null) break; results.push(result); if (!global) break; var matchStr = String(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } var accumulatedResult = ''; var nextSourcePosition = 0; for (var i = 0; i < results.length; i++) { result = results[i]; var matched = String(result[0]); var position = max(min(toInteger(result.index), S.length), 0); var captures = []; // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = [matched].concat(captures, position, S); if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); var replacement = String(replaceValue.apply(undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += S.slice(nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + S.slice(nextSourcePosition); } ]; // https://tc39.github.io/ecma262/#sec-getsubstitution function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { var tailPos = position + matched.length; var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { namedCaptures = toObject(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return $replace.call(replacement, symbols, function (match, ch) { var capture; switch (ch.charAt(0)) { case '$': return '$'; case '&': return matched; case '`': return str.slice(0, position); case "'": return str.slice(tailPos); case '<': capture = namedCaptures[ch.slice(1, -1)]; break; default: // \d\d? var n = +ch; if (n === 0) return match; if (n > m) { var f = floor(n / 10); if (f === 0) return match; if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); return match; } capture = captures[n - 1]; } return capture === undefined ? '' : capture; }); } }); /***/ }), /***/ 51: /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; /***/ }), /***/ 56: /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding var aFunction = __webpack_require__(62); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /***/ 592: /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(50); __webpack_require__(264); __webpack_require__(76); __webpack_require__(15); (function ($) { var ElementorAdmin = elementorModules.ViewModule.extend({ maintenanceMode: null, config: elementorAdminConfig, getDefaultElements: function getDefaultElements() { var elements = { $switchMode: $('#elementor-switch-mode'), $goToEditLink: $('#elementor-go-to-edit-page-link'), $switchModeInput: $('#elementor-switch-mode-input'), $switchModeButton: $('#elementor-switch-mode-button'), $elementorLoader: $('.elementor-loader'), $builderEditor: $('#elementor-editor'), $importButton: $('#elementor-import-template-trigger'), $importArea: $('#elementor-import-template-area'), $settingsForm: $('#elementor-settings-form'), $settingsTabsWrapper: $('#elementor-settings-tabs-wrapper') }; elements.$settingsFormPages = elements.$settingsForm.find('.elementor-settings-form-page'); elements.$activeSettingsPage = elements.$settingsFormPages.filter('.elementor-active'); elements.$settingsTabs = elements.$settingsTabsWrapper.children(); elements.$activeSettingsTab = elements.$settingsTabs.filter('.nav-tab-active'); return elements; }, toggleStatus: function toggleStatus() { var isElementorMode = this.isElementorMode(); elementorCommon.elements.$body.toggleClass('elementor-editor-active', isElementorMode).toggleClass('elementor-editor-inactive', !isElementorMode); }, bindEvents: function bindEvents() { var self = this; self.elements.$switchModeButton.on('click', function (event) { event.preventDefault(); if (self.isElementorMode()) { elementorCommon.dialogsManager.createWidget('confirm', { message: self.translate('back_to_wordpress_editor_message'), headerMessage: self.translate('back_to_wordpress_editor_header'), strings: { confirm: self.translate('yes'), cancel: self.translate('cancel') }, defaultOption: 'confirm', onConfirm: function onConfirm() { self.elements.$switchModeInput.val(''); self.toggleStatus(); } }).show(); } else { self.elements.$switchModeInput.val(true); var $wpTitle = $('#title'); if (!$wpTitle.val()) { $wpTitle.val('Elementor #' + $('#post_ID').val()); } if (wp.autosave) { wp.autosave.server.triggerSave(); } self.animateLoader(); $(document).on('heartbeat-tick.autosave', function () { elementorCommon.elements.$window.off('beforeunload.edit-post'); location.href = self.elements.$goToEditLink.attr('href'); }); self.toggleStatus(); } }); self.elements.$goToEditLink.on('click', function () { self.animateLoader(); }); $('div.notice.elementor-message-dismissed').on('click', 'button.notice-dismiss, .elementor-button-notice-dismiss', function (event) { event.preventDefault(); $.post(ajaxurl, { action: 'elementor_set_admin_notice_viewed', notice_id: $(this).closest('.elementor-message-dismissed').data('notice_id') }); var $wrapperElm = $(this).closest('.elementor-message-dismissed'); $wrapperElm.fadeTo(100, 0, function () { $wrapperElm.slideUp(100, function () { $wrapperElm.remove(); }); }); }); $('#elementor-clear-cache-button').on('click', function (event) { event.preventDefault(); var $thisButton = $(this); $thisButton.removeClass('success').addClass('loading'); $.post(ajaxurl, { action: 'elementor_clear_cache', _nonce: $thisButton.data('nonce') }).done(function () { $thisButton.removeClass('loading').addClass('success'); }); }); $('#elementor-library-sync-button').on('click', function (event) { event.preventDefault(); var $thisButton = $(this); $thisButton.removeClass('success').addClass('loading'); $.post(ajaxurl, { action: 'elementor_reset_library', _nonce: $thisButton.data('nonce') }).done(function () { $thisButton.removeClass('loading').addClass('success'); }); }); $('#elementor-replace-url-button').on('click', function (event) { event.preventDefault(); var $this = $(this), $tr = $this.parents('tr'), $from = $tr.find('[name="from"]'), $to = $tr.find('[name="to"]'); $this.removeClass('success').addClass('loading'); $.post(ajaxurl, { action: 'elementor_replace_url', from: $from.val(), to: $to.val(), _nonce: $this.data('nonce') }).done(function (response) { $this.removeClass('loading'); if (response.success) { $this.addClass('success'); } elementorCommon.dialogsManager.createWidget('alert', { message: response.data }).show(); }); }); $('#elementor_upgrade_fa_button').on('click', function (event) { event.preventDefault(); var $updateButton = $(this); $updateButton.addClass('loading'); elementorCommon.dialogsManager.createWidget('confirm', { id: 'confirm_fa_migration_admin_modal', message: self.translate('confirm_fa_migration_admin_modal_body'), headerMessage: self.translate('confirm_fa_migration_admin_modal_head'), strings: { confirm: self.translate('yes'), cancel: self.translate('cancel') }, defaultOption: 'confirm', onConfirm: function onConfirm() { $updateButton.removeClass('error').addClass('loading'); $.post(ajaxurl, $updateButton.data()).done(function (response) { $updateButton.removeClass('loading').addClass('success'); $('#elementor_upgrade_fa_button').parent().append(response.data.message); var redirectTo = (location.search.split('redirect_to=')[1] || '').split('&')[0]; if (redirectTo) { location.href = decodeURIComponent(redirectTo); return; } history.go(-1); }).fail(function () { $updateButton.removeClass('loading').addClass('error'); }); }, onCancel: function onCancel() { $updateButton.removeClass('loading').addClass('error'); } }).show(); }); self.elements.$settingsTabs.on({ click: function click(event) { event.preventDefault(); event.currentTarget.focus(); // Safari does not focus the tab automatically }, focus: function focus() { // Using focus event to enable navigation by tab key var hrefWithoutHash = location.href.replace(/#.*/, ''); history.pushState({}, '', hrefWithoutHash + this.hash); self.goToSettingsTabFromHash(); } }); $('select.elementor-rollback-select').on('change', function () { var $this = $(this), $rollbackButton = $this.next('.elementor-rollback-button'), placeholderText = $rollbackButton.data('placeholder-text'), placeholderUrl = $rollbackButton.data('placeholder-url'); $rollbackButton.html(placeholderText.replace('{VERSION}', $this.val())); $rollbackButton.attr('href', placeholderUrl.replace('VERSION', $this.val())); }).trigger('change'); $('.elementor-rollback-button').on('click', function (event) { event.preventDefault(); var $this = $(this); elementorCommon.dialogsManager.createWidget('confirm', { headerMessage: self.translate('rollback_to_previous_version'), message: self.translate('rollback_confirm'), strings: { confirm: self.translate('yes'), cancel: self.translate('cancel') }, onConfirm: function onConfirm() { $this.addClass('loading'); location.href = $this.attr('href'); } }).show(); }); $('.elementor_css_print_method select').on('change', function () { var $descriptions = $('.elementor-css-print-method-description'); $descriptions.hide(); $descriptions.filter('[data-value="' + $(this).val() + '"]').show(); }).trigger('change'); }, onInit: function onInit() { elementorModules.ViewModule.prototype.onInit.apply(this, arguments); this.initTemplatesImport(); this.initMaintenanceMode(); this.goToSettingsTabFromHash(); this.roleManager.init(); }, initTemplatesImport: function initTemplatesImport() { if (!elementorCommon.elements.$body.hasClass('post-type-elementor_library')) { return; } var self = this, $importButton = self.elements.$importButton, $importArea = self.elements.$importArea; self.elements.$formAnchor = $('h1'); $('#wpbody-content').find('.page-title-action:last').after($importButton); self.elements.$formAnchor.after($importArea); $importButton.on('click', function () { $('#elementor-import-template-area').toggle(); }); }, initMaintenanceMode: function initMaintenanceMode() { var MaintenanceMode = __webpack_require__(593); this.maintenanceMode = new MaintenanceMode(); }, isElementorMode: function isElementorMode() { return !!this.elements.$switchModeInput.val(); }, animateLoader: function animateLoader() { this.elements.$goToEditLink.addClass('elementor-animate'); }, goToSettingsTabFromHash: function goToSettingsTabFromHash() { var hash = location.hash.slice(1); if (hash) { this.goToSettingsTab(hash); } }, goToSettingsTab: function goToSettingsTab(tabName) { var $pages = this.elements.$settingsFormPages; if (!$pages.length) { return; } var $activePage = $pages.filter('#' + tabName); this.elements.$activeSettingsPage.removeClass('elementor-active'); this.elements.$activeSettingsTab.removeClass('nav-tab-active'); var $activeTab = this.elements.$settingsTabs.filter('#elementor-settings-' + tabName); $activePage.addClass('elementor-active'); $activeTab.addClass('nav-tab-active'); this.elements.$settingsForm.attr('action', 'options.php#' + tabName); this.elements.$activeSettingsPage = $activePage; this.elements.$activeSettingsTab = $activeTab; }, translate: function translate(stringKey, templateArgs) { return elementorCommon.translate(stringKey, null, templateArgs, this.config.i18n); }, roleManager: { selectors: { body: 'elementor-role-manager', row: '.elementor-role-row', label: '.elementor-role-label', excludedIndicator: '.elementor-role-excluded-indicator', excludedField: 'input[name="elementor_exclude_user_roles[]"]', controlsContainer: '.elementor-role-controls', toggleHandle: '.elementor-role-toggle', arrowUp: 'dashicons-arrow-up', arrowDown: 'dashicons-arrow-down' }, toggle: function toggle($trigger) { var self = this, $row = $trigger.closest(self.selectors.row), $toggleHandleIcon = $row.find(self.selectors.toggleHandle).find('.dashicons'), $controls = $row.find(self.selectors.controlsContainer); $controls.toggleClass('hidden'); if ($controls.hasClass('hidden')) { $toggleHandleIcon.removeClass(self.selectors.arrowUp).addClass(self.selectors.arrowDown); } else { $toggleHandleIcon.removeClass(self.selectors.arrowDown).addClass(self.selectors.arrowUp); } self.updateLabel($row); }, updateLabel: function updateLabel($row) { var self = this, $indicator = $row.find(self.selectors.excludedIndicator), excluded = $row.find(self.selectors.excludedField).is(':checked'); if (excluded) { $indicator.html($indicator.data('excluded-label')); } else { $indicator.html(''); } self.setAdvancedState($row, excluded); }, setAdvancedState: function setAdvancedState($row, state) { var self = this, $controls = $row.find('input[type="checkbox"]').not(self.selectors.excludedField); $controls.each(function (index, input) { $(input).prop('disabled', state); }); }, bind: function bind() { var self = this; $(document).on('click', self.selectors.label + ',' + self.selectors.toggleHandle, function (event) { event.stopPropagation(); event.preventDefault(); self.toggle($(this)); }).on('change', self.selectors.excludedField, function () { self.updateLabel($(this).closest(self.selectors.row)); }); }, init: function init() { var self = this; if (!$('body[class*="' + self.selectors.body + '"]').length) { return; } self.bind(); $(self.selectors.row).each(function (index, row) { self.updateLabel($(row)); }); } } }); $(function () { window.elementorAdmin = new ElementorAdmin(); elementorCommon.elements.$window.trigger('elementor/admin/init'); }); })(jQuery); /***/ }), /***/ 593: /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(15); module.exports = elementorModules.ViewModule.extend({ getDefaultSettings: function getDefaultSettings() { return { selectors: { modeSelect: '.elementor_maintenance_mode_mode select', maintenanceModeTable: '#tab-maintenance_mode table', maintenanceModeDescriptions: '.elementor-maintenance-mode-description', excludeModeSelect: '.elementor_maintenance_mode_exclude_mode select', excludeRolesArea: '.elementor_maintenance_mode_exclude_roles', templateSelect: '.elementor_maintenance_mode_template_id select', editTemplateButton: '.elementor-edit-template', maintenanceModeError: '.elementor-maintenance-mode-error' }, classes: { isEnabled: 'elementor-maintenance-mode-is-enabled' } }; }, getDefaultElements: function getDefaultElements() { var elements = {}, selectors = this.getSettings('selectors'); elements.$modeSelect = jQuery(selectors.modeSelect); elements.$maintenanceModeTable = elements.$modeSelect.parents(selectors.maintenanceModeTable); elements.$excludeModeSelect = elements.$maintenanceModeTable.find(selectors.excludeModeSelect); elements.$excludeRolesArea = elements.$maintenanceModeTable.find(selectors.excludeRolesArea); elements.$templateSelect = elements.$maintenanceModeTable.find(selectors.templateSelect); elements.$editTemplateButton = elements.$maintenanceModeTable.find(selectors.editTemplateButton); elements.$maintenanceModeDescriptions = elements.$maintenanceModeTable.find(selectors.maintenanceModeDescriptions); elements.$maintenanceModeError = elements.$maintenanceModeTable.find(selectors.maintenanceModeError); return elements; }, handleModeSelectChange: function handleModeSelectChange() { var settings = this.getSettings(), elements = this.elements; elements.$maintenanceModeTable.toggleClass(settings.classes.isEnabled, !!elements.$modeSelect.val()); elements.$maintenanceModeDescriptions.hide(); elements.$maintenanceModeDescriptions.filter('[data-value="' + elements.$modeSelect.val() + '"]').show(); }, handleExcludeModeSelectChange: function handleExcludeModeSelectChange() { var elements = this.elements; elements.$excludeRolesArea.toggle('custom' === elements.$excludeModeSelect.val()); }, handleTemplateSelectChange: function handleTemplateSelectChange() { var elements = this.elements; var templateID = elements.$templateSelect.val(); if (!templateID) { elements.$editTemplateButton.hide(); elements.$maintenanceModeError.show(); return; } var editUrl = elementorAdmin.config.home_url + '?p=' + templateID + '&elementor'; elements.$editTemplateButton.prop('href', editUrl).show(); elements.$maintenanceModeError.hide(); }, bindEvents: function bindEvents() { var elements = this.elements; elements.$modeSelect.on('change', this.handleModeSelectChange.bind(this)); elements.$excludeModeSelect.on('change', this.handleExcludeModeSelectChange.bind(this)); elements.$templateSelect.on('change', this.handleTemplateSelectChange.bind(this)); }, onAdminInit: function onAdminInit() { this.handleModeSelectChange(); this.handleExcludeModeSelectChange(); this.handleTemplateSelectChange(); }, onInit: function onInit() { elementorModules.ViewModule.prototype.onInit.apply(this, arguments); elementorCommon.elements.$window.on('elementor/admin/init', this.onAdminInit); } }); /***/ }), /***/ 60: /***/ (function(module, exports, __webpack_require__) { var core = __webpack_require__(41); var global = __webpack_require__(13); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, mode: __webpack_require__(94) ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); /***/ }), /***/ 61: /***/ (function(module, exports) { var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; /***/ }), /***/ 62: /***/ (function(module, exports) { module.exports = function (it) { if (typeof it != 'function') throw TypeError(it + ' is not a function!'); return it; }; /***/ }), /***/ 64: /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) var defined = __webpack_require__(33); module.exports = function (it) { return Object(defined(it)); }; /***/ }), /***/ 75: /***/ (function(module, exports, __webpack_require__) { // 22.1.3.31 Array.prototype[@@unscopables] var UNSCOPABLES = __webpack_require__(10)('unscopables'); var ArrayProto = Array.prototype; if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(28)(ArrayProto, UNSCOPABLES, {}); module.exports = function (key) { ArrayProto[UNSCOPABLES][key] = true; }; /***/ }), /***/ 76: /***/ (function(module, exports, __webpack_require__) { "use strict"; var isRegExp = __webpack_require__(114); var anObject = __webpack_require__(18); var speciesConstructor = __webpack_require__(133); var advanceStringIndex = __webpack_require__(100); var toLength = __webpack_require__(37); var callRegExpExec = __webpack_require__(85); var regexpExec = __webpack_require__(80); var fails = __webpack_require__(25); var $min = Math.min; var $push = [].push; var $SPLIT = 'split'; var LENGTH = 'length'; var LAST_INDEX = 'lastIndex'; var MAX_UINT32 = 0xffffffff; // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); }); // @@split logic __webpack_require__(86)('split', 2, function (defined, SPLIT, $split, maybeCallNative) { var internalSplit; if ( 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || '.'[$SPLIT](/()()/)[LENGTH] > 1 || ''[$SPLIT](/.?/)[LENGTH] ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { var string = String(this); if (separator === undefined && limit === 0) return []; // If `separator` is not a regex, use native split if (!isRegExp(separator)) return $split.call(string, separator, limit); var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); var lastLastIndex = 0; var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0; // Make `global` and avoid `lastIndex` issues by working with a copy var separatorCopy = new RegExp(separator.source, flags + 'g'); var match, lastIndex, lastLength; while (match = regexpExec.call(separatorCopy, string)) { lastIndex = separatorCopy[LAST_INDEX]; if (lastIndex > lastLastIndex) { output.push(string.slice(lastLastIndex, match.index)); if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); lastLength = match[0][LENGTH]; lastLastIndex = lastIndex; if (output[LENGTH] >= splitLimit) break; } if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop } if (lastLastIndex === string[LENGTH]) { if (lastLength || !separatorCopy.test('')) output.push(''); } else output.push(string.slice(lastLastIndex)); return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; }; // Chakra, V8 } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); }; } else { internalSplit = $split; } return [ // `String.prototype.split` method // https://tc39.github.io/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = defined(this); var splitter = separator == undefined ? undefined : separator[SPLIT]; return splitter !== undefined ? splitter.call(separator, O, limit) : internalSplit.call(String(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function (regexp, limit) { var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var C = speciesConstructor(rx, RegExp); var unicodeMatching = rx.unicode; var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (SUPPORTS_Y ? 'y' : 'g'); // ^(? + rx + ) is needed, in combination with some S slicing, to // simulate the 'y' flag. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; var p = 0; var q = 0; var A = []; while (q < S.length) { splitter.lastIndex = SUPPORTS_Y ? q : 0; var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); var e; if ( z === null || (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p ) { q = advanceStringIndex(S, q, unicodeMatching); } else { A.push(S.slice(p, q)); if (A.length === lim) return A; for (var i = 1; i <= z.length - 1; i++) { A.push(z[i]); if (A.length === lim) return A; } q = p = e; } } A.push(S.slice(p)); return A; } ]; }); /***/ }), /***/ 80: /***/ (function(module, exports, __webpack_require__) { "use strict"; var regexpFlags = __webpack_require__(101); var nativeExec = RegExp.prototype.exec; // This always refers to the native implementation, because the // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, // which loads this file before patching the method. var nativeReplace = String.prototype.replace; var patchedExec = nativeExec; var LAST_INDEX = 'lastIndex'; var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/, re2 = /b*/g; nativeExec.call(re1, 'a'); nativeExec.call(re2, 'a'); return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; })(); // nonparticipating capturing group, copied from es5-shim's String#split patch. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; if (PATCH) { patchedExec = function exec(str) { var re = this; var lastIndex, reCopy, match, i; if (NPCG_INCLUDED) { reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; match = nativeExec.call(re, str); if (UPDATES_LAST_INDEX_WRONG && match) { re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; } if (NPCG_INCLUDED && match && match.length > 1) { // Fix browsers whose `exec` methods don't consistently return `undefined` // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ // eslint-disable-next-line no-loop-func nativeReplace.call(match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } return match; }; } module.exports = patchedExec; /***/ }), /***/ 85: /***/ (function(module, exports, __webpack_require__) { "use strict"; var classof = __webpack_require__(98); var builtinExec = RegExp.prototype.exec; // `RegExpExec` abstract operation // https://tc39.github.io/ecma262/#sec-regexpexec module.exports = function (R, S) { var exec = R.exec; if (typeof exec === 'function') { var result = exec.call(R, S); if (typeof result !== 'object') { throw new TypeError('RegExp exec method returned something other than an Object or null'); } return result; } if (classof(R) !== 'RegExp') { throw new TypeError('RegExp#exec called on incompatible receiver'); } return builtinExec.call(R, S); }; /***/ }), /***/ 86: /***/ (function(module, exports, __webpack_require__) { "use strict"; __webpack_require__(169); var redefine = __webpack_require__(31); var hide = __webpack_require__(28); var fails = __webpack_require__(25); var defined = __webpack_require__(33); var wks = __webpack_require__(10); var regexpExec = __webpack_require__(80); var SPECIES = wks('species'); var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { // #replace needs built-in support for named groups. // #match works fine because it just return the exec results, even if it has // a "grops" property. var re = /./; re.exec = function () { var result = []; result.groups = { a: '7' }; return result; }; return ''.replace(re, '$<a>') !== '7'; }); var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec var re = /(?:)/; var originalExec = re.exec; re.exec = function () { return originalExec.apply(this, arguments); }; var result = 'ab'.split(re); return result.length === 2 && result[0] === 'a' && result[1] === 'b'; })(); module.exports = function (KEY, length, exec) { var SYMBOL = wks(KEY); var DELEGATES_TO_SYMBOL = !fails(function () { // String methods call symbol-named RegEp methods var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) != 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { // Symbol-named RegExp methods call .exec var execCalled = false; var re = /a/; re.exec = function () { execCalled = true; return null; }; if (KEY === 'split') { // RegExp[@@split] doesn't call the regex's exec method, but first creates // a new one. We need to return the patched regex when creating the new one. re.constructor = {}; re.constructor[SPECIES] = function () { return re; }; } re[SYMBOL](''); return !execCalled; }) : undefined; if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) ) { var nativeRegExpMethod = /./[SYMBOL]; var fns = exec( defined, SYMBOL, ''[KEY], function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { if (regexp.exec === regexpExec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { // The native String method already delegates to @@method (this // polyfilled function), leasing to infinite recursion. // We avoid it by directly calling the native @@method method. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; } return { done: true, value: nativeMethod.call(str, regexp, arg2) }; } return { done: false }; } ); var strfn = fns[0]; var rxfn = fns[1]; redefine(String.prototype, KEY, strfn); hide(RegExp.prototype, SYMBOL, length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) // 21.2.5.11 RegExp.prototype[@@split](string, limit) ? function (string, arg) { return rxfn.call(string, this, arg); } // 21.2.5.6 RegExp.prototype[@@match](string) // 21.2.5.9 RegExp.prototype[@@search](string) : function (string) { return rxfn.call(string, this); } ); } }; /***/ }), /***/ 87: /***/ (function(module, exports) { module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /***/ 92: /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(24); var document = __webpack_require__(13).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; /***/ }), /***/ 94: /***/ (function(module, exports) { module.exports = false; /***/ }), /***/ 97: /***/ (function(module, exports, __webpack_require__) { // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = __webpack_require__(34); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; /***/ }), /***/ 98: /***/ (function(module, exports, __webpack_require__) { // getting tag from 19.1.3.6 Object.prototype.toString() var cof = __webpack_require__(34); var TAG = __webpack_require__(10)('toStringTag'); // ES3 wrong here var ARG = cof(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (e) { /* empty */ } }; module.exports = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; /***/ }), /***/ 99: /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = __webpack_require__(24); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; /***/ }) /******/ }); //# sourceMappingURL=admin.js.map home/theblueo/www/wp-content/themes/thebos/assets/js/admin.js 0000604 00000015732 15214234371 0020350 0 ustar 00 /** * wp-color-picker-alpha * * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker * Only run in input and is defined data alpha in true * * Version: 1.0.0 * https://github.com/23r9i0/wp-color-picker-alpha * Copyright (c) 2015 Sergio P.A. (23r9i0). * Licensed under the GPLv2 license. */ ( function( $ ) { // Variable for some backgrounds var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg=='; // Add support for return rbga in Color Plugin Color.fn.toString = function() { if ( this._alpha < 1 ) return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' ); var hex = parseInt( this._color, 10 ).toString( 16 ); if ( this.error ) return ''; if ( hex.length < 6 ) { for ( var i = 6 - hex.length - 1; i >= 0; i-- ) { hex = '0' + hex; } } return '#' + hex; }; /** * Overwrite iris */ $.widget( 'a8c.iris', $.a8c.iris, { _create: function() { this._super(); // Global option for check is mode rbga is enabled this.options.alpha = this.element.data( 'alpha' ) || false; // Is not input disabled if ( ! this.element.is( ':input' ) ) { this.options.alpha = false; } if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) { var self = this, el = self.element, _html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>', aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ), aSlider = aContainer.find( '.iris-slider-offset-alpha' ), controls = { aContainer: aContainer, aSlider: aSlider }; // Set default width for input reset self.options.defaultWidth = el.width(); // Push new controls $.each( controls, function( k, v ){ self.controls[k] = v; }); // Change size strip and add margin for sliders self.controls.square.css({'margin-right': '0'}); var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ), stripsMargin = emptyWidth/6, stripsWidth = (emptyWidth/2) - stripsMargin; $.each( [ 'aContainer', 'strip' ], function( k, v ) { self.controls[v].width( stripsWidth ).css({ 'margin-left': stripsMargin + 'px' }); }); // Add new slider self._initControls(); // For updated widget self._change(); } }, _initControls: function() { this._super(); if ( this.options.alpha ) { var self = this, controls = self.controls; controls.aSlider.slider({ orientation: 'vertical', min: 0, max: 100, step: 1, value: parseInt( self._color._alpha*100 ), slide: function( event, ui ) { // Update alpha value self._color._alpha = parseFloat( ui.value/100 ); self._change.apply( self, arguments ); } }); } }, _change: function() { this._super(); if ( this.options.alpha ) { var self = this, el = self.element, controls = self.controls, alpha = parseInt( self._color._alpha*100 ), color = self._color.toRgb(), gradient = [ 'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%', 'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%' ], defaultWidth = self.options.defaultWidth, target = self.picker.closest('.wp-picker-container').find( '.wp-color-result' ), targetStyle = 'background:url(' + image + ')'; // Generate background slider alpha, only for CSS3 old browser fuck!! :) controls.aContainer.css({ 'background': 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' }); // Override default background color in input // The wpColorPicker not change background color if ( target.length > 0 ) { target.attr( 'style', targetStyle ).html('<span />'); target.find('span').css({ 'width': '100%', 'height': '100%', 'position': 'absolute', 'top': 0, 'left': 0, 'border-top-left-radius': '3px', 'border-bottom-left-radius': '3px', 'background': self._color.toString() }); } if ( target.hasClass('wp-picker-open') ) { // Update alpha value controls.aSlider.slider( 'value', alpha ); /** * Disabled change opacity in default slider Saturation ( only is alpha enabled ) * and change input width for view all value */ if ( self._color._alpha < 1 ) { var style = controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ); controls.strip.attr( 'style', style ); el.width( parseInt( defaultWidth+100 ) ); var reset = el.data('reset-alpha') || false; if ( reset ) { self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() { self._color._alpha = 1; self.active = 'external'; self._change(); }); } } else { el.width( defaultWidth ); } } } } } ); }( jQuery ) ); // Auto Call plugin is class is color-picker jQuery( document ).ready( function( $ ) { $( '.color-picker' ).wpColorPicker(); } ); home/theblueo/tv/wp-content/plugins/wpforms-lite/assets/js/admin.js 0000604 00000145677 15214273132 0021527 0 ustar 00 /* global wpforms_admin, jconfirm, wpCookies, Choices, List */ ;(function($) { 'use strict'; // Global settings access. var s; // Admin object. var WPFormsAdmin = { // Settings. settings: { iconActivate: '<i class="fa fa-toggle-on fa-flip-horizontal" aria-hidden="true"></i>', iconDeactivate: '<i class="fa fa-toggle-on" aria-hidden="true"></i>', iconInstall: '<i class="fa fa-cloud-download" aria-hidden="true"></i>', iconSpinner: '<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>', mediaFrame: false }, /** * Start the engine. * * @since 1.3.9 */ init: function() { // Settings shortcut. s = this.settings; // Document ready. $( document ).ready( WPFormsAdmin.ready ); // Forms Overview. WPFormsAdmin.initFormOverview(); // Entries Single (Details). WPFormsAdmin.initEntriesSingle(); // Entries List. WPFormsAdmin.initEntriesList(); // Welcome activation. WPFormsAdmin.initWelcome(); // Addons List. WPFormsAdmin.initAddons(); // Settings. WPFormsAdmin.initSettings(); // Tools. WPFormsAdmin.initTools(); // Upgrades (Tools view). WPFormsAdmin.initUpgrades(); }, /** * Document ready. * * @since 1.3.9 */ ready: function() { // To prevent jumping (since WP core moves the notices with js), // they are hidden initially with CSS, then revealed below with JS, // which runs after they have been moved. $( '.notice' ).show(); // If there are screen options we have to move them. $( '#screen-meta-links, #screen-meta' ).prependTo( '#wpforms-header-temp' ).show(); // Init fancy selects via choices.js. WPFormsAdmin.initChoicesJS(); // Init checkbox multi selects columns. WPFormsAdmin.initCheckboxMultiselectColumns(); // Init color pickers via minicolors.js. $( '.wpforms-color-picker' ).minicolors(); // Init fancy File Uploads. $( '.wpforms-file-upload' ).each( function(){ var $input = $( this ).find( 'input[type=file]' ), $label = $( this ).find( 'label' ), labelVal = $label.html(); $input.on( 'change', function( event ) { var fileName = ''; if ( this.files && this.files.length > 1 ) { fileName = ( this.getAttribute( 'data-multiple-caption' ) || '' ).replace( '{count}', this.files.length ); } else if( event.target.value ) { fileName = event.target.value.split( '\\' ).pop(); } if ( fileName ) { $label.find( '.fld' ).html( fileName ); } else { $label.html( labelVal ); } }); // Firefox bug fix. $input.on( 'focus', function(){ $input.addClass( 'has-focus' ); }).on( 'blur', function(){ $input.removeClass( 'has-focus' ); }); }); // jquery-confirm defaults. jconfirm.defaults = { closeIcon: true, backgroundDismiss: true, escapeKey: true, animationBounce: 1, useBootstrap: false, theme: 'modern', boxWidth: '400px', animateFromElement: false }; // Upgrade information modal for upgrade links. $( document ).on( 'click', '.wpforms-upgrade-modal', function() { $.alert({ title: false, content: wpforms_admin.upgrade_modal, icon: 'fa fa-info-circle', type: 'blue', boxWidth: '565px', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ] } } }); }); // Lity lightbox. WPFormsAdmin.initLity(); // Flyout Menu. WPFormsAdmin.initFlyoutMenu(); // Action available for each binding. $( document ).trigger( 'wpformsReady' ); }, /** * Initialize Choices JS elements. * * @since 1.4.2 */ initChoicesJS: function() { $( '.choicesjs-select' ).each( function() { var $this = $( this ), args = { searchEnabled: false }; if ( $this.attr( 'multiple' ) ) { args.searchEnabled = true; args.removeItemButton = true; } if ( $this.data( 'placeholder' ) ) { args.placeholderValue = $this.data( 'placeholder' ); } if ( $this.data( 'sorting' ) === 'off' ) { args.shouldSort = false; } if ( $this.data( 'search' ) ) { args.searchEnabled = true; } // Translate default strings. args.loadingText = wpforms_admin.choicesjs_loading; args.noResultsText = wpforms_admin.choicesjs_no_results; args.noChoicesText = wpforms_admin.choicesjs_no_choices; args.itemSelectText = wpforms_admin.choicesjs_item_select; $this.data( 'choicesjs', new Choices( $this[0], args ) ); }); }, /** * Initilize checkbox mulit-select columns. * * @since 1.4.2 */ initCheckboxMultiselectColumns: function() { $( document ).on( 'change', '.checkbox-multiselect-columns input', function() { var $this = $( this ), $parent = $this.parent(), $container = $this.closest( '.checkbox-multiselect-columns' ), label = $parent.text(), itemID = 'check-item-' + $this.val(), $item = $container.find( '#' + itemID ); if ( $this.prop( 'checked' ) ) { $this.parent().addClass( 'checked' ); if ( ! $item.length ) { $container.find('.second-column ul').append( '<li id="'+itemID+'">'+label+'</li>' ); } } else { $this.parent().removeClass( 'checked' ); $container.find( '#' + itemID ).remove(); } }); $( document ).on( 'click', '.checkbox-multiselect-columns .all', function( event ) { event.preventDefault(); $( this ).closest( '.checkbox-multiselect-columns' ).find( 'input[type=checkbox]' ).prop( 'checked', true ).trigger( 'change' ); $( this ).remove(); }); }, //--------------------------------------------------------------------// // Forms Overview //--------------------------------------------------------------------// /** * Element bindings for Form Overview page. * * @since 1.3.9 */ initFormOverview: function() { // Confirm form entry deletion and duplications. $( document ).on( 'click', '#wpforms-overview .wp-list-table .delete a, #wpforms-overview .wp-list-table .duplicate a', function( event ) { event.preventDefault(); var url = $( this ).attr( 'href' ), msg = $( this ).parent().hasClass( 'delete' ) ? wpforms_admin.form_delete_confirm : wpforms_admin.form_duplicate_confirm; // Trigger alert modal to confirm. $.confirm({ title: false, content: msg, backgroundDismiss: false, closeIcon: false, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function(){ window.location = url; } }, cancel: { text: wpforms_admin.cancel, keys: [ 'esc' ] } } }); }); }, //--------------------------------------------------------------------// // Entry Single (Details) //--------------------------------------------------------------------// /** * Element bindings for Entries Single (Details) page. * * @since 1.3.9 */ initEntriesSingle: function() { // Entry navigation hotkeys. // We only want to listen on the applicable admin page. if ( 'wpforms-entries' === WPFormsAdmin.getQueryString( 'page' ) && 'details' === WPFormsAdmin.getQueryString( 'view' ) ) { WPFormsAdmin.entryHotkeys(); } // Confirm entry deletion. $( document ).on( 'click', '#wpforms-entries-single .submitdelete', function( event ) { event.preventDefault(); var url = $( this ).attr( 'href' ); // Trigger alert modal to confirm. $.confirm({ title: false, content: wpforms_admin.entry_delete_confirm, backgroundDismiss: false, closeIcon: false, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function(){ window.location = url; } }, cancel: { text: wpforms_admin.cancel, keys: [ 'esc' ] } } }); }); // Open Print preview in new window. $( document ).on( 'click', '#wpforms-entries-single .wpforms-entry-print a', function( event ) { event.preventDefault(); window.open( $( this ).attr( 'href' ) ); }); // Toggle displaying empty fields. $( document ).on( 'click', '#wpforms-entries-single .wpforms-empty-field-toggle', function( event ) { event.preventDefault(); // Handle cookie. if ( wpCookies.get( 'wpforms_entry_hide_empty' ) === 'true' ) { // User was hiding empty fields, so now display them. wpCookies.remove( 'wpforms_entry_hide_empty' ); $( this ).text( wpforms_admin.entry_empty_fields_hide ); } else { // User was seeing empty fields, so now hide them. wpCookies.set( 'wpforms_entry_hide_empty', 'true', 2592000 ); // 1month. $( this ).text( wpforms_admin.entry_empty_fields_show ); } $( '.wpforms-entry-field.empty, .wpforms-edit-entry-field.empty' ).toggle(); }); // Display notes editor. $( document ).on( 'click', '#wpforms-entries-single .wpforms-entry-notes-new .add', function( event ) { event.preventDefault(); $( this ).hide().next( 'form' ).slideToggle(); }); // Cancel note. $( document ).on( 'click', '#wpforms-entries-single .wpforms-entry-notes-new .cancel', function( event ) { event.preventDefault(); $( this ).closest( 'form' ).slideToggle(); $('.wpforms-entry-notes-new .add').show(); }); // Delete note. $( document ).on( 'click', '#wpforms-entries-single .wpforms-entry-notes-byline .note-delete', function( event ) { event.preventDefault(); var url = $( this ).attr( 'href' ); // Trigger alert modal to confirm. $.confirm({ title: false, content: wpforms_admin.entry_note_delete_confirm, backgroundDismiss: false, closeIcon: false, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function(){ window.location = url; } }, cancel: { text: wpforms_admin.cancel, keys: [ 'esc' ] } } }); }); }, /** * Hotkeys for Entries Single (Details) page. * * j triggers previous entry, k triggers next entry. * * @since 1.4.0 */ entryHotkeys: function() { $( document ).keydown( function( event ) { if ( 74 === event.keyCode && ! WPFormsAdmin.isFormTypeNode( event.target.nodeName ) ) { // j key has been pressed outside of a form element, go to // the previous entry. var prevEntry = $('#wpforms-entry-prev-link').attr( 'href' ); if ( '#' !== prevEntry ) { window.location.href = prevEntry; } } else if ( 75 === event.keyCode && ! WPFormsAdmin.isFormTypeNode( event.target.nodeName ) ) { // k key has been pressed outside of a form element, go to // the previous entry. var nextEntry = $('#wpforms-entry-next-link').attr( 'href' ); if ( '#' !== nextEntry ) { window.location.href = nextEntry; } } }); }, //--------------------------------------------------------------------// // Entry List //--------------------------------------------------------------------// /** * Element bindings for Entries List table page. * * @since 1.3.9 */ initEntriesList: function() { $( document ).on( 'click', '#wpforms-entries-table-edit-columns', function( event ) { event.preventDefault(); WPFormsAdmin.entriesListFieldColumn(); }); // Toggle form selector dropdown. $( document ).on( 'click', '#wpforms-entries-list .form-selector .toggle', function( event ) { event.preventDefault(); $( this ).toggleClass( 'active' ).next( '.form-list' ).toggle(); }); // Confirm entry deletion. $( document ).on( 'click', '#wpforms-entries-list .wp-list-table .delete', function( event ) { event.preventDefault(); var url = $( this ).attr( 'href' ); // Trigger alert modal to confirm. $.confirm({ title: false, content: wpforms_admin.entry_delete_confirm, backgroundDismiss: false, closeIcon: false, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function(){ window.location = url; } }, cancel: { text: wpforms_admin.cancel, keys: [ 'esc' ] } } }); }); // Toggle entry stars. $( document ).on( 'click', '#wpforms-entries-list .wp-list-table .indicator-star', function( event ) { event.preventDefault(); var $this = $( this ), task = '', total = Number( $( '#wpforms-entries-list .starred-num' ).text() ), id = $this.data( 'id' ), formId = $this.data( 'form-id' ); if ( $this.hasClass( 'star' ) ) { task = 'star'; total++; $this.attr( 'title', wpforms_admin.entry_unstar ); } else { task = 'unstar'; total--; $this.attr( 'title', wpforms_admin.entry_star ); } $this.toggleClass( 'star unstar' ); $( '#wpforms-entries-list .starred-num' ).text( total ); var data = { task : task, action : 'wpforms_entry_list_star', nonce : wpforms_admin.nonce, entryId : id, formId : formId, }; $.post( wpforms_admin.ajax_url, data ); }); // Toggle entry read state. $( document ).on( 'click', '#wpforms-entries-list .wp-list-table .indicator-read', function( event ) { event.preventDefault(); var $this = $( this ), task = '', total = Number( $( '#wpforms-entries-list .unread-num' ).text() ), id = $this.data( 'id' ); if ( $this.hasClass( 'read' ) ) { task = 'read'; total--; $this.attr( 'title', wpforms_admin.entry_unread ); } else { task = 'unread'; total++; $this.attr( 'title', wpforms_admin.entry_read ); } $this.toggleClass( 'read unread' ); $( '#wpforms-entries-list .unread-num' ).text( total ); var data = { task : task, action : 'wpforms_entry_list_read', nonce : wpforms_admin.nonce, entryId : id, formId : $this.data( 'form-id' ), }; $.post( wpforms_admin.ajax_url, data ); }); // Confirm mass entry deletion - this deletes ALL entries. $( document ).on( 'click', '#wpforms-entries-list .form-details-actions-deleteall', function( event ) { event.preventDefault(); var url = $( this ).attr( 'href' ); // Trigger alert modal to confirm. $.confirm({ title: wpforms_admin.heads_up, content: wpforms_admin.entry_delete_all_confirm, backgroundDismiss: false, closeIcon: false, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function(){ window.location = url; } }, cancel: { text: wpforms_admin.cancel, keys: [ 'esc' ] } } }); }); // Check for new form entries using Heartbeat API. $( document ).on( 'heartbeat-send', function ( event, data ) { var $entriesList = $( '#wpforms-entries-list' ); // Works on entry list page only. if ( ! $entriesList.length || $entriesList.find( '.wpforms-dash-widget' ).length ) { return; } var last_entry_id = $entriesList.find( '#wpforms-entries-table' ).data( 'last-entry-id' ); // When entries list is filtered, there is no data param at all. if ( typeof last_entry_id === 'undefined' ) { return; } data.wpforms_new_entries_entry_id = last_entry_id; data.wpforms_new_entries_form_id = $entriesList.find( 'input[name=form_id]' ).val(); } ); // Display entries list notification if Heartbeat API new form entries check is successful. $( document ).on( 'heartbeat-tick', function ( event, data ) { var columnCount; var $entriesList = $( '#wpforms-entries-list' ); // Works on entry list page only. if ( ! $entriesList.length ) { return; } if ( ! data.wpforms_new_entries_notification ) { return; } columnCount = $entriesList.find( '.wp-list-table thead tr' ).first().children().length; if ( ! $entriesList.find( '.new-entries-notification' ).length ) { $entriesList.find( '.wp-list-table thead' ) .append( '<tr class="new-entries-notification"><td colspan="' + columnCount + '"><a href=""></a></td></tr>' ); } $entriesList.find( '.new-entries-notification a' ) .text( data.wpforms_new_entries_notification ) .slideDown( { duration: 500, start : function () { $( this ).css( { display: 'block' } ); } } ); } ); }, /** * Display settings to change the entry list field columns/ * * @since 1.4.0 */ entriesListFieldColumn: function() { $.alert({ title: wpforms_admin.entry_field_columns, boxWidth: '500px', content: s.iconSpinner + $( '#wpforms-field-column-select' ).html(), onContentReady: function() { var $modalContent = this.$content, $select = $modalContent.find( 'select' ), choices = new Choices( $select[0], { shouldSort: false, removeItemButton: true, placeholderValue: wpforms_admin.choicesjs_fields_select + '...', loadingText: wpforms_admin.choicesjs_loading, noResultsText: wpforms_admin.choicesjs_no_results, noChoicesText: wpforms_admin.choicesjs_no_choices, itemSelectText: wpforms_admin.choicesjs_item_select, callbackOnInit: function() { $modalContent.find( '.fa' ).remove(); $modalContent.find( 'form' ).show(); } }); $( '.jconfirm-content-pane, .jconfirm-box' ).css( 'overflow','visible' ); choices.passedElement.element.addEventListener( 'change', function() { // Without `true` parameter dropdown will be hidden together with modal window when `Enter` is pressed. choices.hideDropdown( true ); }, false ); }, buttons: { confirm: { text: wpforms_admin.save_refresh, btnClass: 'btn-confirm', keys: ['enter'], action: function() { this.$content.find( 'form' ).submit(); } }, cancel: { text: wpforms_admin.cancel, keys: [ 'esc' ] } } }); }, //--------------------------------------------------------------------// // Welcome Activation. //--------------------------------------------------------------------// /** * Welcome activation page. * * @since 1.3.9 */ initWelcome: function() { // Open modal and play How To video. $( document ).on( 'click', '#wpforms-welcome .play-video', function( event ) { event.preventDefault(); var video = '<div class="video-container"><iframe width="1280" height="720" src="https://www.youtube-nocookie.com/embed/o2nE1P74WxQ?rel=0&showinfo=0&autoplay=1" frameborder="0" allowfullscreen></iframe></div>'; $.dialog({ title: false, content: video, closeIcon: true, boxWidth: '70%' }); }); }, //--------------------------------------------------------------------// // Addons List. //--------------------------------------------------------------------// /** * Element bindings for Addons List page. * * @since 1.3.9 */ initAddons: function() { // Some actions have to be delayed to document.ready. $( document ).on( 'wpformsReady', function() { // Only run on the addons page. if ( ! $( '#wpforms-admin-addons' ).length ) { return; } // Display all addon boxes as the same height. $( '.addon-item .details' ).matchHeight( { byrow: false, property: 'height' } ); // Addons searching. if ( $('#wpforms-admin-addons-list').length ) { var addonSearch = new List( 'wpforms-admin-addons-list', { valueNames: [ 'addon-name' ] } ); $( '#wpforms-admin-addons-search' ).on( 'keyup', function () { var searchTerm = $( this ).val(), $heading = $( '#addons-heading' ); if ( searchTerm ) { $heading.text( wpforms_admin.addon_search ); } else { $heading.text( $heading.data( 'text' ) ); } addonSearch.search( searchTerm ); } ); } }); // Toggle an addon state. $( document ).on( 'click', '#wpforms-admin-addons .addon-item button', function( event ) { event.preventDefault(); if ( $( this ).hasClass( 'disabled' ) ) { return false; } WPFormsAdmin.addonToggle( $( this ) ); }); }, /** * Toggle addon state. * * @since 1.3.9 */ addonToggle: function( $btn ) { var $addon = $btn.closest( '.addon-item' ), plugin = $btn.attr( 'data-plugin' ), plugin_type = $btn.attr( 'data-type' ), action, cssClass, statusText, buttonText, errorText, successText; if ( $btn.hasClass( 'status-go-to-url' ) ) { // Open url in new tab. window.open( $btn.attr('data-plugin'), '_blank' ); return; } $btn.prop( 'disabled', true ).addClass( 'loading' ); $btn.html( s.iconSpinner ); if ( $btn.hasClass( 'status-active' ) ) { // Deactivate. action = 'wpforms_deactivate_addon'; cssClass = 'status-inactive'; if ( plugin_type === 'plugin' ) { cssClass += ' button button-secondary'; } statusText = wpforms_admin.addon_inactive; buttonText = wpforms_admin.addon_activate; if ( plugin_type === 'addon' ) { buttonText = s.iconActivate + buttonText; } errorText = s.iconDeactivate + wpforms_admin.addon_deactivate; } else if ( $btn.hasClass( 'status-inactive' ) ) { // Activate. action = 'wpforms_activate_addon'; cssClass = 'status-active'; if ( plugin_type === 'plugin' ) { cssClass += ' button button-secondary disabled'; } statusText = wpforms_admin.addon_active; buttonText = wpforms_admin.addon_deactivate; if ( plugin_type === 'addon' ) { buttonText = s.iconDeactivate + buttonText; } else if ( plugin_type === 'plugin' ) { buttonText = wpforms_admin.addon_activated; } errorText = s.iconActivate + wpforms_admin.addon_activate; } else if ( $btn.hasClass( 'status-download' ) ) { // Install & Activate. action = 'wpforms_install_addon'; cssClass = 'status-active'; if ( plugin_type === 'plugin' ) { cssClass += ' button disabled'; } statusText = wpforms_admin.addon_active; buttonText = wpforms_admin.addon_activated; if ( plugin_type === 'addon' ) { buttonText = s.iconActivate + wpforms_admin.addon_deactivate; } errorText = s.iconInstall + wpforms_admin.addon_activate; } else { return; } var data = { action: action, nonce : wpforms_admin.nonce, plugin: plugin, type : plugin_type }; $.post( wpforms_admin.ajax_url, data, function( res ) { if ( res.success ) { if ( 'wpforms_install_addon' === action ) { $btn.attr( 'data-plugin', res.data.basename ); successText = res.data.msg; if ( ! res.data.is_activated ) { cssClass = 'status-inactive'; if ( plugin_type === 'plugin' ) { cssClass = 'button'; } statusText = wpforms_admin.addon_inactive; buttonText = s.iconActivate + wpforms_admin.addon_activate; } } else { successText = res.data; } $addon.find( '.actions' ).append( '<div class="msg success">'+successText+'</div>' ); $addon.find( 'span.status-label' ) .removeClass( 'status-active status-inactive status-download' ) .addClass( cssClass ) .removeClass( 'button button-primary button-secondary disabled' ) .text( statusText ); $btn .removeClass( 'status-active status-inactive status-download' ) .removeClass( 'button button-primary button-secondary disabled' ) .addClass( cssClass ).html( buttonText ); } else { if ( 'download_failed' === res.data[0].code ) { if ( plugin_type === 'addon' ) { $addon.find( '.actions' ).append( '<div class="msg error">'+wpforms_admin.addon_error+'</div>' ); } else { $addon.find( '.actions' ).append( '<div class="msg error">'+wpforms_admin.plugin_error+'</div>' ); } } else { $addon.find( '.actions' ).append( '<div class="msg error">'+res.data+'</div>' ); } $btn.html( errorText ); } $btn.prop( 'disabled', false ).removeClass( 'loading' ); // Automatically clear addon messages after 3 seconds. setTimeout( function() { $( '.addon-item .msg' ).remove(); }, 3000 ); }).fail( function( xhr ) { console.log( xhr.responseText ); }); }, //--------------------------------------------------------------------// // Settings. //--------------------------------------------------------------------// /** * Element bindings for Settings page. * * @since 1.3.9 */ initSettings: function() { // On ready events. $( document ).on( 'wpformsReady', function() { // Only proceed if we're on the settings page. if ( ! $( '#wpforms-settings' ).length ) { return; } // Watch for hashes and scroll to if found. // Display all addon boxes as the same height. var integrationFocus = WPFormsAdmin.getQueryString( 'wpforms-integration' ), jumpTo = WPFormsAdmin.getQueryString( 'jump' ); if ( integrationFocus ) { $( 'body' ).animate({ scrollTop: $( '#wpforms-integration-'+integrationFocus ).offset().top }, 1000 ); } else if ( jumpTo ) { $( 'body' ).animate({ scrollTop: $( '#'+jumpTo ).offset().top }, 1000 ); } // Settings conditional logic. $( '.wpforms-admin-settings-form' ).conditions( [ // Misc > Disable User Cookies visibility. { conditions: { element: '#wpforms-setting-gdpr', type: 'checked', operator: 'is' }, actions: { if: { element: '#wpforms-setting-row-gdpr-disable-uuid,#wpforms-setting-row-gdpr-disable-details', action: 'show' }, else : { element: '#wpforms-setting-row-gdpr-disable-uuid,#wpforms-setting-row-gdpr-disable-details', action: 'hide' } }, effect: 'appear' }, // reCAPTCHA > Score Threshold. { conditions: { element: 'input[name=recaptcha-type]:checked', type: 'value', operator: '=', condition: 'v3' }, actions: { if: { element: '#wpforms-setting-row-recaptcha-v3-threshold', action: 'show' }, else : { element: '#wpforms-setting-row-recaptcha-v3-threshold', action: 'hide' } }, effect: 'appear' } ] ); }); // Form styles plugin setting. $( document ).on( 'change', '#wpforms-setting-disable-css', function() { WPFormsAdmin.settingsFormStylesAlert( $( this ).val() ); }); // Image upload fields. $( document ).on( 'click', '.wpforms-setting-row-image button', function( event ) { event.preventDefault(); WPFormsAdmin.imageUploadModal( $( this ) ); }); // Verify license key. $( document ).on( 'click', '#wpforms-setting-license-key-verify', function( event ) { event.preventDefault(); WPFormsAdmin.licenseVerify( $( this ) ); }); // Deactivate license key. $( document ).on( 'click', '#wpforms-setting-license-key-deactivate', function( event ) { event.preventDefault(); WPFormsAdmin.licenseDeactivate( $( this ) ); }); // Refresh license key. $( document ).on( 'click', '#wpforms-setting-license-key-refresh', function( event ) { event.preventDefault(); WPFormsAdmin.licenseRefresh( $( this ) ); }); /** * @todo Refactor providers settings tab. Code below is legacy. */ // Integration connect. $( document ).on( 'click', '.wpforms-settings-provider-connect', function( event ) { event.preventDefault(); var button = $( this ); WPFormsAdmin.integrationConnect( button ); }); // Integration account disconnect. $( document ).on( 'click', '.wpforms-settings-provider-accounts-list a', function( event ) { event.preventDefault(); WPFormsAdmin.integrationDisconnect( $( this ) ); }); // Integration individual display toggling. $( document ).on( 'click', '.wpforms-settings-provider:not(.focus-out) .wpforms-settings-provider-header', function( event ) { event.preventDefault(); $( this ).parent().find( '.wpforms-settings-provider-accounts' ).slideToggle(); $( this ).parent().find( '.wpforms-settings-provider-logo i' ).toggleClass( 'fa-chevron-right fa-chevron-down' ); }); // Integration accounts display toggling. $( document ).on( 'click', '.wpforms-settings-provider-accounts-toggle a', function( event ) { event.preventDefault(); var $connectFields = $( this ).parent().next( '.wpforms-settings-provider-accounts-connect' ); $connectFields.find( 'input[type=text], input[type=password]' ).val(''); $connectFields.slideToggle(); }); }, /** * Alert users if they change form styles to something that may give * unexpected results. * * @since 1.5.0 */ settingsFormStylesAlert: function( value ) { if ( '2' === value ) { var msg = wpforms_admin.settings_form_style_base; } else if ( '3' === value ) { var msg = wpforms_admin.settings_form_style_none; } else { return; } $.alert({ title: wpforms_admin.heads_up, content: msg, backgroundDismiss: false, closeIcon: false, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ] } } }); }, /** * Image upload modal window. * * @since 1.3.0 */ imageUploadModal: function( el ) { if ( s.media_frame ) { s.media_frame.open(); return; } var $setting = $( el ).closest( '.wpforms-setting-field' ); s.media_frame = wp.media.frames.wpforms_media_frame = wp.media({ className: 'media-frame wpforms-media-frame', frame: 'select', multiple: false, title: wpforms_admin.upload_image_title, library: { type: 'image' }, button: { text: wpforms_admin.upload_image_button } }); s.media_frame.on( 'select', function(){ // Grab our attachment selection and construct a JSON representation of the model. var media_attachment = s.media_frame.state().get( 'selection' ).first().toJSON(); // Send the attachment URL to our custom input field via jQuery. $setting.find( 'input[type=text]' ).val( media_attachment.url ); $setting.find( 'img' ).remove(); $setting.prepend( '<img src="'+media_attachment.url+'">' ); }); // Now that everything has been set, let's open up the frame. s.media_frame.open(); }, /** * Verify a license key. * * @since 1.3.9 */ licenseVerify: function( el ) { var $this = $( el ), $row = $this.closest( '.wpforms-setting-row' ), buttonWidth = $this.outerWidth(), buttonLabel = $this.text(), data = { action: 'wpforms_verify_license', nonce: wpforms_admin.nonce, license: $('#wpforms-setting-license-key').val() }; $this.html( s.iconSpinner ).css( 'width', buttonWidth ).prop( 'disabled', true ); $.post( wpforms_admin.ajax_url, data, function( res ) { var icon = 'fa fa-check-circle', color = 'green', msg; if ( res.success ){ msg = res.data.msg; $row.find( '.type, .desc, #wpforms-setting-license-key-deactivate' ).show(); $row.find( '.type strong' ).text( res.data.type ); $('.wpforms-license-notice').remove(); } else { icon = 'fa fa-exclamation-circle'; color = 'orange'; msg = res.data; $row.find( '.type, .desc, #wpforms-setting-license-key-deactivate' ).hide(); } $.alert({ title: false, content: msg, icon: icon, type: color, buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ] } } }); $this.html( buttonLabel ).css( 'width', 'auto' ).prop( 'disabled', false ); }).fail( function( xhr ) { console.log( xhr.responseText ); }); }, /** * Verify a license key. * * @since 1.3.9 */ licenseDeactivate: function( el ) { var $this = $( el ), $row = $this.closest( '.wpforms-setting-row' ), buttonWidth = $this.outerWidth(), buttonLabel = $this.text(), data = { action: 'wpforms_deactivate_license', nonce: wpforms_admin.nonce }; $this.html( s.iconSpinner ).css( 'width', buttonWidth ).prop( 'disabled', true ); $.post( wpforms_admin.ajax_url, data, function( res ) { var icon = 'fa fa-info-circle', color = 'blue', msg = res.data; if ( res.success ){ $row.find( '#wpforms-setting-license-key' ).val(''); $row.find( '.type, .desc, #wpforms-setting-license-key-deactivate' ).hide(); } else { icon = 'fa fa-exclamation-circle'; color = 'orange'; } $.alert({ title: false, content: msg, icon: icon, type: color, buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ] } } }); $this.html( buttonLabel ).css( 'width', 'auto' ).prop( 'disabled', false ); }).fail( function( xhr ) { console.log( xhr.responseText ); }); }, /** * Refresh a license key. * * @since 1.3.9 */ licenseRefresh: function( el ) { var $this = $( el ), $row = $this.closest( '.wpforms-setting-row' ), data = { action: 'wpforms_refresh_license', nonce: wpforms_admin.nonce, license: $('#wpforms-setting-license-key').val() }; $.post( wpforms_admin.ajax_url, data, function( res ) { var icon = 'fa fa-check-circle', color = 'green', msg; if ( res.success ){ msg = res.data.msg; $row.find( '.type strong' ).text( res.data.type ); } else { icon = 'fa fa-exclamation-circle'; color = 'orange'; msg = res.data; $row.find( '.type, .desc, #wpforms-setting-license-key-deactivate' ).hide(); } $.alert({ title: false, content: msg, icon: icon, type: color, buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ] } } }); }).fail( function( xhr ) { console.log( xhr.responseText ); }); }, /** * Connect integration provider account. * * @param $btn Button (.wpforms-settings-provider-connect) that was clicked to establish connection. * * @since 1.3.9 */ integrationConnect: function( $btn ) { var buttonWidth = $btn.outerWidth(), buttonLabel = $btn.text(), $provider = $btn.closest( '.wpforms-settings-provider' ), data = { action : 'wpforms_settings_provider_add_' + $btn.data( 'provider' ), data : $btn.closest( 'form' ).serialize(), provider: $btn.data( 'provider' ), nonce : wpforms_admin.nonce }; $btn.html( 'Connecting...' ).css( 'width', buttonWidth ).prop( 'disabled', true ); $.post( wpforms_admin.ajax_url, data, function( res ) { if ( res.success ){ $provider.find( '.wpforms-settings-provider-accounts-list ul' ).append( res.data.html ); $provider.addClass( 'connected' ); $btn.closest( '.wpforms-settings-provider-accounts-connect' ).slideToggle(); } else { var msg = wpforms_admin.provider_auth_error; if ( res.hasOwnProperty( 'data' ) && res.data.hasOwnProperty( 'error_msg' ) ) { msg += "\n" + res.data.error_msg; // jshint ignore:line } $.alert({ title: false, content: msg, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ] } } }); } $btn.html( buttonLabel ).css( 'width', 'auto' ).prop( 'disabled', false ); }).fail( function( xhr ) { console.log( xhr.responseText ); }); }, /** * Remove integration provider account. * * @since 1.3.9 */ integrationDisconnect: function( el ) { var $this = $( el ), $provider = $this.parents('.wpforms-settings-provider'), data = { action : 'wpforms_settings_provider_disconnect_' + $this.data( 'provider' ), provider: $this.data( 'provider' ), key : $this.data( 'key'), nonce : wpforms_admin.nonce }; $.confirm({ title: wpforms_admin.heads_up, content: wpforms_admin.provider_delete_confirm, backgroundDismiss: false, closeIcon: false, icon: 'fa fa-exclamation-circle', type: 'orange', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ], action: function(){ $.post( wpforms_admin.ajax_url, data, function( res ) { if ( res.success ){ $this.parent().parent().remove(); // Hide Connected status label if no more integrations are linked. var numberOfIntegrations = $provider.find( '.wpforms-settings-provider-accounts-list li' ).length; if ( typeof numberOfIntegrations === 'undefined' || numberOfIntegrations === 0 ) { $provider.removeClass( 'connected' ); } } else { console.log( res ); } }).fail( function( xhr ) { console.log( xhr.responseText ); }); } }, cancel: { text: wpforms_admin.cancel, keys: [ 'esc' ] } } }); }, //--------------------------------------------------------------------// // Tools. //--------------------------------------------------------------------// /** * Element bindings for Tools page. * * @since 1.4.2 */ initTools: function() { // Run import for a specific provider. $( document ).on( 'click', '#wpforms-ssl-verify', function( event ) { event.preventDefault(); WPFormsAdmin.verifySSLConnection(); }); // Run import for a specific provider. $( document ).on( 'click', '#wpforms-importer-forms-submit', function( event ) { event.preventDefault(); // Check to confirm user as selected a form. if ( $( '#wpforms-importer-forms input:checked' ).length ) { var ids = []; $( '#wpforms-importer-forms input:checked' ).each( function ( i ) { ids[i] = $( this ).val(); }); if ( ! wpforms_admin.isPro ) { // We need to analyze the forms before starting the // actual import. WPFormsAdmin.analyzeForms( ids ); } else { // Begin the import process. WPFormsAdmin.importForms( ids ); } } else { // User didn't actually select a form so alert them. $.alert({ title: false, content: wpforms_admin.importer_forms_required, icon: 'fa fa-info-circle', type: 'blue', buttons: { confirm: { text: wpforms_admin.ok, btnClass: 'btn-confirm', keys: [ 'enter' ] } } }); } }); // Continue import after analyzing. $( document ).on( 'click', '#wpforms-importer-continue-submit', function( event ) { event.preventDefault(); WPFormsAdmin.importForms( s.formIDs ); }); }, /** * Perform test connection to verify that the current web host * can successfully make outbound SSL connections. * * @since 1.4.5 */ verifySSLConnection: function() { var $btn = $( '#wpforms-ssl-verify' ), btnLabel = $btn.text(), btnWidth = $btn.outerWidth(), $settings = $btn.parent(), data = { action: 'wpforms_verify_ssl', nonce: wpforms_admin.nonce }; $btn.css( 'width', btnWidth ).prop( 'disabled', true ).text( wpforms_admin.testing ); // Trigger AJAX to test connection $.post( wpforms_admin.ajax_url, data, function( res ) { console.log( res ); // Remove any previous alerts. $settings.find( '.wpforms-alert, .wpforms-ssl-error' ).remove(); if ( res.success ){ $btn.before( '<div class="wpforms-alert wpforms-alert-success">' + res.data.msg + '</div>' ); } if ( ! res.success && res.data.msg ) { $btn.before( '<div class="wpforms-alert wpforms-alert-danger">' + res.data.msg + '</div>' ); } if ( ! res.success && res.data.debug ) { $btn.before( '<div class="wpforms-ssl-error pre-error">' + res.data.debug + '</div>' ); } $btn.css( 'width', btnWidth ).prop( 'disabled', false ).text( btnLabel ); }); }, /** * Begins the process of analyzing the forms. * * This runs for non-Pro installs to check if any of the forms to be * imported contain fields * not currently available. * * @since 1.4.2 */ analyzeForms: function( forms ) { var $processAnalyze = $( '#wpforms-importer-analyze' ); // Display total number of forms we have to import. $processAnalyze.find( '.form-total' ).text( forms.length ); $processAnalyze.find( '.form-current' ).text( '1' ); // Hide the form select section. $( '#wpforms-importer-forms' ).hide(); // Show Analyze status. $processAnalyze.show(); // Create global analyze queue. s.analyzeQueue = forms; s.analyzed = 0; s.analyzeUpgrade = []; s.formIDs = forms; // Analyze the first form in the queue. WPFormsAdmin.analyzeForm(); }, /** * Analyze a single form from the queue. * * @since 1.4.2 */ analyzeForm: function() { var $analyzeSettings = $( '#wpforms-importer-analyze' ), formID = _.first( s.analyzeQueue ), provider = WPFormsAdmin.getQueryString( 'provider' ), data = { action: 'wpforms_import_form_' + provider, analyze: 1, form_id: formID, nonce: wpforms_admin.nonce }; // Trigger AJAX analyze for this form. $.post( wpforms_admin.ajax_url, data, function( res ) { if ( res.success ){ if ( ! _.isEmpty( res.data.upgrade_plain ) || ! _.isEmpty( res.data.upgrade_omit ) ) { s.analyzeUpgrade.push({ name: res.data.name, fields: _.union( res.data.upgrade_omit, res.data.upgrade_plain ) }); } // Remove this form ID from the queue. s.analyzeQueue = _.without( s.analyzeQueue, formID ); s.analyzed++; if ( _.isEmpty( s.analyzeQueue ) ) { if ( _.isEmpty( s.analyzeUpgrade ) ) { // Continue to import forms as no Pro fields were // found. WPFormsAdmin.importForms( s.formIDs ); } else { // We found Pro fields, so alert the user. var upgradeDetails = wp.template( 'wpforms-importer-upgrade' ); $analyzeSettings.find( '.upgrade' ).append( upgradeDetails( s.analyzeUpgrade ) ); $analyzeSettings.find( '.upgrade' ).show(); $analyzeSettings.find( '.process-analyze' ).hide(); } } else { // Analyze next form in the queue. $analyzeSettings.find( '.form-current' ).text( s.analyzed+1 ); WPFormsAdmin.analyzeForm(); } } }); }, /** * Begins the process of importing the forms. * * @since 1.4.2 */ importForms: function( forms ) { var $processSettings = $( '#wpforms-importer-process' ); // Display total number of forms we have to import. $processSettings.find( '.form-total' ).text( forms.length ); $processSettings.find( '.form-current' ).text( '1' ); // Hide the form select and form analyze sections. $( '#wpforms-importer-forms, #wpforms-importer-analyze' ).hide(); // Show processing status. $processSettings.show(); // Create global import queue. s.importQueue = forms; s.imported = 0; // Import the first form in the queue. WPFormsAdmin.importForm(); }, /** * Imports a single form from the import queue. * * @since 1.4.2 */ importForm: function() { var $processSettings = $( '#wpforms-importer-process' ), formID = _.first( s.importQueue ), provider = WPFormsAdmin.getQueryString( 'provider' ), data = { action: 'wpforms_import_form_' + provider, form_id: formID, nonce: wpforms_admin.nonce }; // Trigger AJAX import for this form. $.post( wpforms_admin.ajax_url, data, function( res ) { if ( res.success ){ var statusUpdate; if ( res.data.error ) { statusUpdate = wp.template( 'wpforms-importer-status-error' ); } else { statusUpdate = wp.template( 'wpforms-importer-status-update' ); } $processSettings.find( '.status' ).prepend( statusUpdate( res.data ) ); $processSettings.find( '.status' ).show(); // Remove this form ID from the queue. s.importQueue = _.without( s.importQueue, formID ); s.imported++; if ( _.isEmpty( s.importQueue ) ) { $processSettings.find( '.process-count' ).hide(); $processSettings.find( '.forms-completed' ).text( s.imported ); $processSettings.find( '.process-completed' ).show(); } else { // Import next form in the queue. $processSettings.find( '.form-current' ).text( s.imported+1 ); WPFormsAdmin.importForm(); } } }); }, //--------------------------------------------------------------------// // Upgrades (Tabs view). //--------------------------------------------------------------------// /** * Element bindings for Tools page. * * @since 1.4.3 */ initUpgrades: function() { // Prepare to run the v1.4.3 upgrade routine. $( document ).on( 'click', '#wpforms-upgrade-143 button', function( event ) { event.preventDefault(); var $this = $( this ), buttonWidth = $this.outerWidth(), $status = $( '#wpforms-upgrade-143 .status' ), data = { action: 'wpforms_upgrade_143', nonce: wpforms_admin.nonce, init: true, incomplete: $this.data( 'incomplete' ) }; // Change the button to indicate we are doing initial processing. $this.html( s.iconSpinner ).css( 'width', buttonWidth ).prop( 'disabled', true ); // Get the total number of entries, then kick off the routine. $.post( wpforms_admin.ajax_url, data, function( res ) { if ( res.success ){ // Set initial values. s.upgraded = Number( res.data.upgraded ); s.upgradeTotal = Number( res.data.total ); var percent = Math.round( ( Number( s.upgraded ) / Number( s.upgradeTotal ) ) * 100 ); // Show the status area. $this.remove(); $status.find( '.bar' ).css( 'width', percent + '%' ); $status.show().find( '.total' ).text( s.upgradeTotal ); $status.find( '.current' ).text( s.upgraded ); $status.find( '.percent' ).text( percent + '%' ); // Begin the actual upgrade routine. WPFormsAdmin.upgrade143(); } }); }); }, /** * The v1.4.3 entry fields upgrade routine. * * @since 1.4.3 */ upgrade143: function() { var $status = $( '#wpforms-upgrade-143 .status' ), data = { action: 'wpforms_upgrade_143', nonce: wpforms_admin.nonce, upgraded: s.upgraded }; // Get the total number of entries, then kick off the routine. $.post( wpforms_admin.ajax_url, data, function( res ) { if ( res.success ){ s.upgraded = Number( s.upgraded ) + Number( res.data.count ); var percent = Math.round( ( Number( s.upgraded ) / Number( s.upgradeTotal ) ) * 100 ); // Update progress bar. $status.find( '.bar' ).css( 'width', percent + '%' ); if ( Number( res.data.count ) < 10 ) { // This batch completed the upgrade routine. $status.find( '.progress-bar' ).addClass( 'complete' ); $status.find( '.msg' ).text( wpforms_admin.upgrade_completed ); } else { $status.find( '.current' ).text( s.upgraded ); $status.find( '.percent' ).text( percent + '%' ); // Batch the next round of entries. WPFormsAdmin.upgrade143(); } } }); }, /** * Element bindings for Flyout Menu. * * @since 1.5.7 */ initFlyoutMenu: function() { // Flyout Menu Elements. var $flyoutMenu = $( '#wpforms-flyout' ); if ( $flyoutMenu.length === 0 ) { return; } var $head = $flyoutMenu.find( '.wpforms-flyout-head' ), $sullie = $head.find( 'img' ), menu = { state: 'inactive', srcInactive: $sullie.attr( 'src' ), srcActive: $sullie.data( 'active' ), }; // Click on the menu head icon. $head.on( 'click', function( e ) { e.preventDefault(); if ( menu.state === 'active' ) { $flyoutMenu.removeClass( 'opened' ); $sullie.attr( 'src', menu.srcInactive ); menu.state = 'inactive'; } else { $flyoutMenu.addClass( 'opened' ); $sullie.attr( 'src', menu.srcActive ); menu.state = 'active'; } } ); // Page elements and other values. var $wpfooter = $( '#wpfooter' ); if ( $wpfooter.length === 0 ) { return; } var $overlap = $( '#wpforms-overview, #wpforms-entries-list' ), wpfooterTop = $wpfooter.offset().top, wpfooterBottom = wpfooterTop + $wpfooter.height(), overlapBottom = $overlap.length > 0 ? $overlap.offset().top + $overlap.height() + 85 : 0; // Hide menu if scrolled down to the bottom of the page. $( window ).on( 'resize scroll', _.debounce( function( e ) { var viewTop = $( window ).scrollTop(), viewBottom = viewTop + $( window ).height(); if ( wpfooterBottom <= viewBottom && wpfooterTop >= viewTop && overlapBottom > viewBottom ) { $flyoutMenu.addClass( 'out' ); } else { $flyoutMenu.removeClass( 'out' ); } }, 50 ) ); $( window ).trigger( 'scroll' ); }, /** * Lity improvements. * * @since 1.5.8 */ initLity: function() { // Use `data-lity-srcset` opener's attribute for add srcset to full image in opened lightbox. $( document ).on( 'lity:ready', function( event, instance ) { var $el = instance.element(), $opener = instance.opener(), srcset = typeof $opener !== 'undefined' ? $opener.data( 'lity-srcset' ) : ''; if ( typeof srcset !== 'undefined' && srcset !== '' ) { $el.find( '.lity-content img' ).attr( 'srcset', srcset ); } } ); }, //--------------------------------------------------------------------// // Helper functions. //--------------------------------------------------------------------// /** * Return if the target nodeName is a form element. * * @since 1.4.0 */ isFormTypeNode: function( name ) { name = name || false; if ( 'TEXTAREA' === name || 'INPUT' === name || 'SELECT' === name ){ return true; } return false; }, /** * Get query string in a URL. * * @since 1.3.9 */ getQueryString: function( name ) { var match = new RegExp( '[?&]' + name + '=([^&]*)' ).exec( window.location.search ); return match && decodeURIComponent( match[1].replace(/\+/g, ' ') ); }, /** * Debug output helper. * * @since 1.4.4 * @param msg */ debug: function( msg ) { if ( WPFormsAdmin.isDebug() ) { if ( typeof msg === 'object' || msg.constructor === Array ) { console.log( 'WPForms Debug:' ); console.log( msg ); } else { console.log( 'WPForms Debug: ' + msg ); } } }, /** * Is debug mode. * * @since 1.4.4 */ isDebug: function() { return ( window.location.hash && '#wpformsdebug' === window.location.hash ); } }; WPFormsAdmin.init(); window.WPFormsAdmin = WPFormsAdmin; })( jQuery );
| ver. 1.4 |
Github
|
.
| PHP 7.0.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings