source: trunk/prototype/plugins/jquery.autoscroll/jquery.aautoscroll.min.2.41.js @ 7751

Revision 7751, 5.5 KB checked in by gustavo, 11 years ago (diff)

Ticket #3293 - Problemas com scroll na listagem de pastas do expressoMail

  • Property svn:executable set to *
Line 
1(function (a) { var b = "$autoscroll", c = "$tAutoscroll", d = "$autoscrollInterval", e = "$edgeAutoscroll", f = "$lastEdgeAutoscroll", g = { up: 90, left: 180, right: 360, upleft: 135, upright: 45, downleft: 225, downright: 315, leftup: 135, rightup: 45, leftdown: 225, rightdown: 315, down: 270 }, h = { init: function (c) { return this.each(function () { if (k(this)) a(this).data(b, n(a.extend(k(this), c))); else { a(this).data(b, n(a.extend({ e: false, fr: false }, a.fn.autoscroll.defaults.settings, c))); a(this).hover(function () { var b = k(this); if (b) { if (b.scroll && b.pauseOnHover) { j(this); a(this).stop(true) } b.e = true } }, function () { var a = k(this); if (a && a.e) { if (a.scroll && a.pauseOnHover) i(this); a.e = false } }); i(this) } }) }, destroy: function () { return this.each(function () { if (k(this)) { j(this); a(this).stop(true).data(d, null).data(b, null).data(c, null) } }) }, delay: function (c) { return this.each(function () { var d = k(this); if (d && d.scroll) { a(this).autoscroll("pause"); a(this).oneTime(c || a.fn.autoscroll.defaults.delay, b, function () { a(this).autoscroll("resume") }) } }) }, fastforward: function (a) { return m(this, "f", a) }, rewind: function (a) { return m(this, "r", a) }, pause: function () { return this.each(function () { var b = k(this); if (b && b.scroll) { b.scroll = false; a(this).stop(true); j(this) } }) }, resume: function () { return this.each(function () { var a = k(this); if (a) { a.scroll = true; i(this) } }) }, reverse: function () { return this.each(function () { var b = k(this); if (b && (b.direction += 180) > 360) b.direction -= 360; a(this).stop(true) }) }, toggle: function () { return this.each(function () { var b = k(this); if (b) if (b.scroll) a(this).autoscroll("pause"); else a(this).autoscroll("resume") }) }, get: function () { return this.each(function () { if (k(this)) return k(this) }) }, addpausesource: function (b) { if (typeof b == "undefined") return this; if (!(b instanceof jQuery)) if ((b = a(b)).length == 0) return this; var c = this.selector; b.each(function () { a(this).hover(function () { a(c).each(function () { var b = k(this); if (b) { if (b.scroll && b.pauseOnHover) { j(this); a(this).stop(true) } b.e = true } }) }, function () { a(c).each(function () { var a = k(this); if (a && a.e) { if (a.scroll && a.pauseOnHover) i(this); a.e = false } }) }) }); return this } }, i = function (b) { a(b).data(d, setInterval(function () { var d, e = k(b); if (e) { if (typeof e.onEvaluate == "function") e.onEvaluate.apply(b); if (!r(b)) { if (e.scroll && !e.e && !e.fr) { if ((d = a(b).data(c)) && !l(d, e)) a(b).stop(true).animate(q(e.step, e.direction, b), 1e3, "linear"); else a(b).animate(q(e.step, e.direction), 1e3, "linear") } } a(b).data(c, a.extend(true, {}, e)) } }, 50)) }, j = function (b) { clearInterval(a(b).data(d)) }, k = function (c) { return a(c).data(b) }, l = function (a, b) { return a.step === b.step && a.direction === b.direction && a.scroll === b.scroll }, m = function (b, c, d) { var e = n(a.extend(a.fn.autoscroll.defaults.ffrw, d)); return b.each(function () { var b = k(this); if (b) { var d = b.scroll, f = b.direction; b.fr = true; if (c == "r" && (f += 180) > 360) f -= 360; if (b.scroll) j(this); a(this).stop(true).animate(q(e.step, f), e.speed, "swing", function () { k(this).fr = false; if (b.scroll) i(this) }) } }) }, n = function (b) { if (a.inArray(typeof b.scroll, ["undefined", "boolean"]) < 0) a.error("scroll is not a boolean"); if (a.inArray(typeof b.step, ["undefined", "number"]) < 0 && isNaN(b.step = Number(b.step))) a.error("step is not a valid number"); if (b.direction) b.direction = p(b.direction); return b }, o = function (a) { return a * Math.PI / 180 }, p = function (b) { if (typeof b === "string" && isNaN(Number(b))) if (g[b]) b = g[b]; else if (b.indexOf("rad") == b.length - 3 && !isNaN(b = Number(b.substring(0, b.length - 3)))) b = b * 180 / Math.PI; if (isNaN(b = Number(b))) a.error("Invalid direction on jQuery.autoscroll"); while (b < 0) b += 360; return b }, q = function (b, c) { var d = Math.round(b * Math.cos(c = o(c))), e = Math.round(b * Math.sin(c)) * -1, f = arguments[2]; return f && a(f).length > 0 ? { scrollTop: f.scrollTop + e, scrollLeft: f.scrollLeft + d} : { scrollTop: (e < 0 ? "-=" : "+=") + Math.abs(e), scrollLeft: (d < 0 ? "-=" : "+=") + Math.abs(d)} }, r = function (b) { var c = k(b); if (c && typeof c.onEdge == "function") { var d = a(b).data(e) || { x: null, y: null }, g = c.step, h = b.scrollLeft, i = o(c.direction), j = Math.round(g * Math.cos(i)), l = h + j, m = b.scrollTop, n = Math.round(g * Math.sin(i)) * -1; nt = m + n, _e = a(b).data(f); if (h > l && h == 0) { if (!d.x || d.x != "left") d.x = "left" } else if (h < l && h == b.scrollWidth - b.clientWidth) { if (!d.x || d.x != "right") d.x = "right" } else d.x = null; if (m > nt && m == 0) { if (!d.y || d.y != "top") d.y = "top" } else if (m < nt && m == b.scrollHeight - b.clientHeight) { if (!d.y || d.y != "bottom") d.y = "bottom" } else d.y = null; try { if (!_e || d.x && d.x != _e.x || d.y && d.y != _e.y) { c.onEdge.apply(b, [d]); return true } } catch (p) { throw p } finally { a(b).data(f, a.extend(true, {}, d)).data(e, d) } } return false }; a.fn.autoscroll = function (b, c) { if (h[b]) return h[b].apply(this, Array.prototype.slice.call(arguments, 1)); else if (typeof b === "object" || !b) return h.init.apply(this, arguments); else a.error("Method " + b + " does not exist on jQuery.autoscroll") }; a.fn.autoscroll.defaults = { settings: { step: 50, scroll: true, direction: "down", pauseOnHover: true }, delay: 5e3, ffrw: { speed: "fast", step: 100}} })(jQuery)
Note: See TracBrowser for help on using the repository browser.