PageSourceSearch

https://fileextension.info/js/jquery.tools.min.js

js fileextension.info collected 2026-10-02 04:13:37 UTC 13,946 bytes, 478 lines download raw bytes

1(function(c){function p(d,b,a){var e=this,l=d.add(this),h=d.find(a.tabs),i=b.jquery?b:d.children(b),j;h.length||(h=d.children());i.length||(i=d.parent().find(b));i.length||(i=c(b));c.extend(this,{click:function(f,g){var k=h.eq(f);if(typeof f=="string"&&f.replace("#","")){k=h.filter("[href*="+f.replace("#","")+"]");f=Math.max(h.index(k),0)}if(a.rotate){var n=h.length-1;if(f<0)return e.click(n,g);if(f>n)return e.click(0,g)}if(!k.length){if(j>=0)return e;f=a.initialIndex;k=h.eq(f)}if(f===j)return e;
2g=g||c.Event();g.type="onBeforeClick";l.trigger(g,[f]);if(!g.isDefaultPrevented()){o[a.effect].call(e,f,function(){g.type="onClick";l.trigger(g,[f])});j=f;h.removeClass(a.current);k.addClass(a.current);return e}},getConf:function(){return a},getTabs:function(){return h},getPanes:function(){return i},getCurrentPane:function(){return i.eq(j)},getCurrentTab:function(){return h.eq(j)},getIndex:function(){return j},next:function(){return e.click(j+1)},prev:function(){return e.click(j-1)},destroy:function(){h.unbind(a.event).removeClass(a.current);
3i.find("a[href^=#]").unbind("click.T");return e}});c.each("onBeforeClick,onClick".split(","),function(f,g){c.isFunction(a[g])&&c(e).bind(g,a[g]);e[g]=function(k){k&&c(e).bind(g,k);return e}});if(a.history&&c.fn.history){c.tools.history.init(h);a.event="history"}h.each(function(f){c(this).bind(a.event,function(g){e.click(f,g);return g.preventDefault()})});i.find("a[href^=#]").bind("click.T",function(f){e.click(c(this).attr("href"),f)});if(location.hash&&a.tabs=="a"&&d.find("[href="+location.hash+"]").length)e.click(location.hash);
4else if(a.initialIndex===0||a.initialIndex>0)e.click(a.initialIndex)}c.tools=c.tools||{version:"1.2.5"};c.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:false,history:false},addEffect:function(d,b){o[d]=b}};var o={"default":function(d,b){this.getPanes().hide().eq(d).show();b.call()},fade:function(d,b){var a=this.getConf(),e=a.fadeOutSpeed,l=this.getPanes();e?l.fadeOut(e):l.hide();l.eq(d).fadeIn(a.fadeInSpeed,b)},slide:function(d,
5b){this.getPanes().slideUp(200);this.getPanes().eq(d).slideDown(400,b)},ajax:function(d,b){this.getPanes().eq(0).load(this.getTabs().eq(d).attr("href"),b)}},m;c.tools.tabs.addEffect("horizontal",function(d,b){m||(m=this.getPanes().eq(0).width());this.getCurrentPane().animate({width:0},function(){c(this).hide()});this.getPanes().eq(d).animate({width:m},function(){c(this).show();b.call()})});c.fn.tabs=function(d,b){var a=this.data("tabs");if(a){a.destroy();this.removeData("tabs")}if(c.isFunction(b))b=
6{onBeforeClick:b};b=c.extend({},c.tools.tabs.conf,b);this.each(function(){a=new p(c(this),d,b);c(this).data("tabs",a)});return b.api?a:this}})(jQuery);
7
8/**
9 * @license 
10 * jQuery Tools 1.2.5 Rangeinput - HTML5 <input type="range" /> for humans
11 * 
12 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
13 * 
14 * http://flowplayer.org/tools/rangeinput/
15 *
16 * Since: Mar 2010
17 * Date:    Wed Sep 22 06:02:10 2010 +0000 
18 */
19(function($) {
20	 
21	$.tools = $.tools || {version: '1.2.5'};
22	 
23	var tool;
24	
25	tool = $.tools.rangeinput = {
26		                            
27		conf: {
28			min: 0,
29			max: 100,		// as defined in the standard
30			step: 'any', 	// granularity of the value. a non-zero float or int (or "any")
31			steps: 0,
32			value: 0,			
33			precision: undefined,
34			vertical: 0,
35			keyboard: true,
36			progress: false,
37			speed: 100,
38			
39			// set to null if not needed
40			css: {
41				input:		'range',
42				slider: 		'slider',
43				progress: 	'progress',
44				handle: 		'handle'					
45			}
46
47		} 
48	};
49	
50//{{{ fn.drag
51		
52	/* 
53		FULL featured drag and drop. 0.7 kb minified, 0.3 gzipped. done.
54		Who told d'n'd is rocket science? Usage:
55		
56		$(".myelement").drag({y: false}).bind("drag", function(event, x, y) {
57			// do your custom thing
58		});
59		 
60		Configuration: 
61			x: true, 		// enable horizontal drag
62			y: true, 		// enable vertical drag 
63			drag: true 		// true = perform drag, false = only fire events 
64			
65		Events: dragStart, drag, dragEnd. 
66	*/
67	var doc, draggable;
68	
69	$.fn.drag = function(conf) {
70		
71		// disable IE specialities
72		document.ondragstart = function () { return false; };
73		
74		conf = $.extend({x: true, y: true, drag: true}, conf);
75	
76		doc = doc || $(document).bind("mousedown mouseup", function(e) {
77				
78			var el = $(e.target);  
79			
80			// start 
81			if (e.type == "mousedown" && el.data("drag")) {
82				
83				var offset = el.position(),
84					 x0 = e.pageX - offset.left, 
85					 y0 = e.pageY - offset.top,
86					 start = true;    
87				
88				doc.bind("mousemove.drag", function(e) {  
89					var x = e.pageX -x0, 
90						 y = e.pageY -y0,
91						 props = {};
92					
93					if (conf.x) { props.left = x; }
94					if (conf.y) { props.top = y; } 
95					
96					if (start) {
97						el.trigger("dragStart");
98						start = false;
99					}
100					if (conf.drag) { el.css(props); }
101					el.trigger("drag", [y, x]);
102					draggable = el;
103				}); 
104				
105				e.preventDefault();
106				
107			} else {
108				
109				try {
110					if (draggable) {  
111						draggable.trigger("dragEnd");  
112					}
113				} finally { 
114					doc.unbind("mousemove.drag");
115					draggable = null; 
116				}
117			} 
118							
119		});
120		
121		return this.data("drag", true); 
122	};	
123
124//}}}
125	
126
127	
128	function round(value, precision) {
129		var n = Math.pow(10, precision);
130		return Math.round(value * n) / n;
131	}
132	
133	// get hidden element's width or height even though it's hidden
134	function dim(el, key) {
135		var v = parseInt(el.css(key), 10);
136		if (v) { return v; }
137		var s = el[0].currentStyle; 
138		return s && s.width && parseInt(s.width, 10);	
139	}
140	
141	function hasEvent(el) {
142		var e = el.data("events");
143		return e && e.onSlide;
144	}
145	
146	function RangeInput(input, conf) {
147		
148		// private variables
149		var self = this,  
150			 css = conf.css, 
151			 root = $("<div><div/><a href='#'/></div>").data("rangeinput", self),	
152			 vertical,		
153			 value,			// current value
154			 origo,			// handle's start point
155			 len,				// length of the range
156			 pos;				// current position of the handle		
157		 
158		// create range	 
159		input.before(root);	
160		
161		var handle = root.addClass(css.slider).find("a").addClass(css.handle), 	
162			 progress = root.find("div").addClass(css.progress);
163		
164		// get (HTML5) attributes into configuration
165		$.each("min,max,step,value".split(","), function(i, key) {
166			var val = input.attr(key);
167			if (parseFloat(val)) {
168				conf[key] = parseFloat(val, 10);
169			}
170		});			   
171		
172		var range = conf.max - conf.min, 
173			 step = conf.step == 'any' ? 0 : conf.step,
174			 precision = conf.precision;
175			 
176		if (precision === undefined) {
177			try {
178				precision = step.toString().split(".")[1].length;
179			} catch (err) {
180				precision = 0;	
181			}
182		}  
183		
184		// Replace built-in range input (type attribute cannot be changed)
185		if (input.attr("type") == 'range') {
186			var tmp = $("<input/>");
187			$.each("class,disabled,id,maxlength,name,readonly,required,size,style,tabindex,title,value".split(","), function(i, attr)  {
188				tmp.attr(attr, input.attr(attr));		
189			});
190			tmp.val(conf.value);
191			input.replaceWith(tmp);
192			input = tmp;
193		}
194		
195		input.addClass(css.input);
196			 
197		var fire = $(self).add(input), fireOnSlide = true;
198
199		
200		/**
201		 	The flesh and bone of this tool. All sliding is routed trough this.
202			
203			@param evt types include: click, keydown, blur and api (setValue call)
204			@param isSetValue when called trough setValue() call (keydown, blur, api)
205			
206			vertical configuration gives additional complexity. 
207		 */
208		function slide(evt, x, val, isSetValue) { 
209
210			// calculate value based on slide position
211			if (val === undefined) {
212				val = x / len * range;  
213				
214			// x is calculated based on val. we need to strip off min during calculation	
215			} else if (isSetValue) {
216				val -= conf.min;	
217			}
218			
219			// increment in steps
220			if (step) {
221				val = Math.round(val / step) * step;
222			}
223
224			// count x based on value or tweak x if stepping is done
225			if (x === undefined || step) {
226				x = val * len / range;	
227			}  
228			
229			// crazy value?
230			if (isNaN(val)) { return self; }       
231			
232			// stay within range
233			x = Math.max(0, Math.min(x, len));  
234			val = x / len * range;   
235
236			if (isSetValue || !vertical) {
237				val += conf.min;
238			}
239			
240			// in vertical ranges value rises upwards
241			if (vertical) {
242				if (isSetValue) {
243					x = len -x;
244				} else {
245					val = conf.max - val;	
246				}
247			}	
248			
249			// precision
250			val = round(val, precision); 
251			
252			// onSlide
253			var isClick = evt.type == "click";
254			if (fireOnSlide && value !== undefined && !isClick) {
255				evt.type = "onSlide";           
256				fire.trigger(evt, [val, x]); 
257				if (evt.isDefaultPrevented()) { return self; }  
258			}				
259			
260			// speed & callback
261			var speed = isClick ? conf.speed : 0,
262				 callback = isClick ? function()  {
263					evt.type = "change";
264					fire.trigger(evt, [val]);
265				 } : null;
266			
267			if (vertical) {
268				handle.animate({top: x}, speed, callback);
269				if (conf.progress) { 
270					progress.animate({height: len - x + handle.width() / 2}, speed);	
271				}				
272				
273			} else {
274				handle.animate({left: x}, speed, callback);
275				if (conf.progress) { 
276					progress.animate({width: x + handle.width() / 2}, speed); 
277				}
278			}
279			
280			// store current value
281			value = val; 
282			pos = x;			 
283			
284			// se input field's value
285			input.val(val);
286
287			return self;
288		} 
289		
290		
291		$.extend(self, {  
292			
293			getValue: function() {
294				return value;	
295			},
296			
297			setValue: function(val, e) {
298				init();
299				return slide(e || $.Event("api"), undefined, val, true); 
300			}, 			  
301			
302			getConf: function() {
303				return conf;	
304			},
305			
306			getProgress: function() {
307				return progress;	
308			},
309
310			getHandle: function() {
311				return handle;	
312			},			
313			
314			getInput: function() {
315				return input;	
316			}, 
317				
318			step: function(am, e) {
319				e = e || $.Event();
320				var step = conf.step == 'any' ? 1 : conf.step;
321				self.setValue(value + step * (am || 1), e);	
322			},
323			
324			// HTML5 compatible name
325			stepUp: function(am) { 
326				return self.step(am || 1);
327			},
328			
329			// HTML5 compatible name
330			stepDown: function(am) { 
331				return self.step(-am || -1);
332			}
333			
334		});
335		
336		// callbacks
337		$.each("onSlide,change".split(","), function(i, name) {
338				
339			// from configuration
340			if ($.isFunction(conf[name]))  {
341				$(self).bind(name, conf[name]);	
342			}
343			
344			// API methods
345			self[name] = function(fn) {
346				if (fn) { $(self).bind(name, fn); }
347				return self;	
348			};
349		}); 
350			
351
352		// dragging		                                  
353		handle.drag({drag: false}).bind("dragStart", function() {
354		
355			/* do some pre- calculations for seek() function. improves performance */			
356			init();
357			
358			// avoid redundant event triggering (= heavy stuff)
359			fireOnSlide = hasEvent($(self)) || hasEvent(input);
360			
361				
362		}).bind("drag", function(e, y, x) {        
363			
364			if (input.is(":disabled")) { return false; } 
365			slide(e, vertical ? y : x); 
366			
367		}).bind("dragEnd", function(e) {
368			if (!e.isDefaultPrevented()) {
369				e.type = "change";
370				fire.trigger(e, [value]);	 
371			}
372			
373		}).click(function(e) {
374			return e.preventDefault();	 
375		});		
376		
377		// clicking
378		root.click(function(e) { 
379			if (input.is(":disabled") || e.target == handle[0]) { 
380				return e.preventDefault(); 
381			}				  
382			init(); 
383			var fix = handle.width() / 2;   
384			slide(e, vertical ? len-origo-fix + e.pageY  : e.pageX -origo -fix);  
385		});
386
387		if (conf.keyboard) {
388			
389			input.keydown(function(e) {
390		
391				if (input.attr("readonly")) { return; }
392				
393				var key = e.keyCode,
394					 up = $([75, 76, 38, 33, 39]).index(key) != -1,
395					 down = $([74, 72, 40, 34, 37]).index(key) != -1;					 
396					 
397				if ((up || down) && !(e.shiftKey || e.altKey || e.ctrlKey)) {
398				
399					// UP: 	k=75, l=76, up=38, pageup=33, right=39			
400					if (up) {
401						self.step(key == 33 ? 10 : 1, e);
402						
403					// DOWN:	j=74, h=72, down=40, pagedown=34, left=37
404					} else if (down) {
405						self.step(key == 34 ? -10 : -1, e); 
406					} 
407					return e.preventDefault();
408				} 
409			});
410		}
411		
412		
413		input.blur(function(e) {	
414			var val = $(this).val();
415			if (val !== value) {
416				self.setValue(val, e);
417			}
418		});    
419		
420		
421		// HTML5 DOM methods
422		$.extend(input[0], { stepUp: self.stepUp, stepDown: self.stepDown});
423		
424		
425		// calculate all dimension related stuff
426		function init() { 
427		 	vertical = conf.vertical || dim(root, "height") > dim(root, "width");
428		 
429			if (vertical) {
430				len = dim(root, "height") - dim(handle, "height");
431				origo = root.offset().top + len; 
432				
433			} else {
434				len = dim(root, "width") - dim(handle, "width");
435				origo = root.offset().left;	  
436			} 	  
437		}
438		
439		function begin() {
440			init();	
441			self.setValue(conf.value !== undefined ? conf.value : conf.min);
442		} 
443		begin();
444		
445		// some browsers cannot get dimensions upon initialization
446		if (!len) {  
447			$(window).load(begin);
448		}
449	}
450	
451	$.expr[':'].range = function(el) {
452		var type = el.getAttribute("type");
453		return type && type == 'range' || !!$(el).filter("input").data("rangeinput");
454	};
455	
456	
457	// jQuery plugin implementation
458	$.fn.rangeinput = function(conf) {
459
460		// already installed
461		if (this.data("rangeinput")) { return this; } 
462		
463		// extend configuration with globals
464		conf = $.extend(true, {}, tool.conf, conf);		
465		
466		var els;
467		
468		this.each(function() {				
469			var el = new RangeInput($(this), $.extend(true, {}, conf));		 
470			var input = el.getInput().data("rangeinput", el);
471			els = els ? els.add(input) : input;	
472		});		
473		
474		return els ? els : this; 
475	};	
476	
477	
478}) (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.