15. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2020-08-14 00:01:30 +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.

15.1 Files compared

#LocationFileLast Modified
1Porto v3.2.3/Magento 2.x/Porto Theme/app/code/Mageplaza/AjaxLayer/view/frontend/web/js/actionsubmit-filter.js2018-10-10 20:33:22 +0000
2Porto v3.2.4/Magento 2.x/Porto Theme/app/code/Mageplaza/AjaxLayer/view/frontend/web/js/actionsubmit-filter.js2020-08-13 23:36:06 +0000

15.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged6154
Changed314
Inserted259
Removed00

15.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

15.4 Active regular expressions

No regular expressions were active.

15.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     ], 27     ],
28     function ($, storage, loader, mage) { 28     function ($, storage, loader, mage) {
29         'use strict'; 29         'use strict';
30  30 
31         var productContainer = $('#layer-product-list'), 31         var productContainer = $('#layer-product-list'),
32             layerContainer = $('.layered-filter-block-container'); 32             layerContainer = $('.layered-filter-block-container'),
    33             quickViewContainer = $('#mpquickview-popup');
33  34 
34         return function (submitUrl, isChangeUrl) { 35         return function (submitUrl, isChangeUrl) {
35             /** save active state */ 36             /** save active state */
36             var actives = []; 37             var actives = [],
    38                 data;
37             $('.filter-options-item').each(function (index) { 39             $('.filter-options-item').each(function (index) {
38                 if ($(this).hasClass('active')) { 40                 if ($(this).hasClass('active')) {
39                     actives.push($(this).attr('attribute')); 41                     actives.push($(this).attr('attribute'));
40                 } 42                 }
41             }); 43             });
42             window.layerActiveTabs = actives; 44             window.layerActiveTabs = actives;
43  45 
44             /** start loader */ 46             /** start loader */
45             loader.startLoader(); 47             loader.startLoader();
46  48 
47             /** change browser url */ 49             /** change browser url */
48             if (typeof window.history.pushState === 'function' && (typeof isChangeUrl === 'undefined')) { 50             if (typeof window.history.pushState === 'function' && (typeof isChangeUrl === 'undefined')) {
49                 window.history.pushState({url: submitUrl}, '', submitUrl); 51                 window.history.pushState({url: submitUrl}, '', submitUrl);
50             } 52             }
51  53 
52             return storage.post(submitUrl, {}).done( 54             if (isChangeUrl){
    55                 data = '{}';
    56             }else{
    57                 data = JSON.stringify({'mp_layer': 1});
    58             }
    59 
    60             return storage.post(submitUrl, data).done(
53                 function (response) { 61                 function (response) {
54                     if (response.backUrl) { 62                     if (response.backUrl) {
55                         window.location = response.backUrl; 63                         window.location = response.backUrl;
56                         return; 64                         return;
57                     } 65                     }
58                     if (response.navigation) { 66                     if (response.navigation) {
59                         layerContainer.html(response.navigation); 67                         layerContainer.html(response.navigation);
60                     } 68                     }
61                     if (response.products) { 69                     if (response.products) {
62                         productContainer.html(response.products); 70                         productContainer.html(response.products);
63                     } 71                     }
    72                     if (response.quickview) {
    73                         quickViewContainer.html(response.quickview);
    74                     }
64  75 
65                     if (mage) { 76                     if (mage) {
66                         mage.apply(); 77                         mage.apply();
67                     } 78                     }
68                 } 79                 }
69             ).fail( 80             ).fail(
70                 function () { 81                 function () {
71                     window.location.reload(); 82                     window.location.reload();
72                 } 83                 }
73             ).always( 84             ).always(
74                 function () { 85                 function () {
    86 
    87                     var colorAttr = $('.filter-options .filter-options-item .color .swatch-option-link-layered .swatch-option');
    88     
    89                     colorAttr.each(function(){
    90                         var el  = $(this),
    91                             hex = el.attr('data-option-tooltip-value');
    92                         if(typeof hex != "undefined"){
    93                             if (hex.charAt(0) === '#') {
    94                                 hex = hex.substr(1);
    95                             }
    96                             if ((hex.length < 2) || (hex.length > 6)) {
    97                                 el.attr('style','background: '+el.attr('data-option-label')+';');
    98                             }
    99                             var values = hex.split(''),
    100                                 r,
    101                                 g,
    102                                 b;
    103 
    104                             if (hex.length === 2) {
    105                                 r = parseInt(values[0].toString() + values[1].toString(), 16);
    106                                 g = r;
    107                                 b = r;
    108                             } else if (hex.length === 3) {
    109                                 r = parseInt(values[0].toString() + values[0].toString(), 16);
    110                                 g = parseInt(values[1].toString() + values[1].toString(), 16);
    111                                 b = parseInt(values[2].toString() + values[2].toString(), 16);
    112                             } else if (hex.length === 6) {
    113                                 r = parseInt(values[0].toString() + values[1].toString(), 16);
    114                                 g = parseInt(values[2].toString() + values[3].toString(), 16);
    115                                 b = parseInt(values[4].toString() + values[5].toString(), 16);
    116                             } else {
    117                                 el.attr('style','background: '+el.attr('data-option-label')+';');
    118                             }
    119 
    120                             el.attr('style','background: center center no-repeat rgb('+[r, g, b]+');'); 
    121                         }
    122                         
    123                     });
    124 
    125                     //selected
    126 
    127                     var filterCurrent = $('.layered-filter-block-container .filter-current .items .item .filter-value');
    128 
    129                     filterCurrent.each(function(){
    130                         var el         = $(this),
    131                             colorLabel = el.html(),
    132                             colorAttr  = $('.filter-options .filter-options-item .color .swatch-option-link-layered .swatch-option');
    133 
    134                         colorAttr.each(function(){
    135                             var elA = $(this);
    136                             if(elA.attr('data-option-label') === colorLabel && !elA.hasClass('selected')){
    137                                 elA.addClass('selected');
    138                             }
    139                         });
    140                     });
    141 
75                     loader.stopLoader(); 142                     loader.stopLoader();
76                 } 143                 }
77             ); 144             );
78         }; 145         };
79     } 146     }
80 ); 147 );