/*! jsModern v1.1.1 | (c) Frank Chao | MIT license */ 'use strict'; ! function(b, f) { "function" === typeof define && define.amd ? define(["jquery"], f) : "object" === typeof module && "object" === typeof module.exports ? module.exports = f() : b.jsModern = f(b.jQuery) } ("undefined" !== typeof window ? window: this, function(b) { var f = window.document, D = navigator.userAgent.toLowerCase(), E = D.match(/(msie|trident)/); if (D.match(/msie (6|7|8)\.0/) || !Array.isArray || !f.addEventListener) throw Error("jsModern's JavaScript does not support of ie8- !!!"); var L = b.fn.jquery.split("."); // if(1===~~L[0]&&12>~~L[1])throw Error("jsModern's JavaScript requires at least jQuery v1.12.0 !!!"); b.easing.easeInOutQuart = function(b, a, c, m, e) { return 1 > (a /= e / 2) ? m / 2 * a * a * a * a + c: -m / 2 * ((a -= 2) * a * a * a - 2) + c }; return window.jsModern = { time: function(d, a) { if (0 === arguments.length) return b.now(); a = a || "-"; d = new Date(d); var c = { yy: d.getFullYear(), mm: d.getMonth() + 1, dd: d.getDate(), h: d.getHours(), m: d.getMinutes(), s: d.getSeconds() }, m; for (m in c) { var e = c[m]; c[m] = 10 > e ? "0" + e: e } return c.yy + a + c.mm + a + c.dd + " " + c.h + ":" + c.m + ":" + c.s }, top: function(d, a) { a = b.isNumeric(a) ? ~~a: 300; var c = b(f.querySelector(d)); if (c.is(":hidden")) b(window).on("scroll", function() { var a = b(window).scrollTop(); 200 < a && c.stop().fadeIn(100); 0 === a && c.stop().fadeOut(100) }); c.click(function() { b("html, body").stop().animate({ scrollTop: 0 }, a) }); return this }, textBind: function(d, a) { function c(c) { b(a).each(function() { var a = b(this); a[0].nodeName.toLowerCase().match(/(input|textarea)/) ? a.val(c) : a.html(c) }) } b(d).each(function() { var a = b(this); a.on("input propertychange", function() { c(b(this).val()) }); D.match("msie 9.0") && setInterval(function() { c(a.val()) }, 13) }); return this }, share: function(d) { var a = encodeURIComponent(location.href), c = f.title; b(f).on("click", function(m) { m = m || window.event; m = b(m.target); var e = D.match("firefox"); if (m.is(d.qrcode)) { // q.id = "jquery-qrcode-js"; f.querySelector(".jsmodern-share") || b("body").append('\x3csection class\x3d"jsmodern-share"\x3e\x3cb\x3e\x3c/b\x3e\x3cp\x3e' + decodeURI("%E6%89%AB%E4%B8%80%E6%89%AB%E5%88%86%E4%BA%AB") + '\x3c/p\x3e\x3cdiv id\x3d"jsmodern-share-qrcode"\x3e\x3c/div\x3e\x3c/section\x3e'); var c = b(f.getElementById("jsmodern-share-qrcode")); c.find("canvas").length || c.qrcode({ render: "canvas", text: decodeURIComponent(a), width: c.width(), height: c.height() }); c.siblings("b").click(function() { b(this).parent().add(b(f.getElementById("jquery-qrcode-js"))).remove() }) } m.is(d.qzone) && window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url\x3d" + a + "\x26title\x3d" + c); m.is(d.sina) && function(b, d, g) { function m() { window.open(["http://v.t.sina.com.cn/share/share.php?", f].join(""), "mb") || (h.href = ["http://v.t.sina.com.cn/share/share.php?", f].join("")) } var h = d.location.href, f = ["url\x3d", g(h), "\x26title\x3d", g(c), "\x26appkey\x3d2924220432\x26pic\x3d", g(a)].join(""); e ? setTimeout(m, 0) : m() } (screen, f, encodeURIComponent); m.is(d.douban) && function() { var b = encodeURIComponent, d = window.getSelection, g = f.getSelection, m = f.selection, d = d ? d() : g ? g() : m ? m.createRange().text: "", h = "https://www.douban.com/recommend/?url\x3d" + b(a) + "\x26title\x3d" + b(c) + "\x26sel\x3d" + b(d) + "\x26v\x3d1", b = function() { window.open(h, "douban") || (location.href = h + "\x26r\x3d1") }; e ? setTimeout(b, 0) : b() } (); m.is(d.qq) && window.open("http://connect.qq.com/widget/shareqq/index.html?url\x3d" + a + "\x26title\x3d" + c + "\x26desc\x3d" + c) }); return this }, marquee: function(d) { var a = 1E3 / 60; b(d).each(function() { var c = b(this), d = c.children(), e = 0; d.addClass("jsmodern-marquee-part").each(function() { e += b(this).outerWidth(!0) }); if (e > c.width()) { c.addClass("jsmodern-marquee"); d.wrapAll('\x3csection class\x3d"jsmodern-marquee-inner"\x3e\x3csection class\x3d"jsmodern-marquee-default"\x3e\x3c/section\x3e\x3c/section\x3e').parent().width(e); var d = c.find(".jsmodern-marquee-inner"), f = c.find(".jsmodern-marquee-default"); f.after(f.clone(!0)).next().attr("class", "jsmodern-marquee-repeat"); d.width(2 * e); var n = function() { c.scrollLeft(c.scrollLeft() > f.width() ? 0 : c.scrollLeft() + 1) }, p = setInterval(n, a); c.hover(function() { clearInterval(p) }, function() { p = setInterval(n, a) }) } }); return this }, picture: function(d, a) { b(d).each(function() { function c(a) { "fade" === g && (a = -1 == a ? w - 1 : a == w ? 0 : a, t.eq(a).stop().fadeIn(700).siblings().stop().fadeOut(700, function() { d(a); e.data("cacheIndex", a) })); "slide" === g && (u.is(":animated") || u.stop().animate({ left: -(n * a + n) + "px" }, 700, "easeInOutQuart", function() { - 1 === a && (u.css("left", "-" + n * w + "px"), a = w - 1); a === w && (u.css("left", "-" + n + "px"), a = 0); d(a); e.data("cacheIndex", a); f.removeClass("jsmodern-picture-pointerevents-none") })) } function d(a) { y.eq(a).addClass("active").siblings().removeClass("active") } var e = b(this), f = e.find("a"), n = e.width(), p = e.height(), g = "slide", k = !0, h = !0, r = !1; a && (g = a.type || "slide", k = a.arrow, h = a.dot, r = a.autoplay); e.addClass("jsmodern-picture-container").children().first().addClass("jsmodern-picture-inner").children().addClass("jsmodern-picture-part"); e.on("selectstart", function() { return ! 1 }).data("cacheIndex", 0); var u = e.find(".jsmodern-picture-inner"), t = e.find(".jsmodern-picture-part"), l = e.find("img, a"), w = u.find("img").length; t.add(l).width(n).height(p); p = ""; for (l = 0; l < w; l++) p += "\x3cb\x3e\x3c/b\x3e"; u.after("\x3cdiv class\x3d'jsmodern-picture-dot'\x3e" + p + "\x3c/div\x3e"); var x = e.find(".jsmodern-picture-dot"), y = x.find("b"); y.first().addClass("active"); e.append("\x3cb class\x3d'jsmodern-picture-prev'\x3e\x3c/b\x3e\x3cb class\x3d'jsmodern-picture-next'\x3e\x3c/b\x3e"); p = e.find(".jsmodern-picture-prev"); l = e.find(".jsmodern-picture-next"); "boolean" !== typeof k || k || p.add(l).remove(); "boolean" !== typeof h || h || x.remove(); "fade" === g && (u.addClass("jsmodern-picture-fade"), t.first().show()); "slide" === g && (t = u.find(".jsmodern-picture-part"), k = t.first(), h = t.last(), u.addClass("jsmodern-picture-slide").width(n * (w + 2)).append(k.clone(!0)).prepend(h.clone(!0)).css("left", -n + "px")); y.click(function() { var a = b(this).index(); c(a); e.data("cacheIndex", a) }); p.click(function() { var a = e.data("cacheIndex"); a--; c(a) }); l.click(function() { var a = e.data("cacheIndex"); a++; c(a) }); if (r && "number" === typeof r) { var v = setInterval(function() { var a = e.data("cacheIndex"); a++; c(a) }, r); e.mouseenter(function() { clearInterval(v) }).mouseleave(function() { v = setInterval(function() { var a = e.data("cacheIndex"); a++; c(a) }, r) }) } }); return this }, video: function(d, a) { b(d).each(function() { function c(a) { var b = parseInt(a / 60); a = parseInt(a % 60); return (10 > b ? "0" + b: b) + ":" + (10 > a ? "0" + a: a) } function d(a) { a = parseInt(w.width()) / (a || F) * G; H.html(c(a)); h.currentTime = a; "play" === k.data("playState") ? h.play() : h.pause() } function e(a) { a.webkitRequestFullScreen ? a.webkitRequestFullScreen() : a.mozRequestFullScreen ? a.mozRequestFullScreen() : a.msRequestFullscreen ? a.msRequestFullscreen() : a.requestFullScreen && a.requestFullScreen() } function q() { f.exitFullscreen ? f.exitFullscreen() : f.msExitFullscreen ? f.msExitFullscreen() : f.mozCancelFullScreen ? f.mozCancelFullScreen() : f.oRequestFullscreen ? f.oCancelFullScreen() : f.webkitExitFullscreen && f.webkitExitFullscreen() } function n() { t.width(M).height(N); h.width = M; h.height = N; l.width(r).addClass("jsmodern-video-panelFull"); z.addClass("jsmodern-video-fullout") } function p() { t.width(r).height(u); h.width = r; h.height = u; l.width(r).removeClass("jsmodern-video-panelFull"); z.removeClass("jsmodern-video-fullout") } var g = b(this), k = g.find("video"), h = k[0], r = g.width(), u = g.height(); k.removeAttr("controls"); k.wrap('\x3csection class\x3d"jsmodern-video" style\x3d"width:' + r + "px;height:" + u + 'px;"\x3e\x3c/section\x3e').prop({ width: r, height: u }); var t = g.find(".jsmodern-video"); g.find(".jsmodern-video").append('\x3csection class\x3d"jsmodern-video-panel"\x3e\x3cb class\x3d"jsmodern-video-play"\x3e\x3c/b\x3e\x3cspan class\x3d"jsmodern-video-start"\x3e00:00\x3c/span\x3e\x3cspan\x3e/\x3c/span\x3e\x3cspan class\x3d"jsmodern-video-end"\x3e00:00\x3c/span\x3e\x3cdiv class\x3d"jsmodern-video-linebox"\x3e\x3cdiv class\x3d"jsmodern-video-pass"\x3e\x3c/div\x3e\x3cb class\x3d"jsmodern-video-linedot"\x3e\x3c/b\x3e\x3c/div\x3e\x3cb class\x3d"jsmodern-video-volume"\x3e\x3c/b\x3e\x3cdiv class\x3d"jsmodern-video-volumebox"\x3e\x3cdiv class\x3d"jsmodern-video-volumeline"\x3e\x3c/div\x3e\x3cb class\x3d"jsmodern-video-volumedot"\x3e\x3c/b\x3e\x3c/div\x3e\x3cb class\x3d"jsmodern-video-fullin"\x3e\x3c/b\x3e\x3c/section\x3e'); var l = g.find(".jsmodern-video-panel"), w = l.find(".jsmodern-video-pass"), g = l.find(".jsmodern-video-linebox"), x = l.find(".jsmodern-video-linedot"), y = l.find(".jsmodern-video-play"), v = l.find(".jsmodern-video-volume"), A = l.find(".jsmodern-video-volumebox"), I = l.find(".jsmodern-video-volumeline"), C = l.find(".jsmodern-video-volumedot"), H = l.find(".jsmodern-video-start"), O = l.find(".jsmodern-video-end"), z = l.find(".jsmodern-video-fullin"), F = g.width(); if (E) l.find("span").on("selectstart", function() { return ! 1 }); E && f.all && z.addClass("jsmodern-video-fullFalse"); var J = 0, K; k.on({ play: function() { k.data("playState", "play"); y.addClass("jsmodern-video-pause"); t.on("mousemove", function() { J = 1; l.stop().fadeIn(50) }); K = setInterval(function() { J ? l.stop().fadeIn(100) : (z.data("fullState") || z.hasClass("jsmodern-video-fullout")) && l.stop().fadeOut(100); J = 0 }, 2E3) }, pause: function() { k.data("playState", "pause"); y.removeClass("jsmodern-video-pause"); t.off("mousemove mouseenter mouseleave"); clearInterval(K) }, ended: function() { k.data("playState", "end"); y.removeClass("jsmodern-video-pause"); H.html("00:00"); w.width(0); x.css("marginLeft", 0); t.off("mousemove mouseenter mouseleave"); l.fadeIn(100); clearInterval(K); a && b.isFunction(a) && a.call(h) } }); var G; k.on("durationchange", function() { var a = h.duration; G = a; O.html(c(a)) }); k.on("timeupdate", function() { var a; isNaN(h.duration) || (a = h.currentTime, H.html(c(a))); O.html().replace(":", ""); a = a / G * F; w.width(a); x.css("marginLeft", a + "px") }); g.on("click", function(a) { a = a || window.event; var c = b(this).offset().left; w.width(a.pageX - c); x.css("marginLeft", a.pageX - c + "px"); d() }); x.on("mousedown", function(a) { var c = b(this), g = b(this).parent().offset().left; b(f).on("mousemove", function(a) { a = a || window.event; var b = a.pageX - g; a.preventDefault(); 0 > b && (b = 0); b > F && (b = F); c.css("marginLeft", b + "px").siblings().width(b); d() }); b(f).mouseup(function() { b(this).off("mousemove") }) }); y.click(function() { h.paused ? h.play() : h.pause() }); h && (h.volume = .5); v.click(function() { h.muted ? (h.muted = !1, v.removeClass("jsmodern-video-muted"), C.css("marginLeft", v.data("left")), I.width(v.data("left"))) : (h.muted = !0, v.addClass("jsmodern-video-muted").data("left", C.css("marginLeft")), C.css("marginLeft", 0), I.width(0)) }); var B = A.width(); A.click(function(a) { a = a || window.event; var c = b(this).offset().left; 0 <= a.pageX - c && a.pageX - c <= B && (h.muted = !1, v.removeClass("jsmodern-video-muted"), I.width(a.pageX - c), C.css("marginLeft", a.pageX - c + "px"), h.volume = (a.pageX - c) / B) }); C.on("mousedown", function(a) { var c = b(this), d = c.parent().offset().left; b(f).on("mousemove", function(a) { a = a || window.event; var b = a.pageX - d; a.preventDefault(); 0 >= b && (b = 0, v.addClass("jsmodern-video-muted"), h.muted = !0); b > B && (h.muted = !1, b = B); 0 < b && b <= B && (h.muted = !1, v.removeClass("jsmodern-video-muted")); c.css("marginLeft", b + "px").siblings().width(b); h.volume = b / B }) }); b(f).mouseup(function() { b(this).off("mousemove") }); var M = screen.width, N = screen.height; z.click(function() { z.hasClass("jsmodern-video-fullFalse") || (z.hasClass("jsmodern-video-fullout") ? q() : (e(t[0]), E && z.data("fullState", !0))) }); b(f).on("fullscreenChange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function() { E ? z.data("fullState") ? (n(), z.removeData("fullState")) : p() : f.fullscreen || f.mozFullScreen || f.webkitIsFullScreen ? (e(t[0]), n()) : (q(), p()) }) }); return this }, dialog: function(d) { var a = decodeURI("%E6%9D%A5%E8%87%AA%E7%BD%91%E9%A1%B5%E7%9A%84%E6%B6%88%E6%81%AF"), c = decodeURI("%E7%A1%AE%E5%AE%9A"), m = decodeURI("%E5%8F%96%E6%B6%88"), e = b.noop, q = b.noop, n = "", p; b.isPlainObject(d) && (p = d.width, a = d.title || a, n = d.content || n, e = d.sure[1] || e, q = d.cancel[1] || q, c = d.sure[0] || c, m = d.cancel[0] || m); "string" === typeof d && (n = d || n); a = '\x3csection class\x3d"jsmodern-dialog-container"\x3e\x3cdiv class\x3d"jsmodern-dialog"\x3e\x3cp class\x3d"jsmodern-dialog-title"\x3e' + a + '\x3c/p\x3e\x3cp class\x3d"jsmodern-dialog-content"\x3e' + n + '\x3c/p\x3e\x3cspan class\x3d"jsmodern-dialog-sure"\x3e' + c + '\x3c/span\x3e\x3cspan class\x3d"jsmodern-dialog-cancel"\x3e' + m + "\x3c/span\x3e\x3c/div\x3e\x3c/section\x3e"; if (!f.querySelector(".jsmodern-dialog-container")) { b("body").append(a); var g = b(".jsmodern-dialog-container"), k = g.find(".jsmodern-dialog"), a = g.find("span"); "string" === typeof d && a.last().remove(); p && k.width(p); d = b(window).height() - 70; k.outerHeight() > d && k.height(d).find(".jsmodern-dialog-content").css({ overflowY: "scroll", height: d - k.find(".jsmodern-dialog-title").height() - 53 + "px" }); g.stop().animate({ opacity: 1 }, 300); k.stop().animate({ top: "20px", opacity: 1 }, 500, "easeInOutQuart"); var h = function() { k.stop().animate({ top: "-10px", opacity: 0 }, 400, "easeInOutQuart"); g.delay(200).animate({ opacity: 0 }, 300, function() { g.remove() }) }; k.find(".jsmodern-dialog-sure").click(function() { e(); h() }).end().find(".jsmodern-dialog-cancel").click(function() { q(); h() }) } return this }, scrollBar: function(d) { b(d).each(function() { var a = b(this), c = a.children().first(), d = a.innerHeight(), e = c.outerHeight(!0); a.addClass("jsmodern-scrollBar-container"); c.addClass("jsmodern-scrollBar-inner").after('\x3csection class\x3d"jsmodern-scrollbar"\x3e\x3c/section\x3e').data("translateY", 0); var q = a.find(".jsmodern-scrollbar"); q.data({ translateY: 0, cacheY: 0 }); b("body").on("selectstart", ".jsmodern-scroll-noselect", function() { return ! 1 }); var n = e + (parseInt(a.css("paddingTop")) + parseInt(a.css("paddingBottom"))); q.height(~~ (d * d / e)); var p = d - q.height(); q.on("mousedown", function(g) { var e = b(this); g = g || window.event; var h = g.pageY - e.position().top - q.data("translateY"); a.addClass("jsmodern-scroll-noselect"); c.add(e).css("transition", "0s"); b(f).on("mousemove", function(a) { a = a || window.event; var b = a.pageY - h; a.preventDefault(); 0 > b && (b = 0); b > p && (b = p); e.css("transform", "translateY(" + b + "px)").data("cacheY", b); c.css("transform", "translateY(-" + n / d * b + "px)") }) }); b(f).mouseup(function() { b(this).off("mousemove"); a.removeClass("jsmodern-scroll-noselect") }); a.on("mousewheel DOMMouseScroll", function(a) { a = a || window.event; var b = a.originalEvent.wheelDelta || a.originalEvent.detail, b = -300 === b || -120 === b || 3 === b ? "down": "up"; q.data("cacheY"); a.preventDefault(); a = q.data("cacheY"); "down" === b ? (a += 20, a > p && (a = p)) : (a -= 20, 0 > a && (a = 0)); q.css({ transform: "translateY(" + a + "px)", transition: ".2s" }).data("cacheY", a); c.css({ transform: "translateY(-" + n / d * a + "px)", transition: ".2s" }) }) }); return this }, lazyload: function(d) { var a = b(window).height(); b(d).each(function() { b(this).find("img").addClass("jsmodern-lazyload").each(function() { var c = b(this), d = c.attr("data-lazy"); b(window).on("load", function() { f.createElement("img").src = d }); b(window).on("scroll", function() { var e = b(window).scrollTop(); c.offset().top - e - 50 < a && d && c.attr("src", d).stop().animate({ opacity: "1" }, 300, function() { c.removeAttr("data-lazy") }) }); c.offset().top - b(window).scrollTop() < a && d && c.attr("src", d).css("opacity", 1).removeAttr("data-lazy") }) }); return this }, page: function(d, a) { d = b(f.querySelector(d)); if (a && b.isPlainObject(a)) { var c = b(a.target), m = a.type, e = a.url, q = ~~a.total, n = ~~a.every, p = a.success; a = a = ""; var g = q / n, g = 1 <= g ? 0 < q % n ? ~~g + 1 : g: g; 1 > g && (g = 1); for (var k = 1; k <= g; k++) a += '\x3ci class\x3d"jsmodern-page-every"\x3e' + k + "\x3c/i\x3e"; a = '\x3csection class\x3d"jsmodern-page"\x3e\x3ci class\x3d"jsmodern-page-first"\x3e\x3cspan\x3e\u00ab\x3c/span\x3e\x3c/i\x3e\x3ci class\x3d"jsmodern-page-prev"\x3e\x3cspan\x3e\u2039\x3c/span\x3e\x3c/i\x3e' + ("\x3cdiv\x3e\x3cdiv\x3e" + a + "\x3c/div\x3e\x3c/div\x3e") + '\x3ci class\x3d"jsmodern-page-next"\x3e\x3cspan\x3e\u203a\x3c/span\x3e\x3c/i\x3e\x3ci class\x3d"jsmodern-page-last"\x3e\x3cspan\x3e\u00bb\x3c/span\x3e\x3c/i\x3e\x3c/section\x3e'; d.addClass("jsmodern-page-content").append(a); a = d.find(".jsmodern-page"); var h = a.find("div \x3e div"), r = a.find(".jsmodern-page-every"), u = a.find(".jsmodern-page-first"), t = a.find(".jsmodern-page-last"), l = a.find(".jsmodern-page-prev"), w = a.find(".jsmodern-page-next"); c.data("index", 1); r.first().addClass("active"); d.on("selectstart", function() { return ! 1 }); var x = function(a) { if (10 < g) { var b = g - 10; h.width(42 * g); var c = parseInt(h.css("marginLeft")); switch (a) { case "next": c > 42 * -b && h.stop().animate({ marginLeft: c - 42 + "px" }, 100); break; case "prev": 0 > c && h.stop().animate({ marginLeft: c + 42 + "px" }, 100); break; case "first": h.stop().animate({ marginLeft: 0 }, 100); break; case "last": h.stop().animate({ marginLeft: 42 * -b + "px" }, 100) } } }; x(); "local" === m && e && b.isFunction(e) && b.ajax(e("")).done(function(a) { a = b.parseJSON(a); var d = [], e; for (e in a) d.push(p(a[e])); var f = "", m = ""; for (a = 0; a < n; a++) f += d[a]; m = f; c.html(f); var k = function(a, e) { f = ""; if (!h.is(":animated")) { var k, l = c.data("index"), p = function(a) { for (var b = (a - 1) * n; b < a * n; b++) d[b] && (f += d[b]); k = l }; switch (a) { case "first": f = m; k = 1; break; case "last": for (e = (g - 1) * n; e < q; e++) f += d[e]; k = g; break; case "prev": 1 < l && (l--, p(l)); break; case "next": l < g && (l++, p(l)); break; case "every": l = b(e).index() + 1, p(l) } "" !== f && c.html(f).data("index", k); r.eq(k - 1).addClass("active").siblings().removeClass("active"); x(a) } }; u.click(function() { k("first") }); t.click(function() { k("last") }); l.click(function() { k("prev") }); w.click(function() { k("next") }); r.click(function() { k("every", this) }) }); if ("ajax" === m && e && b.isFunction(e)) { var y = {}, v = function(a) { r.eq(a - 1).addClass("active").siblings().removeClass("active") }, A = function(a) { if (y[a]) c.html(y[a]); else { var d = ""; b.ajax(e(a)).done(function(e) { e = b.parseJSON(e); for (var f in e) d += p(e[f]); y[a] = d; "" !== d && c.html(d) }) } c.data("index", a) }; A(1); r.click(function() { var a = b(this).index() + 1; v(a); A(a); x("every") }); l.click(function() { var a = c.data("index") - 1; 0 < a && (v(a), A(a), x("prev")) }); w.click(function() { var a = c.data("index") + 1; a < g + 1 && (v(a), A(a), x("next")) }); u.click(function() { v(1); A(1); x("first") }); t.click(function() { v(g); A(g); x("last") }) } } return this } } });