PageSourceSearch

https://www.vigiquebec.com/wp-content/themes/forex/assets/js/main.js?ver=20151112

js vigiquebec.com collected 2026-10-04 15:36:45 UTC 10,238 bytes, 348 lines download raw bytes

1/**
2 * Before window loaded
3 */
4jQuery( window ).load(function() {
5	"use strict";
6
7    jQuery("#preloader").delay('300').fadeOut();
8    jQuery("#mask").delay('320').fadeOut("slow");
9
10});
11/**
12 * When document ready
13 */
14( function( $ ) {
15  	"use strict";
16    // Select
17    //$('select').select2();
18    // Sticky Menu
19    $(window).bind('scroll', function () {
20        if ($(window).scrollTop() > 80) {
21            $('body.sticky_menu .main-header').addClass('fixed');
22        } else {
23            $('body.sticky_menu .main-header').removeClass('fixed');
24        }
25    });
26    // SlideOut
27    var toggleButton = $('.mobile-toggle-mobile-menu'),
28        closeButton = $('.mobile-button-open'),
29        menuWrap = $('.mobile-slideout');
30    toggleButton.on('click', function(e) {
31        $('.site').addClass('blur');
32        $('.body-in-overlay').css({
33          'opacity'     :'1',
34          'visibility'  : 'visible',
35        });
36        menuWrap.toggleClass('mobile-menu-show').css({
37          'opacity'     :'1',
38          'visibility'  : 'visible',
39        });
40        e.preventDefault();
41    });
42    closeButton.on('click', function(e) {
43        $('.site').removeClass('blur');
44        $('.body-in-overlay').css({
45          'opacity'     :'0',
46          'visibility'  : 'hidden',
47        });
48        menuWrap.toggleClass('mobile-menu-show').css({
49          'opacity'     :'0',
50          'visibility'  : 'hidden',
51        });
52        e.preventDefault();
53    });
54    $('.hipster_mobile_clickable').click(function (e) {
55        $(this).toggleClass('hipster_mobile_clickable_clicked');
56        $(this).parent().next().stop(true, true).toggle();
57        e.preventDefault();
58    });
59  	// Setup parallax
60  	$(window).stellar({
61	    horizontalScrolling: false,
62	    scrollProperty: 'scroll',
63	    responsive: false,
64	    positionProperty: 'position'
65  	});
66    // Top Header
67    $(window).bind('scroll', function () {
68      if ($(window).scrollTop() > 80) {
69          $('.mobile-header').addClass('fixed');
70      } else {
71          $('.mobile-header').removeClass('fixed');
72      }
73    });
74    $('.header-office ul li').click(function (e) {
75        $('.header-contact').hide();
76        var text = $(this).html();
77        $(this).parent().parent().find('span').html(text);
78        var office = $(this).data('office');
79        $('#'+office).fadeIn();
80        e.preventDefault();
81    });
82    // Mini cart
83    var mini_cart = false;
84    $('.cart-contents').click(function (e) {
85      if (mini_cart === false) {
86        $(this).next().css({
87          'opacity'     :'1',
88          'top'         : '40px',
89          'visibility'  : 'visible',
90        });
91        mini_cart = true;
92      }else{
93        $(this).next().css({
94          'opacity'     :'0',
95          'top'         : '0px',
96          'visibility'  : 'hidden',
97        });
98        mini_cart = false;
99      }
100      e.preventDefault();
101    });
102    // Search
103    var body_black = false;
104    $('.search-handle,.handle-collapse-black').click(function (e) {
105      e.preventDefault();
106      $('.site').toggleClass('blur');
107      if (body_black === false) {
108        $('.body-in-black').css({
109          'height'      :'100%',
110          'opacity'     :'1',
111          'visibility'  : 'visible',
112        });
113        $('.search-form,.ajax-search-product').css({
114          'margin-top'      :'100px',
115        });
116        body_black = true;
117      }else{
118        $('.body-in-black').css({
119          'height'      : '0px',
120          'opacity'     :'0',
121          'visibility'  : 'hidden',
122        });
123        $('.search-form,.ajax-search-product').css({
124          'margin-top'      :'200px',
125        });
126        body_black = false;
127      }
128    });
129    $('.input-search').live("focus blur", function(event){
130        if (event.type == "focusin") {
131            $('.clear-search').css({
132              'opacity'     :'1',
133            });
134        }else{
135            $('.clear-search').css({
136              'opacity'     :'0',
137            });
138        }
139    });
140    var timer = null;
141    $('.input-search').keyup(function(){
142      var value = $(this).val();
143      var search_type = $('.search-post-type').val();
144      var search_number = $('.search-number').val();
145      var search_character = $('.search-character').val();
146
147      if(timer) {
148        clearTimeout(timer);
149      }
150      timer = setTimeout(function() {
151        if (value !== '' && value.length >= search_character) {
152          $('.display_result').html(' ');
153          if($('.display_result').hasClass('slick-initialized')) {
154            $('.display_result').slick("unslick");
155          }
156          $('.spinner').show();
157          $.ajax({
158            type    : "post",
159            dataType  : "json",
160            url     : forex_param.ajax_url,
161            data    : {
162              action: "search",
163              value: value,
164              type: search_type,
165              number: search_number,
166              nonce: forex_param.nonce
167            },
168            success: function(getData) {
169              $('.spinner').hide();
170              if(getData.type == "success") {
171                $( '.display_result' ).append(getData.html);
172                $( '.display_result' ).slick({
173                  autoplay: false,
174                  autoplaySpeed: 3000,
175                  slidesToShow: 4,
176                  slidesToScroll: 1,
177                  infinite: false,
178                  arrows: false,
179                  dots: true,
180                  responsive: [
181                    {
182                      breakpoint: 480,
183                      settings: {
184                        vertical: false,
185                        slidesToShow: 3,
186                        slidesToScroll: 1
187                      }
188                    },
189                  ]
190                });
191              }else{
192                $('.display_result').html(' ');
193                $('.display_result').append(getData.html);
194              }
195            }
196          });
197        }
198      }, 500);
199    });
200    $('.clear-search').click(function (e) {
201      $('.input-search').val('');
202      e.preventDefault();
203    });
204    // Post Gallery Slider
205    $( ".wrap-post-slider" ).slick({
206        dots: true,
207        infinite: true,
208        arrows: false,
209        speed: 400,
210        slidesToShow: 1,
211        adaptiveHeight: true
212    });
213    // Blog List Slider
214    $('.blog-featured').slick({
215      autoplay: true,
216      autoplaySpeed: 4000,
217      infinite: true,
218      dots: false,
219      arrows: false,
220      slidesToShow: 3,
221      slidesToScroll: 1,
222      responsive: [
223        {
224          breakpoint: 768,
225          settings: {
226            slidesToShow: 3
227          }
228        },
229        {
230          breakpoint: 480,
231          settings: {
232            slidesToShow: 1
233          }
234        }
235      ]
236    });
237    // Related Post
238    $('.entry-related').slick({
239      infinite: false,
240      dots: false,
241      arrows: false,
242      slidesToShow: 3,
243      slidesToScroll: 1,
244      responsive: [
245        {
246          breakpoint: 768,
247          settings: {
248            slidesToShow: 3
249          }
250        },
251        {
252          breakpoint: 480,
253          settings: {
254            slidesToShow: 1
255          }
256        }
257      ]
258    });
259    // Masonry
260    $('.blog-view-type-grid').masonry({
261      // options
262      itemSelector: '.grid-item',
263      columnWidth: '.grid-sizer',
264      percentPosition: true
265    });
266    // Video responsive
267    $(".container").fitVids();
268    $('.tooltip').tooltipster({
269      animation: 'fade',
270      delay: 50,
271      theme: ['tooltipster-borderless', 'tooltipster-borderless-customized'],
272      side: 'left'
273    });
274    // WooCommerce Quick View
275    $('.quick-view').magnificPopup({
276      preloader: true,
277      callbacks : {
278        open : function(){
279           $.ajax({
280              type: "POST",
281              url     : forex_param.ajax_url,
282              data    : {
283                action: "quick_view",
284                value: $(this).data( 'product_id' ),
285                nonce: forex_param.quick_view_nonce
286              },
287              cache: false,
288              success: function(html) {
289                 console.log(html);
290              }
291           });
292        }
293      }
294    });
295    $('.quick-view').magnificPopup({
296      callbacks: {
297          elementParse: function(item){
298              var postData = {
299                  action  :'quick_view',
300                  value: this.st.el.data( 'product_id' ),
301                  nonce: forex_param.quick_view_nonce
302              }
303              var magnificPopup = $.magnificPopup.instance;
304              magnificPopup.st.ajax.settings.data = postData;
305          },
306          parseAjax: function( response )
307          {
308            response.data = response.data.html;
309              var magnificPopup = $.magnificPopup.instance;
310              magnificPopup.items[0].type = "inline";
311              magnificPopup.items[0].src = response.data;
312              magnificPopup.updateItemHTML();
313          }
314      },
315      type: 'ajax',
316      ajax: {
317          settings: {
318              url     : forex_param.ajax_url,
319              dataType: 'json',
320              type: "POST",
321          }
322      },
323  });
324    // Quantity
325    $('.quantity-more span').on( 'click', function(e) {
326        var wrapper_quantity = $(this).closest('.quantity'),
327            quantity_input = wrapper_quantity.find('.qty'),
328            value = quantity_input.attr('value');
329        if( $(this).hasClass('plus') ) {
330            quantity_input.attr('value', parseInt(value) + 1);
331        } else if( $(this).hasClass('minus') ) {
332            if( quantityVal > 1 ) {
333                quantity_input.attr('value', parseInt(value) - 1);
334            }
335        }
336        // Fix update cart button
337        $( '.shop_table.cart' ).closest( 'form' ).find( 'input[name="update_cart"]' ).removeProp( 'disabled');
338        e.preventDefault();
339    });
340    // Vc Video
341    $('body .wpb_video_widget .wpb_wrapper .wpb_video_wrapper .play-button').live( 'click', function (e) {
342        $(this).parent().find('iframe').attr( 'src', $(this).parent().find('iframe').attr( 'src' ) + '?autoplay=1').delay();
343        $(this).hide();
344        $(this).parent().find('img').hide();
345        $(this).parent().find('.video').show();
346        e.preventDefault();
347    });
348})(jQuery);

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.