1. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-03-13 03:00:42 +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.

1.1 Files compared

#LocationFileLast Modified
1Porto v4.0.4/Porto Theme/app/code/Mageplaza/AjaxLayer/view/frontend/web/js/actionsubmit-filter.js2022-02-09 10:11:13 +0000
2Porto v4.0.5/Porto Theme/app/code/Mageplaza/AjaxLayer/view/frontend/web/js/actionsubmit-filter.js2023-03-07 11:12:54 +0000

1.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged5298
Changed25
Inserted24
Removed00

1.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

1.4 Active regular expressions

No regular expressions were active.

1.5 Comparison detail

1 /** 1 /**
2  * Mageplaza 2  * Mageplaza
3  * 3  *
4  * NOTICE OF LICENSE 4  * NOTICE OF LICENSE
5  * 5  *
6  * This source file is subject to the Mageplaza.com license that is 6  * This source file is subject to the Mageplaza.com license that is
7  * available through the world-wide-web at this URL: 7  * available through the world-wide-web at this URL:
8  * https://www.mageplaza.com/LICENSE.txt 8  * https://www.mageplaza.com/LICENSE.txt
9  * 9  *
10  * DISCLAIMER 10  * DISCLAIMER
11  * 11  *
12  * Do not edit or add to this file if you wish to upgrade this extension to newer 12  * Do not edit or add to this file if you wish to upgrade this extension to newer
13  * version in the future. 13  * version in the future.
14  * 14  *
15  * @category    Mageplaza 15  * @category    Mageplaza
16  * @package     Mageplaza_AjaxLayer 16  * @package     Mageplaza_AjaxLayer
17  * @copyright   Copyright (c) Mageplaza (http://www.mageplaza.com/) 17  * @copyright   Copyright (c) Mageplaza (http://www.mageplaza.com/)
18  * @license     https://www.mageplaza.com/LICENSE.txt 18  * @license     https://www.mageplaza.com/LICENSE.txt
19  */ 19  */
20  20 
21 define( 21 define(
22     [ 22     [
23         'jquery', 23         'jquery',
24         'mage/storage', 24         'mage/storage',
25         'Mageplaza_AjaxLayer/js/model/loader', 25         'Mageplaza_AjaxLayer/js/model/loader',
26         'mage/apply/main'
 26         'mage/apply/main',
    27         'ko'
27     ], 28     ],
28     function ($, storage, loader, mage
) {
 29     function ($, storage, loader, mage, ko) {
29         'use strict'; 30         'use strict';
30  31 
31         var productContainer = $('#layer-product-list'), 32         var productContainer   = $('#layer-product-list'),
32             layerContainer = $('.layered-filter-block-container'), 33             layerContainer     = $('.layered-filter-block-container'),
33             quickViewContainer = $('#mpquickview-popup'); 34             quickViewContainer = $('#mpquickview-popup');
34  35 
35         return function (submitUrl, isChangeUrl, method) { 36         return function (submitUrl, isChangeUrl, method) {
36             /** save active state */ 37             /** save active state */
37             var actives = [], 38             var actives = [],
38                 data; 39                 data;
39             $('.filter-options-item').each(function (index) { 40             $('.filter-options-item').each(function (index) {
40                 if ($(this).hasClass('active')) { 41                 if ($(this).hasClass('active')) {
41                     actives.push($(this).attr('attribute')); 42                     actives.push($(this).attr('attribute'));
42                 } 43                 }
43             }); 44             });
44             window.layerActiveTabs = actives; 45             window.layerActiveTabs = actives;
45  46 
46             /** start loader */ 47             /** start loader */
47             loader.startLoader(); 48             loader.startLoader();
48  49 
49             /** change browser url */ 50             /** change browser url */
50             if (typeof window.history.pushState === 'function' && (typeof isChangeUrl === 'undefined')) { 51             if (typeof window.history.pushState === 'function' && (typeof isChangeUrl === 'undefined')) {
51                 window.history.pushState({url: submitUrl}, '', submitUrl); 52                 window.history.pushState({url: submitUrl}, '', submitUrl);
52             } 53             }
53             if (method === 'post') {// For 'add to wishlist' & 'add to compare' event 54             if (method === 'post') {// For 'add to wishlist' & 'add to compare' event
54                 return storage.post(submitUrl).done( 55                 return storage.post(submitUrl).done(
55                 ).fail( 56                 ).fail(
56                     function () { 57                     function () {
57                         window.location.reload(); 58                         window.location.reload();
58                     } 59                     }
59                 ).always(function () { 60                 ).always(function () {
60                     loader.stopLoader(); 61                     loader.stopLoader();
61                 }); 62                 });
62             } 63             }
63  64 
64             return storage.get(submitUrl).done( 65             return storage.get(submitUrl).done(
65                 function (response) { 66                 function (response) {
66                     if (response.backUrl) { 67                     if (response.backUrl) {
67                         window.location = response.backUrl; 68                         window.location = response.backUrl;
68                         return; 69                         return;
69                     } 70                     }
70                     if (response.navigation) { 71                     if (response.navigation) {
71                         layerContainer.html(response.navigation); 72                         layerContainer.html(response.navigation);
72                     } 73                     }
73                     if (response.products) { 74                     if (response.products) {
74                         productContainer.html(response.products); 75                         productContainer.html(response.products);
75                     } 76                     }
76                     if (response.quickview) { 77                     if (response.quickview) {
77                         quickViewContainer.html(response.quickview); 78                         quickViewContainer.html(response.quickview);
78                     } 79                     }
79  80 
    81                     ko.cleanNode(productContainer[0]);
    82                     productContainer.applyBindings();
    83 
80                     if (mage) { 84                     if (mage) {
    85                         $("html, body").animate({scrollTop: $('#layer-product-list').offset().top - 100}, "slow");
81                         mage.apply(); 86                         mage.apply();
82                     } 87                     }
83                 } 88                 }
84             ).fail( 89             ).fail(
85                 function () { 90                 function () {
86                     window.location.reload(); 91                     window.location.reload();
87                 } 92                 }
88             ).always( 93             ).always(
89                 function () { 94                 function () {
90  95 
91                     var colorAttr = $('.filter-options .filter-options-item .color .swatch-option-link-layered .swatch-option'); 96                     var colorAttr = $('.filter-options .filter-options-item .color .swatch-option-link-layered .swatch-option');
92  97 
93                     colorAttr.each(function(){ 98                     colorAttr.each(function(){
94                         var el  = $(this), 99                         var el  = $(this),
95                             hex = el.attr('data-option-tooltip-value'); 100                             hex = el.attr('data-option-tooltip-value');
96                         if(typeof hex != "undefined"){ 101                         if(typeof hex != "undefined"){
97                             if (hex.charAt(0) === '#') { 102                             if (hex.charAt(0) === '#') {
98                                 hex = hex.substr(1); 103                                 hex = hex.substr(1);
99                             } 104                             }
100                             if ((hex.length < 2) || (hex.length > 6)) { 105                             if ((hex.length < 2) || (hex.length > 6)) {
101                                 el.attr('style','background: '+el.attr('data-option-label')+';'); 106                                 el.attr('style','background: '+el.attr('data-option-label')+';');
102                             } 107                             }
103                             var values = hex.split(''), 108                             var values = hex.split(''),
104                                 r, 109                                 r,
105                                 g, 110                                 g,
106                                 b; 111                                 b;
107  112 
108                             if (hex.length === 2) { 113                             if (hex.length === 2) {
109                                 r = parseInt(values[0].toString() + values[1].toString(), 16); 114                                 r = parseInt(values[0].toString() + values[1].toString(), 16);
110                                 g = r; 115                                 g = r;
111                                 b = r; 116                                 b = r;
112                             } else if (hex.length === 3) { 117                             } else if (hex.length === 3) {
113                                 r = parseInt(values[0].toString() + values[0].toString(), 16); 118                                 r = parseInt(values[0].toString() + values[0].toString(), 16);
114                                 g = parseInt(values[1].toString() + values[1].toString(), 16); 119                                 g = parseInt(values[1].toString() + values[1].toString(), 16);
115                                 b = parseInt(values[2].toString() + values[2].toString(), 16); 120                                 b = parseInt(values[2].toString() + values[2].toString(), 16);
116                             } else if (hex.length === 6) { 121                             } else if (hex.length === 6) {
117                                 r = parseInt(values[0].toString() + values[1].toString(), 16); 122                                 r = parseInt(values[0].toString() + values[1].toString(), 16);
118                                 g = parseInt(values[2].toString() + values[3].toString(), 16); 123                                 g = parseInt(values[2].toString() + values[3].toString(), 16);
119                                 b = parseInt(values[4].toString() + values[5].toString(), 16); 124                                 b = parseInt(values[4].toString() + values[5].toString(), 16);
120                             } else { 125                             } else {
121                                 el.attr('style','background: '+el.attr('data-option-label')+';'); 126                                 el.attr('style','background: '+el.attr('data-option-label')+';');
122                             } 127                             }
123  128 
124                             el.attr('style','background: center center no-repeat rgb('+[r, g, b]+');'); 129                             el.attr('style','background: center center no-repeat rgb('+[r, g, b]+');');
125                         } 130                         }
126  131 
127                     }); 132                     });
128  133 
129                     //selected 134                     //selected
130  135 
131                     var filterCurrent = $('.layered-filter-block-container .filter-current .items .item .filter-value'); 136                     var filterCurrent = $('.layered-filter-block-container .filter-current .items .item .filter-value');
132  137 
133                     filterCurrent.each(function(){ 138                     filterCurrent.each(function(){
134                         var el         = $(this), 139                         var el         = $(this),
135                             colorLabel = el.html(), 140                             colorLabel = el.html(),
136                             colorAttr  = $('.filter-options .filter-options-item .color .swatch-option-link-layered .swatch-option'); 141                             colorAttr  = $('.filter-options .filter-options-item .color .swatch-option-link-layered .swatch-option');
137  142 
138                         colorAttr.each(function(){ 143                         colorAttr.each(function(){
139                             var elA = $(this); 144                             var elA = $(this);
140                             if(elA.attr('data-option-label') === colorLabel && !elA.hasClass('selected')){ 145                             if(elA.attr('data-option-label') === colorLabel && !elA.hasClass('selected')){
141                                 elA.addClass('selected'); 146                                 elA.addClass('selected');
142                             } 147                             }
143                         }); 148                         });
144                     }); 149                     });
145  150 
146                     loader.stopLoader(); 151                     loader.stopLoader();
147                 } 152                 }
148             ); 153             );
149         }; 154         };
150     } 155     }
151 ); 156 );