Advertisement
Guest User

komang

a guest
Mar 30th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($) {
  2.   $(document).ready(function() {
  3.     if ($('.slider-counter').length > 0) {
  4.       var sliderCounter = $('.slider-counter');
  5.       var parent = sliderCounter.closest('.imm-slider');
  6.       var totalSlider = parent.find('.immSlider-slide:not(.slick-cloned)').length;
  7.       sliderCounter.find('.number-slider').text('0' + totalSlider);
  8.  
  9.       if (totalSlider <= 1) {
  10.         $('.immSlider-page').addClass('more-slide');
  11.         $('.immSlider-additional-nav').addClass('more-slide');
  12.       } else {
  13.         $('.immSlider-page').removeClass('more-slide');
  14.         $('.immSlider-additional-nav').removeClass('more-slide');
  15.       }
  16.     }
  17.  
  18.  
  19.  
  20.     sal();
  21.  
  22.     if ($(window).width() <= 767) {
  23.       if ($('.opening_paragraph-wrap').height() > 280) {
  24.         $('.opening_paragraph-wrap').parent().addClass('head-read-more');
  25.       }
  26.       $('.opening_paragraph-wrap p').readmore({
  27.         speed: 300,
  28.         collapsedHeight: 300,
  29.         moreLink: '<span class="show-more" style="display:inline-block;margin-top:0px;"><a href="#" class="bpm-button bpm-button-2">Show more</a></span>',
  30.         lessLink: '<span><a href="#" class="bpm-button">Show less</a></span>'
  31.       });
  32.     }
  33.  
  34.     var loadMailchimpScript = function() {
  35.       var mailChimpLoaded = false,
  36.         scriptRunning = false,
  37.         runMailchimp = function() {
  38.           if (scriptRunning == true) {
  39.             return;
  40.           }
  41.           scriptRunning = true;
  42.           window.fnames = new Array();
  43.           window.ftypes = new Array();
  44.           fnames[0] = 'EMAIL';
  45.           ftypes[0] = 'email';
  46.           window.$mcj = jQuery.noConflict(true);
  47.         };
  48.       $(window).scroll(function() {
  49.         if (mailChimpLoaded == true) {
  50.           return;
  51.         }
  52.         if ($(window).scrollTop() < 50) {
  53.           return;
  54.         }
  55.         mailChimpLoaded = true;
  56.         var src = '//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js',
  57.           createTag = document.createElement('script'),
  58.           availableTag = document.getElementsByTagName('script')[0];
  59.         createTag.src = src;
  60.         availableTag.parentNode.insertBefore(createTag, availableTag);
  61.         runMailchimp();
  62.       });
  63.     };
  64.     loadMailchimpScript();
  65.  
  66.     var loadDriftScript = function() {
  67.       var driftLoaded = false,
  68.         scriptRunning = false,
  69.         runDrift = function() {
  70.           if (scriptRunning == true) {
  71.             return;
  72.           }
  73.           scriptRunning = true;
  74.           if (typeof drift !== 'undefined') {
  75.             drift.on("ready", function(api) {
  76.               api.widget.hide()
  77.  
  78.               if (window.innerWidth >= 1025) {
  79.                 //api.widget.show()
  80.               }
  81.  
  82.               $('.livechat-nav').on('click', function(e) {
  83.                 e.preventDefault();
  84.                 drift.api.startInteraction({
  85.                   interactionId: 'uhsbzg2y8chi',
  86.                   goToConversation: true
  87.                 });
  88.                 return false;
  89.               });
  90.               $('button.open-drift-chat').on('click', function(e) {
  91.                 e.preventDefault();
  92.                 drift.api.startInteraction({
  93.                   interactionId: 'uhsbzg2y8chi',
  94.                   goToConversation: true
  95.                 });
  96.                 return false;
  97.               });
  98.             });
  99.           }
  100.         };
  101.       var driftExtension = function() {
  102.         ! function() {
  103.           var t = window.driftt = window.drift = window.driftt || [];
  104.           if (!t.init) {
  105.             if (t.invoked) return void(window.console && console.error && console.error("Drift snippet included twice."));
  106.             t.invoked = !0, t.methods = ["identify", "config", "track", "reset", "debug", "show", "ping", "page", "hide", "off", "on"],
  107.               t.factory = function(e) {
  108.                 return function() {
  109.                   var n = Array.prototype.slice.call(arguments);
  110.                   return n.unshift(e), t.push(n), t;
  111.                 };
  112.               }, t.methods.forEach(function(e) {
  113.                 t[e] = t.factory(e);
  114.               }), t.load = function(t) {
  115.                 var e = 3e5,
  116.                   n = Math.ceil(new Date() / e) * e,
  117.                   o = document.createElement("script");
  118.                 o.type = "text/javascript", o.async = !0, o.crossorigin = "anonymous", o.src = "https://js.driftt.com/include/" + n + "/" + t + ".js";
  119.                 var i = document.getElementsByTagName("script")[0];
  120.                 i.parentNode.insertBefore(o, i);
  121.               };
  122.           }
  123.         }();
  124.       };
  125.       driftExtension();
  126.       var globalLoaded = false;
  127.       $(window).on('load', function() {
  128.         if (globalLoaded == true) {
  129.           return;
  130.         }
  131.         globalLoaded = true;
  132.         drift.SNIPPET_VERSION = '0.3.1';
  133.         drift.load('uhsbzg2y8chi');
  134.         runDrift();
  135.       });
  136.       $(window).scroll(function() {
  137.         if (driftLoaded == true) {
  138.           return;
  139.         }
  140.         if ($(window).scrollTop() < 50) {
  141.           return;
  142.         }
  143.         if (globalLoaded == true) {
  144.           return;
  145.         }
  146.         driftLoaded = true;
  147.         globalLoaded = true;
  148.         drift.SNIPPET_VERSION = '0.3.1';
  149.         drift.load('uhsbzg2y8chi');
  150.         runDrift();
  151.       });
  152.     };
  153.     loadDriftScript();
  154.   });
  155.  
  156. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement