Produced by Araxis Merge on 2023-11-23 04:31:21 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | /Users/coca/Documents/www/Porto v4.0.2/Theme Files/Magento 2.x/Porto Theme 4.0.6/app/code/Smartwave/Filterproducts/view/adminhtml/web/js/content-type/filterproducts | preview.js | 2023-06-29 06:11:23 +0000 |
| 2 | /Users/coca/Documents/www/Porto v4.0.2/Theme Files/Magento 2.x/Porto Theme 4.0.7/app/code/Smartwave/Filterproducts/view/adminhtml/web/js/content-type/filterproducts | preview.js | 2023-08-25 10:30:01 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 320 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | /*eslint-disable */ | 1 | /*eslint-disable */ | |||
| 2 | /* jscs:disable */ | 2 | /* jscs:disable */ | |||
| 3 | 3 | |||||
| 4 | function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | 4 | function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } | |||
| 5 | 5 | |||||
| 6 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | 6 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | |||
| 7 | 7 | |||||
| 8 | define(["jquery", "knockout", "mage/translate", "Magento_PageBuilder/js/events", " | 8 | define(["jquery", "knockout", "mage/translate", "Magento_PageBuilder/js/events", "slick", "underscore", "Magento_PageBuilder/js/config", "Magento_PageBuilder/js/content-type-menu/hide-show-option", "Magento_PageBuilder/js/content-type/preview"], function (_jquery, _knockout, _translate, _events, _slick, _underscore, _config, _hideShowOption, _preview) { | |||
| 9 | /** | 9 | /** | |||
| 10 | * Copyright © Magento, Inc. All rights reserved. | 10 | * Copyright © Magento, Inc. All rights reserved. | |||
| 11 | * See COPYING.txt for license details. | 11 | * See COPYING.txt for license details. | |||
| 12 | */ | 12 | */ | |||
| 13 | 13 | |||||
| 14 | /** | 14 | /** | |||
| 15 | * @api | 15 | * @api | |||
| 16 | */ | 16 | */ | |||
| 17 | var Preview = /*#__PURE__*/function (_preview2) { | 17 | var Preview = /*#__PURE__*/function (_preview2) { | |||
| 18 | "use strict"; | 18 | "use strict"; | |||
| 19 | 19 | |||||
| 20 | _inheritsLoose(Preview, _preview2); | 20 | _inheritsLoose(Preview, _preview2); | |||
| 21 | 21 | |||||
| 22 | /** | 22 | /** | |||
| 23 | * Define keys which when changed should not trigger the slider to be rebuilt | 23 | * Define keys which when changed should not trigger the slider to be rebuilt | |||
| 24 | * | 24 | * | |||
| 25 | * @type {string[]} | 25 | * @type {string[]} | |||
| 26 | */ | 26 | */ | |||
| 27 | 27 | |||||
| 28 | /** | 28 | /** | |||
| 29 | * @inheritdoc | 29 | * @inheritdoc | |||
| 30 | */ | 30 | */ | |||
| 31 | function Preview(contentType, config, observableUpdater) { | 31 | function Preview(contentType, config, observableUpdater) { | |||
| 32 | var _this; | 32 | var _this; | |||
| 33 | 33 | |||||
| 34 | _this = _preview2.call(this, contentType, config, observableUpdater) || this; | 34 | _this = _preview2.call(this, contentType, config, observableUpdater) || this; | |||
| 35 | _this.displayPreview = _knockout.observable(false); | 35 | _this.displayPreview = _knockout.observable(false); | |||
| 36 | _this.previewElement = _jquery.Deferred(); | 36 | _this.previewElement = _jquery.Deferred(); | |||
| 37 | _this.widgetUnsanitizedHtml = _knockout.observable(); | 37 | _this.widgetUnsanitizedHtml = _knockout.observable(); | |||
| 38 | _this.slidesToShow = 5; | 38 | _this.slidesToShow = 5; | |||
| 39 | _this.productItemSelector = ".product-item"; | 39 | _this.productItemSelector = ".product-item"; | |||
| 40 | _this.centerModeClass = "center-mode"; | 40 | _this.centerModeClass = "center-mode"; | |||
| 41 | _this.messages = { | 41 | _this.messages = { | |||
| 42 | EMPTY: (0, _translate)("Empty Products"), | 42 | EMPTY: (0, _translate)("Empty Products"), | |||
| 43 | NO_RESULTS: (0, _translate)("No products were found matching your condition"), | 43 | NO_RESULTS: (0, _translate)("No products were found matching your condition"), | |||
| 44 | LOADING: (0, _translate)("Loading..."), | 44 | LOADING: (0, _translate)("Loading..."), | |||
| 45 | UNKNOWN_ERROR: (0, _translate)("An unknown error occurred. Please try again.") | 45 | UNKNOWN_ERROR: (0, _translate)("An unknown error occurred. Please try again.") | |||
| 46 | }; | 46 | }; | |||
| 47 | _this.ignoredKeysForBuild = ["margins_and_padding", "border", "border_color", "border_radius", "border_width", "css_classes", "text_align"]; | 47 | _this.ignoredKeysForBuild = ["margins_and_padding", "border", "border_color", "border_radius", "border_width", "css_classes", "text_align"]; | |||
| 48 | _this.placeholderText = _knockout.observable(_this.messages.EMPTY); // Redraw slider after content type gets redrawn | 48 | _this.placeholderText = _knockout.observable(_this.messages.EMPTY); // Redraw slider after content type gets redrawn | |||
| 49 | _events.on("contentType:redrawAfter", function (args) { | 49 | _events.on("contentType:redrawAfter", function (args) { | |||
| 50 | if (_this.element && _this.element.children) { | 50 | if (_this.element && _this.element.children) { | |||
| 51 | var $element = (0, _jquery)(_this.element.children); | 51 | var $element = (0, _jquery)(_this.element.children); | |||
| 52 | } | 52 | } | |||
| 53 | }); | 53 | }); | |||
| 54 | 54 | |||||
| 55 | return _this; | 55 | return _this; | |||
| 56 | } | 56 | } | |||
| 57 | /** | 57 | /** | |||
| 58 | * Return an array of options | 58 | * Return an array of options | |||
| 59 | * | 59 | * | |||
| 60 | * @returns {OptionsInterface} | 60 | * @returns {OptionsInterface} | |||
| 61 | */ | 61 | */ | |||
| 62 | 62 | |||||
| 63 | 63 | |||||
| 64 | var _proto = Preview.prototype; | 64 | var _proto = Preview.prototype; | |||
| 65 | 65 | |||||
| 66 | _proto.retrieveOptions = function retrieveOptions() { | 66 | _proto.retrieveOptions = function retrieveOptions() { | |||
| 67 | var options = _preview2.prototype.retrieveOptions.call(this); | 67 | var options = _preview2.prototype.retrieveOptions.call(this); | |||
| 68 | 68 | |||||
| 69 | options.hideShow = new _hideShowOption({ | 69 | options.hideShow = new _hideShowOption({ | |||
| 70 | preview: this, | 70 | preview: this, | |||
| 71 | icon: _hideShowOption.showIcon, | 71 | icon: _hideShowOption.showIcon, | |||
| 72 | title: _hideShowOption.showText, | 72 | title: _hideShowOption.showText, | |||
| 73 | action: this.onOptionVisibilityToggle, | 73 | action: this.onOptionVisibilityToggle, | |||
| 74 | classes: ["hide-show-content-type"], | 74 | classes: ["hide-show-content-type"], | |||
| 75 | sort: 40 | 75 | sort: 40 | |||
| 76 | }); | 76 | }); | |||
| 77 | return options; | 77 | return options; | |||
| 78 | } | 78 | } | |||
| 79 | /** | 79 | /** | |||
| 80 | * On afterRender callback. | 80 | * On afterRender callback. | |||
| 81 | * | 81 | * | |||
| 82 | * @param {Element} element | 82 | * @param {Element} element | |||
| 83 | */ | 83 | */ | |||
| 84 | ; | 84 | ; | |||
| 85 | 85 | |||||
| 86 | _proto.onAfterRender = function onAfterRender(element) { | 86 | _proto.onAfterRender = function onAfterRender(element) { | |||
| 87 | this.element = element; | 87 | this.element = element; | |||
| 88 | this.previewElement.resolve(element); | 88 | this.previewElement.resolve(element); | |||
| 89 | } | 89 | } | |||
| 90 | /** | 90 | /** | |||
| 91 | * @inheritdoc | 91 | * @inheritdoc | |||
| 92 | */ | 92 | */ | |||
| 93 | ; | 93 | ; | |||
| 94 | 94 | |||||
| 95 | _proto.afterObservablesUpdated = function afterObservablesUpdated() { | 95 | _proto.afterObservablesUpdated = function afterObservablesUpdated() { | |||
| 96 | var _this2 = this; | 96 | var _this2 = this; | |||
| 97 | 97 | |||||
| 98 | _preview2.prototype.afterObservablesUpdated.call(this); | 98 | _preview2.prototype.afterObservablesUpdated.call(this); | |||
| 99 | 99 | |||||
| 100 | var data = this.contentType.dataStore.getState(); | 100 | var data = this.contentType.dataStore.getState(); | |||
| 101 | 101 | |||||
| 102 | if (this.hasDataChanged(this.previousData, data)) { | 102 | if (this.hasDataChanged(this.previousData, data)) { | |||
| 103 | this.displayPreview(false); | 103 | this.displayPreview(false); | |||
| 104 | 104 | |||||
| 105 | 105 | |||||
| 106 | var url = _config.getConfig("preview_url"); | 106 | var url = _config.getConfig("preview_url"); | |||
| 107 | var requestConfig = { | 107 | var requestConfig = { | |||
| 108 | // Prevent caching | 108 | // Prevent caching | |||
| 109 | method: "POST", | 109 | method: "POST", | |||
| 110 | data: { | 110 | data: { | |||
| 111 | role: this.config.name, | 111 | role: this.config.name, | |||
| 112 | directive: this.data.main.html() | 112 | directive: this.data.main.html() | |||
| 113 | } | 113 | } | |||
| 114 | }; | 114 | }; | |||
| 115 | this.placeholderText(this.messages.LOADING); | 115 | this.placeholderText(this.messages.LOADING); | |||
| 116 | _jquery.ajax(url, requestConfig).done(function (response) { | 116 | _jquery.ajax(url, requestConfig).done(function (response) { | |||
| 117 | if (typeof response.data !== "object" || !Boolean(response.data.content)) { | 117 | if (typeof response.data !== "object" || !Boolean(response.data.content)) { | |||
| 118 | _this2.placeholderText(_this2.messages.NO_RESULTS); | 118 | _this2.placeholderText(_this2.messages.NO_RESULTS); | |||
| 119 | 119 | |||||
| 120 | return; | 120 | return; | |||
| 121 | } | 121 | } | |||
| 122 | 122 | |||||
| 123 | if (response.data.error) { | 123 | if (response.data.error) { | |||
| 124 | _this2.widgetUnsanitizedHtml(response.data.error); | 124 | _this2.widgetUnsanitizedHtml(response.data.error); | |||
| 125 | } else { | 125 | } else { | |||
| 126 | _this2.widgetUnsanitizedHtml(response.data.content); | 126 | _this2.widgetUnsanitizedHtml(response.data.content); | |||
| 127 | 127 | |||||
| 128 | _this2.displayPreview(true); | 128 | _this2.displayPreview(true); | |||
| 129 | } | 129 | } | |||
| 130 | 130 | |||||
| 131 | _this2.previewElement.done(function () { | 131 | _this2.previewElement.done(function () { | |||
| 132 | (0, _jquery)(_this2.element).trigger("contentUpdated"); | 132 | (0, _jquery)(_this2.element).trigger("contentUpdated"); | |||
| 133 | }); | 133 | }); | |||
| 134 | }).fail(function () { | 134 | }).fail(function () { | |||
| 135 | _this2.placeholderText(_this2.messages.UNKNOWN_ERROR); | 135 | _this2.placeholderText(_this2.messages.UNKNOWN_ERROR); | |||
| 136 | }); | 136 | }); | |||
| 137 | } | 137 | } | |||
| 138 | 138 | |||||
| 139 | this.previousData = Object.assign({}, data); | 139 | this.previousData = Object.assign({}, data); | |||
| 140 | }; | 140 | }; | |||
| 141 | /** | 141 | /** | |||
| 142 | * Determine if the data has changed, whilst ignoring certain keys which don't require a rebuild | 142 | * Determine if the data has changed, whilst ignoring certain keys which don't require a rebuild | |||
| 143 | * | 143 | * | |||
| 144 | * @param {DataObject} previousData | 144 | * @param {DataObject} previousData | |||
| 145 | * @param {DataObject} newData | 145 | * @param {DataObject} newData | |||
| 146 | * @returns {boolean} | 146 | * @returns {boolean} | |||
| 147 | */ | 147 | */ | |||
| 148 | ; | 148 | ; | |||
| 149 | 149 | |||||
| 150 | _proto.hasDataChanged = function hasDataChanged(previousData, newData) { | 150 | _proto.hasDataChanged = function hasDataChanged(previousData, newData) { | |||
| 151 | previousData = _underscore.omit(previousData, this.ignoredKeysForBuild); | 151 | previousData = _underscore.omit(previousData, this.ignoredKeysForBuild); | |||
| 152 | newData = _underscore.omit(newData, this.ignoredKeysForBuild); | 152 | newData = _underscore.omit(newData, this.ignoredKeysForBuild); | |||
| 153 | return !_underscore.isEqual(previousData, newData); | 153 | return !_underscore.isEqual(previousData, newData); | |||
| 154 | }; | 154 | }; | |||
| 155 | 155 | |||||
| 156 | return Preview; | 156 | return Preview; | |||
| 157 | }(_preview); | 157 | }(_preview); | |||
| 158 | 158 | |||||
| 159 | return Preview; | 159 | return Preview; | |||
| 160 | }); | 160 | }); | |||
| 161 | //# sourceMappingURL=preview.js.map | 161 | //# sourceMappingURL=preview.js.map |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.