1//v2.0 2/** 3 * This is the original JS file for the theme which has had a few updates in 2021. 4 */ 5var add_to_quote_buttons_check_timer = null; 6 7$j(document).ready(function() { 8 "use strict"; 9 10 $j('select.colour-select-2').select2({ 11 placeholder: "Select Colours" 12 }); 13 if($j('.qode_carousels .slides').length){ 14 $j('.qode_carousels').each(function(){ 15 var thisItem = $j(this); 16 // thisItem.hide(); 17 setTimeout(function(){ 18 thisItem.find('.slides').trigger('destroy'); 19 var numberOfVisibleItems = 6; 20 if(typeof thisItem.data('number-of-visible-items') !== 'undefined' && thisItem.data('number-of-visible-items') !== '') { 21 if(thisItem.data('number-of-visible-items') === 4) { 22 numberOfVisibleItems = 4; 23 } else if (thisItem.data('number-of-visible-items') === 5) { 24 numberOfVisibleItems = 5; 25 } 26 } 27 var itemWidth = (thisItem.parents('.grid_section').length == 1) ? 170 : 315; 28 var maxItems = 6; 29 if(numberOfVisibleItems === 4) { 30 itemWidth = (thisItem.parents('.grid_section').length == 1) ? 255 : 472; 31 maxItems = 4; 32 } else if (numberOfVisibleItems === 5) { 33 itemWidth = (thisItem.parents('.grid_section').length == 1) ? 204 : 378; 34 maxItems = 5; 35 } 36 37 thisItem.find('.slides').carouFredSel({ 38 circular: true, 39 responsive: true, 40 scroll : { 41 items : 1, 42 duration : 350, 43 pauseOnHover : false 44 }, 45 items: { 46 width: itemWidth, 47 visible: { 48 min: 1, 49 max: maxItems 50 } 51 }, 52 auto: true, 53 mousewheel: false, 54 swipe: { 55 onMouse: true, 56 onTouch: true 57 } 58 59 }).animate({'opacity': 1},1000); 60 61 thisItem.find('.caroufredsel_wrapper').css({'height' : (thisItem.find('li.item').outerHeight()) + 'px'}); 62 }, 1000); 63 }); 64 } 65 66 // $j('.woocommerce-account .woocommerce-MyAccount-content .woocommerce-Button[name="save_account_details"], .woocommerce-account .woocommerce form.register .woocommerce-Button[name="register"]').click(function(event) { 67 // if($j('#account_first_name').val().length <= 0 || 68 // $j('#account_last_name').val().length <= 0 || 69 // $j('#account_company').val().length <= 0) { 70 // alert('Please fill all the required fields.'); 71 // return false; 72 // } 73 // }); 74 75 setTimeout(function(){ 76 $j('.woocommerce .product .images a.mz-thumb').prepend('<span class="light-box light-box icon_plus_alt2"></span>'); 77 $j('.woocommerce .product .images a.mz-thumb .light-box').click(function(event) { 78 var parent_image_url = $j(this).parent().attr('href'); 79 if($j('.product-image-light-box[href="' + parent_image_url + '"]').length > 0) { 80 $j('.product-image-light-box[href="' + parent_image_url + '"]').click(); 81 } 82 }); 83 }, 1000); 84 85 if(!$j('.yith-ywraq-add-button').is(':visible')) { 86 $j('.quantity.buttons_added').hide(); 87 } 88 89 $j('.single-product.woocommerce .add-request-quote-button').click(function(event) { 90 add_to_quote_buttons_check_timer = setInterval(add_to_quote_buttons_checker, 250); 91 }); 92 93 $j('.gineico-advanced-search .gineico-btn.reset').click(function(event) { 94 $j('.gineico-advanced-search input[type="text"]').val(''); 95 $j('.gineico-advanced-search input').removeAttr('checked'); 96 var uri = window.location.toString(); 97 if (uri.indexOf("?") > 0) { 98 var clean_uri = uri.substring(0, uri.indexOf("?")); 99 $('body').addClass('hide-search-options'); 100 window.history.replaceState({}, document.title, clean_uri); 101 } 102 }); 103 104 if($j('#search-results').length > 0) { 105 var uri = window.location.toString(); 106 if (uri.indexOf("#") < 0) { 107 var uri = uri + "#search-results"; 108 window.history.replaceState({}, document.title, uri); 109 } 110 $j('html, body').animate({ 111 scrollTop: $j("#search-results").offset().top 112 }, 500); 113 } 114 115 $j('.qode_search_close .search-options, .widget #searchform .search-options').click(function(event) { 116 event.stopPropagation(); 117 event.preventDefault(); 118 $j('#float-gineico-advanced-filter').fadeIn('slow'); 119 $j('body').addClass('float-gineico-advanced-filter-opened'); 120 }); 121 122 $j('#float-gineico-advanced-filter, .float-gineico-advanced-filter-close').click(function(event) { 123 event.stopPropagation(); 124 if($j(event.target).is('#float-gineico-advanced-filter') || $j(event.target).is('.float-gineico-advanced-filter-close')) { 125 $j('#float-gineico-advanced-filter').fadeOut('slow'); 126 $j('body').removeClass('float-gineico-advanced-filter-opened'); 127 } 128 }); 129 130 $j('#float-gineico-advanced-filter .gineico-advanced-search').on('mousewheel DOMMouseScroll', function(event) { 131 var scrollTime = .5; 132 var scrollDistance = 170; 133 var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3; 134 var scrollTop = $j(this).scrollTop(); 135 var finalScroll = scrollTop - parseInt(delta*scrollDistance); 136 TweenMax.to($j(this), scrollTime, { 137 scrollTo : { y: finalScroll, autoKill:true }, 138 ease: Power1.easeOut,
139 overwrite: 5 140 }); 141 }); 142 143 $j('body').delegate('ul.select2-results__options', 'mousewheel DOMMouseScroll', function(event) { 144 var scrollTime = .5; 145 var scrollDistance = 170; 146 var delta = event.originalEvent.wheelDelta/120 || -event.originalEvent.detail/3; 147 var scrollTop = $j(this).scrollTop(); 148 var finalScroll = scrollTop - parseInt(delta*scrollDistance); 149 TweenMax.to($j(this), scrollTime, { 150 scrollTo : { y: finalScroll, autoKill:true }, 151 ease: Power1.easeOut, 152 overwrite: 5 153 }); 154 }); 155 156 /** 157 * Move the error messages on the request a quote page 158 */ 159 var send_req_btn_container = $j('#yith-ywraq-default-form .raq-send-request').parent(); 160 if(send_req_btn_container.length > 0) { 161 var fix_req_error_message_timer = null; 162 send_req_btn_container.click(function(event) { 163 fix_req_error_message_timer = setInterval(function() { 164 var send_req_error_message = $j('#yith-ywraq-default-form .woocommerce-error.woocommerce-message'); 165 if(send_req_error_message.length > 0 && !send_req_error_message.hasClass('moved')) { 166 send_req_btn_container.after(send_req_error_message); 167 send_req_error_message.addClass('moved'); 168 // send_req_error_message.prepend('<span class="msg-title">Your request was not send<br>The following information is needed:</span><br>'); 169 new_scroll_to_notices(); 170 clearInterval(fix_req_error_message_timer); 171 } 172 }, 10); 173 }); 174 } 175 /** 176 * Show the login form on the request a quote page when clicked 177 */ 178 $j(document).on('click', '#yith-ywraq-default-form .woocommerce-error .showlogin', function (e) { 179 e.preventDefault(); 180 $j('.woocomerce-form.woocommerce-form-login').slideDown(); 181 var header_height = $j('.header_top_bottom_holder').first().height(); 182 $j([document.documentElement, document.body]).animate({ 183 scrollTop: $j(".woocomerce-form.woocommerce-form-login").offset().top - header_height - 300 184 }, 500); 185 $j('.woocomerce-form.woocommerce-form-login .form-row.form-row-first input').focus(); 186 }); 187 188 $j('.show-top-header').click(function(event) { 189 var header_top = $j(this).parents('.header_top'); 190 if(header_top.hasClass('opened')) { 191 header_top.removeClass('opened'); 192 header_top.height(35); 193 $j(this).removeClass('close'); 194 } else { 195 header_top.addClass('opened'); 196 header_top.height(170); 197 $j(this).addClass('close'); 198 } 199 }); 200 201 if($j('.woocommerce-account .woocommerce-MyAccount-navigation').length > 0) { 202 $j('.woocommerce-account .woocommerce-MyAccount-navigation').prepend('<span class="myaccount_mobile_menu_button"><i class="qode_icon_font_awesome fa fa-bars "></i></span>'); 203 var active_link_text = $j('.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a').text(); 204 if(active_link_text.length > 0) { 205 $j('.qode-child-breadcrumb.breadcrumb .current').append(' <small>(' + active_link_text + ')</small>'); 206 } 207 $j('body').delegate('.woocommerce-MyAccount-navigation .myaccount_mobile_menu_button', 'click', function(event) { 208 if($j('.woocommerce-account .woocommerce-MyAccount-navigation ul').hasClass('opened')) { 209 $j('.woocommerce-account .woocommerce-MyAccount-navigation ul').slideUp('fast').removeClass('opened'); 210 } else { 211 $j('.woocommerce-account .woocommerce-MyAccount-navigation ul').slideDown('fast').addClass('opened'); 212 } 213 }); 214 } 215}); 216 217function new_scroll_to_notices() { 218 var scrollElement = $j('.woocommerce-error, .woocommerce-message'), 219 isSmoothScrollSupported = 'scrollBehavior' in document.documentElement.style; 220 221 if (!scrollElement.length) { 222 scrollElement = ywraq_default_form; 223 } 224 225 if (scrollElement.length) { 226 var header_height = $j('.header_top_bottom_holder').first().height(); 227 $j('html, body').stop().animate({ 228 scrollTop: (scrollElement.offset().top - header_height - 100) 229 }, 1000); 230 } 231} 232 233 234function add_to_quote_buttons_checker() { 235 if(!$j('.yith-ywraq-add-button').is(':visible')) { 236 $j('.quantity.buttons_added').hide(); 237 clearInterval(add_to_quote_buttons_check_timer); 238 } 239}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.