PageSourceSearch

https://batana.org/js/fixerupper.js

js batana.org collected 2026-10-02 11:57:12 UTC 21,869 bytes, 240 lines download raw bytes

1
2/**
3 * jQuery.ScrollTo - Easy element scrolling using jQuery.
4 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
5 * Dual licensed under MIT and GPL.
6 * Date: 5/25/2009
7 * @author Ariel Flesler
8 * @version 1.4.2
9 *
10 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
11 */
12; (function (d) { var k = d.scrollTo = function (a, i, e) { d(window).scrollTo(a, i, e) }; k.defaults = { axis: 'xy', duration: parseFloat(d.fn.jquery) >= 1.3 ? 0 : 1 }; k.window = function (a) { return d(window)._scrollable() }; d.fn._scrollable = function () { return this.map(function () { var a = this, i = !a.nodeName || d.inArray(a.nodeName.toLowerCase(), ['iframe', '#document', 'html', 'body']) != -1; if (!i) return a; var e = (a.contentWindow || a).document || a.ownerDocument || a; return d.browser.safari || e.compatMode == 'BackCompat' ? e.body : e.documentElement }) }; d.fn.scrollTo = function (n, j, b) { if (typeof j == 'object') { b = j; j = 0 } if (typeof b == 'function') b = { onAfter: b }; if (n == 'max') n = 9e9; b = d.extend({}, k.defaults, b); j = j || b.speed || b.duration; b.queue = b.queue && b.axis.length > 1; if (b.queue) j /= 2; b.offset = p(b.offset); b.over = p(b.over); return this._scrollable().each(function () { var q = this, r = d(q), f = n, s, g = {}, u = r.is('html,body'); switch (typeof f) { case 'number': case 'string': if (/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)) { f = p(f); break } f = d(f, this); case 'object': if (f.is || f.style) s = (f = d(f)).offset() }d.each(b.axis.split(''), function (a, i) { var e = i == 'x' ? 'Left' : 'Top', h = e.toLowerCase(), c = 'scroll' + e, l = q[c], m = k.max(q, i); if (s) { g[c] = s[h] + (u ? 0 : l - r.offset()[h]); if (b.margin) { g[c] -= parseInt(f.css('margin' + e)) || 0; g[c] -= parseInt(f.css('border' + e + 'Width')) || 0 } g[c] += b.offset[h] || 0; if (b.over[h]) g[c] += f[i == 'x' ? 'width' : 'height']() * b.over[h] } else { var o = f[h]; g[c] = o.slice && o.slice(-1) == '%' ? parseFloat(o) / 100 * m : o } if (/^\d+$/.test(g[c])) g[c] = g[c] <= 0 ? 0 : Math.min(g[c], m); if (!a && b.queue) { if (l != g[c]) t(b.onAfterFirst); delete g[c] } }); t(b.onAfter); function t(a) { r.animate(g, j, b.easing, a && function () { a.call(this, n, b) }) } }).end() }; k.max = function (a, i) { var e = i == 'x' ? 'Width' : 'Height', h = 'scroll' + e; if (!d(a).is('html,body')) return a[h] - d(a)[e.toLowerCase()](); var c = 'client' + e, l = a.ownerDocument.documentElement, m = a.ownerDocument.body; return Math.max(l[h], m[h]) - Math.min(l[c], m[c]) }; function p(a) { return typeof a == 'object' ? a : { top: a, left: a } } })(jQuery);
13
14window.log = function () { log.history = log.history || []; log.history.push(arguments); if (this.console) { arguments.callee = arguments.callee.caller; var a = [].slice.call(arguments); (typeof console.log === "object" ? log.apply.call(console.log, console, a) : console.log.apply(console, a)) } };
15(function (b) { function c() { } for (var d = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","), a; a = d.pop();) { b[a] = b[a] || c } })((function () {
16    try
17    { console.log(); return window.console; } catch (err) { return window.console = {}; }
18})());
19
20
21
22/*!
23 * jQuery Tools v1.2.5 - The missing UI library for the Web
24 * 
25 * overlay/overlay.js
26 * overlay/overlay.apple.js
27 * scrollable/scrollable.js
28 * scrollable/scrollable.autoscroll.js
29 * scrollable/scrollable.navigator.js
30 * 
31 * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
32 * 
33 * http://flowplayer.org/tools/
34 * 
35 */
36(function (a) { a.tools = a.tools || { version: "v1.2.5" }, a.tools.overlay = { addEffect: function (a, b, d) { c[a] = [b, d] }, conf: { close: null, closeOnClick: !0, closeOnEsc: !0, closeSpeed: "fast", effect: "default", fixed: !a.browser.msie || a.browser.version > 6, left: "center", load: !1, mask: null, oneInstance: !0, speed: "normal", target: null, top: "10%" } }; var b = [], c = {}; a.tools.overlay.addEffect("default", function (b, c) { var d = this.getConf(), e = a(window);
36 d.fixed || (b.top += e.scrollTop(), b.left += e.scrollLeft()), b.position = d.fixed ? "fixed" : "absolute", this.getOverlay().css(b).fadeIn(d.speed, c) }, function (a) { this.getOverlay().fadeOut(this.getConf().closeSpeed, a) }); function d(d, e) { var f = this, g = d.add(f), h = a(window), i, j, k, l = a.tools.expose && (e.mask || e.expose), m = Math.random().toString().slice(10); l && (typeof l == "string" && (l = { color: l }), l.closeOnClick = l.closeOnEsc = !1); var n = e.target || d.attr("rel"); j = n ? a(n) : null || d; if (!j.length) throw "Could not find Overlay: " + n; d && d.index(j) == -1 && d.click(function (a) { f.load(a); return a.preventDefault() }), a.extend(f, { load: function (d) { if (f.isOpened()) return f; var i = c[e.effect]; if (!i) throw "Overlay: cannot find effect : \"" + e.effect + "\""; e.oneInstance && a.each(b, function () { this.close(d) }), d = d || a.Event(), d.type = "onBeforeLoad", g.trigger(d); if (d.isDefaultPrevented()) return f; k = !0, l && a(j).expose(l); var n = e.top, o = e.left, p = j.outerWidth({ margin: !0 }), q = j.outerHeight({ margin: !0 }); typeof n == "string" && (n = n == "center" ? Math.max((h.height() - q) / 2, 0) : parseInt(n, 10) / 100 * h.height()), o == "center" && (o = Math.max((h.width() - p) / 2, 0)), i[0].call(f, { top: n, left: o }, function () { k && (d.type = "onLoad", g.trigger(d)) }), l && e.closeOnClick && a.mask.getMask().one("click", f.close), e.closeOnClick && a(document).bind("click." + m, function (b) { a(b.target).parents(j).length || f.close(b) }), e.closeOnEsc && a(document).bind("keydown." + m, function (a) { a.keyCode == 27 && f.close(a) }); return f }, close: function (b) { if (!f.isOpened()) return f; b = b || a.Event(), b.type = "onBeforeClose", g.trigger(b); if (!b.isDefaultPrevented()) { k = !1, c[e.effect][1].call(f, function () { b.type = "onClose", g.trigger(b) }), a(document).unbind("click." + m).unbind("keydown." + m), l && a.mask.close(); return f } }, getOverlay: function () { return j }, getTrigger: function () { return d }, getClosers: function () { return i }, isOpened: function () { return k }, getConf: function () { return e } }), a.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","), function (b, c) { a.isFunction(e[c]) && a(f).bind(c, e[c]), f[c] = function (b) { b && a(f).bind(c, b); return f } }), i = j.find(e.close || ".close"), !i.length && !e.close && (i = a("<a class=\"close\"></a>"), j.prepend(i)), i.click(function (a) { f.close(a) }), e.load && f.load() } a.fn.overlay = function (c) { var e = this.data("overlay"); if (e) return e; a.isFunction(c) && (c = { onBeforeLoad: c }), c = a.extend(!0, {}, a.tools.overlay.conf, c), this.each(function () { e = new d(a(this), c), b.push(e), a(this).data("overlay", e) }); return c.api ? e : this } })(jQuery);
37(function (a) { var b = a.tools.overlay, c = a(window); a.extend(b.conf, { start: { top: null, left: null }, fadeInSpeed: "fast", zIndex: 9999 }); function d(a) { var b = a.offset(); return { top: b.top + a.height() / 2, left: b.left + a.width() / 2 } } var e = function (b, e) { var f = this.getOverlay(), g = this.getConf(), h = this.getTrigger(), i = this, j = f.outerWidth({ margin: !0 }), k = f.data("img"), l = g.fixed ? "fixed" : "absolute"; if (!k) { var m = f.css("backgroundImage"); if (!m) throw "background-image CSS property not set for overlay"; m = m.slice(m.indexOf("(") + 1, m.indexOf(")")).replace(/\"/g, ""), f.css("backgroundImage", "none"), k = a("<img src=\"" + m + "\"/>"), k.css({ border: 0, display: "none" }).width(j), a("body").append(k), f.data("img", k) } var n = g.start.top || Math.round(c.height() / 2), o = g.start.left || Math.round(c.width() / 2); if (h) { var p = d(h); n = p.top, o = p.left } g.fixed ? (n -= c.scrollTop(), o -= c.scrollLeft()) : (b.top += c.scrollTop(), b.left += c.scrollLeft()), k.css({ position: "absolute", top: n, left: o, width: 0, zIndex: g.zIndex }).show(), b.position = l, f.css(b), k.animate({ top: f.css("top"), left: f.css("left"), width: j }, g.speed, function () { f.css("zIndex", g.zIndex + 1).fadeIn(g.fadeInSpeed, function () { i.isOpened() && !a(this).index(f) ? e.call() : f.hide() }) }).css("position", l) }, f = function (b) { var e = this.getOverlay().hide(), f = this.getConf(), g = this.getTrigger(), h = e.data("img"), i = { top: f.start.top, left: f.start.left, width: 0 }; g && a.extend(i, d(g)), f.fixed && h.css({ position: "absolute" }).animate({ top: "+=" + c.scrollTop(), left: "+=" + c.scrollLeft() }, 0), h.animate(i, f.closeSpeed, b) }; b.addEffect("apple", e, f) })(jQuery);
38(function (a) { a.tools = a.tools || { version: "v1.2.5" }, a.tools.scrollable = { conf: { activeClass: "active", circular: !1, clonedClass: "cloned", disabledClass: "disabled", easing: "swing", initialIndex: 0, item: null, items: ".items", keyboard: !0, mousewheel: !1, next: ".next", prev: ".prev", speed: 400, vertical: !1, touch: !0, wheelSpeed: 0 } }; function b(a, b) { var c = parseInt(a.css(b), 10); if (c) return c; var d = a[0].currentStyle; return d && d.width && parseInt(d.width, 10) } function c(b, c) { var d = a(c); return d.length < 2 ? d : b.parent().find(c) } var d; function e(b, e) { var f = this, g = b.add(f), h = b.children(), i = 0, j = e.vertical; d || (d = f), h.length > 1 && (h = a(e.items, b)), a.extend(f, { getConf: function () { return e }, getIndex: function () { return i }, getSize: function () { return f.getItems().size() }, getNaviButtons: function () { return m.add(n) }, getRoot: function () { return b }, getItemWrap: function () { return h }, getItems: function () { return h.children(e.item).not("." + e.clonedClass) }, move: function (a, b) { return f.seekTo(i + a, b) }, next: function (a) { return f.move(1, a) }, prev: function (a) { return f.move(-1, a) }, begin: function (a) { return f.seekTo(0, a) }, end: function (a) { return f.seekTo(f.getSize() - 1, a) }, focus: function () { d = f; return f }, addItem: function (b) { b = a(b), e.circular ? (h.children("." + e.clonedClass + ":last").before(b), h.children("." + e.clonedClass + ":first").replaceWith(b.clone().addClass(e.clonedClass))) : h.append(b), g.trigger("onAddItem", [b]); return f }, seekTo: function (b, c, k) { b.jquery || (b *= 1);
38 if (e.circular && b === 0 && i == -1 && c !== 0) return f; if (!e.circular && b < 0 || b > f.getSize() || b < -1) return f; var l = b; b.jquery ? b = f.getItems().index(b) : l = f.getItems().eq(b); var m = a.Event("onBeforeSeek"); if (!k) { g.trigger(m, [b, c]); if (m.isDefaultPrevented() || !l.length) return f } var n = j ? { top: -l.position().top } : { left: -l.position().left }; i = b, d = f, c === undefined && (c = e.speed), h.animate(n, c, e.easing, k || function () { g.trigger("onSeek", [b]) }); return f } }), a.each(["onBeforeSeek", "onSeek", "onAddItem"], function (b, c) { a.isFunction(e[c]) && a(f).bind(c, e[c]), f[c] = function (b) { b && a(f).bind(c, b); return f } }); if (e.circular) { var k = f.getItems().slice(-1).clone().prependTo(h), l = f.getItems().eq(1).clone().appendTo(h); k.add(l).addClass(e.clonedClass), f.onBeforeSeek(function (a, b, c) { if (!a.isDefaultPrevented()) { if (b == -1) { f.seekTo(k, c, function () { f.end(0) }); return a.preventDefault() } b == f.getSize() && f.seekTo(l, c, function () { f.begin(0) }) } }), f.seekTo(0, 0, function () { }) } var m = c(b, e.prev).click(function () { f.prev() }), n = c(b, e.next).click(function () { f.next() }); !e.circular && f.getSize() > 1 && (f.onBeforeSeek(function (a, b) { setTimeout(function () { a.isDefaultPrevented() || (m.toggleClass(e.disabledClass, b <= 0), n.toggleClass(e.disabledClass, b >= f.getSize() - 1)) }, 1) }), e.initialIndex || m.addClass(e.disabledClass)), e.mousewheel && a.fn.mousewheel && b.mousewheel(function (a, b) { if (e.mousewheel) { f.move(b < 0 ? 1 : -1, e.wheelSpeed || 50); return !1 } }); if (e.touch) { var o = {}; h[0].ontouchstart = function (a) { var b = a.touches[0]; o.x = b.clientX, o.y = b.clientY }, h[0].ontouchmove = function (a) { if (a.touches.length == 1 && !h.is(":animated")) { var b = a.touches[0], c = o.x - b.clientX, d = o.y - b.clientY; f[j && d > 0 || !j && c > 0 ? "next" : "prev"](), a.preventDefault() } } } e.keyboard && a(document).bind("keydown.scrollable", function (b) { if (e.keyboard && !b.altKey && !b.ctrlKey && !a(b.target).is(":input")) { if (e.keyboard != "static" && d != f) return; var c = b.keyCode; if (j && (c == 38 || c == 40)) { f.move(c == 38 ? -1 : 1); return b.preventDefault() } if (!j && (c == 37 || c == 39)) { f.move(c == 37 ? -1 : 1); return b.preventDefault() } } }), e.initialIndex && f.seekTo(e.initialIndex, 0, function () { }) } a.fn.scrollable = function (b) { var c = this.data("scrollable"); if (c) return c; b = a.extend({}, a.tools.scrollable.conf, b), this.each(function () { c = new e(a(this), b), a(this).data("scrollable", c) }); return b.api ? c : this } })(jQuery);
39(function (a) { var b = a.tools.scrollable; b.autoscroll = { conf: { autoplay: !0, interval: 3e3, autopause: !0 } }, a.fn.autoscroll = function (c) { typeof c == "number" && (c = { interval: c }); var d = a.extend({}, b.autoscroll.conf, c), e; this.each(function () { var b = a(this).data("scrollable"); b && (e = b); var c, f = !0; b.play = function () { c || (f = !1, c = setInterval(function () { b.next() }, d.interval)) }, b.pause = function () { c = clearInterval(c) }, b.stop = function () { b.pause(), f = !0 }, d.autopause && b.getRoot().add(b.getNaviButtons()).hover(b.pause, b.play), d.autoplay && b.play() }); return d.api ? e : this } })(jQuery);
40(function (a) { var b = a.tools.scrollable; b.navigator = { conf: { navi: ".navi", naviItem: null, activeClass: "active", indexed: !1, idPrefix: null, history: !1 } }; function c(b, c) { var d = a(c); return d.length < 2 ? d : b.parent().find(c) } a.fn.navigator = function (d) { typeof d == "string" && (d = { navi: d }), d = a.extend({}, b.navigator.conf, d); var e; this.each(function () { var b = a(this).data("scrollable"), f = d.navi.jquery ? d.navi : c(b.getRoot(), d.navi), g = b.getNaviButtons(), h = d.activeClass, i = d.history && a.fn.history; b && (e = b), b.getNaviButtons = function () { return g.add(f) }; function j(a, c, d) { b.seekTo(c); if (i) location.hash && (location.hash = a.attr("href").replace("#", "")); else return d.preventDefault() } function k() { return f.find(d.naviItem || "> *") } function l(b) { var c = a("<" + (d.naviItem || "a") + "/>").click(function (c) { j(a(this), b, c) }).attr("href", "#" + b); b === 0 && c.addClass(h), d.indexed && c.text(b + 1), d.idPrefix && c.attr("id", d.idPrefix + b); return c.appendTo(f) } k().length ? k().each(function (b) { a(this).click(function (c) { j(a(this), b, c) }) }) : a.each(b.getItems(), function (a) { l(a) }), b.onBeforeSeek(function (a, b) { setTimeout(function () { if (!a.isDefaultPrevented()) { var c = k().eq(b); !a.isDefaultPrevented() && c.length && k().removeClass(h).eq(b).addClass(h) } }, 1) }); function m(a, b) { var c = k().eq(b.replace("#", "")); c.length || (c = k().filter("[href=" + b + "]")), c.click() } b.onAddItem(function (a, c) { c = l(b.getItems().index(c)), i && c.history(m) }), i && k().history(m) }); return d.api ? e : this } })(jQuery);
41
42
43
44window.log = function () { log.history = log.history || []; log.history.push(arguments); if (this.console) { arguments.callee = arguments.callee.caller; var a = [].slice.call(arguments); (typeof console.log === "object" ? log.apply.call(console.log, console, a) : console.log.apply(console, a)) } };
45(function (b) { function c() { } for (var d = "assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","), a; a = d.pop();) { b[a] = b[a] || c } })((function () {
46    try
47    { console.log(); return window.console; } catch (err) { return window.console = {}; }
48})());
49
50
51/*jQuery selectbox */
52jQuery.fn.extend({
53    selectbox: function (options) {
54        return this.each(function () {
55            new jQuery.SelectBox(this, options);
56        });
57    }
58});
59
60
61/* pawel maziarz: work around for ie logging */
62if (!window.console) {
63    var console = {
64        log: function (msg) {
65        }
66    }
67}
68/* */
69
70jQuery.SelectBox = function (selectobj, options) {
71
72    var opt = options || {};
73    opt.inputClass = opt.inputClass || "selectbox";
74    opt.containerClass = opt.containerClass || "selectbox-wrapper";
75    opt.hoverClass = opt.hoverClass || "current";
76    opt.currentClass = opt.selectedClass || "selected"
77    opt.debug = opt.debug || false;
78
79    var elm_id = selectobj.id;
80    var active = -1;
81    var inFocus = false;
82    var hasfocus = 0;
83    //jquery object for select element
84    var $select = $(selectobj);
85    // jquery container object
86    var $container = setupContainer(opt);
87    //jquery input object 
88    var $input = setupInput(opt);
89    // hide select and append newly created elements
90    $select.hide().before($input).before($container);
91
92
93    init();
94
95    $input
96        .click(function () {
97            if (!inFocus) {
98                $container.toggle();
99            }
100        })
101        .focus(function () {
102            if ($container.not(':visible')) {
103                inFocus = true;
104                $container.show();
105            }
106        })
107        .keydown(function (event) {
108            switch (event.keyCode) {
109                case 38: // up
110                    event.preventDefault();
111                    moveSelect(-1);
112                    break;
113                case 40: // down
114                    event.preventDefault();
115                    moveSelect(1);
116                    break;
117                //case 9:  // tab 
118                case 13: // return
119                    event.preventDefault(); // seems not working in mac !
120                    $('li.' + opt.hoverClass).trigger('click');
121                    break;
122                case 27: //escape
123                    hideMe();
124                    break;
125            }
126        })
127        .blur(function () {
128            if ($container.is(':visible') && hasfocus > 0) {
129                if (opt.debug) console.log('container visible and has focus')
130            } else {
131                hideMe();
132            }
133        });
134
135
136    function hideMe() {
137        hasfocus = 0;
138        $container.hide();
139    }
140
141    function init() {
142        $container.append(getSelectOptions($input.attr('id'))).hide();
143        var width = $input.css('width');
144        $container.width(width);
145    }
146
147    function setupContainer(options) {
148        var container = document.createElement("div");
149        $container = $(container);
150        $container.attr('id', elm_id + '_container');
151        $container.addClass(options.containerClass);
152
153        return $container;
154    }
155
156    function setupInput(options) {
157        var input = document.createElement("input");
158        var $input = $(input);
159        $input.attr("id", elm_id + "_input");
160        $input.attr("type", "text");
161        $input.addClass(options.inputClass);
162        $input.attr("autocomplete", "off");
163        $input.attr("readonly", "readonly");
164        $input.attr("tabIndex", $select.attr("tabindex")); // "I" capital is important for ie
165
166        return $input;
167    }
168
169    function moveSelect(step) {
170        var lis = $("li", $container);
171        if (!lis) return;
172
173        active += step;
174
175        if (active < 0) {
176            active = 0;
177        } else if (active >= lis.size()) {
178            active = lis.size() - 1;
179        }
180
181        lis.removeClass(opt.hoverClass);
182
183        $(lis[active]).addClass(opt.hoverClass);
184    }
185
186    function setCurrent() {
187        var li = $("li." + opt.currentClass, $container).get(0);
188        var ar = ('' + li.id).split('_');
189        var el = ar[ar.length - 1];
190        $select.val(el);
191        $input.val($(li).html());
192        return true;
193    }
194
195    // select value
196    function getCurrentSelected() {
197        return $select.val();
198    }
199
200    // input value
201    function getCurrentValue() {
202        return $input.val();
203    }
204
205    function getSelectOptions(parentid) {
206        var select_options = new Array();
207        var ul = document.createElement('ul');
208        $select.children('option').each(function () {
209            var li = document.createElement('li');
210            li.setAttribute('id', parentid + '_' + $(this).val());
211            li.innerHTML = $(this).html();
212            if ($(this).is(':selected')) {
213                $input.val($(this).html());
214                $(li).addClass(opt.currentClass);
215            }
216            ul.appendChild(li);
217            $(li)
218                .mouseover(function (event) {
219                    hasfocus = 1;
220                    if (opt.debug) console.log('over on : ' + this.id);
221                    jQuery(event.target, $container).addClass(opt.hoverClass);
222                })
223                .mouseout(function (event) {
224                    hasfocus = -1;
225                    if (opt.debug) console.log('out on : ' + this.id);
226                    jQuery(event.target, $container).removeClass(opt.hoverClass);
227                })
228                .click(function (event) {
229                    var fl = $('li.' + opt.hoverClass, $container).get(0);
230                    if (opt.debug) console.log('click on :' + this.id);
231                    $('li.' + opt.currentClass).removeClass(opt.currentClass);
232                    $(this).addClass(opt.currentClass);
233                    setCurrent();
234                    hideMe();
235                });
236        });
237        return ul;
238    }
239
240};

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.