1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10/* 11 * jQuery Superfish Menu Plugin 12 * Copyright (c) 2013 Joel Birch 13 * 14 * Dual licensed under the MIT and GPL licenses: 15 * http://www.opensource.org/licenses/mit-license.php 16 * http://www.gnu.org/licenses/gpl.html 17 */ 18 19(function ($) { 20 "use strict"; 21 22 var methods = (function () { 23 // private properties and methods go here 24 var c = { 25 bcClass: 'sf-breadcrumb', 26 menuClass: 'sf-js-enabled', 27 anchorClass: 'sf-with-ul', 28 menuArrowClass: 'sf-arrows' 29 }, 30 ios = (function () { 31 var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent); 32 if (ios) { 33 // iOS clicks only bubble as far as body children 34 $(window).load(function () { 35 $('body').children().on('click', $.noop); 36 }); 37 } 38 return ios; 39 })(), 40 wp7 = (function () { 41 var style = document.documentElement.style; 42 return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent)); 43 })(), 44 toggleMenuClasses = function ($menu, o) { 45 var classes = c.menuClass; 46 if (o.cssArrows) { 47 classes += ' ' + c.menuArrowClass; 48 } 49 $menu.toggleClass(classes); 50 }, 51 setPathToCurrent = function ($menu, o) { 52 return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels) 53 .addClass(o.hoverClass + ' ' + c.bcClass) 54 .filter(function () { 55 return ($(this).children(o.popUpSelector).hide().show().length); 56 }).removeClass(o.pathClass); 57 }, 58 toggleAnchorClass = function ($li) { 59 $li.children('a').toggleClass(c.anchorClass); 60 }, 61 toggleTouchAction = function ($menu) { 62 var touchAction = $menu.css('ms-touch-action'); 63 touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y'; 64 $menu.css('ms-touch-action', touchAction); 65 }, 66 applyHandlers = function ($menu, o) { 67 var targets = 'li:has(' + o.popUpSelector + ')'; 68 if ($.fn.hoverIntent && !o.disableHI) { 69 $menu.hoverIntent(over, out, targets); 70 } 71 else { 72 $menu 73 .on('mouseenter.superfish', targets, over) 74 .on('mouseleave.superfish', targets, out); 75 } 76 var touchevent = 'MSPointerDown.superfish'; 77 if (!ios) { 78 touchevent += ' touchend.superfish'; 79 } 80 if (wp7) { 81 touchevent += ' mousedown.superfish'; 82 } 83 $menu 84 .on('focusin.superfish', 'li', over) 85 .on('focusout.superfish', 'li', out) 86 .on(touchevent, 'a', o, touchHandler); 87 }, 88 touchHandler = function (e) { 89 var $this = $(this), 90 $ul = $this.siblings(e.data.popUpSelector); 91 92 if ($ul.length > 0 && $ul.is(':hidden')) { 93 $this.one('click.superfish', false); 94 if (e.type === 'MSPointerDown') { 95 $this.trigger('focus'); 96 } else { 97 $.proxy(over, $this.parent('li'))(); 98 } 99 } 100 }, 101 over = function () { 102 var $this = $(this), 103 o = getOptions($this); 104 clearTimeout(o.sfTimer); 105 $this.siblings().superfish('hide').end().superfish('show'); 106 }, 107 out = function () { 108 var $this = $(this), 109 o = getOptions($this); 110 if (ios) { 111 $.proxy(close, $this, o)(); 112 } 113 else { 114 clearTimeout(o.sfTimer); 115 o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay); 116 } 117 }, 118 close = function (o) { 119 o.retainPath = ($.inArray(this[0], o.$path) > -1); 120 this.superfish('hide'); 121 122 if (!this.parents('.' + o.hoverClass).length) { 123 o.onIdle.call(getMenu(this)); 124 if (o.$path.length) { 125 $.proxy(over, o.$path)(); 126 } 127 } 128 }, 129 getMenu = function ($el) { 130 return $el.closest('.' + c.menuClass); 131 }, 132 getOptions = function ($el) { 133 return getMenu($el).data('sf-options'); 134 }; 135 136 return { 137 // public methods 138 hide: function (instant) { 139 if (this.length) { 140 var $this = this, 141 o = getOptions($this); 142 if (!o) { 143 return this; 144 } 145 var not = (o.retainPath === true) ? o.$path : '', 146 $ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector), 147 speed = o.speedOut; 148 149 if (instant) { 150 $ul.show(); 151 speed = 0; 152 } 153 o.retainPath = false;
vendor: 2,962 bytes, lines 154-267
154 o.onBeforeHide.call($ul); 155 $ul.stop(true, true).animate(o.animationOut, speed, function () { 156 var $this = $(this); 157 o.onHide.call($this); 158 }); 159 } 160 return this; 161 }, 162 show: function () { 163 var o = getOptions(this); 164 if (!o) { 165 return this; 166 } 167 var $this = this.addClass(o.hoverClass), 168 $ul = $this.children(o.popUpSelector); 169 170 o.onBeforeShow.call($ul); 171 $ul.stop(true, true).animate(o.animation, o.speed, function () { 172 o.onShow.call($ul); 173 }); 174 return this; 175 }, 176 destroy: function () { 177 return this.each(function () { 178 var $this = $(this), 179 o = $this.data('sf-options'), 180 $hasPopUp; 181 if (!o) { 182 return false; 183 } 184 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 185 clearTimeout(o.sfTimer); 186 toggleMenuClasses($this, o); 187 toggleAnchorClass($hasPopUp); 188 toggleTouchAction($this); 189 // remove event handlers 190 $this.off('.superfish').off('.hoverIntent'); 191 // clear animation's inline display style 192 $hasPopUp.children(o.popUpSelector).attr('style', function (i, style) { 193 return style.replace(/display[^;]+;?/g, ''); 194 }); 195 // reset 'current' path classes 196 o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass); 197 $this.find('.' + o.hoverClass).removeClass(o.hoverClass); 198 o.onDestroy.call($this); 199 $this.removeData('sf-options'); 200 }); 201 }, 202 init: function (op) { 203 return this.each(function () { 204 var $this = $(this); 205 if ($this.data('sf-options')) { 206 return false; 207 } 208 var o = $.extend({}, $.fn.superfish.defaults, op), 209 $hasPopUp = $this.find(o.popUpSelector).parent('li'); 210 o.$path = setPathToCurrent($this, o); 211 212 $this.data('sf-options', o); 213 214 toggleMenuClasses($this, o); 215 toggleAnchorClass($hasPopUp); 216 toggleTouchAction($this); 217 applyHandlers($this, o); 218 219 $hasPopUp.not('.' + c.bcClass).superfish('hide', true); 220 221 o.onInit.call(this); 222 }); 223 } 224 }; 225 })(); 226 227 $.fn.superfish = function (method, args) { 228 if (methods[method]) { 229 return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); 230 } 231 else if (typeof method === 'object' || ! method) { 232 return methods.init.apply(this, arguments); 233 } 234 else { 235 return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish'); 236 } 237 }; 238 239 $.fn.superfish.defaults = { 240 popUpSelector: 'ul,.sf-mega', // within menu context 241 hoverClass: 'sfHover', 242 pathClass: 'overrideThisToUse', 243 pathLevels: 1, 244 delay: 60, 245 animation: {opacity: 'show'}, 246 animationOut: {opacity: 'hide'}, 247 speed: 'fast', 248 speedOut: 'fast', 249 cssArrows: true, 250 disableHI: false, 251 onInit: $.noop, 252 onBeforeShow: $.noop, 253 onShow: $.noop, 254 onBeforeHide: $.noop, 255 onHide: $.noop, 256 onIdle: $.noop, 257 onDestroy: $.noop 258 }; 259 260 // soon to be deprecated 261 $.fn.extend({ 262 hideSuperfishUl: methods.hide, 263 showSuperfishUl: methods.show 264 }); 265 266})(jQuery); 267}
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.