PageSourceSearch

https://www.1stonlinesolutions.com/assets/js/smoothscroll.js

js 1stonlinesolutions.com collected 2026-10-09 05:08:20 UTC 7,064 bytes, 261 lines download raw bytes

1/**
2 * SmoothScroll This helper script created by DWUser.com. Copyright 2012
3 * DWUser.com. Dual-licensed under the GPL and MIT licenses. All individual
4 * scripts remain property of their copyrighters. Date: 10-Sep-2012 Version:
5 * 1.0.1
6 */
7if (!window['jQuery'])
8	alert('The jQuery library must be included before the smoothscroll.js file.  The plugin will not work propery.');
9
10/**
11 * jQuery.ScrollTo - Easy element scrolling using jQuery. Copyright (c)
12 * 2007-2012 Ariel Flesler - aflesler(at)gmail(dot)com |
13 * http://flesler.blogspot.com Dual licensed under MIT and GPL.
14 * 
15 * @author Ariel Flesler
16 * @version 1.4.3.1
17 */
18;
19(function($) {
20	var h = $.scrollTo = function(a, b, c) {
21		$(window).scrollTo(a, b, c)
22	};
23	h.defaults = {
24		axis : 'xy',
25		duration : parseFloat($.fn.jquery) >= 1.3 ? 0 : 1,
26		limit : true
27	};
28	h.window = function(a) {
29		return $(window)._scrollable()
30	};
31	$.fn._scrollable = function() {
32		return this.map(function() {
33			var a = this, isWin = !a.nodeName
34					|| $.inArray(a.nodeName.toLowerCase(), [ 'iframe',
35							'#document', 'html', 'body' ]) != -1;
36			if (!isWin)
37				return a;
38			var b = (a.contentWindow || a).document || a.ownerDocument || a;
39			return /webkit/i.test(navigator.userAgent)
40					|| b.compatMode == 'BackCompat' ? b.body
41					: b.documentElement
42		})
43	};
44	$.fn.scrollTo = function(e, f, g) {
45		if (typeof f == 'object') {
46			g = f;
47			f = 0
48		}
49		if (typeof g == 'function')
50			g = {
51				onAfter : g
52			};
53		if (e == 'max')
54			e = 9e9;
55		g = $.extend({}, h.defaults, g);
56		f = f || g.duration;
57		g.queue = g.queue && g.axis.length > 1;
58		if (g.queue)
59			f /= 2;
60		g.offset = both(g.offset);
61		g.over = both(g.over);
62		return this
63				._scrollable()
64				.each(
65						function() {
66							if (e == null)
67								return;
68							var d = this, $elem = $(d), targ = e, toff, attr = {}, win = $elem
69									.is('html,body');
70							switch (typeof targ) {
71							case 'number':
72							case 'string':
73								if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
74									targ = both(targ);
75									break
76								}
77								targ = $(targ, this);
78								if (!targ.length)
79									return;
80							case 'object':
81								if (targ.is || targ.style)
82									toff = (targ = $(targ)).offset()
83							}
84							$
85									.each(
86											g.axis.split(''),
87											function(i, a) {
88												var b = a == 'x' ? 'Left'
89														: 'Top', pos = b
90														.toLowerCase(), key = 'scroll'
91														+ b, old = d[key], max = h
92														.max(d, a);
93												if (toff) {
94													attr[key] = toff[pos]
95															+ (win ? 0
96																	: old
97																			- $elem
98																					.offset()[pos]);
99													if (g.margin) {
100														attr[key] -= parseInt(targ
101																.css('margin'
102																		+ b)) || 0;
103														attr[key] -= parseInt(targ
104																.css('border'
105																		+ b
106																		+ 'Width')) || 0
107													}
108													attr[key] += g.offset[pos] || 0;
109													if (g.over[pos])
110														attr[key] += targ[a == 'x' ? 'width'
111																: 'height']()
112																* g.over[pos]
113												} else {
114													var c = targ[pos];
115													attr[key] = c.slice
116															&& c.slice(-1) == '%' ? parseFloat(c)
117															/ 100 * max
118															: c
119												}
120												if (g.limit
121														&& /^\d+$/
122																.test(attr[key]))
123													attr[key] = attr[key] <= 0 ? 0
124															: Math.min(
125																	attr[key],
126																	max);
127												if (!i && g.queue) {
128													if (old != attr[key])
129														animate(g.onAfterFirst);
130													delete attr[key]
131												}
132											});
133							animate(g.onAfter);
134							function animate(a) {
135								$elem.animate(attr, f, g.easing, a
136										&& function() {
137											a.call(this, e, g)
138										})
139							}
140						}).end()
141	};
142	h.max = function(a, b) {
143		var c = b == 'x' ? 'Width' : 'Height', scroll = 'scroll' + c;
144		if (!$(a).is('html,body'))
145			return a[scroll] - $(a)[c.toLowerCase()]();
146		var d = 'client' + c, html = a.ownerDocument.documentElement, body = a.ownerDocument.body;
147		return Math.max(html[scroll], body[scroll])
148				- Math.min(html[d], body[d])
149	};
150	function both(a) {
151		return typeof a == 'object' ? a : {
152			top : a,
153			left : a
154		}
155	}
156})(jQuery);
157
158/**
159 * jQuery.LocalScroll Copyright (c) 2007-2010 Ariel Flesler -
160 * aflesler(at)gmail(dot)com | http://flesler.blogspot.com Dual licensed under
161 * MIT and GPL. Date: 05/31/2010
162 * 
163 * @author Ariel Flesler
164 * @version 1.2.8b
165 */
166;
167(function(b) {
168	function g(a, e, d) {
169		var h = e.hash.slice(1), f = document.getElementById(h)
170				|| document.getElementsByName(h)[0];
171		if (f) {
172			a && a.preventDefault();
173			var c = b(d.target);
174			if (!(d.lock && c.is(":animated") || d.onBefore
175					&& !1 === d.onBefore(a, f, c))) {
176				d.stop && c._scrollable().stop(!0);
177				if (d.hash) {
178					var a = f.id == h ? "id" : "name", g = b("<a> </a>").attr(
179							a, h).css({
180						position : "absolute",
181						top : b(window).scrollTop(),
182						left : b(window).scrollLeft()
183					});
184					f[a] = "";
185					b("body").prepend(g);
186					location = e.hash;
187					g.remove();
188					f[a] = h
189				}
190				c.scrollTo(f, d).trigger("notify.serialScroll", [ f ])
191			}
192		}
193	}
194	var i = location.href.replace(/#.*/, ""), c = b.localScroll = function(a) {
195		b("body").localScroll(a)
196	};
197	c.defaults = {
198		duration : 1E3,
199		axis : "y",
200		event : "click",
201		stop : !0,
202		target : window,
203		reset : !0
204	};
205	c.hash = function(a) {
206		if (location.hash) {
207			a = b.extend({}, c.defaults, a);
208			a.hash = !1;
209			if (a.reset) {
210				var e = a.duration;
211				delete a.duration;
212				b(a.target).scrollTo(0, a);
213				a.duration = e
214			}
215			g(0, location, a)
216		}
217	};
218	b.fn.localScroll = function(a) {
219		function e() {
220			return !!this.href && !!this.hash
221					&& this.href.replace(this.hash, "") == i
222					&& (!a.filter || b(this).is(a.filter))
223		}
224		a = b.extend({}, c.defaults, a);
225		return a.lazy ? this.bind(a.event, function(d) {
226			var c = b([ d.target, d.target.parentNode ]).filter(e)[0];
227			c && g(d, c, a)
228		}) : this.find("a,area").filter(e).bind(a.event, function(b) {
229			g(b, this, a)
230		}).end().end()
231	}
232})(jQuery);
233
234
235(function($) {
236    $.fn.textfill = function(maxFontSize) {
237        maxFontSize = parseInt(maxFontSize, 10);
238        return this.each(function(){
239            var ourText = $("a", this),
240                parent = ourText.parent(),
241                maxHeight = parent.height(),
242                maxWidth = parent.width(),
243                fontSize = parseInt(ourText.css("fontSize"), 10),
244                multiplier = maxWidth/ourText.width(),
245                newSize = (fontSize*(multiplier-0.1));
246            ourText.css(
247                "fontSize", 
248                (maxFontSize > 0 && newSize > maxFontSize) ? 
249                    maxFontSize : 
250                    newSize
251            );
252        });
253    };
254})(jQuery);
255
256// Initialize all .smoothScroll links
257jQuery(function($) {
258	$.localScroll({
259		filter : '.smoothScroll'
260	});
261});

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.