PageSourceSearch

https://www.okseopros.com/files/theme/custom.js?1703014541

js okseopros.com collected 2026-09-30 18:01:29 UTC 5,953 bytes, 197 lines download raw bytes

1jQuery(function($) {
2
3    // Fixed nav
4    $.fn.checkHeaderPositioning = function(scrollEl, scrollClass) {
5        var $me = $(this);
6
7        if (!$me.length) {
8          return;
9        }
10
11        if($(scrollEl).scrollTop() > 50) {
12            $me.addClass(scrollClass);
13        } else if($(scrollEl).scrollTop() === 0) {
14            $me.removeClass(scrollClass);
15        }
16    };
17
18  // Mobile sidebars
19  $.fn.expandableSidebar = function(expandedClass) {
20    var $me = this;
21
22    $me.on('click', function() {
23      if(!$me.hasClass(expandedClass)) {
24        $me.addClass(expandedClass);
25      } else {
26        $me.removeClass(expandedClass);
27      }
28    });
29  }
30
31  // Interval loop
32  $.fn.intervalLoop = function(condition, action, duration, limit) {
33    var counter = 0;
34    var looper = setInterval(function(){
35      if (counter >= limit || $.fn.checkIfElementExists(condition)) {
36        clearInterval(looper);
37      } else {
38        action();
39        counter++;
40      }
41    }, duration);
42  }
43
44  // Check if element exists
45  $.fn.checkIfElementExists = function(selector) {
46    return $(selector).length;
47  }
48
49  var uniteController = {
50    init: function(opts) {
51      var base = this;
52
53      $('body').checkHeaderPositioning(window, 'collapse');
54
55      // Add classes to elements
56      base._addClasses();
57
58      // Fade header content on scroll
59      $(window).scroll(function(){
60        var scaler = 1 - $(window).scrollTop() / ($('.banner-wrap').height());
61        if (scaler < 0) { scaler = 0; }
62          $('body.header-scroll-animate-on .banner').css("opacity", 1 - $(window).scrollTop() / ($('.banner-wrap').height() / 1.5));
63          $('body.header-scroll-animate-on .banner').css("top", - 200 * $(window).scrollTop() / $('.banner-wrap').height());
64          $('body.header-scroll-animate-on .banner').css({'-webkit-transform' : 'scale(' + scaler + ')', '-moz-transform' : 'scale(' + scaler + ')', '-ms-transform' : 'scale(' + scaler + ')', 'transform' : 'scale(' + scaler + ')'});
65      });
66
67      setTimeout(function(){
68        base._attachEvents();
69      }, 1000);
70    },
71
72    _addClasses: function() {
73      var base = this;
74
75      // Add fade in class to nav + logo + banner
76        $('body').addClass('fade-in');
77
78      // Add class to nav items with subnav
79      $('.wsite-menu-default').find('li.wsite-menu-item-wrap').each(function(){
80        var $me = $(this);
81
82        if($me.children('.wsite-menu-wrap').length > 0) {
83          $me.addClass('has-submenu');
84          $('<span class="icon-caret"></span>').insertAfter($me.children('a.wsite-menu-item'));
85        }
86      });
87
88      // Active nav class
89
90      $('#active').addClass('active');
91
92      // Add class to subnav items with subnav
93      $('.wsite-menu').find('li.wsite-menu-subitem-wrap').each(function(){
94        var $me = $(this);
95
96        if($me.children('.wsite-menu-wrap').length > 0) {
97          $me.addClass('has-submenu');
98          $('<span class="icon-caret"></span>').insertAfter($me.children('a.wsite-menu-subitem'));
99        }
100      });
101
102        // Keep subnav open if submenu item is active
103        $('li.wsite-menu-subitem-wrap.wsite-nav-current').parents('.wsite-menu-wrap').addClass('open');
104
105      // Add placeholder text to inputs
106      $('.wsite-form-sublabel').each(function(){
107        var sublabel = $(this).text();
108        $(this).prev('.wsite-form-input').attr('placeholder', sublabel);
109      });
110    },
111
112    _cloneLogin: function() {
113      var loginDetach = $('#member-login').clone(true);
114      $('.mobile-nav .wsite-menu-default > li:last-child').after(loginDetach);
115    },
116
117    _moveFlyout: function() {
118      var move = $("#wsite-menus").detach();
119      $(".unite-header").append(move);
120    },
121
122    _attachEvents: function() {
123    	var base = this;
124
125        $('.hamburger').on('click', function(e) {
126            e.preventDefault();
127            if (!$('body').hasClass('nav-open')) {
128                $('body').addClass('nav-open');
129            } else {
130                $('body').removeClass('nav-open');
131            }
132        });
133
134        // Move cart
135        $.fn.intervalLoop('.unite-header.sticky-nav-on #wsite-menus', base._moveFlyout, 200, 12);
136
137      	// Copy login
138
139        $.fn.intervalLoop('.mobile-nav #member-login', base._cloneLogin, 800, 5);
140
141
142        // Fixed header
143        $(window).on('scroll', function() {
144          $('body').checkHeaderPositioning(window, 'collapse');
145        });
146
147        // Splash page logo link swap
148
149        $('.splash-page .wsite-logo a').attr("href", $('.wsite-menu-default li:first-child a').attr("href"));
150
151        // Subnav toggle
152        $('li.has-submenu span.icon-caret').on('click', function() {
153            var $me = $(this);
154
155            if($me.siblings('.wsite-menu-wrap').hasClass('open')) {
156                $me.siblings('.wsite-menu-wrap').removeClass('open');
157            } else {
158                $me.siblings('.wsite-menu-wrap').addClass('open');
159            }
160        });
161
162      // Store category dropdown
163      $('.wsite-com-sidebar').expandableSidebar('sidebar-expanded');
164
165      // Search filters dropdown
166      $('#wsite-search-sidebar').expandableSidebar('sidebar-expanded');
167
168    	// Init fancybox swipe on mobile
169      if ('ontouchstart' in window) {
170        $('body').on('click', 'a.w-fancybox', function() {
171          base._initSwipeGallery();
172        });
173      }
174    },
175
176    _initSwipeGallery: function() {
177      var base = this;
178
179      setTimeout(function(){
180        var touchGallery = document.getElementsByClassName('fancybox-wrap')[0];
181        var mc = new Hammer(touchGallery);
182        mc.on("panleft panright", function(ev) {
183          if (ev.type == "panleft") {
184            $("a.fancybox-next").trigger("click");
185          } else if (ev.type == "panright") {
186            $("a.fancybox-prev").trigger("click");
187          }
188          base._initSwipeGallery();
189        });
190      }, 500);
191    }
192  }
193
194  $(document).ready(function(){
195  	uniteController.init();
196  });
197});

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.