PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.2
Elementor Website Builder – more than just a page builder v4.2.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / assets / js / admin-feedback.js

admin-feedback.js in Elementor Website Builder – more than just a page builder 4.2.2, at assets/js/admin-feedback.js

135 lines 4.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ "use strict";
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "@wordpress/i18n":
6 /*!**************************!*\
7 !*** external "wp.i18n" ***!
8 \**************************/
9 /***/ ((module) => {
10
11 module.exports = wp.i18n;
12
13 /***/ })
14
15 /******/ });
16 /************************************************************************/
17 /******/ // The module cache
18 /******/ var __webpack_module_cache__ = {};
19 /******/
20 /******/ // The require function
21 /******/ function __webpack_require__(moduleId) {
22 /******/ // Check if module is in cache
23 /******/ var cachedModule = __webpack_module_cache__[moduleId];
24 /******/ if (cachedModule !== undefined) {
25 /******/ return cachedModule.exports;
26 /******/ }
27 /******/ // Create a new module (and put it into the cache)
28 /******/ var module = __webpack_module_cache__[moduleId] = {
29 /******/ // no module.id needed
30 /******/ // no module.loaded needed
31 /******/ exports: {}
32 /******/ };
33 /******/
34 /******/ // Execute the module function
35 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
36 /******/
37 /******/ // Return the exports of the module
38 /******/ return module.exports;
39 /******/ }
40 /******/
41 /************************************************************************/
42 // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
43 (() => {
44 /*!************************************************!*\
45 !*** ../assets/dev/js/admin/admin-feedback.js ***!
46 \************************************************/
47 /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
48
49
50 (function ($) {
51 'use strict';
52
53 var ElementorAdminDialogApp = {
54 cacheElements: function cacheElements() {
55 this.cache = {
56 $deactivateLink: $('#the-list').find('[data-slug="elementor"] span.deactivate a'),
57 $dialogHeader: $('#elementor-deactivate-feedback-dialog-header'),
58 $dialogForm: $('#elementor-deactivate-feedback-dialog-form')
59 };
60 },
61 bindEvents: function bindEvents() {
62 var self = this;
63 self.cache.$deactivateLink.on('click', function (event) {
64 event.preventDefault();
65 self.getModal().show();
66 });
67 },
68 deactivate: function deactivate() {
69 location.href = this.cache.$deactivateLink.attr('href');
70 },
71 initModal: function initModal() {
72 var self = this,
73 modal;
74 self.getModal = function () {
75 if (!modal) {
76 modal = elementorCommon.dialogsManager.createWidget('lightbox', {
77 id: 'elementor-deactivate-feedback-modal',
78 headerMessage: self.cache.$dialogHeader,
79 message: self.cache.$dialogForm,
80 hide: {
81 onButtonClick: false
82 },
83 position: {
84 my: 'center',
85 at: 'center'
86 },
87 onReady: function onReady() {
88 DialogsManager.getWidgetType('lightbox').prototype.onReady.apply(this, arguments);
89 this.addButton({
90 name: 'submit',
91 text: __('Submit & Deactivate', 'elementor'),
92 callback: self.sendFeedback.bind(self)
93 });
94 this.addButton({
95 name: 'skip',
96 text: __('Skip & Deactivate', 'elementor'),
97 callback: function callback() {
98 self.deactivate();
99 }
100 });
101 },
102 onShow: function onShow() {
103 var $dialogModal = $('#elementor-deactivate-feedback-modal'),
104 radioSelector = '.elementor-deactivate-feedback-dialog-input';
105 $dialogModal.find(radioSelector).on('change', function () {
106 $dialogModal.attr('data-feedback-selected', $(this).val());
107 });
108 $dialogModal.find(radioSelector + ':checked').trigger('change');
109 }
110 });
111 }
112 return modal;
113 };
114 },
115 sendFeedback: function sendFeedback() {
116 var self = this,
117 formData = self.cache.$dialogForm.serialize();
118 self.getModal().getElements('submit').text('').addClass('elementor-loading');
119 $.post(ajaxurl, formData, this.deactivate.bind(this));
120 },
121 init: function init() {
122 this.initModal();
123 this.cacheElements();
124 this.bindEvents();
125 }
126 };
127 $(function () {
128 ElementorAdminDialogApp.init();
129 });
130 })(jQuery);
131 })();
132
133 /******/ })()
134 ;
135 //# sourceMappingURL=admin-feedback.js.map