Plugin Directory

Changeset 3478729


Ignore:
Timestamp:
03/10/2026 04:10:21 AM (4 weeks ago)
Author:
domainlee
Message:

Release 1.5.5

Location:
crt-manage
Files:
2506 added
10 edited

Legend:

Unmodified
Added
Removed
  • crt-manage/trunk/assets/css/admin/library-frontend.min.css

    r3474722 r3478729  
    106106
    107107.crt-tplib-header ul li {
     108    margin: 10px 0;
    108109    width: 115px;
    109     padding: 20px 0;
     110    padding: 10px 0;
    110111    color: #6d7882;
    111     font-family: "Roboto",Arial,Helvetica,Verdana,sans-serif;
     112    font-family: "Roboto", Arial, Helvetica, Verdana, sans-serif;
    112113    font-size: 14px;
    113114    line-height: 1;
     
    115116    text-align: center;
    116117    cursor: pointer;
    117 
    118 }
    119 
    120 .crt-tplib-active-tab {
    121     background-image: -o-linear-gradient(top,#f1f3f5,#fff);
    122     background-image: -webkit-gradient(linear,left top, left bottom,from(#f1f3f5),to(#fff));
    123     background-image: linear-gradient(180deg,#f1f3f5,#fff);
    124     border-bottom: 3px solid #6A4BFF;
     118}
     119
     120.crt-tplib-header ul li.crt-tplib-active-tab {
     121    background: #FF00F7;
     122    background: linear-gradient(0deg,rgba(255, 0, 247, 1) 0%, rgba(195, 1, 255, 1) 100%);
     123    border: 1px solid #dd00fb;
     124    border-radius: 20px;
     125    color: #FFF;
    125126}
    126127
  • crt-manage/trunk/assets/css/frontend.css

    r3474722 r3478729  
    1959119591}
    1959219592
     19593
     19594/*--------------------------------------------------------------
     19595== Widget Advanced Filters
     19596--------------------------------------------------------------*/
     19597.crt-advanced-filters-inner {
     19598    display: -webkit-box;
     19599    display: -ms-flexbox;
     19600    display: flex;
     19601    -webkit-box-orient: vertical;
     19602    -webkit-box-direction: normal;
     19603    -ms-flex-direction: column;
     19604    flex-direction: column;
     19605}
     19606
     19607.crt-af-check-radio-group.crt-advanced-filters-inner {
     19608    -ms-flex-wrap: wrap;
     19609    flex-wrap: wrap;
     19610}
     19611
     19612.crt-af-filters-label {
     19613    margin: 0;
     19614}
     19615
     19616.crt-grid-loading {
     19617    opacity: 0.7 !important;
     19618}
     19619
     19620.crt-af-input-wrap {
     19621    cursor: pointer;
     19622}
     19623
     19624.crt-af-input-wrap.crt-af-child {
     19625    margin-left: 16px !important;
     19626}
     19627.crt-af-input-wrap.crt-af-g-child {
     19628    margin-left: 32px !important;
     19629}
     19630
     19631.crt-af-input-wrap.crt-af-g-grand-child {
     19632    margin-left: 48px !important;
     19633}
     19634
     19635.crt-af-visual-group {
     19636    display: -webkit-box;
     19637    display: -ms-flexbox;
     19638    display: flex;
     19639    -ms-flex-wrap: wrap;
     19640    flex-wrap: wrap;
     19641}
     19642
     19643.crt-af-visual-group .crt-af-input-wrap input {
     19644    display: none !important;
     19645}
     19646
     19647.crt-af-visual-wrap {
     19648    display: -webkit-box;
     19649    display: -ms-flexbox;
     19650    display: flex;
     19651    -webkit-box-orient: horizontal;
     19652    -webkit-box-direction: reverse;
     19653    -ms-flex-direction: row-reverse;
     19654    flex-direction: row-reverse;
     19655    -webkit-box-pack: end;
     19656    -ms-flex-pack: end;
     19657    justify-content: flex-end;
     19658    gap: 5px;
     19659    cursor: pointer;
     19660    -webkit-user-select: none;
     19661    -moz-user-select: none;
     19662    -ms-user-select: none;
     19663    user-select: none;
     19664    overflow: hidden;
     19665}
     19666
     19667.crt-af-visual-wrap.crt-af-visual-color-wrap .crt-af-visual {
     19668    -ms-flex-negative: 0;
     19669    flex-shrink: 0;
     19670}
     19671
     19672.crt-af-visual-wrap * {
     19673    cursor: pointer;
     19674}
     19675
     19676.crt-af-hide-label-yes .crt-af-visual-wrap {
     19677    gap: 0;
     19678}
     19679
     19680.crt-af-visual-wrap .crt-af-count {
     19681    margin-left: 3px;
     19682}
     19683
     19684.crt-af-visual-wrap .crt-af-input-wrap {
     19685    width: 100%;
     19686}
     19687
     19688/* Range */
     19689.crt-af-range-container {
     19690    display: -webkit-box;
     19691    display: -ms-flexbox;
     19692    display: flex;
     19693    -webkit-box-orient: vertical;
     19694    -webkit-box-direction: normal;
     19695    -ms-flex-direction: column;
     19696    flex-direction: column;
     19697}
     19698
     19699.crt-af-apply-btn-wrap {
     19700    display: -webkit-box;
     19701    display: -ms-flexbox;
     19702    display: flex;
     19703}
     19704
     19705.crt-af-apply-btn-stretch .crt-af-apply-btn-wrap button {
     19706    width: 100%;
     19707}
     19708
     19709.crt-af-range-container .crt-af-rs-control {
     19710    position: relative;
     19711}
     19712
     19713.crt-af-range-container .crt-af-rf-control {
     19714    position: relative;
     19715    display: -webkit-box;
     19716    display: -ms-flexbox;
     19717    display: flex;
     19718}
     19719
     19720.crt-af-range-container[show-inputs='no'] .crt-af-rf-control {
     19721    display: none;
     19722}
     19723
     19724.crt-af-range-container input[type=number]::-webkit-inner-spin-button,
     19725.crt-af-range-container input[type=number]::-webkit-outer-spin-button {
     19726    -webkit-appearance: none !important;
     19727}
     19728
     19729.crt-af-range-container input[type="range"] {
     19730    -webkit-appearance: none !important;
     19731    -moz-appearance: none !important;
     19732    appearance: none !important;
     19733    height: 12px;
     19734    width: 100% !important;
     19735    position: absolute !important;
     19736    background-color: #C6C6C6;
     19737    pointer-events: none !important;
     19738}
     19739
     19740.crt-af-range-container input[type=range]::-webkit-slider-thumb {
     19741    -webkit-appearance: none !important;
     19742    pointer-events: all !important;
     19743    width: 19px;
     19744    height: 19px;
     19745    border-radius: 50%;
     19746    cursor: pointer !important;
     19747}
     19748
     19749.crt-af-range-container input[type=range]::-moz-range-thumb {
     19750    pointer-events: all !important;
     19751    width: 19px;
     19752    height: 19px;
     19753    border-radius: 50%;
     19754    cursor: pointer !important;
     19755}
     19756
     19757.crt-af-range-container [id^="crt-af-from-slider-"]input[type=range] {
     19758    height: 0 !important;
     19759    z-index: 1 !important;
     19760}
     19761
     19762.crt-af-range-container [id^="crt-af-to-slider-"]input[type=range] {
     19763    /* transform: translateY(-50%) !important; */
     19764}
     19765
     19766/* Base track */
     19767.crt-af-slider-track-bg {
     19768    position: absolute;
     19769    left: 0;
     19770    width: 100%;
     19771}
     19772
     19773/* Filled (active) range */
     19774.crt-af-slider-fill {
     19775    position: absolute;
     19776    width: 100%;
     19777}
     19778
     19779/* Range sliders */
     19780input[type=range].crt-af-from-slider,
     19781input[type=range].crt-af-to-slider {
     19782    position: absolute;
     19783    width: 100%;
     19784    margin: 0;
     19785    padding: 0;
     19786    background: transparent;
     19787    -webkit-appearance: none;
     19788    -moz-appearance: none;
     19789    appearance: none;
     19790}
     19791
     19792/* Hide native track */
     19793input[type=range]::-webkit-slider-runnable-track {
     19794    background: transparent;
     19795}
     19796
     19797input[type=range]::-moz-range-track {
     19798    background: transparent;
     19799}
     19800
     19801/* View More Less */
     19802.crt-view-ml-wrap {
     19803    display: block;
     19804    width: 100% !important;
     19805    text-align: center;
     19806}
     19807
     19808.crt-view-more-less {
     19809    display: inline-block;
     19810}
     19811
     19812/* Select */
     19813.crt-af-select-wrap {
     19814    position: relative;
     19815}
     19816
     19817input.crt-date-filter-start {
     19818    width: 49%;
     19819    margin-right: 2%;
     19820}
     19821
     19822input.crt-date-filter-end {
     19823    width: 49%;
     19824}
     19825
     19826/* Grid Active Filters */
     19827.crt-af-active-filters {
     19828    display: -webkit-box;
     19829    display: -ms-flexbox;
     19830    display: flex;
     19831    -ms-flex-wrap: wrap;
     19832    flex-wrap: wrap;
     19833    gap: 5px;
     19834}
     19835
     19836.crt-af-active-filters span {
     19837    display: block;
     19838    cursor: pointer;
     19839}
     19840
     19841.crt-af-active-filters .crt-remove-filter span {
     19842    vertical-align: middle;
     19843    line-height: 1;
     19844    margin-left: 5px;
     19845}
     19846
     19847[class^="crt-af-active-wrap-"] {
     19848    display: -webkit-inline-box;
     19849    display: -ms-inline-flexbox;
     19850    display: inline-flex;
     19851}
     19852
     19853[class^="crt-af-active-wrap-"] span {
     19854    display: inline-block;
     19855}
     19856
     19857[class^="crt-af-active-wrap-"]:empty {
     19858    display: none;
     19859}
     19860
     19861.crt-af-active-filters .crt-af-reset-btn {
     19862    background-color: transparent;
     19863}
     19864
     19865.crt-af-rating-filter input {
     19866    display: none;
     19867}
     19868
     19869.crt-af-rating-filter .crt-woo-rating {
     19870    cursor: pointer;
     19871}
     19872.crt-af-hide-input-yes .crt-af-check-radio-group input,
     19873.crt-af-hide-input-yes .crt-af-check-radio-group input+.crt-af-term-name::before {
     19874    display: none !important;
     19875}
     19876
    1959319877@-webkit-keyframes crtIconHorizontal {
    1959419878    0% {
  • crt-manage/trunk/assets/js/modules/crt-header.js

    r3461154 r3478729  
    11(function($) {
    22    "use strict";
     3
    34    $(window).on( 'elementor/frontend/init', function() {
    4 
    5         var header = jQuery(".crt-sticky-section-yes");
    6         $.each(header, function () {
    7             var t = $(this);
    8             var data = t.data('settings');
    9             t.css({'position': 'fixed', 'left': '0', 'right': '0'});
    10             t.css('top', '-80px');
    11             $(window).scroll(function() {
    12                 var scrollTop = $('html').scrollTop();
    13                 if(scrollTop >= 500) {
    14                     t.addClass('crt-sticky-section-fix');
     5        elementorFrontend.hooks.addAction('frontend/element_ready/global',function($scope) {
     6            if ( $scope.hasClass('crt-sticky-section-yes') && typeof CRTConfig !== 'undefined' && CRTConfig.sticky_section === 'on'  ) {
     7                $(document).ready(function() {
     8                    stickySection();
     9                });
     10            }
     11
     12            function stickySection() {
     13                var positionType = !CrtElements.editorCheck() ? $scope.attr('data-crt-position-type') : $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-position-type'),
     14                    positionLocation = !CrtElements.editorCheck() ? $scope.attr('data-crt-position-location') : $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-position-location'),
     15                    positionOffset = !CrtElements.editorCheck() ? $scope.attr('data-crt-position-offset') : $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-position-offset'),
     16                    viewportWidth = $('body').prop('clientWidth') + 17,
     17                    availableDevices = !CrtElements.editorCheck() ? $scope.attr('data-crt-sticky-devices') : $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-sticky-devices'),
     18                    activeDevices = !CrtElements.editorCheck() ? $scope.attr('data-crt-active-breakpoints') : $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-active-breakpoints'),
     19                    stickySectionExists = $scope.hasClass('crt-sticky-section-yes') || $scope.find('.crt-sticky-section-yes-editor') ? true : false,
     20                    positionStyle,
     21                    adminBarHeight,
     22                    stickyEffectsOffset = $(window).scrollTop(),
     23                    stickyHideDistance = 0,
     24                    $window = $(window),
     25                    prevScrollPos = $window.scrollTop(),
     26                    stickyHeaderFooter = '',
     27                    stickyAnimation = 'none',
     28                    stickyAnimationHide = '',
     29                    headerFooterZIndex = !CrtElements.editorCheck() ? $scope.attr('data-crt-z-index') : $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-z-index'),
     30                    stickType = !CrtElements.editorCheck() ? $scope.attr('data-crt-sticky-type') : $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-sticky-type'),
     31                    hiddenHeaderClass = $scope.next().hasClass('e-con') ? 'crt-hidden-header-flex' : 'crt-hidden-header',
     32                    distanceFromTop = $scope.offset().top,
     33                    windowHeight = $(window).height(),
     34                    elementHeight = $scope.outerHeight(true),
     35                    distanceFromBottom = $(document).height() - (distanceFromTop + elementHeight),
     36                    offsetTop;
     37
     38
     39                if ( $scope.data('settings') && $scope.data('settings').sticky_animation ) {
     40                    stickyAnimation = $scope.data('settings').sticky_animation;
    1541                } else {
    16                     t.removeClass('crt-sticky-section-fix');
    17                 }
    18             });
     42                    stickyAnimation = $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-sticky-animation');
     43                }
     44
     45                var stickyAnimDuration = $scope.attr('data-crt-animation-duration') ? $scope.attr('data-crt-animation-duration') + 's' : 500 + 's';
     46
     47                if ( $scope.closest('div[data-elementor-type="wp-post"]').length > 0 ) {
     48                    stickyHeaderFooter = $scope.closest('div[data-elementor-type="wp-post"]');
     49                } else if ( $scope.closest('div[data-elementor-type="header"]').length > 0 ) {
     50                    stickyHeaderFooter = $scope.closest('div[data-elementor-type="header"]');
     51                } else if ( $scope.closest('div[data-elementor-type="footer"]').length > 0 ) {
     52                    stickyHeaderFooter = $scope.closest('div[data-elementor-type="footer"]');
     53                }
     54
     55                if ( !$scope.find('.crt-sticky-section-yes-editor').length) {
     56                    positionType = $scope.attr('data-crt-position-type');
     57                    positionLocation = $scope.attr('data-crt-position-location');
     58                    positionOffset = $scope.attr('data-crt-position-offset');
     59                    availableDevices = $scope.attr('data-crt-sticky-devices');
     60                    activeDevices = $scope.attr('data-crt-active-breakpoints');
     61                    headerFooterZIndex = $scope.attr('data-crt-z-index');
     62                }
     63
     64                if ( 'top' === positionLocation && 'auto' === $scope.css('top') ) {
     65                    var offsetTop = $scope.data('crt-position-offset');
     66                    $scope.css('top', offsetTop);
     67                } else {
     68                    var offsetTop = $scope.data('crt-position-offset');
     69                }
     70
     71                if ( 0 == availableDevices.length ) {
     72                    positionType = 'relative';
     73                }
     74
     75                if ( CrtElements.editorCheck() && availableDevices ) {
     76                    var attributes = $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-sticky-devices');
     77                    $scope.attr('data-crt-sticky-devices', attributes);
     78                    availableDevices = $scope.attr('data-crt-sticky-devices');
     79                }
     80
     81                changePositionType();
     82                changeAdminBarOffset();
     83
     84                $(window).smartresize(function() {
     85                    recalculateVariables();
     86                });
     87
     88                // Debounce function
     89                function debounce(func, wait) {
     90                    let timeout;
     91                    return function(...args) {
     92                        const context = this;
     93                        clearTimeout(timeout);
     94                        timeout = setTimeout(() => func.apply(context, args), wait);
     95                    };
     96                }// Adjust the debounce delay as needed
     97
     98                // Create a MutationObserver instance
     99                if ( !CrtElements.editorCheck() ) {
     100                    if ( 'yes' !== $scope.data('crt-replace-header') && 'yes' !== $scope.data('crt-sticky-hide') ) {
     101                        // Function to be called when mutations are observed
     102                        const handleMutations = debounce(function(mutationsList) {
     103                            // if (!$scope[0] || !document.body.contains($scope[0])) return;
     104                            // var isGTranslate = function(node) {
     105                            //  if (!node || !node.getAttribute) return false;
     106                            //  var id = node.getAttribute('id') || '';
     107                            //  if (id.indexOf('google_translate') !== -1 || id.indexOf('gtranslate') !== -1) return true;
     108                            //  return node.closest && (node.closest('#google_translate_element') || node.closest('.gtranslate'));
     109                            // };
     110                            for (let mutation of mutationsList) {
     111                                // if (mutation.type === 'childList' && !isGTranslate(mutation.target)) {
     112                                if (mutation.type === 'childList') {
     113                                    $(window).trigger('scroll');
     114                                    recalculateVariables();
     115                                    break;
     116                                }
     117                            }
     118                        }, 100);
     119
     120                        const observer = new MutationObserver(handleMutations);
     121                        observer.observe(document.body, { childList: true, subtree: true });
     122                    }
     123                }
     124
     125                $(window).scroll(function() {
     126                    if ($scope && $scope.css('position') === 'relative') {
     127                        recalculateVariables();
     128                    }
     129                });
     130
     131                if (!stickySectionExists) {
     132                    positionStyle = 'relative';
     133                }
     134
     135                function recalculateVariables() {
     136                    distanceFromTop = $scope.offset().top;
     137                    windowHeight = $(window).height(),
     138                        elementHeight = $scope.outerHeight(true),
     139                        distanceFromBottom = $(document).height() - (distanceFromTop + elementHeight);
     140
     141                    viewportWidth = $('body').prop('clientWidth') + 17;
     142
     143                    changePositionType();
     144                }
     145
     146                function changePositionType() {
     147                    if ( !$scope.hasClass('crt-sticky-section-yes') && !$scope.find('.crt-sticky-section-yes-editor') ) {
     148                        positionStyle = 'relative';
     149                        return;
     150                    }
     151
     152                    var desktopDimension = activeDevices.includes('widescreen_sticky') ? 2400 : 4000
     153                    var checkDevices = [['mobile_sticky', 768], ['mobile_extra_sticky', 881], ['tablet_sticky', 1025], ['tablet_extra_sticky', 1201], ['laptop_sticky', 1216],  ['desktop_sticky', 4000], ['widescreen_sticky', 4000]];
     154                    var emptyVariables = [];
     155
     156                    var checkedDevices = checkDevices.filter((item, index) => {
     157                        return activeDevices.indexOf(item[0]) != -1;
     158                    }).reverse();
     159
     160                    checkedDevices.forEach((device, index) => {
     161                        if ( device[1] > viewportWidth ) {
     162                            var deviceName = device[0].replace("_sticky", "");
     163
     164                            if ( 'desktop' == deviceName ) {
     165                                if ( $scope.data('settings') ) {
     166                                    stickyEffectsOffset = distanceFromTop + $scope.data('settings').wpr_sticky_effects_offset;
     167                                } else {
     168                                    stickyEffectsOffset = distanceFromTop + $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-offset-settings');
     169                                }
     170                            } else {
     171                                if ( $scope.data('settings') ) {
     172                                    stickyEffectsOffset = distanceFromTop + $scope.data('settings')['wpr_sticky_effects_offset_' + deviceName];
     173                                } else {
     174                                    stickyEffectsOffset = distanceFromTop + $scope.find('.crt-sticky-section-yes-editor').attr('data-crt-offset-settings');
     175                                }
     176                            }
     177
     178                            if ( availableDevices.indexOf(device[0]) === -1 ) {
     179                                positionStyle = activeDevices?.indexOf(device[0]) !== -1 ? 'relative' : (emptyVariables[index - 1] ? emptyVariables[index - 1] : positionType);
     180                                // positionStyle = activeDevices && activeDevices.indexOf(device[0]) !== -1 ? 'static' : (emptyVariables[index - 1] ? emptyVariables[index - 1] : positionType);
     181                                emptyVariables[index] = positionStyle;
     182                            } else if ( availableDevices.indexOf(device[0]) !== -1 ) {
     183                                positionStyle = positionType;
     184                            }
     185                        }
     186                    });
     187
     188                    var handleScroll = function() {
     189                        let scrollPos = $window.scrollTop();
     190
     191                        if ( 'fixed' != positionStyle ) {
     192                            if ( 'top' === positionLocation ) {
     193                                if ( scrollPos > distanceFromTop) {
     194                                    applyPosition();
     195                                } else if ( scrollPos <= distanceFromTop ) {
     196                                    $scope.css({'position': 'relative' });
     197                                }
     198                            }
     199
     200                            if ( 'bottom' === positionLocation ) {
     201                                if ( scrollPos + windowHeight <= $(document).height() - distanceFromBottom ) {
     202                                    applyPosition();
     203                                } else {
     204                                    $scope.css({'position': 'relative' });
     205                                }
     206                            }
     207                        }
     208
     209                        if ( 'relative' !== positionStyle ) {
     210                            if ( scrollPos > stickyEffectsOffset ) {
     211                                if ( 'yes' == $scope.data('crt-replace-header') ) {
     212
     213                                    if ( 'yes' === $scope.data('crt-sticky-hide') ) {
     214
     215                                        if ( scrollPos >= distanceFromTop ) {
     216                                            $scope.addClass('crt-visibility-hidden');
     217                                        }
     218
     219                                        if ( scrollPos < prevScrollPos) {
     220                                            $scope.next().addClass(hiddenHeaderClass).addClass('crt-' + stickyAnimation + '-in');
     221                                        }
     222                                    } else {
     223                                        $scope.addClass('crt-visibility-hidden');
     224                                        $scope.next().addClass(hiddenHeaderClass).addClass('crt-' + stickyAnimation + '-in');
     225                                    }
     226                                } else {
     227                                    $scope.addClass('crt-sticky-header');
     228                                }
     229                            } else if ( scrollPos <= stickyEffectsOffset ) {
     230                                if ( 'yes' == $scope.data('crt-replace-header') ) {
     231                                    $scope.next().removeClass(hiddenHeaderClass);
     232                                    $scope.removeClass('crt-visibility-hidden');
     233                                    $scope.next().removeClass('crt-' + stickyAnimation + '-in');
     234                                } else {
     235                                    $scope.removeClass('crt-sticky-header');
     236                                }
     237                            }
     238                        }
     239
     240                        if ( 'yes' === $scope.data('crt-sticky-hide') ) {
     241                            if ( scrollPos >= distanceFromTop ) {
     242                                if ( scrollPos < prevScrollPos ) {
     243                                    // Scrolling up
     244                                    if ( 'yes' === $scope.data('crt-replace-header') ) {
     245                                        $scope.next().removeClass('crt-' + stickyAnimation + '-out');
     246                                        $scope.next().addClass('crt-' + stickyAnimation + '-in');
     247                                    } else {
     248                                        $scope.removeClass('crt-' + stickyAnimation + '-out');
     249                                        $scope.addClass('crt-' + stickyAnimation + '-in');
     250                                    }
     251                                } else {
     252                                    // Scrolling down or no direction change
     253                                    if ( 'yes' === $scope.data('crt-replace-header') ) {
     254                                        $scope.next().removeClass('crt-' + stickyAnimation + '-in');
     255                                        $scope.next().addClass('crt-' + stickyAnimation + '-out');
     256                                    } else {
     257                                        $scope.removeClass('crt-' + stickyAnimation + '-in');
     258                                        $scope.addClass('crt-' + stickyAnimation + '-out');
     259                                    }
     260                                }
     261                            }
     262
     263                            if ( 0 === $(window).scrollTop() && 'sticky' === positionType ) {
     264                                $scope.css('position', 'relative');
     265                            }
     266                        }
     267
     268                        // Clear any previous timeout
     269                        clearTimeout(scrollEndTimeout);
     270
     271                        // Set a new timeout to update prevScrollPos after 150 milliseconds (adjust the delay as needed)
     272                        scrollEndTimeout = setTimeout(() => {
     273                            prevScrollPos = scrollPos;
     274                        }, 10);
     275                    }
     276
     277                    if ( 'sticky' == positionStyle ) {
     278                        $(window).scroll(handleScroll);
     279                    } else if ( 'fixed' == positionStyle ) {
     280                        applyPosition();
     281                        $(window).scroll(handleScroll);
     282                    }
     283
     284                    if ( 'yes' == $scope.data('crt-replace-header') ) {
     285                        if ( 0 != $scope.next().length ) {
     286                            $scope.next().get(0).style.setProperty('--crt-animation-duration', stickyAnimDuration);
     287                        }
     288                    }
     289
     290                    let scrollEndTimeout;
     291                }
     292
     293                function applyPosition() {
     294                    var bottom = +window.innerHeight - (+$scope.css('top').slice(0, -2) + $scope.height());
     295                    var top = +window.innerHeight - (+$scope.css('bottom').slice(0, -2) + $scope.height());
     296
     297                    if ( 'yes' === $scope.data('crt-sticky-hide') && prevScrollPos < $window.scrollTop() ) {
     298                        return;
     299                    }
     300
     301                    if ( '' == stickType ) {
     302                        stickType = 'fixed';
     303                    }
     304
     305                    $scope.css({'position': stickType });
     306
     307                    if ( $('.crt-close-cart span').length && !CrtElements.editorCheck() ) {
     308                        CrtElements.closeSideBarOnReplace($scope, 200);
     309                    }
     310                }
     311
     312                function changeAdminBarOffset() {
     313                    if ( $('#wpadminbar').length ) {
     314                        adminBarHeight = $('#wpadminbar').css('height').slice(0, $('#wpadminbar').css('height').length - 2);
     315
     316                        if ( 'top'  ===  positionLocation && ( 'fixed' == $scope.css('position') ) ) {
     317                            $scope.css('top', +adminBarHeight + offsetTop + 'px');
     318                            $scope.css('bottom', 'auto');
     319                        }
     320                    }
     321                }
     322            }
     323
     324            var CrtElements = {
     325                editorCheck: function() {
     326                    return $( 'body' ).hasClass( 'elementor-editor-active' ) ? true : false;
     327                },
     328            }
    19329        });
    20 
    21330    });
    22331})(jQuery);
  • crt-manage/trunk/crt-manage.php

    r3476572 r3478729  
    33 * Plugin Name: CRT Manage
    44 * Description: CRT Manage is a front page customizer plugin for Wordpress themes by author domainlee
    5  * Version: 1.5.4
     5 * Version: 1.5.5
    66 * Author: Domainlee
    77 * Author URI: https://crthemes.com/
  • crt-manage/trunk/includes/customizer/addons/addons.php

    r3475480 r3478729  
    138138        require CRT_MANAGE_DIR . '/includes/customizer/addons/woocommerce/woocommerce-config.php';
    139139        require CRT_MANAGE_DIR . '/includes/customizer/addons/woocommerce/woocommerce-helpers.php';
     140        require CRT_MANAGE_DIR . '/includes/customizer/addons/woocommerce/crt-check-product-in-wc.php';
    140141        require CRT_MANAGE_DIR . '/includes/customizer/addons/woocommerce/crt-grid-helpers.php';
    141142        require CRT_MANAGE_DIR . '/includes/customizer/addons/admin/crt-templates-modal-popups.php';
     
    370371                    'id' => get_the_ID(),
    371372                    'text' => html_entity_decode(get_the_title()),
     373                ];
     374            }
     375        }
     376
     377        wp_reset_postdata();
     378
     379        return [ 'results' => $options ];
     380    }
     381
     382    public function get_post_type_taxonomies( $request ) {
     383        if ( ! current_user_can( 'edit_posts' ) ) {
     384            return;
     385        }
     386
     387        $post_type = isset($request['query_slug']) ? $request['query_slug'] : '';
     388
     389        $args = [
     390            'orderby' => 'name',
     391            'order' => 'DESC',
     392            'hide_empty' => true,
     393            'number' => -1,
     394        ];
     395
     396        if ( isset( $request['ids'] ) ) {
     397            $request['ids'] = ('' !== $request['ids']) ? $request['ids'] : '99999999'; // Query Hack
     398            $ids = explode( ',', $request['ids'] );
     399            $args['include'] = $ids;
     400        }
     401
     402        if ( isset( $request['s'] ) ) {
     403            $args['name__like'] = $request['s'];
     404        }
     405
     406        $options = [];
     407        $taxonomies = get_object_taxonomies( $post_type, 'objects' );
     408
     409        if ( ! empty($taxonomies) ) {
     410            foreach ( $taxonomies as $taxonomy ) {
     411                $options[] = [
     412                    'id'   => $taxonomy->name,
     413                    'text' => $taxonomy->label,
    372414                ];
    373415            }
     
    632674            array( 'CRT_Back_To_Top', 'crt-back-to-top' ),
    633675//            array( 'CRT_Product_Filters', 'crt-product-filters' ),
     676            array( 'CRT_Advanced_Filters_Pro', 'crt-advanced-filters-pro' ),
    634677        );
    635678    }
  • crt-manage/trunk/includes/customizer/addons/builder.php

    r3474722 r3478729  
    154154                'is_product_category' => function_exists('is_product_category') ? is_product_category() : false,
    155155                'is_product_tag' => function_exists('is_product_tag') ? is_product_tag() : false,
     156                'sticky_section' => $this->crt_get_extension_option( 'crt-sticky-section' ),
     157
    156158                // 'token' => $custom_token
    157159            ]
     
    10071009    }
    10081010
     1011    private static $crt_extension_options = null;
     1012
     1013
     1014    private function crt_get_extension_option( $key, $default = 'on' ) {
     1015        if ( null === self::$crt_extension_options ) {
     1016            self::$crt_extension_options = [
     1017                'crt-particles'             => get_option( 'crt-particles', 'on' ),
     1018                'crt-parallax-background'   => get_option( 'crt-parallax-background', 'on' ),
     1019                'crt-parallax-multi-layer'  => get_option( 'crt-parallax-multi-layer', 'on' ),
     1020                'crt-sticky-section'        => get_option( 'crt-sticky-section', 'on' ),
     1021                'crt-custom-css'            => get_option( 'crt-custom-css', 'on' ),
     1022                'crt_override_woo_templates'=> get_option( 'crt_override_woo_templates', 'on' ),
     1023            ];
     1024        }
     1025        return isset( self::$crt_extension_options[ $key ] ) ? self::$crt_extension_options[ $key ] : $default;
     1026    }
     1027
    10091028
    10101029}
  • crt-manage/trunk/includes/customizer/addons/controls/crt-sticky-section.php

    r3461154 r3478729  
    2424    public function __construct() {
    2525        add_action( 'elementor/element/section/section_background/after_section_end', [ $this, 'register_controls' ], 10 );
    26 //      add_action( 'elementor/section/print_template', [ $this, '_print_template' ], 10, 2 );
    27 //      add_action( 'elementor/frontend/section/before_render', [ $this, '_before_render' ], 10, 1 );
     26        add_action( 'elementor/section/print_template', [ $this, '_print_template' ], 10, 2 );
     27        add_action( 'elementor/frontend/section/before_render', [ $this, '_before_render' ], 10, 1 );
    2828
    2929        // FLEXBOX
    3030        add_action('elementor/element/container/section_layout/after_section_end', [$this, 'register_controls'], 10);
    31 //        add_action( 'elementor/container/print_template', [ $this, '_print_template' ], 10, 2 );
    32 //        add_action('elementor/frontend/container/before_render', [$this, '_before_render'], 10, 1);
     31        add_action( 'elementor/container/print_template', [ $this, '_print_template' ], 10, 2 );
     32        add_action('elementor/frontend/container/before_render', [$this, '_before_render'], 10, 1);
    3333    }
    3434
    35     public static function add_control_group_sticky_advanced_options($element) {
    36 
    37         $element->add_control(
    38             'sticky_advanced_pro_notice',
    39             [
    40                 'type' => Controls_Manager::RAW_HTML,
    41                 'raw' => '<strong>Advanced Options</strong> are available in the',
    42                 'content_classes' => 'crt-pro-notice',
    43                 'condition' => [
    44                     'enable_sticky_section' => 'yes'
    45                 ]
    46             ]
    47         );
    48     }
     35    public static function add_control_group_sticky_advanced_options($element) {
     36
     37        $element->add_control(
     38            'sticky_advanced_options_heading',
     39            [
     40                'label' => esc_html__( 'Advanced', 'crt-manage' ),
     41                'type' => Controls_Manager::HEADING,
     42                'separator' => 'before',
     43                'condition' => [
     44                    'enable_sticky_section' => 'yes',
     45                    'position_location' => 'top'
     46                ],
     47            ]
     48        );
     49
     50        // All pro
     51        $element->add_control (
     52            'sticky_advanced_options',
     53            [
     54                'type' => Controls_Manager::SWITCHER,
     55                'label' => esc_html__( 'Enable Advanced Options', 'crt-manage' ),
     56                'description' => 'Please note that <strong>Advanced Options</strong> are designed to work only with <strong>Header Sections</strong>.',
     57                'default' => 'no',
     58                'return_value' => 'yes',
     59                'condition' => [
     60                    'enable_sticky_section' => 'yes',
     61                    'position_location' => 'top'
     62                ]
     63            ]
     64        );
     65
     66        $element->add_responsive_control(
     67            'crt_sticky_effects_offset',
     68            [
     69                'label' => __( 'Scroll Top Distance', 'crt-manage' ), // SHOULD WORK AFTER STICKING
     70                'type' => Controls_Manager::NUMBER,
     71                'description' => esc_html__('Set the distance to start the effect when the Top of the page touches the Sticky section.', 'crt-manage'),
     72                'min' => 0,
     73                'required' => true,
     74                'frontend_available' => true,
     75                'render_type' => 'template',
     76                'default' => 0,
     77                'widescreen_default' => 0,
     78                'laptop_default' => 0,
     79                'tablet_extra_default' => 0,
     80                'tablet_default' => 0,
     81                'mobile_extra_default' => 0,
     82                'mobile_default' => 0,
     83                'condition' => [
     84                    'enable_sticky_section' => 'yes',
     85                    'sticky_advanced_options' => 'yes',
     86                    'position_location' => 'top'
     87                ],
     88                'separator' => 'before'
     89            ]
     90        );
     91
     92        $element->add_control ( // NEXT HIDDEN SECTION
     93            'sticky_replace_header',
     94            [
     95                'type' => Controls_Manager::SWITCHER,
     96                'label' => esc_html__( 'Replace with New Section', 'crt-manage' ),
     97                'description' => esc_html__('After enabling this option, the next section will replace this section when it becomes sticky. The next section will be automatically hidden on page load.', 'crt-manage'),
     98                'default' => 'no',
     99                'return_value' => 'yes',
     100                'condition' => [
     101                    'enable_sticky_section' => 'yes',
     102                    'sticky_advanced_options' => 'yes',
     103                    'position_location' => 'top'
     104                ],
     105                'prefix_class' => 'crt-sticky-replace-header-',
     106                'separator' => 'before',
     107                'render_type' => 'template',
     108            ]
     109        );
     110
     111        $element->add_control ( // NEXT HIDDEN SECTION
     112            'sticky_shrink_section',
     113            [
     114                'type' => Controls_Manager::SWITCHER,
     115                'label' => esc_html__( 'Custom Height', 'crt-manage' ),
     116                'default' => 'no',
     117                'return_value' => 'yes',
     118                'condition' => [
     119                    'enable_sticky_section' => 'yes',
     120                    'sticky_advanced_options' => 'yes',
     121                    'position_location' => 'top',
     122                    'sticky_replace_header!' => 'yes'
     123                ],
     124                'separator' => 'before',
     125                'prefix_class' => 'crt-sticky-custom-height-'
     126            ]
     127        );
     128
     129        $element->add_responsive_control(
     130            'sticky_shrink_size',
     131            [
     132                'type' => Controls_Manager::SLIDER,
     133                'label' => esc_html__( 'Section Height', 'crt-manage' ),
     134                'range' => [
     135                    'px' => [
     136                        'min' => 0,
     137                        'max' => 500,
     138                    ]
     139                ],
     140                'default' => [
     141                    'size' => 50,
     142                ],
     143                'selectors' => [
     144                    '{{WRAPPER}}.crt-sticky-header .elementor-container' => 'min-height: {{SIZE}}{{UNIT}} !important;',
     145                ],
     146                'condition' => [
     147                    'enable_sticky_section' => 'yes',
     148                    'position_location' => 'top',
     149                    'sticky_advanced_options' => 'yes',
     150                    'sticky_shrink_section' => 'yes',
     151                    'sticky_replace_header!' => 'yes'
     152                ]
     153            ]
     154        );
     155
     156        $element->add_control (
     157            'sticky_background',
     158            [
     159                'type' => Controls_Manager::SWITCHER,
     160                'label' => esc_html__( 'Custom Colors (Beta)', 'crt-manage' ),
     161                'default' => 'no',
     162                'return_value' => 'yes',
     163                'condition' => [
     164                    'enable_sticky_section' => 'yes',
     165                    'sticky_advanced_options' => 'yes',
     166                    'position_location' => 'top',
     167                    'sticky_replace_header!' => 'yes'
     168                ],
     169                'separator' => 'before',
     170                'prefix_class' => 'crt-sticky-custom-colors-'
     171            ]
     172        );
     173
     174        $element->add_control(
     175            'sticky_text_color',
     176            [
     177                'label' => esc_html__( 'Text Color', 'crt-manage' ),
     178                'type' => Controls_Manager::COLOR,
     179                'selectors' => [
     180                    '{{WRAPPER}}.crt-sticky-header *:not(.sub-menu *)' => 'color: {{VALUE}} !important;', // CHECK SELECTORS - LOGO MENU & maybe BUTTON
     181                ],
     182                'condition' => [
     183                    'enable_sticky_section' => 'yes',
     184                    'sticky_background' => 'yes',
     185                    'sticky_advanced_options' => 'yes',
     186                    'position_location' => 'top',
     187                    'sticky_replace_header!' => 'yes'
     188                ]
     189            ]
     190        );
     191
     192        $element->add_control(
     193            'sticky_link_color',
     194            [
     195                'label' => esc_html__( 'Link Color', 'crt-manage' ),
     196                'type' => Controls_Manager::COLOR,
     197                'selectors' => [
     198                    '{{WRAPPER}}.crt-sticky-header a:not(.sub-menu a)' => 'color: {{VALUE}} !important;', // CHECK SELECTORS - LOGO MENU & maybe BUTTON
     199                    '{{WRAPPER}}.crt-sticky-header a:not(.sub-menu a) *' => 'color: {{VALUE}} !important;'
     200                ],
     201                'condition' => [
     202                    'enable_sticky_section' => 'yes',
     203                    'sticky_background' => 'yes',
     204                    'sticky_advanced_options' => 'yes',
     205                    'position_location' => 'top',
     206                    'sticky_replace_header!' => 'yes'
     207                ]
     208            ]
     209        );
     210
     211        // $element->add_control(
     212        //  'sticky_logo_color',
     213        //  [
     214        //      'label' => esc_html__( 'Logo Color', 'crt-manage' ),
     215        //      'type' => Controls_Manager::COLOR,
     216        //      'selectors' => [
     217        //          '{{WRAPPER}}.crt-sticky-header .crt-logo' => 'color: {{VALUE}} !important;', // CHECK SELECTORS - LOGO MENU & maybe BUTTON
     218        //          '{{WRAPPER}}.crt-sticky-header .crt-logo *' => 'color: {{VALUE}} !important;'
     219        //      ],
     220        //      'condition' => [
     221        //          'sticky_background' => 'yes',
     222        //          'sticky_advanced_options' => 'yes'
     223        //      ]
     224        //  ]
     225        // );
     226
     227        $element->add_control(
     228            'sticky_background_color',
     229            [
     230                'label' => esc_html__( 'Background Color', 'crt-manage' ),
     231                'type' => Controls_Manager::COLOR,
     232                'selectors' => [
     233                    '{{WRAPPER}}.crt-sticky-header' => 'background-color: {{VALUE}} !important; z-index: 9999 !important;',
     234                ],
     235                'condition' => [
     236                    'enable_sticky_section' => 'yes',
     237                    'sticky_background' => 'yes',
     238                    'sticky_advanced_options' => 'yes',
     239                    'position_location' => 'top',
     240                    'sticky_replace_header!' => 'yes'
     241                ]
     242            ]
     243        );
     244
     245        $element->add_control (
     246            'sticky_logo_scale',
     247            [
     248                'type' => Controls_Manager::SWITCHER,
     249                'label' => esc_html__( 'Logo Scale', 'crt-manage' ), // Show Number Input 0.7 default
     250                'description' => esc_html__( 'Works with Royal Addons Logo widget.', 'crt-manage' ),
     251                'default' => 'no',
     252                'return_value' => 'yes',
     253                'condition' => [
     254                    'enable_sticky_section' => 'yes',
     255                    'sticky_advanced_options' => 'yes',
     256                    'position_location' => 'top',
     257                    'sticky_replace_header!' => 'yes'
     258                ],
     259                'separator' => 'before',
     260                'prefix_class' => 'crt-sticky-scale-logo-'
     261            ]
     262        );
     263
     264        $element->add_control(
     265            'sticky_logo_scale_size',
     266            [
     267                'label' => esc_html__( 'Logo Size %', 'crt-manage' ),
     268                'type' => Controls_Manager::NUMBER,
     269                'default' => 70,
     270                'min' => 10,
     271                'max' => 100,
     272                'step' => 5,
     273                'selectors' => [
     274                    '{{WRAPPER}}.crt-sticky-header .crt-logo-image' => 'width: {{VALUE}}%', // ADD CONTROL FOR ANIMATION TIMINGS
     275                ],
     276                'condition' => [
     277                    'enable_sticky_section' => 'yes',
     278                    'sticky_logo_scale' => 'yes',
     279                    'sticky_advanced_options' => 'yes',
     280                    'position_location' => 'top',
     281                    'sticky_replace_header!' => 'yes'
     282                ]
     283            ]
     284        );
     285
     286        $element->add_control(
     287            'sticky_trans_duration',
     288            [
     289                'label' => esc_html__( 'Transition Time', 'crt-manage' ),
     290                'description' => esc_html__('Set a trinsition time for Custom Height animation, Custom Colors and Logo Scale.', 'crt-manage'),
     291                'type' => Controls_Manager::NUMBER,
     292                'default' => 0.3,
     293                'min' => 0,
     294                'max' => 5,
     295                'step' => 0.1,
     296                'selectors' => [
     297                    '{{WRAPPER}}.crt-sticky-custom-height-yes' => 'transition: all {{VALUE}}s linear !important;', // ADD CONTROL FOR ANIMATION TIMINGS
     298                    '{{WRAPPER}}.crt-sticky-scale-logo-yes .crt-logo' => 'transition: all {{VALUE}}s linear !important;', // ADD CONTROL FOR ANIMATION TIMINGS
     299                    '{{WRAPPER}}.crt-sticky-custom-colors-yes span' => 'transition: all {{VALUE}}s linear !important;',
     300                    '{{WRAPPER}}.crt-sticky-custom-colors-yes a' => 'transition: all {{VALUE}}s linear !important;',
     301                    '{{WRAPPER}}.crt-sticky-custom-colors-yes button' => 'transition: all {{VALUE}}s linear !important;',
     302                    '{{WRAPPER}}.crt-sticky-custom-colors-yes *::before' => 'transition: all {{VALUE}}s linear !important;'
     303                    // '{{WRAPPER}}' => 'transition: background {{VALUE}}s, border {{VALUE}}s, border-radius {{VALUE}}s, box-shadow {{VALUE}}s;',
     304                    // '{{WRAPPER}} *' => 'transition: background {{VALUE}}s, border {{VALUE}}s, border-radius {{VALUE}}s, box-shadow {{VALUE}}s;'
     305
     306                ],
     307                'condition' => [
     308                    'enable_sticky_section' => 'yes',
     309                    'sticky_advanced_options' => 'yes',
     310                    'position_location' => 'top',
     311                    'sticky_replace_header!' => 'yes'
     312                ],
     313                'separator' => 'before'
     314            ]
     315        );
     316
     317        $element->add_control ( // NEXT HIDDEN SECTION
     318            'crt_sticky_section_border',
     319            [
     320                'type' => Controls_Manager::SWITCHER,
     321                'label' => esc_html__( 'Custom Border', 'crt-manage' ),
     322                'default' => 'no',
     323                'return_value' => 'yes',
     324                'condition' => [
     325                    'enable_sticky_section' => 'yes',
     326                    'sticky_advanced_options' => 'yes',
     327                    'position_location' => 'top',
     328                    'sticky_replace_header!' => 'yes'
     329                ],
     330                'separator' => 'before'
     331            ]
     332        );
     333
     334        $element->add_control(
     335            'crt_sticky_section_border_type',
     336            [
     337                'label' => esc_html__( 'Border Type', 'crt-manage' ),
     338                'type' => Controls_Manager::SELECT,
     339                'options' => [
     340                    'none' => esc_html__( 'None', 'crt-manage' ),
     341                    'solid' => esc_html__( 'Solid', 'crt-manage' ),
     342                    'double' => esc_html__( 'Double', 'crt-manage' ),
     343                    'dotted' => esc_html__( 'Dotted', 'crt-manage' ),
     344                    'dashed' => esc_html__( 'Dashed', 'crt-manage' ),
     345                    'groove' => esc_html__( 'Groove', 'crt-manage' ),
     346                ],
     347                'default' => 'none',
     348                'selectors' => [
     349                    '{{WRAPPER}}.crt-sticky-header' => 'border-style: {{VALUE}};'
     350                ],
     351                'condition' => [
     352                    'enable_sticky_section' => 'yes',
     353                    'sticky_advanced_options' => 'yes',
     354                    'position_location' => 'top',
     355                    'sticky_replace_header!' => 'yes',
     356                    'crt_sticky_section_border' => 'yes'
     357                ]
     358            ]
     359        );
     360
     361        $element->add_control(
     362            'crt_sticky_section_border_color',
     363            [
     364                'label'  => esc_html__( 'Border Color', 'crt-manage' ),
     365                'type' => Controls_Manager::COLOR,
     366                'default' => '#E8E8E8',
     367                'selectors' => [
     368                    '{{WRAPPER}}.crt-sticky-header' => 'border-color: {{VALUE}}'
     369                ],
     370                'condition' => [
     371                    'enable_sticky_section' => 'yes',
     372                    'sticky_advanced_options' => 'yes',
     373                    'position_location' => 'top',
     374                    'sticky_replace_header!' => 'yes',
     375                    'crt_sticky_section_border' => 'yes',
     376                    'crt_sticky_section_border_type!' => 'none'
     377                ]
     378            ]
     379        );
     380
     381        $element->add_control(
     382            'crt_sticky_section_border_width',
     383            [
     384                'label' => esc_html__( 'Border Width', 'crt-manage' ),
     385                'type' => Controls_Manager::DIMENSIONS,
     386                'size_units' => [ 'px' ],
     387                'default' => [
     388                    'top' => 1,
     389                    'right' => 1,
     390                    'bottom' => 1,
     391                    'left' => 1,
     392                ],
     393                'selectors' => [
     394                    '{{WRAPPER}}.crt-sticky-header' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
     395                ],
     396                'condition' => [
     397                    'enable_sticky_section' => 'yes',
     398                    'sticky_advanced_options' => 'yes',
     399                    'position_location' => 'top',
     400                    'sticky_replace_header!' => 'yes',
     401                    'crt_sticky_section_border' => 'yes',
     402                    'crt_sticky_section_border_type!' => 'none'
     403                ]
     404            ]
     405        );
     406
     407        $element->add_control(
     408            'crt_sticky_section_border_radius',
     409            [
     410                'label' => esc_html__( 'Border Radius', 'crt-manage' ),
     411                'type' => Controls_Manager::DIMENSIONS,
     412                'size_units' => [ 'px', '%' ],
     413                'default' => [
     414                    'top' => 0,
     415                    'right' => 0,
     416                    'bottom' => 0,
     417                    'left' => 0,
     418                ],
     419                'selectors' => [
     420                    '{{WRAPPER}}.crt-sticky-header' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
     421                ],
     422                'condition' => [
     423                    'enable_sticky_section' => 'yes',
     424                    'sticky_advanced_options' => 'yes',
     425                    'position_location' => 'top',
     426                    'sticky_replace_header!' => 'yes',
     427                    'crt_sticky_section_border' => 'yes',
     428                    'crt_sticky_section_border_type!' => 'none'
     429                ]
     430            ]
     431        );
     432
     433        $element->add_control ( // NEXT HIDDEN SECTION
     434            'crt_sticky_section_bs',
     435            [
     436                'type' => Controls_Manager::SWITCHER,
     437                'label' => esc_html__( 'Custom Shadow', 'crt-manage' ),
     438                'default' => 'no',
     439                'return_value' => 'yes',
     440                'condition' => [
     441                    'enable_sticky_section' => 'yes',
     442                    'sticky_advanced_options' => 'yes',
     443                    'position_location' => 'top',
     444                    'sticky_replace_header!' => 'yes'
     445                ],
     446                'separator' => 'before'
     447            ]
     448        );
     449
     450        $element->add_group_control(
     451            Group_Control_Box_Shadow::get_type(),
     452            [
     453                'name' => 'crt_sticky_section_box_shadow',
     454                'selector' => '{{WRAPPER}}.crt-sticky-header',
     455                'condition' => [
     456                    'enable_sticky_section' => 'yes',
     457                    'sticky_advanced_options' => 'yes',
     458                    'position_location' => 'top',
     459                    'sticky_replace_header!' => 'yes',
     460                    'crt_sticky_section_bs' => 'yes'
     461                ]
     462            ]
     463        );
     464
     465        $element->add_control (
     466            'sticky_hide',
     467            [
     468                'type' => Controls_Manager::SWITCHER,
     469                'label' => esc_html__( 'Show on Scrolling Up', 'crt-manage' ),
     470                'description' => esc_html__('If the section is sticky and page is scrolled Down, this section will be hidden and will only show up when the page is scrolled Up.', 'crt-manage'),
     471                'default' => 'no',
     472                'return_value' => 'yes',
     473                'condition' => [
     474                    'enable_sticky_section' => 'yes',
     475                    'sticky_advanced_options' => 'yes',
     476                    'position_location' => 'top'
     477                ],
     478                'separator' => 'before'
     479            ]
     480        );
     481
     482        $element->add_control( // TRANSITION
     483            'sticky_animation',
     484            [
     485                'label' => esc_html__( 'Select Animation', 'crt-manage' ),
     486                'type' => Controls_Manager::SELECT,
     487                'default' => 'none',
     488                'options' => [
     489                    'none' => 'None',
     490                    'fade' => 'Fade',
     491                    'slide' => 'Slide'
     492                ],
     493                'frontend_available' => true,
     494                'conditions' => [
     495                    'relation' => 'and',
     496                    'terms' => [
     497                        [
     498                            'name' => 'enable_sticky_section',
     499                            'operator' => '=',
     500                            'value' => 'yes',
     501                        ],
     502                        [
     503                            'name' => 'sticky_advanced_options',
     504                            'operator' => '=',
     505                            'value' => 'yes',
     506                        ],
     507                        [
     508                            'name' => 'position_location',
     509                            'operator' => '=',
     510                            'value' => 'top',
     511                        ],
     512                        [
     513                            'relation' => 'or',
     514                            'terms' => [
     515                                [
     516                                    'name' => 'sticky_replace_header',
     517                                    'operator' => '=',
     518                                    'value' => 'yes',
     519                                ],
     520                                [
     521                                    'name' => 'sticky_hide',
     522                                    'operator' => '=',
     523                                    'value' => 'yes',
     524                                ],
     525                            ],
     526                        ],
     527                    ],
     528                ],
     529                'separator' => 'before',
     530                'render_type' => 'template'
     531            ]
     532        );
     533
     534        $element->add_control(
     535            'sticky_animation_duration',
     536            [
     537                'label' => esc_html__( 'Animation Duration', 'crt-manage' ),
     538                'type' => Controls_Manager::NUMBER,
     539                'default' => 0.3,
     540                'min' => 0,
     541                'max' => 5,
     542                'step' => 0.1,
     543                'selectors' => [
     544                    '{{WRAPPER}}' => '--crt-animation-duration: {{VALUE}}s', // ADD CONTROL FOR ANIMATION TIMINGS
     545
     546                ],
     547                'conditions' => [
     548                    'relation' => 'and',
     549                    'terms' => [
     550                        [
     551                            'name' => 'enable_sticky_section',
     552                            'operator' => '=',
     553                            'value' => 'yes',
     554                        ],
     555                        [
     556                            'name' => 'sticky_advanced_options',
     557                            'operator' => '=',
     558                            'value' => 'yes',
     559                        ],
     560                        [
     561                            'name' => 'position_location',
     562                            'operator' => '=',
     563                            'value' => 'top',
     564                        ],
     565                        [
     566                            'name' => 'sticky_animation',
     567                            'operator' => '!=',
     568                            'value' => 'none',
     569                        ],
     570                        [
     571                            'relation' => 'or',
     572                            'terms' => [
     573                                [
     574                                    'name' => 'sticky_replace_header',
     575                                    'operator' => '=',
     576                                    'value' => 'yes',
     577                                ],
     578                                [
     579                                    'name' => 'sticky_hide',
     580                                    'operator' => '=',
     581                                    'value' => 'yes',
     582                                ],
     583                            ],
     584                        ],
     585                    ],
     586                ],
     587                'render_type' => 'template',
     588            ]
     589        );
     590    }
     591
    49592
    50593    public function register_controls( $element ) {
    51         $post_type = get_post_type( get_the_ID() );
    52594
    53595        if ( ( 'section' === $element->get_name() || 'container' === $element->get_name() ) ) {
    54596
    55             $element->start_controls_section (
    56                 'crt_section_sticky_section',
    57                 [
    58                     'tab'   => Controls_Manager::TAB_ADVANCED,
    59                     'label' =>  esc_html__('Sticky Section', 'crt-manage'),
    60                 ]
    61             );
    62 
    63 //          $element->add_control(
    64 //              'crt_sticky_apply_changes',
    65 //              [
    66 //                  'type' => Controls_Manager::RAW_HTML,
    67 //                  'raw' => '<div class="elementor-update-preview-button editor-crt-preview-update"><span>Update changes to Preview</span><button class="elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply</button></div>',
    68 //                  'separator' => 'after'
    69 //              ]
    70 //          );
    71 
    72             $element->add_control (
    73                 'enable_sticky_section',
    74                 [
    75                     'type' => Controls_Manager::SWITCHER,
    76                     'label' => esc_html__( 'Make This Section Sticky', 'crt-manage' ),
    77                     'default' => 'no',
    78                     'return_value' => 'yes',
    79                     'prefix_class' => 'crt-sticky-section-',
    80                     'render_type' => 'template',
    81                 ]
    82             );
    83 
    84             $element->add_control(
    85                 'enable_on_devices',
    86                 [
    87                     'label' => esc_html__( 'Enable on Devices', 'crt-manage' ),
    88                     'label_block' => true,
    89                     'type' => Controls_Manager::SELECT2,
    90                     'default' => ['desktop_sticky'],
    91                     'options' => $this->breakpoints_manager(),
    92                     'multiple' => true,
    93                     'separator' => 'before',
    94                     'condition' => [
    95                         'enable_sticky_section' => 'yes'
    96                     ],
    97 
    98                 ]
    99             );
    100            
    101 //          $element->add_control (
    102 //              'position_type',
    103 //              [
    104 //                  'label' => __( 'Position Type', 'crt-manage' ),
    105 //                  'type' => Controls_Manager::SELECT,
    106 //                  'default' => 'sticky',
    107 //                  'options' => [
    108 //                      'sticky'  => __( 'Stick on Scroll', 'crt-manage' ),
    109 //                      'fixed' => __( 'Fixed by Default', 'crt-manage' ),
    110 //                  ],
    111 //                    // 'selectors' => [
    112 //                  //  '{{WRAPPER}}' => 'position: {{VALUE}};',
    113 //                    // ],
    114 //                  'render_type' => 'template',
    115 //                  'condition' => [
    116 //                      'enable_sticky_section' => 'yes'
    117 //                  ],
    118 //              ]
    119 //          );
    120            
    121 //          $element->add_control (
    122 //              'sticky_type',
    123 //              [
    124 //                  'label' => __( 'Sticky Relation', 'crt-manage' ),
    125 //                  'type' => Controls_Manager::SELECT,
    126 //                  'description' => __('Please switch to *Window* if you are going to use <span style="color: red;">*Advanced Options*</span>.', 'crt-manage'),
    127 //                  'default' => 'sticky',
    128 //                  'options' => [
    129 //                      'sticky'  => __( 'Parent', 'crt-manage' ),
    130 //                      'fixed' => __( 'Window', 'crt-manage' ),
    131 //                  ],
    132 //                  'render_type' => 'template',
    133 //                  'condition' => [
    134 //                      'enable_sticky_section' => 'yes',
    135 //                      'position_type' => 'sticky'
    136 //                  ],
    137 //              ]
    138 //          );
    139            
    140             $element->add_control (
    141                 'position_location',
    142                 [
    143                     'label' => __( 'Location', 'crt-manage' ),
    144                     'type' => Controls_Manager::SELECT,
    145                     'default' => 'top',
    146                     'render_type' => 'template',
    147                     'options' => [
    148                         'top' => __( 'Top', 'crt-manage' ),
    149                         'bottom'  => __( 'Bottom', 'crt-manage' ),
    150                     ],
    151                     // 'selectors_dictionary' => [
    152                     //  'top' => 'top: {{position_offset.VALUE}}px; bottom: auto;',
    153                     //  'bottom' => 'bottom: {{position_offset.VALUE}}px; top: auto;'
    154                     // ],
     597            $element->start_controls_section (
     598                'crt_section_sticky_section',
     599                [
     600                    'tab'   => Controls_Manager::TAB_ADVANCED,
     601                    'label' =>  sprintf(esc_html__('Sticky Section - %s', 'crt-manage'), Utilities::get_plugin_name()),
     602                ]
     603            );
     604
     605            $element->add_control(
     606                'crt_sticky_apply_changes',
     607                [
     608                    'type' => Controls_Manager::RAW_HTML,
     609                    'raw' => '<div class="elementor-update-preview-button editor-crt-preview-update"><span>Update changes to Preview</span><button class="elementor-button elementor-button-success" onclick="elementor.reloadPreview();">Apply</button></div>',
     610                    'separator' => 'after'
     611                ]
     612            );
     613
     614            $element->add_control (
     615                'enable_sticky_section',
     616                [
     617                    'type' => Controls_Manager::SWITCHER,
     618                    'label' => esc_html__( 'Make This Section Sticky', 'crt-manage' ),
     619                    'default' => 'no',
     620                    'return_value' => 'yes',
     621                    'prefix_class' => 'crt-sticky-section-',
     622                    'render_type' => 'template',
     623                ]
     624            );
     625
     626            $element->add_control(
     627                'enable_on_devices',
     628                [
     629                    'label' => esc_html__( 'Enable on Devices', 'crt-manage' ),
     630                    'label_block' => true,
     631                    'type' => Controls_Manager::SELECT2,
     632                    'default' => ['desktop_sticky'],
     633                    'options' => $this->breakpoints_manager(),
     634                    'multiple' => true,
     635                    'separator' => 'before',
     636                    'condition' => [
     637                        'enable_sticky_section' => 'yes'
     638                    ],
     639
     640                ]
     641            );
     642
     643            $element->add_control (
     644                'position_type',
     645                [
     646                    'label' => __( 'Position Type', 'crt-manage' ),
     647                    'type' => Controls_Manager::SELECT,
     648                    'default' => 'sticky',
     649                    'options' => [
     650                        'sticky'  => __( 'Stick on Scroll', 'crt-manage' ),
     651                        'fixed' => __( 'Fixed by Default', 'crt-manage' ),
     652                    ],
     653                    // 'selectors' => [
     654                    //  '{{WRAPPER}}' => 'position: {{VALUE}};',
     655                    // ],
     656                    'render_type' => 'template',
     657                    'condition' => [
     658                        'enable_sticky_section' => 'yes'
     659                    ],
     660                ]
     661            );
     662
     663            $element->add_control (
     664                'sticky_type',
     665                [
     666                    'label' => __( 'Sticky Relation', 'crt-manage' ),
     667                    'type' => Controls_Manager::SELECT,
     668                    'description' => __('Please switch to *Window* if you are going to use <span style="color: red;">*Advanced Options*</span>.', 'crt-manage'),
     669                    'default' => 'sticky',
     670                    'options' => [
     671                        'sticky'  => __( 'Parent', 'crt-manage' ),
     672                        'fixed' => __( 'Window', 'crt-manage' ),
     673                    ],
     674                    'render_type' => 'template',
     675                    'condition' => [
     676                        'enable_sticky_section' => 'yes',
     677                        'position_type' => 'sticky'
     678                    ],
     679                ]
     680            );
     681
     682            $element->add_control (
     683                'position_location',
     684                [
     685                    'label' => __( 'Location', 'crt-manage' ),
     686                    'type' => Controls_Manager::SELECT,
     687                    'default' => 'top',
     688                    'render_type' => 'template',
     689                    'options' => [
     690                        'top' => __( 'Top', 'crt-manage' ),
     691                        'bottom'  => __( 'Bottom', 'crt-manage' ),
     692                    ],
     693                    // 'selectors_dictionary' => [
     694                    //  'top' => 'top: {{position_offset.VALUE}}px; bottom: auto;',
     695                    //  'bottom' => 'bottom: {{position_offset.VALUE}}px; top: auto;'
     696                    // ],
    155697                    'selectors' => [
    156698                        '{{WRAPPER}}' => 'top: auto; bottom: auto; {{VALUE}}: {{position_offset.VALUE}}px;',
    157699                    ],
    158                     'condition' => [
    159                         'enable_sticky_section' => 'yes'
    160                     ]
    161                 ]
    162             );
    163            
    164             $element->add_responsive_control(
    165                 'position_offset',
    166                 [
    167                     'label' => __( 'Offset', 'crt-manage' ),
    168                     'type' => Controls_Manager::NUMBER,
    169                     'min' => 0,
    170                     'max' => 500,
    171                     'required' => true,
    172                     'frontend_available' => true,
    173                     'render_type' => 'template',
    174                     'default' => 0,
    175                     'widescreen_default' => 0,
    176                     'laptop_default' => 0,
    177                     'tablet_extra_default' => 0,
    178                     'tablet_default' => 0,
    179                     'mobile_extra_default' => 0,
    180                     'mobile_default' => 0,
     700                    'condition' => [
     701                        'enable_sticky_section' => 'yes'
     702                    ]
     703                ]
     704            );
     705
     706            $element->add_responsive_control(
     707                'position_offset',
     708                [
     709                    'label' => __( 'Offset', 'crt-manage' ),
     710                    'type' => Controls_Manager::NUMBER,
     711                    'min' => 0,
     712                    'max' => 500,
     713                    'required' => true,
     714                    'frontend_available' => true,
     715                    'render_type' => 'template',
     716                    'default' => 0,
     717                    'widescreen_default' => 0,
     718                    'laptop_default' => 0,
     719                    'tablet_extra_default' => 0,
     720                    'tablet_default' => 0,
     721                    'mobile_extra_default' => 0,
     722                    'mobile_default' => 0,
    181723                    'selectors' => [
    182                         '{{WRAPPER}}.crt-sticky-section-yes.crt-sticky-section-fix' => 'top: {{VALUE}}px !important;',
    183                         '.logged-in.admin-bar {{WRAPPER}}.crt-sticky-section-yes.crt-sticky-section-fix' => 'top: calc({{VALUE}}px + 32px) !important;'
    184                     ],
    185                     'condition' => [
    186                         'enable_sticky_section' => 'yes'
    187                     ],
    188                 ]
    189             );
    190                
     724                        '{{WRAPPER}}' => 'top: auto; bottom: auto; {{position_location.VALUE}}: {{VALUE}}px;',
     725                        '{{WRAPPER}} + .crt-hidden-header' => 'top: {{VALUE}}px;',
     726                        '{{WRAPPER}} + .crt-hidden-header-flex' => 'top: {{VALUE}}px;'
     727                    ],
     728                    'condition' => [
     729                        'enable_sticky_section' => 'yes'
     730                    ],
     731                ]
     732            );
     733
    191734            $element->add_control(
    192735                'crt_z_index',
     
    195738                    'type' => Controls_Manager::NUMBER,
    196739                    'min' => -99,
    197                     'max' => 99999,
    198                     'step' => 1,
     740                    'max' => 99999,
     741                    'step' => 1,
    199742                    'default' => 10,
    200743                    'selectors' => [
    201                         '{{WRAPPER}}' => 'z-index: {{VALUE}};',
     744                        '{{WRAPPER}}' => 'z-index: {{VALUE}};',
    202745                        '.crt-hidden-header' => 'z-index: {{VALUE}};',
    203746                        '.crt-hidden-header-flex' => 'z-index: {{VALUE}};'
    204747                    ],
    205                     'condition' => [
    206                         'enable_sticky_section' => 'yes'
    207                     ],
    208                     'render_type' => 'template'
    209                 ]
    210             );
    211 
    212 //          $element->add_control(
    213 //              'custom_breakpoints',
    214 //              [
    215 //                  'label' => __( 'Breakpoints', 'crt-manage' ),
    216 //                  'type' => \Elementor\Controls_Manager::HIDDEN,
    217 //                  'default' => get_option('elementor_experiment-additional_custom_breakpoints'),
    218 //                  'condition' => [
    219 //                      'enable_sticky_section' => 'yes'
    220 //                  ]
    221 //              ]
    222 //          );
    223 
    224 //          $element->add_control(
    225 //              'active_breakpoints',
    226 //              [
    227 //                  'label' => __( 'Active Breakpoints', 'crt-manage' ),
    228 //                  'type' => \Elementor\Controls_Manager::HIDDEN,
    229 //                  'default' => $this->breakpoints_manager_active(),
    230 //                  'condition' => [
    231 //                      'enable_sticky_section' => 'yes'
    232 //                  ]
    233 //              ]
    234 //          );
    235 
    236 
    237             $element->end_controls_section();           
     748                    'condition' => [
     749                        'enable_sticky_section' => 'yes'
     750                    ],
     751                    'render_type' => 'template'
     752                ]
     753            );
     754
     755            $element->add_control(
     756                'custom_breakpoints',
     757                [
     758                    'label' => __( 'Breakpoints', 'crt-manage' ),
     759                    'type' => \Elementor\Controls_Manager::HIDDEN,
     760                    'default' => get_option('elementor_experiment-additional_custom_breakpoints'),
     761                    'condition' => [
     762                        'enable_sticky_section' => 'yes'
     763                    ]
     764                ]
     765            );
     766
     767            $element->add_control(
     768                'active_breakpoints',
     769                [
     770                    'label' => __( 'Active Breakpoints', 'crt-manage' ),
     771                    'type' => \Elementor\Controls_Manager::HIDDEN,
     772                    'default' => $this->breakpoints_manager_active(),
     773                    'condition' => [
     774                        'enable_sticky_section' => 'yes'
     775                    ]
     776                ]
     777            );
     778
     779            $this->add_control_group_sticky_advanced_options($element);
     780
     781            $element->end_controls_section();
    238782        }
    239783    }
    240784
    241     public function breakpoints_manager() {
     785    public function breakpoints_manager() {
    242786        $active_breakpoints = [];
    243787        foreach ( \Elementor\Plugin::$instance->breakpoints->get_active_breakpoints() as $key => $value ) {
  • crt-manage/trunk/includes/customizer/addons/modules/crt-woo-grid.php

    r3475480 r3478729  
    292292
    293293
    294     public function add_section_style_sort_and_results() {
    295         // Styles ====================
    296         // Section: sorting ----------
    297         $this->start_controls_section(
    298             'section_style_sort_and_results',
    299             [
    300                 'label' => esc_html__( 'Sorting', 'crt-manage' ),
    301                 'tab' => Controls_Manager::TAB_STYLE,
    302                 'show_label' => false,
    303                 'condition' => [
    304                     'query_selection!' => ['upsell', 'cross-sell'],
    305                     'layout_select!' => 'slider',
    306                     'layout_sort_and_results_count' => 'yes'
    307                 ]
    308             ]
    309         );
    310 
    311         $this->add_control(
    312             'sort_and_results_bg_color',
    313             [
    314                 'label'  => esc_html__( 'Background Color', 'crt-manage' ),
    315                 'type' => Controls_Manager::COLOR,
    316                 'selectors' => [
    317                     '{{WRAPPER}} .crt-grid-sorting-wrap' => 'background-color: {{VALUE}}',
    318                 ]
    319             ]
    320         );
    321 
    322         $this->add_responsive_control(
    323             'sort_and_results_padding',
    324             [
    325                 'label' => esc_html__( 'Padding', 'crt-manage' ),
    326                 'type' => Controls_Manager::DIMENSIONS,
    327                 'size_units' => [ 'px' ],
    328                 'default' => [
    329                     'top' => 0,
    330                     'right' => 0,
    331                     'bottom' => 0,
    332                     'left' => 0,
    333                 ],
    334                 'selectors' => [
    335                     '{{WRAPPER}} .crt-grid-sorting-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
    336                 ]
    337             ]
    338         );
    339 
    340         $this->add_responsive_control(
    341             'sort_and_results_distance_from_grid',
    342             [
    343                 'label' => esc_html__( 'Distance From Grid', 'crt-manage' ),
    344                 'type' => Controls_Manager::SLIDER,
    345                 'size_units' => [ 'px' ],
    346                 'range' => [
    347                     'px' => [
    348                         'min' => 0,
    349                         'max' => 100,
    350                     ],
    351                 ],             
    352                 'default' => [
    353                     'unit' => 'px',
    354                     'size' => 25,
    355                 ],
    356                 'selectors' => [
    357                     '{{WRAPPER}} .crt-grid-sorting-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
    358                 ]
    359             ]
    360         );
    361 
    362         $this->end_controls_section();
    363     }
    364 
    365 
    366     public function add_control_layout_slider_amount() {
     294    public function add_section_style_sort_and_results() {
     295        // Styles ====================
     296        // Section: sorting ----------
     297        $this->start_controls_section(
     298            'section_style_sort_and_results',
     299            [
     300                'label' => esc_html__( 'Sorting', 'crt-manage' ),
     301                'tab' => Controls_Manager::TAB_STYLE,
     302                'show_label' => false,
     303                'condition' => [
     304                    'query_selection!' => ['upsell', 'cross-sell'],
     305                    'layout_select!' => 'slider',
     306                    'layout_sort_and_results_count' => 'yes'
     307                ]
     308            ]
     309        );
     310
     311        $this->add_control(
     312            'sort_and_results_bg_color',
     313            [
     314                'label'  => esc_html__( 'Background Color', 'crt-manage' ),
     315                'type' => Controls_Manager::COLOR,
     316                'selectors' => [
     317                    '{{WRAPPER}} .crt-grid-sorting-wrap' => 'background-color: {{VALUE}}',
     318                ]
     319            ]
     320        );
     321
     322        $this->add_responsive_control(
     323            'sort_and_results_padding',
     324            [
     325                'label' => esc_html__( 'Padding', 'crt-manage' ),
     326                'type' => Controls_Manager::DIMENSIONS,
     327                'size_units' => [ 'px' ],
     328                'default' => [
     329                    'top' => 0,
     330                    'right' => 0,
     331                    'bottom' => 0,
     332                    'left' => 0,
     333                ],
     334                'selectors' => [
     335                    '{{WRAPPER}} .crt-grid-sorting-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
     336                ]
     337            ]
     338        );
     339
     340        $this->add_responsive_control(
     341            'sort_and_results_distance_from_grid',
     342            [
     343                'label' => esc_html__( 'Distance From Grid', 'crt-manage' ),
     344                'type' => Controls_Manager::SLIDER,
     345                'size_units' => [ 'px' ],
     346                'range' => [
     347                    'px' => [
     348                        'min' => 0,
     349                        'max' => 100,
     350                    ],
     351                ],
     352                'default' => [
     353                    'unit' => 'px',
     354                    'size' => 25,
     355                ],
     356                'selectors' => [
     357                    '{{WRAPPER}} .crt-grid-sorting-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
     358                ]
     359                // 'separator' => 'before'
     360            ]
     361        );
     362
     363        // Results
     364        $this->add_control(
     365            'sort_title_style_heading',
     366            [
     367                'label' => esc_html__( 'Title', 'crt-manage' ),
     368                'type' => Controls_Manager::HEADING,
     369                'separator' => 'before'
     370            ]
     371        );
     372
     373        $this->add_control(
     374            'sort_title_color',
     375            [
     376                'label'  => esc_html__( 'Color', 'crt-manage' ),
     377                'type' => Controls_Manager::COLOR,
     378                'default' => '#222222',
     379                'selectors' => [
     380                    '{{WRAPPER}} .crt-grid-sort-heading :is(h1, h2, h3, h4, h5, h6)' => 'color: {{VALUE}}'
     381                ],
     382            ]
     383        );
     384
     385        $this->add_group_control(
     386            Group_Control_Typography::get_type(),
     387            [
     388                'name'     => 'sort_title',
     389                'selector' => '{{WRAPPER}} .crt-grid-sort-heading :is(h1, h2, h3, h4, h5, h6)',
     390                'fields_options' => [
     391                    'typography'      => [
     392                        'default' => 'custom',
     393                    ],
     394                    // 'font_size'      => [
     395                    //  'default'    => [
     396                    //      'size' => '14',
     397                    //      'unit' => 'px',
     398                    //  ],
     399                    // ]
     400                ]
     401            ]
     402        );
     403
     404        $this->add_responsive_control(
     405            'sort_and_results_title_distance_from_grid',
     406            [
     407                'label' => esc_html__( 'Distance', 'crt-manage' ),
     408                'type' => Controls_Manager::SLIDER,
     409                'size_units' => [ 'px' ],
     410                'range' => [
     411                    'px' => [
     412                        'min' => 0,
     413                        'max' => 100,
     414                    ],
     415                ],
     416                'default' => [
     417                    'unit' => 'px',
     418                    'size' => 10,
     419                ],
     420                'selectors' => [
     421                    '{{WRAPPER}} .crt-grid-sort-heading' => 'margin-bottom: {{SIZE}}{{UNIT}};',
     422                ]
     423            ]
     424        );
     425
     426        // Results
     427        $this->add_control(
     428            'results_style_heading',
     429            [
     430                'label' => esc_html__( 'Results', 'crt-manage' ),
     431                'type' => Controls_Manager::HEADING,
     432                'separator' => 'before'
     433            ]
     434        );
     435
     436        $this->add_control(
     437            'results_color',
     438            [
     439                'label'  => esc_html__( 'Color', 'crt-manage' ),
     440                'type' => Controls_Manager::COLOR,
     441                'default' => '#787878',
     442                'selectors' => [
     443                    '{{WRAPPER}} .crt-grid-sorting-inner-wrap .woocommerce-result-count' => 'color: {{VALUE}}'
     444                ],
     445            ]
     446        );
     447
     448        $this->add_group_control(
     449            Group_Control_Typography::get_type(),
     450            [
     451                'name'     => 'results',
     452                'selector' => '{{WRAPPER}} .crt-grid-sorting-inner-wrap .woocommerce-result-count',
     453                'fields_options' => [
     454                    'typography'      => [
     455                        'default' => 'custom',
     456                    ],
     457                    // 'font_size'      => [
     458                    //  'default'    => [
     459                    //      'size' => '14',
     460                    //      'unit' => 'px',
     461                    //  ],
     462                    // ]
     463                ]
     464            ]
     465        );
     466
     467        // Results
     468        $this->add_control(
     469            'sorting_style_heading',
     470            [
     471                'label' => esc_html__( 'Sorting', 'crt-manage' ),
     472                'type' => Controls_Manager::HEADING,
     473                'separator' => 'before'
     474            ]
     475        );
     476
     477        $this->add_control(
     478            'sorting_color',
     479            [
     480                'label'  => esc_html__( 'Color', 'crt-manage' ),
     481                'type' => Controls_Manager::COLOR,
     482                'default' => '#787878',
     483                'selectors' => [
     484                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'color: {{VALUE}}',
     485                    '{{WRAPPER}} .crt-grid-sorting-wrap form .crt-orderby-icon' => 'color: {{VALUE}}'
     486                ],
     487            ]
     488        );
     489
     490        $this->add_control(
     491            'sorting_border_color',
     492            [
     493                'label'  => esc_html__( 'Border Color', 'crt-manage' ),
     494                'type' => Controls_Manager::COLOR,
     495                'default' => '#E8E8E8',
     496                'selectors' => [
     497                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'border-color: {{VALUE}}',
     498                ],
     499            ]
     500        );
     501
     502        $this->add_control(
     503            'sorting_bg_color',
     504            [
     505                'label'  => esc_html__( 'Background Color', 'crt-manage' ),
     506                'type' => Controls_Manager::COLOR,
     507                'default' => '#FFF',
     508                'selectors' => [
     509                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'background-color: {{VALUE}}'
     510                ],
     511            ]
     512        );
     513
     514        $this->add_group_control(
     515            Group_Control_Typography::get_type(),
     516            [
     517                'name'     => 'sorting',
     518                'selector' => '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby, {{WRAPPER}} .crt-grid-sorting-wrap form .orderby option'
     519            ]
     520        );
     521
     522        $this->add_responsive_control(
     523            'sorting_icon_size',
     524            [
     525                'label' => esc_html__( 'Icon Size', 'crt-manage' ),
     526                'type' => Controls_Manager::SLIDER,
     527                'size_units' => [ 'px' ],
     528                'range' => [
     529                    'px' => [
     530                        'min' => 5,
     531                        'max' => 50,
     532                    ],
     533                ],
     534                'default' => [
     535                    'unit' => 'px',
     536                    'size' => 12,
     537                ],
     538                'selectors' => [
     539                    '{{WRAPPER}} .crt-grid-sorting-wrap form .crt-orderby-icon' => 'font-size: {{SIZE}}{{UNIT}};',
     540                ],
     541                // 'separator' => 'before'
     542            ]
     543        );
     544
     545        $this->add_responsive_control(
     546            'sorting_select_width',
     547            [
     548                'label' => esc_html__( 'Width', 'crt-manage' ),
     549                'type' => Controls_Manager::SLIDER,
     550                'size_units' => [ 'px' ],
     551                'range' => [
     552                    'px' => [
     553                        'min' => 150,
     554                        'max' => 400,
     555                    ],
     556                ],
     557                'default' => [
     558                    'unit' => 'px',
     559                    'size' => 200,
     560                ],
     561                'selectors' => [
     562                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'width: {{SIZE}}{{UNIT}};',
     563                ],
     564                // 'separator' => 'before'
     565            ]
     566        );
     567
     568        $this->add_control(
     569            'sorting_select_padding',
     570            [
     571                'label' => esc_html__( 'Padding', 'crt-manage' ),
     572                'type' => Controls_Manager::DIMENSIONS,
     573                'size_units' => [ 'px' ],
     574                'default' => [
     575                    'top' => 5,
     576                    'right' => 15,
     577                    'bottom' => 5,
     578                    'left' => 15,
     579                ],
     580                'selectors' => [
     581                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
     582                    '{{WRAPPER}} .crt-grid-sorting-wrap .crt-orderby-icon' => 'right: {{LEFT}}{{UNIT}};'
     583                ]
     584            ]
     585        );
     586
     587        $this->add_control(
     588            'sorting_border_type',
     589            [
     590                'label' => esc_html__( 'Border Type', 'crt-manage' ),
     591                'type' => Controls_Manager::SELECT,
     592                'options' => [
     593                    'none' => esc_html__( 'None', 'crt-manage' ),
     594                    'solid' => esc_html__( 'Solid', 'crt-manage' ),
     595                    'double' => esc_html__( 'Double', 'crt-manage' ),
     596                    'dotted' => esc_html__( 'Dotted', 'crt-manage' ),
     597                    'dashed' => esc_html__( 'Dashed', 'crt-manage' ),
     598                    'groove' => esc_html__( 'Groove', 'crt-manage' ),
     599                ],
     600                'default' => 'solid',
     601                'selectors' => [
     602                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'border-style: {{VALUE}};',
     603                ],
     604                // 'separator' => 'before',
     605            ]
     606        );
     607
     608        $this->add_control(
     609            'sorting_border_width',
     610            [
     611                'label' => esc_html__( 'Border Width', 'crt-manage' ),
     612                'type' => Controls_Manager::DIMENSIONS,
     613                'size_units' => [ 'px' ],
     614                'default' => [
     615                    'top' => 1,
     616                    'right' => 1,
     617                    'bottom' => 1,
     618                    'left' => 1,
     619                ],
     620                'selectors' => [
     621                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
     622                ],
     623                'condition' => [
     624                    'sorting_border_type!' => 'none',
     625                ],
     626            ]
     627        );
     628
     629        $this->add_control(
     630            'sorting_border_radius',
     631            [
     632                'label' => esc_html__( 'Border Radius', 'crt-manage' ),
     633                'type' => Controls_Manager::DIMENSIONS,
     634                'size_units' => [ 'px' ],
     635                'default' => [
     636                    'top' => 1,
     637                    'right' => 1,
     638                    'bottom' => 1,
     639                    'left' => 1,
     640                ],
     641                'selectors' => [
     642                    '{{WRAPPER}} .crt-grid-sorting-wrap form .orderby' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
     643                ]
     644            ]
     645        );
     646
     647        $this->end_controls_section();
     648    }
     649
     650
     651
     652    public function add_control_layout_slider_amount() {
    367653        $this->add_responsive_control(
    368654            'layout_slider_amount',
  • crt-manage/trunk/includes/customizer/addons/woocommerce/woocommerce-helpers.php

    r3475480 r3478729  
    6565
    6666//      if ( !defined('CRT_ADDONS_PRO_VERSION') || !crt_fs()->can_use_premium_code() ) {
    67 //          $settings['query_selection'] = 'pro-cr' == $settings['query_selection'] ? 'dynamic' : $settings['query_selection'];
    68 //          $settings['query_orderby'] = 'pro-rn' == $settings['query_orderby'] ? 'date' : $settings['query_orderby'];
     67            $settings['query_selection'] = 'pro-cr' == $settings['query_selection'] ? 'dynamic' : $settings['query_selection'];
     68            $settings['query_orderby'] = 'pro-rn' == $settings['query_orderby'] ? 'date' : $settings['query_orderby'];
    6969//      }
    7070
     
    282282                $posts_per_page = intval(get_option('crt_woo_shop_ppp', 9));
    283283            }
    284             $args = $wp_query->query_vars;
     284//          $args = $wp_query->query_vars;
     285            $args = array();
    285286            $args['tax_query'] = CRT_Woo_Grid_Helpers::get_tax_query_args($settings);
    286287            $args['meta_query'] = CRT_Woo_Grid_Helpers::get_meta_query_args();
     
    289290                $args['orderby'] = $settings['query_randomize'];
    290291            } else {
     292                $settings['current_query_orderby'] = isset($settings['current_query_orderby']) ? $settings['current_query_orderby']:'';
    291293                $args['orderby'] = get_query_var('orderby') ? get_query_var('orderby') : $settings['current_query_orderby'];
    292294                $args['order'] = $settings['order_direction'] ? $settings['order_direction'] : $settings['current_query_order'];
     
    593595                                                array_push( $tax_query, [
    594596                                                    'taxonomy' => $cleanedKey,
    595                                                     'field' => 'slug',
     597                                                    'field' => 'id',
    596598                                                    'terms' => $filtervalues
    597599                                                ] );
     
    652654
    653655    // Meta Query Args
    654     public static function get_meta_query_args(){
    655         $meta_query = WC()->query->get_meta_query();
    656 
    657         // Price Filter Args
    658         if ( isset( $_GET['min_price'] ) || isset( $_GET['max_price'] ) ) {
    659             $meta_query = array_merge( ['relation' => 'AND'], $meta_query );
    660             $meta_query[] = [
    661                 [
    662                     'key' => '_price',
    663                     'value' => [ $_GET['min_price'], $_GET['max_price'] ],
    664                     'compare' => 'BETWEEN',
    665                     'type' => 'NUMERIC'
    666                 ],
    667             ];
    668         }
    669 
    670         return $meta_query;
    671     }
    672 
    673     // Taxonomy Query Args
    674     public static function get_tax_query_args($settings) {
    675         $tax_query = [];
    676 
    677         // Filters Query
    678         if ( isset($_GET['crtfilters']) ) {
    679             $selected_filters = WC()->query->get_layered_nav_chosen_attributes();
    680 
    681             if ( !empty($selected_filters) ) {
    682                 foreach ( $selected_filters as $taxonomy => $data ) {
    683                     array_push($tax_query, [
    684                         'taxonomy' => $taxonomy,
    685                         'field' => 'slug',
    686                         'terms' => $data['terms'],
    687                         'operator' => 'and' === $data['query_type'] ? 'AND' : 'IN',
    688                         'include_children' => false,
    689                     ]);
    690                 }
    691             }
    692 
    693             // Product Categories
    694             if ( isset($_GET['filter_product_cat']) ) {
    695                 array_push($tax_query, [
    696                     'taxonomy' => 'product_cat',
    697                     'field' => 'slug',
    698                     'terms' => explode( ',', $_GET['filter_product_cat'] ),
    699                     'operator' => 'IN',
    700                     'include_children' => true, // test this needed or not for hierarchy
    701                 ]);
    702             }
    703 
    704             // Product Tags
    705             if ( isset($_GET['filter_product_tag']) ) {
    706                 array_push($tax_query, [
    707                     'taxonomy' => 'product_tag',
    708                     'field' => 'slug',
    709                     'terms' => explode( ',', $_GET['filter_product_tag'] ),
    710                     'operator' => 'IN',
    711                     'include_children' => true, // test this needed or not for hierarchy
    712                 ]);
    713             }
    714         // Grid Query
    715         } else {
    716             if ( isset($_GET['crt_select_product_cat']) ) {
    717                 if ( $_GET['crt_select_product_cat'] != '0' ) {
    718                     // Get category from URL
    719                     $category = sanitize_text_field($_GET['crt_select_product_cat']);
    720                
    721                     array_push( $tax_query, [
    722                         'taxonomy' => 'product_cat',
    723                         'field' => 'id',
    724                         'terms' => $category
    725                     ] );
    726                 }
    727             }
    728 
    729             if ( isset($_GET['product_cat']) ) {
    730                 if ( $_GET['product_cat'] != '0' ) {
    731                     // Get category from URL
    732                     $category = sanitize_text_field($_GET['product_cat']);
    733                
    734                     array_push( $tax_query, [
    735                         'taxonomy' => 'product_cat',
    736                         'field' => 'slug',
    737                         'terms' => $category
    738                     ] );
    739                 }
    740             } else {
    741                 if ( 'current' != $settings['query_selection'] ) {
    742                     foreach ( get_object_taxonomies( 'product' ) as $tax ) {
    743                         if ( ! empty($settings[ 'query_taxonomy_'. $tax ]) ) {
    744                             array_push( $tax_query, [
    745                                 'taxonomy' => $tax,
    746                                 'field' => 'id',
    747                                 'terms' => $settings[ 'query_taxonomy_'. $tax ]
    748                             ] );
    749                         }
    750                     }
    751                 }
    752             }
    753 
    754             if ( isset($_POST['crt_taxonomy']) ) {
    755                 $settings = $_POST['grid_settings'];
    756                 $taxonomy = $_POST['crt_taxonomy'];
    757                 $term = $_POST['crt_filter'];
    758 
    759                 if ( $term != '*' ) {
    760                     if ( 'tag' === $taxonomy ) {
    761                         $taxonomy = 'product_' . $_POST['crt_taxonomy'];
    762                     }
    763                     array_push( $tax_query, [
    764                         'taxonomy' => $taxonomy,
    765                         'field' => 'slug',
    766                         'terms' => $term
    767                     ] );
    768                 }
    769             }
    770 
    771             if ( isset($settings['current_query_source']) && !empty($settings['current_query_source']) ) {
    772                 array_push( $tax_query, [
    773                     'taxonomy' => $settings['current_query_tax'],
    774                     'field' => 'slug',
    775                     'terms' => $settings['current_query_source']
    776                 ] );
    777             }
    778         }
    779 
    780         // phpcs:disable WordPress.Security.NonceVerification.Recommended
    781         // Filter by rating.
    782         if ( isset( $_GET['filter_rating'] ) ) {
    783 
    784             $product_visibility_terms  = wc_get_product_visibility_term_ids();
    785             // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    786             $filter_rating = array_filter( array_map( 'absint', explode( ',', wp_unslash( $_GET['filter_rating'] ) ) ) );
    787             $rating_terms  = array();
    788             for ( $i = 1; $i <= 5; $i ++ ) {
    789                 if ( in_array( $i, $filter_rating, true ) && isset( $product_visibility_terms[ 'rated-' . $i ] ) ) {
    790                     $rating_terms[] = $product_visibility_terms[ 'rated-' . $i ];
    791                 }
    792             }
    793             if ( ! empty( $rating_terms ) ) {
    794                 $tax_query[] = array(
    795                     'taxonomy'      => 'product_visibility',
    796                     'field'         => 'term_taxonomy_id',
    797                     'terms'         => $rating_terms,
    798                     'operator'      => 'IN',
    799                 );
    800             }
    801         }
    802 
    803         return $tax_query;
    804     }
    805 
    806     // Get Animation Class
     656    public static function get_meta_query_args(){
     657         $meta_query = WC()->query->get_meta_query();
     658
     659         // Price Filter Args
     660         if ( isset( $_GET['min_price'] ) || isset( $_GET['max_price'] ) ) {
     661             $meta_query = array_merge( ['relation' => 'AND'], $meta_query );
     662             $meta_query[] = [
     663                 [
     664                     'key' => '_price',
     665                     'value' => [ $_GET['min_price'], $_GET['max_price'] ],
     666                     'compare' => 'BETWEEN',
     667                     'type' => 'NUMERIC'
     668                 ],
     669             ];
     670         }
     671
     672         return $meta_query;
     673     }
     674
     675     // Taxonomy Query Args
     676     public static function get_tax_query_args($settings) {
     677         $tax_query = [];
     678
     679         // Filters Query
     680         if ( isset($_GET['crtfilters']) ) {
     681             $selected_filters = WC()->query->get_layered_nav_chosen_attributes();
     682
     683             if ( !empty($selected_filters) ) {
     684                 foreach ( $selected_filters as $taxonomy => $data ) {
     685                     array_push($tax_query, [
     686                         'taxonomy' => $taxonomy,
     687                         'field' => 'slug',
     688                         'terms' => $data['terms'],
     689                         'operator' => 'and' === $data['query_type'] ? 'AND' : 'IN',
     690                         'include_children' => false,
     691                     ]);
     692                 }
     693             }
     694
     695             // Product Categories
     696             if ( isset($_GET['filter_product_cat']) ) {
     697                 array_push($tax_query, [
     698                     'taxonomy' => 'product_cat',
     699                     'field' => 'slug',
     700                     'terms' => explode( ',', $_GET['filter_product_cat'] ),
     701                     'operator' => 'IN',
     702                     'include_children' => true, // test this needed or not for hierarchy
     703                 ]);
     704             }
     705
     706             // Product Tags
     707             if ( isset($_GET['filter_product_tag']) ) {
     708                 array_push($tax_query, [
     709                     'taxonomy' => 'product_tag',
     710                     'field' => 'slug',
     711                     'terms' => explode( ',', $_GET['filter_product_tag'] ),
     712                     'operator' => 'IN',
     713                     'include_children' => true, // test this needed or not for hierarchy
     714                 ]);
     715             }
     716             // Grid Query
     717         } else {
     718             if ( isset($_GET['crt_select_product_cat']) ) {
     719                 if ( $_GET['crt_select_product_cat'] != '0' ) {
     720                     // Get category from URL
     721                     $category = sanitize_text_field($_GET['crt_select_product_cat']);
     722
     723                     array_push( $tax_query, [
     724                         'taxonomy' => 'product_cat',
     725                         'field' => 'id',
     726                         'terms' => $category
     727                     ] );
     728                 }
     729             }
     730
     731             if ( isset($_GET['product_cat']) ) {
     732                 if ( $_GET['product_cat'] != '0' ) {
     733                     // Get category from URL
     734                     $category = sanitize_text_field($_GET['product_cat']);
     735
     736                     array_push( $tax_query, [
     737                         'taxonomy' => 'product_cat',
     738                         'field' => 'id',
     739                         'terms' => $category
     740                     ] );
     741                 }
     742             } else {
     743                 if ( 'current' != $settings['query_selection'] ) {
     744                     foreach ( get_object_taxonomies( 'product' ) as $tax ) {
     745                         if ( ! empty($settings[ 'query_taxonomy_'. $tax ]) ) {
     746                             array_push( $tax_query, [
     747                                 'taxonomy' => $tax,
     748                                 'field' => 'id',
     749                                 'terms' => $settings[ 'query_taxonomy_'. $tax ]
     750                             ] );
     751                         }
     752                     }
     753                 }
     754             }
     755
     756             if ( isset($_POST['crt_taxonomy']) ) {
     757                 $settings = $_POST['grid_settings'];
     758                 $taxonomy = $_POST['crt_taxonomy'];
     759                 $term = $_POST['crt_filter'];
     760
     761                 if ( $term != '*' ) {
     762                     if ( 'tag' === $taxonomy ) {
     763                         $taxonomy = 'product_' . $_POST['crt_taxonomy'];
     764                     }
     765                     array_push( $tax_query, [
     766                         'taxonomy' => $taxonomy,
     767                         'field' => 'slug',
     768                         'terms' => $term
     769                     ] );
     770                 }
     771             }
     772
     773             if ( isset($settings['current_query_source']) && !empty($settings['current_query_source']) ) {
     774                 array_push( $tax_query, [
     775                     'taxonomy' => $settings['current_query_tax'],
     776                     'field' => 'slug',
     777                     'terms' => $settings['current_query_source']
     778                 ] );
     779             }
     780         }
     781
     782         // phpcs:disable WordPress.Security.NonceVerification.Recommended
     783         // Filter by rating.
     784         if ( isset( $_GET['filter_rating'] ) ) {
     785
     786             $product_visibility_terms  = wc_get_product_visibility_term_ids();
     787             // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     788             $filter_rating = array_filter( array_map( 'absint', explode( ',', wp_unslash( $_GET['filter_rating'] ) ) ) );
     789             $rating_terms  = array();
     790             for ( $i = 1; $i <= 5; $i ++ ) {
     791                 if ( in_array( $i, $filter_rating, true ) && isset( $product_visibility_terms[ 'rated-' . $i ] ) ) {
     792                     $rating_terms[] = $product_visibility_terms[ 'rated-' . $i ];
     793                 }
     794             }
     795             if ( ! empty( $rating_terms ) ) {
     796                 $tax_query[] = array(
     797                     'taxonomy'      => 'product_visibility',
     798                     'field'         => 'term_taxonomy_id',
     799                     'terms'         => $rating_terms,
     800                     'operator'      => 'IN',
     801                 );
     802             }
     803         }
     804
     805         return $tax_query;
     806     }
     807
     808     // Get Animation Class
    807809    public static function get_animation_class( $data, $object ) {
    808810        $class = '';
     
    23202322
    23212323        // Get Posts
    2322         $posts = new \WP_Query( CRT_Woo_Grid_Helpers::get_main_query_args($settings, []) );
     2324        $args = CRT_Woo_Grid_Helpers::get_main_query_args($settings, []);
     2325        $posts = new \WP_Query( $args );
    23232326
    23242327        // Loop: Start
  • crt-manage/trunk/readme.txt

    r3476572 r3478729  
    44Requires at least: 4.0
    55Tested up to: 6.9
    6 Stable tag: 1.5.4
     6Stable tag: 1.5.5
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.