PageSourceSearch

https://www.mondoirrigazione.it/modules/iqitmegamenu/views/js/front.js

js mondoirrigazione.it collected 2026-10-08 00:14:57 UTC 9,251 bytes, 290 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
31     var menuId = '#cbp-hrmenu',
32        $listItems = $( menuId + '> ul > li'  ),
33        $menuItems = $listItems.children( 'a, .cbp-main-link' ),
34        $body = $( 'body' ),
35        current = -1;
36    currentlevel = -1;
37
38    const innerTabs = document.querySelectorAll(menuId + ' .cbp-hrsub-tabs-names li > a');
39
40    if (iqitTheme.hm_submenu_width == 'default') {
41      var $header = $( '#desktop-header-container' );
42    } else{
43      var $header = $( '#header' );
44    }
45
46    $listItems.has('ul').find(' > a').doubleTapToGo();
47
48    function init() {
49      var isTouchDevice = 'ontouchstart' in document.documentElement;
50      if( isTouchDevice ) {
51        $menuItems.on( 'mouseover', open );
52      }
53      else{
54        $menuItems.hoverIntent( {
55          over: open,
56          out: dnthing,
57          interval: 30
58        } );
59      }
60
61      $listItems.on( 'mouseover', function( event ) { event.stopPropagation(); } );
62
63      innerTabs.forEach(tab => {
64        tab.addEventListener('mouseenter', function() {
65          const tabTrigger = new bootstrap.Tab(this);
66          tabTrigger.show();
67        });
68      });
69    }
70
71    var setCurrent = function(strName) {
72      current = strName;
73    };
74
75    function dnthing( event ) {
76
77    }
78
79    function open( event ) {
80
81      $othemenuitem = $('#cbp-hrmenu1').find('.cbp-hropen');
82
83
84      $othemenuitem.find('.cbp-hrsub').removeClass('cbp-show');
85      $othemenuitem.removeClass( 'cbp-hropen' );
86
87      cbpVerticalmenu.setCurrent(-1);
88
89      var $item = $( event.currentTarget ).parent( 'li' ),
90          idx = $item.index();
91
92
93      $submenu = $item.find('.cbp-hrsub');
94
95      if(current == idx )
96        return;
97
98      $submenu.removeClass('cbp-notfit');
99      $submenu.removeClass('cbp-show');
100
101      if( current !== -1 ) {
102        $listItems.eq( current ).removeClass( 'cbp-hropen' );
103      }
104
105      if( current === idx ) {
106        $item.removeClass( 'cbp-hropen' );
107        current = -1;
108
109      }
110      else {
111        $submenu.addClass( 'cbp-show' );
112        iqitmenuwidth = $header.width();
113        iqititemposition = $item.offset().left - $header.offset().left;
114
115        if((iqitmenuwidth-iqititemposition)<=$submenu.width())
116        {
117          $submenu.addClass( 'cbp-notfit' );
118        }
119
120        $item.addClass( 'cbp-hropen' );
121        current = idx;
122        $body.off( 'mouseover' ).on( 'mouseover', close );
123      }
124
125
126
127      return false;
128
129    }
130
131    function close( event ) {
132      $listItems.eq( current ).removeClass( 'cbp-hropen' );
133      current = -1;
134    }
135
136    return { init : init,
137      setCurrent: setCurrent
138    };
139
140  })();
141
142  cbpHorizontalMenu.init();
143
144});
145
146$(document).ready(function(){
147
148  $('.cbp-vertical-on-top').on( 'mouseover', function() {
149    $(this).addClass('cbp-vert-expanded');
150  });
151
152  $('.cbp-vertical-on-top').on( 'mouseleave', function() {
153    $(this).removeClass('cbp-vert-expanded');
154  });
155
156
157
158  cbpVerticalmenu = (function(test) {
159
160    var menuId = '#cbp-hrmenu1-ul',
161        $listItems = $( menuId + ' > li'  ),
162        $menuItems = $listItems.children( 'a' ),
163        $body = $( 'body' ),
164        current = -1,
165        currentlevel = -1;
166
167    const innerTabs = document.querySelectorAll(menuId + ' .cbp-hrsub-tabs-names li > a');    
168
169    $listItems.has('ul').find(' > a').doubleTapToGo();
170
171
172
173    function init() {
174
175      var isTouchDevice = 'ontouchstart' in document.documentElement;
176      if( isTouchDevice ) {
177        $menuItems.on( 'mouseover', open );
178      }
179      else{
180        $menuItems.hoverIntent( {
181          over: open,
182          out: dnthing,
183          interval: 30
184        } );
185      }
186
187      $listItems.on( 'mouseover', function( event ) { event.stopPropagation(); } );
188
189      innerTabs.forEach(tab => {
190        tab.addEventListener('mouseenter', function() {
191          const tabTrigger = new bootstrap.Tab(this);
192          tabTrigger.show();
193        });
194      });
195
196      $( window ).resize(function() {
197        $('cbp-hrmenu-tab').not('.cbp-hropen').find( '.cbp-hrsub-wrapper' ).removeAttr( 'style' );
198      });
199    }
200
201    function dnthing( event ) {
202
203    }
204
205    var setCurrent = function(strName) {
206      current = strName;
207    };
208
209    function open( event ) {
210
211
212      $othemenuitem = $('#cbp-hrmenu').find('.cbp-hropen');
213
214      $othemenuitem.find('.cbp-hrsub').removeClass('cbp-show');
215      closeElement($othemenuitem);
216
217      cbpHorizontalMenu.setCurrent(-1);
218
219      var $item = $( event.currentTarget ).parent( 'li' ),
220          idx = $item.index();
221
222      if(current == idx )
223        return;
224
225      $submenu = $item.find('.cbp-hrsub');
226      $submenu.removeClass('cbp-show');
227
228      if( current !== -1 ) {
229        closeElement($listItems.eq( current ));
230      }
231
232      if( current === idx ) {
233        closeElement($item);
234        current = -1;
235      }
236      else {
237        $submenu.parent().width($(iqitmegamenu.containerSelector).width()-$(menuId).width());
238        callerHeight = $item.height();
239        $submenu.parent().css( { marginLeft : $item.innerWidth()+"px", marginRight : $item.innerWidth()+"px", marginTop : -callerHeight+"px" } );
240        $submenu.addClass( 'cbp-show' );
241        $item.addClass( 'cbp-hropen' );
242        current = idx;
243        $body.off( 'mouseover' ).on( 'mouseover', close );
244      }
245
246      return false;
247    }
248
249    function close( event ) {
250      closeElement($listItems.eq( current ));
251      current = -1;
252    }
253
254    function closeElement( $element ) {
255      $element.removeClass( 'cbp-hropen' );
256    }
257
258    return { init : init,
259      setCurrent: setCurrent
260    };
261
262  })();
263
264  cbpVerticalmenu.init();
265
266});
267
268
269$(document).ready(function(){
270
271  var iqitMobileMenu = (function() {
272
273    var $menu = $('#iqitmegamenu-mobile');
274    var $expander = $menu.find('.mm-expand');
275
276    $menu.on('click', function (e) {
277      e.stopPropagation()
278    });
279
280    $expander.on('click', function () {
281      $(this).parent().toggleClass('show');
282    });
283  });
284
285  iqitMobileMenu();
286  
287});
288
289
290

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.