PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.3
Elementor Website Builder – more than just a page builder v4.0.3
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 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | assets/js/media-hints.js +215 -131 4.3.0-beta24.0.3 View file →
@@ -1,141 +1,225 @@
1 -(function() {
1 +/******/ (() => { // webpackBootstrap
2 +/******/ var __webpack_modules__ = ({
2 3
3 -//#region \0rolldown/runtime.js
4 - var __defProp = Object.defineProperty;
5 - var __name = (target, value) => __defProp(target, "name", {
6 - value,
7 - configurable: true
8 - });
4 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
5 +/*!****************************************************************!*\
6 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
7 + \****************************************************************/
8 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
9 9
10 -//#endregion
10 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
11 +function _defineProperty(e, r, t) {
12 + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
13 + value: t,
14 + enumerable: !0,
15 + configurable: !0,
16 + writable: !0
17 + }) : e[r] = t, e;
18 +}
19 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
11 20
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 - }
21 +/***/ }),
21 22
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 - }
23 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
24 +/*!***********************************************************************!*\
25 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
26 + \***********************************************************************/
27 +/***/ ((module) => {
34 28
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 - }
29 +function _interopRequireDefault(e) {
30 + return e && e.__esModule ? e : {
31 + "default": e
32 + };
33 +}
34 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
41 35
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 - }
36 +/***/ }),
52 37
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 - })();
38 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
39 +/*!*************************************************************!*\
40 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
41 + \*************************************************************/
42 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
138 43
139 -//#endregion
44 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
45 +function toPrimitive(t, r) {
46 + if ("object" != _typeof(t) || !t) return t;
47 + var e = t[Symbol.toPrimitive];
48 + if (void 0 !== e) {
49 + var i = e.call(t, r || "default");
50 + if ("object" != _typeof(i)) return i;
51 + throw new TypeError("@@toPrimitive must return a primitive value.");
52 + }
53 + return ("string" === r ? String : Number)(t);
54 +}
55 +module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
56 +
57 +/***/ }),
58 +
59 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
60 +/*!***************************************************************!*\
61 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
62 + \***************************************************************/
63 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
64 +
65 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
66 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
67 +function toPropertyKey(t) {
68 + var i = toPrimitive(t, "string");
69 + return "symbol" == _typeof(i) ? i : i + "";
70 +}
71 +module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
72 +
73 +/***/ }),
74 +
75 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
76 +/*!********************************************************!*\
77 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
78 + \********************************************************/
79 +/***/ ((module) => {
80 +
81 +function _typeof(o) {
82 + "@babel/helpers - typeof";
83 +
84 + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
85 + return typeof o;
86 + } : function (o) {
87 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
88 + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
89 +}
90 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
91 +
92 +/***/ })
93 +
94 +/******/ });
95 +/************************************************************************/
96 +/******/ // The module cache
97 +/******/ var __webpack_module_cache__ = {};
98 +/******/
99 +/******/ // The require function
100 +/******/ function __webpack_require__(moduleId) {
101 +/******/ // Check if module is in cache
102 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
103 +/******/ if (cachedModule !== undefined) {
104 +/******/ return cachedModule.exports;
105 +/******/ }
106 +/******/ // Create a new module (and put it into the cache)
107 +/******/ var module = __webpack_module_cache__[moduleId] = {
108 +/******/ // no module.id needed
109 +/******/ // no module.loaded needed
110 +/******/ exports: {}
111 +/******/ };
112 +/******/
113 +/******/ // Execute the module function
114 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
115 +/******/
116 +/******/ // Return the exports of the module
117 +/******/ return module.exports;
118 +/******/ }
119 +/******/
120 +/************************************************************************/
121 +// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
122 +(() => {
123 +"use strict";
124 +/*!*********************************************!*\
125 + !*** ../assets/dev/js/admin/hints/media.js ***!
126 + \*********************************************/
127 +
128 +
129 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
130 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
131 +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
132 +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
133 +(function (_elementorAdminHints, _wp) {
134 + if (!((_elementorAdminHints = elementorAdminHints) !== null && _elementorAdminHints !== void 0 && _elementorAdminHints.mediaHint)) {
135 + return;
136 + }
137 + 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)) {
138 + return;
139 + }
140 + wp.media.view.Attachment.Details = wp.media.view.Attachment.Details.extend({
141 + _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 %>\" aria-label=\"<%= dismiss %>\">\n\t\t\t\t<i class=\"eicon eicon-close\" aria-hidden=\"true\"></i>\n\t\t\t</button>\n\t\t</div>\n\t</div>",
142 + template: function template(view) {
143 + // Get the template and parse it
144 + var html = wp.media.template('attachment-details')(view); // The template to extend
145 + var dom = document.createElement('div');
146 + dom.innerHTML = html;
147 + if (!this.shouldDisplayHint(view)) {
148 + return dom.innerHTML;
149 + }
150 + var hint = document.createElement('div'); // Create a new element
151 + hint.classList.add('e-hint'); // Add a class to the element for styling
152 + hint.innerHTML = _.template(this._tmpl)(elementorAdminHints.mediaHint); // Add the content to the new element
153 +
154 + // Insert the new element at the correct spot
155 + var details = dom.querySelector('.attachment-info');
156 + details.appendChild(hint); // Add new element at the correct spot
157 +
158 + return dom.innerHTML;
159 + },
160 + events: _objectSpread(_objectSpread({}, wp.media.view.Attachment.Details.prototype.events), {}, {
161 + 'click .elementor-control-notice-dismiss': 'dismiss',
162 + 'click .e-hint__container a': 'onHintAnchorClick',
163 + 'click .e-hint__container button.e-btn-1': 'onHintAction'
164 + }),
165 + shouldDisplayHint: function shouldDisplayHint(view) {
166 + var _elementorAdminHints2;
167 + if (!elementorAdminHints || !((_elementorAdminHints2 = elementorAdminHints) !== null && _elementorAdminHints2 !== void 0 && _elementorAdminHints2.mediaHint)) {
168 + return false;
169 + }
170 + if (window.elementorHints !== undefined) {
171 + return false;
172 + }
173 + if (view.type !== 'image') {
174 + return false;
175 + }
176 + if (elementorAdminHints.mediaHint.display) {
177 + return true;
178 + }
179 + return this.imageNotOptimized(view);
180 + },
181 + imageNotOptimized: function imageNotOptimized(attachment) {
182 + var checks = {
183 + height: 1080,
184 + width: 1920,
185 + filesizeInBytes: 100000
186 + };
187 + return Object.keys(checks).some(function (key) {
188 + var value = attachment[key] || false;
189 + return value && value > checks[key];
190 + });
191 + },
192 + onHintAction: function onHintAction(event) {
193 + event.preventDefault();
194 + var b64Settings = event.target.closest('.action-handler').dataset.settings;
195 + var settings = atob(b64Settings);
196 + var _JSON$parse = JSON.parse(settings),
197 + _JSON$parse$action_ur = _JSON$parse.action_url,
198 + actionURL = _JSON$parse$action_ur === void 0 ? null : _JSON$parse$action_ur;
199 + if (actionURL) {
200 + window.open(actionURL, '_blank');
201 + }
202 + this.dismiss(event);
203 + },
204 + onHintAnchorClick: function onHintAnchorClick(event) {
205 + this.dismiss(event);
206 + },
207 + dismiss: function dismiss(event) {
208 + elementorCommon.ajax.addRequest('dismissed_editor_notices', {
209 + data: {
210 + dismissId: event.target.closest('.e-hint__container').dataset.event
211 + }
212 + });
213 + this.hideHint(event);
214 + },
215 + hideHint: function hideHint(event) {
216 + event.target.closest('.e-hint__container').remove();
217 + window.elementorHints = {};
218 + }
219 + });
140 220 })();
221 +})();
222 +
223 +/******/ })()
224 +;
141 225 //# sourceMappingURL=media-hints.js.map