PageSourceSearch

https://sicame-energie.com/modules/iqitmegamenu/views/js/front.js

js sicame-energie.com collected 2026-10-04 01:46:31 UTC 10,865 bytes, 355 lines download raw bytes

1/**
2* 2014-2017 IQIT-COMMERCE.COM
3*
4* NOTICE OF LICENSE
5*
6*  @author    IQIT-COMMERCE.COM <[email protected]>
7*  @copyright 2007-2017 IQIT-COMMERCE.COM
8*  @license   GNU General Public License version 2
9*
10* You can not resell or redistribute this software.
11* 
12*/
13
14// classie - class helper functions, from bonzo https://github.com/ded/bonzo
15
16!function(a){"use strict";function b(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function f(a,b){var f=c(a,b)?e:d;f(a,b)}var c,d,e;"classList"in document.documentElement?(c=function(a,b){return a.classList.contains(b)},d=function(a,b){a.classList.add(b)},e=function(a,b){a.classList.remove(b)}):(c=function(a,c){return b(c).test(a.className)},d=function(a,b){c(a,b)||(a.className=a.className+" "+b)},e=function(a,c){a.className=a.className.replace(b(c)," ")});var g={hasClass:c,addClass:d,removeClass:e,toggleClass:f,has:c,add:d,remove:e,toggle:f};"function"==typeof define&&define.amd?define(g):a.classie=g}(window);
17
18//hover intent
19(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))<cfg.sensitivity){$(ob).off("mousemove.hoverIntent",track);ob.hoverIntent_s=true;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=false;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=$.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type==="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).on("mousemove.hoverIntent",track);if(!ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).off("mousemove.hoverIntent",track);if(ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}})(jQuery);
20
21//double tap
22;(function(e,t,n,r){e.fn.doubleTapToGo=function(r){if(!("ontouchstart"in t)&&!navigator.msMaxTouchPoints&&!navigator.userAgent.toLowerCase().match(/windows phone os 7/i))return false;this.each(function(){var t=false;e(this).on("click",function(n){var r=e(this);if(r[0]!=t[0]){n.preventDefault();t=r}});e(n).on("click touchstart MSPointerDown",function(n){var r=true,i=e(n.target).parents();for(var s=0;s<i.length;s++)if(i[s]==t[0])r=false;if(r)t=false})});return this}})(jQuery,window,document);
23
24var cbpHorizontalMenu, cbpVerticalmenu;
25
26$(document).ready(function(){
27
28  cbpHorizontalMenu = (function() {
29
30    var menuId = '#cbp-hrmenu',
31        $listItems = $( menuId + '> ul > li'  ),
32        $menuItems = $listItems.children( 'a, .cbp-main-link' ),
33        $innerTabs = $( menuId + ' .cbp-hrsub-tabs-names li > a'  ),
34        $body = $( 'body' ),
35        current = -1;
36    currentlevel = -1;
37
38    $listItems.has('ul').find(' > a').doubleTapToGo();
39
40    function init() {
41      var isTouchDevice = 'ontouchstart' in document.documentElement;
42      if( isTouchDevice ) {
43        $menuItems.on( 'mouseover', open );
44      }
45      else{
46        $menuItems.hoverIntent( {
47          over: open,
48          out: dnthing,
49          interval: 30
50        } );
51      }
52
53      $listItems.on( 'mouseover', function( event ) { event.stopPropagation(); } );
54
55      $innerTabs.hover( function(){
56        $innerTabs.removeClass('active');
57        $(this).tab('show');
58      });
59    }
60
61    var setCurrent = function(strName) {
62      current = strName;
63    };
64
65    function dnthing( event ) {
66
67    }
68
69    function open( event ) {
70
71      $othemenuitem = $('#cbp-hrmenu1').find('.cbp-hropen');
72
73
74      $othemenuitem.find('.cbp-hrsub').removeClass('cbp-show');
75      $othemenuitem.removeClass( 'cbp-hropen' );
76
77      cbpVerticalmenu.setCurrent(-1);
78
79      var $item = $( event.currentTarget ).parent( 'li' ),
80          idx = $item.index();
81
82
83      $submenu = $item.find('.cbp-hrsub');
84
85      if(current == idx )
86        return;
87
88      $submenu.removeClass('cbp-notfit');
89      $submenu.removeClass('cbp-show');
90
91      if( current !== -1 ) {
92        $listItems.eq( current ).removeClass( 'cbp-hropen' );
93      }
94
95      if( current === idx ) {
96        $item.removeClass( 'cbp-hropen' );
97        current = -1;
98
99      }
100      else {
101        $submenu.addClass( 'cbp-show' );
102        iqitmenuwidth = $(menuId).width();
103        iqititemposition = $item.position().left;
104
105        triangleoffset = iqitmenuwidth-$submenu.width();
106
107        if((iqitmenuwidth-iqititemposition)<$submenu.width())
108        {
109          $submenu.addClass( 'cbp-notfit' );
110          $submenu.find('.cbp-triangle-container').css({left: (iqititemposition-12+$item.width()/2)-triangleoffset });
111        }
112        else
113          $submenu.find('.cbp-triangle-container').css({left: (-12+$item.width()/2) });
114
115
116
117        $item.addClass( 'cbp-hropen' );
118        current = idx;
119        $body.off( 'mouseover' ).on( 'mouseover', close );
120      }
121
122
123
124      return false;
125
126    }
127
128    function close( event ) {
129      $listItems.eq( current ).removeClass( 'cbp-hropen' );
130      current = -1;
131    }
132
133    return { init : init,
134      setCurrent: setCurrent
135    };
136
137  })();
138
139  cbpHorizontalMenu.init();
140
141  if (iqitmegamenu.sticky) {
142    var s = $("#iqitmegamenu-horizontal");
143    var pos = s.offset();
144    var alreadySticky = false;
145
146    $(window).scroll(function() {
147      var windowpos = $(window).scrollTop();
148      if ( s.length  ){
149        if(!alreadySticky) {
150          if (windowpos >= pos.top) {
151            alreadySticky = true;
152            s.parent().height(s.height());
153            s.removeClass("cbp-nosticky");
154            s.addClass("cbp-sticky");
155          }
156        }
157        if(alreadySticky) { 
158          if (windowpos < pos.top) {
159            alreadySticky = false;
160            s.removeClass("cbp-sticky");
161            s.addClass("cbp-nosticky"); 
162            s.parent().removeAttr("style");
163          }}
164        }
165      });
166  }
167
168});
169
170$(document).ready(function(){
171
172  $('.cbp-vertical-on-top').on( 'mouseover', function() {
173    $(this).addClass('cbp-vert-expanded');
174  });
175
176  $('.cbp-vertical-on-top').on( 'mouseleave', function() {
177    $(this).removeClass('cbp-vert-expanded');
178  });
179
180
181
182  cbpVerticalmenu = (function(test) {
183
184    var menuId = '#cbp-hrmenu1',
185        $listItems = $( menuId + '> ul > li'  ),
186        $menuItems = $listItems.children( 'a' ),
187        $innerTabs = $( menuId + ' .cbp-hrsub-tabs-names li > a'  ),
188        $body = $( 'body' ),
189        current = -1,
190        currentlevel = -1;
191
192    $listItems.has('ul').find(' > a').doubleTapToGo();
193
194
195
196    function init() {
197
198      var isTouchDevice = 'ontouchstart' in document.documentElement;
199      if( isTouchDevice ) {
200        $menuItems.on( 'mouseover', open );
201      }
202      else{
203        $menuItems.hoverIntent( {
204          over: open,
205          out: dnthing,
206          interval: 30
207        } );
208      }
209
210
211
212      $listItems.on( 'mouseover', function( event ) { event.stopPropagation(); } );
213
214      $innerTabs.hover( function(){
215        console.log('aas');
216        $innerTabs.removeClass('active');
217        $(this).tab('show');
218      });
219
220      $( window ).resize(function() {
221        $('cbp-hrmenu-tab').not('.cbp-hropen').find( '.cbp-hrsub-wrapper' ).removeAttr( 'style' );
222      });
223    }
224
225    function dnthing( event ) {
226
227    }
228
229    var setCurrent = function(strName) {
230      current = strName;
231    };
232
233    function open( event ) {
234
235
236      $othemenuitem = $('#cbp-hrmenu').find('.cbp-hropen');
237
238      $othemenuitem.find('.cbp-hrsub').removeClass('cbp-show');
239      closeElement($othemenuitem);
240
241      cbpHorizontalMenu.setCurrent(-1);
242
243      var $item = $( event.currentTarget ).parent( 'li' ),
244          idx = $item.index();
245
246      if(current == idx )
247        return;
248
249      $submenu = $item.find('.cbp-hrsub');
250      $submenu.removeClass('cbp-show');
251
252      if( current !== -1 ) {
253        closeElement($listItems.eq( current ));
254      }
255
256      if( current === idx ) {
257        closeElement($item);
258        current = -1;
259
260      }
261      else {
262        $submenu.parent().width($(iqitmegamenu.containerSelector).width()-$(menuId).width());
263        callerHeight = $item.height();
264        $submenu.parent().css( { marginLeft : $item.innerWidth()+"px", marginRight : $item.innerWidth()+"px", marginTop : -callerHeight+"px" } );
265        $submenu.find('.cbp-triangle-container').css({top: (callerHeight-24)/2});
266        $submenu.addClass( 'cbp-show' );
267        $item.addClass( 'cbp-hropen' );
268        current = idx;
269        $body.off( 'mouseover' ).on( 'mouseover', close );
270      }
271
272
273
274      return false;
275
276    }
277
278    function close( event ) {
279      closeElement($listItems.eq( current ));
280      current = -1;
281    }
282
283    function closeElement( $element ) {
284      $element.removeClass( 'cbp-hropen' );
285    }
286
287    return { init : init,
288      setCurrent: setCurrent
289    };
290
291  })();
292
293  cbpVerticalmenu.init();
294
295});
296
297
298$(document).ready(function(){
299
300
301  var cbpPush = (function() {
302
303
304    $('body').prepend($('#iqitmegamenu-mobile-content'));
305
306
307    $(".responsiveInykator").on("click", function () {
308
309      if (false == $(this).parent().next().is(':visible')) {
310        $('#iqitmegamenu-accordion > ul').removeClass('cbpm-ul-showed');
311      }
312
313      if ($(this).text() == "+"){
314        $(this).text("-");
315      }
316      else{
317        $(this).text("+");
318      }
319      $(this).parent().children('ul').toggleClass('cbpm-ul-showed');
320    });
321
322
323    var menuLeft = document.getElementById('iqitmegamenu-accordion'),
324        showLeftPush = document.getElementById('iqitmegamenu-shower'),
325        menuoverlay = document.getElementById('cbp-spmenu-overlay'),
326        body = document.body;
327
328    classie.addClass(body, 'cbp-spmenu-body');
329
330    $('#iqitmegamenu-shower').on("touchstart click", function (e) {
331      e.stopPropagation();
332      e.preventDefault();
333      classie.toggle(showLeftPush, 'active');
334      classie.toggle(body, 'cbp-spmenu-push-toright');
335      classie.toggle(menuLeft, 'cbp-spmenu-open');
336      classie.toggle(menuoverlay, 'cbp-spmenu-overlay-show');
337    });
338
339    $('#cbp-spmenu-overlay').on("touchstart click", function (e) {
340      e.stopPropagation();
341      e.preventDefault();
342      classie.toggle(this, 'active');
343      classie.toggle(body, 'cbp-spmenu-push-toright');
344      classie.toggle(menuLeft, 'cbp-spmenu-open');
345      classie.toggle(this, 'cbp-spmenu-overlay-show');
346    });
347
348  });
349
350  cbpPush();
351  
352});
353
354
355

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.