PageSourceSearch

https://masaveubodegas.com/wp-content/plugins/trx_addons/component…/menu/superfish.js?reload=1264214491

js masaveubodegas.com collected 2026-10-08 12:42:00 UTC 7,609 bytes, 277 lines download raw bytes

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

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.