PageSourceSearch

https://virsnieki.lv/wp-content/plugins/keydesign-addon/assets/js/kd_addon_script.js?ver=7.1.2

js virsnieki.lv collected 2026-10-02 22:03:55 UTC 12,552 bytes, 339 lines download raw bytes

1jQuery(document).ready(function($) {
2
3  (function($, win) {
4    $.fn.inViewport = function(cb) {
5      return this.each(function(i, el) {
6        function visPx() {
7          var H = $(this).height(),
8            r = el.getBoundingClientRect(),
9            t = r.top,
10            b = r.bottom;
11          return cb.call(el, Math.max(0, t > 0 ? H - t : (b < H ? b : H)));
12        }
13        visPx();
14        $(win).on("resize scroll", visPx);
15      });
16    };
17  }(jQuery, window));
18
19  /* ------------------------------------------------------------------------
20    FAQ
21   ------------------------------------------------------------------------*/
22  $(document).on("click", ".vc_toggle:not(.vc_toggle_active) .vc_toggle_title", function(e) {
23    e.preventDefault();
24    if ($('body').hasClass("collapsible-faq")) {
25      $('.vc_toggle.vc_toggle_active .vc_toggle_title').trigger('click');
26    }
27  });
28
29
30  /* ------------------------------------------------------------------------
31    ANIMATIONS
32   ------------------------------------------------------------------------*/
33
34  $(".kd-animated").inViewport(function(px) {
35    if (px) $(this).addClass("kd-animate");
36  });
37
38  /* ------------------------------------------------------------------------
39    COUNTDOWN
40   ------------------------------------------------------------------------*/
41  $('.kd-countdown').each(function(index, value) {
42    var text_days = $(this).attr("data-text-days");
43    var text_hours = $(this).attr("data-text-hours");
44    var text_minutes = $(this).attr("data-text-minutes");
45    var text_seconds = $(this).attr("data-text-seconds");
46
47    var count_year = $(this).attr("data-count-year");
48    var count_month = $(this).attr("data-count-month");
49    var count_day = $(this).attr("data-count-day");
50    var count_hour = $(this).attr("data-count-hour");
51    var count_minute = $(this).attr("data-count-minute");
52    var count_date = count_year + '/' + count_month + '/' + count_day + ' ' + count_hour + ':' + count_minute + ':00';
53    $(this).countdown(count_date, function(event) {
54      $(this).html(
55        event.strftime('<span class="CountdownContent">%D<span class="CountdownLabel">' + text_days + '</span></span><span class="CountdownSeparator">:</span><span class="CountdownContent">%H <span class="CountdownLabel">' + text_hours + '</span></span><span class="CountdownSeparator">:</span><span class="CountdownContent">%M <span class="CountdownLabel">' + text_minutes + '</span></span><span class="CountdownSeparator">:</span><span class="CountdownContent">%S <span class="CountdownLabel">' + text_seconds + '</span></span>')
56      );
57    });
58  });
59
60
61
62  /* ------------------------------------------------------------------------
63    PRICING TABLE HOVER & SWITCHER
64   ------------------------------------------------------------------------*/
65    $( ".comparison-pricing-table .pricing-row,.comparison-pricing-table .pricing-headings .vc_custom_heading" ).hover(
66         function() {
67            var index = $(this).index();
68            $('.comparison-pricing-table .pricing-options-container,.comparison-pricing-table .pricing-headings .wpb_wrapper').each(function(){
69            $(this).children().eq(index).addClass( "active" );
70            });
71          }, function() {
72          var index = $(this).index();
73            $('.comparison-pricing-table .pricing-options-container,.comparison-pricing-table .pricing-headings .wpb_wrapper').each(function(){
74            $(this).children().eq(index).removeClass( "active" );
75            });
76          }
77    );
78
79    $(".kd-price-switch input").click( function(){
80    jQuery(".pricing .tt_button").each(function(index, value) {
81        var pricing_btn = $(this);
82        var primary_btn_url = pricing_btn.attr("href");
83        var secondary_btn_url = pricing_btn.attr("data-secondary-link");
84        var aux_url = primary_btn_url;
85        pricing_btn.attr("href", secondary_btn_url);
86        pricing_btn.attr("data-secondary-link", aux_url);
87    });
88      if( $(this).is(':checked') ) {
89        $(this).parents(".vc_row-fluid").find(".pricing").addClass('secondary-price');
90      } else {
91        $(this).parents(".vc_row-fluid").find(".pricing").removeClass('secondary-price');
92      }
93    });
94
95
96
97  /* ------------------------------------------------------------------------
98    PIE CHART
99   ------------------------------------------------------------------------*/
100
101  jQuery(".kd_pie_chart .kd_chart").each(function(index, value) {
102    jQuery(this).appear(function() {
103      jQuery(this).easyPieChart({
104        barColor: "#000",
105        trackColor: "rgba(210, 210, 210, 0.2)",
106        animate: 2000,
107        size: "160",
108        lineCap: 'square',
109        lineWidth: "2",
110        scaleColor: false,
111        onStep: function(from, to, percent) {
112          jQuery(this.el).find(".pc_percent").text(Math.round(percent));
113        }
114      });
115    });
116    var chart = window.chart = jQuery("kd_pie_chart .kd_chart").data("easyPieChart");
117  });
118
119  /* ------------------------------------------------------------------------
120   REV SLIDER FONT FIX
121   ------------------------------------------------------------------------*/
122
123  $("rs-layer[data-type='text'], .rs-layer[data-type='text']").each(function(index, value) {
124    if ($(this).css('font-family') == '"inherit"') {
125      $(this).css('font-family','');
126    }
127    if ($(this).css('font-family') == 'inherit') {
128      $(this).css('font-family','');
129    }
130  });
131
132  /* ------------------------------------------------------------------------
133    COUNTERS
134   ------------------------------------------------------------------------*/
135
136  jQuery(".kd_number_string").each(function(index, value) {
137    jQuery(this).appear(function() {
138      if ($(this).data('format') === 'disable') {
139        jQuery(this).countTo({formatter: function (value, options) {return value.toFixed(options.decimals); }});
140      } else {
141        jQuery(this).countTo();
142      }
143    });
144  });
145
146  /* ------------------------------------------------------------------------
147      REFRESH GOOGLE MAP WITH THE ACTIVE TAB
148   ------------------------------------------------------------------------*/
149  if (jQuery(".contact-map-container").length) {
150    jQuery('.vc_tta-tabs a').on('show.vc.tab', function() {
151      setTimeout(function() {
152        google.maps.event.trigger(window, 'resize', {});
153      }, 500)
154    });
155  }
156
157  jQuery('.toggle-map-info').on('click', function(e) {
158    e.preventDefault();
159    jQuery(this).closest('.business-info-wrapper').toggleClass('minimize');
160  });
161
162  /* ------------------------------------------------------------------------
163      VIDEO MODAL
164   ------------------------------------------------------------------------*/
165
166  function autoPlayYouTubeModal() {
167    var trigger = $("body").find('.video-container [data-toggle="modal"]');
168    trigger.click(function() {
169      var theModal = $(this).data("target");
170      videoSRC = $(this).data("src");
171      videoSRCauto = videoSRC + "?autoplay=1";
172      $(theModal + ' iframe').attr('src', videoSRCauto);
173      $(theModal + ' button.close').click(function() {
174        $(theModal + ' iframe').attr('src', videoSRC);
175      });
176      $('.modal').click(function() {
177        $(theModal + ' iframe').attr('src', videoSRC);
178      });
179    });
180  }
181  autoPlayYouTubeModal();
182
183  function autoPlayVideoModal() {
184    var trigger = $("body").find('.video-container [data-toggle="modal"]');
185      trigger.click(function() {
186      var theModal = $(this).data("target");
187      if ($(theModal + ' .video-modal-local').length) {
188        $(theModal + ' .video-modal-local')[0].play();
189      }
190    });
191  }
192  autoPlayVideoModal();
193
194
195  $('body').on('hidden.bs.modal', '.modal', function () {
196    $('video').trigger('pause');
197  });
198
199  if (jQuery(".modal.video-modal").length > 0) {
200    jQuery(".video-modal").each(function() {
201      jQuery(this).insertAfter("#footer");
202    });
203  }
204
205  /* ------------------------------------------------------------------------
206    FEATURE SECTIONS
207   ------------------------------------------------------------------------*/
208  if (jQuery(".feature-sections-wrapper").length > 0) {
209    jQuery('body').scrollspy({
210      offset: 180,
211      target: '.kd-feature-tabs'
212    });
213  }
214
215
216});
217
218
219jQuery(window).on('load', function() {
220
221  /* ------------------------------------------------------------------------
222    EXTENDED TABS
223   ------------------------------------------------------------------------*/
224
225  if ( jQuery(".features-tabs").length > 0 ) {
226    jQuery(".features-tabs").each( function () {
227      jQuery( "li.tab-control-item", this ).appendTo( jQuery( ".tab-control
227s", this ) );
228    });
229
230    jQuery(".features-tabs").easytabs({
231      updateHash: false,
232      animationSpeed: "fast",
233      transitionIn: "fadeIn"
234    });
235  }
236
237  /* ------------------------------------------------------------------------
238    TEXT ROTATOR
239   ------------------------------------------------------------------------*/
240
241  jQuery(".kd-text-rotator").each(function(index, value) {
242    jQuery(this).appear(function() {
243      jQuery(this).addClass("start-rotator");
244    });
245  });
246
247  /* ------------------------------------------------------------------------
248  STICKY NAVIGATION ELEMENT
249 ------------------------------------------------------------------------*/
250
251
252  if (jQuery(".feature-sections-wrapper").length > 0) {
253    var adminbar_offset = 0;
254    if (jQuery("#wpadminbar").length > 0) { adminbar_offset = 32; }
255    if (jQuery('.navbar-default.with-topbar-sticky').length > 0) {
256      var sticky_offset = jQuery('.navbar-default.with-topbar-sticky').outerHeight();
257       if (jQuery( '.navbar-default' ).hasClass( 'fixed-menu' )) { sticky_offset = 0;}
258      jQuery('.feature-sections-tabs').css( "top", sticky_offset + adminbar_offset );
259    } else {
260      var sticky_offset = jQuery('.navbar.navbar-default .menubar').outerHeight();
261      if (jQuery( '.navbar-default' ).hasClass( 'fixed-menu' )) { sticky_offset = 0;}
262      jQuery('.feature-sections-tabs').css( "top", sticky_offset + adminbar_offset );
263    }
264
265
266    jQuery(".feature-sections-wrapper").each(function() {
267      jQuery("li.nav-label", this).appendTo(jQuery(".sticky-tabs", this));
268    });
269
270    jQuery('.sticky-tabs li a[href*=\\#]').bind('click', function(e) {
271      e.preventDefault();
272      var target = jQuery(this).attr("href");
273      jQuery('html, body').stop().animate({
274        scrollTop: jQuery(target).offset().top - 176
275      }, 1000, 'easeOutCubic');
276      return false;
277    });
278
279   var feature_container = jQuery(".feature-sections-wrapper");
280    var feature_nav = jQuery(".feature-sections-tabs");
281    var offset = feature_container.offset().top;
282
283    jQuery(window).scroll(function(event) {
284      var scroll = jQuery(window).scrollTop();
285      var total = feature_container.height() + offset - 200;
286      if (scroll > total) {
287        feature_nav.addClass('sticky-hide')
288      }
289      if (scroll < total) {
290        feature_nav.removeClass('sticky-hide')
291      }
292    });
293  }
294
295  /* ------------------------------------------------------------------------
296  MASONRY GALLERY ELEMENT
297 ------------------------------------------------------------------------*/
298
299  if (jQuery('.mg-gallery').length > 0) {
300    jQuery('.mg-gallery').each(function() {
301      var msnry = new Masonry(this, {
302        itemSelector: '.mg-single-img',
303        columnWidth: '.mg-sizer',
304        percentPosition: true,
305        gutter: 30
306      });
307    });
308    var classes = '.vc_tta-tabs-list .vc_tta-tab,' + '.vc_pagination .vc_pagination-item';
309    jQuery('body').on('click', classes,
310      function() {
311        setInterval(function(){
312        var reloadMasonry = jQuery('.vc_active .mg-gallery').masonry({
313            itemSelector: '.mg-single-img',
314            columnWidth: '.mg-sizer',
315            percentPosition: true,
316            gutter: 30
317        });
318        reloadMasonry.masonry("reloadItems");
319        reloadMasonry.masonry('layout');
320        },200);
321      });
322  }
323
324  /* ------------------------------------------------------------------------
325  ALERT BOX ELEMENT
326 ------------------------------------------------------------------------*/
327
328  jQuery('.kd-alertbox .ab-close').on('click', function(e) {
329    e.preventDefault();
330    jQuery(this).closest('.kd-alertbox').hide(200);
331  });
332
333  /* ------------------------------------------------------------------------
334 LOGIN FORM
335------------------------------------------------------------------------*/
336  jQuery('#user_login').attr('placeholder', 'Username');
337  jQuery('#user_pass').attr('placeholder', 'Password');
338
339});

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.