PluginProbe
Elementor Website Builder – more than just a page builder / 3.22.2
Elementor Website Builder – more than just a page builder v3.22.2
4.3.1 4.3.0 4.3.0-beta3 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 All 454 releases
← All changes | assets/js/media-hints.js +220 -131 4.3.0 → 3.22.2 View file →
@@ -1,141 +1,230 @@
1 -(function() {
1 +/*! elementor - v3.22.0 - 24-06-2024 */
2 +/******/ (() => { // webpackBootstrap
3 +/******/ var __webpack_modules__ = ({
2 4
3 -//#region \0rolldown/runtime.js
4 - var __defProp = Object.defineProperty;
5 - var __name = (target, value) => __defProp(target, "name", {
6 - value,
7 - configurable: true
8 - });
5 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
6 +/*!****************************************************************!*\
7 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
8 + \****************************************************************/
9 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9 10
10 -//#endregion
11 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
12 +function _defineProperty(obj, key, value) {
13 + key = toPropertyKey(key);
14 + if (key in obj) {
15 + Object.defineProperty(obj, key, {
16 + value: value,
17 + enumerable: true,
18 + configurable: true,
19 + writable: true
20 + });
21 + } else {
22 + obj[key] = value;
23 + }
24 + return obj;
25 +}
26 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
11 27
12 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
13 - function _typeof(o) {
14 - "@babel/helpers - typeof";
15 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
16 - return typeof o;
17 - } : function(o) {
18 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
19 - }, _typeof(o);
20 - }
28 +/***/ }),
21 29
22 -//#endregion
23 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
24 - function toPrimitive(t, r) {
25 - if ("object" != _typeof(t) || !t) return t;
26 - var e = t[Symbol.toPrimitive];
27 - if (void 0 !== e) {
28 - var i = e.call(t, r || "default");
29 - if ("object" != _typeof(i)) return i;
30 - throw new TypeError("@@toPrimitive must return a primitive value.");
31 - }
32 - return ("string" === r ? String : Number)(t);
33 - }
30 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
31 +/*!***********************************************************************!*\
32 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
33 + \***********************************************************************/
34 +/***/ ((module) => {
34 35
35 -//#endregion
36 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
37 - function toPropertyKey(t) {
38 - var i = toPrimitive(t, "string");
39 - return "symbol" == _typeof(i) ? i : i + "";
40 - }
36 +function _interopRequireDefault(obj) {
37 + return obj && obj.__esModule ? obj : {
38 + "default": obj
39 + };
40 +}
41 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
41 42
42 -//#endregion
43 -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
44 - function _defineProperty(e, r, t) {
45 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
46 - value: t,
47 - enumerable: !0,
48 - configurable: !0,
49 - writable: !0
50 - }) : e[r] = t, e;
51 - }
43 +/***/ }),
52 44
53 -//#endregion
54 -//#region assets/dev/js/admin/hints/media.js
55 - function ownKeys(e, r) {
56 - var t = Object.keys(e);
57 - if (Object.getOwnPropertySymbols) {
58 - var o = Object.getOwnPropertySymbols(e);
59 - r && (o = o.filter(function(r) {
60 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
61 - })), t.push.apply(t, o);
62 - }
63 - return t;
64 - }
65 - function _objectSpread(e) {
66 - for (var r = 1; r < arguments.length; r++) {
67 - var t = null != arguments[r] ? arguments[r] : {};
68 - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
69 - _defineProperty(e, r, t[r]);
70 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
71 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
72 - });
73 - }
74 - return e;
75 - }
76 - (function(_elementorAdminHints, _wp) {
77 - if (!((_elementorAdminHints = elementorAdminHints) !== null && _elementorAdminHints !== void 0 && _elementorAdminHints.mediaHint)) return;
78 - if (!((_wp = wp) !== null && _wp !== void 0 && (_wp = _wp.media) !== null && _wp !== void 0 && (_wp = _wp.view) !== null && _wp !== void 0 && (_wp = _wp.Attachment) !== null && _wp !== void 0 && _wp.Details)) return;
79 - wp.media.view.Attachment.Details = wp.media.view.Attachment.Details.extend({
80 - _tmpl: "<div class=\"e-hint__container\" style=\"clear:both\" data-event=\"<%= dismissible %>\">\n <div class=\"elementor-control-notice elementor-control-notice-type-<%= type %>\" data-display=\"<%= display %>\">\n <div class=\"elementor-control-notice-icon\">\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M2.25 9H3M9 2.25V3M15 9H15.75M4.2 4.2L4.725 4.725M13.8 4.2L13.275 4.725M7.27496 12.75H10.725M6.75 12C6.12035 11.5278 5.65525 10.8694 5.42057 10.1181C5.1859 9.36687 5.19355 8.56082 5.44244 7.81415C5.69133 7.06748 6.16884 6.41804 6.80734 5.95784C7.44583 5.49764 8.21294 5.25 9 5.25C9.78706 5.25 10.5542 5.49764 11.1927 5.95784C11.8312 6.41804 12.3087 7.06748 12.5576 7.81415C12.8065 8.56082 12.8141 9.36687 12.5794 10.1181C12.3448 10.8694 11.8796 11.5278 11.25 12C10.9572 12.2899 10.7367 12.6446 10.6064 13.0355C10.4761 13.4264 10.4397 13.8424 10.5 14.25C10.5 14.6478 10.342 15.0294 10.0607 15.3107C9.77936 15.592 9.39782 15.75 9 15.75C8.60218 15.75 8.22064 15.592 7.93934 15.3107C7.65804 15.0294 7.5 14.6478 7.5 14.25C7.56034 13.8424 7.52389 13.4264 7.3936 13.0355C7.2633 12.6446 7.04282 12.2899 6.75 12Z\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n </div>\n <div class=\"elementor-control-notice-main action-handler\" data-event=\"<%= button_event %>\" data-settings=\"<%= button_data %>\">\n <div class=\"elementor-control-notice-main-content\"><%= content %></div>\n <div class=\"elementor-control-notice-main-actions\">\n <% if ( typeof(button_text) !== \"undefined\" ) { %>\n <button class=\"e-btn e-<%= type %> e-btn-1\">\n <%= button_text %>\n </button>\n <% } %>\n </div>\n </div>\n <button class=\"elementor-control-notice-dismiss\" data-event=\"<%= dismissible %>\" aria-label=\"<%= dismiss %>\">\n <i class=\"eicon eicon-close\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>",
81 - template: function template(view) {
82 - var html = wp.media.template("attachment-details")(view);
83 - var dom = document.createElement("div");
84 - dom.innerHTML = html;
85 - if (!this.shouldDisplayHint(view)) return dom.innerHTML;
86 - var hint = document.createElement("div");
87 - hint.classList.add("e-hint");
88 - hint.innerHTML = _.template(this._tmpl)(elementorAdminHints.mediaHint);
89 - dom.querySelector(".attachment-info").appendChild(hint);
90 - return dom.innerHTML;
91 - },
92 - events: _objectSpread(_objectSpread({}, wp.media.view.Attachment.Details.prototype.events), {}, {
93 - "click .elementor-control-notice-dismiss": "dismiss",
94 - "click .e-hint__container a": "onHintAnchorClick",
95 - "click .e-hint__container button.e-btn-1": "onHintAction"
96 - }),
97 - shouldDisplayHint: function shouldDisplayHint(view) {
98 - var _elementorAdminHints2;
99 - if (!elementorAdminHints || !((_elementorAdminHints2 = elementorAdminHints) !== null && _elementorAdminHints2 !== void 0 && _elementorAdminHints2.mediaHint)) return false;
100 - if (window.elementorHints !== void 0) return false;
101 - if (view.type !== "image") return false;
102 - if (elementorAdminHints.mediaHint.display) return true;
103 - return this.imageNotOptimized(view);
104 - },
105 - imageNotOptimized: function imageNotOptimized(attachment) {
106 - var checks = {
107 - height: 1080,
108 - width: 1920,
109 - filesizeInBytes: 1e5
110 - };
111 - return Object.keys(checks).some(function(key) {
112 - var value = attachment[key] || false;
113 - return value && value > checks[key];
114 - });
115 - },
116 - onHintAction: function onHintAction(event) {
117 - event.preventDefault();
118 - var b64Settings = event.target.closest(".action-handler").dataset.settings;
119 - var settings = atob(b64Settings);
120 - var _JSON$parse$action_ur = JSON.parse(settings).action_url;
121 - var actionURL = _JSON$parse$action_ur === void 0 ? null : _JSON$parse$action_ur;
122 - if (actionURL) window.open(actionURL, "_blank");
123 - this.dismiss(event);
124 - },
125 - onHintAnchorClick: function onHintAnchorClick(event) {
126 - this.dismiss(event);
127 - },
128 - dismiss: function dismiss(event) {
129 - elementorCommon.ajax.addRequest("dismissed_editor_notices", { data: { dismissId: event.target.closest(".e-hint__container").dataset.event } });
130 - this.hideHint(event);
131 - },
132 - hideHint: function hideHint(event) {
133 - event.target.closest(".e-hint__container").remove();
134 - window.elementorHints = {};
135 - }
136 - });
137 - })();
45 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
46 +/*!*************************************************************!*\
47 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
48 + \*************************************************************/
49 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
138 50
139 -//#endregion
51 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
52 +function toPrimitive(t, r) {
53 + if ("object" != _typeof(t) || !t) return t;
54 + var e = t[Symbol.toPrimitive];
55 + if (void 0 !== e) {
56 + var i = e.call(t, r || "default");
57 + if ("object" != _typeof(i)) return i;
58 + throw new TypeError("@@toPrimitive must return a primitive value.");
59 + }
60 + return ("string" === r ? String : Number)(t);
61 +}
62 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
63 +
64 +/***/ }),
65 +
66 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
67 +/*!***************************************************************!*\
68 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
69 + \***************************************************************/
70 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
71 +
72 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
73 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
74 +function toPropertyKey(t) {
75 + var i = toPrimitive(t, "string");
76 + return "symbol" == _typeof(i) ? i : String(i);
77 +}
78 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
79 +
80 +/***/ }),
81 +
82 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
83 +/*!********************************************************!*\
84 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
85 + \********************************************************/
86 +/***/ ((module) => {
87 +
88 +function _typeof(o) {
89 + "@babel/helpers - typeof";
90 +
91 + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
92 + return typeof o;
93 + } : function (o) {
94 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
95 + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
96 +}
97 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
98 +
99 +/***/ })
100 +
101 +/******/ });
102 +/************************************************************************/
103 +/******/ // The module cache
104 +/******/ var __webpack_module_cache__ = {};
105 +/******/
106 +/******/ // The require function
107 +/******/ function __webpack_require__(moduleId) {
108 +/******/ // Check if module is in cache
109 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
110 +/******/ if (cachedModule !== undefined) {
111 +/******/ return cachedModule.exports;
112 +/******/ }
113 +/******/ // Create a new module (and put it into the cache)
114 +/******/ var module = __webpack_module_cache__[moduleId] = {
115 +/******/ // no module.id needed
116 +/******/ // no module.loaded needed
117 +/******/ exports: {}
118 +/******/ };
119 +/******/
120 +/******/ // Execute the module function
121 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
122 +/******/
123 +/******/ // Return the exports of the module
124 +/******/ return module.exports;
125 +/******/ }
126 +/******/
127 +/************************************************************************/
128 +var __webpack_exports__ = {};
129 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
130 +(() => {
131 +"use strict";
132 +/*!*********************************************!*\
133 + !*** ../assets/dev/js/admin/hints/media.js ***!
134 + \*********************************************/
135 +
136 +
137 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
138 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
139 +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
140 +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
141 +(function (_elementorAdminHints, _wp, _wp$media, _wp$media$view, _wp$media$view$Attach) {
142 + if (!((_elementorAdminHints = elementorAdminHints) !== null && _elementorAdminHints !== void 0 && _elementorAdminHints.mediaHint)) {
143 + return;
144 + }
145 + if (!((_wp = wp) !== null && _wp !== void 0 && (_wp$media = _wp.media) !== null && _wp$media !== void 0 && (_wp$media$view = _wp$media.view) !== null && _wp$media$view !== void 0 && (_wp$media$view$Attach = _wp$media$view.Attachment) !== null && _wp$media$view$Attach !== void 0 && _wp$media$view$Attach.Details)) {
146 + return;
147 + }
148 + wp.media.view.Attachment.Details = wp.media.view.Attachment.Details.extend({
149 + _tmpl: "<div class=\"e-hint__container\" style=\"clear:both\" data-event=\"<%= dismissible %>\">\n\t\t<div class=\"elementor-control-notice elementor-control-notice-type-<%= type %>\" data-display=\"<%= display %>\">\n\t\t\t<div class=\"elementor-control-notice-icon\">\n\t\t\t\t<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<path d=\"M2.25 9H3M9 2.25V3M15 9H15.75M4.2 4.2L4.725 4.725M13.8 4.2L13.275 4.725M7.27496 12.75H10.725M6.75 12C6.12035 11.5278 5.65525 10.8694 5.42057 10.1181C5.1859 9.36687 5.19355 8.56082 5.44244 7.81415C5.69133 7.06748 6.16884 6.41804 6.80734 5.95784C7.44583 5.49764 8.21294 5.25 9 5.25C9.78706 5.25 10.5542 5.49764 11.1927 5.95784C11.8312 6.41804 12.3087 7.06748 12.5576 7.81415C12.8065 8.56082 12.8141 9.36687 12.5794 10.1181C12.3448 10.8694 11.8796 11.5278 11.25 12C10.9572 12.2899 10.7367 12.6446 10.6064 13.0355C10.4761 13.4264 10.4397 13.8424 10.5 14.25C10.5 14.6478 10.342 15.0294 10.0607 15.3107C9.77936 15.592 9.39782 15.75 9 15.75C8.60218 15.75 8.22064 15.592 7.93934 15.3107C7.65804 15.0294 7.5 14.6478 7.5 14.25C7.56034 13.8424 7.52389 13.4264 7.3936 13.0355C7.2633 12.6446 7.04282 12.2899 6.75 12Z\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t\t<div class=\"elementor-control-notice-main action-handler\" data-event=\"<%= button_event %>\" data-settings=\"<%= button_data %>\">\n\t\t\t\t<div class=\"elementor-control-notice-main-content\"><%= content %></div>\n\t\t\t\t<div class=\"elementor-control-notice-main-actions\">\n\t\t\t\t<% if ( typeof(button_text) !== \"undefined\" ) { %>\n\t\t\t\t\t<button class=\"e-btn e-<%= type %> e-btn-1\">\n\t\t\t\t\t\t<%= button_text %>\n\t\t\t\t\t</button>\n\t\t\t\t<% } %>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<button class=\"elementor-control-notice-dismiss\" data-event=\"<%= dismissible %>\">\n\t\t\t\t<i class=\"eicon eicon-close\" aria-hidden=\"true\"></i>\n\t\t\t\t<span class=\"elementor-screen-only\"><%= dismiss %></span>\n\t\t\t</button>\n\t\t</div>\n\t</div>",
150 + template: function template(view) {
151 + // Get the template and parse it
152 + var html = wp.media.template('attachment-details')(view); // The template to extend
153 + var dom = document.createElement('div');
154 + dom.innerHTML = html;
155 + if (!this.shouldDisplayHint(view)) {
156 + return dom.innerHTML;
157 + }
158 + var hint = document.createElement('div'); // Create a new element
159 + hint.classList.add('e-hint'); // Add a class to the element for styling
160 + hint.innerHTML = _.template(this._tmpl)(elementorAdminHints.mediaHint); // Add the content to the new element
161 +
162 + // Insert the new element at the correct spot
163 + var details = dom.querySelector('.attachment-info');
164 + details.appendChild(hint); // Add new element at the correct spot
165 +
166 + return dom.innerHTML;
167 + },
168 + events: _objectSpread(_objectSpread({}, wp.media.view.Attachment.Details.prototype.events), {}, {
169 + 'click .elementor-control-notice-dismiss': 'dismiss',
170 + 'click .e-hint__container .e-btn-1': 'onHintAction',
171 + 'click .e-hint__container a': 'onHintAction'
172 + }),
173 + shouldDisplayHint: function shouldDisplayHint(view) {
174 + var _elementorAdminHints2;
175 + if (!elementorAdminHints || !((_elementorAdminHints2 = elementorAdminHints) !== null && _elementorAdminHints2 !== void 0 && _elementorAdminHints2.mediaHint)) {
176 + return false;
177 + }
178 + if (window.elementorHints !== undefined) {
179 + return false;
180 + }
181 + if (view.type !== 'image') {
182 + return false;
183 + }
184 + if (elementorAdminHints.mediaHint.display) {
185 + return true;
186 + }
187 + return this.imageNotOptimized(view);
188 + },
189 + imageNotOptimized: function imageNotOptimized(attachment) {
190 + var checks = {
191 + height: 1080,
192 + width: 1920,
193 + filesizeInBytes: 100000
194 + };
195 + return Object.keys(checks).some(function (key) {
196 + var value = attachment[key] || false;
197 + return value && value > checks[key];
198 + });
199 + },
200 + onHintAction: function onHintAction(event) {
201 + event.preventDefault();
202 + var b64Settings = event.target.closest('.action-handler').dataset.settings;
203 + var settings = atob(b64Settings);
204 + var _JSON$parse = JSON.parse(settings),
205 + _JSON$parse$action_ur = _JSON$parse.action_url,
206 + actionURL = _JSON$parse$action_ur === void 0 ? null : _JSON$parse$action_ur;
207 + if (actionURL) {
208 + window.open(actionURL, '_blank');
209 + }
210 + this.dismiss(event);
211 + },
212 + dismiss: function dismiss(event) {
213 + elementorCommon.ajax.addRequest('dismissed_editor_notices', {
214 + data: {
215 + dismissId: event.target.closest('.e-hint__container').dataset.event
216 + }
217 + });
218 + this.hideHint(event);
219 + },
220 + hideHint: function hideHint(event) {
221 + event.target.closest('.e-hint__container').remove();
222 + window.elementorHints = {};
223 + }
224 + });
140 225 })();
226 +})();
227 +
228 +/******/ })()
229 +;
141 230 //# sourceMappingURL=media-hints.js.map