PageSourceSearch

https://cad-gis.ru/modules/mod_as_menu/js/script.js

js cad-gis.ru collected 2026-10-05 00:09:41 UTC 3,624 bytes, 120 lines download raw bytes

1
2/*
3 *
4 * Dual licensed under the MIT and GPL licenses:
5 * 	http://www.opensource.org/licenses/mit-license.php
6 * 	http://www.gnu.org/licenses/gpl.html
7 *
8 */
9
10;(function($){
11	$.fn.asmenu = function(op){
12
13		var as = $.fn.asmenu,
14			c = as.c,
15			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
16			over = function(){
17				var $$ = $(this), menu = getMenu($$);
18				clearTimeout(menu.asTimer);
19				$$.showasmenuUl().siblings().hideasmenuUl();
20			},
21			out = function(){
22				var $$ = $(this), menu = getMenu($$), o = as.op;
23				clearTimeout(menu.asTimer);
24				menu.asTimer=setTimeout(function(){
25					o.retainPath=($.inArray($$[0],o.$path)>-1);
26					$$.hideasmenuUl();
27					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
28				},o.delay);	
29			},
30			getMenu = function($menu){
31				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
32				as.op = as.o[menu.serial];
33				return menu;
34			},
35			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
36			
37		return this.each(function() {
38			var s = this.serial = as.o.length;
39			var o = $.extend({},as.defaults,op);
40			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
41				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
42					.filter('li:has(ul)').removeClass(o.pathClass);
43			});
44			as.o[s] = as.op = o;
45			
46			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
47				if (o.autoArrows) addArrow( $('>a:first-child',this) );
48			})
49			.not('.'+c.bcClass)
50				.hideasmenuUl();
51			
52			var $a = $('a',this);
53			$a.each(function(i){
54				var $li = $a.eq(i).parents('li');
55			});
56			o.onInit.call(this);
57			
58		}).each(function() {
59			var menuClasses = [c.menuClass];
60			if (as.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
61			$(this).addClass(menuClasses.join(' '));
62		});
63	};
64
65	var as = $.fn.asmenu;
66	as.o = [];
67	as.op = {};
68	as.IE7fix = function(){
69		var o = as.op;
70		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
71			this.toggleClass(as.c.shadowClass+'-off');
72		};
73	as.c = {
74		bcClass     : 'as-breadcrumb',
75		menuClass   : 'as-js-enabled',
76		anchorClass : 'as-with-ul',
77		arrowClass  : 'as-sub-indicator',
78		shadowClass : 'as-shadow'
79	};
80	as.defaults = {
81		hoverClass	: 'asHover',
82		pathClass	: 'overideThisToUse',
83		pathLevels	: 2,
84		delay		: 1000,
85		animation	: {opacity:'show', height:'show'},
86		speed		: 'normal',
87		autoArrows	: false,
88		dropShadows : false,
89		disableHI	: false,		// true disables hoverIntent detection
90		easing      : 'swing',
91		onInit		: function(){}, // callback functions
92		onBeforeShow: function(){},
93		onShow		: function(){},
94		onHide		: function(){}
95	};
96	$.fn.extend({
97		hideasmenuUl : function(){
98			var o = as.op,
99				not = (o.retainPath===true) ? o.$path : '';
100			o.retainPath = false;
101			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
102					.find('>ul').hide();
103			o.onHide.call($ul);
104			/*Cufon.refresh();*/
105			return this;
106		},
107		showasmenuUl : function(){
108			var o = as.op,
109				sh = as.c.shadowClass+'-off',
110				$ul = this.not('.accorChild').addClass(o.hoverClass)
111					.find('>ul:hidden');
112			as.IE7fix.call($ul);
113			o.onBeforeShow.call($ul);
114			$ul.animate(o.animation,o.speed,o.easing,function() 
115				{ as.IE7fix.call($ul); o.onShow.call($ul); }); 
116        return this; 
117		}
118	});
119
120})(jQuery);

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.