Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function test_sms_live() {
- var e = '<div id="sms_live_tmp_item" class="sms_feed_user" title="@baev" style="margin-left: -60px;"><a href="/baev"><img src="http://moscow.sprashivai.net/10,f4804642a58d4f_2.jpg" width="100%" height="100%"></a></div>';
- $("#sms_live_users").prepend(e), $("#sms_live_tmp_item").velocity({
- marginLeft: "0"
- }, {
- duration: 200,
- delay: 0,
- easing: "easeInSine",
- complete: function() {
- $("#sms_live_tmp_item").removeAttr("id")
- }
- })
- }
- function hide_lk(e) {
- $("#lks_" + e).css("bottom", "25px"), $("#lks_" + e).css("opacity", "0"), $("#lks_" + e).css("visibility", "hidden")
- }! function(e) {
- "function" == typeof define && define.amd ? define(["jquery"], e) : e("object" == typeof exports ? require("jquery") : window.jQuery || window.Zepto)
- }(function(e) {
- var t, i, o, n, s, r, a, l = "Close",
- c = "BeforeClose",
- u = "AfterClose",
- p = "BeforeAppend",
- d = "MarkupParse",
- _ = "Open",
- h = "Change",
- f = "mfp",
- m = "." + f,
- g = "mfp-ready",
- v = "mfp-removing",
- $ = "mfp-prevent-close",
- y = function() {},
- b = !!window.jQuery,
- w = e(window),
- k = function(e, i) {
- t.ev.on(f + e + m, i)
- },
- x = function(t, i, o, n) {
- var s = document.createElement("div");
- return s.className = "mfp-" + t, o && (s.innerHTML = o), n ? i && i.appendChild(s) : (s = e(s), i && s.appendTo(i)), s
- },
- S = function(i, o) {
- t.ev.triggerHandler(f + i, o), t.st.callbacks && (i = i.charAt(0).toLowerCase() + i.slice(1), t.st.callbacks[i] && t.st.callbacks[i].apply(t, e.isArray(o) ? o : [o]))
- },
- C = function(i) {
- return i === a && t.currTemplate.closeBtn || (t.currTemplate.closeBtn = e(t.st.closeMarkup.replace("%title%", t.st.tClose)), a = i), t.currTemplate.closeBtn
- },
- T = function() {
- e.magnificPopup.instance || (t = new y, t.init(), e.magnificPopup.instance = t)
- },
- P = function() {
- var e = document.createElement("p").style,
- t = ["ms", "O", "Moz", "Webkit"];
- if (void 0 !== e.transition) return !0;
- for (; t.length;)
- if (t.pop() + "Transition" in e) return !0;
- return !1
- };
- y.prototype = {
- constructor: y,
- init: function() {
- var i = navigator.appVersion;
- t.isIE7 = -1 !== i.indexOf("MSIE 7."), t.isIE8 = -1 !== i.indexOf("MSIE 8."), t.isLowIE = t.isIE7 || t.isIE8, t.isAndroid = /android/gi.test(i), t.isIOS = /iphone|ipad|ipod/gi.test(i), t.supportsTransition = P(), t.probablyMobile = t.isAndroid || t.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent), n = e(document), t.popupsCache = {}
- },
- open: function(i) {
- o || (o = e(document.body));
- var s;
- if (i.isObj === !1) {
- t.items = i.items.toArray(), t.index = 0;
- var a, l = i.items;
- for (s = 0; s < l.length; s++)
- if (a = l[s], a.parsed && (a = a.el[0]), a === i.el[0]) {
- t.index = s;
- break
- }
- } else t.items = e.isArray(i.items) ? i.items : [i.items], t.index = i.index || 0;
- if (t.isOpen) return void t.updateItemHTML();
- t.types = [], r = "", t.ev = i.mainEl && i.mainEl.length ? i.mainEl.eq(0) : n, i.key ? (t.popupsCache[i.key] || (t.popupsCache[i.key] = {}), t.currTemplate = t.popupsCache[i.key]) : t.currTemplate = {}, t.st = e.extend(!0, {}, e.magnificPopup.defaults, i), t.fixedContentPos = "auto" === t.st.fixedContentPos ? !t.probablyMobile : t.st.fixedContentPos, t.st.modal && (t.st.closeOnContentClick = !1, t.st.closeOnBgClick = !1, t.st.showCloseBtn = !1, t.st.enableEscapeKey = !1), t.bgOverlay || (t.bgOverlay = x("bg").on("click" + m, function() {
- t.close()
- }), t.wrap = x("wrap").attr("tabindex", -1).on("click" + m, function(e) {
- t._checkIfClose(e.target) && t.close()
- }), t.container = x("container", t.wrap)), t.contentContainer = x("content"), t.st.preloader && (t.preloader = x("preloader", t.container, t.st.tLoading));
- var c = e.magnificPopup.modules;
- for (s = 0; s < c.length; s++) {
- var u = c[s];
- u = u.charAt(0).toUpperCase() + u.slice(1), t["init" + u].call(t)
- }
- S("BeforeOpen"), t.st.showCloseBtn && (t.st.closeBtnInside ? (k(d, function(e, t, i, o) {
- i.close_replaceWith = C(o.type)
- }), r += " mfp-close-btn-in") : t.wrap.append(C())), t.st.alignTop && (r += " mfp-align-top"), t.wrap.css(t.fixedContentPos ? {
- overflow: t.st.overflowY,
- overflowX: "hidden",
- overflowY: t.st.overflowY
- } : {
- top: w.scrollTop(),
- position: "absolute"
- }), (t.st.fixedBgPos === !1 || "auto" === t.st.fixedBgPos && !t.fixedContentPos) && t.bgOverlay.css({
- height: n.height(),
- position: "absolute"
- }), t.st.enableEscapeKey && n.on("keyup" + m, function(e) {
- 27 === e.keyCode && t.close()
- }), w.on("resize" + m, function() {
- t.updateSize()
- }), t.st.closeOnContentClick || (r += " mfp-auto-cursor"), r && t.wrap.addClass(r);
- var p = t.wH = w.height(),
- h = {};
- if (t.fixedContentPos && t._hasScrollBar(p)) {
- var f = t._getScrollbarSize();
- f && (h.marginRight = f)
- }
- t.fixedContentPos && (t.isIE7 ? e("body, html").css("overflow", "hidden") : h.overflow = "hidden");
- var v = t.st.mainClass;
- return t.isIE7 && (v += " mfp-ie7"), v && t._addClassToMFP(v), t.updateItemHTML(), S("BuildControls"), e("html").css(h), t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo || o), t._lastFocusedEl = document.activeElement, setTimeout(function() {
- t.content ? (t._addClassToMFP(g), t._setFocus()) : t.bgOverlay.addClass(g), n.on("focusin" + m, t._onFocusIn)
- }, 16), t.isOpen = !0, t.updateSize(p), S(_), i
- },
- close: function() {
- t.isOpen && (S(c), t.isOpen = !1, t.st.removalDelay && !t.isLowIE && t.supportsTransition ? (t._addClassToMFP(v), setTimeout(function() {
- t._close()
- }, t.st.removalDelay)) : t._close())
- },
- _close: function() {
- S(l);
- var i = v + " " + g + " ";
- if (t.bgOverlay.detach(), t.wrap.detach(), t.container.empty(), t.st.mainClass && (i += t.st.mainClass + " "), t._removeClassFromMFP(i), t.fixedContentPos) {
- var o = {
- marginRight: ""
- };
- t.isIE7 ? e("body, html").css("overflow", "") : o.overflow = "", e("html").css(o)
- }
- n.off("keyup" + m + " focusin" + m), t.ev.off(m), t.wrap.attr("class", "mfp-wrap").removeAttr("style"), t.bgOverlay.attr("class", "mfp-bg"), t.container.attr("class", "mfp-container"), !t.st.showCloseBtn || t.st.closeBtnInside && t.currTemplate[t.currItem.type] !== !0 || t.currTemplate.closeBtn && t.currTemplate.closeBtn.detach(), t._lastFocusedEl && e(t._lastFocusedEl).focus(), t.currItem = null, t.content = null, t.currTemplate = null, t.prevHeight = 0, S(u)
- },
- updateSize: function(e) {
- if (t.isIOS) {
- var i = document.documentElement.clientWidth / window.innerWidth,
- o = window.innerHeight * i;
- t.wrap.css("height", o), t.wH = o
- } else t.wH = e || w.height();
- t.fixedContentPos || t.wrap.css("height", t.wH), S("Resize")
- },
- updateItemHTML: function() {
- var i = t.items[t.index];
- t.contentContainer.detach(), t.content && t.content.detach(), i.parsed || (i = t.parseEl(t.index));
- var o = i.type;
- if (S("BeforeChange", [t.currItem ? t.currItem.type : "", o]), t.currItem = i, !t.currTemplate[o]) {
- var n = t.st[o] ? t.st[o].markup : !1;
- S("FirstMarkupParse", n), t.currTemplate[o] = n ? e(n) : !0
- }
- s && s !== i.type && t.container.removeClass("mfp-" + s + "-holder");
- var r = t["get" + o.charAt(0).toUpperCase() + o.slice(1)](i, t.currTemplate[o]);
- t.appendContent(r, o), i.preloaded = !0, S(h, i), s = i.type, t.container.prepend(t.contentContainer), S("AfterChange")
- },
- appendContent: function(e, i) {
- t.content = e, e ? t.st.showCloseBtn && t.st.closeBtnInside && t.currTemplate[i] === !0 ? t.content.find(".mfp-close").length || t.content.append(C()) : t.content = e : t.content = "", S(p), t.container.addClass("mfp-" + i + "-holder"), t.contentContainer.append(t.content)
- },
- parseEl: function(i) {
- var o, n = t.items[i];
- if (n.tagName ? n = {
- el: e(n)
- } : (o = n.type, n = {
- data: n,
- src: n.src
- }), n.el) {
- for (var s = t.types, r = 0; r < s.length; r++)
- if (n.el.hasClass("mfp-" + s[r])) {
- o = s[r];
- break
- }
- n.src = n.el.attr("data-mfp-src"), n.src || (n.src = n.el.attr("href"))
- }
- return n.type = o || t.st.type || "inline", n.index = i, n.parsed = !0, t.items[i] = n, S("ElementParse", n), t.items[i]
- },
- addGroup: function(e, i) {
- var o = function(o) {
- o.mfpEl = this, t._openClick(o, e, i)
- };
- i || (i = {});
- var n = "click.magnificPopup";
- i.mainEl = e, i.items ? (i.isObj = !0, e.off(n).on(n, o)) : (i.isObj = !1, i.delegate ? e.off(n).on(n, i.delegate, o) : (i.items = e, e.off(n).on(n, o)))
- },
- _openClick: function(i, o, n) {
- var s = void 0 !== n.midClick ? n.midClick : e.magnificPopup.defaults.midClick;
- if (s || 2 !== i.which && !i.ctrlKey && !i.metaKey) {
- var r = void 0 !== n.disableOn ? n.disableOn : e.magnificPopup.defaults.disableOn;
- if (r)
- if (e.isFunction(r)) {
- if (!r.call(t)) return !0
- } else if (w.width() < r) return !0;
- i.type && (i.preventDefault(), t.isOpen && i.stopPropagation()), n.el = e(i.mfpEl), n.delegate && (n.items = o.find(n.delegate)), t.open(n)
- }
- },
- updateStatus: function(e, o) {
- if (t.preloader) {
- i !== e && t.container.removeClass("mfp-s-" + i), o || "loading" !== e || (o = t.st.tLoading);
- var n = {
- status: e,
- text: o
- };
- S("UpdateStatus", n), e = n.status, o = n.text, t.preloader.html(o), t.preloader.find("a").on("click", function(e) {
- e.stopImmediatePropagation()
- }), t.container.addClass("mfp-s-" + e), i = e
- }
- },
- _checkIfClose: function(i) {
- if (!e(i).hasClass($)) {
- var o = t.st.closeOnContentClick,
- n = t.st.closeOnBgClick;
- if (o && n) return !0;
- if (!t.content || e(i).hasClass("mfp-close") || t.preloader && i === t.preloader[0]) return !0;
- if (i === t.content[0] || e.contains(t.content[0], i)) {
- if (o) return !0
- } else if (n && e.contains(document, i)) return !0;
- return !1
- }
- },
- _addClassToMFP: function(e) {
- t.bgOverlay.addClass(e), t.wrap.addClass(e)
- },
- _removeClassFromMFP: function(e) {
- this.bgOverlay.removeClass(e), t.wrap.removeClass(e)
- },
- _hasScrollBar: function(e) {
- return (t.isIE7 ? n.height() : document.body.scrollHeight) > (e || w.height())
- },
- _setFocus: function() {
- (t.st.focus ? t.content.find(t.st.focus).eq(0) : t.wrap).focus()
- },
- _onFocusIn: function(i) {
- return i.target === t.wrap[0] || e.contains(t.wrap[0], i.target) ? void 0 : (t._setFocus(), !1)
- },
- _parseMarkup: function(t, i, o) {
- var n;
- o.data && (i = e.extend(o.data, i)), S(d, [t, i, o]), e.each(i, function(e, i) {
- if (void 0 === i || i === !1) return !0;
- if (n = e.split("_"), n.length > 1) {
- var o = t.find(m + "-" + n[0]);
- if (o.length > 0) {
- var s = n[1];
- "replaceWith" === s ? o[0] !== i[0] && o.replaceWith(i) : "img" === s ? o.is("img") ? o.attr("src", i) : o.replaceWith('<img src="' + i + '" class="' + o.attr("class") + '" />') : o.attr(n[1], i)
- }
- } else t.find(m + "-" + e).html(i)
- })
- },
- _getScrollbarSize: function() {
- if (void 0 === t.scrollbarSize) {
- var e = document.createElement("div");
- e.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(e), t.scrollbarSize = e.offsetWidth - e.clientWidth, document.body.removeChild(e)
- }
- return t.scrollbarSize
- }
- }, e.magnificPopup = {
- instance: null,
- proto: y.prototype,
- modules: [],
- open: function(t, i) {
- return T(), t = t ? e.extend(!0, {}, t) : {}, t.isObj = !0, t.index = i || 0, this.instance.open(t)
- },
- close: function() {
- return e.magnificPopup.instance && e.magnificPopup.instance.close()
- },
- registerModule: function(t, i) {
- i.options && (e.magnificPopup.defaults[t] = i.options), e.extend(this.proto, i.proto), this.modules.push(t)
- },
- defaults: {
- disableOn: 0,
- key: null,
- midClick: !1,
- mainClass: "",
- preloader: !0,
- focus: "",
- closeOnContentClick: !1,
- closeOnBgClick: !0,
- closeBtnInside: !0,
- showCloseBtn: !0,
- enableEscapeKey: !0,
- modal: !1,
- alignTop: !1,
- removalDelay: 0,
- prependTo: null,
- fixedContentPos: "auto",
- fixedBgPos: "auto",
- overflowY: "auto",
- closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>',
- tClose: "Close (Esc)",
- tLoading: "Loading..."
- }
- }, e.fn.magnificPopup = function(i) {
- T();
- var o = e(this);
- if ("string" == typeof i)
- if ("open" === i) {
- var n, s = b ? o.data("magnificPopup") : o[0].magnificPopup,
- r = parseInt(arguments[1], 10) || 0;
- s.items ? n = s.items[r] : (n = o, s.delegate && (n = n.find(s.delegate)), n = n.eq(r)), t._openClick({
- mfpEl: n
- }, o, s)
- } else t.isOpen && t[i].apply(t, Array.prototype.slice.call(arguments, 1));
- else i = e.extend(!0, {}, i), b ? o.data("magnificPopup", i) : o[0].magnificPopup = i, t.addGroup(o, i);
- return o
- };
- var A, q, O, R = "inline",
- j = function() {
- O && (q.after(O.addClass(A)).detach(), O = null)
- };
- e.magnificPopup.registerModule(R, {
- options: {
- hiddenClass: "hide",
- markup: "",
- tNotFound: "Content not found"
- },
- proto: {
- initInline: function() {
- t.types.push(R), k(l + "." + R, function() {
- j()
- })
- },
- getInline: function(i, o) {
- if (j(), i.src) {
- var n = t.st.inline,
- s = e(i.src);
- if (s.length) {
- var r = s[0].parentNode;
- r && r.tagName && (q || (A = n.hiddenClass, q = x(A), A = "mfp-" + A), O = s.after(q).detach().removeClass(A)), t.updateStatus("ready")
- } else t.updateStatus("error", n.tNotFound), s = e("<div>");
- return i.inlineElement = s, s
- }
- return t.updateStatus("ready"), t._parseMarkup(o, {}, i), o
- }
- }
- });
- var I, F = "ajax",
- E = function() {
- I && o.removeClass(I)
- },
- M = function() {
- E(), t.req && t.req.abort()
- };
- e.magnificPopup.registerModule(F, {
- options: {
- settings: null,
- cursor: "mfp-ajax-cur",
- tError: '<a href="%url%">The content</a> could not be loaded.'
- },
- proto: {
- initAjax: function() {
- t.types.push(F), I = t.st.ajax.cursor, k(l + "." + F, M), k("BeforeChange." + F, M)
- },
- getAjax: function(i) {
- I && o.addClass(I), t.updateStatus("loading");
- var n = e.extend({
- url: i.src,
- success: function(o, n, s) {
- var r = {
- data: o,
- xhr: s
- };
- S("ParseAjax", r), t.appendContent(e(r.data), F), i.finished = !0, E(), t._setFocus(), setTimeout(function() {
- t.wrap.addClass(g)
- }, 16), t.updateStatus("ready"), S("AjaxContentAdded")
- },
- error: function() {
- E(), i.finished = i.loadError = !0, t.updateStatus("error", t.st.ajax.tError.replace("%url%", i.src))
- }
- }, t.st.ajax.settings);
- return t.req = e.ajax(n), ""
- }
- }
- });
- var z, N = function(i) {
- if (i.data && void 0 !== i.data.title) return i.data.title;
- var o = t.st.image.titleSrc;
- if (o) {
- if (e.isFunction(o)) return o.call(t, i);
- if (i.el) return i.el.attr(o) || ""
- }
- return ""
- };
- e.magnificPopup.registerModule("image", {
- options: {
- markup: '<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',
- cursor: "mfp-zoom-out-cur",
- titleSrc: "title",
- verticalFit: !0,
- tError: '<a href="%url%">The image</a> could not be loaded.'
- },
- proto: {
- initImage: function() {
- var e = t.st.image,
- i = ".image";
- t.types.push("image"), k(_ + i, function() {
- "image" === t.currItem.type && e.cursor && o.addClass(e.cursor)
- }), k(l + i, function() {
- e.cursor && o.removeClass(e.cursor), w.off("resize" + m)
- }), k("Resize" + i, t.resizeImage), t.isLowIE && k("AfterChange", t.resizeImage)
- },
- resizeImage: function() {
- var e = t.currItem;
- if (e && e.img && t.st.image.verticalFit) {
- var i = 0;
- t.isLowIE && (i = parseInt(e.img.css("padding-top"), 10) + parseInt(e.img.css("padding-bottom"), 10)), e.img.css("max-height", t.wH - i)
- }
- },
- _onImageHasSize: function(e) {
- e.img && (e.hasSize = !0, z && clearInterval(z), e.isCheckingImgSize = !1, S("ImageHasSize", e), e.imgHidden && (t.content && t.content.removeClass("mfp-loading"), e.imgHidden = !1))
- },
- findImageSize: function(e) {
- var i = 0,
- o = e.img[0],
- n = function(s) {
- z && clearInterval(z), z = setInterval(function() {
- return o.naturalWidth > 0 ? void t._onImageHasSize(e) : (i > 200 && clearInterval(z), i++, void(3 === i ? n(10) : 40 === i ? n(50) : 100 === i && n(500)))
- }, s)
- };
- n(1)
- },
- getImage: function(i, o) {
- var n = 0,
- s = function() {
- i && (i.img[0].complete ? (i.img.off(".mfploader"), i === t.currItem && (t._onImageHasSize(i), t.updateStatus("ready")), i.hasSize = !0, i.loaded = !0, S("ImageLoadComplete")) : (n++, 200 > n ? setTimeout(s, 100) : r()))
- },
- r = function() {
- i && (i.img.off(".mfploader"), i === t.currItem && (t._onImageHasSize(i), t.updateStatus("error", a.tError.replace("%url%", i.src))), i.hasSize = !0, i.loaded = !0, i.loadError = !0)
- },
- a = t.st.image,
- l = o.find(".mfp-img");
- if (l.length) {
- var c = document.createElement("img");
- c.className = "mfp-img", i.el && i.el.find("img").length && (c.alt = i.el.find("img").attr("alt")), i.img = e(c).on("load.mfploader", s).on("error.mfploader", r), c.src = i.src, l.is("img") && (i.img = i.img.clone()), c = i.img[0], c.naturalWidth > 0 ? i.hasSize = !0 : c.width || (i.hasSize = !1)
- }
- return t._parseMarkup(o, {
- title: N(i),
- img_replaceWith: i.img
- }, i), t.resizeImage(), i.hasSize ? (z && clearInterval(z), i.loadError ? (o.addClass("mfp-loading"), t.updateStatus("error", a.tError.replace("%url%", i.src))) : (o.removeClass("mfp-loading"), t.updateStatus("ready")), o) : (t.updateStatus("loading"), i.loading = !0, i.hasSize || (i.imgHidden = !0, o.addClass("mfp-loading"), t.findImageSize(i)), o)
- }
- }
- });
- var V, L = function() {
- return void 0 === V && (V = void 0 !== document.createElement("p").style.MozTransform), V
- };
- e.magnificPopup.registerModule("zoom", {
- options: {
- enabled: !1,
- easing: "ease-in-out",
- duration: 300,
- opener: function(e) {
- return e.is("img") ? e : e.find("img")
- }
- },
- proto: {
- initZoom: function() {
- var e, i = t.st.zoom,
- o = ".zoom";
- if (i.enabled && t.supportsTransition) {
- var n, s, r = i.duration,
- a = function(e) {
- var t = e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),
- o = "all " + i.duration / 1e3 + "s " + i.easing,
- n = {
- position: "fixed",
- zIndex: 9999,
- left: 0,
- top: 0,
- "-webkit-backface-visibility": "hidden"
- },
- s = "transition";
- return n["-webkit-" + s] = n["-moz-" + s] = n["-o-" + s] = n[s] = o, t.css(n), t
- },
- u = function() {
- t.content.css("visibility", "visible")
- };
- k("BuildControls" + o, function() {
- if (t._allowZoom()) {
- if (clearTimeout(n), t.content.css("visibility", "hidden"), e = t._getItemToZoom(), !e) return void u();
- s = a(e), s.css(t._getOffset()), t.wrap.append(s), n = setTimeout(function() {
- s.css(t._getOffset(!0)), n = setTimeout(function() {
- u(), setTimeout(function() {
- s.remove(), e = s = null, S("ZoomAnimationEnded")
- }, 16)
- }, r)
- }, 16)
- }
- }), k(c + o, function() {
- if (t._allowZoom()) {
- if (clearTimeout(n), t.st.removalDelay = r, !e) {
- if (e = t._getItemToZoom(), !e) return;
- s = a(e)
- }
- s.css(t._getOffset(!0)), t.wrap.append(s), t.content.css("visibility", "hidden"), setTimeout(function() {
- s.css(t._getOffset())
- }, 16)
- }
- }), k(l + o, function() {
- t._allowZoom() && (u(), s && s.remove(), e = null)
- })
- }
- },
- _allowZoom: function() {
- return "image" === t.currItem.type
- },
- _getItemToZoom: function() {
- return t.currItem.hasSize ? t.currItem.img : !1
- },
- _getOffset: function(i) {
- var o;
- o = i ? t.currItem.img : t.st.zoom.opener(t.currItem.el || t.currItem);
- var n = o.offset(),
- s = parseInt(o.css("padding-top"), 10),
- r = parseInt(o.css("padding-bottom"), 10);
- n.top -= e(window).scrollTop() - s;
- var a = {
- width: o.width(),
- height: (b ? o.innerHeight() : o[0].offsetHeight) - r - s
- };
- return L() ? a["-moz-transform"] = a.transform = "translate(" + n.left + "px," + n.top + "px)" : (a.left = n.left, a.top = n.top), a
- }
- }
- });
- var H = "iframe",
- D = "//about:blank",
- B = function(e) {
- if (t.currTemplate[H]) {
- var i = t.currTemplate[H].find("iframe");
- i.length && (e || (i[0].src = D), t.isIE8 && i.css("display", e ? "block" : "none"))
- }
- };
- e.magnificPopup.registerModule(H, {
- options: {
- markup: '<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',
- srcAction: "iframe_src",
- patterns: {
- youtube: {
- index: "youtube.com",
- id: "v=",
- src: "//www.youtube.com/embed/%id%?autoplay=1"
- },
- vimeo: {
- index: "vimeo.com/",
- id: "/",
- src: "//player.vimeo.com/video/%id%?autoplay=1"
- },
- gmaps: {
- index: "//maps.google.",
- src: "%id%&output=embed"
- }
- }
- },
- proto: {
- initIframe: function() {
- t.types.push(H), k("BeforeChange", function(e, t, i) {
- t !== i && (t === H ? B() : i === H && B(!0))
- }), k(l + "." + H, function() {
- B()
- })
- },
- getIframe: function(i, o) {
- var n = i.src,
- s = t.st.iframe;
- e.each(s.patterns, function() {
- return n.indexOf(this.index) > -1 ? (this.id && (n = "string" == typeof this.id ? n.substr(n.lastIndexOf(this.id) + this.id.length, n.length) : this.id.call(this, n)), n = this.src.replace("%id%", n), !1) : void 0
- });
- var r = {};
- return s.srcAction && (r[s.srcAction] = n), t._parseMarkup(o, r, i), t.updateStatus("ready"), o
- }
- }
- });
- var W = function(e) {
- var i = t.items.length;
- return e > i - 1 ? e - i : 0 > e ? i + e : e
- },
- U = function(e, t, i) {
- return e.replace(/%curr%/gi, t + 1).replace(/%total%/gi, i)
- };
- e.magnificPopup.registerModule("gallery", {
- options: {
- enabled: !1,
- arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
- preload: [0, 2],
- navigateByImgClick: !0,
- arrows: !0,
- tPrev: "Previous (Left arrow key)",
- tNext: "Next (Right arrow key)",
- tCounter: "%curr% of %total%"
- },
- proto: {
- initGallery: function() {
- var i = t.st.gallery,
- o = ".mfp-gallery",
- s = Boolean(e.fn.mfpFastClick);
- return t.direction = !0, i && i.enabled ? (r += " mfp-gallery", k(_ + o, function() {
- i.navigateByImgClick && t.wrap.on("click" + o, ".mfp-img", function() {
- return t.items.length > 1 ? (t.next(), !1) : void 0
- }), n.on("keydown" + o, function(e) {
- 37 === e.keyCode ? t.prev() : 39 === e.keyCode && t.next()
- })
- }), k("UpdateStatus" + o, function(e, i) {
- i.text && (i.text = U(i.text, t.currItem.index, t.items.length))
- }), k(d + o, function(e, o, n, s) {
- var r = t.items.length;
- n.counter = r > 1 ? U(i.tCounter, s.index, r) : ""
- }), k("BuildControls" + o, function() {
- if (t.items.length > 1 && i.arrows && !t.arrowLeft) {
- var o = i.arrowMarkup,
- n = t.arrowLeft = e(o.replace(/%title%/gi, i.tPrev).replace(/%dir%/gi, "left")).addClass($),
- r = t.arrowRight = e(o.replace(/%title%/gi, i.tNext).replace(/%dir%/gi, "right")).addClass($),
- a = s ? "mfpFastClick" : "click";
- n[a](function() {
- t.prev()
- }), r[a](function() {
- t.next()
- }), t.isIE7 && (x("b", n[0], !1, !0), x("a", n[0], !1, !0), x("b", r[0], !1, !0), x("a", r[0], !1, !0)), t.container.append(n.add(r))
- }
- }), k(h + o, function() {
- t._preloadTimeout && clearTimeout(t._preloadTimeout), t._preloadTimeout = setTimeout(function() {
- t.preloadNearbyImages(), t._preloadTimeout = null
- }, 16)
- }), void k(l + o, function() {
- n.off(o), t.wrap.off("click" + o), t.arrowLeft && s && t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(), t.arrowRight = t.arrowLeft = null
- })) : !1
- },
- next: function() {
- t.direction = !0, t.index = W(t.index + 1), t.updateItemHTML()
- },
- prev: function() {
- t.direction = !1, t.index = W(t.index - 1), t.updateItemHTML()
- },
- goTo: function(e) {
- t.direction = e >= t.index, t.index = e, t.updateItemHTML()
- },
- preloadNearbyImages: function() {
- var e, i = t.st.gallery.preload,
- o = Math.min(i[0], t.items.length),
- n = Math.min(i[1], t.items.length);
- for (e = 1; e <= (t.direction ? n : o); e++) t._preloadItem(t.index + e);
- for (e = 1; e <= (t.direction ? o : n); e++) t._preloadItem(t.index - e)
- },
- _preloadItem: function(i) {
- if (i = W(i), !t.items[i].preloaded) {
- var o = t.items[i];
- o.parsed || (o = t.parseEl(i)), S("LazyLoad", o), "image" === o.type && (o.img = e('<img class="mfp-img" />').on("load.mfploader", function() {
- o.hasSize = !0
- }).on("error.mfploader", function() {
- o.hasSize = !0, o.loadError = !0, S("LazyLoadError", o)
- }).attr("src", o.src)), o.preloaded = !0
- }
- }
- }
- });
- var Q = "retina";
- e.magnificPopup.registerModule(Q, {
- options: {
- replaceSrc: function(e) {
- return e.src.replace(/\.\w+$/, function(e) {
- return "@2x" + e
- })
- },
- ratio: 1
- },
- proto: {
- initRetina: function() {
- if (window.devicePixelRatio > 1) {
- var e = t.st.retina,
- i = e.ratio;
- i = isNaN(i) ? i() : i, i > 1 && (k("ImageHasSize." + Q, function(e, t) {
- t.img.css({
- "max-width": t.img[0].naturalWidth / i,
- width: "100%"
- })
- }), k("ElementParse." + Q, function(t, o) {
- o.src = e.replaceSrc(o, i)
- }))
- }
- }
- }
- }),
- function() {
- var t = 1e3,
- i = "ontouchstart" in window,
- o = function() {
- w.off("touchmove" + s + " touchend" + s)
- },
- n = "mfpFastClick",
- s = "." + n;
- e.fn.mfpFastClick = function(n) {
- return e(this).each(function() {
- var r, a = e(this);
- if (i) {
- var l, c, u, p, d, _;
- a.on("touchstart" + s, function(e) {
- p = !1, _ = 1, d = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0], c = d.clientX, u = d.clientY, w.on("touchmove" + s, function(e) {
- d = e.originalEvent ? e.originalEvent.touches : e.touches, _ = d.length, d = d[0], (Math.abs(d.clientX - c) > 10 || Math.abs(d.clientY - u) > 10) && (p = !0, o())
- }).on("touchend" + s, function(e) {
- o(), p || _ > 1 || (r = !0, e.preventDefault(), clearTimeout(l), l = setTimeout(function() {
- r = !1
- }, t), n())
- })
- })
- }
- a.on("click" + s, function() {
- r || n()
- })
- })
- }, e.fn.destroyMfpFastClick = function() {
- e(this).off("touchstart" + s + " click" + s), i && w.off("touchmove" + s + " touchend" + s)
- }
- }(), T()
- }),
- function(e, t, i) {
- function o(t, i) {
- this.bodyOverflowX, this.callbacks = {
- hide: [],
- show: []
- }, this.checkInterval = null, this.Content, this.$el = e(t), this.$elProxy, this.elProxyPosition, this.enabled = !0, this.options = e.extend({}, l, i), this.mouseIsOverProxy = !1, this.namespace = "tooltipster-" + Math.round(1e5 * Math.random()), this.Status = "hidden", this.timerHide = null, this.timerShow = null, this.$tooltip, this.options.iconTheme = this.options.iconTheme.replace(".", ""), this.options.theme = this.options.theme.replace(".", ""), this._init()
- }
- function n(t, i) {
- var o = !0;
- return e.each(t, function(e, n) {
- return "undefined" == typeof i[e] || t[e] !== i[e] ? (o = !1, !1) : void 0
- }), o
- }
- function s() {
- return !u && c
- }
- function r() {
- var e = i.body || i.documentElement,
- t = e.style,
- o = "transition";
- if ("string" == typeof t[o]) return !0;
- v = ["Moz", "Webkit", "Khtml", "O", "ms"], o = o.charAt(0).toUpperCase() + o.substr(1);
- for (var n = 0; n < v.length; n++)
- if ("string" == typeof t[v[n] + o]) return !0;
- return !1
- }
- var a = "tooltipster",
- l = {
- animation: "fade",
- arrow: !0,
- arrowColor: "",
- autoClose: !0,
- content: null,
- contentAsHTML: !1,
- contentCloning: !0,
- debug: !0,
- delay: 200,
- minWidth: 0,
- maxWidth: null,
- functionInit: function(e, t) {},
- functionBefore: function(e, t) {
- t()
- },
- functionReady: function(e, t) {},
- functionAfter: function(e) {},
- hideOnClick: !1,
- icon: "(?)",
- iconCloning: !0,
- iconDesktop: !1,
- iconTouch: !1,
- iconTheme: "tooltipster-icon",
- interactive: !1,
- interactiveTolerance: 350,
- multiple: !1,
- offsetX: 0,
- offsetY: 0,
- onlyOne: !1,
- position: "top",
- positionTracker: !1,
- positionTrackerCallback: function(e) {
- "hover" == this.option("trigger") && this.option("autoClose") && this.hide()
- },
- restoration: "current",
- speed: 350,
- timer: 0,
- theme: "tooltipster-default",
- touchDevices: !0,
- trigger: "hover",
- updateAnimation: !0
- };
- o.prototype = {
- _init: function() {
- var t = this;
- if (i.querySelector) {
- var o = null;
- void 0 === t.$el.data("tooltipster-initialTitle") && (o = t.$el.attr("title"), void 0 === o && (o = null), t.$el.data("tooltipster-initialTitle", o)), t._content_set(null !== t.options.content ? t.options.content : o);
- var n = t.options.functionInit.call(t.$el, t.$el, t.Content);
- "undefined" != typeof n && t._content_set(n), t.$el.removeAttr("title").addClass("tooltipstered"), !c && t.options.iconDesktop || c && t.options.iconTouch ? ("string" == typeof t.options.icon ? (t.$elProxy = e('<span class="' + t.options.iconTheme + '"></span>'), t.$elProxy.text(t.options.icon)) : t.$elProxy = t.options.iconCloning ? t.options.icon.clone(!0) : t.options.icon, t.$elProxy.insertAfter(t.$el)) : t.$elProxy = t.$el, "hover" == t.options.trigger ? (t.$elProxy.on("mouseenter." + t.namespace, function() {
- (!s() || t.options.touchDevices) && (t.mouseIsOverProxy = !0, t._show())
- }).on("mouseleave." + t.namespace, function() {
- (!s() || t.options.touchDevices) && (t.mouseIsOverProxy = !1)
- }), c && t.options.touchDevices && t.$elProxy.on("touchstart." + t.namespace, function() {
- t._showNow()
- })) : "click" == t.options.trigger && t.$elProxy.on("click." + t.namespace, function() {
- (!s() || t.options.touchDevices) && t._show()
- })
- }
- },
- _show: function() {
- var e = this;
- "shown" != e.Status && "appearing" != e.Status && (e.options.delay ? e.timerShow = setTimeout(function() {
- ("click" == e.options.trigger || "hover" == e.options.trigger && e.mouseIsOverProxy) && e._showNow()
- }, e.options.delay) : e._showNow())
- },
- _showNow: function(i) {
- var o = this;
- o.options.functionBefore.call(o.$el, o.$el, function() {
- if (o.enabled && null !== o.Content) {
- i && o.callbacks.show.push(i), o.callbacks.hide = [], clearTimeout(o.timerShow), o.timerShow = null, clearTimeout(o.timerHide), o.timerHide = null, o.options.onlyOne && e(".tooltipstered").not(o.$el).each(function(t, i) {
- var o = e(i),
- n = o.data("tooltipster-ns");
- e.each(n, function(e, t) {
- var i = o.data(t),
- n = i.status(),
- s = i.option("autoClose");
- "hidden" !== n && "disappearing" !== n && s && i.hide()
- })
- });
- var n = function() {
- o.Status = "shown", e.each(o.callbacks.show, function(e, t) {
- t.call(o.$el)
- }), o.callbacks.show = []
- };
- if ("hidden" !== o.Status) {
- var s = 0;
- "disappearing" === o.Status ? (o.Status = "appearing", r() ? (o.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-" + o.options.animation + "-show"), o.options.speed > 0 && o.$tooltip.delay(o.options.speed), o.$tooltip.queue(n)) : o.$tooltip.stop().fadeIn(n)) : "shown" === o.Status && n()
- } else {
- o.Status = "appearing";
- var s = o.options.speed;
- o.bodyOverflowX = e("body").css("overflow-x"), e("body").css("overflow-x", "hidden");
- var a = "tooltipster-" + o.options.animation,
- l = "-webkit-transition-duration: " + o.options.speed + "ms; -webkit-animation-duration: " + o.options.speed + "ms; -moz-transition-duration: " + o.options.speed + "ms; -moz-animation-duration: " + o.options.speed + "ms; -o-transition-duration: " + o.options.speed + "ms; -o-animation-duration: " + o.options.speed + "ms; -ms-transition-duration: " + o.options.speed + "ms; -ms-animation-duration: " + o.options.speed + "ms; transition-duration: " + o.options.speed + "ms; animation-duration: " + o.options.speed + "ms;",
- u = o.options.minWidth ? "min-width:" + Math.round(o.options.minWidth) + "px;" : "",
- p = o.options.maxWidth ? "max-width:" + Math.round(o.options.maxWidth) + "px;" : "",
- d = o.options.interactive ? "pointer-events: auto;" : "";
- if (o.$tooltip = e('<div class="tooltipster-base ' + o.options.theme + '" style="' + u + " " + p + " " + d + " " + l + '"><div class="tooltipster-content"></div></div>'), r() && o.$tooltip.addClass(a), o._content_insert(), o.$tooltip.appendTo("body"), o.reposition(), o.options.functionReady.call(o.$el, o.$el, o.$tooltip), r() ? (o.$tooltip.addClass(a + "-show"), o.options.speed > 0 && o.$tooltip.delay(o.options.speed), o.$tooltip.queue(n)) : o.$tooltip.css("display", "none").fadeIn(o.options.speed, n), o._interval_set(), e(t).on("scroll." + o.namespace + " resize." + o.namespace, function() {
- o.reposition()
- }), o.options.autoClose)
- if (e("body").off("." + o.namespace), "hover" == o.options.trigger) {
- if (c && setTimeout(function() {
- e("body").on("touchstart." + o.namespace, function() {
- o.hide()
- })
- }, 0), o.options.interactive) {
- c && o.$tooltip.on("touchstart." + o.namespace, function(e) {
- e.stopPropagation()
- });
- var _ = null;
- o.$elProxy.add(o.$tooltip).on("mouseleave." + o.namespace + "-autoClose", function() {
- clearTimeout(_), _ = setTimeout(function() {
- o.hide()
- }, o.options.interactiveTolerance)
- }).on("mouseenter." + o.namespace + "-autoClose", function() {
- clearTimeout(_)
- })
- } else o.$elProxy.on("mouseleave." + o.namespace + "-autoClose", function() {
- o.hide()
- });
- o.options.hideOnClick && o.$elProxy.on("click." + o.namespace + "-autoClose", function() {
- o.hide()
- })
- } else "click" == o.options.trigger && (setTimeout(function() {
- e("body").on("click." + o.namespace + " touchstart." + o.namespace, function() {
- o.hide()
- })
- }, 0), o.options.interactive && o.$tooltip.on("click." + o.namespace + " touchstart." + o.namespace, function(e) {
- e.stopPropagation()
- }))
- }
- o.options.timer > 0 && (o.timerHide = setTimeout(function() {
- o.timerHide = null, o.hide()
- }, o.options.timer + s))
- }
- })
- },
- _interval_set: function() {
- var t = this;
- t.checkInterval = setInterval(function() {
- if (0 === e("body").find(t.$el).length || 0 === e("body").find(t.$elProxy).length || "hidden" == t.Status || 0 === e("body").find(t.$tooltip).length)("shown" == t.Status || "appearing" == t.Status) && t.hide(), t._interval_cancel();
- else if (t.options.positionTracker) {
- var i = t._repositionInfo(t.$elProxy),
- o = !1;
- n(i.dimension, t.elProxyPosition.dimension) && ("fixed" === t.$elProxy.css("position") ? n(i.position, t.elProxyPosition.position) && (o = !0) : n(i.offset, t.elProxyPosition.offset) && (o = !0)), o || (t.reposition(), t.options.positionTrackerCallback.call(t, t.$el))
- }
- }, 200)
- },
- _interval_cancel: function() {
- clearInterval(this.checkInterval), this.checkInterval = null
- },
- _content_set: function(e) {
- "object" == typeof e && null !== e && this.options.contentCloning && (e = e.clone(!0)), this.Content = e
- },
- _content_insert: function() {
- var e = this,
- t = this.$tooltip.find(".tooltipster-content");
- "string" != typeof e.Content || e.options.contentAsHTML ? t.empty().append(e.Content) : t.text(e.Content)
- },
- _update: function(e) {
- var t = this;
- t._content_set(e), null !== t.Content ? "hidden" !== t.Status && (t._content_insert(), t.reposition(), t.options.updateAnimation && (r() ? (t.$tooltip.css({
- width: "",
- "-webkit-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- "-moz-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- "-o-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- "-ms-transition": "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms",
- transition: "all " + t.options.speed + "ms, width 0ms, height 0ms, left 0ms, top 0ms"
- }).addClass("tooltipster-content-changing"), setTimeout(function() {
- "hidden" != t.Status && (t.$tooltip.removeClass("tooltipster-content-changing"), setTimeout(function() {
- "hidden" !== t.Status && t.$tooltip.css({
- "-webkit-transition": t.options.speed + "ms",
- "-moz-transition": t.options.speed + "ms",
- "-o-transition": t.options.speed + "ms",
- "-ms-transition": t.options.speed + "ms",
- transition: t.options.speed + "ms"
- })
- }, t.options.speed))
- }, t.options.speed)) : t.$tooltip.fadeTo(t.options.speed, .5, function() {
- "hidden" != t.Status && t.$tooltip.fadeTo(t.options.speed, 1)
- }))) : t.hide()
- },
- _repositionInfo: function(e) {
- return {
- dimension: {
- height: e.outerHeight(!1),
- width: e.outerWidth(!1)
- },
- offset: e.offset(),
- position: {
- left: parseInt(e.css("left")),
- top: parseInt(e.css("top"))
- }
- }
- },
- hide: function(i) {
- var o = this;
- i && o.callbacks.hide.push(i), o.callbacks.show = [], clearTimeout(o.timerShow), o.timerShow = null, clearTimeout(o.timerHide), o.timerHide = null;
- var n = function() {
- e.each(o.callbacks.hide, function(e, t) {
- t.call(o.$el)
- }), o.callbacks.hide = []
- };
- if ("shown" == o.Status || "appearing" == o.Status) {
- o.Status = "disappearing";
- var s = function() {
- o.Status = "hidden", "object" == typeof o.Content && null !== o.Content && o.Content.detach(), o.$tooltip.remove(), o.$tooltip = null, e(t).off("." + o.namespace), e("body").off("." + o.namespace).css("overflow-x", o.bodyOverflowX), e("body").off("." + o.namespace), o.$elProxy.off("." + o.namespace + "-autoClose"), o.options.functionAfter.call(o.$el, o.$el), n()
- };
- r() ? (o.$tooltip.clearQueue().removeClass("tooltipster-" + o.options.animation + "-show").addClass("tooltipster-dying"), o.options.speed > 0 && o.$tooltip.delay(o.options.speed), o.$tooltip.queue(s)) : o.$tooltip.stop().fadeOut(o.options.speed, s)
- } else "hidden" == o.Status && n();
- return o
- },
- show: function(e) {
- return this._showNow(e), this
- },
- update: function(e) {
- return this.content(e)
- },
- content: function(e) {
- return "undefined" == typeof e ? this.Content : (this._update(e), this)
- },
- reposition: function() {
- function i() {
- var i = e(t).scrollLeft();
- 0 > P - i && (s = P - i, P = i), P + l - i > r && (s = P - (r + i - l), P = r + i - l)
- }
- function o(i, o) {
- a.offset.top - e(t).scrollTop() - c - O - 12 < 0 && o.indexOf("top") > -1 && (j = i), a.offset.top + a.dimension.height + c + 12 + O > e(t).scrollTop() + e(t).height() && o.indexOf("bottom") > -1 && (j = i, q = a.offset.top - c - O - 12)
- }
- var n = this;
- if (0 !== e("body").find(n.$tooltip).length) {
- n.$tooltip.css("width", ""), n.elProxyPosition = n._repositionInfo(n.$elProxy);
- var s = null,
- r = e(t).width(),
- a = n.elProxyPosition,
- l = n.$tooltip.outerWidth(!1),
- c = (n.$tooltip.innerWidth() + 1, n.$tooltip.outerHeight(!1));
- if (n.$elProxy.is("area")) {
- var u = n.$elProxy.attr("shape"),
- p = n.$elProxy.parent().attr("name"),
- d = e('img[usemap="#' + p + '"]'),
- _ = d.offset().left,
- h = d.offset().top,
- f = void 0 !== n.$elProxy.attr("coords") ? n.$elProxy.attr("coords").split(",") : void 0;
- if ("circle" == u) {
- var m = parseInt(f[0]),
- g = parseInt(f[1]),
- v = parseInt(f[2]);
- a.dimension.height = 2 * v, a.dimension.width = 2 * v, a.offset.top = h + g - v, a.offset.left = _ + m - v
- } else if ("rect" == u) {
- var m = parseInt(f[0]),
- g = parseInt(f[1]),
- $ = parseInt(f[2]),
- y = parseInt(f[3]);
- a.dimension.height = y - g, a.dimension.width = $ - m, a.offset.top = h + g, a.offset.left = _ + m
- } else if ("poly" == u) {
- for (var b = 0, w = 0, k = 0, x = 0, S = "even", C = 0; C < f.length; C++) {
- var T = parseInt(f[C]);
- "even" == S ? (T > k && (k = T, 0 === C && (b = k)), b > T && (b = T), S = "odd") : (T > x && (x = T, 1 == C && (w = x)), w > T && (w = T), S = "even")
- }
- a.dimension.height = x - w, a.dimension.width = k - b, a.offset.top = h + w, a.offset.left = _ + b
- } else a.dimension.height = d.outerHeight(!1), a.dimension.width = d.outerWidth(!1), a.offset.top = h, a.offset.left = _
- }
- var P = 0,
- A = 0,
- q = 0,
- O = parseInt(n.options.offsetY),
- R = parseInt(n.options.offsetX),
- j = n.options.position;
- if ("top" == j) {
- var I = a.offset.left + l - (a.offset.left + a.dimension.width);
- P = a.offset.left + R - I / 2, q = a.offset.top - c - O - 12, i(), o("bottom", "top")
- }
- if ("top-left" == j && (P = a.offset.left + R, q = a.offset.top - c - O - 12, i(), o("bottom-left", "top-left")), "top-right" == j && (P = a.offset.left + a.dimension.width + R - l, q = a.offset.top - c - O - 12, i(), o("bottom-right", "top-right")), "bottom" == j) {
- var I = a.offset.left + l - (a.offset.left + a.dimension.width);
- P = a.offset.left - I / 2 + R, q = a.offset.top + a.dimension.height + O + 12, i(), o("top", "bottom")
- }
- if ("bottom-left" == j && (P = a.offset.left + R, q = a.offset.top + a.dimension.height + O + 12, i(), o("top-left", "bottom-left")), "bottom-right" == j && (P = a.offset.left + a.dimension.width + R - l, q = a.offset.top + a.dimension.height + O + 12, i(), o("top-right", "bottom-right")), "left" == j) {
- P = a.offset.left - R - l - 12, A = a.offset.left + R + a.dimension.width + 12;
- var F = a.offset.top + c - (a.offset.top + a.dimension.height);
- if (q = a.offset.top - F / 2 - O, 0 > P && A + l > r) {
- var E = 2 * parseFloat(n.$tooltip.css("border-width")),
- M = l + P - E;
- n.$tooltip.css("width", M + "px"), c = n.$tooltip.outerHeight(!1), P = a.offset.left - R - M - 12 - E, F = a.offset.top + c - (a.offset.top + a.dimension.height), q = a.offset.top - F / 2 - O
- } else 0 > P && (P = a.offset.left + R + a.dimension.width + 12, s = "left")
- }
- if ("right" == j) {
- P = a.offset.left + R + a.dimension.width + 12, A = a.offset.left - R - l - 12;
- var F = a.offset.top + c - (a.offset.top + a.dimension.height);
- if (q = a.offset.top - F / 2 - O, P + l > r && 0 > A) {
- var E = 2 * parseFloat(n.$tooltip.css("border-width")),
- M = r - P - E;
- n.$tooltip.css("width", M + "px"), c = n.$tooltip.outerHeight(!1), F = a.offset.top + c - (a.offset.top + a.dimension.height), q = a.offset.top - F / 2 - O
- } else P + l > r && (P = a.offset.left - R - l - 12, s = "right")
- }
- if (n.options.arrow) {
- var z = "tooltipster-arrow-" + j;
- if (n.options.arrowColor.length < 1) var N = n.$tooltip.css("background-color");
- else var N = n.options.arrowColor;
- if (s ? "left" == s ? (z = "tooltipster-arrow-right", s = "") : "right" == s ? (z = "tooltipster-arrow-left", s = "") : s = "left:" + Math.round(s) + "px;" : s = "", "top" == j || "top-left" == j || "top-right" == j) var V = parseFloat(n.$tooltip.css("border-bottom-width")),
- L = n.$tooltip.css("border-bottom-color");
- else if ("bottom" == j || "bottom-left" == j || "bottom-right" == j) var V = parseFloat(n.$tooltip.css("border-top-width")),
- L = n.$tooltip.css("border-top-color");
- else if ("left" == j) var V = parseFloat(n.$tooltip.css("border-right-width")),
- L = n.$tooltip.css("border-right-color");
- else if ("right" == j) var V = parseFloat(n.$tooltip.css("border-left-width")),
- L = n.$tooltip.css("border-left-color");
- else var V = parseFloat(n.$tooltip.css("border-bottom-width")),
- L = n.$tooltip.css("border-bottom-color");
- V > 1 && V++;
- var H = "";
- if (0 !== V) {
- var D = "",
- B = "border-color: " + L + ";"; - 1 !== z.indexOf("bottom") ? D = "margin-top: -" + Math.round(V) + "px;" : -1 !== z.indexOf("top") ? D = "margin-bottom: -" + Math.round(V) + "px;" : -1 !== z.indexOf("left") ? D = "margin-right: -" + Math.round(V) + "px;" : -1 !== z.indexOf("right") && (D = "margin-left: -" + Math.round(V) + "px;"), H = '<span class="tooltipster-arrow-border" style="' + D + " " + B + ';"></span>'
- }
- n.$tooltip.find(".tooltipster-arrow").remove();
- var W = '<div class="' + z + ' tooltipster-arrow" style="' + s + '">' + H + '<span style="border-color:' + N + ';"></span></div>';
- n.$tooltip.append(W)
- }
- n.$tooltip.css({
- top: Math.round(q) + "px",
- left: Math.round(P) + "px"
- })
- }
- return n
- },
- enable: function() {
- return this.enabled = !0, this
- },
- disable: function() {
- return this.hide(), this.enabled = !1, this
- },
- destroy: function() {
- var t = this;
- t.hide(), t.$el[0] !== t.$elProxy[0] && t.$elProxy.remove(), t.$el.removeData(t.namespace).off("." + t.namespace);
- var i = t.$el.data("tooltipster-ns");
- if (1 === i.length) {
- var o = null;
- "previous" === t.options.restoration ? o = t.$el.data("tooltipster-initialTitle") : "current" === t.options.restoration && (o = "string" == typeof t.Content ? t.Content : e("<div></div>").append(t.Content).html()), o && t.$el.attr("title", o), t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")
- } else i = e.grep(i, function(e, i) {
- return e !== t.namespace
- }), t.$el.data("tooltipster-ns", i);
- return t
- },
- elementIcon: function() {
- return this.$el[0] !== this.$elProxy[0] ? this.$elProxy[0] : void 0
- },
- elementTooltip: function() {
- return this.$tooltip ? this.$tooltip[0] : void 0
- },
- option: function(e, t) {
- return "undefined" == typeof t ? this.options[e] : (this.options[e] = t, this)
- },
- status: function() {
- return this.Status
- }
- }, e.fn[a] = function() {
- var t = arguments;
- if (0 === this.length) {
- if ("string" == typeof t[0]) {
- var i = !0;
- switch (t[0]) {
- case "setDefaults":
- e.extend(l, t[1]);
- break;
- default:
- i = !1
- }
- return i ? !0 : this
- }
- return this
- }
- if ("string" == typeof t[0]) {
- var n = "#*$~&";
- return this.each(function() {
- var i = e(this).data("tooltipster-ns"),
- o = i ? e(this).data(i[0]) : null;
- if (!o) throw new Error("You called Tooltipster's \"" + t[0] + '" method on an uninitialized element');
- if ("function" != typeof o[t[0]]) throw new Error('Unknown method .tooltipster("' + t[0] + '")');
- var s = o[t[0]](t[1], t[2]);
- return s !== o ? (n = s, !1) : void 0
- }), "#*$~&" !== n ? n : this
- }
- var s = [],
- r = t[0] && "undefined" != typeof t[0].multiple,
- a = r && t[0].multiple || !r && l.multiple,
- c = t[0] && "undefined" != typeof t[0].debug,
- u = c && t[0].debug || !c && l.debug;
- return this.each(function() {
- var i = !1,
- n = e(this).data("tooltipster-ns"),
- r = null;
- n ? a ? i = !0 : u && console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.') : i = !0, i && (r = new o(this, t[0]), n || (n = []), n.push(r.namespace), e(this).data("tooltipster-ns", n), e(this).data(r.namespace, r)), s.push(r)
- }), a ? s : this
- };
- var c = !!("ontouchstart" in t),
- u = !1;
- e("body").one("mousemove", function() {
- u = !0
- })
- }(jQuery, window, document), ! function(e) {
- "use strict";
- var t = "selectric",
- i = "Input Items Open Disabled TempShow HideSelect Wrapper Hover Responsive Above Scroll Group GroupLabel",
- o = ".sl",
- n = {
- onChange: function(t) {
- e(t).change()
- },
- maxHeight: 300,
- keySearchTimeout: 500,
- arrowButtonMarkup: '<b class="button">▾</b>',
- disableOnMobile: !0,
- openOnHover: !1,
- hoverIntentTimeout: 500,
- expandToItemText: !1,
- responsive: !1,
- preventWindowScroll: !0,
- inheritOriginalWidth: !1,
- allowWrap: !0,
- customClass: {
- prefix: t,
- camelCase: !1,
- overwrite: !0
- },
- optionsItemBuilder: "{text}",
- labelBuilder: "{text}"
- },
- s = {
- add: function(e, t, i) {
- this[e] || (this[e] = {}), this[e][t] = i
- },
- remove: function(e, t) {
- delete this[e][t]
- }
- },
- r = {
- replaceDiacritics: function(e) {
- for (var t = "40-46 50-53 54-57 62-70 71-74 61 47 77".replace(/\d+/g, "\\3$&").split(" "), i = t.length; i--;) e = e.toLowerCase().replace(RegExp("[" + t[i] + "]", "g"), "aeiouncy".charAt(i));
- return e
- },
- format: function(e) {
- var t = arguments;
- return ("" + e).replace(/{(\d+|(\w+))}/g, function(e, i, o) {
- return o && t[1] ? t[1][o] : t[i]
- })
- },
- nextEnabledItem: function(e, t) {
- for (; e[t = (t + 1) % e.length].disabled;);
- return t
- },
- previousEnabledItem: function(e, t) {
- for (; e[t = (t > 0 ? t : e.length) - 1].disabled;);
- return t
- },
- toDash: function(e) {
- return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()
- },
- triggerCallback: function(i, o) {
- var n = o.element,
- a = o.options["on" + i];
- e.isFunction(a) && a.call(n, n, o), s[i] && e.each(s[i], function() {
- this.call(n, n, o)
- }), e(n).trigger(t + "-" + r.toDash(i), o)
- }
- },
- a = e(document),
- l = e(window),
- c = function(s, c) {
- function u(t) {
- if (E.options = e.extend(!0, {}, n, E.options, t), E.classes = {}, E.element = s, r.triggerCallback("BeforeInit", E), E.options.disableOnMobile && V) return void(E.disableOnMobile = !0);
- y(!0);
- var o = E.options.customClass,
- a = i.split(" "),
- l = M.width();
- e.each(a, function(e, t) {
- var i = o.prefix + t;
- E.classes[t.toLowerCase()] = o.camelCase ? i : r.toDash(i)
- }), b = e("<input/>", {
- "class": E.classes.input,
- readonly: V
- }), w = e("<div/>", {
- "class": E.classes.items,
- tabindex: -1
- }), k = e("<div/>", {
- "class": E.classes.scroll
- }), x = e("<div/>", {
- "class": o.prefix,
- html: E.options.arrowButtonMarkup
- }), S = e('<p class="label"/>'), C = M.wrap("<div>").parent().append(x.prepend(S), w, b), I = {
- open: f,
- close: g,
- destroy: y,
- refresh: d,
- init: u
- }, M.on(I).wrap('<div class="' + E.classes.hideselect + '">'), e.extend(E, I), F = E.options.labelBuilder, E.options.inheritOriginalWidth && l > 0 && C.width(l), p()
- }
- function p() {
- E.items = [];
- var t = M.children(),
- i = "<ul>",
- n = t.filter(":selected").index(),
- s = 0;
- A = P = ~n ? n : 0, (j = t.length) && (t.each(function() {
- function t() {
- var t = e(this),
- o = t.html(),
- n = t.prop("disabled"),
- a = E.options.optionsItemBuilder;
- E.items[s] = {
- element: t,
- value: t.val(),
- text: o,
- slug: r.replaceDiacritics(o),
- disabled: n
- }, i += r.format('<li data-index="{1}" class="{2}">{3}</li>', s, e.trim([s == A ? "selected" : "", s == j - 1 ? "last" : "", n ? "disabled" : ""].join(" ")), e.isFunction(a) ? a(E.items[s], t, s) : r.format(a, E.items[s])), s++
- }
- var o = e(this);
- if (o.is("optgroup")) {
- var n = o.prop("disabled"),
- a = o.children();
- i += r.format('<ul class="{1}"><li class="{2}">{3}</li>', e.trim([E.classes.group, n ? "disabled" : "", o.prop("class")].join(" ")), E.classes.grouplabel, o.prop("label")), n && a.prop("disabled", !0), a.each(t), i += "</ul>"
- } else t.call(o)
- }), w.append(k.html(i + "</ul>")), S.html(e.isFunction(F) ? F(E.items[A]) : r.format(F, E.items[A]))), x.add(M).add(C).add(b).off(o), C.prop("class", [E.classes.wrapper, E.options.customClass.overwrite ? M.prop("class").replace(/\S+/g, E.options.customClass.prefix + "-$&") : M.prop("class"), E.options.responsive ? E.classes.responsive : ""].join(" ")), M.prop("disabled") ? (C.addClass(E.classes.disabled), b.prop("disabled", !0)) : (N = !0, C.removeClass(E.classes.disabled).on("mouseenter" + o + " mouseleave" + o, function(t) {
- e(this).toggleClass(E.classes.hover), E.options.openOnHover && (clearTimeout(E.closeTimer), "mouseleave" == t.type ? E.closeTimer = setTimeout(g, E.options.hoverIntentTimeout) : f())
- }), x.on("click" + o, function(e) {
- z ? g() : f(e)
- }), b.prop({
- tabindex: L,
- disabled: !1
- }).on("keypress" + o, _).on("keydown" + o, function(e) {
- _(e), clearTimeout(E.resetStr), E.resetStr = setTimeout(function() {
- b.val("")
- }, E.options.keySearchTimeout);
- var t = e.keyCode || e.which;
- if (t > 36 && 41 > t) {
- if (!E.options.allowWrap && (39 > t && 0 == P || t > 38 && P + 1 == E.items.length)) return;
- v(r[(39 > t ? "previous" : "next") + "EnabledItem"](E.items, P))
- }
- }).on("focusin" + o, function(e) {
- b.one("blur", function() {
- b.blur()
- }), z || f(e)
- }).on("oninput" in b[0] ? "input" : "keyup", function() {
- b.val().length && e.each(E.items, function(e, t) {
- return RegExp("^" + b.val(), "i").test(t.slug) && !t.disabled ? (v(e), !1) : void 0
- })
- }), M.prop("tabindex", !1), T = e("li", w.removeAttr("style")).on({
- mousedown: function(e) {
- e.preventDefault(), e.stopPropagation()
- },
- click: function() {
- return v(e(this).data("index"), !0), !1
- }
- }).filter("[data-index]")), r.triggerCallback("Init", E)
- }
- function d() {
- r.triggerCallback("Refresh", E), p()
- }
- function _(e) {
- var t = e.keyCode || e.which;
- 13 == t && e.preventDefault(), /^(9|13|27)$/.test(t) && (e.stopPropagation(), v(P, !0))
- }
- function h() {
- var e = w.closest(":visible").children(":hidden").addClass(E.classes.tempshow),
- t = E.options.maxHeight,
- i = w.outerWidth(),
- o = x.outerWidth() - (i - w.width());
- !E.options.expandToItemText || o > i ? R = o : (w.css("overflow", "scroll"), C.width(9e4), R = w.width(), w.css("overflow", ""), C.width("")), w.width(R).height() > t && w.height(t), e.removeClass(E.classes.tempshow)
- }
- function f(i) {
- r.triggerCallback("BeforeOpen", E), i && (i.preventDefault(), i.stopPropagation()), N && (h(), e("." + E.classes.hideselect, "." + E.classes.open).children()[t]("close"), z = !0, q = w.outerHeight(), O = w.height(), C.addClass(E.classes.open), b.val("").is(":focus") || b.focus(), a.on("click" + o, g).on("scroll" + o, m), m(), E.options.preventWindowScroll && a.on("mousewheel" + o + " DOMMouseScroll" + o, "." + E.classes.scroll, function(t) {
- var i = t.originalEvent,
- o = e(this).scrollTop(),
- n = 0;
- "detail" in i && (n = -1 * i.detail), "wheelDelta" in i && (n = i.wheelDelta), "wheelDeltaY" in i && (n = i.wheelDeltaY), "deltaY" in i && (n = -1 * i.deltaY), (o == this.scrollHeight - O && 0 > n || 0 == o && n > 0) && t.preventDefault()
- }), $(P), r.triggerCallback("Open", E))
- }
- function m() {
- C.toggleClass(E.classes.above, C.offset().top + C.outerHeight() + q > l.scrollTop() + l.height())
- }
- function g() {
- if (r.triggerCallback("BeforeClose", E), A != P) {
- r.triggerCallback("BeforeChange", E);
- var t = E.items[P].text;
- M.prop("selectedIndex", A = P).data("value", t), S.html(e.isFunction(F) ? F(E.items[P]) : r.format(F, E.items[P])), r.triggerCallback("Change", E)
- }
- a.off(o), C.removeClass(E.classes.open), z = !1, r.triggerCallback("Close", E)
- }
- function v(e, t) {
- void 0 != e && (E.items[e].disabled || (T.removeClass("selected").eq(P = e).addClass("selected"), $(e), t && g()))
- }
- function $(e) {
- var t = T.eq(e).outerHeight(),
- i = T[e].offsetTop,
- o = k.scrollTop(),
- n = i + 2 * t;
- k.scrollTop(n > o + q ? n - q : o > i - t ? i - t : o)
- }
- function y(e) {
- N && (w.add(x).add(b).remove(), !e && M.removeData(t).removeData("value"), M.prop("tabindex", L).off(o).off(I).unwrap().unwrap(), N = !1)
- }
- var b, w, k, x, S, C, T, P, A, q, O, R, j, I, F, E = this,
- M = e(s),
- z = !1,
- N = !1,
- V = /android|ip(hone|od|ad)/i.test(navigator.userAgent),
- L = M.prop("tabindex");
- u(c)
- };
- e.fn[t] = function(i) {
- return this.each(function() {
- var o = e.data(this, t);
- o && !o.disableOnMobile ? "" + i === i && o[i] ? o[i]() : o.init(i) : e.data(this, t, new c(this, i))
- })
- }, e.fn[t].hooks = s
- }(jQuery),
- function(e) {
- e.caretTo = function(e, t) {
- if (e.createTextRange) {
- var i = e.createTextRange();
- i.move("character", t), i.select()
- } else null != e.selectionStart && (e.focus(), e.setSelectionRange(t, t))
- }, e.caretPos = function(e) {
- if ("selection" in document) {
- var t = e.createTextRange();
- try {
- t.setEndPoint("EndToStart", document.selection.createRange())
- } catch (i) {
- return 0
- }
- return t.text.length
- }
- return null != e.selectionStart ? e.selectionStart : void 0
- }, e.fn.caret = function(t, i) {
- return "undefined" == typeof t ? e.caretPos(this.get(0)) : this.queue(function(o) {
- if (isNaN(t)) {
- var n = e(this).val().indexOf(t);
- i === !0 ? n += t.length : "undefined" != typeof i && (n += i), e.caretTo(this, n)
- } else e.caretTo(this, t);
- o()
- })
- }, e.fn.caretToStart = function() {
- return this.caret(0)
- }, e.fn.caretToEnd = function() {
- return this.queue(function(t) {
- e.caretTo(this, e(this).val().length), t()
- })
- }
- }(jQuery);
- var AutoResizer = function(e, t) {
- function i() {
- window.setTimeout(function() {
- o.checkResize()
- }, 0)
- }
- var o = this;
- this.$textArea = $(e), this.minHeight = this.$textArea.height(), this.options = $.extend({}, $.fn.autoResizer.defaults, t), this.$shadowArea = $("<div></div>").css({
- position: "absolute",
- top: -1e4,
- left: -1e4,
- fontSize: this.$textArea.css("fontSize") || "inherit",
- fontFamily: this.$textArea.css("fontFamily") || "inherit",
- lineHeight: this.$textArea.css("lineHeight") || "inherit",
- resize: "none"
- }).appendTo(document.body);
- var n = this.$textArea.width() || $(window).width();
- this.$shadowArea.width(n), this.options.resizeOnChange && this.$textArea.change(i).keyup(i).keydown(i).focus(i), this.checkResize()
- };
- AutoResizer.prototype = {
- constructor: AutoResizer,
- checkResize: function() {
- if (0 !== this.$textArea.height()) {
- if (0 === this.minHeight && (this.minHeight = this.$textArea.height()), 0 !== this.$textArea.width() && Math.abs(this.$shadowArea.width() - this.$textArea.width()) > 20 && this.$shadowArea.width(this.$textArea.width()), this.$textArea.height() > 400) return void this.$textArea.height(400);
- var e = this.$textArea.val().replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/\n/g, "<br/> ");
- "" === $.trim(e) && (e = "a"), this.$shadowArea.html(e);
- var t = Math.max(this.$shadowArea[0].offsetHeight + 10, this.minHeight);
- this.prevHeight && t == this.prevHeight || (this.$textArea.css("height", t), this.prevHeight = t)
- }
- }
- }, $.fn.autoResizer = function(e) {
- return this.each(function() {
- var t = $(this),
- i = t.data("autoresizer"),
- o = "object" == typeof e && e;
- i || t.data("autoresizer", i = new AutoResizer(this, o)), "string" == typeof e ? i[e]() : i.checkResize()
- })
- }, $.fn.autoResizer.defaults = {
- resizeOnChange: !0
- }, $.fn.autoResizer.Constructor = AutoResizer,
- function() {
- var e, t, i, o, n, s, r, a, l, c, u, p, d, _, h, f, m, g, v, $, y, b, w, k, x, S, C, T, P, A, q, O, R = [].slice;
- m = '<span class="odometer-value"></span>', _ = '<span class="odometer-ribbon"><span class="odometer-ribbon-inner">' + m + "</span></span>", o = '<span class="odometer-digit"><span class="odometer-digit-spacer">8</span><span class="odometer-digit-inner">' + _ + "</span></span>", r = '<span class="odometer-formatting-mark"></span>', i = "(,ddd).dd", a = /^\(?([^)]*)\)?(?:(.)(d+))?$/, l = 30, s = 2e3, e = 20, c = 2, n = .5, u = 1e3 / l, t = 1e3 / e, h = "transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd", x = document.createElement("div").style, f = null != x.transition || null != x.webkitTransition || null != x.mozTransition || null != x.oTransition, w = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame, p = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver, v = function(e) {
- var t;
- return t = document.createElement("div"), t.innerHTML = e, t.children[0]
- }, b = function(e, t) {
- return e.className = e.className.replace(new RegExp("(^| )" + t.split(" ").join("|") + "( |$)", "gi"), " ")
- }, g = function(e, t) {
- return b(e, t), e.className += " " + t
- }, S = function(e, t) {
- var i;
- return null != document.createEvent ? (i = document.createEvent("HTMLEvents"), i.initEvent(t, !0, !0), e.dispatchEvent(i)) : void 0
- }, y = function() {
- var e, t;
- return null != (e = null != (t = window.performance) && "function" == typeof t.now ? t.now() : void 0) ? e : +new Date
- }, k = function(e, t) {
- return null == t && (t = 0), t ? (e *= Math.pow(10, t), e += .5, e = Math.floor(e), e /= Math.pow(10, t)) : Math.round(e)
- }, C = function(e) {
- return 0 > e ? Math.ceil(e) : Math.floor(e)
- }, $ = function(e) {
- return e - k(e)
- }, P = !1, (T = function() {
- var e, t, i, o, n;
- if (!P && null != window.jQuery) {
- for (P = !0, o = ["html", "text"], n = [], t = 0, i = o.length; i > t; t++) e = o[t], n.push(function(e) {
- var t;
- return t = window.jQuery.fn[e], window.jQuery.fn[e] = function(e) {
- var i;
- return null == e || null == (null != (i = this[0]) ? i.odometer : void 0) ? t.apply(this, arguments) : this[0].odometer.update(e)
- }
- }(e));
- return n
- }
- })(), setTimeout(T, 0), d = function() {
- function e(t) {
- var i, o, n, r, a, l, p, d, _, h, f = this;
- if (this.options = t, this.el = this.options.el, null != this.el.odometer) return this.el.odometer;
- this.el.odometer = this, d = e.options;
- for (o in d) r = d[o], null == this.options[o] && (this.options[o] = r);
- null == (a = this.options).duration && (a.duration = s), this.MAX_VALUES = this.options.duration / u / c | 0, this.resetFormat(), this.value = this.cleanValue(null != (_ = this.options.value) ? _ : ""), this.renderInside(), this.render();
- try {
- for (h = ["innerHTML", "innerText", "textContent"], l = 0, p = h.length; p > l; l++) n = h[l], null != this.el[n] && ! function(e) {
- return Object.defineProperty(f.el, e, {
- get: function() {
- var t;
- return "innerHTML" === e ? f.inside.outerHTML : null != (t = f.inside.innerText) ? t : f.inside.textContent
- },
- set: function(e) {
- return f.update(e)
- }
- })
- }(n)
- } catch (m) {
- i = m, this.watchForMutations()
- }
- }
- return e.prototype.renderInside = function() {
- return this.inside = document.createElement("div"), this.inside.className = "odometer-inside", this.el.innerHTML = "", this.el.appendChild(this.inside)
- }, e.prototype.watchForMutations = function() {
- var e, t = this;
- if (null != p) try {
- return null == this.observer && (this.observer = new p(function() {
- var e;
- return e = t.el.innerText, t.renderInside(), t.render(t.value), t.update(e)
- })), this.watchMutations = !0, this.startWatchingMutations()
- } catch (i) {
- e = i
- }
- }, e.prototype.startWatchingMutations = function() {
- return this.watchMutations ? this.observer.observe(this.el, {
- childList: !0
- }) : void 0
- }, e.prototype.stopWatchingMutations = function() {
- var e;
- return null != (e = this.observer) ? e.disconnect() : void 0
- }, e.prototype.cleanValue = function(e) {
- var t;
- return "string" == typeof e && (e = e.replace(null != (t = this.format.radix) ? t : ".", "<radix>"), e = e.replace(/[.,]/g, ""), e = e.replace("<radix>", "."), e = parseFloat(e, 10) || 0), k(e, this.format.precision)
- }, e.prototype.bindTransitionEnd = function() {
- var e, t, i, o, n, s, r = this;
- if (!this.transitionEndBound) {
- for (this.transitionEndBound = !0, t = !1, n = h.split(" "), s = [], i = 0, o = n.length; o > i; i++) e = n[i], s.push(this.el.addEventListener(e, function() {
- return t ? !0 : (t = !0, setTimeout(function() {
- return r.render(), t = !1, S(r.el, "odometerdone")
- }, 0), !0)
- }, !1));
- return s
- }
- }, e.prototype.resetFormat = function() {
- var e, t, o, n, s, r, l, c;
- if (e = null != (l = this.options.format) ? l : i, e || (e = "d"), o = a.exec(e), !o) throw new Error("Odometer: Unparsable digit format");
- return c = o.slice(1, 4), r = c[0], s = c[1], t = c[2], n = (null != t ? t.length : void 0) || 0, this.format = {
- repeating: r,
- radix: s,
- precision: n
- }
- }, e.prototype.render = function(e) {
- var t, i, o, n, s, r, a, l, c, u, p, d;
- for (null == e && (e = this.value), this.stopWatchingMutations(), this.resetFormat(), this.inside.innerHTML = "", r = this.options.theme, t = this.el.className.split(" "), s = [], l = 0, u = t.length; u > l; l++) i = t[l], i.length && ((n = /^odometer-theme-(.+)$/.exec(i)) ? r = n[1] : /^odometer(-|$)/.test(i) || s.push(i));
- for (s.push("odometer"), f || s.push("odometer-no-transitions"), s.push(r ? "odometer-theme-" + r : "odometer-auto-theme"), this.el.className = s.join(" "), this.ribbons = {}, this.digits = [], a = !this.format.precision || !$(e) || !1, d = e.toString().split("").reverse(), c = 0, p = d.length; p > c; c++) o = d[c], "." === o && (a = !0), this.addDigit(o, a);
- return this.startWatchingMutations()
- }, e.prototype.update = function(e) {
- var t, i = this;
- return e = this.cleanValue(e), (t = e - this.value) ? (b(this.el, "odometer-animating-up odometer-animating-down odometer-animating"), t > 0 ? g(this.el, "odometer-animating-up") : g(this.el, "odometer-animating-down"), this.stopWatchingMutations(), this.animate(e), this.startWatchingMutations(), setTimeout(function() {
- return i.el.offsetHeight, g(i.el, "odometer-animating")
- }, 0), this.value = e) : void 0
- }, e.prototype.renderDigit = function() {
- return v(o)
- }, e.prototype.insertDigit = function(e, t) {
- return null != t ? this.inside.insertBefore(e, t) : this.inside.children.length ? this.inside.insertBefore(e, this.inside.children[0]) : this.inside.appendChild(e)
- }, e.prototype.addSpacer = function(e, t, i) {
- var o;
- return o = v(r), o.innerHTML = e, i && g(o, i), this.insertDigit(o, t)
- }, e.prototype.addDigit = function(e, t) {
- var i, o, n, s;
- if (null == t && (t = !0), "-" === e) return this.addSpacer(e, null, "odometer-negation-mark");
- if ("." === e) return this.addSpacer(null != (s = this.format.radix) ? s : ".", null, "odometer-radix-mark");
- if (t)
- for (n = !1;;) {
- if (!this.format.repeating.length) {
- if (n) throw new Error("Bad odometer format without digits");
- this.resetFormat(), n = !0
- }
- if (i = this.format.repeating[this.format.repeating.length - 1], this.format.repeating = this.format.repeating.substring(0, this.format.repeating.length - 1), "d" === i) break;
- this.addSpacer(i)
- }
- return o = this.renderDigit(), o.querySelector(".odometer-value").innerHTML = e, this.digits.push(o), this.insertDigit(o)
- }, e.prototype.animate = function(e) {
- return f && "count" !== this.options.animation ? this.animateSlide(e) : this.animateCount(e)
- }, e.prototype.animateCount = function(e) {
- var i, o, n, s, r, a = this;
- return (o = +e - this.value) ? (s = n = y(), i = this.value, (r = function() {
- var l, c, u;
- return y() - s > a.options.duration ? (a.value = e, a.render(), void S(a.el, "odometerdone")) : (l = y() - n, l > t && (n = y(), u = l / a.options.duration, c = o * u, i += c, a.render(Math.round(i))), null != w ? w(r) : setTimeout(r, t))
- })()) : void 0
- }, e.prototype.getDigitCount = function() {
- var e, t, i, o, n, s;
- for (o = 1 <= arguments.length ? R.call(arguments, 0) : [], e = n = 0, s = o.length; s > n; e = ++n) i = o[e], o[e] = Math.abs(i);
- return t = Math.max.apply(Math, o), Math.ceil(Math.log(t + 1) / Math.log(10))
- }, e.prototype.getFractionalDigitCount = function() {
- var e, t, i, o, n, s, r;
- for (n = 1 <= arguments.length ? R.call(arguments, 0) : [], t = /^\-?\d*\.(\d*?)0*$/, e = s = 0, r = n.length; r > s; e = ++s) o = n[e], n[e] = o.toString(), i = t.exec(n[e]), n[e] = null == i ? 0 : i[1].length;
- return Math.max.apply(Math, n)
- }, e.prototype.resetDigits = function() {
- return this.digits = [], this.ribbons = [], this.inside.innerHTML = "", this.resetFormat()
- }, e.prototype.animateSlide = function(e) {
- var t, i, o, s, r, a, l, c, u, p, d, _, h, f, m, v, $, y, b, w, k, x, S, T, P, A, q;
- if (v = this.value, c = this.getFractionalDigitCount(v, e), c && (e *= Math.pow(10, c), v *= Math.pow(10, c)), o = e - v) {
- for (this.bindTransitionEnd(), s = this.getDigitCount(v, e), r = [], t = 0, d = b = 0; s >= 0 ? s > b : b > s; d = s >= 0 ? ++b : --b) {
- if ($ = C(v / Math.pow(10, s - d - 1)), l = C(e / Math.pow(10, s - d - 1)), a = l - $, Math.abs(a) > this.MAX_VALUES) {
- for (p = [], _ = a / (this.MAX_VALUES + this.MAX_VALUES * t * n), i = $; a > 0 && l > i || 0 > a && i > l;) p.push(Math.round(i)), i += _;
- p[p.length - 1] !== l && p.push(l), t++
- } else p = function() {
- q = [];
- for (var e = $; l >= $ ? l >= e : e >= l; l >= $ ? e++ : e--) q.push(e);
- return q
- }.apply(this);
- for (d = w = 0, x = p.length; x > w; d = ++w) u = p[d], p[d] = Math.abs(u % 10);
- r.push(p)
- }
- for (this.resetDigits(), A = r.reverse(), d = k = 0, S = A.length; S > k; d = ++k)
- for (p = A[d], this.digits[d] || this.addDigit(" ", d >= c), null == (y = this.ribbons)[d] && (y[d] = this.digits[d].querySelector(".odometer-ribbon-inner")), this.ribbons[d].innerHTML = "", 0 > o && (p = p.reverse()), h = P = 0, T = p.length; T > P; h = ++P) u = p[h], m = document.createElement("div"), m.className = "odometer-value", m.innerHTML = u, this.ribbons[d].appendChild(m), h === p.length - 1 && g(m, "odometer-last-value"), 0 === h && g(m, "odometer-first-value");
- return 0 > $ && this.addDigit("-"), f = this.inside.querySelector(".odometer-radix-mark"), null != f && f.parent.removeChild(f), c ? this.addSpacer(this.format.radix, this.digits[c - 1], "odometer-radix-mark") : void 0
- }
- }, e
- }(), d.options = null != (q = window.odometerOptions) ? q : {}, setTimeout(function() {
- var e, t, i, o, n;
- if (window.odometerOptions) {
- o = window.odometerOptions, n = [];
- for (e in o) t = o[e], n.push(null != (i = d.options)[e] ? (i = d.options)[e] : i[e] = t);
- return n
- }
- }, 0), d.init = function() {
- var e, t, i, o, n, s;
- if (null != document.querySelectorAll) {
- for (t = document.querySelectorAll(d.options.selector || ".odometer"), s = [], i = 0, o = t.length; o > i; i++) e = t[i], s.push(e.odometer = new d({
- el: e,
- value: null != (n = e.innerText) ? n : e.textContent
- }));
- return s
- }
- }, null != (null != (O = document.documentElement) ? O.doScroll : void 0) && null != document.createEventObject ? (A = document.onreadystatechange, document.onreadystatechange = function() {
- return "complete" === document.readyState && d.options.auto !== !1 && d.init(), null != A ? A.apply(this, arguments) : void 0
- }) : document.addEventListener("DOMContentLoaded", function() {
- return d.options.auto !== !1 ? d.init() : void 0
- }, !1), "function" == typeof define && define.amd ? define(["jquery"], function() {
- return d
- }) : typeof exports === !1 ? module.exports = d : window.Odometer = d
- }.call(this),
- function(e) {
- function t(e, t, n) {
- var s = e[0],
- r = /er/.test(n) ? _indeterminate : /bl/.test(n) ? _ : p,
- a = n == _update ? {
- checked: s[p],
- disabled: s[_],
- indeterminate: "true" == e.attr(_indeterminate) || "false" == e.attr(_determinate)
- } : s[r];
- if (/^(ch|di|in)/.test(n) && !a) i(e, r);
- else if (/^(un|en|de)/.test(n) && a) o(e, r);
- else if (n == _update)
- for (var l in a) a[l] ? i(e, l, !0) : o(e, l, !0);
- else t && "toggle" != n || (t || e[_callback]("ifClicked"), a ? s[_type] !== u && o(e, r) : i(e, r))
- }
- function i(t, i, n) {
- var h = t[0],
- f = t.parent(),
- m = i == p,
- g = i == _indeterminate,
- v = i == _,
- $ = g ? _determinate : m ? d : "enabled",
- y = s(t, $ + r(h[_type])),
- b = s(t, i + r(h[_type]));
- if (!0 !== h[i]) {
- if (!n && i == p && h[_type] == u && h.name) {
- var w = t.closest("form"),
- k = 'input[name="' + h.name + '"]',
- k = w.length ? w.find(k) : e(k);
- k.each(function() {
- this !== h && e(this).data(l) && o(e(this), i)
- })
- }
- g ? (h[i] = !0, h[p] && o(t, p, "force")) : (n || (h[i] = !0), m && h[_indeterminate] && o(t, _indeterminate, !1)), a(t, m, i, n)
- }
- h[_] && s(t, _cursor, !0) && f.find("." + c).css(_cursor, "default"), f[_add](b || s(t, i) || ""), f.attr("role") && !g && f.attr("aria-" + (v ? _ : p), "true"), f[_remove](y || s(t, $) || "")
- }
- function o(e, t, i) {
- var o = e[0],
- n = e.parent(),
- l = t == p,
- u = t == _indeterminate,
- h = t == _,
- f = u ? _determinate : l ? d : "enabled",
- m = s(e, f + r(o[_type])),
- g = s(e, t + r(o[_type]));
- !1 !== o[t] && ((u || !i || "force" == i) && (o[t] = !1), a(e, l, f, i)), !o[_] && s(e, _cursor, !0) && n.find("." + c).css(_cursor, "pointer"), n[_remove](g || s(e, t) || ""), n.attr("role") && !u && n.attr("aria-" + (h ? _ : p), "false"), n[_add](m || s(e, f) || "")
- }
- function n(t, i) {
- t.data(l) && (t.parent().html(t.attr("style", t.data(l).s || "")), i && t[_callback](i), t.off(".i").unwrap(), e(_label + '[for="' + t[0].id + '"]').add(t.closest(_label)).off(".i"))
- }
- function s(e, t, i) {
- return e.data(l) ? e.data(l).o[t + (i ? "" : "Class")] : void 0
- }
- function r(e) {
- return e.charAt(0).toUpperCase() + e.slice(1)
- }
- function a(e, t, i, o) {
- o || (t && e[_callback]("ifToggled"), e[_callback]("ifChanged")[_callback]("if" + r(i)))
- }
- var l = "iCheck",
- c = l + "-helper",
- u = "radio",
- p = "checked",
- d = "un" + p,
- _ = "disabled";
- _determinate = "determinate", _indeterminate = "in" + _determinate, _update = "update", _type = "type", _click = "click", _touch = "touchbegin.i touchend.i", _add = "addClass", _remove = "removeClass", _callback = "trigger", _label = "label", _cursor = "cursor", _mobile = /ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent), e.fn[l] = function(s, r) {
- var a = 'input[type="checkbox"], input[type="' + u + '"]',
- d = e(),
- h = function(t) {
- t.each(function() {
- var t = e(this);
- d = d.add(t.is(a) ? t : t.find(a))
- })
- };
- if (/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(s)) return s = s.toLowerCase(), h(this), d.each(function() {
- var i = e(this);
- "destroy" == s ? n(i, "ifDestroyed") : t(i, !0, s), e.isFunction(r) && r()
- });
- if ("object" != typeof s && s) return this;
- var f = e.extend({
- checkedClass: p,
- disabledClass: _,
- indeterminateClass: _indeterminate,
- labelHover: !0
- }, s),
- m = f.handle,
- g = f.hoverClass || "hover",
- v = f.focusClass || "focus",
- $ = f.activeClass || "active",
- y = !!f.labelHover,
- b = f.labelHoverClass || "hover",
- w = 0 | ("" + f.increaseArea).replace("%", "");
- return ("checkbox" == m || m == u) && (a = 'input[type="' + m + '"]'), -50 > w && (w = -50), h(this), d.each(function() {
- var s = e(this);
- n(s);
- var r = this,
- a = r.id,
- d = -w + "%",
- h = 100 + 2 * w + "%",
- h = {
- position: "absolute",
- top: d,
- left: d,
- display: "block",
- width: h,
- height: h,
- margin: 0,
- padding: 0,
- background: "#fff",
- border: 0,
- opacity: 0
- },
- d = _mobile ? {
- position: "absolute",
- visibility: "hidden"
- } : w ? h : {
- position: "absolute",
- opacity: 0
- },
- m = "checkbox" == r[_type] ? f.checkboxClass || "icheckbox" : f.radioClass || "i" + u,
- k = e(_label + '[for="' + a + '"]').add(s.closest(_label)),
- x = !!f.aria,
- S = l + "-" + Math.random().toString(36).substr(2, 6),
- C = '<div class="' + m + '" ' + (x ? 'role="' + r[_type] + '" ' : "");
- x && k.each(function() {
- C += 'aria-labelledby="', this.id ? C += this.id : (this.id = S, C += S), C += '"'
- }), C = s.wrap(C + "/>")[_callback]("ifCreated").parent().append(f.insert), h = e('<ins class="' + c + '"/>').css(h).appendTo(C), s.data(l, {
- o: f,
- s: s.attr("style")
- }).css(d), f.inheritClass && C[_add](r.className || ""), f.inheritID && a && C.attr("id", l + "-" + a), "static" == C.css("position") && C.css("position", "relative"), t(s, !0, _update), k.length && k.on(_click + ".i mouseover.i mouseout.i " + _touch, function(i) {
- var o = i[_type],
- n = e(this);
- if (!r[_]) {
- if (o == _click) {
- if (e(i.target).is("a")) return;
- t(s, !1, !0)
- } else y && (/ut|nd/.test(o) ? (C[_remove](g), n[_remove](b)) : (C[_add](g), n[_add](b)));
- if (!_mobile) return !1;
- i.stopPropagation()
- }
- }), s.on(_click + ".i focus.i blur.i keyup.i keydown.i keypress.i", function(e) {
- var t = e[_type];
- return e = e.keyCode, t == _click ? !1 : "keydown" == t && 32 == e ? (r[_type] == u && r[p] || (r[p] ? o(s, p) : i(s, p)), !1) : void("keyup" == t && r[_type] == u ? !r[p] && i(s, p) : /us|ur/.test(t) && C["blur" == t ? _remove : _add](v))
- }), h.on(_click + " mousedown mouseup mouseover mouseout " + _touch, function(e) {
- var i = e[_type],
- o = /wn|up/.test(i) ? $ : g;
- if (!r[_]) {
- if (i == _click ? t(s, !1, !0) : (/wn|er|in/.test(i) ? C[_add](o) : C[_remove](o + " " + $), k.length && y && o == g && k[/ut|nd/.test(i) ? _remove : _add](b)), !_mobile) return !1;
- e.stopPropagation()
- }
- })
- })
- }
- }(window.jQuery || window.Zepto), ! function(e) {
- function t(e) {
- var t = e.length,
- o = i.type(e);
- return "function" === o || i.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === o || 0 === t || "number" == typeof t && t > 0 && t - 1 in e
- }
- if (!e.jQuery) {
- var i = function(e, t) {
- return new i.fn.init(e, t)
- };
- i.isWindow = function(e) {
- return null != e && e == e.window
- }, i.type = function(e) {
- return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? n[r.call(e)] || "object" : typeof e
- }, i.isArray = Array.isArray || function(e) {
- return "array" === i.type(e)
- }, i.isPlainObject = function(e) {
- var t;
- if (!e || "object" !== i.type(e) || e.nodeType || i.isWindow(e)) return !1;
- try {
- if (e.constructor && !s.call(e, "constructor") && !s.call(e.constructor.prototype, "isPrototypeOf")) return !1
- } catch (o) {
- return !1
- }
- for (t in e);
- return void 0 === t || s.call(e, t)
- }, i.each = function(e, i, o) {
- var n, s = 0,
- r = e.length,
- a = t(e);
- if (o) {
- if (a)
- for (; r > s && (n = i.apply(e[s], o), n !== !1); s++);
- else
- for (s in e)
- if (n = i.apply(e[s], o), n === !1) break
- } else if (a)
- for (; r > s && (n = i.call(e[s], s, e[s]), n !== !1); s++);
- else
- for (s in e)
- if (n = i.call(e[s], s, e[s]), n === !1) break; return e
- }, i.data = function(e, t, n) {
- if (void 0 === n) {
- var s = e[i.expando],
- r = s && o[s];
- if (void 0 === t) return r;
- if (r && t in r) return r[t]
- } else if (void 0 !== t) {
- var s = e[i.expando] || (e[i.expando] = ++i.uuid);
- return o[s] = o[s] || {}, o[s][t] = n, n
- }
- }, i.removeData = function(e, t) {
- var n = e[i.expando],
- s = n && o[n];
- s && i.each(t, function(e, t) {
- delete s[t]
- })
- }, i.extend = function() {
- var e, t, o, n, s, r, a = arguments[0] || {},
- l = 1,
- c = arguments.length,
- u = !1;
- for ("boolean" == typeof a && (u = a, a = arguments[l] || {}, l++), "object" != typeof a && "function" !== i.type(a) && (a = {}), l === c && (a = this, l--); c > l; l++)
- if (null != (s = arguments[l]))
- for (n in s) e = a[n], o = s[n], a !== o && (u && o && (i.isPlainObject(o) || (t = i.isArray(o))) ? (t ? (t = !1,
- r = e && i.isArray(e) ? e : []) : r = e && i.isPlainObject(e) ? e : {}, a[n] = i.extend(u, r, o)) : void 0 !== o && (a[n] = o));
- return a
- }, i.queue = function(e, o, n) {
- function s(e, i) {
- var o = i || [];
- return null != e && (t(Object(e)) ? ! function(e, t) {
- for (var i = +t.length, o = 0, n = e.length; i > o;) e[n++] = t[o++];
- if (i !== i)
- for (; void 0 !== t[o];) e[n++] = t[o++];
- return e.length = n, e
- }(o, "string" == typeof e ? [e] : e) : [].push.call(o, e)), o
- }
- if (e) {
- o = (o || "fx") + "queue";
- var r = i.data(e, o);
- return n ? (!r || i.isArray(n) ? r = i.data(e, o, s(n)) : r.push(n), r) : r || []
- }
- }, i.dequeue = function(e, t) {
- i.each(e.nodeType ? [e] : e, function(e, o) {
- t = t || "fx";
- var n = i.queue(o, t),
- s = n.shift();
- "inprogress" === s && (s = n.shift()), s && ("fx" === t && n.unshift("inprogress"), s.call(o, function() {
- i.dequeue(o, t)
- }))
- })
- }, i.fn = i.prototype = {
- init: function(e) {
- if (e.nodeType) return this[0] = e, this;
- throw new Error("Not a DOM node.")
- },
- offset: function() {
- var t = this[0].getBoundingClientRect ? this[0].getBoundingClientRect() : {
- top: 0,
- left: 0
- };
- return {
- top: t.top + (e.pageYOffset || document.scrollTop || 0) - (document.clientTop || 0),
- left: t.left + (e.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || 0)
- }
- },
- position: function() {
- function e() {
- for (var e = this.offsetParent || document; e && "html" === !e.nodeType.toLowerCase && "static" === e.style.position;) e = e.offsetParent;
- return e || document
- }
- var t = this[0],
- e = e.apply(t),
- o = this.offset(),
- n = /^(?:body|html)$/i.test(e.nodeName) ? {
- top: 0,
- left: 0
- } : i(e).offset();
- return o.top -= parseFloat(t.style.marginTop) || 0, o.left -= parseFloat(t.style.marginLeft) || 0, e.style && (n.top += parseFloat(e.style.borderTopWidth) || 0, n.left += parseFloat(e.style.borderLeftWidth) || 0), {
- top: o.top - n.top,
- left: o.left - n.left
- }
- }
- };
- var o = {};
- i.expando = "velocity" + (new Date).getTime(), i.uuid = 0;
- for (var n = {}, s = n.hasOwnProperty, r = n.toString, a = "Boolean Number String Function Array Date RegExp Object Error".split(" "), l = 0; l < a.length; l++) n["[object " + a[l] + "]"] = a[l].toLowerCase();
- i.fn.init.prototype = i.fn, e.Velocity = {
- Utilities: i
- }
- }
- }(window),
- function(e) {
- "object" == typeof module && "object" == typeof module.exports ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : e()
- }(function() {
- return function(e, t, i, o) {
- function n(e) {
- for (var t = -1, i = e ? e.length : 0, o = []; ++t < i;) {
- var n = e[t];
- n && o.push(n)
- }
- return o
- }
- function s(e) {
- return f.isWrapped(e) ? e = [].slice.call(e) : f.isNode(e) && (e = [e]), e
- }
- function r(e) {
- var t = d.data(e, "velocity");
- return null === t ? o : t
- }
- function a(e) {
- return function(t) {
- return Math.round(t * e) * (1 / e)
- }
- }
- function l(e, i, o, n) {
- function s(e, t) {
- return 1 - 3 * t + 3 * e
- }
- function r(e, t) {
- return 3 * t - 6 * e
- }
- function a(e) {
- return 3 * e
- }
- function l(e, t, i) {
- return ((s(t, i) * e + r(t, i)) * e + a(t)) * e
- }
- function c(e, t, i) {
- return 3 * s(t, i) * e * e + 2 * r(t, i) * e + a(t)
- }
- function u(t, i) {
- for (var n = 0; f > n; ++n) {
- var s = c(i, e, o);
- if (0 === s) return i;
- var r = l(i, e, o) - t;
- i -= r / s
- }
- return i
- }
- function p() {
- for (var t = 0; $ > t; ++t) k[t] = l(t * y, e, o)
- }
- function d(t, i, n) {
- var s, r, a = 0;
- do r = i + (n - i) / 2, s = l(r, e, o) - t, s > 0 ? n = r : i = r; while (Math.abs(s) > g && ++a < v);
- return r
- }
- function _(t) {
- for (var i = 0, n = 1, s = $ - 1; n != s && k[n] <= t; ++n) i += y;
- --n;
- var r = (t - k[n]) / (k[n + 1] - k[n]),
- a = i + r * y,
- l = c(a, e, o);
- return l >= m ? u(t, a) : 0 == l ? a : d(t, i, i + y)
- }
- function h() {
- x = !0, (e != i || o != n) && p()
- }
- var f = 4,
- m = .001,
- g = 1e-7,
- v = 10,
- $ = 11,
- y = 1 / ($ - 1),
- b = "Float32Array" in t;
- if (4 !== arguments.length) return !1;
- for (var w = 0; 4 > w; ++w)
- if ("number" != typeof arguments[w] || isNaN(arguments[w]) || !isFinite(arguments[w])) return !1;
- e = Math.min(e, 1), o = Math.min(o, 1), e = Math.max(e, 0), o = Math.max(o, 0);
- var k = b ? new Float32Array($) : new Array($),
- x = !1,
- S = function(t) {
- return x || h(), e === i && o === n ? t : 0 === t ? 0 : 1 === t ? 1 : l(_(t), i, n)
- };
- S.getControlPoints = function() {
- return [{
- x: e,
- y: i
- }, {
- x: o,
- y: n
- }]
- };
- var C = "generateBezier(" + [e, i, o, n] + ")";
- return S.toString = function() {
- return C
- }, S
- }
- function c(e, t) {
- var i = e;
- return f.isString(e) ? $.Easings[e] || (i = !1) : i = f.isArray(e) && 1 === e.length ? a.apply(null, e) : f.isArray(e) && 2 === e.length ? y.apply(null, e.concat([t])) : f.isArray(e) && 4 === e.length ? l.apply(null, e) : !1, i === !1 && (i = $.Easings[$.defaults.easing] ? $.defaults.easing : v), i
- }
- function u(e) {
- if (e) {
- var t = (new Date).getTime(),
- i = $.State.calls.length;
- i > 1e4 && ($.State.calls = n($.State.calls));
- for (var s = 0; i > s; s++)
- if ($.State.calls[s]) {
- var a = $.State.calls[s],
- l = a[0],
- c = a[2],
- _ = a[3],
- h = !!_,
- m = null;
- _ || (_ = $.State.calls[s][3] = t - 16);
- for (var g = Math.min((t - _) / c.duration, 1), v = 0, y = l.length; y > v; v++) {
- var w = l[v],
- x = w.element;
- if (r(x)) {
- var S = !1;
- if (c.display !== o && null !== c.display && "none" !== c.display) {
- if ("flex" === c.display) {
- var C = ["-webkit-box", "-moz-box", "-ms-flexbox", "-webkit-flex"];
- d.each(C, function(e, t) {
- b.setPropertyValue(x, "display", t)
- })
- }
- b.setPropertyValue(x, "display", c.display)
- }
- c.visibility !== o && "hidden" !== c.visibility && b.setPropertyValue(x, "visibility", c.visibility);
- for (var T in w)
- if ("element" !== T) {
- var P, A = w[T],
- q = f.isString(A.easing) ? $.Easings[A.easing] : A.easing;
- if (1 === g) P = A.endValue;
- else {
- var O = A.endValue - A.startValue;
- if (P = A.startValue + O * q(g, c, O), !h && P === A.currentValue) continue
- }
- if (A.currentValue = P, "tween" === T) m = P;
- else {
- if (b.Hooks.registered[T]) {
- var R = b.Hooks.getRoot(T),
- j = r(x).rootPropertyValueCache[R];
- j && (A.rootPropertyValue = j)
- }
- var I = b.setPropertyValue(x, T, A.currentValue + (0 === parseFloat(P) ? "" : A.unitType), A.rootPropertyValue, A.scrollData);
- b.Hooks.registered[T] && (r(x).rootPropertyValueCache[R] = b.Normalizations.registered[R] ? b.Normalizations.registered[R]("extract", null, I[1]) : I[1]), "transform" === I[0] && (S = !0)
- }
- }
- c.mobileHA && r(x).transformCache.translate3d === o && (r(x).transformCache.translate3d = "(0px, 0px, 0px)", S = !0), S && b.flushTransformCache(x)
- }
- }
- c.display !== o && "none" !== c.display && ($.State.calls[s][2].display = !1), c.visibility !== o && "hidden" !== c.visibility && ($.State.calls[s][2].visibility = !1), c.progress && c.progress.call(a[1], a[1], g, Math.max(0, _ + c.duration - t), _, m), 1 === g && p(s)
- }
- }
- $.State.isTicking && k(u)
- }
- function p(e, t) {
- if (!$.State.calls[e]) return !1;
- for (var i = $.State.calls[e][0], n = $.State.calls[e][1], s = $.State.calls[e][2], a = $.State.calls[e][4], l = !1, c = 0, u = i.length; u > c; c++) {
- var p = i[c].element;
- if (t || s.loop || ("none" === s.display && b.setPropertyValue(p, "display", s.display), "hidden" === s.visibility && b.setPropertyValue(p, "visibility", s.visibility)), s.loop !== !0 && (d.queue(p)[1] === o || !/\.velocityQueueEntryFlag/i.test(d.queue(p)[1])) && r(p)) {
- r(p).isAnimating = !1, r(p).rootPropertyValueCache = {};
- var _ = !1;
- d.each(b.Lists.transforms3D, function(e, t) {
- var i = /^scale/.test(t) ? 1 : 0,
- n = r(p).transformCache[t];
- r(p).transformCache[t] !== o && new RegExp("^\\(" + i + "[^.]").test(n) && (_ = !0, delete r(p).transformCache[t])
- }), s.mobileHA && (_ = !0, delete r(p).transformCache.translate3d), _ && b.flushTransformCache(p), b.Values.removeClass(p, "velocity-animating")
- }
- if (!t && s.complete && !s.loop && c === u - 1) try {
- s.complete.call(n, n)
- } catch (h) {
- setTimeout(function() {
- throw h
- }, 1)
- }
- a && s.loop !== !0 && a(n), r(p) && s.loop === !0 && !t && (d.each(r(p).tweensContainer, function(e, t) {
- /^rotate/.test(e) && 360 === parseFloat(t.endValue) && (t.endValue = 0, t.startValue = 360), /^backgroundPosition/.test(e) && 100 === parseFloat(t.endValue) && "%" === t.unitType && (t.endValue = 0, t.startValue = 100)
- }), $(p, "reverse", {
- loop: !0,
- delay: s.delay
- })), s.queue !== !1 && d.dequeue(p, s.queue)
- }
- $.State.calls[e] = !1;
- for (var f = 0, m = $.State.calls.length; m > f; f++)
- if ($.State.calls[f] !== !1) {
- l = !0;
- break
- }
- l === !1 && ($.State.isTicking = !1, delete $.State.calls, $.State.calls = [])
- }
- var d, _ = function() {
- if (i.documentMode) return i.documentMode;
- for (var e = 7; e > 4; e--) {
- var t = i.createElement("div");
- if (t.innerHTML = "<!--[if IE " + e + "]><span></span><![endif]-->", t.getElementsByTagName("span").length) return t = null, e
- }
- return o
- }(),
- h = function() {
- var e = 0;
- return t.webkitRequestAnimationFrame || t.mozRequestAnimationFrame || function(t) {
- var i, o = (new Date).getTime();
- return i = Math.max(0, 16 - (o - e)), e = o + i, setTimeout(function() {
- t(o + i)
- }, i)
- }
- }(),
- f = {
- isString: function(e) {
- return "string" == typeof e
- },
- isArray: Array.isArray || function(e) {
- return "[object Array]" === Object.prototype.toString.call(e)
- },
- isFunction: function(e) {
- return "[object Function]" === Object.prototype.toString.call(e)
- },
- isNode: function(e) {
- return e && e.nodeType
- },
- isNodeList: function(e) {
- return "object" == typeof e && /^\[object (HTMLCollection|NodeList|Object)\]$/.test(Object.prototype.toString.call(e)) && e.length !== o && (0 === e.length || "object" == typeof e[0] && e[0].nodeType > 0)
- },
- isWrapped: function(e) {
- return e && (e.jquery || t.Zepto && t.Zepto.zepto.isZ(e))
- },
- isSVG: function(e) {
- return t.SVGElement && e instanceof t.SVGElement
- },
- isEmptyObject: function(e) {
- for (var t in e) return !1;
- return !0
- }
- },
- m = !1;
- if (e.fn && e.fn.jquery ? (d = e, m = !0) : d = t.Velocity.Utilities, 8 >= _ && !m) throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");
- if (7 >= _) return void(jQuery.fn.velocity = jQuery.fn.animate);
- var g = 400,
- v = "swing",
- $ = {
- State: {
- isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
- isAndroid: /Android/i.test(navigator.userAgent),
- isGingerbread: /Android 2\.3\.[3-7]/i.test(navigator.userAgent),
- isChrome: t.chrome,
- isFirefox: /Firefox/i.test(navigator.userAgent),
- prefixElement: i.createElement("div"),
- prefixMatches: {},
- scrollAnchor: null,
- scrollPropertyLeft: null,
- scrollPropertyTop: null,
- isTicking: !1,
- calls: []
- },
- CSS: {},
- Utilities: d,
- Redirects: {},
- Easings: {},
- Promise: t.Promise,
- defaults: {
- queue: "",
- duration: g,
- easing: v,
- begin: o,
- complete: o,
- progress: o,
- display: o,
- visibility: o,
- loop: !1,
- delay: !1,
- mobileHA: !0,
- _cacheValues: !0
- },
- init: function(e) {
- d.data(e, "velocity", {
- isSVG: f.isSVG(e),
- isAnimating: !1,
- computedStyle: null,
- tweensContainer: null,
- rootPropertyValueCache: {},
- transformCache: {}
- })
- },
- hook: null,
- mock: !1,
- version: {
- major: 1,
- minor: 2,
- patch: 2
- },
- debug: !1
- };
- t.pageYOffset !== o ? ($.State.scrollAnchor = t, $.State.scrollPropertyLeft = "pageXOffset", $.State.scrollPropertyTop = "pageYOffset") : ($.State.scrollAnchor = i.documentElement || i.body.parentNode || i.body, $.State.scrollPropertyLeft = "scrollLeft", $.State.scrollPropertyTop = "scrollTop");
- var y = function() {
- function e(e) {
- return -e.tension * e.x - e.friction * e.v
- }
- function t(t, i, o) {
- var n = {
- x: t.x + o.dx * i,
- v: t.v + o.dv * i,
- tension: t.tension,
- friction: t.friction
- };
- return {
- dx: n.v,
- dv: e(n)
- }
- }
- function i(i, o) {
- var n = {
- dx: i.v,
- dv: e(i)
- },
- s = t(i, .5 * o, n),
- r = t(i, .5 * o, s),
- a = t(i, o, r),
- l = 1 / 6 * (n.dx + 2 * (s.dx + r.dx) + a.dx),
- c = 1 / 6 * (n.dv + 2 * (s.dv + r.dv) + a.dv);
- return i.x = i.x + l * o, i.v = i.v + c * o, i
- }
- return function o(e, t, n) {
- var s, r, a, l = {
- x: -1,
- v: 0,
- tension: null,
- friction: null
- },
- c = [0],
- u = 0,
- p = 1e-4,
- d = .016;
- for (e = parseFloat(e) || 500, t = parseFloat(t) || 20, n = n || null, l.tension = e, l.friction = t, s = null !== n, s ? (u = o(e, t), r = u / n * d) : r = d; a = i(a || l, r), c.push(1 + a.x), u += 16, Math.abs(a.x) > p && Math.abs(a.v) > p;);
- return s ? function(e) {
- return c[e * (c.length - 1) | 0]
- } : u
- }
- }();
- $.Easings = {
- linear: function(e) {
- return e
- },
- swing: function(e) {
- return .5 - Math.cos(e * Math.PI) / 2
- },
- spring: function(e) {
- return 1 - Math.cos(4.5 * e * Math.PI) * Math.exp(6 * -e)
- }
- }, d.each([
- ["ease", [.25, .1, .25, 1]],
- ["ease-in", [.42, 0, 1, 1]],
- ["ease-out", [0, 0, .58, 1]],
- ["ease-in-out", [.42, 0, .58, 1]],
- ["easeInSine", [.47, 0, .745, .715]],
- ["easeOutSine", [.39, .575, .565, 1]],
- ["easeInOutSine", [.445, .05, .55, .95]],
- ["easeInQuad", [.55, .085, .68, .53]],
- ["easeOutQuad", [.25, .46, .45, .94]],
- ["easeInOutQuad", [.455, .03, .515, .955]],
- ["easeInCubic", [.55, .055, .675, .19]],
- ["easeOutCubic", [.215, .61, .355, 1]],
- ["easeInOutCubic", [.645, .045, .355, 1]],
- ["easeInQuart", [.895, .03, .685, .22]],
- ["easeOutQuart", [.165, .84, .44, 1]],
- ["easeInOutQuart", [.77, 0, .175, 1]],
- ["easeInQuint", [.755, .05, .855, .06]],
- ["easeOutQuint", [.23, 1, .32, 1]],
- ["easeInOutQuint", [.86, 0, .07, 1]],
- ["easeInExpo", [.95, .05, .795, .035]],
- ["easeOutExpo", [.19, 1, .22, 1]],
- ["easeInOutExpo", [1, 0, 0, 1]],
- ["easeInCirc", [.6, .04, .98, .335]],
- ["easeOutCirc", [.075, .82, .165, 1]],
- ["easeInOutCirc", [.785, .135, .15, .86]]
- ], function(e, t) {
- $.Easings[t[0]] = l.apply(null, t[1])
- });
- var b = $.CSS = {
- RegEx: {
- isHex: /^#([A-f\d]{3}){1,2}$/i,
- valueUnwrap: /^[A-z]+\((.*)\)$/i,
- wrappedValueAlreadyExtracted: /[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,
- valueSplit: /([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/gi
- },
- Lists: {
- colors: ["fill", "stroke", "stopColor", "color", "backgroundColor", "borderColor", "borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor", "outlineColor"],
- transformsBase: ["translateX", "translateY", "scale", "scaleX", "scaleY", "skewX", "skewY", "rotateZ"],
- transforms3D: ["transformPerspective", "translateZ", "scaleZ", "rotateX", "rotateY"]
- },
- Hooks: {
- templates: {
- textShadow: ["Color X Y Blur", "black 0px 0px 0px"],
- boxShadow: ["Color X Y Blur Spread", "black 0px 0px 0px 0px"],
- clip: ["Top Right Bottom Left", "0px 0px 0px 0px"],
- backgroundPosition: ["X Y", "0% 0%"],
- transformOrigin: ["X Y Z", "50% 50% 0px"],
- perspectiveOrigin: ["X Y", "50% 50%"]
- },
- registered: {},
- register: function() {
- for (var e = 0; e < b.Lists.colors.length; e++) {
- var t = "color" === b.Lists.colors[e] ? "0 0 0 1" : "255 255 255 1";
- b.Hooks.templates[b.Lists.colors[e]] = ["Red Green Blue Alpha", t]
- }
- var i, o, n;
- if (_)
- for (i in b.Hooks.templates) {
- o = b.Hooks.templates[i], n = o[0].split(" ");
- var s = o[1].match(b.RegEx.valueSplit);
- "Color" === n[0] && (n.push(n.shift()), s.push(s.shift()), b.Hooks.templates[i] = [n.join(" "), s.join(" ")])
- }
- for (i in b.Hooks.templates) {
- o = b.Hooks.templates[i], n = o[0].split(" ");
- for (var e in n) {
- var r = i + n[e],
- a = e;
- b.Hooks.registered[r] = [i, a]
- }
- }
- },
- getRoot: function(e) {
- var t = b.Hooks.registered[e];
- return t ? t[0] : e
- },
- cleanRootPropertyValue: function(e, t) {
- return b.RegEx.valueUnwrap.test(t) && (t = t.match(b.RegEx.valueUnwrap)[1]), b.Values.isCSSNullValue(t) && (t = b.Hooks.templates[e][1]), t
- },
- extractValue: function(e, t) {
- var i = b.Hooks.registered[e];
- if (i) {
- var o = i[0],
- n = i[1];
- return t = b.Hooks.cleanRootPropertyValue(o, t), t.toString().match(b.RegEx.valueSplit)[n]
- }
- return t
- },
- injectValue: function(e, t, i) {
- var o = b.Hooks.registered[e];
- if (o) {
- var n, s, r = o[0],
- a = o[1];
- return i = b.Hooks.cleanRootPropertyValue(r, i), n = i.toString().match(b.RegEx.valueSplit), n[a] = t, s = n.join(" ")
- }
- return i
- }
- },
- Normalizations: {
- registered: {
- clip: function(e, t, i) {
- switch (e) {
- case "name":
- return "clip";
- case "extract":
- var o;
- return b.RegEx.wrappedValueAlreadyExtracted.test(i) ? o = i : (o = i.toString().match(b.RegEx.valueUnwrap), o = o ? o[1].replace(/,(\s+)?/g, " ") : i), o;
- case "inject":
- return "rect(" + i + ")"
- }
- },
- blur: function(e, t, i) {
- switch (e) {
- case "name":
- return $.State.isFirefox ? "filter" : "-webkit-filter";
- case "extract":
- var o = parseFloat(i);
- if (!o && 0 !== o) {
- var n = i.toString().match(/blur\(([0-9]+[A-z]+)\)/i);
- o = n ? n[1] : 0
- }
- return o;
- case "inject":
- return parseFloat(i) ? "blur(" + i + ")" : "none"
- }
- },
- opacity: function(e, t, i) {
- if (8 >= _) switch (e) {
- case "name":
- return "filter";
- case "extract":
- var o = i.toString().match(/alpha\(opacity=(.*)\)/i);
- return i = o ? o[1] / 100 : 1;
- case "inject":
- return t.style.zoom = 1, parseFloat(i) >= 1 ? "" : "alpha(opacity=" + parseInt(100 * parseFloat(i), 10) + ")"
- } else switch (e) {
- case "name":
- return "opacity";
- case "extract":
- return i;
- case "inject":
- return i
- }
- }
- },
- register: function() {
- 9 >= _ || $.State.isGingerbread || (b.Lists.transformsBase = b.Lists.transformsBase.concat(b.Lists.transforms3D));
- for (var e = 0; e < b.Lists.transformsBase.length; e++) ! function() {
- var t = b.Lists.transformsBase[e];
- b.Normalizations.registered[t] = function(e, i, n) {
- switch (e) {
- case "name":
- return "transform";
- case "extract":
- return r(i) === o || r(i).transformCache[t] === o ? /^scale/i.test(t) ? 1 : 0 : r(i).transformCache[t].replace(/[()]/g, "");
- case "inject":
- var s = !1;
- switch (t.substr(0, t.length - 1)) {
- case "translate":
- s = !/(%|px|em|rem|vw|vh|\d)$/i.test(n);
- break;
- case "scal":
- case "scale":
- $.State.isAndroid && r(i).transformCache[t] === o && 1 > n && (n = 1), s = !/(\d)$/i.test(n);
- break;
- case "skew":
- s = !/(deg|\d)$/i.test(n);
- break;
- case "rotate":
- s = !/(deg|\d)$/i.test(n)
- }
- return s || (r(i).transformCache[t] = "(" + n + ")"), r(i).transformCache[t]
- }
- }
- }();
- for (var e = 0; e < b.Lists.colors.length; e++) ! function() {
- var t = b.Lists.colors[e];
- b.Normalizations.registered[t] = function(e, i, n) {
- switch (e) {
- case "name":
- return t;
- case "extract":
- var s;
- if (b.RegEx.wrappedValueAlreadyExtracted.test(n)) s = n;
- else {
- var r, a = {
- black: "rgb(0, 0, 0)",
- blue: "rgb(0, 0, 255)",
- gray: "rgb(128, 128, 128)",
- green: "rgb(0, 128, 0)",
- red: "rgb(255, 0, 0)",
- white: "rgb(255, 255, 255)"
- };
- /^[A-z]+$/i.test(n) ? r = a[n] !== o ? a[n] : a.black : b.RegEx.isHex.test(n) ? r = "rgb(" + b.Values.hexToRgb(n).join(" ") + ")" : /^rgba?\(/i.test(n) || (r = a.black), s = (r || n).toString().match(b.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g, " ")
- }
- return 8 >= _ || 3 !== s.split(" ").length || (s += " 1"), s;
- case "inject":
- return 8 >= _ ? 4 === n.split(" ").length && (n = n.split(/\s+/).slice(0, 3).join(" ")) : 3 === n.split(" ").length && (n += " 1"), (8 >= _ ? "rgb" : "rgba") + "(" + n.replace(/\s+/g, ",").replace(/\.(\d)+(?=,)/g, "") + ")"
- }
- }
- }()
- }
- },
- Names: {
- camelCase: function(e) {
- return e.replace(/-(\w)/g, function(e, t) {
- return t.toUpperCase()
- })
- },
- SVGAttribute: function(e) {
- var t = "width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";
- return (_ || $.State.isAndroid && !$.State.isChrome) && (t += "|transform"), new RegExp("^(" + t + ")$", "i").test(e)
- },
- prefixCheck: function(e) {
- if ($.State.prefixMatches[e]) return [$.State.prefixMatches[e], !0];
- for (var t = ["", "Webkit", "Moz", "ms", "O"], i = 0, o = t.length; o > i; i++) {
- var n;
- if (n = 0 === i ? e : t[i] + e.replace(/^\w/, function(e) {
- return e.toUpperCase()
- }), f.isString($.State.prefixElement.style[n])) return $.State.prefixMatches[e] = n, [n, !0]
- }
- return [e, !1]
- }
- },
- Values: {
- hexToRgb: function(e) {
- var t, i = /^#?([a-f\d])([a-f\d])([a-f\d])$/i,
- o = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;
- return e = e.replace(i, function(e, t, i, o) {
- return t + t + i + i + o + o
- }), t = o.exec(e), t ? [parseInt(t[1], 16), parseInt(t[2], 16), parseInt(t[3], 16)] : [0, 0, 0]
- },
- isCSSNullValue: function(e) {
- return 0 == e || /^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(e)
- },
- getUnitType: function(e) {
- return /^(rotate|skew)/i.test(e) ? "deg" : /(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(e) ? "" : "px"
- },
- getDisplayType: function(e) {
- var t = e && e.tagName.toString().toLowerCase();
- return /^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(t) ? "inline" : /^(li)$/i.test(t) ? "list-item" : /^(tr)$/i.test(t) ? "table-row" : /^(table)$/i.test(t) ? "table" : /^(tbody)$/i.test(t) ? "table-row-group" : "block"
- },
- addClass: function(e, t) {
- e.classList ? e.classList.add(t) : e.className += (e.className.length ? " " : "") + t
- },
- removeClass: function(e, t) {
- e.classList ? e.classList.remove(t) : e.className = e.className.toString().replace(new RegExp("(^|\\s)" + t.split(" ").join("|") + "(\\s|$)", "gi"), " ")
- }
- },
- getPropertyValue: function(e, i, n, s) {
- function a(e, i) {
- function n() {
- c && b.setPropertyValue(e, "display", "none")
- }
- var l = 0;
- if (8 >= _) l = d.css(e, i);
- else {
- var c = !1;
- if (/^(width|height)$/.test(i) && 0 === b.getPropertyValue(e, "display") && (c = !0, b.setPropertyValue(e, "display", b.Values.getDisplayType(e))), !s) {
- if ("height" === i && "border-box" !== b.getPropertyValue(e, "boxSizing").toString().toLowerCase()) {
- var u = e.offsetHeight - (parseFloat(b.getPropertyValue(e, "borderTopWidth")) || 0) - (parseFloat(b.getPropertyValue(e, "borderBottomWidth")) || 0) - (parseFloat(b.getPropertyValue(e, "paddingTop")) || 0) - (parseFloat(b.getPropertyValue(e, "paddingBottom")) || 0);
- return n(), u
- }
- if ("width" === i && "border-box" !== b.getPropertyValue(e, "boxSizing").toString().toLowerCase()) {
- var p = e.offsetWidth - (parseFloat(b.getPropertyValue(e, "borderLeftWidth")) || 0) - (parseFloat(b.getPropertyValue(e, "borderRightWidth")) || 0) - (parseFloat(b.getPropertyValue(e, "paddingLeft")) || 0) - (parseFloat(b.getPropertyValue(e, "paddingRight")) || 0);
- return n(), p
- }
- }
- var h;
- h = r(e) === o ? t.getComputedStyle(e, null) : r(e).computedStyle ? r(e).computedStyle : r(e).computedStyle = t.getComputedStyle(e, null), "borderColor" === i && (i = "borderTopColor"), l = 9 === _ && "filter" === i ? h.getPropertyValue(i) : h[i], ("" === l || null === l) && (l = e.style[i]), n()
- }
- if ("auto" === l && /^(top|right|bottom|left)$/i.test(i)) {
- var f = a(e, "position");
- ("fixed" === f || "absolute" === f && /top|left/i.test(i)) && (l = d(e).position()[i] + "px")
- }
- return l
- }
- var l;
- if (b.Hooks.registered[i]) {
- var c = i,
- u = b.Hooks.getRoot(c);
- n === o && (n = b.getPropertyValue(e, b.Names.prefixCheck(u)[0])), b.Normalizations.registered[u] && (n = b.Normalizations.registered[u]("extract", e, n)), l = b.Hooks.extractValue(c, n)
- } else if (b.Normalizations.registered[i]) {
- var p, h;
- p = b.Normalizations.registered[i]("name", e), "transform" !== p && (h = a(e, b.Names.prefixCheck(p)[0]), b.Values.isCSSNullValue(h) && b.Hooks.templates[i] && (h = b.Hooks.templates[i][1])), l = b.Normalizations.registered[i]("extract", e, h)
- }
- if (!/^[\d-]/.test(l))
- if (r(e) && r(e).isSVG && b.Names.SVGAttribute(i))
- if (/^(height|width)$/i.test(i)) try {
- l = e.getBBox()[i]
- } catch (f) {
- l = 0
- } else l = e.getAttribute(i);
- else l = a(e, b.Names.prefixCheck(i)[0]);
- return b.Values.isCSSNullValue(l) && (l = 0), $.debug >= 2 && console.log("Get " + i + ": " + l), l
- },
- setPropertyValue: function(e, i, o, n, s) {
- var a = i;
- if ("scroll" === i) s.container ? s.container["scroll" + s.direction] = o : "Left" === s.direction ? t.scrollTo(o, s.alternateValue) : t.scrollTo(s.alternateValue, o);
- else if (b.Normalizations.registered[i] && "transform" === b.Normalizations.registered[i]("name", e)) b.Normalizations.registered[i]("inject", e, o), a = "transform", o = r(e).transformCache[i];
- else {
- if (b.Hooks.registered[i]) {
- var l = i,
- c = b.Hooks.getRoot(i);
- n = n || b.getPropertyValue(e, c), o = b.Hooks.injectValue(l, o, n), i = c
- }
- if (b.Normalizations.registered[i] && (o = b.Normalizations.registered[i]("inject", e, o), i = b.Normalizations.registered[i]("name", e)), a = b.Names.prefixCheck(i)[0], 8 >= _) try {
- e.style[a] = o
- } catch (u) {
- $.debug && console.log("Browser does not support [" + o + "] for [" + a + "]")
- } else r(e) && r(e).isSVG && b.Names.SVGAttribute(i) ? e.setAttribute(i, o) : e.style[a] = o;
- $.debug >= 2 && console.log("Set " + i + " (" + a + "): " + o)
- }
- return [a, o]
- },
- flushTransformCache: function(e) {
- function t(t) {
- return parseFloat(b.getPropertyValue(e, t))
- }
- var i = "";
- if ((_ || $.State.isAndroid && !$.State.isChrome) && r(e).isSVG) {
- var o = {
- translate: [t("translateX"), t("translateY")],
- skewX: [t("skewX")],
- skewY: [t("skewY")],
- scale: 1 !== t("scale") ? [t("scale"), t("scale")] : [t("scaleX"), t("scaleY")],
- rotate: [t("rotateZ"), 0, 0]
- };
- d.each(r(e).transformCache, function(e) {
- /^translate/i.test(e) ? e = "translate" : /^scale/i.test(e) ? e = "scale" : /^rotate/i.test(e) && (e = "rotate"), o[e] && (i += e + "(" + o[e].join(" ") + ") ", delete o[e])
- })
- } else {
- var n, s;
- d.each(r(e).transformCache, function(t) {
- return n = r(e).transformCache[t], "transformPerspective" === t ? (s = n, !0) : (9 === _ && "rotateZ" === t && (t = "rotate"), void(i += t + n + " "))
- }), s && (i = "perspective" + s + " " + i)
- }
- b.setPropertyValue(e, "transform", i)
- }
- };
- b.Hooks.register(), b.Normalizations.register(), $.hook = function(e, t, i) {
- var n = o;
- return e = s(e), d.each(e, function(e, s) {
- if (r(s) === o && $.init(s), i === o) n === o && (n = $.CSS.getPropertyValue(s, t));
- else {
- var a = $.CSS.setPropertyValue(s, t, i);
- "transform" === a[0] && $.CSS.flushTransformCache(s), n = a
- }
- }), n
- };
- var w = function() {
- function e() {
- return a ? T.promise || null : l
- }
- function n() {
- function e(e) {
- function p(e, t) {
- var i = o,
- n = o,
- r = o;
- return f.isArray(e) ? (i = e[0], !f.isArray(e[1]) && /^[\d-]/.test(e[1]) || f.isFunction(e[1]) || b.RegEx.isHex.test(e[1]) ? r = e[1] : (f.isString(e[1]) && !b.RegEx.isHex.test(e[1]) || f.isArray(e[1])) && (n = t ? e[1] : c(e[1], a.duration), e[2] !== o && (r = e[2]))) : i = e, t || (n = n || a.easing), f.isFunction(i) && (i = i.call(s, x, k)), f.isFunction(r) && (r = r.call(s, x, k)), [i || 0, n, r]
- }
- function _(e, t) {
- var i, o;
- return o = (t || "0").toString().toLowerCase().replace(/[%A-z]+$/, function(e) {
- return i = e, ""
- }), i || (i = b.Values.getUnitType(e)), [o, i]
- }
- function g() {
- var e = {
- myParent: s.parentNode || i.body,
- position: b.getPropertyValue(s, "position"),
- fontSize: b.getPropertyValue(s, "fontSize")
- },
- o = e.position === I.lastPosition && e.myParent === I.lastParent,
- n = e.fontSize === I.lastFontSize;
- I.lastParent = e.myParent, I.lastPosition = e.position, I.lastFontSize = e.fontSize;
- var a = 100,
- l = {};
- if (n && o) l.emToPx = I.lastEmToPx, l.percentToPxWidth = I.lastPercentToPxWidth, l.percentToPxHeight = I.lastPercentToPxHeight;
- else {
- var c = r(s).isSVG ? i.createElementNS("http://www.w3.org/2000/svg", "rect") : i.createElement("div");
- $.init(c), e.myParent.appendChild(c), d.each(["overflow", "overflowX", "overflowY"], function(e, t) {
- $.CSS.setPropertyValue(c, t, "hidden")
- }), $.CSS.setPropertyValue(c, "position", e.position), $.CSS.setPropertyValue(c, "fontSize", e.fontSize), $.CSS.setPropertyValue(c, "boxSizing", "content-box"), d.each(["minWidth", "maxWidth", "width", "minHeight", "maxHeight", "height"], function(e, t) {
- $.CSS.setPropertyValue(c, t, a + "%")
- }), $.CSS.setPropertyValue(c, "paddingLeft", a + "em"), l.percentToPxWidth = I.lastPercentToPxWidth = (parseFloat(b.getPropertyValue(c, "width", null, !0)) || 1) / a, l.percentToPxHeight = I.lastPercentToPxHeight = (parseFloat(b.getPropertyValue(c, "height", null, !0)) || 1) / a, l.emToPx = I.lastEmToPx = (parseFloat(b.getPropertyValue(c, "paddingLeft")) || 1) / a, e.myParent.removeChild(c)
- }
- return null === I.remToPx && (I.remToPx = parseFloat(b.getPropertyValue(i.body, "fontSize")) || 16), null === I.vwToPx && (I.vwToPx = parseFloat(t.innerWidth) / 100, I.vhToPx = parseFloat(t.innerHeight) / 100), l.remToPx = I.remToPx, l.vwToPx = I.vwToPx, l.vhToPx = I.vhToPx, $.debug >= 1 && console.log("Unit ratios: " + JSON.stringify(l), s), l
- }
- if (a.begin && 0 === x) try {
- a.begin.call(h, h)
- } catch (y) {
- setTimeout(function() {
- throw y
- }, 1)
- }
- if ("scroll" === P) {
- var w, S, C, A = /^x$/i.test(a.axis) ? "Left" : "Top",
- q = parseFloat(a.offset) || 0;
- a.container ? f.isWrapped(a.container) || f.isNode(a.container) ? (a.container = a.container[0] || a.container, w = a.container["scroll" + A], C = w + d(s).position()[A.toLowerCase()] + q) : a.container = null : (w = $.State.scrollAnchor[$.State["scrollProperty" + A]], S = $.State.scrollAnchor[$.State["scrollProperty" + ("Left" === A ? "Top" : "Left")]], C = d(s).offset()[A.toLowerCase()] + q), l = {
- scroll: {
- rootPropertyValue: !1,
- startValue: w,
- currentValue: w,
- endValue: C,
- unitType: "",
- easing: a.easing,
- scrollData: {
- container: a.container,
- direction: A,
- alternateValue: S
- }
- },
- element: s
- }, $.debug && console.log("tweensContainer (scroll): ", l.scroll, s)
- } else if ("reverse" === P) {
- if (!r(s).tweensContainer) return void d.dequeue(s, a.queue);
- "none" === r(s).opts.display && (r(s).opts.display = "auto"), "hidden" === r(s).opts.visibility && (r(s).opts.visibility = "visible"), r(s).opts.loop = !1, r(s).opts.begin = null, r(s).opts.complete = null, v.easing || delete a.easing, v.duration || delete a.duration, a = d.extend({}, r(s).opts, a);
- var O = d.extend(!0, {}, r(s).tweensContainer);
- for (var R in O)
- if ("element" !== R) {
- var j = O[R].startValue;
- O[R].startValue = O[R].currentValue = O[R].endValue, O[R].endValue = j, f.isEmptyObject(v) || (O[R].easing = a.easing), $.debug && console.log("reverse tweensContainer (" + R + "): " + JSON.stringify(O[R]), s)
- }
- l = O
- } else if ("start" === P) {
- var O;
- r(s).tweensContainer && r(s).isAnimating === !0 && (O = r(s).tweensContainer), d.each(m, function(e, t) {
- if (RegExp("^" + b.Lists.colors.join("$|^") + "$").test(e)) {
- var i = p(t, !0),
- n = i[0],
- s = i[1],
- r = i[2];
- if (b.RegEx.isHex.test(n)) {
- for (var a = ["Red", "Green", "Blue"], l = b.Values.hexToRgb(n), c = r ? b.Values.hexToRgb(r) : o, u = 0; u < a.length; u++) {
- var d = [l[u]];
- s && d.push(s), c !== o && d.push(c[u]), m[e + a[u]] = d
- }
- delete m[e]
- }
- }
- });
- for (var E in m) {
- var M = p(m[E]),
- z = M[0],
- N = M[1],
- V = M[2];
- E = b.Names.camelCase(E);
- var L = b.Hooks.getRoot(E),
- H = !1;
- if (r(s).isSVG || "tween" === L || b.Names.prefixCheck(L)[1] !== !1 || b.Normalizations.registered[L] !== o) {
- (a.display !== o && null !== a.display && "none" !== a.display || a.visibility !== o && "hidden" !== a.visibility) && /opacity|filter/.test(E) && !V && 0 !== z && (V = 0), a._cacheValues && O && O[E] ? (V === o && (V = O[E].endValue + O[E].unitType), H = r(s).rootPropertyValueCache[L]) : b.Hooks.registered[E] ? V === o ? (H = b.getPropertyValue(s, L), V = b.getPropertyValue(s, E, H)) : H = b.Hooks.templates[L][1] : V === o && (V = b.getPropertyValue(s, E));
- var D, B, W, U = !1;
- if (D = _(E, V), V = D[0], W = D[1], D = _(E, z), z = D[0].replace(/^([+-\/*])=/, function(e, t) {
- return U = t, ""
- }), B = D[1], V = parseFloat(V) || 0, z = parseFloat(z) || 0, "%" === B && (/^(fontSize|lineHeight)$/.test(E) ? (z /= 100, B = "em") : /^scale/.test(E) ? (z /= 100, B = "") : /(Red|Green|Blue)$/i.test(E) && (z = z / 100 * 255, B = "")), /[\/*]/.test(U)) B = W;
- else if (W !== B && 0 !== V)
- if (0 === z) B = W;
- else {
- n = n || g();
- var Q = /margin|padding|left|right|width|text|word|letter/i.test(E) || /X$/.test(E) || "x" === E ? "x" : "y";
- switch (W) {
- case "%":
- V *= "x" === Q ? n.percentToPxWidth : n.percentToPxHeight;
- break;
- case "px":
- break;
- default:
- V *= n[W + "ToPx"]
- }
- switch (B) {
- case "%":
- V *= 1 / ("x" === Q ? n.percentToPxWidth : n.percentToPxHeight);
- break;
- case "px":
- break;
- default:
- V *= 1 / n[B + "ToPx"]
- }
- }
- switch (U) {
- case "+":
- z = V + z;
- break;
- case "-":
- z = V - z;
- break;
- case "*":
- z = V * z;
- break;
- case "/":
- z = V / z
- }
- l[E] = {
- rootPropertyValue: H,
- startValue: V,
- currentValue: V,
- endValue: z,
- unitType: B,
- easing: N
- }, $.debug && console.log("tweensContainer (" + E + "): " + JSON.stringify(l[E]), s)
- } else $.debug && console.log("Skipping [" + L + "] due to a lack of browser support.")
- }
- l.element = s
- }
- l.element && (b.Values.addClass(s, "velocity-animating"), F.push(l), "" === a.queue && (r(s).tweensContainer = l, r(s).opts = a), r(s).isAnimating = !0, x === k - 1 ? ($.State.calls.push([F, h, a, null, T.resolver]), $.State.isTicking === !1 && ($.State.isTicking = !0, u())) : x++)
- }
- var n, s = this,
- a = d.extend({}, $.defaults, v),
- l = {};
- switch (r(s) === o && $.init(s), parseFloat(a.delay) && a.queue !== !1 && d.queue(s, a.queue, function(e) {
- $.velocityQueueEntryFlag = !0, r(s).delayTimer = {
- setTimeout: setTimeout(e, parseFloat(a.delay)),
- next: e
- }
- }), a.duration.toString().toLowerCase()) {
- case "fast":
- a.duration = 200;
- break;
- case "normal":
- a.duration = g;
- break;
- case "slow":
- a.duration = 600;
- break;
- default:
- a.duration = parseFloat(a.duration) || 1
- }
- $.mock !== !1 && ($.mock === !0 ? a.duration = a.delay = 1 : (a.duration *= parseFloat($.mock) || 1, a.delay *= parseFloat($.mock) || 1)), a.easing = c(a.easing, a.duration), a.begin && !f.isFunction(a.begin) && (a.begin = null), a.progress && !f.isFunction(a.progress) && (a.progress = null), a.complete && !f.isFunction(a.complete) && (a.complete = null), a.display !== o && null !== a.display && (a.display = a.display.toString().toLowerCase(), "auto" === a.display && (a.display = $.CSS.Values.getDisplayType(s))), a.visibility !== o && null !== a.visibility && (a.visibility = a.visibility.toString().toLowerCase()), a.mobileHA = a.mobileHA && $.State.isMobile && !$.State.isGingerbread, a.queue === !1 ? a.delay ? setTimeout(e, a.delay) : e() : d.queue(s, a.queue, function(t, i) {
- return i === !0 ? (T.promise && T.resolver(h), !0) : ($.velocityQueueEntryFlag = !0, void e(t))
- }), "" !== a.queue && "fx" !== a.queue || "inprogress" === d.queue(s)[0] || d.dequeue(s)
- }
- var a, l, _, h, m, v, y = arguments[0] && (arguments[0].p || d.isPlainObject(arguments[0].properties) && !arguments[0].properties.names || f.isString(arguments[0].properties));
- if (f.isWrapped(this) ? (a = !1, _ = 0, h = this, l = this) : (a = !0, _ = 1, h = y ? arguments[0].elements || arguments[0].e : arguments[0]), h = s(h)) {
- y ? (m = arguments[0].properties || arguments[0].p, v = arguments[0].options || arguments[0].o) : (m = arguments[_], v = arguments[_ + 1]);
- var k = h.length,
- x = 0;
- if (!/^(stop|finish)$/i.test(m) && !d.isPlainObject(v)) {
- var S = _ + 1;
- v = {};
- for (var C = S; C < arguments.length; C++) f.isArray(arguments[C]) || !/^(fast|normal|slow)$/i.test(arguments[C]) && !/^\d/.test(arguments[C]) ? f.isString(arguments[C]) || f.isArray(arguments[C]) ? v.easing = arguments[C] : f.isFunction(arguments[C]) && (v.complete = arguments[C]) : v.duration = arguments[C]
- }
- var T = {
- promise: null,
- resolver: null,
- rejecter: null
- };
- a && $.Promise && (T.promise = new $.Promise(function(e, t) {
- T.resolver = e, T.rejecter = t
- }));
- var P;
- switch (m) {
- case "scroll":
- P = "scroll";
- break;
- case "reverse":
- P = "reverse";
- break;
- case "finish":
- case "stop":
- d.each(h, function(e, t) {
- r(t) && r(t).delayTimer && (clearTimeout(r(t).delayTimer.setTimeout), r(t).delayTimer.next && r(t).delayTimer.next(), delete r(t).delayTimer)
- });
- var A = [];
- return d.each($.State.calls, function(e, t) {
- t && d.each(t[1], function(i, n) {
- var s = v === o ? "" : v;
- return s === !0 || t[2].queue === s || v === o && t[2].queue === !1 ? void d.each(h, function(i, o) {
- o === n && ((v === !0 || f.isString(v)) && (d.each(d.queue(o, f.isString(v) ? v : ""), function(e, t) {
- f.isFunction(t) && t(null, !0)
- }), d.queue(o, f.isString(v) ? v : "", [])), "stop" === m ? (r(o) && r(o).tweensContainer && s !== !1 && d.each(r(o).tweensContainer, function(e, t) {
- t.endValue = t.currentValue
- }), A.push(e)) : "finish" === m && (t[2].duration = 1))
- }) : !0
- })
- }), "stop" === m && (d.each(A, function(e, t) {
- p(t, !0)
- }), T.promise && T.resolver(h)), e();
- default:
- if (!d.isPlainObject(m) || f.isEmptyObject(m)) {
- if (f.isString(m) && $.Redirects[m]) {
- var q = d.extend({}, v),
- O = q.duration,
- R = q.delay || 0;
- return q.backwards === !0 && (h = d.extend(!0, [], h).reverse()), d.each(h, function(e, t) {
- parseFloat(q.stagger) ? q.delay = R + parseFloat(q.stagger) * e : f.isFunction(q.stagger) && (q.delay = R + q.stagger.call(t, e, k)), q.drag && (q.duration = parseFloat(O) || (/^(callout|transition)/.test(m) ? 1e3 : g), q.duration = Math.max(q.duration * (q.backwards ? 1 - e / k : (e + 1) / k), .75 * q.duration, 200)), $.Redirects[m].call(t, t, q || {}, e, k, h, T.promise ? T : o)
- }), e()
- }
- var j = "Velocity: First argument (" + m + ") was not a property map, a known action, or a registered redirect. Aborting.";
- return T.promise ? T.rejecter(new Error(j)) : console.log(j), e()
- }
- P = "start"
- }
- var I = {
- lastParent: null,
- lastPosition: null,
- lastFontSize: null,
- lastPercentToPxWidth: null,
- lastPercentToPxHeight: null,
- lastEmToPx: null,
- remToPx: null,
- vwToPx: null,
- vhToPx: null
- },
- F = [];
- d.each(h, function(e, t) {
- f.isNode(t) && n.call(t)
- });
- var E, q = d.extend({}, $.defaults, v);
- if (q.loop = parseInt(q.loop), E = 2 * q.loop - 1, q.loop)
- for (var M = 0; E > M; M++) {
- var z = {
- delay: q.delay,
- progress: q.progress
- };
- M === E - 1 && (z.display = q.display, z.visibility = q.visibility, z.complete = q.complete), w(h, "reverse", z)
- }
- return e()
- }
- };
- $ = d.extend(w, $), $.animate = w;
- var k = t.requestAnimationFrame || h;
- return $.State.isMobile || i.hidden === o || i.addEventListener("visibilitychange", function() {
- i.hidden ? (k = function(e) {
- return setTimeout(function() {
- e(!0)
- }, 16)
- }, u()) : k = t.requestAnimationFrame || h
- }), e.Velocity = $, e !== t && (e.fn.velocity = w,
- e.fn.velocity.defaults = $.defaults), d.each(["Down", "Up"], function(e, t) {
- $.Redirects["slide" + t] = function(e, i, n, s, r, a) {
- var l = d.extend({}, i),
- c = l.begin,
- u = l.complete,
- p = {
- height: "",
- marginTop: "",
- marginBottom: "",
- paddingTop: "",
- paddingBottom: ""
- },
- _ = {};
- l.display === o && (l.display = "Down" === t ? "inline" === $.CSS.Values.getDisplayType(e) ? "inline-block" : "block" : "none"), l.begin = function() {
- c && c.call(r, r);
- for (var i in p) {
- _[i] = e.style[i];
- var o = $.CSS.getPropertyValue(e, i);
- p[i] = "Down" === t ? [o, 0] : [0, o]
- }
- _.overflow = e.style.overflow, e.style.overflow = "hidden"
- }, l.complete = function() {
- for (var t in _) e.style[t] = _[t];
- u && u.call(r, r), a && a.resolver(r)
- }, $(e, p, l)
- }
- }), d.each(["In", "Out"], function(e, t) {
- $.Redirects["fade" + t] = function(e, i, n, s, r, a) {
- var l = d.extend({}, i),
- c = {
- opacity: "In" === t ? 1 : 0
- },
- u = l.complete;
- l.complete = n !== s - 1 ? l.begin = null : function() {
- u && u.call(r, r), a && a.resolver(r)
- }, l.display === o && (l.display = "In" === t ? "auto" : "none"), $(this, c, l)
- }
- }), $
- }(window.jQuery || window.Zepto || window, window, document)
- }),
- function(e) {
- e.isScrollToFixed = function(t) {
- return !!e(t).data("ScrollToFixed")
- }, e.ScrollToFixed = function(t, i) {
- function o() {
- w.trigger("preUnfixed.ScrollToFixed"), u(), w.trigger("unfixed.ScrollToFixed"), C = -1, k = w.offset().top, x = w.offset().left, m.options.offsets && (x += w.offset().left - w.position().left), -1 == S && (S = x), g = w.css("position"), b = !0, -1 != m.options.bottom && (w.trigger("preFixed.ScrollToFixed"), l(), w.trigger("fixed.ScrollToFixed"))
- }
- function n() {
- var e = m.options.limit;
- return e ? "function" == typeof e ? e.apply(w) : e : 0
- }
- function s() {
- return "fixed" === g
- }
- function r() {
- return "absolute" === g
- }
- function a() {
- return !(s() || r())
- }
- function l() {
- s() || (T.css({
- display: w.css("display"),
- width: w.outerWidth(!0),
- height: w.outerHeight(!0),
- "float": w.css("float")
- }), cssOptions = {
- "z-index": m.options.zIndex,
- position: "fixed",
- top: -1 == m.options.bottom ? d() : "",
- bottom: -1 == m.options.bottom ? "" : m.options.bottom,
- "margin-left": "0px"
- }, m.options.dontSetWidth || (cssOptions.width = w.width()), w.css(cssOptions), w.addClass(m.options.baseClassName), m.options.className && w.addClass(m.options.className), g = "fixed")
- }
- function c() {
- var e = n(),
- t = x;
- m.options.removeOffsets && (t = "", e -= k), cssOptions = {
- position: "absolute",
- top: e,
- left: t,
- "margin-left": "0px",
- bottom: ""
- }, m.options.dontSetWidth || (cssOptions.width = w.width()), w.css(cssOptions), g = "absolute"
- }
- function u() {
- a() || (C = -1, T.css("display", "none"), w.css({
- "z-index": y,
- width: "",
- position: v,
- left: "",
- top: $,
- "margin-left": ""
- }), w.removeClass("scroll-to-fixed-fixed"), m.options.className && w.removeClass(m.options.className), g = null)
- }
- function p(e) {
- e != C && (w.css("left", x - e), C = e)
- }
- function d() {
- var e = m.options.marginTop;
- return e ? "function" == typeof e ? e.apply(w) : e : 0
- }
- function _() {
- if (e.isScrollToFixed(w)) {
- var t = b;
- b ? a() && (k = w.offset().top, x = w.offset().left) : o();
- var i = e(window).scrollLeft(),
- _ = e(window).scrollTop(),
- g = n();
- m.options.minWidth && e(window).width() < m.options.minWidth ? a() && t || (f(), w.trigger("preUnfixed.ScrollToFixed"), u(), w.trigger("unfixed.ScrollToFixed")) : m.options.maxWidth && e(window).width() > m.options.maxWidth ? a() && t || (f(), w.trigger("preUnfixed.ScrollToFixed"), u(), w.trigger("unfixed.ScrollToFixed")) : -1 == m.options.bottom ? g > 0 && _ >= g - d() ? r() && t || (f(), w.trigger("preAbsolute.ScrollToFixed"), c(), w.trigger("unfixed.ScrollToFixed")) : _ >= k - d() ? (s() && t || (f(), w.trigger("preFixed.ScrollToFixed"), l(), C = -1, w.trigger("fixed.ScrollToFixed")), p(i)) : a() && t || (f(), w.trigger("preUnfixed.ScrollToFixed"), u(), w.trigger("unfixed.ScrollToFixed")) : g > 0 ? _ + e(window).height() - w.outerHeight(!0) >= g - (d() || -h()) ? s() && (f(), w.trigger("preUnfixed.ScrollToFixed"), "absolute" === v ? c() : u(), w.trigger("unfixed.ScrollToFixed")) : (s() || (f(), w.trigger("preFixed.ScrollToFixed"), l()), p(i), w.trigger("fixed.ScrollToFixed")) : p(i)
- }
- }
- function h() {
- return m.options.bottom ? m.options.bottom : 0
- }
- function f() {
- var e = w.css("position");
- w.trigger("absolute" == e ? "postAbsolute.ScrollToFixed" : "fixed" == e ? "postFixed.ScrollToFixed" : "postUnfixed.ScrollToFixed")
- }
- var m = this;
- m.$el = e(t), m.el = t, m.$el.data("ScrollToFixed", m);
- var g, v, $, y, b = !1,
- w = m.$el,
- k = 0,
- x = 0,
- S = -1,
- C = -1,
- T = null,
- P = function(e) {
- w.is(":visible") && (b = !1, _())
- },
- A = function(e) {
- window.requestAnimationFrame ? requestAnimationFrame(_) : _()
- },
- q = function(e) {
- e = e || window.event, e.preventDefault && e.preventDefault(), e.returnValue = !1
- };
- m.init = function() {
- m.options = e.extend({}, e.ScrollToFixed.defaultOptions, i), y = w.css("z-index"), m.$el.css("z-index", m.options.zIndex), T = e("<div />"), g = w.css("position"), v = w.css("position"), $ = w.css("top"), a() && m.$el.after(T), e(window).bind("resize.ScrollToFixed", P), e(window).bind("scroll.ScrollToFixed", A), "ontouchmove" in window && e(window).bind("touchmove.ScrollToFixed", _), m.options.preFixed && w.bind("preFixed.ScrollToFixed", m.options.preFixed), m.options.postFixed && w.bind("postFixed.ScrollToFixed", m.options.postFixed), m.options.preUnfixed && w.bind("preUnfixed.ScrollToFixed", m.options.preUnfixed), m.options.postUnfixed && w.bind("postUnfixed.ScrollToFixed", m.options.postUnfixed), m.options.preAbsolute && w.bind("preAbsolute.ScrollToFixed", m.options.preAbsolute), m.options.postAbsolute && w.bind("postAbsolute.ScrollToFixed", m.options.postAbsolute), m.options.fixed && w.bind("fixed.ScrollToFixed", m.options.fixed), m.options.unfixed && w.bind("unfixed.ScrollToFixed", m.options.unfixed), m.options.spacerClass && T.addClass(m.options.spacerClass), w.bind("resize.ScrollToFixed", function() {
- T.height(w.height())
- }), w.bind("scroll.ScrollToFixed", function() {
- w.trigger("preUnfixed.ScrollToFixed"), u(), w.trigger("unfixed.ScrollToFixed"), _()
- }), w.bind("detach.ScrollToFixed", function(t) {
- q(t), w.trigger("preUnfixed.ScrollToFixed"), u(), w.trigger("unfixed.ScrollToFixed"), e(window).unbind("resize.ScrollToFixed", P), e(window).unbind("scroll.ScrollToFixed", A), w.unbind(".ScrollToFixed"), T.remove(), m.$el.removeData("ScrollToFixed")
- }), P()
- }, m.init()
- }, e.ScrollToFixed.defaultOptions = {
- marginTop: 0,
- limit: 0,
- bottom: -1,
- zIndex: 1e3,
- baseClassName: "scroll-to-fixed-fixed"
- }, e.fn.scrollToFixed = function(t) {
- return this.each(function() {
- new e.ScrollToFixed(this, t)
- })
- }
- }(jQuery),
- function(e) {
- var t = new Array,
- o = new Array;
- e.fn.doAutosize = function(t) {
- var i = e(this).data("minwidth"),
- o = e(this).data("maxwidth"),
- n = "",
- s = e(this),
- r = e("#" + e(this).data("tester_id"));
- if (n !== (n = s.val())) {
- var a = n.replace(/&/g, "&").replace(/\s/g, " ").replace(/</g, "<").replace(/>/g, ">");
- r.html(a);
- var l = r.width(),
- c = l + t.comfortZone >= i ? l + t.comfortZone : i,
- u = s.width(),
- p = u > c && c >= i || c > i && o > c;
- p && s.width(c)
- }
- }, e.fn.resetAutosize = function(t) {
- var i = e(this).data("minwidth") || t.minInputWidth || e(this).width(),
- o = e(this).data("maxwidth") || t.maxInputWidth || e(this).closest(".tagsinput").width() - t.inputPadding,
- n = e(this),
- s = e("<tester/>").css({
- position: "absolute",
- top: -9999,
- left: -9999,
- width: "auto",
- fontSize: n.css("fontSize"),
- fontFamily: n.css("fontFamily"),
- fontWeight: n.css("fontWeight"),
- letterSpacing: n.css("letterSpacing"),
- whiteSpace: "nowrap"
- }),
- r = e(this).attr("id") + "_autosize_tester";
- !e("#" + r).length > 0 && (s.attr("id", r), s.appendTo("body")), n.data("minwidth", i), n.data("maxwidth", o), n.data("tester_id", r), n.css("width", i)
- }, e.fn.addTag = function(i, n) {
- return n = jQuery.extend({
- focus: !1,
- callback: !0
- }, n), this.each(function() {
- var s = e(this).attr("id"),
- r = e(this).val().split(t[s]);
- if ("" == r[0] && (r = new Array), i = jQuery.trim(i), n.unique) {
- var a = e(r).tagExist(i);
- 1 == a && e("#" + s + "_tag").addClass("not_valid")
- } else var a = !1;
- if ("" != i && 1 != a) {
- if (e("<span>").addClass("tag").append(e("<span>").text(i).append(" "), e("<a>", {
- href: "#",
- title: "Removing tag",
- text: "×"
- }).click(function() {
- return e("#" + s).removeTag(escape(i))
- })).insertBefore("#" + s + "_addTag"), r.push(i), e("#" + s + "_tag").val(""), n.focus ? e("#" + s + "_tag").focus() : e("#" + s + "_tag").blur(), e.fn.tagsInput.updateTagsField(this, r), n.callback && o[s] && o[s].onAddTag) {
- var l = o[s].onAddTag;
- l.call(this, i)
- }
- if (o[s] && o[s].onChange) {
- var c = r.length,
- l = o[s].onChange;
- l.call(this, e(this), r[c - 1])
- }
- }
- }), !1
- }, e.fn.removeTag = function(n) {
- return n = unescape(n), this.each(function() {
- var s = e(this).attr("id"),
- r = e(this).val().split(t[s]);
- for (e("#" + s + "_tagsinput .tag").remove(), str = "", i = 0; i < r.length; i++) r[i] != n && (str = str + t[s] + r[i]);
- if (e.fn.tagsInput.importTags(this, str), o[s] && o[s].onRemoveTag) {
- var a = o[s].onRemoveTag;
- a.call(this, n)
- }
- }), !1
- }, e.fn.tagExist = function(t) {
- return jQuery.inArray(t, e(this)) >= 0
- }, e.fn.importTags = function(t) {
- id = e(this).attr("id"), e("#" + id + "_tagsinput .tag").remove(), e.fn.tagsInput.importTags(this, t)
- }, e.fn.tagsInput = function(i) {
- var n = jQuery.extend({
- interactive: !0,
- defaultText: "add a tag",
- minChars: 0,
- width: "300px",
- height: "100px",
- autocomplete: {
- selectFirst: !1
- },
- hide: !0,
- delimiter: ",",
- unique: !0,
- removeWithBackspace: !0,
- placeholderColor: "#666666",
- autosize: !0,
- comfortZone: 20,
- inputPadding: 12
- }, i);
- return this.each(function() {
- n.hide && e(this).hide();
- var i = e(this).attr("id"),
- s = jQuery.extend({
- pid: i,
- real_input: "#" + i,
- holder: "#" + i + "_tagsinput",
- input_wrapper: "#" + i + "_addTag",
- fake_input: "#" + i + "_tag"
- }, n);
- t[i] = s.delimiter, (n.onAddTag || n.onRemoveTag || n.onChange) && (o[i] = new Array, o[i].onAddTag = n.onAddTag, o[i].onRemoveTag = n.onRemoveTag, o[i].onChange = n.onChange);
- var r = '<div id="' + i + '_tagsinput" class="tagsinput"><div id="' + i + '_addTag">';
- if (n.interactive && (r = r + '<input id="' + i + '_tag" value="" data-default="' + n.defaultText + '" />'), r += '</div><div class="tags_clear"></div></div>', e(r).insertAfter(this), e(s.holder).css("width", n.width), e(s.holder).css("height", n.height), "" != e(s.real_input).val() && e.fn.tagsInput.importTags(e(s.real_input), e(s.real_input).val()), n.interactive) {
- if (e(s.fake_input).val(e(s.fake_input).attr("data-default")), e(s.fake_input).css("color", n.placeholderColor), e(s.fake_input).resetAutosize(n), e(s.holder).bind("click", s, function(t) {
- e(t.data.fake_input).focus()
- }), e(s.fake_input).bind("focus", s, function(t) {
- e(t.data.fake_input).val() == e(t.data.fake_input).attr("data-default") && e(t.data.fake_input).val(""), e(t.data.fake_input).css("color", "#000000")
- }), void 0 != n.autocomplete_url) {
- autocomplete_options = {
- source: n.autocomplete_url
- };
- for (attrname in n.autocomplete) autocomplete_options[attrname] = n.autocomplete[attrname];
- void 0 !== jQuery.Autocompleter ? (n.autocomplete.onItemSelect = function(t, o) {
- e("#" + i).addTag(t.data + "", {
- focus: !0,
- unique: n.unique
- })
- }, e(s.fake_input).autocomplete(n.autocomplete_url, n.autocomplete), e(s.fake_input).bind("result", s, function(t, o, s) {
- o && e("#" + i).addTag(o[0] + "", {
- focus: !0,
- unique: n.unique
- })
- })) : void 0 !== jQuery.ui.autocomplete && (e(s.fake_input).autocomplete(autocomplete_options), e(s.fake_input).bind("autocompleteselect", s, function(t, i) {
- return e(t.data.real_input).addTag(i.item.value, {
- focus: !0,
- unique: n.unique
- }), !1
- }))
- } else e(s.fake_input).bind("blur", s, function(t) {
- var i = e(this).attr("data-default");
- return "" != e(t.data.fake_input).val() && e(t.data.fake_input).val() != i ? t.data.minChars <= e(t.data.fake_input).val().length && (!t.data.maxChars || t.data.maxChars >= e(t.data.fake_input).val().length) && e(t.data.real_input).addTag(e(t.data.fake_input).val(), {
- focus: !0,
- unique: n.unique
- }) : (e(t.data.fake_input).val(e(t.data.fake_input).attr("data-default")), e(t.data.fake_input).css("color", n.placeholderColor)), !1
- });
- e(s.fake_input).bind("keypress", s, function(t) {
- return t.which == t.data.delimiter.charCodeAt(0) || 13 == t.which ? (t.preventDefault(), t.data.minChars <= e(t.data.fake_input).val().length && (!t.data.maxChars || t.data.maxChars >= e(t.data.fake_input).val().length) && e(t.data.real_input).addTag(e(t.data.fake_input).val(), {
- focus: !0,
- unique: n.unique
- }), e(t.data.fake_input).resetAutosize(n), !1) : void(t.data.autosize && e(t.data.fake_input).doAutosize(n))
- }), s.removeWithBackspace && e(s.fake_input).bind("keydown", function(t) {
- if (8 == t.keyCode && "" == e(this).val()) {
- t.preventDefault();
- var i = e(this).closest(".tagsinput").find(".tag:last").text(),
- o = e(this).attr("id").replace(/_tag$/, "");
- i = i.replace(/[\s]+×$/, ""), e("#" + o).removeTag(escape(i)), e(this).trigger("focus")
- }
- }), e(s.fake_input).blur(), s.unique && e(s.fake_input).keydown(function(t) {
- (8 == t.keyCode || String.fromCharCode(t.which).match(/\w+|[áéÃóúÃÉÃÓÚñÑ,/]+/)) && e(this).removeClass("not_valid")
- })
- }
- return !1
- }), this
- }, e.fn.tagsInput.updateTagsField = function(i, o) {
- var n = e(i).attr("id");
- e(i).val(o.join(t[n]))
- }, e.fn.tagsInput.importTags = function(n, s) {
- e(n).val("");
- var r = e(n).attr("id"),
- a = s.split(t[r]);
- for (i = 0; i < a.length; i++) e(n).addTag(a[i], {
- focus: !1,
- callback: !1
- });
- if (o[r] && o[r].onChange) {
- var l = o[r].onChange;
- l.call(n, n, a[i])
- }
- }
- }(jQuery),
- function(e) {
- "use strict";
- e.fn.autocomplete = function(t) {
- var i;
- arguments.length > 1 ? (i = t, t = arguments[1], t.url = i) : "string" == typeof t && (i = t, t = {
- url: i
- });
- var o = e.extend({}, e.fn.autocomplete.defaults, t);
- return this.each(function() {
- var t = e(this);
- t.data("autocompleter", new e.Autocompleter(t, e.meta ? e.extend({}, o, t.data()) : o))
- })
- }, e.fn.autocomplete.defaults = {
- inputClass: "acInput",
- loadingClass: "acLoading",
- resultsClass: "acResults",
- selectClass: "acSelect",
- queryParamName: "q",
- extraParams: {},
- remoteDataType: !1,
- lineSeparator: "\n",
- cellSeparator: "|",
- minChars: 2,
- maxItemsToShow: 10,
- delay: 400,
- useCache: !0,
- maxCacheLength: 10,
- matchSubset: !0,
- matchCase: !1,
- matchInside: !0,
- mustMatch: !1,
- selectFirst: !1,
- selectOnly: !1,
- showResult: null,
- preventDefaultReturn: 1,
- preventDefaultTab: 0,
- autoFill: !1,
- filterResults: !0,
- filter: !0,
- sortResults: !0,
- sortFunction: null,
- onItemSelect: null,
- onNoMatch: null,
- onFinish: null,
- matchStringConverter: null,
- beforeUseConverter: null,
- autoWidth: "min-width",
- useDelimiter: !1,
- delimiterChar: ",",
- delimiterKeyCode: 188,
- processData: null,
- onError: null,
- enabled: !0
- };
- var t = function(t) {
- var i, o, n = typeof t;
- return "string" === n ? (i = t, o = {}) : e.isArray(t) ? (i = t[0], o = t.slice(1)) : "object" === n && (i = t.value, o = t.data), i = String(i), "object" != typeof o && (o = {}), {
- value: i,
- data: o
- }
- },
- i = function(e, t, i) {
- var o = parseInt(e, 10);
- return i = i || {}, (isNaN(o) || i.min && o < i.min) && (o = t), o
- },
- o = function(e, t) {
- return [e, encodeURIComponent(t)].join("=")
- },
- n = function(t, i) {
- var n = [];
- return e.each(i, function(e, t) {
- n.push(o(e, t))
- }), n.length && (t += -1 === t.indexOf("?") ? "?" : "&", t += n.join("&")), t
- },
- s = function(e, t, i) {
- return e = String(e.value), t = String(t.value), i || (e = e.toLowerCase(), t = t.toLowerCase()), e > t ? 1 : t > e ? -1 : 0
- },
- r = function(e, t, i) {
- var o, n, s, r, a, l, c = [];
- for (l = String(e).replace("\r\n", "\n").split(t), o = 0; o < l.length; o++) {
- for (r = l[o].split(i), s = [], n = 0; n < r.length; n++) s.push(decodeURIComponent(r[n]));
- a = s.shift(), c.push({
- value: a,
- data: s
- })
- }
- return c
- };
- e.Autocompleter = function(t, o) {
- if (!(t && t instanceof e && 1 === t.length && "INPUT" === t.get(0).tagName.toUpperCase())) throw new Error("Invalid parameter for jquery.Autocompleter, jQuery object with one element with INPUT tag expected.");
- var n = this;
- this.options = o, this.cacheData_ = {}, this.cacheLength_ = 0, this.selectClass_ = "jquery-autocomplete-selected-item", this.keyTimeout_ = null, this.finishTimeout_ = null, this.lastKeyPressed_ = null, this.lastProcessedValue_ = null, this.lastSelectedValue_ = null, this.active_ = !1, this.finishOnBlur_ = !0, this.options.minChars = i(this.options.minChars, e.fn.autocomplete.defaults.minChars, {
- min: 0
- }), this.options.maxItemsToShow = i(this.options.maxItemsToShow, e.fn.autocomplete.defaults.maxItemsToShow, {
- min: 0
- }), this.options.maxCacheLength = i(this.options.maxCacheLength, e.fn.autocomplete.defaults.maxCacheLength, {
- min: 1
- }), this.options.delay = i(this.options.delay, e.fn.autocomplete.defaults.delay, {
- min: 0
- }), 2 != this.options.preventDefaultReturn && (this.options.preventDefaultReturn = this.options.preventDefaultReturn ? 1 : 0), 2 != this.options.preventDefaultTab && (this.options.preventDefaultTab = this.options.preventDefaultTab ? 1 : 0), this.dom = {}, this.dom.$elem = t, this.dom.$elem.attr("autocomplete", "off").addClass(this.options.inputClass), this.dom.$results = e("<div></div>").hide().addClass(this.options.resultsClass).css({
- position: "absolute"
- }), e("body").append(this.dom.$results), t.keydown(function(e) {
- switch (n.lastKeyPressed_ = e.keyCode, n.lastKeyPressed_) {
- case n.options.delimiterKeyCode:
- n.options.useDelimiter && n.active_ && n.selectCurrent();
- break;
- case 35:
- case 36:
- case 16:
- case 17:
- case 18:
- case 37:
- case 39:
- break;
- case 38:
- return e.preventDefault(), n.active_ ? n.focusPrev() : n.activate(), !1;
- case 40:
- return e.preventDefault(), n.active_ ? n.focusNext() : n.activate(), !1;
- case 9:
- if (n.active_ && (n.selectCurrent(), n.options.preventDefaultTab)) return e.preventDefault(), !1;
- if (2 === n.options.preventDefaultTab) return e.preventDefault(), !1;
- break;
- case 13:
- if (n.active_ && (n.selectCurrent(), n.options.preventDefaultReturn)) return e.preventDefault(), !1;
- if (2 === n.options.preventDefaultReturn) return e.preventDefault(), !1;
- break;
- case 27:
- if (n.active_) return e.preventDefault(), n.deactivate(!0), !1;
- break;
- default:
- n.activate()
- }
- }), t.on("paste", function() {
- n.activate()
- });
- var s = function() {
- n.deactivate(!0)
- };
- t.blur(function() {
- n.finishOnBlur_ && (n.finishTimeout_ = setTimeout(s, 200))
- }), t.parents("form").on("submit", s)
- }, e.Autocompleter.prototype.position = function() {
- var t = this.dom.$elem.offset(),
- i = this.dom.$results.outerHeight(),
- o = e(window).outerHeight(),
- n = t.top + this.dom.$elem.outerHeight(),
- s = n + i,
- r = {
- top: n,
- left: t.left
- };
- if (s > o) {
- var a = t.top - i;
- a >= 0 && (r.top = a)
- }
- this.dom.$results.css(r)
- }, e.Autocompleter.prototype.cacheRead = function(e) {
- var t, i, o, n, s;
- if (this.options.useCache)
- for (e = String(e), t = e.length, i = this.options.matchSubset ? 1 : t; t >= i;) {
- for (n = this.options.matchInside ? t - i : 0, s = 0; n >= s;) {
- if (o = e.substr(0, i), void 0 !== this.cacheData_[o]) return this.cacheData_[o];
- s++
- }
- i++
- }
- return !1
- }, e.Autocompleter.prototype.cacheWrite = function(e, t) {
- return this.options.useCache ? (this.cacheLength_ >= this.options.maxCacheLength && this.cacheFlush(), e = String(e), void 0 !== this.cacheData_[e] && this.cacheLength_++, this.cacheData_[e] = t, this.cacheData_[e]) : !1
- }, e.Autocompleter.prototype.cacheFlush = function() {
- this.cacheData_ = {}, this.cacheLength_ = 0
- }, e.Autocompleter.prototype.callHook = function(t, i) {
- var o = this.options[t];
- return o && e.isFunction(o) ? o(i, this) : !1
- }, e.Autocompleter.prototype.activate = function() {
- if (this.options.enabled) {
- var e = this;
- this.keyTimeout_ && clearTimeout(this.keyTimeout_), this.keyTimeout_ = setTimeout(function() {
- e.activateNow()
- }, this.options.delay)
- }
- }, e.Autocompleter.prototype.activateNow = function() {
- var e = this.beforeUseConverter(this.dom.$elem.val());
- e !== this.lastProcessedValue_ && e !== this.lastSelectedValue_ && this.fetchData(e)
- }, e.Autocompleter.prototype.fetchData = function(e) {
- var t = this,
- i = function(e, i) {
- t.options.processData && (e = t.options.processData(e)), t.showResults(t.filterResults(e, i), i)
- };
- this.lastProcessedValue_ = e, e.length < this.options.minChars ? i([], e) : this.options.data ? i(this.options.data, e) : this.fetchRemoteData(e, function(t) {
- i(t, e)
- })
- }, e.Autocompleter.prototype.fetchRemoteData = function(t, i) {
- var o = this.cacheRead(t);
- if (o) i(o);
- else {
- var n = this,
- s = "json" === n.options.remoteDataType ? "json" : "text",
- r = function(e) {
- var o = !1;
- e !== !1 && (o = n.parseRemoteData(e), n.cacheWrite(t, o)), n.dom.$elem.removeClass(n.options.loadingClass), i(o)
- };
- this.dom.$elem.addClass(this.options.loadingClass), e.ajax({
- url: this.makeUrl(t),
- success: r,
- error: function(t, i, o) {
- e.isFunction(n.options.onError) ? n.options.onError(t, i, o) : r(!1)
- },
- dataType: s
- })
- }
- }, e.Autocompleter.prototype.setExtraParam = function(t, i) {
- var o = e.trim(String(t));
- return o && (this.options.extraParams || (this.options.extraParams = {}), this.options.extraParams[o] !== i && (this.options.extraParams[o] = i, this.cacheFlush())), this
- }, e.Autocompleter.prototype.makeUrl = function(t) {
- var i = this.options.url,
- o = e.extend({}, this.options.extraParams);
- return this.options.queryParamName === !1 ? i += encodeURIComponent(t) : o[this.options.queryParamName] = t, n(i, o)
- }, e.Autocompleter.prototype.parseRemoteData = function(t) {
- var i, o = t;
- if ("json" === this.options.remoteDataType) {
- switch (i = typeof t) {
- case "object":
- o = t;
- break;
- case "string":
- o = e.parseJSON(t);
- break;
- default:
- throw new Error("Unexpected remote data type: " + i)
- }
- return o
- }
- return r(o, this.options.lineSeparator, this.options.cellSeparator)
- }, e.Autocompleter.prototype.defaultFilter = function(e, t) {
- if (!e.value) return !1;
- if (this.options.filterResults) {
- var i = this.matchStringConverter(t),
- o = this.matchStringConverter(e.value);
- this.options.matchCase || (i = i.toLowerCase(), o = o.toLowerCase());
- var n = o.indexOf(i);
- return this.options.matchInside ? n > -1 : 0 === n
- }
- return !0
- }, e.Autocompleter.prototype.filterResult = function(t, i) {
- return this.options.filter === !1 ? !0 : e.isFunction(this.options.filter) ? this.options.filter(t, i) : this.defaultFilter(t, i)
- }, e.Autocompleter.prototype.filterResults = function(e, i) {
- var o, n, s = [];
- for (o = 0; o < e.length; o++) n = t(e[o]), this.filterResult(n, i) && s.push(n);
- return this.options.sortResults && (s = this.sortResults(s, i)), this.options.maxItemsToShow > 0 && this.options.maxItemsToShow < s.length && (s.length = this.options.maxItemsToShow), s
- }, e.Autocompleter.prototype.sortResults = function(t, i) {
- var o = this,
- n = this.options.sortFunction;
- return e.isFunction(n) || (n = function(e, t, i) {
- return s(e, t, o.options.matchCase)
- }), t.sort(function(e, t) {
- return n(e, t, i, o.options)
- }), t
- }, e.Autocompleter.prototype.matchStringConverter = function(t, i, o) {
- var n = this.options.matchStringConverter;
- return e.isFunction(n) && (t = n(t, i, o)), t
- }, e.Autocompleter.prototype.beforeUseConverter = function(t) {
- t = this.getValue(t);
- var i = this.options.beforeUseConverter;
- return e.isFunction(i) && (t = i(t)), t
- }, e.Autocompleter.prototype.enableFinishOnBlur = function() {
- this.finishOnBlur_ = !0
- }, e.Autocompleter.prototype.disableFinishOnBlur = function() {
- this.finishOnBlur_ = !1
- }, e.Autocompleter.prototype.createItemFromResult = function(t) {
- var i = this,
- o = e("<li/>");
- return o.html(this.showResult(t.value, t.data)), o.data({
- value: t.value,
- data: t.data
- }).click(function() {
- i.selectItem(o)
- }).mousedown(i.disableFinishOnBlur).mouseup(i.enableFinishOnBlur), o
- }, e.Autocompleter.prototype.getItems = function() {
- return e(">ul>li", this.dom.$results)
- }, e.Autocompleter.prototype.showResults = function(t, i) {
- var o, n, s, r, a = t.length,
- l = this,
- c = e("<ul></ul>"),
- u = !1,
- p = !1;
- if (a) {
- for (o = 0; a > o; o++) n = t[o], s = this.createItemFromResult(n), c.append(s), u === !1 && (u = String(n.value), p = s, s.addClass(this.options.firstItemClass)), o === a - 1 && s.addClass(this.options.lastItemClass);
- this.dom.$results.html(c).show(), this.position(), this.options.autoWidth && (r = this.dom.$elem.outerWidth() - this.dom.$results.outerWidth() + this.dom.$results.width(), this.dom.$results.css(this.options.autoWidth, r)), this.getItems().hover(function() {
- l.focusItem(this)
- }, function() {}), (this.autoFill(u, i) || this.options.selectFirst || this.options.selectOnly && 1 === a) && this.focusItem(p), this.active_ = !0
- } else this.hideResults(), this.active_ = !1
- }, e.Autocompleter.prototype.showResult = function(t, i) {
- return e.isFunction(this.options.showResult) ? this.options.showResult(t, i) : e("<p></p>").text(t).html()
- }, e.Autocompleter.prototype.autoFill = function(e, t) {
- var i, o, n, s;
- if (this.options.autoFill && 8 !== this.lastKeyPressed_ && (i = String(e).toLowerCase(), o = String(t).toLowerCase(), n = e.length, s = t.length, i.substr(0, s) === o)) {
- var r = this.getDelimiterOffsets(),
- a = r.start ? " " : "";
- this.setValue(a + e);
- var l = s + r.start + a.length,
- c = n + r.start + a.length;
- return this.selectRange(l, c), !0
- }
- return !1
- }, e.Autocompleter.prototype.focusNext = function() {
- this.focusMove(1)
- }, e.Autocompleter.prototype.focusPrev = function() {
- this.focusMove(-1)
- }, e.Autocompleter.prototype.focusMove = function(t) {
- var o = this.getItems();
- if (t = i(t, 0))
- for (var n = 0; n < o.length; n++)
- if (e(o[n]).hasClass(this.selectClass_)) return void this.focusItem(n + t);
- this.focusItem(0)
- }, e.Autocompleter.prototype.focusItem = function(t) {
- var i, o = this.getItems();
- o.length && (o.removeClass(this.selectClass_).removeClass(this.options.selectClass), "number" == typeof t ? (0 > t ? t = 0 : t >= o.length && (t = o.length - 1), i = e(o[t])) : i = e(t), i && i.addClass(this.selectClass_).addClass(this.options.selectClass))
- }, e.Autocompleter.prototype.selectCurrent = function() {
- var t = e("li." + this.selectClass_, this.dom.$results);
- 1 === t.length ? this.selectItem(t) : this.deactivate(!1)
- }, e.Autocompleter.prototype.selectItem = function(e) {
- var t = e.data("value"),
- i = e.data("data"),
- o = this.displayValue(t, i),
- n = this.beforeUseConverter(o);
- this.lastProcessedValue_ = n, this.lastSelectedValue_ = n;
- var s = this.getDelimiterOffsets(),
- r = this.options.delimiterChar,
- a = this.dom.$elem,
- l = 0;
- this.options.useDelimiter && (a.val().substring(s.start - 1, s.start) == r && " " != r && (o = " " + o), a.val().substring(s.end, s.end + 1) != r && this.lastKeyPressed_ != this.options.delimiterKeyCode ? o += r : l = 1), this.setValue(o), this.setCaret(s.start + o.length + l), this.callHook("onItemSelect", {
- value: t,
- data: i
- }), this.deactivate(!0), a.focus()
- }, e.Autocompleter.prototype.displayValue = function(t, i) {
- return e.isFunction(this.options.displayValue) ? this.options.displayValue(t, i) : t
- }, e.Autocompleter.prototype.hideResults = function() {
- this.dom.$results.hide()
- }, e.Autocompleter.prototype.deactivate = function(e) {
- this.finishTimeout_ && clearTimeout(this.finishTimeout_), this.keyTimeout_ && clearTimeout(this.keyTimeout_), e && (this.lastProcessedValue_ !== this.lastSelectedValue_ && (this.options.mustMatch && this.setValue(""), this.callHook("onNoMatch")), this.active_ && this.callHook("onFinish"), this.lastKeyPressed_ = null, this.lastProcessedValue_ = null, this.lastSelectedValue_ = null, this.active_ = !1), this.hideResults()
- }, e.Autocompleter.prototype.selectRange = function(e, t) {
- var i = this.dom.$elem.get(0);
- if (i.setSelectionRange) i.focus(), i.setSelectionRange(e, t);
- else if (i.createTextRange) {
- var o = i.createTextRange();
- o.collapse(!0), o.moveEnd("character", t), o.moveStart("character", e), o.select()
- }
- }, e.Autocompleter.prototype.setCaret = function(e) {
- this.selectRange(e, e)
- }, e.Autocompleter.prototype.getCaret = function() {
- var e, t, i, o, n, s, r = this.dom.$elem,
- a = r[0];
- return a.createTextRange ? (t = document.selection, "textarea" != a.tagName.toLowerCase() ? (e = r.val(), i = t.createRange().duplicate(), i.moveEnd("character", e.length), o = "" === i.text ? e.length : e.lastIndexOf(i.text), i = t.createRange().duplicate(), i.moveStart("character", -e.length), n = i.text.length) : (i = t.createRange(), s = i.duplicate(), s.moveToElementText(a), s.setEndPoint("EndToEnd", i), o = s.text.length - i.text.length, n = o + i.text.length)) : (o = r[0].selectionStart, n = r[0].selectionEnd), {
- start: o,
- end: n
- }
- }, e.Autocompleter.prototype.setValue = function(e) {
- if (this.options.useDelimiter) {
- var t = this.dom.$elem.val(),
- i = this.getDelimiterOffsets(),
- o = t.substring(0, i.start),
- n = t.substring(i.end);
- e = o + e + n
- }
- this.dom.$elem.val(e)
- }, e.Autocompleter.prototype.getValue = function(e) {
- if (this.options.useDelimiter) {
- var t = this.getDelimiterOffsets();
- return e.substring(t.start, t.end).trim()
- }
- return e
- }, e.Autocompleter.prototype.getDelimiterOffsets = function() {
- var e = this.dom.$elem.val();
- if (this.options.useDelimiter) {
- var t = e.substring(0, this.getCaret().start),
- i = t.lastIndexOf(this.options.delimiterChar) + 1,
- o = e.substring(this.getCaret().start),
- n = o.indexOf(this.options.delimiterChar); - 1 == n && (n = e.length), n += this.getCaret().start
- } else i = 0, n = e.length;
- return {
- start: i,
- end: n
- }
- }
- }(jQuery),
- function(e) {
- function t() {
- return e("<div/>")
- }
- var i = Math.abs,
- o = Math.max,
- n = Math.min,
- s = Math.round;
- e.imgAreaSelect = function(r, a) {
- function l(e) {
- return e + me.left - ge.left
- }
- function c(e) {
- return e + me.top - ge.top
- }
- function u(e) {
- return e - me.left + ge.left
- }
- function p(e) {
- return e - me.top + ge.top
- }
- function d(e) {
- return e.pageX - ge.left
- }
- function _(e) {
- return e.pageY - ge.top
- }
- function h(e) {
- var t = e || B,
- i = e || W;
- return {
- x1: s(ye.x1 * t),
- y1: s(ye.y1 * i),
- x2: s(ye.x2 * t),
- y2: s(ye.y2 * i),
- width: s(ye.x2 * t) - s(ye.x1 * t),
- height: s(ye.y2 * i) - s(ye.y1 * i)
- }
- }
- function f(e, t, i, o, n) {
- var r = n || B,
- a = n || W;
- ye = {
- x1: s(e / r || 0),
- y1: s(t / a || 0),
- x2: s(i / r || 0),
- y2: s(o / a || 0)
- }, ye.width = ye.x2 - ye.x1, ye.height = ye.y2 - ye.y1
- }
- function m() {
- F && ue.width() && (me = {
- left: s(ue.offset().left),
- top: s(ue.offset().top)
- }, N = ue.innerWidth(), V = ue.innerHeight(), me.top += ue.outerHeight() - V >> 1, me.left += ue.outerWidth() - N >> 1, Q = s(a.minWidth / B) || 0, G = s(a.minHeight / W) || 0, K = s(n(a.maxWidth / B || 1 << 24, N)), Y = s(n(a.maxHeight / W || 1 << 24, V)), "1.3.2" != e().jquery || "fixed" != $e || be.getBoundingClientRect || (me.top += o(document.body.scrollTop, be.scrollTop), me.left += o(document.body.scrollLeft, be.scrollLeft)), ge = /absolute|relative/.test(L.css("position")) ? {
- left: s(L.offset().left) - L.scrollLeft(),
- top: s(L.offset().top) - L.scrollTop()
- } : "fixed" == $e ? {
- left: e(document).scrollLeft(),
- top: e(document).scrollTop()
- } : {
- left: 0,
- top: 0
- }, M = l(0), z = c(0), (ye.x2 > N || ye.y2 > V) && x())
- }
- function g(t) {
- if (X) {
- switch (pe.css({
- left: l(ye.x1),
- top: c(ye.y1)
- }).add(de).width(ae = ye.width).height(le = ye.height), de.add(_e).add(fe).css({
- left: 0,
- top: 0
- }), _e.width(o(ae - _e.outerWidth() + _e.innerWidth(), 0)).height(o(le - _e.outerHeight() + _e.innerHeight(), 0)), e(he[0]).css({
- left: M,
- top: z,
- width: ye.x1,
- height: V
- }), e(he[1]).css({
- left: M + ye.x1,
- top: z,
- width: ae,
- height: ye.y1
- }), e(he[2]).css({
- left: M + ye.x2,
- top: z,
- width: N - ye.x2,
- height: V
- }), e(he[3]).css({
- left: M + ye.x1,
- top: z + ye.y2,
- width: ae,
- height: V - ye.y2
- }), ae -= fe.outerWidth(), le -= fe.outerHeight(), fe.length) {
- case 8:
- e(fe[4]).css({
- left: ae >> 1
- }), e(fe[5]).css({
- left: ae,
- top: le >> 1
- }), e(fe[6]).css({
- left: ae >> 1,
- top: le
- }), e(fe[7]).css({
- top: le >> 1
- });
- case 4:
- fe.slice(1, 3).css({
- left: ae
- }), fe.slice(2, 4).css({
- top: le
- })
- }
- t !== !1 && (e.imgAreaSelect.onKeyPress != ke && e(document).unbind(e.imgAreaSelect.keyPress, e.imgAreaSelect.onKeyPress), a.keys && e(document)[e.imgAreaSelect.keyPress](e.imgAreaSelect.onKeyPress = ke)), xe && _e.outerWidth() - _e.innerWidth() == 2 && (_e.css("margin", 0), setTimeout(function() {
- _e.css("margin", "auto")
- }, 0))
- }
- }
- function v(e) {
- m(), g(e), J = l(ye.x1), ee = c(ye.y1), te = l(ye.x2), ie = c(ye.y2)
- }
- function $(e, t) {
- a.fadeSpeed ? e.fadeOut(a.fadeSpeed, t) : e.hide()
- }
- function y(e) {
- var t = u(d(e)) - ye.x1,
- i = p(_(e)) - ye.y1;
- ce || (m(), ce = !0, pe.one("mouseout", function() {
- ce = !1
- })), U = "", a.resizable && (i <= a.resizeMargin ? U = "n" : i >= ye.height - a.resizeMargin && (U = "s"), t <= a.resizeMargin ? U += "w" : t >= ye.width - a.resizeMargin && (U += "e")), pe.css("cursor", U ? U + "-resize" : a.movable ? "move" : ""), E && E.toggle()
- }
- function b(t) {
- e("body").css("cursor", ""), (a.autoHide || ye.width * ye.height == 0) && $(pe.add(he), function() {
- e(this).hide()
- }), e(document).unbind("mousemove", S), pe.mousemove(y), a.onSelectEnd(r, h())
- }
- function w(t) {
- return 1 != t.which ? !1 : (m(), U ? (e("body").css("cursor", U + "-resize"), J = l(ye[/w/.test(U) ? "x2" : "x1"]), ee = c(ye[/n/.test(U) ? "y2" : "y1"]), e(document).mousemove(S).one("mouseup", b), pe.unbind("mousemove", y)) : a.movable ? (H = M + ye.x1 - d(t), D = z + ye.y1 - _(t), pe.unbind("mousemove", y), e(document).mousemove(T).one("mouseup", function() {
- a.onSelectEnd(r, h()), e(document).unbind("mousemove", T), pe.mousemove(y)
- })) : ue.mousedown(t), !1)
- }
- function k(e) {
- Z && (e ? (te = o(M, n(M + N, J + i(ie - ee) * Z * (te > J || -1))), ie = s(o(z, n(z + V, ee + i(te - J) / Z * (ie > ee || -1)))), te = s(te)) : (ie = o(z, n(z + V, ee + i(te - J) / Z * (ie > ee || -1))), te = s(o(M, n(M + N, J + i(ie - ee) * Z * (te > J || -1)))), ie = s(ie)))
- }
- function x() {
- J = n(J, M + N), ee = n(ee, z + V), i(te - J) < Q && (te = J - Q * (J > te || -1), M > te ? J = M + Q : te > M + N && (J = M + N - Q)), i(ie - ee) < G && (ie = ee - G * (ee > ie || -1), z > ie ? ee = z + G : ie > z + V && (ee = z + V - G)), te = o(M, n(te, M + N)), ie = o(z, n(ie, z + V)), k(i(te - J) < i(ie - ee) * Z), i(te - J) > K && (te = J - K * (J > te || -1), k()), i(ie - ee) > Y && (ie = ee - Y * (ee > ie || -1), k(!0)), ye = {
- x1: u(n(J, te)),
- x2: u(o(J, te)),
- y1: p(n(ee, ie)),
- y2: p(o(ee, ie)),
- width: i(te - J),
- height: i(ie - ee)
- }, g(), a.onSelectChange(r, h())
- }
- function S(e) {
- return te = /w|e|^$/.test(U) || Z ? d(e) : l(ye.x2), ie = /n|s|^$/.test(U) || Z ? _(e) : c(ye.y2), x(), !1
- }
- function C(t, i) {
- te = (J = t) + ye.width, ie = (ee = i) + ye.height, e.extend(ye, {
- x1: u(J),
- y1: p(ee),
- x2: u(te),
- y2: p(ie)
- }), g(), a.onSelectChange(r, h())
- }
- function T(e) {
- return J = o(M, n(H + d(e), M + N - ye.width)), ee = o(z, n(D + _(e), z + V - ye.height)), C(J, ee), e.preventDefault(), !1
- }
- function P() {
- e(document).unbind("mousemove", P), m(), te = J, ie = ee, x(), U = "", he.is(":visible") || pe.add(he).hide().fadeIn(a.fadeSpeed || 0), X = !0, e(document).unbind("mouseup", A).mousemove(S).one("mouseup", b), pe.unbind("mousemove", y), a.onSelectStart(r, h())
- }
- function A() {
- e(document).unbind("mousemove", P).unbind("mouseup", A), $(pe.add(he)), f(u(J), p(ee), u(J), p(ee)), this instanceof e.imgAreaSelect || (a.onSelectChange(r, h()), a.onSelectEnd(r, h()))
- }
- function q(t) {
- return 1 != t.which || he.is(":animated") ? !1 : (m(), H = J = d(t), D = ee = _(t), e(document).mousemove(P).mouseup(A), !1)
- }
- function O() {
- v(!1)
- }
- function R() {
- F = !0, I(a = e.extend({
- classPrefix: "imgareaselect",
- movable: !0,
- parent: "body",
- resizable: !0,
- resizeMargin: 10,
- onInit: function() {},
- onSelectStart: function() {},
- onSelectChange: function() {},
- onSelectEnd: function() {}
- }, a)), pe.add(he).css({
- visibility: ""
- }), a.show && (X = !0, m(), g(), pe.add(he).hide().fadeIn(a.fadeSpeed || 0)), setTimeout(function() {
- a.onInit(r, h())
- }, 0)
- }
- function j(e, t) {
- for (var i in t) void 0 !== a[i] && e.css(t[i], a[i])
- }
- function I(i) {
- if (i.parent && (L = e(i.parent)).append(pe).append(he), e.extend(a, i), m(), null != i.handles) {
- for (fe.remove(), fe = e([]), se = i.handles ? "corners" == i.handles ? 4 : 8 : 0; se--;) fe = fe.add(t());
- fe.addClass(a.classPrefix + "-handle").css({
- position: "absolute",
- fontSize: 0,
- zIndex: ve + 1 || 1
- }), !parseInt(fe.css("width")) >= 0 && fe.width(5).height(5), (re = a.borderWidth) && fe.css({
- borderWidth: re,
- borderStyle: "solid"
- }), j(fe, {
- borderColor1: "border-color",
- borderColor2: "background-color",
- borderOpacity: "opacity"
- })
- }
- for (B = a.imageWidth / N || 1, W = a.imageHeight / V || 1, null != i.x1 && (f(i.x1, i.y1, i.x2, i.y2), i.show = !i.hide), i.keys && (a.keys = e.extend({
- shift: 1,
- ctrl: "resize"
- }, i.keys)), he.addClass(a.classPrefix + "-outer"), de.addClass(a.classPrefix + "-selection"), se = 0; se++ < 4;) e(_e[se - 1]).addClass(a.classPrefix + "-border" + se);
- j(de, {
- selectionColor: "background-color",
- selectionOpacity: "opacity"
- }), j(_e, {
- borderOpacity: "opacity",
- borderWidth: "border-width"
- }), j(he, {
- outerColor: "background-color",
- outerOpacity: "opacity"
- }), (re = a.borderColor1) && e(_e[0]).css({
- borderStyle: "solid",
- borderColor: re
- }), (re = a.borderColor2) && e(_e[1]).css({
- borderStyle: "dashed",
- borderColor: re
- }), pe.append(de.add(_e).add(E)).append(fe), xe && ((re = (he.css("filter") || "").match(/opacity=(\d+)/)) && he.css("opacity", re[1] / 100), (re = (_e.css("filter") || "").match(/opacity=(\d+)/)) && _e.css("opacity", re[1] / 100)), i.hide ? $(pe.add(he)) : i.show && F && (X = !0, pe.add(he).fadeIn(a.fadeSpeed || 0), v()), Z = (ne = (a.aspectRatio || "").split(/:/))[0] / ne[1], ue.add(he).unbind("mousedown", q), a.disable || a.enable === !1 ? (pe.unbind("mousemove", y).unbind("mousedown", w), e(window).unbind("resize", O)) : ((a.enable || a.disable === !1) && ((a.resizable || a.movable) && pe.mousemove(y).mousedown(w), e(window).resize(O)), a.persistent || ue.add(he).mousedown(q)), a.enable = a.disable = void 0
- }
- var F, E, M, z, N, V, L, H, D, B, W, U, Q, G, K, Y, Z, X, J, ee, te, ie, oe, ne, se, re, ae, le, ce, ue = e(r),
- pe = t(),
- de = t(),
- _e = t().add(t()).add(t()).add(t()),
- he = t().add(t()).add(t()).add(t()),
- fe = e([]),
- me = {
- left: 0,
- top: 0
- },
- ge = {
- left: 0,
- top: 0
- },
- ve = 0,
- $e = "absolute",
- ye = {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 0,
- width: 0,
- height: 0
- },
- be = document.documentElement,
- we = navigator.userAgent,
- ke = function(e) {
- var t, i, s = a.keys,
- r = e.keyCode;
- if (t = isNaN(s.alt) || !e.altKey && !e.originalEvent.altKey ? !isNaN(s.ctrl) && e.ctrlKey ? s.ctrl : !isNaN(s.shift) && e.shiftKey ? s.shift : isNaN(s.arrows) ? 10 : s.arrows : s.alt, "resize" == s.arrows || "resize" == s.shift && e.shiftKey || "resize" == s.ctrl && e.ctrlKey || "resize" == s.alt && (e.altKey || e.originalEvent.altKey)) {
- switch (r) {
- case 37:
- t = -t;
- case 39:
- i = o(J, te), J = n(J, te), te = o(i + t, J), k();
- break;
- case 38:
- t = -t;
- case 40:
- i = o(ee, ie), ee = n(ee, ie), ie = o(i + t, ee), k(!0);
- break;
- default:
- return
- }
- x()
- } else switch (J = n(J, te), ee = n(ee, ie), r) {
- case 37:
- C(o(J - t, M), ee);
- break;
- case 38:
- C(J, o(ee - t, z));
- break;
- case 39:
- C(J + n(t, N - u(te)), ee);
- break;
- case 40:
- C(J, ee + n(t, V - p(ie)));
- break;
- default:
- return
- }
- return !1
- };
- this.remove = function() {
- I({
- disable: !0
- }), pe.add(he).remove()
- }, this.getOptions = function() {
- return a
- }, this.setOptions = I, this.getSelection = h, this.setSelection = f, this.cancelSelection = A, this.update = v;
- var xe = (/msie ([\w.]+)/i.exec(we) || [])[1],
- Se = /opera/i.test(we),
- Ce = /webkit/i.test(we) && !/chrome/i.test(we);
- for (oe = ue; oe.length;) ve = o(ve, isNaN(oe.css("z-index")) ? ve : oe.css("z-index")), "fixed" == oe.css("position") && ($e = "fixed"), oe = oe.parent(":not(body)");
- ve = a.zIndex || ve, xe && ue.attr("unselectable", "on"), e.imgAreaSelect.keyPress = xe || Ce ? "keydown" : "keypress", Se && (E = t().css({
- width: "100%",
- height: "100%",
- position: "absolute",
- zIndex: ve + 2 || 2
- })), pe.add(he).css({
- visibility: "hidden",
- position: $e,
- overflow: "hidden",
- zIndex: ve || "0"
- }), pe.css({
- zIndex: ve + 2 || 2
- }), de.add(_e).css({
- position: "absolute",
- fontSize: 0
- }), r.complete || "complete" == r.readyState || !ue.is("img") ? R() : ue.one("load", R), !F && xe && xe >= 7 && (r.src = r.src)
- }, e.fn.imgAreaSelect = function(t) {
- return t = t || {}, this.each(function() {
- e(this).data("imgAreaSelect") ? t.remove ? (e(this).data("imgAreaSelect").remove(), e(this).removeData("imgAreaSelect")) : e(this).data("imgAreaSelect").setOptions(t) : t.remove || (void 0 === t.enable && void 0 === t.disable && (t.enable = !0), e(this).data("imgAreaSelect", new e.imgAreaSelect(this, t)))
- }), t.instance ? e(this).data("imgAreaSelect") : this
- }
- }(jQuery),
- function(e) {
- e.fn.visible = function(t, i, o) {
- var n = e(this).eq(0),
- s = n.get(0),
- r = e(window),
- a = r.scrollTop(),
- l = a + r.height(),
- c = r.scrollLeft(),
- u = c + r.width(),
- p = n.offset().top,
- d = p + n.height(),
- _ = n.offset().left,
- h = _ + n.width(),
- f = t === !0 ? d : p,
- m = t === !0 ? p : d,
- g = t === !0 ? h : _,
- v = t === !0 ? _ : h,
- $ = i === !0 ? s.offsetWidth * s.offsetHeight : !0,
- o = o ? o : "both";
- return "both" === o ? !!$ && l >= m && f >= a && u >= v && g >= c : "vertical" === o ? !!$ && l >= m && f >= a : "horizontal" === o ? !!$ && u >= v && g >= c : void 0
- }
- }(jQuery),
- function(e) {
- e.fn.combSpr = function(t) {
- var i = e.extend({
- width: 0,
- dataurl: !1,
- valueInput: "",
- value: 0,
- valueText: "",
- childPlugin: null,
- childBlock: null,
- field: null,
- fieldPlugin: null,
- fieldValue: null,
- placeholder: "",
- zIndex: 0,
- onSelect: function() {},
- onClear: function() {}
- }, t);
- return this.each(function() {
- var t, o, n = e(this).val(),
- s = i.value,
- r = -1,
- a = [],
- l = e(this),
- c = !1,
- u = {
- set_value: function(t) {
- l.val(a[r].title), s = a[r].id, e("#comb_spr_result_" + i.valueInput).hide(), e("#comb_spr_results_" + i.valueInput).html(""), e("#" + i.valueInput).val(a[r].id), "null" != i.childPlugin && e("#" + i.childPlugin).trigger("enable"), "null" != i.childBlock && 0 != a[r].id && e("#" + i.childBlock).show(), console.log("setting value " + a[r].title), "null" != i.childPlugin && e("#" + i.childPlugin).focus(), "function" == typeof i.onSelect && i.onSelect.call(this), clearTimeout(o)
- },
- update_current: function(t) {
- e("#comb_spr_results_" + i.valueInput).children("a").removeClass("current"), r >= 0 && (e(".combspr_item:eq(" + r + ")").addClass("current"), e("#comb_spr_results_" + i.valueInput).scrollTop(e("#comb_spr_results_" + i.valueInput).scrollTop() + e(".combspr_item:eq(" + r + ")").position().top - e("#comb_spr_results_" + i.valueInput).height() / 2 + e(".combspr_item:eq(" + r + ")").height() / 2))
- },
- fetch_result: function(o) {
- console.log("fetch result");
- var n = e(this).val(),
- s = {
- query: e(this).val()
- };
- null != i.field && (s[i.field] = e("#" + i.fieldValue).val()), t && t.abort(), t = e.ajax({
- type: "GET",
- url: i.dataurl,
- data: s,
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- "ok" == t.status && (a = t.result, r = -1, u.show_results.apply(this, {
- value: n
- }), a.length > 0 && (e("#comb_spr_result_" + i.valueInput).show(), e("#comb_spr_results_" + i.valueInput).show()))
- },
- error: function() {
- console.log("ajax error")
- }
- })
- },
- show_results: function(t, o) {
- if (e("#comb_spr_results_" + i.valueInput).html(""), 0 == a.length);
- else {
- var s = !1;
- a.forEach(function(t, o, a) {
- var l = "";
- if ("" != n) {
- var c = new RegExp("(" + n + ")", "ig");
- l = t.title.replace(c, "<b>$1</b>"), s || (r = o, s = !0)
- } else l = t.title;
- var u = '<a href="#" rel="' + o + '" class="combspr_item">' + l;
- "" != t.subtitle && (u += '<div class="comb_spr_sub">' + t.subtitle + "</div>"), u += "</a>", e("#comb_spr_results_" + i.valueInput).append(u)
- }), u.update_current.apply(this, ["top"])
- }
- }
- };
- e(this).attr("autocomplete", "off"), e(this).wrap('<div id="combspr_div_' + i.valueInput + '" class="combspr_div"><div class="comb_spr_inp"></div></div>'), e(this).addClass("combspr");
- var p = i.width - 34;
- e(this).css("width", p + "px"), e(this).after('<b class="button comb_spr_button">â–¾</b>'), e(this).after('<input type="hidden" name="' + i.valueInput + '" id="' + i.valueInput + '">'), e("#" + i.valueInput).val(i.value), e(this).val(i.valueText), e(this).parent("div.comb_spr_inp").parent("div.combspr_div").append('<div id="comb_spr_result_' + i.valueInput + '" class="results"><div class="inner" id="comb_spr_results_' + i.valueInput + '"> </div></div>'), i.zIndex > 0 && (e(this).parent("div.comb_spr_inp").css("z-index", i.zIndex, "important"), e(this).parent("div.comb_spr_inp").parent("div.combspr_div").children("div.results").css("z-index", --i.zIndex, "important")), "null" != i.childPlugin && 0 == e("#" + i.valueInput).val() && e("#" + i.childPlugin).trigger("disable"), "" != i.placeholder && e(this).attr("placeholder", i.placeholder), e(this).focus(function() {
- e("#comb_spr_result_" + i.valueInput).show(), u.fetch_result.apply(this, {})
- }), e("#comb_spr_results_" + i.valueInput).on("click", "a", function() {
- return r = parseInt(e(this).attr("rel")), console.log("a clicked index " + r), u.set_value.apply(this), !1
- }), e("#combspr_div_" + i.valueInput).on("click", ".comb_spr_button", function() {
- return c ? !1 : (e("#comb_spr_result_" + i.valueInput).show(), void u.fetch_result.apply(this, {}))
- }), e(this).keydown(function(e) {
- var t = e.keyCode || e.which;
- 13 == t ? (a.length > 0 && r >= 0 && u.set_value.apply(this), e.preventDefault()) : 38 == t ? (a.length > 0 && r > 0 && (r--, u.update_current.apply(this, ["top"])), e.preventDefault()) : 40 == t && (a.length > 0 && r < a.length - 1 && (r++, u.update_current.apply(this, ["bottom"])), e.preventDefault())
- }), e(this).keyup(function(t) {
- var o = t.keyCode || t.which;
- console.log("keyup " + o), 13 != o && 38 != o && 40 != o && (s = 0, n = e(this).val(), u.fetch_result.apply(this, {}), "null" != i.childPlugin && (e("#" + i.childPlugin).trigger("clearvalue"), e("#" + i.childPlugin).trigger("disable"), "null" != i.childBlock && e("#" + i.childBlock).hide()))
- }), e(this).blur(function() {
- o = setTimeout(function() {
- 0 == s && (l.val(""), e("#" + i.valueInput).val(0), "function" == typeof i.onClear && i.onClear.call(this)), a = [], r = -1, e("#comb_spr_result_" + i.valueInput).hide(), e("#comb_spr_results_" + i.valueInput).html("")
- }, 150)
- }), e(this).bind("disable", function() {
- c = !0, e(this).attr("disabled", "disabled"), e(this).parent("div.comb_spr_inp").addClass("comb_spr_inp_dis"), console.log("disable")
- }), e(this).bind("enable", function() {
- c = !1, e(this).removeAttr("disabled"), e(this).parent("div.comb_spr_inp").removeClass("comb_spr_inp_dis"), console.log("enable")
- }), e(this).bind("clearvalue", function() {
- e("#" + i.valueInput).val(0), e(this).val(""), e("#comb_spr_result_" + i.valueInput).hide(), e("#comb_spr_results_" + i.valueInput).html(""), a = [], r = -1
- }), "null" != i.fieldValue && 0 == e("#" + i.fieldValue).val() && (console.log("so what?"), e(this).trigger("disable")), "null" != i.childBlock && 0 == e("#" + i.valueInput).val() && e("#" + i.childBlock).hide()
- })
- }
- }(jQuery),
- function() {
- ! function(e) {
- var t, i;
- return t = function() {
- function t(t, i, o, n) {
- var s, r, a;
- if (s = this._normalize_args(t, i, o, n), this.$container = s.$container, this.target = s.target, a = s.init_options, this._is_window = !this.$container[0].nodeName || -1 !== e.inArray(this.$container[0].nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]), this._is_window && (this.$container = e(this.$container[0].contentWindow || window), a.container = this.$container), this._$container_for_scroll = this.$container.is(e(window)) ? e("body, html") : this.$container, a = this._normalize_options(a), this.options = e.extend(!0, {}, this.constructor.defaults, a), this.options = this._normalize_mode_options(this.options), null == this.target) return e.extend(!0, this.constructor.defaults, a), this._set_status("cancel"), this;
- if (this._is_in_motion()) {
- if (!this.constructor.last_scrollport.options.interrupt_scrollport) return this._set_status("cancel"), this;
- this.constructor.last_scrollport.stop("interrupt")
- }
- return this.final_position = this._get_final_position(this.target), this.final_position.top_distance + this.final_position.left_distance === 0 ? (this._set_status("cancel"), this) : (r = this._$container_for_scroll.offset(), this.scroll_position = {
- top: this.$container.scrollTop(),
- left: this.$container.scrollLeft()
- }, this.constructor.last_scrollport = this, this._do_scroll(this.final_position))
- }
- return t.defaults = {
- mode: "usual",
- interrupt: null,
- interrupt_user: !0,
- interrupt_scrollport: !0,
- container: e(window),
- delta: {
- top: 0,
- left: 0
- },
- on_start: null,
- on_stop: null,
- on_interrupt: null,
- on_finish: null
- }, t.prototype._normalize_args = function(t, i, o, n) {
- var s, r;
- return s = {}, r = null, null != n ? (s = n, r = {
- top: parseFloat(i),
- left: parseFloat(o)
- }) : null != o ? !isNaN(parseFloat(o)) && isFinite(o) ? r = {
- top: parseFloat(i),
- left: parseFloat(o)
- } : (s = o, r = !isNaN(parseFloat(i)) && isFinite(i) ? {
- top: parseFloat(i)
- } : i) : null != i && (!isNaN(parseFloat(i)) && isFinite(i) ? r = {
- top: parseFloat(i)
- } : "object" != typeof i || i instanceof jQuery ? r = i : s = i), null == t && (t = null != s.container ? s.container : e(window)), s.container = t, {
- $container: t,
- target: r,
- init_options: s
- }
- }, t.last_scrollport = !1, t.prototype.status = "init", t.prototype._is_window = function(t) {
- return !t.nodeName || -1 !== e.inArray(t.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"])
- }, t.prototype._get_final_position = function(t) {
- var i, o, n, s, r, a, l, c, u, p, d, _, h, f, m, g, v;
- return _ = this.$container.scrollTop(), d = this.$container.scrollLeft(), t instanceof jQuery || "object" == typeof t ? t instanceof jQuery && (i = t) : i = e(t), s = this._$container_for_scroll.offset(), l = s.top, n = s.left, r = this._$container_for_scroll[0].scrollHeight, a = this._$container_for_scroll[0].scrollWidth, o = this.$container.innerHeight(), c = this.$container.innerWidth(), null != i ? (f = i.offset(), m = f.top - this.options.delta.top, h = f.left - this.options.delta.left) : (m = null != t.top ? t.top - this.options.delta.top : _, h = null != t.left ? t.left - this.options.delta.left : d), c >= a ? (u = 0, p = 0) : (u = h + (this._is_window ? 0 : d) - n, u > a - c && (u = a - c), p = u - d), o >= r ? (g = 0, v = 0) : (g = m + (this._is_window ? 0 : _) - l, g > r - o && (g = r - o), v = g - _), {
- top: g,
- left: u,
- top_distance: v,
- left_distance: p
- }
- }, t.prototype._get_distance_betwin_points = function(e, t, i, o) {
- var n, s;
- return s = o - t, n = i - e, Math.sqrt(s * s + n * n)
- }, t.prototype._get_point_betwin_points = function(e, t, i, o, n) {
- var s, r, a, l;
- return l = o - t, a = i - e, s = Math.sqrt(l * l + a * a), 0 > n && (n = s + n), r = n / s, {
- left: e + a * r,
- top: t + l * r
- }
- }, t.prototype._modes = {
- usual: {
- defaults: {
- easing: "swing",
- duration: 700
- },
- do_scroll: function(e, t) {
- return e._$container_for_scroll.stop(!0).animate({
- scrollTop: t.top,
- scrollLeft: t.left
- }, e.options.duration, e.options.easing, function() {
- return e._$container_for_scroll.last().is(this) ? e.stop("finish") : void 0
- })
- },
- stop_scroll: function(e, t) {
- return e._$container_for_scroll.stop(!0), e._set_status(t), e._call_end_callbacks()
- }
- },
- roll: {
- defaults: {
- easing: "swing",
- speed: 2500,
- max_duration: 700,
- min_duration: 300
- },
- do_scroll: function(e, t) {
- var i, o;
- return i = Math.sqrt(t.top_distance * t.top_distance + t.left_distance * t.left_distance), o = i / e.options.speed * 1e3, e.options.max_duration && o < e.options.min_duration && (o = e.options.min_duration), e.options.min_duration && o > e.options.max_duration && (o = e.options.max_duration), e._$container_for_scroll.stop(!0).animate({
- scrollTop: t.top,
- scrollLeft: t.left
- }, o, e.options.easing, function() {
- return e._$container_for_scroll.last().is(this) ? e.stop("finish") : void 0
- }), e
- },
- stop_scroll: function(e, t) {
- return e._$container_for_scroll.stop(!0), e._set_status(t), e._call_end_callbacks()
- }
- },
- hard: {
- defaults: {
- easing: "swing",
- distance: 5,
- duration: 100
- },
- do_scroll: function(e, t) {
- var i;
- return i = e._get_point_betwin_points(e.scroll_position.left, e.scroll_position.top, t.left, t.top, -e.options.distance), e._$container_for_scroll.scrollTop(i.top).scrollLeft(i.left), e._$container_for_scroll.stop(!0).animate({
- scrollTop: t.top,
- scrollLeft: t.left
- }, e.options.duration, e.options.easing, function() {
- return e._$container_for_scroll.last().is(this) ? e.stop("finish") : void 0
- }), e
- },
- stop_scroll: function(e, t) {
- return e._$container_for_scroll.stop(!0), e._set_status(t), e._call_end_callbacks()
- }
- },
- soft: {
- defaults: {
- easing: null,
- easing_before: "swing",
- easing_after: "swing",
- distance: null,
- distance_before: 200,
- distance_after: 200,
- duration: null,
- duration_before: 200,
- duration_after: 400,
- speed: null,
- waiting: 100
- },
- do_scroll: function(i, o) {
- var n, s, r, a;
- return a = Math.sqrt(o.top_distance * o.top_distance + o.left_distance * o.left_distance), a < 1.5 * (i.options.distance_before + i.options.distance_before) ? null != i.target.top ? null != i.target.left ? new t(i.$container, i.target.top, i.target.left, e.extend(!0, {}, i.options, {
- mode: "roll",
- speed: i.options.speed
- })) : new t(i.$container, i.target.top, e.extend(!0, {}, i.options, {
- mode: "roll",
- speed: i.options.speed
- })) : new t(i.$container, i.target, e.extend(!0, {}, i.options, {
- mode: "roll",
- speed: i.options.speed
- })) : (r = i._get_point_betwin_points(i.scroll_position.left, i.scroll_position.top, o.left, o.top, i.options.distance_before), s = i._get_point_betwin_points(i.scroll_position.left, i.scroll_position.top, o.left, o.top, -i.options.distance_after), n = i._get_or_create_overlay(), n.stop(!0).show().animate({
- opacity: 1
- }, i.options.duration_before), i._$container_for_scroll.stop(!0).animate({
- scrollTop: r.top,
- scrollLeft: r.left
- }, i.options.duration_before, i.options.easing_before, function() {
- return i._$container_for_scroll.last().is(this) ? (i._$container_for_scroll.scrollTop(s.top).scrollLeft(s.left), n.animate({
- opacity: 1
- }, i.options.waiting, function() {
- return n.stop(!0).animate({
- opacity: 0
- }, i.options.duration_after, function() {
- return n.hide()
- }), i._$container_for_scroll.stop(!0).animate({
- scrollTop: o.top,
- scrollLeft: o.left
- }, i.options.duration_after, i.options.easing_after, function() {
- return i._$container_for_scroll.last().is(this) ? i.stop("finish") : void 0
- })
- })) : void 0
- }), i)
- },
- stop_scroll: function(e, t) {
- var i, o, n;
- return i = e._get_or_create_overlay(), "none" === i.css("display") ? (e._set_status(t), void e._call_end_callbacks()) : (n = parseFloat(i.css("opacity")), o = e.options.duration_after * n, e._$container_for_scroll.stop(!0), e._set_status(t), e._call_end_callbacks(), i.stop(!0).animate({
- opacity: 0
- }, o, function() {
- return i.hide()
- }))
- }
- }
- }, t.prototype.stop = function(e) {
- return this._modes[this.options.mode].stop_scroll(this, e), this._$container_for_scroll.off("mousewheel.scrollport DOMMouseScroll.scrollport")
- }, t.prototype._do_scroll = function(e) {
- var t;
- return t = this, this._$container_for_scroll.on("mousewheel.scrollport DOMMouseScroll.scrollport", function(e) {
- return t.options.interrupt_user ? (t._$container_for_scroll.off("mousewheel.scrollport DOMMouseScroll.scrollport"), t.stop("interrupt")) : e.preventDefault()
- }), this._set_status("motion"), null != this.options.on_start && this.options.on_start.call(this._$container_for_scroll, this), this._modes[this.options.mode].do_scroll(this, e)
- }, t.prototype._set_status = function(e) {
- return this.status = e
- }, t.prototype._is_in_motion = function() {
- return !!this.constructor.last_scrollport && "motion" === this.constructor.last_scrollport.status
- }, t.prototype._call_end_callbacks = function() {
- return null != this.options.on_stop && this.options.on_stop.call(this._$container_for_scroll, this), null != this.options.on_finish && "finish" === this.status && this.options.on_finish.call(this._$container_for_scroll, this), null != this.options.on_interrupt && "interrupt" === this.status ? this.options.on_interrupt.call(this._$container_for_scroll, this) : void 0
- }, t.prototype._get_or_create_overlay = function() {
- return null != this.constructor._$overlay && e(".scrollport-overlay").length ? this.constructor._$overlay.css({
- width: this._$container_for_scroll[0].scrollWidth,
- height: this._$container_for_scroll[0].scrollHeight
- }) : (this.constructor._$overlay = e("<div>").attr("class", "scrollport-overlay").hide().appendTo(this._$container_for_scroll.first()).css({
- backgroundColor: "#ffffff",
- width: this._$container_for_scroll[0].scrollWidth,
- height: this._$container_for_scroll[0].scrollHeight,
- top: "0",
- left: "0",
- position: "absolute",
- opacity: 0
- }), this.constructor._$overlay)
- }, t.prototype._normalize_options = function(e) {
- return null != e.delta && ("object" == typeof e.delta ? (e.delta.top = null != e.delta.top ? parseFloat(e.delta.top) : 0, e.delta.left = null != e.delta.left ? parseFloat(e.delta.left) : 0) : e.delta = {
- top: e.delta,
- left: 0
- }), null != e.interrupt && (e.interrupt_user = e.interrupt, e.interrupt_scrollport = e.interrupt), e
- }, t.prototype._normalize_mode_options = function(t) {
- return t = e.extend(!0, {}, this._modes[this.options.mode].defaults, t), "soft" === t.mode && (null != t.distance && (t.distance_before = t.distance, t.distance_after = t.distance), null != t.duration && (t.duration_before = t.duration, t.duration_after = t.duration), null != t.easing && (t.easing_before = t.easing, t.easing_after = t.easing), null == t.speed && (t.speed = (t.distance_before + t.distance_after) / (t.duration_before + t.duration_after) * 1e3)), t
- }, t
- }(), i = function() {
- function i(i, o, n, s, r) {
- var a, l, c, u, p, d, _;
- if (d = this, a = this._normalize_args(o, n, s, r), this.$link = i, this.target = a.target, this.$container = a.$container, _ = a.scrollport_options, null == this.target) {
- for (c = ["data-scrollport", "href", "data-href"], u = !1, p = 0; !u && p < c.length;) l = this.$link.attr(c[p]), null != l && "" !== l && (u = !0), p++;
- if (!u) return;
- this.target = e(l)
- }
- this.$link.on("click", function(e) {
- return e.preventDefault(), null != this.target.top ? null != this.target.left ? new t(d.$container, d.target.top, d.target.left, _) : new t(d.$container, d.target.top, _) : new t(d.$container, d.target, _)
- })
- }
- return i.prototype._normalize_args = function(e, t, i, o) {
- var n, s, r;
- return n = null, s = {}, r = null, null != o ? (s = o, n = i, r = {
- top: e,
- left: t
- }) : null != i ? i instanceof jQuery ? (n = i, r = {
- top: e,
- left: t
- }) : (s = i, t instanceof jQuery ? (n = t, r = !isNaN(parseFloat(e)) && isFinite(e) ? {
- top: e
- } : e) : r = {
- top: e,
- left: t
- }) : null != t ? !isNaN(parseFloat(t)) && isFinite(t) ? r = {
- top: e,
- left: t
- } : t instanceof jQuery ? (n = t, r = !isNaN(parseFloat(e)) && isFinite(e) ? {
- top: e
- } : e) : (s = t, r = !isNaN(parseFloat(e)) && isFinite(e) ? {
- top: e
- } : e) : null != e && (!isNaN(parseFloat(e)) && isFinite(e) ? r = {
- top: e
- } : "object" != typeof e || e instanceof jQuery ? r = e : s = e), {
- $container: n,
- target: r,
- scrollport_options: s
- }
- }, i
- }(), e.scrollport = function(e, i, o) {
- return new t(null, e, i, o)
- }, e.fn.scrollport = function(e, i, o) {
- return new t(this.first(), e, i, o), this
- }, e.fn.scrollport_link = function(t, o, n, s) {
- return this.each(function() {
- return new i(e(this), t, o, n, s)
- })
- }, e(function() {
- return e("[data-scrollport]").scrollport_link()
- })
- }(jQuery)
- }.call(this),
- function(e) {
- "function" == typeof define && define.amd ? define(["jquery"], e) : e(window.jQuery)
- }(function(e) {
- e.fn.numeric = function(t, i) {
- "boolean" == typeof t && (t = {
- decimal: t,
- negative: !0,
- decimalPlaces: -1
- }), t = t || {}, "undefined" == typeof t.negative && (t.negative = !0);
- var o = t.decimal === !1 ? "" : t.decimal || ".",
- n = t.negative === !0 ? !0 : !1,
- s = "undefined" == typeof t.decimalPlaces ? -1 : t.decimalPlaces;
- return i = "function" == typeof i ? i : function() {}, this.data("numeric.decimal", o).data("numeric.negative", n).data("numeric.callback", i).data("numeric.decimalPlaces", s).keypress(e.fn.numeric.keypress).keyup(e.fn.numeric.keyup).blur(e.fn.numeric.blur)
- }, e.fn.numeric.keypress = function(t) {
- var i = e.data(this, "numeric.decimal"),
- o = e.data(this, "numeric.negative"),
- n = e.data(this, "numeric.decimalPlaces"),
- s = t.charCode ? t.charCode : t.keyCode ? t.keyCode : 0;
- if (13 == s && "input" == this.nodeName.toLowerCase()) return !0;
- if (13 == s) return !1;
- var r = !1;
- if (t.ctrlKey && 97 == s || t.ctrlKey && 65 == s) return !0;
- if (t.ctrlKey && 120 == s || t.ctrlKey && 88 == s) return !0;
- if (t.ctrlKey && 99 == s || t.ctrlKey && 67 == s) return !0;
- if (t.ctrlKey && 122 == s || t.ctrlKey && 90 == s) return !0;
- if (t.ctrlKey && 118 == s || t.ctrlKey && 86 == s || t.shiftKey && 45 == s) return !0;
- if (48 > s || s > 57) {
- var a = e(this).val();
- if (0 !== e.inArray("-", a.split("")) && o && 45 == s && (0 === a.length || 0 === parseInt(e.fn.getSelectionStart(this), 10))) return !0;
- i && s == i.charCodeAt(0) && -1 != e.inArray(i, a.split("")) && (r = !1), 8 != s && 9 != s && 13 != s && 35 != s && 36 != s && 37 != s && 39 != s && 46 != s ? r = !1 : "undefined" != typeof t.charCode && (t.keyCode == t.which && 0 !== t.which ? (r = !0, 46 == t.which && (r = !1)) : 0 !== t.keyCode && 0 === t.charCode && 0 === t.which && (r = !0)), i && s == i.charCodeAt(0) && (r = -1 == e.inArray(i, a.split("")) ? !0 : !1)
- } else if (r = !0, i && n > 0) {
- var l = e.fn.getSelectionStart(this),
- c = e.fn.getSelectionEnd(this),
- u = e.inArray(i, e(this).val().split(""));
- l === c && u >= 0 && l > u && e(this).val().length > u + n && (r = !1)
- }
- return r
- }, e.fn.numeric.keyup = function(t) {
- var i = e(this).val();
- if (i && i.length > 0) {
- var o = e.fn.getSelectionStart(this),
- n = e.fn.getSelectionEnd(this),
- s = e.data(this, "numeric.decimal"),
- r = e.data(this, "numeric.negative"),
- a = e.data(this, "numeric.decimalPlaces");
- if ("" !== s && null !== s) {
- var l = e.inArray(s, i.split(""));
- 0 === l && (this.value = "0" + i, o++, n++), 1 == l && "-" == i.charAt(0) && (this.value = "-0" + i.substring(1), o++, n++), i = this.value
- }
- for (var c = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "-", s], u = i.length, p = u - 1; p >= 0; p--) {
- var d = i.charAt(p);
- 0 !== p && "-" == d ? i = i.substring(0, p) + i.substring(p + 1) : 0 !== p || r || "-" != d || (i = i.substring(1));
- for (var _ = !1, h = 0; h < c.length; h++)
- if (d == c[h]) {
- _ = !0;
- break
- }
- _ && " " != d || (i = i.substring(0, p) + i.substring(p + 1))
- }
- var f = e.inArray(s, i.split(""));
- if (f > 0)
- for (var m = u - 1; m > f; m--) {
- var g = i.charAt(m);
- g == s && (i = i.substring(0, m) + i.substring(m + 1))
- }
- if (s && a > 0) {
- var l = e.inArray(s, i.split(""));
- l >= 0 && (i = i.substring(0, l + a + 1), n = Math.min(i.length, n))
- }
- this.value = i, e.fn.setSelection(this, [o, n])
- }
- }, e.fn.numeric.blur = function() {
- var t = e.data(this, "numeric.decimal"),
- i = e.data(this, "numeric.callback"),
- o = e.data(this, "numeric.negative"),
- n = this.value;
- if ("" !== n) {
- var s = new RegExp(o ? "-?" : "^\\d+$|^\\d*" + t + "\\d+$");
- s.exec(n) || i.apply(this)
- }
- }, e.fn.removeNumeric = function() {
- return this.data("numeric.decimal", null).data("numeric.negative", null).data("numeric.callback", null).data("numeric.decimalPlaces", null).unbind("keypress", e.fn.numeric.keypress).unbind("keyup", e.fn.numeric.keyup).unbind("blur", e.fn.numeric.blur)
- }, e.fn.getSelectionStart = function(e) {
- if ("number" === e.type) return void 0;
- if (e.createTextRange && document.selection) {
- var t = document.selection.createRange().duplicate();
- return t.moveEnd("character", e.value.length), "" == t.text ? e.value.length : Math.max(0, e.value.lastIndexOf(t.text))
- }
- try {
- return e.selectionStart
- } catch (i) {
- return 0
- }
- }, e.fn.getSelectionEnd = function(e) {
- if ("number" === e.type) return void 0;
- if (e.createTextRange && document.selection) {
- var t = document.selection.createRange().duplicate();
- return t.moveStart("character", -e.value.length), t.text.length
- }
- return e.selectionEnd
- }, e.fn.setSelection = function(e, t) {
- if ("number" == typeof t && (t = [t, t]), t && t.constructor == Array && 2 == t.length)
- if ("number" === e.type) e.focus();
- else if (e.createTextRange) {
- var i = e.createTextRange();
- i.collapse(!0), i.moveStart("character", t[0]), i.moveEnd("character", t[1] - t[0]), i.select()
- } else {
- e.focus();
- try {
- e.setSelectionRange && e.setSelectionRange(t[0], t[1])
- } catch (o) {}
- }
- }
- }),
- function(e, t) {
- "use strict";
- var i = "undefined" != typeof module;
- i && (e = global, e.JS_MD5_TEST && (e.navigator = {
- userAgent: "Firefox"
- }));
- var o, n = (e.JS_MD5_TEST || !i) && -1 != navigator.userAgent.indexOf("Firefox"),
- s = !e.JS_MD5_TEST && "undefined" != typeof ArrayBuffer,
- r = "0123456789abcdef".split(""),
- a = [128, 32768, 8388608, -2147483648],
- l = [0, 8, 16, 24],
- c = [];
- if (s) {
- var u = new ArrayBuffer(68);
- o = new Uint8Array(u), c = new Uint32Array(u)
- }
- var p = function(e) {
- var t = "string" != typeof e;
- t && e.constructor == ArrayBuffer && (e = new Uint8Array(e));
- var i, u, p, d, _, h, f, m, g, v, $, y, b = !0,
- w = !1,
- k = 0,
- x = 0,
- S = 0,
- C = e.length;
- c[16] = 0;
- do {
- if (c[0] = c[16], c[16] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] = c[10] = c[11] = c[12] = c[13] = c[14] = c[15] = 0, t)
- if (s)
- for (y = x; C > k && 64 > y; ++k) o[y++] = e[k];
- else
- for (y = x; C > k && 64 > y; ++k) c[y >> 2] |= e[k] << l[3 & y++];
- else if (s)
- for (y = x; C > k && 64 > y; ++k) $ = e.charCodeAt(k), 128 > $ ? o[y++] = $ : 2048 > $ ? (o[y++] = 192 | $ >> 6, o[y++] = 128 | 63 & $) : 55296 > $ || $ >= 57344 ? (o[y++] = 224 | $ >> 12, o[y++] = 128 | $ >> 6 & 63, o[y++] = 128 | 63 & $) : ($ = 65536 + ((1023 & $) << 10 | 1023 & e.charCodeAt(++k)), o[y++] = 240 | $ >> 18, o[y++] = 128 | $ >> 12 & 63, o[y++] = 128 | $ >> 6 & 63, o[y++] = 128 | 63 & $);
- else
- for (y = x; C > k && 64 > y; ++k) $ = e.charCodeAt(k), 128 > $ ? c[y >> 2] |= $ << l[3 & y++] : 2048 > $ ? (c[y >> 2] |= (192 | $ >> 6) << l[3 & y++], c[y >> 2] |= (128 | 63 & $) << l[3 & y++]) : 55296 > $ || $ >= 57344 ? (c[y >> 2] |= (224 | $ >> 12) << l[3 & y++], c[y >> 2] |= (128 | $ >> 6 & 63) << l[3 & y++], c[y >> 2] |= (128 | 63 & $) << l[3 & y++]) : ($ = 65536 + ((1023 & $) << 10 | 1023 & e.charCodeAt(++k)), c[y >> 2] |= (240 | $ >> 18) << l[3 & y++], c[y >> 2] |= (128 | $ >> 12 & 63) << l[3 & y++], c[y >> 2] |= (128 | $ >> 6 & 63) << l[3 & y++], c[y >> 2] |= (128 | 63 & $) << l[3 & y++]);
- S += y - x, x = y - 64, k == C && (c[y >> 2] |= a[3 & y], ++k), k > C && 56 > y && (c[14] = S << 3, w = !0), b ? (_ = c[0] - 680876937, _ = (_ << 7 | _ >>> 25) - 271733879 << 0, m = (-1732584194 ^ 2004318071 & _) + c[1] - 117830708, m = (m << 12 | m >>> 20) + _ << 0, f = (-271733879 ^ m & (-271733879 ^ _)) + c[2] - 1126478375, f = (f << 17 | f >>> 15) + m << 0, h = (_ ^ f & (m ^ _)) + c[3] - 1316259209, h = (h << 22 | h >>> 10) + f << 0) : (_ = i, h = u, f = p, m = d, _ += (m ^ h & (f ^ m)) + c[0] - 680876936, _ = (_ << 7 | _ >>> 25) + h << 0, m += (f ^ _ & (h ^ f)) + c[1] - 389564586, m = (m << 12 | m >>> 20) + _ << 0, f += (h ^ m & (_ ^ h)) + c[2] + 606105819, f = (f << 17 | f >>> 15) + m << 0, h += (_ ^ f & (m ^ _)) + c[3] - 1044525330, h = (h << 22 | h >>> 10) + f << 0), _ += (m ^ h & (f ^ m)) + c[4] - 176418897, _ = (_ << 7 | _ >>> 25) + h << 0, m += (f ^ _ & (h ^ f)) + c[5] + 1200080426, m = (m << 12 | m >>> 20) + _ << 0, f += (h ^ m & (_ ^ h)) + c[6] - 1473231341, f = (f << 17 | f >>> 15) + m << 0, h += (_ ^ f & (m ^ _)) + c[7] - 45705983, h = (h << 22 | h >>> 10) + f << 0, _ += (m ^ h & (f ^ m)) + c[8] + 1770035416, _ = (_ << 7 | _ >>> 25) + h << 0, m += (f ^ _ & (h ^ f)) + c[9] - 1958414417, m = (m << 12 | m >>> 20) + _ << 0, f += (h ^ m & (_ ^ h)) + c[10] - 42063, f = (f << 17 | f >>> 15) + m << 0, h += (_ ^ f & (m ^ _)) + c[11] - 1990404162, h = (h << 22 | h >>> 10) + f << 0, _ += (m ^ h & (f ^ m)) + c[12] + 1804603682, _ = (_ << 7 | _ >>> 25) + h << 0, m += (f ^ _ & (h ^ f)) + c[13] - 40341101, m = (m << 12 | m >>> 20) + _ << 0, f += (h ^ m & (_ ^ h)) + c[14] - 1502002290, f = (f << 17 | f >>> 15) + m << 0, h += (_ ^ f & (m ^ _)) + c[15] + 1236535329, h = (h << 22 | h >>> 10) + f << 0, _ += (f ^ m & (h ^ f)) + c[1] - 165796510, _ = (_ << 5 | _ >>> 27) + h << 0, m += (h ^ f & (_ ^ h)) + c[6] - 1069501632, m = (m << 9 | m >>> 23) + _ << 0, f += (_ ^ h & (m ^ _)) + c[11] + 643717713, f = (f << 14 | f >>> 18) + m << 0, h += (m ^ _ & (f ^ m)) + c[0] - 373897302, h = (h << 20 | h >>> 12) + f << 0, _ += (f ^ m & (h ^ f)) + c[5] - 701558691, _ = (_ << 5 | _ >>> 27) + h << 0, m += (h ^ f & (_ ^ h)) + c[10] + 38016083, m = (m << 9 | m >>> 23) + _ << 0, f += (_ ^ h & (m ^ _)) + c[15] - 660478335, f = (f << 14 | f >>> 18) + m << 0, h += (m ^ _ & (f ^ m)) + c[4] - 405537848, h = (h << 20 | h >>> 12) + f << 0, _ += (f ^ m & (h ^ f)) + c[9] + 568446438, _ = (_ << 5 | _ >>> 27) + h << 0, m += (h ^ f & (_ ^ h)) + c[14] - 1019803690, m = (m << 9 | m >>> 23) + _ << 0, f += (_ ^ h & (m ^ _)) + c[3] - 187363961, f = (f << 14 | f >>> 18) + m << 0, h += (m ^ _ & (f ^ m)) + c[8] + 1163531501, h = (h << 20 | h >>> 12) + f << 0, _ += (f ^ m & (h ^ f)) + c[13] - 1444681467, _ = (_ << 5 | _ >>> 27) + h << 0, m += (h ^ f & (_ ^ h)) + c[2] - 51403784, m = (m << 9 | m >>> 23) + _ << 0, f += (_ ^ h & (m ^ _)) + c[7] + 1735328473, f = (f << 14 | f >>> 18) + m << 0, h += (m ^ _ & (f ^ m)) + c[12] - 1926607734, h = (h << 20 | h >>> 12) + f << 0, g = h ^ f, _ += (g ^ m) + c[5] - 378558, _ = (_ << 4 | _ >>> 28) + h << 0, m += (g ^ _) + c[8] - 2022574463, m = (m << 11 | m >>> 21) + _ << 0, v = m ^ _, f += (v ^ h) + c[11] + 1839030562, f = (f << 16 | f >>> 16) + m << 0, h += (v ^ f) + c[14] - 35309556, h = (h << 23 | h >>> 9) + f << 0, g = h ^ f, _ += (g ^ m) + c[1] - 1530992060, _ = (_ << 4 | _ >>> 28) + h << 0, m += (g ^ _) + c[4] + 1272893353, m = (m << 11 | m >>> 21) + _ << 0, v = m ^ _, f += (v ^ h) + c[7] - 155497632, f = (f << 16 | f >>> 16) + m << 0, h += (v ^ f) + c[10] - 1094730640, h = (h << 23 | h >>> 9) + f << 0, g = h ^ f, _ += (g ^ m) + c[13] + 681279174, _ = (_ << 4 | _ >>> 28) + h << 0, m += (g ^ _) + c[0] - 358537222, m = (m << 11 | m >>> 21) + _ << 0, v = m ^ _, f += (v ^ h) + c[3] - 722521979, f = (f << 16 | f >>> 16) + m << 0, h += (v ^ f) + c[6] + 76029189, h = (h << 23 | h >>> 9) + f << 0, g = h ^ f, _ += (g ^ m) + c[9] - 640364487, _ = (_ << 4 | _ >>> 28) + h << 0, m += (g ^ _) + c[12] - 421815835, m = (m << 11 | m >>> 21) + _ << 0, v = m ^ _, f += (v ^ h) + c[15] + 530742520, f = (f << 16 | f >>> 16) + m << 0, h += (v ^ f) + c[2] - 995338651, h = (h << 23 | h >>> 9) + f << 0, _ += (f ^ (h | ~m)) + c[0] - 198630844, _ = (_ << 6 | _ >>> 26) + h << 0, m += (h ^ (_ | ~f)) + c[7] + 1126891415, m = (m << 10 | m >>> 22) + _ << 0, f += (_ ^ (m | ~h)) + c[14] - 1416354905, f = (f << 15 | f >>> 17) + m << 0, h += (m ^ (f | ~_)) + c[5] - 57434055, h = (h << 21 | h >>> 11) + f << 0, _ += (f ^ (h | ~m)) + c[12] + 1700485571, _ = (_ << 6 | _ >>> 26) + h << 0, m += (h ^ (_ | ~f)) + c[3] - 1894986606, m = (m << 10 | m >>> 22) + _ << 0, f += (_ ^ (m | ~h)) + c[10] - 1051523, f = (f << 15 | f >>> 17) + m << 0, h += (m ^ (f | ~_)) + c[1] - 2054922799, h = (h << 21 | h >>> 11) + f << 0, _ += (f ^ (h | ~m)) + c[8] + 1873313359, _ = (_ << 6 | _ >>> 26) + h << 0, m += (h ^ (_ | ~f)) + c[15] - 30611744, m = (m << 10 | m >>> 22) + _ << 0, f += (_ ^ (m | ~h)) + c[6] - 1560198380, f = (f << 15 | f >>> 17) + m << 0, h += (m ^ (f | ~_)) + c[13] + 1309151649, h = (h << 21 | h >>> 11) + f << 0, _ += (f ^ (h | ~m)) + c[4] - 145523070, _ = (_ << 6 | _ >>> 26) + h << 0, m += (h ^ (_ | ~f)) + c[11] - 1120210379, m = (m << 10 | m >>> 22) + _ << 0, f += (_ ^ (m | ~h)) + c[2] + 718787259, f = (f << 15 | f >>> 17) + m << 0, h += (m ^ (f | ~_)) + c[9] - 343485551, h = (h << 21 | h >>> 11) + f << 0, b ? (i = _ + 1732584193 << 0, u = h - 271733879 << 0, p = f - 1732584194 << 0, d = m + 271733878 << 0, b = !1) : (i = i + _ << 0, u = u + h << 0, p = p + f << 0, d = d + m << 0)
- } while (!w);
- if (n) {
- var T = r[i >> 4 & 15] + r[15 & i];
- return T += r[i >> 12 & 15] + r[i >> 8 & 15], T += r[i >> 20 & 15] + r[i >> 16 & 15], T += r[i >> 28 & 15] + r[i >> 24 & 15], T += r[u >> 4 & 15] + r[15 & u], T += r[u >> 12 & 15] + r[u >> 8 & 15], T += r[u >> 20 & 15] + r[u >> 16 & 15], T += r[u >> 28 & 15] + r[u >> 24 & 15], T += r[p >> 4 & 15] + r[15 & p], T += r[p >> 12 & 15] + r[p >> 8 & 15], T += r[p >> 20 & 15] + r[p >> 16 & 15], T += r[p >> 28 & 15] + r[p >> 24 & 15], T += r[d >> 4 & 15] + r[15 & d], T += r[d >> 12 & 15] + r[d >> 8 & 15], T += r[d >> 20 & 15] + r[d >> 16 & 15], T += r[d >> 28 & 15] + r[d >> 24 & 15]
- }
- return r[i >> 4 & 15] + r[15 & i] + r[i >> 12 & 15] + r[i >> 8 & 15] + r[i >> 20 & 15] + r[i >> 16 & 15] + r[i >> 28 & 15] + r[i >> 24 & 15] + r[u >> 4 & 15] + r[15 & u] + r[u >> 12 & 15] + r[u >> 8 & 15] + r[u >> 20 & 15] + r[u >> 16 & 15] + r[u >> 28 & 15] + r[u >> 24 & 15] + r[p >> 4 & 15] + r[15 & p] + r[p >> 12 & 15] + r[p >> 8 & 15] + r[p >> 20 & 15] + r[p >> 16 & 15] + r[p >> 28 & 15] + r[p >> 24 & 15] + r[d >> 4 & 15] + r[15 & d] + r[d >> 12 & 15] + r[d >> 8 & 15] + r[d >> 20 & 15] + r[d >> 16 & 15] + r[d >> 28 & 15] + r[d >> 24 & 15]
- };
- if (!e.JS_MD5_TEST && i) {
- var d = require("crypto"),
- _ = require("buffer").Buffer;
- module.exports = function(e) {
- return "string" == typeof e ? e.length <= 80 ? p(e) : e.length <= 183 && !/[^\x00-\x7F]/.test(e) ? p(e) : d.createHash("md5").update(e, "utf8").digest("hex") : (e.constructor == ArrayBuffer && (e = new Uint8Array(e)), e.length <= 370 ? p(e) : d.createHash("md5").update(new _(e)).digest("hex"))
- }
- } else e && (e.md5 = p)
- }(this),
- function(e, t) {
- "function" == typeof define && define.amd ? define("pass-meter", t) : "object" == typeof module && module.exports ? module.exports = t() : e.PassMeter = t()
- }("undefined" != typeof window ? window : this, function() {
- "use strict";
- var e, t = {
- events: "keyup",
- afterTest: null,
- commonPasswords: ["password", "123456", "12345678", "1234", "qwerty"]
- };
- e = "function" != typeof jQuery ? function() {
- for (var e, t, i, o, n = arguments[0] || {}, s = 1, r = arguments.length; r > s; s++)
- if (null !== (e = arguments[s]))
- for (t in e) o = n[t], i = e[t], n !== i && void 0 !== i && (n[t] = i);
- return n
- } : jQuery.extend;
- var i = function(i) {
- "undefined" == typeof i ? i = {} : "function" == typeof i && (i = {
- afterTest: i
- }), this.options = e({}, t, i)
- };
- return i.prototype = {
- constructor: i,
- checks: [{
- score: 35,
- callback: function(e) {
- return e.length >= 8
- }
- }, {
- score: 20,
- regex: new RegExp("[A-Z]")
- }, {
- score: 10,
- regex: new RegExp("[a-z]")
- }, {
- score: 10,
- regex: new RegExp("[0-9]")
- }, {
- score: 25,
- regex: new RegExp("\\W")
- }, {
- score: -100,
- callback: function(e) {
- return -1 !== this.options.commonPasswords.indexOf(String(e).toLowerCase()) ? !0 : !1
- }
- }],
- test: function(e) {
- var t = this,
- i = 0;
- return this.checks.forEach(function(o) {
- o.hasOwnProperty("regex") ? e.match(o.regex) && (i += o.score) : o.hasOwnProperty("callback") && o.callback.call(t, e) && (i += o.score)
- }), 0 > i && (i = 0), i > 100 && (i = 100), "function" == typeof this.options.afterTest && this.options.afterTest(i, e), i
- }
- }, "function" == typeof jQuery && jQuery.fn && (jQuery.fn.passMeter = function(e) {
- return this.each(function() {
- var t = jQuery(this);
- if (!t.data("pass-meter")) {
- var o = new i(e);
- t.on(o.options.events, function() {
- o.test(this.value)
- }), t.data("pass-meter", o)
- }
- })
- }), i
- }),
- function(e) {
- e.redirect = function(t, o, n) {
- if (n = n && "GET" == n.toUpperCase() ? "GET" : "POST", !o) {
- var s = e.parse_url(t);
- t = s.url, o = s.params
- }
- var r = e("<form>").attr({
- method: n,
- action: t
- });
- i(o, [], r), e("body").append(r), r.submit()
- }, e.parse_url = function(e) {
- if (-1 == e.indexOf("?")) return {
- url: e,
- params: {}
- };
- var t = e.split("?"),
- e = t[0],
- i = t[1],
- o = i.split("&"),
- n = {};
- for (var s in o) {
- var r = o[s].split("=");
- n[r[0]] = r[1]
- }
- return {
- url: e,
- params: n
- }
- };
- var t = function(t, i, o) {
- var n;
- if (o.length > 0) {
- n = o[0];
- for (var s = 1; s < o.length; ++s) n += "[" + o[s] + "]";
- t = n + "[" + t + "]"
- }
- return e("<input>").attr({
- type: "hidden",
- name: t,
- value: i
- })
- },
- i = function(e, o, n) {
- var s = [];
- for (var r in e) "object" == typeof e[r] ? (s = o.slice(), s.push(r), i(e[r], s, n)) : t(r, e[r], o).appendTo(n)
- }
- }(jQuery), ! function(e) {
- "function" == typeof define && define.amd ? define(["jquery"], e) : e(jQuery)
- }(function(e, t) {
- "use strict";
- function i(e, t) {
- this.container = e, this.options = t, this.init()
- }
- function o(t, i) {
- this.widget = t, this.options = e.extend({}, i), this.detectService(), this.service && this.init()
- }
- function n(e) {
- function t(e, t) {
- return t.toUpper()
- }
- var i = {},
- o = e.data();
- for (var n in o) {
- var s = o[n];
- "yes" === s ? s = !0 : "no" === s && (s = !1), i[n.replace(/-(\w)/g, t)] = s
- }
- return i
- }
- function s(e, t) {
- return r(e, t, encodeURIComponent)
- }
- function r(e, t, i) {
- return e.replace(/\{([^\}]+)\}/g, function(e, o) {
- return o in t ? i ? i(t[o]) : t[o] : e
- })
- }
- function a(e, t) {
- var i = p + e;
- return i + " " + i + "_" + t
- }
- function l(t, i) {
- function o(r) {
- "keydown" === r.type && 27 !== r.which || e(r.target).closest(t).length || (t.removeClass(d), n.off(s, o), e.isFunction(i) && i())
- }
- var n = e(document),
- s = "click touchstart keydown";
- n.on(s, o)
- }
- function c(e) {
- var t = 10;
- if (document.documentElement.getBoundingClientRect) {
- var i = parseInt(e.css("left"), 10),
- o = parseInt(e.css("top"), 10),
- n = e[0].getBoundingClientRect();
- n.left < t ? e.css("left", t - n.left + i) : n.right > window.innerWidth - t && e.css("left", window.innerWidth - n.right - t + i), n.top < t ? e.css("top", t - n.top + o) : n.bottom > window.innerHeight - t && e.css("top", window.innerHeight - n.bottom - t + o)
- }
- e.addClass(d)
- }
- var u = "social-likes",
- p = u + "__",
- d = u + "_opened",
- _ = "https:" === location.protocol ? "https:" : "http:",
- h = "https:" === _,
- f = {
- facebook: {
- counterUrl: "https://graph.facebook.com/fql?q=SELECT+total_count+FROM+link_stat+WHERE+url%3D%22{url}%22&callback=?",
- convertNumber: function(e) {
- return e.data[0].total_count
- },
- popupUrl: "https://www.facebook.com/sharer/sharer.php?u={url}",
- popupWidth: 600,
- popupHeight: 500
- },
- twitter: {
- counterUrl: "https://cdn.api.twitter.com/1/urls/count.json?url={url}&callback=?",
- convertNumber: function(e) {
- return e.count
- },
- popupUrl: "https://twitter.com/intent/tweet?url={url}&text={title}",
- popupWidth: 600,
- popupHeight: 450,
- click: function() {
- return /[\.\?:\-–—]\s*$/.test(this.options.title) || (this.options.title += ":"), !0
- }
- },
- mailru: {
- counterUrl: _ + "//connect.mail.ru/share_count?url_list={url}&callback=1&func=?",
- convertNumber: function(e) {
- for (var t in e)
- if (e.hasOwnProperty(t)) return e[t].shares
- },
- popupUrl: _ + "//connect.mail.ru/share?share_url={url}&title={title}",
- popupWidth: 550,
- popupHeight: 360
- },
- vkontakte: {
- counterUrl: "https://vk.com/share.php?act=count&url={url}&index={index}",
- counter: function(t, i) {
- var o = f.vkontakte;
- o._ || (o._ = [], window.VK || (window.VK = {}), window.VK.Share = {
- count: function(e, t) {
- o._[e].resolve(t)
- }
- });
- var n = o._.length;
- o._.push(i), e.getScript(s(t, {
- index: n
- })).fail(i.reject)
- },
- popupUrl: _ + "//vk.com/share.php?url={url}&title={title}",
- popupWidth: 550,
- popupHeight: 330
- },
- odnoklassniki: {
- counterUrl: h ? t : "http://connect.ok.ru/dk?st.cmd=extLike&ref={url}&uid={index}",
- counter: function(t, i) {
- var o = f.odnoklassniki;
- o._ || (o._ = [], window.ODKL || (window.ODKL = {}), window.ODKL.updateCount = function(e, t) {
- o._[e].resolve(t)
- });
- var n = o._.length;
- o._.push(i), e.getScript(s(t, {
- index: n
- })).fail(i.reject)
- },
- popupUrl: "http://connect.ok.ru/dk?st.cmd=WidgetSharePreview&service=odnoklassniki&st.shareUrl={url}",
- popupWidth: 550,
- popupHeight: 360
- },
- plusone: {
- counterUrl: h ? t : "http://share.yandex.ru/gpp.xml?url={url}",
- counter: function(t, i) {
- var o = f.plusone;
- return o._ ? void i.reject() : (window.services || (window.services = {}), window.services.gplus = {
- cb: function(e) {
- "string" == typeof e && (e = e.replace(/\D/g, "")), o._.resolve(parseInt(e, 10))
- }
- }, o._ = i, void e.getScript(s(t)).fail(i.reject))
- },
- popupUrl: "https://plus.google.com/share?url={url}",
- popupWidth: 700,
- popupHeight: 500
- },
- pinterest: {
- counterUrl: _ + "//api.pinterest.com/v1/urls/count.json?url={url}&callback=?",
- convertNumber: function(e) {
- return e.count
- },
- popupUrl: _ + "//pinterest.com/pin/create/button/?url={url}&description={title}",
- popupWidth: 630,
- popupHeight: 270
- }
- },
- m = {
- promises: {},
- fetch: function(t, i, o) {
- m.promises[t] || (m.promises[t] = {});
- var n = m.promises[t];
- if (!o.forceUpdate && n[i]) return n[i];
- var r = e.extend({}, f[t], o),
- a = e.Deferred(),
- l = r.counterUrl && s(r.counterUrl, {
- url: i
- });
- return l && e.isFunction(r.counter) ? r.counter(l, a) : r.counterUrl ? e.getJSON(l).done(function(t) {
- try {
- var i = t;
- e.isFunction(r.convertNumber) && (i = r.convertNumber(t)), a.resolve(i)
- } catch (o) {
- a.reject()
- }
- }).fail(a.reject) : a.reject(), n[i] = a.promise(), n[i]
- }
- };
- e.fn.socialLikes = function(t) {
- return this.each(function() {
- var o = e(this),
- s = o.data(u);
- s ? e.isPlainObject(t) && s.update(t) : (s = new i(o, e.extend({}, e.fn.socialLikes.defaults, t, n(o))), o.data(u, s))
- })
- }, e.fn.socialLikes.defaults = {
- url: window.location.href.replace(window.location.hash, ""),
- title: document.title,
- counters: !0,
- zeroes: !1,
- wait: 500,
- timeout: 1e4,
- popupCheckInterval: 500,
- singleTitle: "Share"
- }, i.prototype = {
- init: function() {
- this.container.addClass(u), this.single = this.container.hasClass(u + "_single"), this.initUserButtons(), this.countersLeft = 0, this.number = 0, this.container.on("counter." + u, e.proxy(this.updateCounter, this));
- var t = this.container.children();
- this.makeSingleButton(), this.buttons = [], t.each(e.proxy(function(t, i) {
- var n = new o(e(i), this.options);
- this.buttons.push(n), n.options.counterUrl && this.countersLeft++
- }, this)), this.options.counters ? (this.timer = setTimeout(e.proxy(this.appear, this), this.options.wait), this.timeout = setTimeout(e.proxy(this.ready, this, !0), this.options.timeout)) : this.appear()
- },
- initUserButtons: function() {
- !this.userButtonInited && window.socialLikesButtons && e.extend(!0, f, socialLikesButtons), this.userButtonInited = !0
- },
- makeSingleButton: function() {
- if (this.single) {
- var t = this.container;
- t.addClass(u + "_vertical"), t.wrap(e("<div>", {
- "class": u + "_single-w"
- })), t.wrapInner(e("<div>", {
- "class": u + "__single-container"
- }));
- var i = t.parent(),
- o = e("<div>", {
- "class": a("widget", "single")
- }),
- n = e(r('<div class="{buttonCls}"><span class="{iconCls}"></span>{title}</div>', {
- buttonCls: a("button", "single"),
- iconCls: a("icon", "single"),
- title: this.options.singleTitle
- }));
- o.append(n), i.append(o), o.on("click", function() {
- var e = u + "__widget_active";
- return o.toggleClass(e), o.hasClass(e) ? (t.css({
- left: -(t.width() - o.width()) / 2,
- top: -t.height()
- }), c(t), l(t, function() {
- o.removeClass(e)
- })) : t.removeClass(d), !1
- }), this.widget = o
- }
- },
- update: function(t) {
- if (t.forceUpdate || t.url !== this.options.url) {
- this.number = 0, this.countersLeft = this.buttons.length, this.widget && this.widget.find("." + u + "__counter").remove(), e.extend(this.options, t);
- for (var i = 0; i < this.buttons.length; i++) this.buttons[i].update(t)
- }
- },
- updateCounter: function(e, t, i) {
- i && (this.number += i, this.single && this.getCounterElem().text(this.number)), this.countersLeft--, 0 === this.countersLeft && (this.appear(), this.ready())
- },
- appear: function() {
- this.container.addClass(u + "_visible")
- },
- ready: function(e) {
- this.timeout && clearTimeout(this.timeout), this.container.addClass(u + "_ready"), e || this.container.trigger("ready." + u, this.number)
- },
- getCounterElem: function() {
- var t = this.widget.find("." + p + "counter_single");
- return t.length || (t = e("<span>", {
- "class": a("counter", "single")
- }), this.widget.append(t)), t
- }
- }, o.prototype = {
- init: function() {
- this.detectParams(), this.initHtml(), setTimeout(e.proxy(this.initCounter, this), 0)
- },
- update: function(t) {
- e.extend(this.options, {
- forceUpdate: !1
- }, t), this.widget.find("." + u + "__counter").remove(), this.initCounter()
- },
- detectService: function() {
- var t = this.widget.data("service");
- if (!t) {
- for (var i = this.widget[0], o = i.classList || i.className.split(" "), n = 0; n < o.length; n++) {
- var s = o[n];
- if (f[s]) {
- t = s;
- break
- }
- }
- if (!t) return
- }
- this.service = t, e.extend(this.options, f[t])
- },
- detectParams: function() {
- var e = this.widget.data();
- if (e.counter) {
- var t = parseInt(e.counter, 10);
- isNaN(t) ? this.options.counterUrl = e.counter : this.options.counterNumber = t
- }
- e.title && (this.options.title = e.title), e.url && (this.options.url = e.url)
- },
- initHtml: function() {
- var t = this.options,
- i = this.widget,
- o = i.find("a");
- o.length && this.cloneDataAttrs(o, i);
- var n = e("<span>", {
- "class": this.getElementClassNames("button"),
- text: i.text()
- });
- if (t.clickUrl) {
- var r = s(t.clickUrl, {
- url: t.url,
- title: t.title
- }),
- a = e("<a>", {
- href: r
- });
- this.cloneDataAttrs(i, a), i.replaceWith(a), this.widget = i = a
- } else i.on("click", e.proxy(this.click, this));
- i.removeClass(this.service), i.addClass(this.getElementClassNames("widget")), n.prepend(e("<span>", {
- "class": this.getElementClassNames("icon")
- })), i.empty().append(n), this.button = n
- },
- initCounter: function() {
- if (this.options.counters)
- if (this.options.counterNumber) this.updateCounter(this.options.counterNumber);
- else {
- var t = {
- counterUrl: this.options.counterUrl,
- forceUpdate: this.options.forceUpdate
- };
- m.fetch(this.service, this.options.url, t).always(e.proxy(this.updateCounter, this))
- }
- },
- cloneDataAttrs: function(e, t) {
- var i = e.data();
- for (var o in i) i.hasOwnProperty(o) && t.data(o, i[o])
- },
- getElementClassNames: function(e) {
- return a(e, this.service)
- },
- updateCounter: function(t) {
- t = parseInt(t, 10) || 0;
- var i = {
- "class": this.getElementClassNames("counter"),
- text: t
- };
- t || this.options.zeroes || (i["class"] += " " + u + "__counter_empty", i.text = "");
- var o = e("<span>", i);
- this.widget.append(o), this.widget.trigger("counter." + u, [this.service, t])
- },
- click: function(t) {
- var i = this.options,
- o = !0;
- if (e.isFunction(i.click) && (o = i.click.call(this, t)), o) {
- var n = s(i.popupUrl, {
- url: i.url,
- title: i.title
- });
- n = this.addAdditionalParamsToUrl(n), this.openPopup(n, {
- width: i.popupWidth,
- height: i.popupHeight
- })
- }
- return !1
- },
- addAdditionalParamsToUrl: function(t) {
- var i = e.param(e.extend(this.widget.data(), this.options.data));
- if (e.isEmptyObject(i)) return t;
- var o = -1 === t.indexOf("?") ? "?" : "&";
- return t + o + i
- },
- openPopup: function(t, i) {
- var o = Math.round(screen.width / 2 - i.width / 2),
- n = 0;
- screen.height > i.height && (n = Math.round(screen.height / 3 - i.height / 2));
- var s = window.open(t, "sl_" + this.service, "left=" + o + ",top=" + n + ",width=" + i.width + ",height=" + i.height + ",personalbar=0,toolbar=0,scrollbars=1,resizable=1");
- if (s) {
- s.focus(), this.widget.trigger("popup_opened." + u, [this.service, s]);
- var r = setInterval(e.proxy(function() {
- s.closed && (clearInterval(r), this.widget.trigger("popup_closed." + u, this.service))
- }, this), this.options.popupCheckInterval)
- } else location.href = t
- }
- }, e(function() {
- e("." + u).socialLikes()
- })
- }),
- function e(t, i, o) {
- function n(r, a) {
- if (!i[r]) {
- if (!t[r]) {
- var l = "function" == typeof require && require;
- if (!a && l) return l(r, !0);
- if (s) return s(r, !0);
- var c = new Error("Cannot find module '" + r + "'");
- throw c.code = "MODULE_NOT_FOUND", c
- }
- var u = i[r] = {
- exports: {}
- };
- t[r][0].call(u.exports, function(e) {
- var i = t[r][1][e];
- return n(i ? i : e)
- }, u, u.exports, e, t, i, o)
- }
- return i[r].exports
- }
- for (var s = "function" == typeof require && require, r = 0; r < o.length; r++) n(o[r]);
- return n
- }({
- 1: [function(e, t, i) {
- "use strict";
- var o = {
- rules: {}
- };
- o.rules.common = e("./LIVR/Rules/Common"), o.rules.string = e("./LIVR/Rules/String"), o.rules.numeric = e("./LIVR/Rules/Numeric"), o.rules.special = e("./LIVR/Rules/Special"), o.rules.helper = e("./LIVR/Rules/Helper"), o.rules.filters = e("./LIVR/Rules/Filters"), o.Validator = e("./LIVR/Validator"), o.Validator.registerDefaultRules({
- required: o.rules.common.required,
- not_empty: o.rules.common.not_empty,
- not_empty_list: o.rules.common.not_empty_list,
- one_of: o.rules.string.one_of,
- max_length: o.rules.string.max_length,
- min_length: o.rules.string.min_length,
- length_equal: o.rules.string.length_equal,
- length_between: o.rules.string.length_between,
- like: o.rules.string.like,
- integer: o.rules.numeric.integer,
- positive_integer: o.rules.numeric.positive_integer,
- decimal: o.rules.numeric.decimal,
- positive_decimal: o.rules.numeric.positive_decimal,
- max_number: o.rules.numeric.max_number,
- min_number: o.rules.numeric.min_number,
- number_between: o.rules.numeric.number_between,
- email: o.rules.special.email,
- equal_to_field: o.rules.special.equal_to_field,
- url: o.rules.special.url,
- iso_date: o.rules.special.iso_date,
- nested_object: o.rules.helper.nested_object,
- list_of: o.rules.helper.list_of,
- list_of_objects: o.rules.helper.list_of_objects,
- list_of_different_objects: o.rules.helper.list_of_different_objects,
- trim: o.rules.filters.trim,
- to_lc: o.rules.filters.to_lc,
- to_uc: o.rules.filters.to_uc,
- remove: o.rules.filters.remove,
- leave_only: o.rules.filters.leave_only
- }), t.exports = o
- }, {
- "./LIVR/Rules/Common": 2,
- "./LIVR/Rules/Filters": 3,
- "./LIVR/Rules/Helper": 4,
- "./LIVR/Rules/Numeric": 5,
- "./LIVR/Rules/Special": 6,
- "./LIVR/Rules/String": 7,
- "./LIVR/Validator": 8
- }],
- 2: [function(e, t, i) {
- "use strict";
- var o = e("../util");
- t.exports = {
- required: function() {
- return function(e) {
- return o.isNoValue(e) ? "REQUIRED" : void 0
- }
- },
- not_empty: function() {
- return function(e) {
- return null !== e && void 0 !== e && "" === e ? "CANNOT_BE_EMPTY" : void 0
- }
- },
- not_empty_list: function() {
- return function(e) {
- return void 0 === e || "" === e ? "CANNOT_BE_EMPTY" : Array.isArray(e) ? e.length < 1 ? "CANNOT_BE_EMPTY" : void 0 : "WRONG_FORMAT"
- }
- }
- }
- }, {
- "../util": 9
- }],
- 3: [function(e, t, i) {
- "use strict";
- var o = e("../util");
- t.exports = {
- trim: function() {
- return function(e, t, i) {
- o.isNoValue(e) || "object" == typeof e || (e += "", i.push(e.replace(/^\s*/, "").replace(/\s*$/, "")))
- }
- },
- to_lc: function() {
- return function(e, t, i) {
- o.isNoValue(e) || "object" == typeof e || (e += "", i.push(e.toLowerCase()))
- }
- },
- to_uc: function() {
- return function(e, t, i) {
- o.isNoValue(e) || "object" == typeof e || (e += "", i.push(e.toUpperCase()))
- }
- },
- remove: function(e) {
- e = o.escapeRegExp(e);
- var t = new RegExp("[" + e + "]", "g");
- return function(e, i, n) {
- o.isNoValue(e) || "object" == typeof e || (e += "", n.push(e.replace(t, "")))
- }
- },
- leave_only: function(e) {
- e = o.escapeRegExp(e);
- var t = new RegExp("[^" + e + "]", "g");
- return function(e, i, n) {
- o.isNoValue(e) || "object" == typeof e || (e += "", n.push(e.replace(t, "")))
- }
- }
- }
- }, {
- "../util": 9
- }],
- 4: [function(e, t, i) {
- "use strict";
- var o = e("../Validator"),
- n = e("../util");
- t.exports = {
- nested_object: function(e, t) {
- var i = new o(e).registerRules(t).prepare();
- return function(e, t, o) {
- if (!n.isNoValue(e)) {
- if ("object" != typeof e) return "FORMAT_ERROR";
- var s = i.validate(e);
- return s ? void o.push(s) : i.getErrors()
- }
- }
- },
- list_of: function(e, t) {
- Array.isArray(e) || (e = Array.prototype.slice.call(arguments), t = e.pop());
- var i = {
- field: e
- },
- s = new o(i).registerRules(t).prepare();
- return function(e, t, i) {
- if (!n.isNoValue(e)) {
- if (!Array.isArray(e)) return "FORMAT_ERROR";
- for (var o = [], r = [], a = !1, l = 0; l < e.length; l++) {
- var c = s.validate({
- field: e[l]
- });
- c ? (o.push(c.field), r.push(null)) : (a = !0, r.push(s.getErrors().field), o.push(null))
- }
- return a ? r : void i.push(o)
- }
- }
- },
- list_of_objects: function(e, t) {
- var i = new o(e).registerRules(t).prepare();
- return function(e, t, o) {
- if (!n.isNoValue(e)) {
- if (!Array.isArray(e)) return "FORMAT_ERROR";
- for (var s = [], r = [], a = !1, l = 0; l < e.length; l++) {
- var c = i.validate(e[l]);
- c ? (s.push(c), r.push(null)) : (a = !0, r.push(i.getErrors()), s.push(null))
- }
- return a ? r : void o.push(s)
- }
- }
- },
- list_of_different_objects: function(e, t, i) {
- var s = {};
- for (var r in t) {
- var a = new o(t[r]).registerRules(i).prepare();
- s[r] = a
- }
- return function(t, i, o) {
- if (!n.isNoValue(t)) {
- if (!Array.isArray(t)) return "FORMAT_ERROR";
- for (var r = [], a = [], l = !1, c = 0; c < t.length; c++) {
- var u = t[c];
- if ("object" == typeof u && u[e] && s[u[e]]) {
- var p = s[u[e]],
- d = p.validate(u);
- d ? (r.push(d), a.push(null)) : (l = !0, a.push(p.getErrors()), r.push(null))
- } else a.push("FORMAT_ERROR")
- }
- return l ? a : void o.push(r)
- }
- }
- }
- }
- }, {
- "../Validator": 8,
- "../util": 9
- }],
- 5: [function(e, t, i) {
- "use strict";
- var o = e("../util");
- t.exports = {
- integer: function() {
- return function(e) {
- return o.isNoValue(e) ? void 0 : o.isNumberOrString(e) ? (e += "", e.match(/^\-?[0-9]+$/) ? void 0 : "NOT_INTEGER") : "FORMAT_ERROR"
- }
- },
- positive_integer: function() {
- return function(e) {
- return o.isNoValue(e) ? void 0 : o.isNumberOrString(e) ? (e += "", /^[1-9][0-9]*$/.test(e) ? void 0 : "NOT_POSITIVE_INTEGER") : "FORMAT_ERROR"
- }
- },
- decimal: function() {
- return function(e) {
- return o.isNoValue(e) ? void 0 : o.isNumberOrString(e) ? (e += "", /^(?:\-?(?:[0-9]+\.[0-9]+)|(?:[0-9]+))$/.test(e) ? void 0 : "NOT_DECIMAL") : "FORMAT_ERROR"
- }
- },
- positive_decimal: function() {
- return function(e) {
- return o.isNoValue(e) ? void 0 : o.isNumberOrString(e) ? (e += "", /^(?:(?:[0-9]*\.[0-9]+)|(?:[1-9][0-9]*))$/.test(e) ? void 0 : "NOT_POSITIVE_DECIMAL") : "FORMAT_ERROR"
- }
- },
- max_number: function(e) {
- return function(t) {
- return o.isNoValue(t) ? void 0 : o.isNumberOrString(t) ? +t > +e ? "TOO_HIGH" : void 0 : "FORMAT_ERROR"
- }
- },
- min_number: function(e) {
- return function(t) {
- return o.isNoValue(t) ? void 0 : o.isNumberOrString(t) ? +e > +t ? "TOO_LOW" : void 0 : "FORMAT_ERROR"
- }
- },
- number_between: function(e, t) {
- return function(i) {
- return o.isNoValue(i) ? void 0 : o.isNumberOrString(i) ? +e > +i ? "TOO_LOW" : +i > +t ? "TOO_HIGH" : void 0 : "FORMAT_ERROR"
- }
- }
- }
- }, {
- "../util": 9
- }],
- 6: [function(e, t, i) {
- "use strict";
- var o = e("../util");
- t.exports = {
- email: function() {
- var e = /^([\w\-_+]+(?:\.[\w\-_+]+)*)@((?:[\w\-]+\.)*\w[\w\-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
- return function(t) {
- return void 0 !== t && null !== t && "" !== t ? o.isNumberOrString(t) ? (t += "", e.test(t) ? /\@.*\@/.test(t) ? "WRONG_EMAIL" : /\@.*_/.test(t) ? "WRONG_EMAIL" : void 0 : "WRONG_EMAIL") : "FORMAT_ERROR" : void 0
- }
- },
- equal_to_field: function(e) {
- return function(t, i) {
- return void 0 !== t && null !== t && "" !== t ? o.isNumberOrString(t) ? t != i[e] ? "FIELDS_NOT_EQUAL" : void 0 : "FORMAT_ERROR" : void 0
- }
- },
- url: function() {
- var e = "^(?:(?:http|https)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
- t = new RegExp(e, "i");
- return function(e) {
- if (void 0 !== e && null !== e && "" !== e) {
- if (!o.isNumberOrString(e)) return "FORMAT_ERROR";
- if (!(e.length < 2083 && t.test(e))) return "WRONG_URL"
- }
- }
- },
- iso_date: function() {
- return function(e) {
- if (void 0 !== e && null !== e && "" !== e) {
- if (!o.isNumberOrString(e)) return "FORMAT_ERROR";
- var t = e.match(/^(\d{4})-([0-1][0-9])-([0-3][0-9])$/);
- if (t) {
- var i = Date.parse(e);
- if (!i && 0 !== i) return "WRONG_DATE";
- var n = new Date(i);
- if (n.setTime(n.getTime() + 60 * n.getTimezoneOffset() * 1e3), n.getFullYear() == t[1] && n.getMonth() + 1 == +t[2] && n.getDate() == +t[3]) return
- }
- return "WRONG_DATE"
- }
- }
- }
- }
- }, {
- "../util": 9
- }],
- 7: [function(e, t, i) {
- "use strict";
- var o = e("../util");
- t.exports = {
- one_of: function(e) {
- return Array.isArray(e) || (e = Array.prototype.slice.call(arguments), e.pop()),
- function(t) {
- if (void 0 !== t && null !== t && "" !== t) {
- if (!o.isNumberOrString(t)) return "FORMAT_ERROR";
- for (var i = 0; i < e.length; i++)
- if (t == e[i]) return;
- return "NOT_ALLOWED_VALUE"
- }
- }
- },
- max_length: function(e) {
- return function(t) {
- return void 0 !== t && null !== t && "" !== t ? o.isNumberOrString(t) ? (t += "", t.length > e ? "TOO_LONG" : void 0) : "FORMAT_ERROR" : void 0
- }
- },
- min_length: function(e) {
- return function(t) {
- return void 0 !== t && null !== t && "" !== t ? o.isNumberOrString(t) ? (t += "", t.length < e ? "TOO_SHORT" : void 0) : "FORMAT_ERROR" : void 0
- }
- },
- length_equal: function(e) {
- return function(t) {
- return void 0 !== t && null !== t && "" !== t ? o.isNumberOrString(t) ? (t += "", t.length < e ? "TOO_SHORT" : t.length > e ? "TOO_LONG" : void 0) : "FORMAT_ERROR" : void 0
- }
- },
- length_between: function(e, t) {
- return function(i) {
- return void 0 !== i && null !== i && "" !== i ? o.isNumberOrString(i) ? (i += "", i.length < e ? "TOO_SHORT" : i.length > t ? "TOO_LONG" : void 0) : "FORMAT_ERROR" : void 0
- }
- },
- like: function(e, t) {
- var i = 3 === arguments.length && t.match("i"),
- n = new RegExp(e, i ? "i" : "");
- return function(e) {
- return void 0 !== e && null !== e && "" !== e ? o.isNumberOrString(e) ? (e += "", e.match(n) ? void 0 : "WRONG_FORMAT") : "FORMAT_ERROR" : void 0
- }
- }
- }
- }, {
- "../util": 9
- }],
- 8: [function(e, t, i) {
- "use strict";
- function o(e, t) {
- this.isPrepared = !1, this.livrRules = e, this.validators = {}, this.validatorBuilders = {}, this.errors = null, this.isAutoTrim = null !== t && void 0 !== t ? t : r, this.registerRules(s)
- }
- var n = e("./util"),
- s = {},
- r = 0;
- o.registerDefaultRules = function(e) {
- for (var t in e) s[t] = e[t]
- }, o.registerAliasedDefaultRule = function(e) {
- if (!e.name) throw "Alias name required";
- s[e.name] = o._buildAliasedRule(e)
- }, o._buildAliasedRule = function(e) {
- if (!e.name) throw "Alias name required";
- if (!e.rules) throw "Alias rules required";
- var t = {
- value: e.rules
- };
- return function(i) {
- var n = new o(t).registerRules(i).prepare();
- return function(t, i, o) {
- var s = n.validate({
- value: t
- });
- return s ? void o.push(s.value) : e.error || n.getErrors().value
- }
- }
- }, o.defaultAutoTrim = function(e) {
- r = !!e
- }, o.prototype = {
- prepare: function() {
- var e = this.livrRules;
- for (var t in e) {
- var i = e[t];
- Array.isArray(i) || (i = [i]);
- for (var o = [], n = 0; n < i.length; n++) {
- var s = this._parseRule(i[n]);
- o.push(this._buildValidator(s.name, s.args))
- }
- this.validators[t] = o
- }
- return this.isPrepared = !0, this
- },
- validate: function(e) {
- if (this.isPrepared || this.prepare(), !n.isObject(e)) return void(this.errors = "FORMAT_ERROR");
- this.isAutoTrim && (e = this._autoTrim(e));
- var t = {},
- i = {};
- for (var o in this.validators) {
- var s = this.validators[o];
- if (s && s.length)
- for (var r = e[o], a = 0; a < s.length; a++) {
- var l = [],
- c = s[a](i.hasOwnProperty(o) ? i[o] : r, e, l);
- if (c) {
- t[o] = c;
- break
- }
- e.hasOwnProperty(o) && (l.length ? i[o] = l[0] : i.hasOwnProperty(o) || (i[o] = r))
- }
- }
- return n.isEmptyObject(t) ? (this.errors = null, i) : (this.errors = t, !1)
- },
- getErrors: function() {
- return this.errors
- },
- registerRules: function(e) {
- for (var t in e) this.validatorBuilders[t] = e[t];
- return this
- },
- registerAliasedRule: function(e) {
- if (!e.name) throw "Alias name required";
- return this.validatorBuilders[e.name] = o._buildAliasedRule(e), this
- },
- getRules: function() {
- return this.validatorBuilders
- },
- _parseRule: function(e) {
- var t, i;
- return n.isObject(e) ? (t = Object.keys(e)[0], i = e[t], Array.isArray(i) || (i = [i])) : (t = e, i = []), {
- name: t,
- args: i
- }
- },
- _buildValidator: function(e, t) {
- if (!this.validatorBuilders[e]) throw "Rule [" + e + "] not registered";
- var i = [];
- return i.push.apply(i, t), i.push(this.getRules()), this.validatorBuilders[e].apply(null, i)
- },
- _autoTrim: function(e) {
- var t = typeof e;
- if ("object" !== t && e) return e.replace ? e.replace(/^\s*/, "").replace(/\s*$/, "") : e;
- if ("object" == t && Array.isArray(e)) {
- for (var i = [], o = 0; o < e.length; o++) i[o] = this._autoTrim(e[o]);
- return i
- }
- if ("object" == t && n.isObject(e)) {
- var i = {};
- for (var s in e) e.hasOwnProperty(s) && (i[s] = this._autoTrim(e[s]));
- return i
- }
- return e
- }
- }, t.exports = o
- }, {
- "./util": 9
- }],
- 9: [function(e, t, i) {
- "use strict";
- t.exports = {
- isNumberOrString: function(e) {
- return "string" == typeof e ? !0 : "number" == typeof e && isFinite(e) ? !0 : !1
- },
- isObject: function(e) {
- return e === Object(e)
- },
- isEmptyObject: function(e) {
- for (var t in e)
- if (e.hasOwnProperty(t)) return !1;
- return !0
- },
- escapeRegExp: function(e) {
- return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&")
- },
- isNoValue: function(e) {
- return void 0 === e || null === e || "" === e
- }
- }
- }, {}],
- 10: [function(e, t, i) {
- window.LIVR = e("../lib/LIVR")
- }, {
- "../lib/LIVR": 1
- }]
- }, {}, [10]), window.odometerOptions = {
- duration: 5e3,
- theme: "default",
- auto: !1,
- format: "( ddd)"
- }, $.extend(!0, $.magnificPopup.defaults, {
- tClose: "Закрыть (Esc)",
- tLoading: "ПожалуйÑта, подождите...",
- gallery: {
- tPrev: "Ðазад (клавиша ←)",
- tNext: "Вперед (клавиша →)",
- tCounter: "%curr% из %total%"
- },
- image: {
- tError: '<a href="%url%">Изображение</a> не удалоÑÑŒ загрузить.'
- },
- ajax: {
- tError: '<a href="%url%">Содержимое</a> не удалоÑÑŒ загрузить.'
- }
- }), $(document).ready(function() {
- Sprashivai.logged || ($(".signin_lnk").magnificPopup({
- type: "inline",
- preloader: !1,
- focus: "#signin_username",
- modal: !0
- }), $(document).on("click", "#signin_close", function(e) {
- $("#signin_pass").val(""), e.preventDefault(), $.magnificPopup.close()
- }), $("#qick_sngp_inp_pwd").passMeter(function(e) {
- $("#pass_strong_ind").css("width", e + "%"), 30 > e ? $("#pass_strong_ind").css("background-color", "#FF7979") : 55 > e ? $("#pass_strong_ind").css("background-color", "#FFBC84") : $("#pass_strong_ind").css("background-color", "#91DD81")
- })), setTimeout(function() {
- Sprashivai.time_updater()
- }, 1e4), $(".pr_gft_img").length > 0 && $(".pr_gft_img").tooltipster({
- delay: 100,
- position: "top",
- contentAsHTML: !0,
- offsetY: -5,
- offsetX: 5
- }), $("#nav_search_inp").keydown(function(e) {
- var t = e.keyCode || e.which;
- if (13 == t) {
- if (Sprashivai.following_matched.length > 0)
- if ($(this).val().length > 0 && 0 == Sprashivai.following_index) location = "/search?query=" + encodeURIComponent($(this).val());
- else {
- var i = 0 == $(this).val().length ? Sprashivai.following_index : Sprashivai.following_index - 1;
- location = "/" + Sprashivai.following_matched[i].username
- } else $(this).val().length > 0 && (location = "/search?query=" + encodeURIComponent($(this).val()));
- e.preventDefault()
- } else if (38 == t) Sprashivai.following_index > 0 && (Sprashivai.following_index--, Sprashivai.search_quick_update()), e.preventDefault();
- else if (40 == t) {
- var o = Sprashivai.following_matched.length;
- $(this).val().length > 0 && o++, o > 0 && Sprashivai.following_index < o - 1 && (Sprashivai.following_index++, Sprashivai.search_quick_update()), e.preventDefault()
- }
- }), $("#nav_search_inp").keyup(function(e) {
- var t = e.keyCode || e.which;
- 13 == t || 38 == t || 40 == t || (Sprashivai.search_quick($(this).val()), Sprashivai.following_index = $(this).val().length > 0 ? 0 : Sprashivai.following_matched.length > 0 ? 0 : -1, Sprashivai.search_quick_update())
- }), $("#nav_search_inp").focus(function() {
- Sprashivai.logged && ($("#nav_search_results").show(), Sprashivai.following ? Sprashivai.search_quick($("#nav_search_inp").val()) : Profile.following_autocomplete(), Sprashivai.following_index = $(this).val().length > 0 ? 0 : Sprashivai.following_matched.length > 0 ? 0 : -1, Sprashivai.search_quick_update())
- }), $("#nav_search_inp").blur(function() {
- $("#nav_search_results").hide()
- }), $("#nav_search_results").on("mousedown", function(e) {
- e.preventDefault()
- }), $(".comment_options").on("click", ".cmnt_an_dis", function() {
- Sprashivai.show_error("Комментарии к Ñвоим ответам не могут быть анонимными")
- }), $("#nav_opt_link").click(function(e) {
- return "visible" == $("#top_menu_box").css("visibility") ? ($("#top_menu_box").css("top", "31px"), $("#top_menu_box").css("opacity", "0"), $("#top_menu_box").css("visibility", "hidden")) : Sprashivai.top_menu(), e.stopPropagation(), !1
- }), $("#top_menu_box").click(function(e) {
- e.stopPropagation()
- }), $("#not_cont").click(function(e) {
- e.stopPropagation()
- }), $("#head_not_lnk").click(function(e) {
- e.stopPropagation()
- }), $(document).click(function(e) {
- $("#top_menu_box").css("top", "31px"), $("#top_menu_box").css("opacity", "0"), $("#top_menu_box").css("visibility", "hidden"), $("#not_cont").css("display", "none")
- }), Sprashivai.logged || ($("#user_big_avatar").one("load", function() {
- $("#quick_signup_lyot").scrollToFixed({
- marginTop: 60
- })
- }).each(function() {
- this.complete && $(this).load()
- }), $(document).on("focus", "#qick_sngp_inp_us", function() {
- $("#quick_sgp_hidden").css("max-height", "600px"), $("#quick_sgp_hidden").css("opacity", "1.0"), $("#quick_sgp_hidden").css("visibility", "visible")
- }), $(document).on("focus", ".sgnp_inp", function() {
- var e = $(this).attr("id").replace("_inp_", "_ab_"),
- t = $(this).attr("id").replace("_inp_", "_er_");
- $("#" + t).hide(), $("#" + e).show()
- }), $(document).on("blur", ".sgnp_inp", function() {
- var e = $(this).attr("id").replace("_inp_", "_ab_"),
- t = $(this).attr("id").replace("_inp_", "_er_");
- $("#" + e).hide(), "" != $("#" + t).children(".form_error_bl").html() && $("#" + t).show()
- }), $(document).on("blur", "#qick_sngp_inp_us", function() {
- Signup_quick.check_username(!1)
- }), $(document).on("blur", "#qick_sngp_inp_em", function() {
- Signup_quick.check_email(!1)
- }), $(document).on("blur", "#qick_sngp_inp_pwd", function() {
- Signup_quick.check_pwd(!1)
- })), Sprashivai.ichecks(), $("#self_av_options").length > 0 && $("#profile_avatar_wrapper").hover(function() {
- $("#self_av_options").velocity({
- bottom: "",
- opacity: "1.0"
- }, {
- duration: 200,
- delay: 0,
- easing: "easeInSine"
- })
- }, function() {
- $("#self_av_options").velocity({
- bottom: "-150px",
- opacity: "0"
- }, {
- duration: 200,
- delay: 0,
- easing: "easeInSine"
- })
- }), $(document).on({
- mouseenter: function() {
- $(this).stop().velocity({
- width: "80px",
- height: "80px",
- marginTop: "-10px"
- }, {
- duration: 100,
- delay: 0,
- easing: "easeInSine"
- })
- },
- mouseleave: function() {
- $(this).stop().velocity({
- width: "60px",
- height: "60px",
- marginTop: "0"
- }, {
- duration: 100,
- delay: 0,
- easing: "easeInSine"
- })
- }
- }, ".sms_feed_user"), $("#sms_live_in").hover(function() {
- $("#sms_feed_rel").stop().velocity({
- marginLeft: "70px"
- }, {
- duration: 350,
- delay: 0,
- easing: "easeInSine"
- })
- }, function() {
- $("#sms_feed_rel").stop().velocity({
- marginLeft: "0px"
- }, {
- duration: 350,
- delay: 0,
- easing: "easeInSine"
- })
- }), $("#sms_avatars_layout").hover(function() {
- $(this).stop().velocity({
- left: "5px"
- }, {
- duration: 100,
- delay: 0,
- easing: "easeInSine"
- })
- }, function() {
- $(this).stop().velocity({
- left: "15px"
- }, {
- duration: 100,
- delay: 0,
- easing: "easeInSine"
- })
- }), "profile_self" == Sprashivai.page && ($(".pr-qck-edit").on("mouseenter", "#pr_quck_edit_icon", function() {
- $("#pr_quck_edit_btn_lyot").show()
- }), $(".pr-qck-edit").on("mouseleave", "#pr_quck_edit_btn_lyot", function() {
- $("#pr_quck_edit_btn_lyot").hide()
- })), $(".toolt-soc").length > 0 && $(".toolt-soc").tooltipster({
- delay: 0,
- position: "top",
- offsetY: 12
- }), $(".sms_feed_user").tooltipster({
- delay: 100,
- position: "bottom",
- contentAsHTML: !0,
- offsetY: 2
- }), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top"
- }), $(".toolt-na").tooltipster({
- delay: 0,
- position: "top",
- offsetY: -12
- }), $(".autosize").length > 0 && $(".autosize").autoResizer(), $(".av_mg").length > 0 && $(".av_mg").magnificPopup({
- type: "image"
- }), Sprashivai.odometer()
- }), Sprashivai.odometer = function() {
- $(".odometer_i").each(function() {
- var e = document.getElementById($(this).attr("id"));
- od = new Odometer({
- el: e,
- value: parseInt($(this).html().replace(" ", ""))
- }), $(this).removeClass("odometer_i")
- })
- }, Sprashivai.ichecks = function() {
- $(".icheck_i").each(function() {
- $(this).iCheck({
- checkboxClass: "icheckbox_flat"
- }), $(this).removeClass("icheck_i")
- })
- };
- var top_error_timeout, top_message_timeout;
- Sprashivai.show_error = function(e) {
- $("#top_error_message").html(e), top_error_timeout && clearTimeout(top_error_timeout), $("#top_error").show();
- var t = e.length / 19 * 1e3;
- t = 4e3 > t ? 4e3 : t, top_error_timeout = setTimeout("$('#top_error').hide();", t)
- }, Sprashivai.show_center_loader = function(e) {
- $("#notify_small_block").html(e);
- var t = $("#notify_small_block").width() / 2;
- $("#notify_small_block").css("margin-left", "-" + t + "px"), $("#notify_small_block").show(), $("#notify_small_block").velocity({
- top: "70px",
- opacity: "1.0"
- }, {
- duration: 80,
- delay: 0,
- easing: "easeInSine"
- })
- }, Sprashivai.hide_center_loader = function() {
- $("#notify_small_block").css("top", "0"), $("#notify_small_block").css("opacity", "0"), $("#notify_small_block").hide()
- }, Sprashivai.show_message = function(e) {
- $("#top_message_text").html(e), top_message_timeout && clearTimeout(top_message_timeout), $("#top_message").show();
- var t = e.length / 19 * 1e3;
- t = 4e3 > t ? 4e3 : t, top_message_timeout = setTimeout("$('#top_message').hide();", t)
- }, Sprashivai.open_youtube = function(e) {
- $.magnificPopup.open({
- items: {
- src: e,
- type: "iframe"
- }
- })
- }, Sprashivai.open_media = function(e) {
- $.magnificPopup.open({
- items: {
- src: e,
- type: "image"
- }
- })
- }, Sprashivai.top_menu = function() {
- $("#top_menu_box").css("top", "51px"), $("#top_menu_box").css("opacity", "1"), $("#top_menu_box").css("visibility", "visible")
- }, Sprashivai.show_two_factor_about = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/two_factor_auth"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- }, Sprashivai.show_support = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/support"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !0
- }, 0)
- }, Sprashivai.two_factor_auth = function(e) {
- $.magnificPopup.close(), setTimeout(function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/set_two_factor?step=" + e
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- }, 100)
- }, Sprashivai.search_quick = function(e) {
- if ($("#nav_search_results_content").html(""), e.length > 0) {
- $("#nav_search_results_content").append('<div class="pr_aut_blck"><a href="/search?query=' + encodeURIComponent(e) + '" class="pr_aut_lnk_s">ИÑкать <b>' + e + "</b></a></div>"), Sprashivai.following_matched = [];
- var t = new RegExp(e, "i");
- Sprashivai.following.forEach(function(e, i, o) {
- e.username.match(t) ? Sprashivai.following_matched.push(e) : e.city.match(t) ? Sprashivai.following_matched.push(e) : e.fullname.match(t) && Sprashivai.following_matched.push(e)
- })
- } else Sprashivai.following_matched = Sprashivai.following;
- var i = "",
- t = new RegExp("(" + e + ")", "i");
- Sprashivai.following_matched.forEach(function(e, o, n) {
- 6 >= o && (i += '<div class="pr_aut_blck"><a href="/' + e.username + '" class="pr_aut_lnk"><img class="pr_aut_img" src="' + e.photo + '" width="30" height="30"><p class="pr_auth_tit">@' + e.username.replace(t, '<span class="highlight_yel">$1</span>'), e.official && (i += '<i class="icon spr_icon_official_small"></i>'), i += '</p><p class="pr_auth_subtit">' + e.fullname.replace(t, '<span class="highlight_yel">$1</span>') + "</p></a>", e.fav && (i += '<div class="pr_fav"><i class="icon spr_icon_star_small"></i></div>'), i += "</div>")
- }), $("#nav_search_results_content").append(i), Sprashivai.favs > 7 && 0 == e.length && $("#nav_search_results_content").append('<div class="pr_aut_blck"><a href="/my/favourites" class="pr_aut_lnk_fav">Пользователи в закладках <b>' + Sprashivai.favs + "</b></a></div>");
- }, Sprashivai.search_quick_update = function() {
- $(".pr_aut_blck").removeClass("pr_aut_blck_sel"), Sprashivai.following_index >= 0 && $(".pr_aut_blck:eq(" + Sprashivai.following_index + ")").addClass("pr_aut_blck_sel")
- }, Sprashivai.open_payments = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/payments"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- };
- var search_xhr;
- Sprashivai.search = function(e) {
- $("#srch_loader").show(), e && (search_hits = 0, search_passed = 0, $("#load-more-preloader").show(), $("#load-more-link").hide()), $("#srch_result").css("opacity", "0.6"), $("#srch_query_hid").val($("#srch_query").val()), $("#srch_offset").val(search_passed), search_xhr && search_xhr.abort(), search_xhr = $.ajax({
- type: "POST",
- url: "/search/load",
- data: $("#search_filters_form").serialize(),
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- $("#srch_result").css("opacity", "1"), $("#srch_loader").hide(), e && ($("#load-more-preloader").hide(), $("#load-more-link").show()), "ok" == t.status ? (e && $("#srch_result").html(""), -1 == t.hits ? ($("#srch_hits").hide(), $("#srch_empty").hide(), search_hits = 0, $("#srch_load_more").hide()) : 0 == t.hits ? ($("#srch_empty").show(), $("#srch_hits").hide(), search_hits = 0, $("#srch_load_more").hide()) : ($("#srch_hits_text").html(t.hits_text), $("#srch_empty").hide(), $("#srch_hits").show(), search_hits = t.hits, search_passed += t.passed, search_passed >= t.hits ? $("#srch_load_more").hide() : $("#srch_load_more").show()), $("#srch_result").append(t.users)) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- e && ($("#load-more-preloader").hide(), $("#load-more-link").show()), $("#srch_loader").hide(), $("#srch_result").css("opacity", "1"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Sprashivai.open_avatar = function(e) {
- $.magnificPopup.open({
- items: {
- src: e,
- type: "image"
- }
- })
- }, Date.now || (Date.now = function() {
- return (new Date).getTime()
- }), Sprashivai.time_updater = function() {
- $(".t_timer").length > 0 && $(".t_timer").each(function() {
- $(this).children(".t_t").html(return_date_time($(this).children(".t_st").html()))
- }), setTimeout(function() {
- Sprashivai.time_updater()
- }, 1e4)
- }, Sprashivai.pass_set_eye = function() {
- "password" == $("#rec_inp_new_pass").attr("type") ? ($("#rec_inp_new_pass").attr("type", "text"), $("#signin_eye_pass_rec").removeClass("spr_icon_eye_off"), $("#signin_eye_pass_rec").addClass("spr_icon_eye")) : ($("#rec_inp_new_pass").attr("type", "password"), $("#signin_eye_pass_rec").removeClass("spr_icon_eye"), $("#signin_eye_pass_rec").addClass("spr_icon_eye_off"))
- }, Sprashivai.signin_eye = function() {
- "password" == $("#signin_pass").attr("type") ? ($("#signin_pass").attr("type", "text"), $("#signin_eye_i").removeClass("spr_icon_eye_off"), $("#signin_eye_i").addClass("spr_icon_eye")) : ($("#signin_pass").attr("type", "password"), $("#signin_eye_i").removeClass("spr_icon_eye"), $("#signin_eye_i").addClass("spr_icon_eye_off"))
- }, Sprashivai.quck_reg_eye = function() {
- "password" == $("#qick_sngp_inp_pwd").attr("type") ? ($("#qick_sngp_inp_pwd").attr("type", "text"), $("#signin_eye_reg").removeClass("spr_icon_eye_off"), $("#signin_eye_reg").addClass("spr_icon_eye")) : ($("#qick_sngp_inp_pwd").attr("type", "password"), $("#signin_eye_reg").removeClass("spr_icon_eye"), $("#signin_eye_reg").addClass("spr_icon_eye_off"))
- }, Sprashivai.signin = function() {
- $("#signin_btn").attr("disabled", "disabled"), $("#signin_btn").html("подождите..."), $("#signin_error").hide(), $.ajax({
- type: "POST",
- url: "/ajax/signin",
- data: {
- email: $("#signin_username").val(),
- pass: md5($("#signin_pass").val())
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? location.reload() : ($("#signin_btn").removeAttr("disabled"), $("#signin_btn").html("Войти"), $("#signin_error").html(e.message), $("#signin_error").show())
- },
- error: function(e, t) {
- $("#signin_btn").removeAttr("disabled"), $("#signin_btn").html("Войти"), $("#signin_error").html("Произошла ошибка, попробуйте еще раз"), $("#signin_error").show()
- }
- })
- }, window.Signup_quick || (window.Signup_quick = {}), window.Signup || (window.Signup = {}), "signup_finish" == Sprashivai.page && $(document).ready(function() {
- $(document).on("blur", "#sgnp_fin_us", function() {
- Signup.check_username(!1)
- }), $(document).on("blur", "#sgnp_fin_em", function() {
- Signup.check_email(!1)
- }), $(document).on("keyup", "#sgnp_fin_pwd", function() {
- Signup.check_pwd(!1)
- }), $("#sgnp_fin_pwd").passMeter(function(e) {
- $("#pass_strong_ind").css("width", e + "%"), 30 > e ? $("#pass_strong_ind").css("background-color", "#FF7979") : 55 > e ? $("#pass_strong_ind").css("background-color", "#FFBC84") : $("#pass_strong_ind").css("background-color", "#91DD81")
- }), $(document).on("focus", ".msignup_input", function() {
- var e = $(this).attr("id") + "_about",
- t = $(this).attr("id") + "_error";
- $("#" + t).hide(), $("#" + e).show()
- }), $(document).on("blur", ".msignup_input", function() {
- var e = $(this).attr("id") + "_about",
- t = $(this).attr("id") + "_error";
- $("#" + e).hide(), "" != $("#" + t).children(".form_error_bl").html() && $("#" + t).show()
- }), $("#sgnp_fin_us").keyup(function() {
- var e = new RegExp(/^([a-zA-Z0-9_]{3,25}?)$/);
- $(this).val().length > 0 && e.test($(this).val()) ? ($("#sgnp_future_url").html("http://sprashivai.ru/" + $(this).val()), $("#sgnp_future_address").show()) : $("#sgnp_future_address").hide()
- })
- }), Signup_quick.check_username = function(e) {
- if ($("#qick_sngp_inp_us").removeClass("inp_err"), $("#qick_sngp_inp_us").removeClass("inp_success"), $("#qick_sngp_er_us").children(".form_error_bl").html(""), $("#qick_sngp_er_us").hide(), !e && "" == $("#qick_sngp_inp_us").val()) return !0;
- if (0 == $("#qick_sngp_inp_us").val().length) return $("#qick_sngp_er_us").children(".form_error_bl").html("Введите Ð¸Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ"), $("#qick_sngp_er_us").show(), $("#qick_sngp_inp_us").addClass("inp_err"), !1;
- var t = new RegExp(/^([a-zA-Z0-9_]{1,100}?)$/);
- return t.test($("#qick_sngp_inp_us").val()) ? ($("#qick_sngp_load_us").show(), void $.ajax({
- type: "GET",
- url: "/signup/check_username",
- dataType: "json",
- data: {
- username: $("#qick_sngp_inp_us").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- $("#qick_sngp_load_us").hide(), "ok" == e.status ? $("#qick_sngp_inp_us").addClass("inp_success") : ($("#qick_sngp_er_us").children(".form_error_bl").html(e.message), $("#qick_sngp_er_us").show(), $("#qick_sngp_inp_us").addClass("inp_err"))
- },
- error: function(e, t) {
- $("#qick_sngp_load_us").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })) : ($("#qick_sngp_er_us").children(".form_error_bl").html("Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¼Ð¾Ð¶ÐµÑ‚ Ñодержать только английÑкие буквы, цифры и знак нижнего подчеркиваниÑ!"), $("#qick_sngp_er_us").show(), $("#qick_sngp_inp_us").addClass("inp_err"), !1)
- }, Signup_quick.check_email = function(e) {
- if ($("#qick_sngp_inp_em").removeClass("inp_err"), $("#qick_sngp_inp_em").removeClass("inp_success"), $("#qick_sngp_er_em").children(".form_error_bl").html(""), $("#qick_sngp_er_em").hide(), !e && "" == $("#qick_sngp_inp_em").val()) return !0;
- if (0 == $("#qick_sngp_inp_em").val().length) return $("#qick_sngp_er_em").children(".form_error_bl").html("Введите email"), $("#qick_sngp_er_em").show(), $("#qick_sngp_inp_em").addClass("inp_err"), !1;
- var t = new RegExp(/^[\w.-]+@([a-z0-9\-]+\.)+[a-z]{2,6}$/i);
- return t.test($("#qick_sngp_inp_em").val()) ? ($("#qick_sngp_load_em").show(), void $.ajax({
- type: "GET",
- url: "/signup/check_email",
- dataType: "json",
- data: {
- email: $("#qick_sngp_inp_em").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- $("#qick_sngp_load_em").hide(), "ok" == e.status ? $("#qick_sngp_inp_em").addClass("inp_success") : ($("#qick_sngp_er_em").children(".form_error_bl").html(e.message), $("#qick_sngp_er_em").show(), $("#qick_sngp_inp_em").addClass("inp_err"))
- },
- error: function(e, t) {
- $("#qick_sngp_load_em").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })) : ($("#qick_sngp_er_em").children(".form_error_bl").html("Введите корректный email!"), $("#qick_sngp_er_em").show(), $("#qick_sngp_inp_em").addClass("inp_err"), !1)
- }, Signup_quick.check_pwd = function(e) {
- return $("#qick_sngp_inp_pwd").removeClass("inp_err"), $("#qick_sngp_inp_pwd").removeClass("inp_success"), $("#qick_sngp_er_pwd").children(".form_error_bl").html(""), $("#qick_sngp_er_pwd").hide(), e || "" != $("#qick_sngp_inp_pwd").val() ? 0 == $("#qick_sngp_inp_pwd").val().length ? ($("#qick_sngp_er_pwd").children(".form_error_bl").html("Введите пароль"), $("#qick_sngp_er_pwd").show(), $("#qick_sngp_inp_pwd").addClass("inp_err"), !1) : $("#qick_sngp_inp_pwd").val().length < 6 ? ($("#qick_sngp_er_pwd").children(".form_error_bl").html("Введите пароль подлиннее, минимум 6 Ñимволов"), $("#qick_sngp_er_pwd").show(), $("#qick_sngp_inp_pwd").addClass("inp_err"), !1) : $("#qick_sngp_inp_pwd").val().length > 22 ? ($("#qick_sngp_er_pwd").children(".form_error_bl").html("Введите пароль покороче, макÑимум 22 Ñимвола"), $("#qick_sngp_er_pwd").show(), $("#qick_sngp_inp_pwd").addClass("inp_err"), !1) : ($("#qick_sngp_inp_pwd").addClass("inp_success"), !0) : !0
- }, Signup_quick.signup = function() {
- $("#qick_sngp_btn").html("региÑтрируем"), $("#qick_sngp_btn").attr("disabled", "disabled"), $.ajax({
- type: "POST",
- url: "/signup/quick",
- data: {
- email: $("#qick_sngp_inp_em").val(),
- username: $("#qick_sngp_inp_us").val(),
- pass: $("#qick_sngp_inp_pwd").val()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#qick_sngp_btn").html("ЗарегиÑтрироватьÑÑ"), $("#qick_sngp_btn").removeAttr("disabled"), "ok" == e.status ? ($("#qick_sngp_btn").html("региÑтрируем"), $("#qick_sngp_btn").attr("disabled", "disabled"), Sprashivai.show_center_loader("Ð’Ñ‹ уÑпешно зарегиÑтрировалиÑÑŒ, подождите еще чуть-чуть..."), location = e.redirect) : e.field ? ($("#qick_sngp_er_" + e.field).children(".form_error_bl").html(e.message), $("#qick_sngp_er_" + e.field).show(), $("#qick_sngp_inp_" + e.field).addClass("inp_err")) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#qick_sngp_btn").html("ЗарегиÑтрироватьÑÑ"), $("#qick_sngp_btn").removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Signup.signup_finish = function() {
- $("#btn_signup_finish").html("региÑтрируем"), $("#btn_signup_finish").attr("disabled", "disabled"), $.ajax({
- type: "POST",
- url: "/signup/finish",
- data: $("#form_signup_finish").serialize(),
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#btn_signup_finish").html("ЗарегиÑтрироватьÑÑ"), $("#btn_signup_finish").removeAttr("disabled"), "ok" == e.status ? ($("#btn_signup_finish").html("региÑтрируем"), $("#btn_signup_finish").attr("disabled", "disabled"), Sprashivai.show_center_loader("Ð’Ñ‹ уÑпешно зарегиÑтрировалиÑÑŒ, подождите еще чуть-чуть..."), location = "/signup/next?from=signup") : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#btn_signup_finish").html("ЗарегиÑтрироватьÑÑ"), $("#btn_signup_finish").removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, "signup" == Sprashivai.page && $(document).ready(function() {
- $(document).on("blur", "#sgnp_fin_us", function() {
- Signup.check_username(!1)
- }), $(document).on("blur", "#sgnp_fin_em", function() {
- Signup.check_email(!1)
- }), $(document).on("keyup", "#sgnp_fin_pwd", function() {
- Signup.check_pwd(!1)
- }), $("#sgnp_fin_pwd").passMeter(function(e) {
- $("#pass_strong_ind").css("width", e + "%"), 30 > e ? $("#pass_strong_ind").css("background-color", "#FF7979") : 55 > e ? $("#pass_strong_ind").css("background-color", "#FFBC84") : $("#pass_strong_ind").css("background-color", "#91DD81")
- }), $(document).on("focus", ".msignup_input", function() {
- var e = $(this).attr("id") + "_about",
- t = $(this).attr("id") + "_error";
- $("#" + t).hide(), $("#" + e).show()
- }), $(document).on("blur", ".msignup_input", function() {
- var e = $(this).attr("id") + "_about",
- t = $(this).attr("id") + "_error";
- $("#" + e).hide(), "" != $("#" + t).children(".form_error_bl").html() && $("#" + t).show()
- }), $("#sgnp_fin_us").keyup(function() {
- var e = new RegExp(/^([a-zA-Z0-9_]{3,25}?)$/);
- $(this).val().length > 0 && e.test($(this).val()) ? ($("#sgnp_future_url").html("http://sprashivai.ru/" + $(this).val()), $("#sgnp_future_address").show()) : $("#sgnp_future_address").hide()
- })
- }), Signup.check_username = function(e) {
- if ($("#sgnp_fin_us").removeClass("inp_err"), $("#sgnp_fin_us").removeClass("inp_success"), $("#sgnp_fin_us_error").children(".form_error_bl").html(""), $("#sgnp_fin_us_error").hide(), !e && "" == $("#sgnp_fin_us").val()) return !0;
- if (0 == $("#sgnp_fin_us").val().length) return $("#sgnp_fin_us_error").css("z-index", 100), $("#sgnp_fin_us_error").children(".form_error_bl").html("Введите Ð¸Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ"), $("#sgnp_fin_us_error").show(), $("#sgnp_fin_us").addClass("inp_err"), !1;
- var t = new RegExp(/^([a-zA-Z0-9_]{1,100}?)$/);
- return t.test($("#sgnp_fin_us").val()) ? ($("#sgnp_fin_us_loader").show(), void $.ajax({
- type: "GET",
- url: "/signup/check_username",
- dataType: "json",
- data: {
- username: $("#sgnp_fin_us").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- $("#sgnp_fin_us_loader").hide(), "ok" == e.status ? $("#sgnp_fin_us").addClass("inp_success") : ($("#sgnp_fin_us_error").css("z-index", 100), $("#sgnp_fin_us_error").children(".form_error_bl").html(e.message), $("#sgnp_fin_us_error").show(), $("#sgnp_fin_us").addClass("inp_err"))
- },
- error: function(e, t) {
- $("#sgnp_fin_us_loader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })) : ($("#sgnp_fin_us_error").css("z-index", 100), $("#sgnp_fin_us_error").children(".form_error_bl").html("Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¼Ð¾Ð¶ÐµÑ‚ Ñодержать только английÑкие буквы, цифры и знак нижнего подчеркиваниÑ!"), $("#sgnp_fin_us_error").show(), $("#sgnp_fin_us").addClass("inp_err"), !1)
- }, Signup.check_email = function(e) {
- if ($("#sgnp_fin_em").removeClass("inp_err"), $("#sgnp_fin_em").removeClass("inp_success"), $("#sgnp_fin_em_error").children(".form_error_bl").html(""), $("#sgnp_fin_em_error").hide(), !e && "" == $("#sgnp_fin_em").val()) return !0;
- if (0 == $("#sgnp_fin_em").val().length) return $("#sgnp_fin_em_error").css("z-index", 100), $("#sgnp_fin_em_error").children(".form_error_bl").html("Введите email"), $("#sgnp_fin_em_error").show(), $("#sgnp_fin_em").addClass("inp_err"), !1;
- var t = new RegExp(/^[\w.-]+@([a-z0-9\-]+\.)+[a-z]{2,6}$/i);
- return t.test($("#sgnp_fin_em").val()) ? ($("#sgnp_fin_em_loader").show(), void $.ajax({
- type: "GET",
- url: "/signup/check_email",
- dataType: "json",
- data: {
- email: $("#sgnp_fin_em").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- $("#sgnp_fin_em_loader").hide(), "ok" == e.status ? $("#sgnp_fin_em").addClass("inp_success") : ($("#sgnp_fin_em_error").css("z-index", 100), $("#sgnp_fin_em_error").children(".form_error_bl").html(e.message), $("#sgnp_fin_em_error").show(), $("#sgnp_fin_em").addClass("inp_err"))
- },
- error: function(e, t) {
- $("#sgnp_fin_em_loader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })) : ($("#sgnp_fin_em_error").css("z-index", 100), $("#sgnp_fin_em_error").children(".form_error_bl").html("Введите корректный email!"), $("#sgnp_fin_em_error").show(), $("#sgnp_fin_em").addClass("inp_err"), !1)
- }, Signup.check_pwd = function(e) {
- return $("#sgnp_fin_pwd").removeClass("inp_err"), $("#sgnp_fin_pwd").removeClass("inp_success"), $("#sgnp_fin_pwd_error").children(".form_error_bl").html(""), $("#sgnp_fin_pwd_error").hide(), e || "" != $("#sgnp_fin_pwd").val() ? 0 == $("#sgnp_fin_pwd").val().length ? ($("#sgnp_fin_pwd_error").css("z-index", 100), $("#sgnp_fin_pwd_error").children(".form_error_bl").html("Введите пароль"), $("#sgnp_fin_pwd_error").show(), $("#sgnp_fin_pwd").addClass("inp_err"), !1) : $("#sgnp_fin_pwd").val().length < 6 ? ($("#sgnp_fin_pwd_error").css("z-index", 100), $("#sgnp_fin_pwd_error").children(".form_error_bl").html("Введите пароль подлиннее, минимум 6 Ñимволов"), $("#sgnp_fin_pwd_error").show(), $("#sgnp_fin_pwd").addClass("inp_err"), !1) : $("#sgnp_fin_pwd").val().length > 22 ? ($("#sgnp_fin_pwd_error").css("z-index", 100), $("#sgnp_fin_pwd_error").children(".form_error_bl").html("Введите пароль покороче, макÑимум 22 Ñимвола"), $("#sgnp_fin_pwd_error").show(), $("#sgnp_fin_pwd").addClass("inp_err"), !1) : ($("#sgnp_fin_pwd").addClass("inp_success"), !0) : !0
- }, Signup.signup_main = function() {
- $("#btn_signup_finish").html("региÑтрируем"), $("#btn_signup_finish").attr("disabled", "disabled"), $.ajax({
- type: "POST",
- url: "/signup/quick",
- data: {
- email: $("#sgnp_fin_em").val(),
- username: $("#sgnp_fin_us").val(),
- pass: $("#sgnp_fin_pwd").val(),
- "g-recaptcha-response": grecaptcha.getResponse()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#btn_signup_finish").html("ЗарегиÑтрироватьÑÑ"), $("#btn_signup_finish").removeAttr("disabled"), "ok" == e.status ? ($("#btn_signup_finish").html("региÑтрируем"), $("#btn_signup_finish").attr("disabled", "disabled"), Sprashivai.show_center_loader("Ð’Ñ‹ уÑпешно зарегиÑтрировалиÑÑŒ, подождите еще чуть-чуть..."), location = e.redirect) : e.field ? ($("#sgnp_fin_" + e.field + "_error").children(".form_error_bl").html(e.message), $("#sgnp_fin_" + e.field + "_error").show(), $("#sgnp_fin_" + e.field).addClass("inp_err")) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#btn_signup_finish").html("ЗарегиÑтрироватьÑÑ"), $("#btn_signup_finish").removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, window.Profile || (window.Profile = {}), Profile.quick_edit_changed = !1, Profile.quick_edit_visible = !1, Profile.quick_edit = function(e) {
- e = "undefined" != typeof e ? e : !1, !Profile.quick_edit_visible || e ? ($.ajaxSetup({
- cache: !1
- }), Profile.quick_edit_visible = !0, $("#pr-quick-edit-lyot").show(), $("#pr-quick-edit-lyot").children(".loader-lyot").show(), $("#pr-quick-edit-lyot").children(".loader-error").hide(), $("#profile_quick_edit_content").hide(), $("#pr_quck_edit_btn_lyot").addClass("pr-qck-edit-btn-vis"), $("#pr-second-line").length > 0 && $("#pr-second-line").hide(), $("#profile_quick_edit_content").load("/blocks/profile/quick_edit", function(e, t, i) {
- $("#pr-quick-edit-lyot").children(".loader-lyot").hide(), "error" == t ? $("#pr-quick-edit-lyot").children(".loader-error").show() : $("#profile_quick_edit_content").show()
- })) : (Profile.quick_edit_visible = !1, $("#pr-quick-edit-lyot").hide(), $("#pr-quick-edit-lyot").children(".loader-lyot").hide(), $("#profile_quick_edit_content").unbind("load"), $("#pr_quck_edit_btn_lyot").removeClass("pr-qck-edit-btn-vis"), $("#pr-second-line").length > 0 && $("#pr-second-line").show())
- }, Profile.edit_status = function() {
- $("#pr_status_text").hide(), $("#pr_status_edit").show(), $("#pr_status_edit_input").focus()
- }, Profile.cancel_edit_status = function() {
- $("#pr_status_text").show(), $("#pr_status_edit").hide(), $("#pr_status_edit_input").val(Sprashivai.profile_status)
- }, Profile.delete_status = function(e) {
- $("#pr_status_text").show(), $("#pr_status_edit").hide(), $("#pr_status_text_lnk").removeClass("lnk_drk_grey"), $("#pr_status_text_lnk").addClass("lnk_lght_grey"), $("#pr_status_text_lnk").html("изменить ÑтатуÑ"), $("#pr_stat_delete").hide(), Sprashivai.profile_status = "", $("#pr_status_edit_input").val(""), $.ajax({
- type: "POST",
- url: "/profile/status/delete",
- data: {
- hash: e
- },
- dataType: "json",
- timeout: 3e4
- })
- }, Profile.set_status = function(e) {
- $.ajax({
- type: "POST",
- url: "/profile/status/set",
- data: {
- status: $("#pr_status_edit_input").val(),
- hash: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($("#pr_status_edit_input").val(e.status_text), $("#pr_status_text_lnk").addClass("lnk_drk_grey"), $("#pr_status_text_lnk").removeClass("lnk_lght_grey"), $("#pr_status_text_lnk").html(e.status_text), $("#pr_status_text").show(), $("#pr_status_edit").hide(), $("#pr_stat_delete").show(), Sprashivai.profile_status = e.status_text) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.set_gender = function(e) {
- $("#pr_quick_edit_gender").val(e), "m" == e ? ($("#pr_quick_edit_gender_m").addClass("set_gen_m_a"), $("#pr_quick_edit_gender_m").removeClass("set_gen_m"), $("#pr_quick_edit_gender_w").addClass("set_gen_w"), $("#pr_quick_edit_gender_w").removeClass("set_gen_w_a"), $("#pr_quick_edit_gender").val(e)) : ($("#pr_quick_edit_gender_m").removeClass("set_gen_m_a"), $("#pr_quick_edit_gender_m").addClass("set_gen_m"), $("#pr_quick_edit_gender_w").removeClass("set_gen_w"), $("#pr_quick_edit_gender_w").addClass("set_gen_w_a"))
- }, Profile.update_profile_quick = function(e) {
- $("#pr_quick_edit_button").html("ÑохранÑем..."), $("#pr_quick_edit_button").attr("disabled", "disabled"), $("#pr_quick_edit_error").hide(), $("#interests_txtarea_tag").val().length > 0 && $("#interests_txtarea_tag").val() != tags_default_text && $("#interests_txtarea").addTag($("#interests_txtarea_tag").val());
- var t = $("#pr_quick_edit_dn_show_age").is(":checked") ? "true" : "false";
- $.ajax({
- type: "POST",
- url: "/profile/quick_edit",
- data: {
- fullname: $("#pr_quick_edit_fullname").val(),
- city: $("#pr_quick_edit_city").val(),
- city_id: $("#pr_quick_edit_city_id").val(),
- b_day: $("#pr_quick_edit_b_day").val(),
- b_month: $("#pr_quick_edit_b_month").val(),
- b_year: $("#pr_quick_edit_b_year").val(),
- show_age: t,
- gender: $("#pr_quick_edit_gender").val(),
- interests: $("#interests_txtarea").val(),
- hash: e,
- sig: hash_profile_quick_edit(e, $("#pr_quick_edit_fullname").val(), $("#pr_quick_edit_city").val())
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($(".toolt-n").tooltipster("destroy"), $("#pr-second-line").html(e.profile.second_line), $("#pr-profile-name-main").html(e.profile.fullname), $("#pr-second-line").show(), $("#pr-quick-edit-lyot").hide(), $("#pr_quck_edit_btn_lyot").removeClass("pr-qck-edit-btn-vis"), Profile.quick_edit_visible = !1, $("#pr-quick-edit-lyot").children(".loader-lyot").hide(), $("#profile_quick_edit_content").unbind("load"), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- })) : ($("#pr_quick_edit_button").html("Сохранить"), $("#pr_quick_edit_button").removeAttr("disabled"), $("#pr_quick_edit_error").html(e.message), $("#pr_quick_edit_error").show())
- },
- error: function(e, t) {
- $("#pr_quick_edit_button").html("Сохранить"), $("#pr_quick_edit_button").removeAttr("disabled"), $("#pr_quick_edit_error").html("Произошла ошибка, попробуйте еще раз"), $("#pr_quick_edit_error").show()
- }
- })
- }, Profile.recount = function() {
- $("#btn_set_recount").html("подождите..."), $("#btn_set_recount").attr("disabled", "disabled"), $.ajax({
- type: "POST",
- url: "/settings/recount",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? (Sprashivai.show_message("Готово, обновлÑем Ñтраницу..."), location.reload()) : ($("#btn_set_recount").html("ПереÑчитать показатели"), $("#btn_set_recount").removeAttr("disabled"), Sprashivai.show_error(e.message))
- },
- error: function(e, t) {
- $("#btn_set_recount").html("ПереÑчитать показатели"), $("#btn_set_recount").removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.toggle_favourite = function(e) {
- $.ajax({
- type: "POST",
- url: "/profile/set_favourite",
- data: {
- user: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- "ok" == t.status ? ("removed" == t.action ? ($(".fav_lnk_" + e).children("i").removeClass("spr_icon_star"), $(".fav_lnk_" + e).children("i").addClass("spr_icon_star_grey")) : ($(".fav_lnk_" + e).children("i").addClass("spr_icon_star"), $(".fav_lnk_" + e).children("i").removeClass("spr_icon_star_grey")), $(".fav_lnk_" + e).tooltipster("destroy"), $(".fav_lnk_" + e).attr("title", t.title), Sprashivai.show_message(t.alert), $(".fav_lnk_" + e).tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- })) : Sprashivai.show_error(t.message)
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.delete_blacklist_item = function(e) {
- $("#bl_item_" + e).css("opacity", "0.6"), Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/settings/blacklist/delete_record",
- data: {
- blacklist_id: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- $("#bl_item_" + e).css("opacity", "1"), Sprashivai.hide_center_loader(), "ok" == t.status ? ($("#bl_item_" + e).velocity("slideUp", {
- delay: 0,
- duration: 150
- }), Sprashivai.show_message("ЗапиÑÑŒ удалена из черного ÑпиÑка")) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- $("#bl_item_" + e).css("opacity", "1"), Sprashivai.hide_center_loader(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.terminate_all_sessions = function() {
- return confirm("Ð’Ñ‹ дейÑтвительно хотите закрыть вÑе ÑеÑÑии, кроме текущей?") ? (Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), void $.ajax({
- type: "POST",
- url: "/settings/terminate_all_sessions",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? location.reload() : (Sprashivai.hide_center_loader(), Sprashivai.show_error(e.message))
- },
- error: function(e, t) {
- Sprashivai.hide_center_loader(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })) : !1
- }, Profile.open_upload_avatar_dialog = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/profile/avatar/upload"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- }, Profile.open_sms_live_dialog = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/sms_live"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- }, Profile.sms_live_in = function(e) {
- $("#btn_sms_live_place").attr("disabled", "disabled"), $("#btn_sms_live_place_text").html("подождите..."), $.ajax({
- type: "POST",
- url: "/sms/live/place",
- dataType: "json",
- data: {
- hash: e
- },
- timeout: 3e4,
- success: function(e) {
- $("#btn_sms_live_place").removeAttr("disabled"), $("#btn_sms_live_place_text").html("Ð’Ñтупить Ñ Ð±Ð°Ð»Ð°Ð½Ñа"), "ok" == e.status ? ($(".self_balance").html(e.balance), $("#sms_live_users").prepend(e.cell_html), $("#sms_live_tmp_item").velocity({
- marginLeft: "0"
- }, {
- duration: 200,
- delay: 0,
- easing: "easeInSine",
- complete: function() {
- $("#sms_live_tmp_item").removeAttr("id")
- }
- }), $.magnificPopup.close(), Sprashivai.show_message("Ð’Ñ‹ Ñтали популÑрнее!")) : Sprashivai.show_error(e.message)
- },
- error: function() {
- $("#btn_sms_live_place").removeAttr("disabled"), $("#btn_sms_live_place_text").html("Ð’Ñтупить Ñ Ð±Ð°Ð»Ð°Ð½Ñа"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.open_verify_dialog = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/verify"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- };
- var check_verified_timeout;
- Profile.check_verified = function() {
- clearTimeout(check_verified_timeout), $.ajax({
- type: "POST",
- url: "/profile/check_verified",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status && (e.verified ? ($("#modal_verify").hide(), $("#modal_verified").show()) : check_verified_timeout = setTimeout(function() {
- Profile.check_verified()
- }, 8e3))
- }
- })
- }, Profile.open_avatar_list = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/profile/avatars"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !0
- }, 0)
- }, Profile.set_avatar = function(e) {
- $.ajax({
- type: "POST",
- url: "/profile/avatar/set",
- data: {
- avatar_id: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($(".av_self_s").attr("src", e.photo_square), $("#user_big_avatar").attr("src", e.photo_big), $("#self_av_opt_crop").show(), $("#self_av_opt_delete").show(), $.magnificPopup.close()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.avatar_upload_repeat = function() {
- $("#avtr_upl_cntr").show(), $("#av_upl_pgrs_div").hide(), $("#av_upl_crop").hide(), $("#av_upl_error").hide()
- }, Profile.avatar_upload_error = function(e) {
- $("#av_upl_error_message").text(e), $("#avtr_upl_cntr").hide(), $("#av_upl_pgrs_div").hide(), $("#av_upl_crop").hide(), $("#av_upl_error").show()
- }, Profile.close_upload_avatar_dialog = function() {
- "undefined" != typeof window.ias && window.ias.cancelSelection(), $.magnificPopup.close()
- }, Profile.crop_avatar_dialog = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/avatar/crop"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- }, Profile.crop_avatar = function(e) {
- $("#btn_av_crop").attr("disabled", "disabled"), $("#btn_av_crop").children(".loader").show(), $.ajax({
- type: "POST",
- url: "/profile/avatar/crop",
- data: {
- avatar: $("#crop_av_id").val(),
- x1: $("#crop_av_x1").val(),
- x2: $("#crop_av_x2").val(),
- y1: $("#crop_av_y1").val(),
- y2: $("#crop_av_y2").val(),
- hash: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#btn_av_crop").removeAttr("disabled"), $("#btn_av_crop").children(".loader").hide(), "ok" == e.status ? ($(".av_self_s").attr("src", e.photo_square), Profile.close_upload_avatar_dialog()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз"), $("#btn_av_crop").removeAttr("disabled"), $("#btn_av_crop").children(".loader").hide()
- }
- })
- }, Profile.following_autocomplete = function() {
- $("#nav_search_load").show(), $("#nav_search_results_content").html(""), $.ajax({
- type: "GET",
- url: "/ajax/following",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#nav_search_load").hide(), "ok" == e.status ? (Sprashivai.following = e.following, Sprashivai.following_matched = e.following, Sprashivai.favs = e.fav_count, $("#nav_search_results_content").html(e.html), Sprashivai.search_quick($("#nav_search_inp").val())) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#nav_search_load").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.show_notifications = function(e) {
- return $("#not_cont").is(":visible") ? ($("#not_cont").hide(), !1) : ($("#not_cont").show(), $("#not_loading").show(), $("#not_error").hide(), void $.ajax({
- type: "GET",
- url: "/notifications/load",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#not_loading").hide(), "ok" == e.status ? ($("#not_content").show(), $("#not_content").html(e.html), e.unread > 0 ? $("#not_box_mark_as_read").css("display", "block") : $("#not_box_mark_as_read").hide()) : ($("#not_error").show(), $("#not_content").hide(), Sprashivai.show_error(e.message))
- },
- error: function(e, t) {
- $("#not_loading").hide(), $("#not_error").show(), $("#not_content").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- }))
- }, Profile.load_notifications = function() {
- $("#load-more-link").hide(), $("#load-more-preloader").show(), $.ajax({
- type: "POST",
- url: "/notifications/full/load",
- data: {
- offset: notifications_passed
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), "ok" == e.status ? ($("#notifications_div").append(e.html), notifications_passed += e.passed, notifications_passed >= notifications_count && $("#load-more-link").hide()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.mark_notifications_as_read = function() {
- $("#notifications_div").css("opacity", "0.8"), $.ajax({
- type: "POST",
- url: "/notifications/mark_as_read",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#notifications_div").css("opacity", "1.0"), "ok" == e.status ? ($(".notify_big_link").removeClass("notify_link_unr"), $(".notify_link").removeClass("notify_link_unr"), $("#head_not_lnk").removeClass("spr_ntf_red"), $("#head_not_lnk").addClass("spr_ntf_blue"), $("#head_not_span").html(" "), $("#not_box_mark_as_read").hide(), Sprashivai.show_message("Ð’Ñе ÑƒÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¾Ñ‚Ð¼ÐµÑ‡ÐµÐ½Ñ‹ как проÑмотренные")) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#notifications_div").css("opacity", "1.0"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.load_following = function(e) {
- $("#load-more-link").hide(), $("#load-more-preloader").show(), $.ajax({
- type: "POST",
- url: "/" + e + "/following/load",
- data: {
- offset: following_passed
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), "ok" == e.status ? ($("#user_following").append(e.html), following_passed += e.passed, following_passed >= following_count && $("#load-more-link").hide()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.load_followers = function(e) {
- $("#load-more-link").hide(), $("#load-more-preloader").show(), $.ajax({
- type: "POST",
- url: "/" + e + "/followers/load",
- data: {
- offset: following_passed
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), "ok" == e.status ? ($("#user_following").append(e.html), following_passed += e.passed, following_passed >= following_count && $("#load-more-link").hide()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.unlink_social = function(e) {
- Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/social/" + e + "/unlink",
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- Sprashivai.hide_center_loader(), "ok" == t.status ? ($("#social_privacy_" + e).hide(), $("#social_info_div_" + e).hide(), $("#social_btn_div_" + e).show(), $("#social_unlink_" + e).hide(), Sprashivai.show_message("Ð¡Ð¾Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ñеть отключена")) : Sprashivai.show_error(t.message)
- },
- error: function(e, t) {
- Sprashivai.hide_center_loader(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- };
- var settings_main_xhr;
- Profile.save_settings = function() {
- $("#btn_set_main_save").html("ÑохранÑем..."),
- $("#btn_set_main_save").attr("disabled", "disabled"), settings_main_xhr && settings_main_xhr.abort(), settings_main_xhr = $.ajax({
- type: "POST",
- url: "/settings/main/update",
- data: $("#form_settings_main").serialize(),
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#btn_set_main_save").html("Сохранить"), $("#btn_set_main_save").removeAttr("disabled", "disabled"), "ok" == e.status ? Sprashivai.show_message("ÐаÑтройки Ñохранены") : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#btn_set_main_save").html("Сохранить"), $("#btn_set_main_save").removeAttr("disabled", "disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- };
- var settings_design_xhr;
- Profile.save_design = function() {
- $("#btn_set_design").html("ÑохранÑем..."), $("#btn_set_design").attr("disabled", "disabled");
- var e = $("#ui_bg_del").is(":checked") ? !0 : !1;
- settings_design_xhr && settings_design_xhr.abort(), settings_design_xhr = $.ajax({
- type: "POST",
- url: "/settings/design/update",
- data: $("#form_settings_design").serialize(),
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- $("#btn_set_design").html("Сохранить изменениÑ"), $("#btn_set_design").removeAttr("disabled", "disabled"), "ok" == t.status ? (e && $("#ui_bg_settings").hide(), Sprashivai.show_message("ÐаÑтройки Ñохранены")) : Sprashivai.show_error(t.message)
- },
- error: function(e, t) {
- $("#btn_set_design").html("Сохранить изменениÑ"), $("#btn_set_design").removeAttr("disabled", "disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- };
- var settings_privacy_xhr;
- Profile.save_privacy = function() {
- $("#btn_privacy_save").html("ÑохранÑем..."), $("#btn_privacy_save").attr("disabled", "disabled"), settings_privacy_xhr && settings_privacy_xhr.abort(), settings_privacy_xhr = $.ajax({
- type: "POST",
- url: "/settings/privacy/update",
- data: $("#form_settings_privacy").serialize(),
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#btn_privacy_save").html("Сохранить"), $("#btn_privacy_save").removeAttr("disabled", "disabled"), "ok" == e.status ? Sprashivai.show_message("ÐаÑтройки Ñохранены") : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#btn_privacy_save").html("Сохранить"), $("#btn_privacy_save").removeAttr("disabled", "disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- };
- var settings_notify_xhr;
- Profile.save_notify_settings = function() {
- $("#btn_notifications_save").html("ÑохранÑем..."), $("#btn_notifications_save").attr("disabled", "disabled"), settings_notify_xhr && settings_notify_xhr.abort(), settings_notify_xhr = $.ajax({
- type: "POST",
- url: "/settings/notifications/update",
- data: $("#form_settings_notifications").serialize(),
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#btn_notifications_save").html("Сохранить"), $("#btn_notifications_save").removeAttr("disabled", "disabled"), "ok" == e.status ? Sprashivai.show_message("ÐаÑтройки Ñохранены") : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#btn_notifications_save").html("Сохранить"), $("#btn_notifications_save").removeAttr("disabled", "disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.remove_from_followers = function(e) {
- return confirm("Ð’Ñ‹ дейÑтвительно хотите удалить Ñтого Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð¸Ð· ваших подпиÑчиков?") ? ($("#pr_ln_" + e).css("opacity", "0.6"), void $.ajax({
- type: "POST",
- url: "/profile/remove_from_followers",
- data: {
- username: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- $("#pr_ln_" + e).css("opacity", "1"), "ok" == t.status ? ($("#pr_ln_" + e).velocity("slideUp", {
- delay: 0,
- duration: 150
- }), $("#followers_badge").html(t.count), t.count <= 0 && $("#followers_badge").hide(), Sprashivai.show_message("Пользователь удален из ваших подпиÑчиков")) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- $("#pr_ln_" + e).css("opacity", "1"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })) : !1
- }, Profile.unlink_phone_modal = function() {
- $("#pwd_check_action").val("unlink_phone"), $.magnificPopup.open({
- items: {
- src: "#pwd_check_modal"
- },
- type: "inline",
- focus: "#pwd_check_inp"
- })
- }, Profile.change_pass_modal = function() {
- return "" == $("#set_inp_pass1").val() ? (Sprashivai.show_error("Укажите новый пароль"), !1) : $("#set_inp_pass1").val() != $("#set_inp_pass2").val() ? (Sprashivai.show_error("Пароли не Ñовпадают"), !1) : ($("#pwd_check_action").val("change_password"), void $.magnificPopup.open({
- items: {
- src: "#pwd_check_modal"
- },
- type: "inline",
- focus: "#pwd_check_inp"
- }))
- }, Profile.change_username_modal = function() {
- $("#pwd_check_action").val("change_username"), $.magnificPopup.open({
- items: {
- src: "#pwd_check_modal"
- },
- type: "inline",
- focus: "#pwd_check_inp"
- })
- }, Profile.change_email_modal = function() {
- return re = new RegExp(/^[\w.-]+@([a-z0-9\-]+\.)+[a-z]{2,6}$/i), re.test($("#set_inp_email").val()) ? ($("#pwd_check_action").val("change_email"), void $.magnificPopup.open({
- items: {
- src: "#pwd_check_modal"
- },
- type: "inline",
- focus: "#pwd_check_inp"
- })) : (Sprashivai.show_error("Введите корректный email адреÑ"), !1)
- }, Profile.change_password = function() {
- $.ajax({
- type: "POST",
- url: "/profile/password/change",
- data: {
- pass: md5($("#pwd_check_inp").val()),
- new_pass: md5($("#set_inp_pass1").val())
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($.magnificPopup.close(), Sprashivai.show_center_loader("Пароль изменен, подождите еще чуть-чуть..."), location.reload()) : ($("#pwd_check_error").html(e.message), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- }))
- },
- error: function(e, t) {
- $("#pwd_check_error").html("Произошла ошибка, попробуйте еще раз"), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- })
- }
- })
- }, Profile.unlink_phone = function() {
- $.ajax({
- type: "POST",
- url: "/profile/unlink_phone",
- data: {
- pass: md5($("#pwd_check_inp").val())
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($.magnificPopup.close(), Sprashivai.show_center_loader("Телефон откреплен, подождите еще чуть-чуть..."), location.reload()) : ($("#pwd_check_error").html(e.message), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- }))
- },
- error: function(e, t) {
- $("#pwd_check_error").html("Произошла ошибка, попробуйте еще раз"), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- })
- }
- })
- }, Profile.change_email = function() {
- $.ajax({
- type: "POST",
- url: "/profile/email/change",
- data: {
- pass: md5($("#pwd_check_inp").val()),
- email: $("#set_inp_email").val()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($.magnificPopup.close(), Sprashivai.show_center_loader("Подождите еще чуть-чуть..."), location.reload()) : ($("#pwd_check_error").html(e.message), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- }))
- },
- error: function(e, t) {
- $("#pwd_check_error").html("Произошла ошибка, попробуйте еще раз"), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- })
- }
- })
- }, Profile.change_username = function() {
- $.ajax({
- type: "POST",
- url: "/profile/username/change",
- data: {
- pass: md5($("#pwd_check_inp").val()),
- username: $("#set_inp_username").val()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($.magnificPopup.close(), Sprashivai.show_center_loader("Подождите еще чуть-чуть..."), location.reload()) : ($("#pwd_check_error").html(e.message), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- }))
- },
- error: function(e, t) {
- $("#pwd_check_error").html("Произошла ошибка, попробуйте еще раз"), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- })
- }
- })
- }, Profile.resend_confirmation = function() {
- Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/confirm/resend",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- Sprashivai.hide_center_loader(), "ok" == e.status ? Sprashivai.show_message("ПиÑьмо Ñ Ð¿Ð¾Ð´Ñ‚Ð²ÐµÑ€Ð¶Ð´ÐµÐ½Ð¸ÐµÐ¼ отправлено на " + e.email) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- Sprashivai.hide_center_loader(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.check_password = function() {
- $.ajax({
- type: "POST",
- url: "/ajax/password/check",
- data: {
- pass: md5($("#pwd_check_inp").val())
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? "unlink_phone" == $("#pwd_check_action").val() ? Profile.unlink_phone() : "change_email" == $("#pwd_check_action").val() ? Profile.change_email() : "change_password" == $("#pwd_check_action").val() ? Profile.change_password() : "change_username" == $("#pwd_check_action").val() && Profile.change_username() : ($("#pwd_check_error").html(e.message), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- }))
- },
- error: function(e, t) {
- $("#pwd_check_error").html("Произошла ошибка, попробуйте еще раз"), $("#pwd_check_error").show(), $("#pwd_check_modal").addClass("wrong"), $("#pwd_check_modal").on("animationend", function(e) {
- $(this).removeClass("wrong")
- })
- }
- })
- }, Profile.delete_avatar = function() {
- return confirm("Ð’Ñ‹ дейÑтвительно хотите удалить Ñвой аватар?") ? (Sprashivai.show_center_loader("пожалуйÑта, подождите..."), void $.ajax({
- type: "POST",
- url: "/profile/avatar/remove/current",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- Sprashivai.hide_center_loader(), "ok" == e.status ? ($("#user_big_avatar").attr("src", e.photo_big), $("#user_big_avatar_url").attr("href", e.photo_big), $("#self_av_opt_delete").hide(), $("#self_av_opt_crop").hide(), $(".av_self_s").attr("src", e.photo_s), Sprashivai.show_message("Пользователь удален из ваших подпиÑчиков")) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- Sprashivai.hide_center_loader(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })) : !1
- }, window.User || (window.User = {}), User.open_gifts_dialog = function(e) {
- $.magnificPopup.open({
- items: {
- src: "/" + e + "/gift_select"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- }, window.Profile_settings || (window.Profile_settings = {}), "settings_main" == Sprashivai.page && $(document).ready(function() {
- $("#set_inp_pass1").passMeter(function(e) {
- $("#pass_strong_ind").css("width", e + "%"), 30 > e ? $("#pass_strong_ind").css("background-color", "#FF7979") : 55 > e ? $("#pass_strong_ind").css("background-color", "#FFBC84") : $("#pass_strong_ind").css("background-color", "#91DD81")
- })
- }), Profile_settings.check_username = function() {
- $("#set_inp_username").removeClass("inp_success"), $("#set_inp_username").removeClass("inp_err");
- var e = new RegExp(/^([a-zA-Z0-9_]{3,24}?)$/);
- return e.test($("#set_inp_username").val()) ? void $.ajax({
- type: "GET",
- url: "/signup/check_username",
- dataType: "json",
- data: {
- username: $("#set_inp_username").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- "ok" == e.status ? (Profile.change_username_modal(), $("#set_inp_username").removeClass("inp_err"), $("#set_inp_username").addClass("inp_success")) : ($("#set_inp_username").addClass("inp_err"), $("#set_inp_username").focus(), Sprashivai.show_error(e.message))
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- }) : (Sprashivai.show_error("Ð˜Ð¼Ñ Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ Ð´Ð¾Ð»Ð¶Ð½Ð¾ ÑоÑтоÑÑ‚ÑŒ только из английÑких букв, цифр и знака нижнего подчеркиваниÑ, от 3 до 24 Ñимволов"), $("#set_inp_username").addClass("inp_err"), $("#set_inp_username").focus(), !1)
- }, Profile.save_new_pass = function() {
- $("#rec_new_pass_btn_subm").attr("disabled", "disabled"), $("#rec_new_pass_btn_subm").html("подождите..."), $.ajax({
- type: "POST",
- url: "/password/save",
- dataType: "json",
- data: {
- newpass: md5($("#rec_inp_new_pass").val()),
- h: $("#pass_set_hash").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- $("#rec_new_pass_btn_subm").removeAttr("disabled"), $("#rec_new_pass_btn_subm").html("УÑтановить пароль"), "ok" == e.status ? (Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), location = "/password/changed") : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#rec_new_pass_btn_subm").removeAttr("disabled"), $("#rec_new_pass_btn_subm").html("УÑтановить пароль"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.sent_recovery_email = function() {
- return $("#rec_inp_username").removeClass("inp_err"), "" == $("#rec_inp_username").val() ? (Sprashivai.show_error("Укажите логин или email"), $("#rec_inp_username").addClass("inp_err"), $("#rec_inp_username").focus(), !1) : ($("#rec_btn_subm").attr("disabled", "disabled"), $("#rec_btn_subm").html("подождите..."), void $.ajax({
- type: "POST",
- url: "/password/send_recovery",
- dataType: "json",
- data: {
- username: $("#rec_inp_username").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- $("#rec_btn_subm").removeAttr("disabled"), $("#rec_btn_subm").html("ВоÑÑтановить пароль"), "ok" == e.status ? ($("#rec_form_result").html(e.message), $("#rec_form_result").show(), $("#rec_inp_username").val("")) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#rec_btn_subm").removeAttr("disabled"), $("#rec_btn_subm").html("ВоÑÑтановить пароль"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- }))
- }, Profile_settings.check_email = function() {
- $("#set_inp_email").removeClass("inp_success"), $("#set_inp_email").removeClass("inp_err");
- var e = new RegExp(/^[\w.-]+@([a-z0-9\-]+\.)+[a-z]{2,6}$/i);
- return e.test($("#set_inp_email").val()) ? void $.ajax({
- type: "GET",
- url: "/signup/check_email",
- dataType: "json",
- data: {
- email: $("#set_inp_email").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- "ok" == e.status ? (Profile.change_email_modal(), $("#set_inp_email").removeClass("inp_err"), $("#set_inp_email").addClass("inp_success")) : ($("#set_inp_email").addClass("inp_err"), $("#set_inp_email").focus(), Sprashivai.show_error(e.message))
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- }) : (Sprashivai.show_error("Укажите корректный email адреÑ"), $("#set_inp_email").addClass("inp_err"), $("#set_inp_email").focus(), !1)
- }, Profile.follow = function(e, t) {
- $(".btn_fol_med_" + e).children("button").attr("disabled", "disabled"), $(".btn_fol_big_" + e).children("button").attr("disabled", "disabled"), Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/" + e + "/follow",
- dataType: "json",
- data: {
- hash: t,
- sig: hash_follow(e, t)
- },
- timeout: 3e4,
- success: function(t, i, o) {
- Sprashivai.hide_center_loader(), $(".btn_fol_big_" + e).children("button").removeAttr("disabled"), $(".btn_fol_med_" + e).children("button").removeAttr("disabled"), "ok" == t.status ? ($(".btn_fol_med_" + e).html(t.btn_mini), $(".btn_fol_big_" + e).html(t.btn_big), Sprashivai.show_message("Ð’Ñ‹ подпиÑалиÑÑŒ на Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ @" + e)) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- Sprashivai.hide_center_loader(), $(".btn_fol_big_" + e).children("button").removeAttr("disabled"), $(".btn_fol_med_" + e).children("button").removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.unfollow = function(e, t) {
- $(".btn_fol_med_" + e).children("button").attr("disabled", "disabled"), $(".btn_fol_big_" + e).children("button").attr("disabled", "disabled"), Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/" + e + "/unfollow",
- dataType: "json",
- data: {
- hash: t,
- sig: hash_follow(e, t)
- },
- timeout: 3e4,
- success: function(t, i, o) {
- Sprashivai.hide_center_loader(), $(".btn_fol_med_" + e).children("button").removeAttr("disabled"), $(".btn_fol_big_" + e).children("button").removeAttr("disabled"), "ok" == t.status ? ($(".btn_fol_med_" + e).html(t.btn_mini), $(".btn_fol_big_" + e).html(t.btn_big), Sprashivai.show_message("Ð’Ñ‹ отпиÑалиÑÑŒ от Ð¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚ÐµÐ»Ñ @" + e)) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- Sprashivai.hide_center_loader(), $(".btn_fol_med_" + e).children("button").removeAttr("disabled"), $(".btn_fol_big_" + e).children("button").removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.make_gift = function(e, t) {
- $("#btn_gift_make").attr("disabled", "disabled"), $("#btn_gift_make").html("отправлÑем..."), $("#mdl_gift_error").hide(), $.ajax({
- type: "POST",
- url: "/" + e + "/gift/make",
- dataType: "json",
- data: {
- gift: $("#mdl_gift_selected_id").val(),
- privacy: $("#gift_anon_sel").val(),
- message: $("#mdl_gift_message").val(),
- hash: t
- },
- timeout: 3e4,
- success: function(t, i, o) {
- $("#btn_gift_make").html("Отправить"), $("#btn_gift_make").removeAttr("disabled"), "ok" == t.status ? ($(".self_balance").html(t.balance), $.magnificPopup.close(), Sprashivai.show_message("Ð’Ñ‹ отправили подарок Ð´Ð»Ñ @" + e), $("#pr_av_gft_cont").css("width", $("#pr_av_gft_cont").width() + 88 + "px"), $("#pr_av_gft_cont").prepend(t.gift_html), $("#pr_av_gft_cont").css("margin-left", "-92px"), $("#pr_av_gft_cont").velocity({
- marginLeft: "0px"
- }, {
- duration: 180,
- easing: "ease-out"
- })) : ($("#mdl_gift_error").html(t.message), $("#mdl_gift_error").show())
- },
- error: function(e, t) {
- $("#btn_gift_make").html("Отправить"), $("#btn_gift_make").removeAttr("disabled"), $("#mdl_gift_error").html("Произошла ошибка, попробуйте еще раз"), $("#mdl_gift_error").show()
- }
- })
- }, Profile.set_bg_fill = function(e) {
- $(".ui_bg").removeClass("ui_bg_selected"), $("#ui_bg_" + e).addClass("ui_bg_selected"), $("#ui_bg_fill").val(e), "cover" == e ? $("body").css("background-size", "cover") : $("body").css("background-size", "initial")
- }, Profile.find_friends = function() {
- social_linked && ($("#friends_result").html('<span class="gr_it">Ищем ваших друзей. ПожалуйÑта, подождите...</span>'), Sprashivai.show_center_loader("Ищем ваших друзей. ПожалуйÑта, подождите..."), $("#friends_result").load("/tools/find_friends/load", {}, function() {
- Sprashivai.hide_center_loader()
- }))
- }, Profile.fr_search_hide = function() {
- followed_hidden ? ($(".fr_srch_fld").show(), $("#fr_srch_hid_lnk").html("Ñкрыть добавленных"), followed_hidden = !1) : ($(".fr_srch_fld").hide(), $("#fr_srch_hid_lnk").html("показать добавленных"), followed_hidden = !0)
- }, Profile.hide_social = function(e) {
- Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/settings/social/hide",
- dataType: "json",
- data: {
- social: e
- },
- timeout: 3e4,
- success: function(t, i, o) {
- Sprashivai.hide_center_loader(), "ok" == t.status ? t.show ? ($("#social_hide_lnk_" + e).children("i").removeClass("spr_icon_eye_off"), $("#social_hide_lnk_" + e).children("i").addClass("spr_icon_eye"), $("#social_hide_lnk_" + e).attr("onclick", "Profile.hide_social('" + e + "'); return false;"), Sprashivai.show_message("Ð¡Ð¾Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ñеть отображаетÑÑ Ð½Ð° вашем профайле")) : ($("#social_hide_lnk_" + e).children("i").addClass("spr_icon_eye_off"), $("#social_hide_lnk_" + e).children("i").removeClass("spr_icon_eye"), $("#social_hide_lnk_" + e).attr("onclick", "Profile.show_social('" + e + "'); return false;"), Sprashivai.show_message("Ð¡Ð¾Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ñеть не отображаетÑÑ Ð½Ð° вашем профайле")) : Sprashivai.show_error(t.message)
- },
- error: function(e, t) {
- Sprashivai.hide_center_loader(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.show_social = function(e) {
- Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/settings/social/show",
- dataType: "json",
- data: {
- social: e
- },
- timeout: 3e4,
- success: function(t, i, o) {
- Sprashivai.hide_center_loader(), "ok" == t.status ? t.show ? ($("#social_hide_lnk_" + e).children("i").removeClass("spr_icon_eye_off"), $("#social_hide_lnk_" + e).children("i").addClass("spr_icon_eye"), $("#social_hide_lnk_" + e).attr("onclick", "Profile.hide_social('" + e + "'); return false;"), Sprashivai.show_message("Ð¡Ð¾Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ñеть отображаетÑÑ Ð½Ð° вашем профайле")) : ($("#social_hide_lnk_" + e).children("i").addClass("spr_icon_eye_off"), $("#social_hide_lnk_" + e).children("i").removeClass("spr_icon_eye"), $("#social_hide_lnk_" + e).attr("onclick", "Profile.show_social('" + e + "'); return false;"), Sprashivai.show_message("Ð¡Ð¾Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ñеть не отображаетÑÑ Ð½Ð° вашем профайле")) : Sprashivai.show_error(t.message)
- },
- error: function(e, t) {
- Sprashivai.hide_center_loader(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.upload_document = function() {
- $(".form_about_lyot").hide(), $(".doc_inp").removeClass("inp_err"), LIVR.Validator.defaultAutoTrim(!0);
- var e = new LIVR.Validator({
- login: ["required", "spr_login"],
- email: ["required", "email"],
- document: ["required"]
- });
- e.registerRules({
- spr_login: function() {
- return function(e) {
- if (void 0 !== e && null !== e && "" !== e) {
- var t = new RegExp(/^([a-zA-Z0-9_]{3,24}?)$/);
- return t.test(e) ? void 0 : "LOGIN_INCORRECT"
- }
- }
- }
- });
- var t = {
- login: $("#doc_inp_login").val(),
- email: $("#doc_inp_email").val(),
- document: $("#doc_inp_document").val()
- },
- i = e.validate(t);
- i ? ($("#password_document_form").submit(), $("#doc_btn_subm").html("подождите..."), $("#doc_btn_subm").attr("disabled", "disabled")) : ($.each(e.getErrors(), function(e, t) {
- $("#doc_inp_error_" + e).children(".form_error_bl").html(lang.errors[e][t]), $("#doc_inp_error_" + e).show(), $("#doc_inp_" + e).addClass("inp_err")
- }), console.log("errors", e.getErrors()))
- }, Profile.share_page = function() {
- $.magnificPopup.open({
- items: {
- src: "/modals/share"
- },
- type: "ajax",
- showCloseBtn: !1
- }, 0)
- }, Profile.open_sms_live_from_m = function() {
- $.magnificPopup.close(), setTimeout(function() {
- Profile.open_sms_live_dialog()
- }, 100)
- }, Profile.check_phone_pass = function() {
- $("#rec_ph_load").show(), $("#rec_ph_result").html(""), $.ajax({
- type: "POST",
- url: "/password/recovery_by_phone/check",
- dataType: "json",
- data: {
- country_code: $("#phone_country_code").val(),
- phone: $("#rec_ph_phone").val()
- },
- timeout: 3e4,
- success: function(e, t, i) {
- $("#rec_ph_load").hide(), "ok" == e.status ? $("#rec_ph_result").html(e.html) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#rec_ph_load").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Profile.hide_vk_notice = function() {
- $("#top_notice_vk").hide(), $.ajax({
- type: "POST",
- url: "/settings/social/hide_vk_notice",
- dataType: "json",
- timeout: 3e4
- })
- }, Profile.hide_fb_notice = function() {
- $("#top_notice_fb").hide(), $.ajax({
- type: "POST",
- url: "/settings/social/hide_fb_notice",
- dataType: "json",
- timeout: 3e4
- })
- }, Profile.delete_old_avatar = function(e) {
- $.ajax({
- type: "POST",
- url: "/profile/avatar/delete_old",
- dataType: "json",
- data: {
- avatar_id: e
- },
- timeout: 3e4,
- success: function(t, i, o) {
- "ok" == t.status ? $("#av_cell_" + e).hide() : Sprashivai.show_error(t.message)
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- };
- var likes_timeout;
- $(document).ready(function() {
- $(document).on("keyup", ".cmnt_txt_area", function() {
- var e = 4e3,
- t = e - $(this).val().length,
- i = $(this).attr("id").replace("cmnt_txt_", "");
- 0 > t && (t = 0, $(this).val($(this).val().substr(0, e))), 100 > t ? $("#cmnt_cntr_" + i).show() : $("#cmnt_cntr_" + i).hide(), 0 == $(this).val().length || 0 > t ? $("#cmnt_btn_" + i).attr("disabled", "disabled") : $("#cmnt_btn_" + i).removeAttr("disabled"), $("#cmnt_cntr_" + i).html(t)
- }), $("#ask_txt_layout").on("keyup", "#ask_txt_area", function() {
- var e = 800,
- t = e - $(this).val().length;
- 0 > t && (t = 0, $(this).val($(this).val().substr(0, e))), 100 > t ? $("#ask_cntr").show() : $("#ask_cntr").hide(), 0 == $(this).val().length || 0 > t ? $("#ask_btn").attr("disabled", "disabled") : $("#ask_btn").removeAttr("disabled"), 50 >= t ? $("#ask_cntr").addClass("cntr_red") : $("#ask_cntr").removeClass("cntr_red"), $("#ask_cntr").html(t)
- }), $(document).on("mouseenter", ".lk_exists", function() {
- var e = $(this).attr("rel");
- likes_timeout && clearTimeout(likes_timeout), $(".item_likes_lyot").not("#" + e).css("bottom", "25px"), $(".item_likes_lyot").not("#" + e).css("opacity", "0"), $(".item_likes_lyot").not("#" + e).css("visibility", "hidden"), $("#lks_" + e).css("bottom", "15px"), $("#lks_" + e).css("opacity", "1.0"), $("#lks_" + e).css("visibility", "visible")
- }), $(document).on("mouseenter", ".item_likes_lyot", function() {
- var e = $(this).attr("rel");
- likes_timeout && clearTimeout(likes_timeout), $(".item_likes_lyot").not("#" + e).css("bottom", "25px"), $(".item_likes_lyot").not("#" + e).css("opacity", "0"), $(".item_likes_lyot").not("#" + e).css("visibility", "hidden"), $("#lks_" + e).css("bottom", "15px"), $("#lks_" + e).css("opacity", "1.0"), $("#lks_" + e).css("visibility", "visible")
- }), $(document).on("mouseleave", ".lk_exists", function() {
- var e = $(this).attr("rel");
- likes_timeout = setTimeout('hide_lk("' + e + '")', 50)
- }), $(document).on("mouseleave", ".item_likes_lyot", function() {
- var e = $(this).attr("rel");
- likes_timeout = setTimeout('hide_lk("' + e + '")', 50)
- }), ("profile" == Sprashivai.page || "profile_self" == Sprashivai.page) && setTimeout(function() {
- Responses.check_new_responses(Sprashivai.profile_username)
- }, 3e4)
- }), window.Inbox || (window.Inbox = {}), Inbox.delete_all = function(e) {
- confirm("Ð’Ñ‹ дейÑтвительно хотите удалить ВСЕ новые вопроÑÑ‹? Ðто дейÑтвие Ð½ÐµÐ»ÑŒÐ·Ñ Ð¾Ñ‚Ð¼ÐµÐ½Ð¸Ñ‚ÑŒ!") && ($("#inbox_questions").css("opacity", "0.5"), $.ajax({
- type: "POST",
- url: "/inbox/delete/all",
- data: {
- hash: e,
- sig: hash_inbox_delete_all(e)
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e, t, i) {
- $("#inbox_questions").css("opacity", "1.0"), "ok" == e.status ? ($("#inbox_questions").html(""), $("#load-more-link").hide(), $("#nq_remain_text").html(e.nq_string), $("#top_nq_badge").html(""), $("#top_nq_badge").hide(), $(".nq_del_all").hide(), Sprashivai.show_message("Ð’Ñе вопроÑÑ‹ удалены")) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#inbox_questions").css("opacity", "1.0"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- }))
- }, Inbox.toggle_answer_form = function(e) {
- $("#answer_form_" + e).hasClass("opened") ? ($("#answer_form_" + e).velocity({
- maxHeight: "0",
- opacity: "0"
- }, {
- duration: 250,
- delay: 0,
- easing: "easeInSine"
- }), $("#answer_form_" + e).removeClass("opened")) : ($("#answer_form_" + e).velocity({
- maxHeight: "600px",
- opacity: "1.0"
- }, {
- duration: 250,
- delay: 0,
- easing: "easeInSine"
- }), $("#answer_form_" + e).addClass("opened"), $("#answer_txtar_" + e).caretToEnd())
- }, Inbox.load = function() {
- $("#load-more-link").hide(), $("#load-more-preloader").show(), $.ajax({
- type: "POST",
- url: "/inbox/load",
- data: {
- offset: inbox_offset
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), "ok" == e.status && ($(".toolt-na").tooltipster("destroy"), $("#inbox_questions").append(e.q_html), inbox_offset = e.q_offset, inbox_passed += e.q_passed, inbox_passed >= inbox_all && $("#load-more-link").hide(), $(".toolt-na").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow",
- offsetY: -12
- }))
- },
- error: function(e, t) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), Sprashivai.show_error("Произошла ошибка попробуйте еще раз")
- }
- })
- }, Inbox.remove = function(e, t) {
- $("#nq_it_" + e).css("opacity", "0.6"), $.ajax({
- type: "POST",
- url: "/inbox/delete",
- data: {
- question: e
- },
- dataType: "json",
- timeout: 15e3,
- success: function(t, i, o) {
- $("#nq_it_" + e).css("opacity", "1"), "ok" == t.status ? ($("#nq_it_" + e).velocity("slideUp", {
- delay: 0,
- duration: 150
- }), t.nq_count > 0 ? ($("#top_nq_badge").html(t.nq_count), $("#top_nq_badge").show()) : ($("#top_nq_badge").html(""), $("#top_nq_badge").hide()), Sprashivai.logged && (document.title = t.nq_count > 0 ? "(" + t.nq_count + ") " + Sprashivai.page_title : Sprashivai.page_title), $("#nq_remain_text").html(t.nq_string), Sprashivai.show_message("Ð’Ð¾Ð¿Ñ€Ð¾Ñ ÑƒÐ´Ð°Ð»ÐµÐ½")) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- $("#nq_it_" + e).css("opacity", "1"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Inbox.answer = function(e) {
- $("#answer_txtar_" + e).attr("disabled", "disabled"), $("#nq_btn_" + e).attr("disabled", "disabled"), $("#nq_btn_" + e).text("отвечаем"), $.ajax({
- type: "POST",
- url: "/inbox/answer",
- data: {
- question: e,
- media: $("#media_" + e).val(),
- answer: $("#answer_txtar_" + e).val()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(t) {
- "ok" == t.status ? (t.nq_count > 0 ? ($("#top_nq_badge").html(t.nq_count), $("#top_nq_badge").show()) : ($("#top_nq_badge").html(""), $("#top_nq_badge").hide()), $("#nq_it_" + e).velocity("slideUp", {
- delay: 0,
- duration: 150
- }), $("#nq_remain_text").html(t.nq_string), Sprashivai.show_message("Ответ добавлен на вашу Ñтраницу"), Sprashivai.logged && (document.title = t.nq_count > 0 ? "(" + t.nq_count + ") " + Sprashivai.page_title : Sprashivai.page_title)) : "error" == t.status && ($("#answer_txtar_" + e).removeAttr("disabled"), $("#nq_btn_" + e).removeAttr("disabled"), $("#nq_btn_" + e).text("Ответить"), Sprashivai.show_error(t.message))
- },
- error: function(t, i) {
- $("#answer_txtar_" + e).removeAttr("disabled"), $("#nq_btn_" + e).removeAttr("disabled"), $("#nq_btn_" + e).text("Ответить"), Sprashivai.show_error("Произошла ошибка попробуйте еще раз")
- }
- })
- }, Inbox.preview_media = function(e) {
- $.magnificPopup.open({
- items: {
- src: $("#nq_m_lnk_prev_" + e).attr("href"),
- type: "image"
- }
- })
- }, Inbox.clean_media = function(e) {
- $("#nq_cont_m_" + e).show(), $("#nq_m_upld_" + e).hide(), $("#media_" + e).val(""), 0 == $("#answer_txtar_" + e).val().length && $("#nq_btn_" + e).attr("disabled", "disabled")
- }, Inbox.init_media_uploader = function(e, t) {
- mOxie.Mime.addMimeType("image/jpeg,jpg jpeg");
- var i = new plupload.Uploader({
- runtimes: "html5,flash,silverlight",
- browse_button: "nq_btn_m_" + e,
- container: "nq_cont_m_" + e,
- multipart_params: {
- question_id: e,
- session: t
- },
- max_file_size: "10mb",
- url: "/question/media/attach",
- flash_swf_url: "http://st.sprashivai.net/10/251b77cbfd/uploader.swf",
- silverlight_xap_url: "http://st.sprashivai.net/10/2664b9ec17/uploader.xap",
- filters: [{
- title: "ИзображениÑ",
- extensions: "jpg,jpeg,gif,png"
- }],
- resize: {
- width: 800,
- height: 800,
- quality: 85
- }
- });
- i.init(), i.bind("FilesAdded", function(t, o) {
- var n = 1;
- t.files.length > n && t.splice(n), t.refresh(), i.start(), $("#nq_cont_m_" + e).hide(), $("#nq_pgrs_" + e).show()
- }), i.bind("UploadProgress", function(e, t) {
- $("#nq_m_pgrs_").css("width", t.percent + "%")
- }), i.bind("Error", function(t, i) {
- t.splice(0), $("#nq_cont_m_" + e).show(), $("#nq_pgrs_" + e).hide(), Sprashivai.show_error(i.message), t.refresh()
- }), i.bind("FileUploaded", function(t, i, o) {
- t.splice(0);
- try {
- resp = JSON.parse(o.response)
- } catch (n) {
- return Sprashivai.show_error("Произошла ошибка"), $("#nq_cont_m_" + e).show(), $("#nq_pgrs_" + e).hide(), void t.refresh()
- }
- resp.result ? ($("#nq_pgrs_" + e).hide(), $("#nq_m_preview_" + e).attr("src", resp.result), $("#nq_m_lnk_prev_" + e).attr("href", resp.media_big), $("#nq_m_upld_" + e).show(), $("#media_" + e).val(resp.media_id), $("#nq_btn_" + e).removeAttr("disabled"), t.refresh()) : resp.error ? ($("#nq_cont_m_" + e).show(), $("#nq_pgrs_" + e).hide(), Sprashivai.show_error(resp.error.message), t.refresh()) : ($("#nq_cont_m_" + e).show(), $("#nq_pgrs_" + e).hide(), Sprashivai.show_error("Произошла ошибка"), t.refresh())
- })
- }, $(document).ready(function() {
- "inbox" == Sprashivai.page && ($(".nq_txt_area_lyot").on("keydown", ".antxtar", function(e) {
- if ((e.metaKey || e.ctrlKey) && 13 == e.keyCode) {
- e.preventDefault();
- var t = $(this).attr("id").replace("answer_txtar_", "");
- return Inbox.answer(t), !1
- }
- return !0
- }), $(document).on("keyup", ".antxtar", function() {
- var e = $(this).attr("id").replace("answer_txtar_", ""),
- t = answer_limit - $(this).val().length;
- t = 0 > t ? 0 : t, $(this).val().length < 2 && "" == $("#media_" + e).val() ? $("#nq_btn_" + e).attr("disabled", "disabled") : $("#nq_btn_" + e).removeAttr("disabled"), $("#nq_cntr_" + e).html(t), 5 >= t ? ($("#nq_cntr_" + e).html("ТолÑтой, перелогиньтеÑÑŒ!"), $("#nq_cntr_" + e).show()) : 300 >= t ? $("#nq_cntr_" + e).show() : $("#nq_cntr_" + e).hide(), 50 >= t ? $("#nq_cntr_" + e).addClass("cntr_red") : $("#nq_cntr_" + e).removeClass("cntr_red"), $(this).val($(this).val().substring(0, answer_limit))
- }))
- }), window.Responses || (window.Responses = {}), Responses.load = function(e) {
- $("#load-more-link").hide(), $("#load-more-preloader").show(), $.ajax({
- type: "POST",
- url: "/responses/load",
- data: {
- username: e,
- offset: profile_responses_offset
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e, t, i) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), "ok" == e.status ? ($(".toolt-n").tooltipster("destroy"), $(".toolt-na").tooltipster("destroy"), $("#user_responses").append(e.q_html), profile_responses_offset = e.q_offset, profile_responses_passed += e.q_passed, profile_responses_passed >= profile_responses_all && $("#load-more-link").hide(), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- }), $(".toolt-na").tooltipster({
- delay: 100,
- position: "top",
- animation: "grow",
- offsetY: -12
- }), Sprashivai.odometer(), Sprashivai.ichecks()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Responses.like = function(e, t) {
- $.ajax({
- type: "POST",
- url: "/response/like",
- data: {
- question: e,
- hash: t,
- sig: hash_like(t, e)
- },
- dataType: "json",
- timeout: 15e3,
- success: function(t, i, o) {
- "ok" == t.status ? ($("#lk_cntr_" + e).text(t.likes_f.replace(" ", "")), $("#lk_title_" + e).html(t.lk_us_title), 1 == t.action ? ($("#lk_link_" + e).addClass("liked"), $("#lk_av_cont_" + e).addClass("lk_av_ln_liked")) : ($("#lk_link_" + e).removeClass("liked"), $("#lk_av_cont_" + e).removeClass("lk_av_ln_liked")), t.likes > 0 ? ($("#lk_link_" + e).addClass("lk_exists"),
- $("#lks_" + e).css("bottom", "15px"), $("#lks_" + e).css("opacity", "1.0"), $("#lks_" + e).css("visibility", "visible")) : ($("#lk_link_" + e).removeClass("lk_exists"), $("#lks_" + e).css("bottom", "25px"), $("#lks_" + e).css("opacity", "0"), $("#lks_" + e).css("visibility", "hidden"))) : Sprashivai.show_error(t.message)
- },
- error: function(e, t) {
- Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- };
- var blurred = !1;
- Responses.show_comment_form = function(e, t) {
- return console.log("show_comment_form force " + t), blurred && !t ? void(blurred = !1) : void($("#cmnt_form_" + e).is(":visible") ? ($("#cmnt_quick_inp_" + e).show(), $("#cmnt_form_" + e).hide()) : ($("#cmnt_quick_inp_" + e).hide(), $("#cmnt_form_" + e).show(), $("#cmnt_txt_" + e).caretToEnd()))
- }, Responses.report_question = function(e) {
- $.magnificPopup.open({
- items: {
- src: "/modals/report_response?question_id=" + e
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !0
- }, 0)
- }, Inbox.report_question = function(e) {
- $("#btn_report_question_" + e).html("подождите..."), $("#btn_report_question_" + e).attr("disabled", "disabled");
- var t = $("#add_to_black_list").is(":checked") ? "true" : "false";
- $.ajax({
- type: "POST",
- url: "/question/report",
- data: {
- question_id: e,
- bl: t,
- reason: $("input[name=report_reason]:checked", "#report_question_form").val()
- },
- dataType: "json",
- timeout: 15e3,
- success: function(t, i, o) {
- $("#btn_report_question_" + e).html("ПожаловатьÑÑ"), $("#btn_report_question_" + e).removeAttr("disabled"), "ok" == t.status ? ($.magnificPopup.close(), $("#nq_it_" + e).velocity("slideUp", {
- delay: 0,
- duration: 150
- }), Sprashivai.show_message("Жалоба отправлена")) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- $("#btn_report_question_" + e).html("ПожаловатьÑÑ"), $("#btn_report_question_" + e).removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Responses.show_delete_form = function(e) {
- $.magnificPopup.open({
- items: {
- src: "/modals/response/remove?response_id=" + e
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !0
- }, 0)
- }, Responses.comment = function(e, t) {
- if (0 == $("#cmnt_txt_" + e).val().length) return Sprashivai.show_error("Введите текÑÑ‚ комментариÑ"), !1;
- $("#cmnt_btn_" + e).attr("disabled", "disabled"), $("#cmnt_btn_" + e).html("комментируем...");
- var i = $("#cmnt_check_" + e).is(":checked") ? "true" : "false";
- $.ajax({
- type: "POST",
- url: "/response/comment",
- data: {
- response: e,
- comment: $("#cmnt_txt_" + e).val(),
- anonymously: i,
- hash: t,
- sig: hash_comment(t, e)
- },
- dataType: "json",
- timeout: 15e3,
- success: function(t, i, o) {
- $("#cmnt_btn_" + e).removeAttr("disabled"), $("#cmnt_btn_" + e).html("Комментировать"), "ok" == t.status ? ($("#comments_" + e).append(t.html), $("#cmnt_txt_" + e).val(""), $("#cmnt_btn_" + e).attr("disabled", "disabled"), $("#cmnt_cntr_" + e).hide()) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- $("#cmnt_btn_" + e).removeAttr("disabled"), $("#cmnt_btn_" + e).html("Комментировать"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Responses.comment_delete = function(e, t) {
- $("#cmnt_lyt_" + e).css("opacity", "0.6"), $.ajax({
- type: "POST",
- url: "/comment/delete",
- data: {
- comment: e,
- hash: t,
- sig: hash_comment_delete(t, e)
- },
- dataType: "json",
- timeout: 15e3,
- success: function(t, i, o) {
- $("#cmnt_lyt_" + e).css("opacity", "1"), "ok" == t.status ? $("#cmnt_lyt_" + e).html(t.html) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- $("#cmnt_lyt_" + e).css("opacity", "1"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Responses.comment_restore = function(e, t) {
- $("#cmnt_lyt_" + e).css("opacity", "0.6"), $.ajax({
- type: "POST",
- url: "/comment/restore",
- data: {
- comment: e,
- hash: t,
- sig: hash_comment(t, e)
- },
- dataType: "json",
- timeout: 15e3,
- success: function(t, i, o) {
- $("#cmnt_lyt_" + e).css("opacity", "1"), "ok" == t.status ? ($(".toolt-n").tooltipster("destroy"), $(".toolt-na").tooltipster("destroy"), $("#cmnt_lyt_" + e).html(t.html), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- }), $(".toolt-na").tooltipster({
- delay: 100,
- position: "top",
- animation: "grow",
- offsetY: -12
- })) : Sprashivai.show_error(t.message)
- },
- error: function(t, i) {
- $("#cmnt_lyt_" + e).css("opacity", "1"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Responses.show_likes = function(e) {
- $.magnificPopup.open({
- items: {
- src: "/modals/likes/" + e
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !0
- }, 0)
- }, Responses.comments_load = function(e, t) {
- $("#comments-all-" + e).hide(), $("#comments_loader_" + e).show(), $.ajax({
- type: "POST",
- url: "/response/comments",
- data: {
- response: e,
- offset: t
- },
- dataType: "json",
- timeout: 15e3,
- success: function(t, i, o) {
- "ok" == t.status ? ($("#comments-all-" + e).hide(), $("#comments_loader_" + e).hide(), $(".toolt-n").tooltipster("destroy"), $(".toolt-na").tooltipster("destroy"), $("#resp_cmnt_" + e).prepend(t.html), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- }), $(".toolt-na").tooltipster({
- delay: 100,
- position: "top",
- animation: "grow",
- offsetY: -12
- })) : ($("#comments-all-" + e).show(), $("#comments_loader_" + e).hide(), Sprashivai.show_error(t.message))
- },
- error: function(t, i) {
- $("#comments-all-" + e).show(), $("#comments_loader_" + e).hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Responses.ask_error = function() {
- $("#ask_form_layout").addClass("wrong"), $("#ask_form_layout").on("animationend", function(e) {
- $(this).removeClass("wrong")
- })
- }, Responses.check_new_responses = function(e) {
- $.ajax({
- type: "POST",
- url: "/responses/load/new",
- data: {
- username: e,
- offset: profile_new_load_offset
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e, t, i) {
- "ok" == e.status && ($("#pr_responses_badge").html(e.q_resp_txt), e.q_passed > 0 && ($("#pr_new_resp_tmp").prepend(e.q_html), profile_new_load_offset = e.q_offset, profile_new_loaded_responses += e.q_passed, $("#pr_new_resp_load_show_lnk").html("Показать " + decl_of_num(profile_new_loaded_responses, ["новый ответ", "новых ответа", "новых ответов"])), $("#pr_new_resp_load_show").show()), Sprashivai.logged && (document.title = e.inbox_questions > 0 ? "(" + e.inbox_questions + ") " + Sprashivai.page_title : Sprashivai.page_title)), setTimeout(function() {
- Responses.check_new_responses(Sprashivai.profile_username)
- }, 3e4)
- },
- error: function(e, t) {
- setTimeout(function() {
- Responses.check_new_responses(Sprashivai.profile_username)
- }, 3e4)
- }
- })
- }, Responses.show_new_responses = function() {
- profile_new_loaded_responses = 0, $(".toolt-n").filter(function() {
- return $(this).data("tooltipsterNs")
- }).tooltipster("destroy"), $(".toolt-na").filter(function() {
- return $(this).data("tooltipsterNs")
- }).tooltipster("destroy"), $("#user_responses").prepend($("#pr_new_resp_tmp").html()), $("#pr_new_resp_tmp").html(""), $("#pr_new_resp_load_show").hide(), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- }), $(".toolt-na").tooltipster({
- delay: 100,
- position: "top",
- animation: "grow",
- offsetY: -12
- }), Sprashivai.odometer(), Sprashivai.ichecks()
- }, Responses.reask = function() {
- $("#ask_sent").hide(), $("#ask_layout").show(), $("#ask_txt_area").focus()
- }, Responses.remove = function(e) {
- $("#btn_resp_remove_" + e).html("удалÑем"), $("#btn_resp_remove_" + e).attr("disabled", "disabled"), $.ajax({
- type: "POST",
- url: "/response/remove",
- data: {
- response: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(t, i, o) {
- $("#btn_resp_remove_" + e).html("Удалить"), $("#btn_resp_remove_" + e).removeAttr("disabled"), "ok" == t.status ? ($.magnificPopup.close(), $("#response_item_" + e).velocity("slideUp", {
- delay: 0,
- duration: 150
- }), $("#top_nq_badge").html(t.inbox), $("#pr_responses_badge").html(t.responses_f), t.inbox > 0 ? $("#top_nq_badge").show() : $("#top_nq_badge").hide(), Sprashivai.logged && (document.title = t.inbox > 0 ? "(" + t.inbox + ") " + Sprashivai.page_title : Sprashivai.page_title), t.responses > 0 ? $("#pr_responses_badge").show() : $("#pr_responses_badge").hide()) : Sprashivai.show_error("error" == t.status ? t.message : "Произошла ошибка, попробуйте еще раз")
- },
- error: function(t, i) {
- $("#btn_resp_remove_" + e).html("Удалить"), $("#btn_resp_remove_" + e).removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Responses.ask = function(e, t) {
- $("#ask_btn").attr("disabled", "disabled"), $("#ask_btn").html("Ñпрашиваем"), $("#ask_txt_area").attr("disabled", "disabled");
- var i = $("#ask_anonymously").is(":checked") ? "yes" : "no";
- $.ajax({
- type: "POST",
- url: "/question/ask",
- data: {
- username: e,
- anonymously: i,
- question: $("#ask_txt_area").val(),
- hash: t,
- sig: hash_ask(e, t)
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e, t, i) {
- $("#ask_btn").removeAttr("disabled"), $("#ask_btn").html("СпроÑить"), $("#ask_txt_area").removeAttr("disabled"), "ok" == e.status ? ($("#ask_sent").show(), $("#ask_layout").hide(), $("#ask_txt_area").val("")) : "error" == e.status ? (Sprashivai.show_error(e.message), Responses.ask_error()) : (Sprashivai.show_error("Произошла ошибка, попробуйте еще раз"), Responses.ask_error())
- },
- error: function(e, t) {
- $("#ask_btn").removeAttr("disabled"), $("#ask_btn").html("СпроÑить"), $("#ask_txt_area").removeAttr("disabled"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз"), Responses.ask_error()
- }
- })
- }, Responses.hide_response = function(e) {
- $("#response_item_" + e).css("opacity", "0.5"), $.ajax({
- type: "POST",
- url: "/response/hide",
- data: {
- question: e
- },
- dataType: "json",
- timeout: 3e4,
- success: function(t, i, o) {
- "ok" == t.status ? ($("#response_item_" + e).velocity("slideUp", {
- delay: 0,
- duration: 150
- }), Sprashivai.show_message("Ответ Ñкрыт")) : "error" == t.status ? (Sprashivai.show_error(t.message), $("#response_item_" + e).css("opacity", "1")) : (Sprashivai.show_error("Произошла ошибка, попробуйте еще раз"), $("#response_item_" + e).css("opacity", "1"))
- },
- error: function(t, i) {
- $("#response_item_" + e).css("opacity", "1"), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, window.Gifts || (window.Gifts = {}), Gifts.move_right = function(e) {
- var t = parseInt($("#gft_cur_" + e).val()),
- i = parseInt($("#gft_sec_" + e).val());
- if (i > t) {
- t++;
- var o = 40 - 525 * (t - 1);
- $("#gft_cur_" + e).val(t), $("#mdl_gift_lt_" + e).velocity({
- marginLeft: o.toString() + "px"
- }, {
- duration: 350,
- easing: "easeInSine"
- })
- }
- t == i && $("#gft_ar_r_" + e).hide(), t > 1 && $("#gft_ar_l_" + e).show()
- }, Gifts.move_left = function(e) {
- var t = parseInt($("#gft_cur_" + e).val()),
- i = parseInt($("#gft_sec_" + e).val());
- if (t > 1) {
- t--;
- var o = 1 == t ? 20 : 40 - 525 * (t - 1);
- $("#gft_cur_" + e).val(t), $("#mdl_gift_lt_" + e).velocity({
- marginLeft: o.toString() + "px"
- }, {
- duration: 350,
- easing: "easeInSine"
- })
- }
- 1 == t && $("#gft_ar_l_" + e).hide(), i > t && $("#gft_ar_r_" + e).show()
- }, Gifts.close_modal = function() {
- "select" == window.gift_current_view ? $.magnificPopup.close() : "selected" == window.gift_current_view && ($("#mdl_gift_selected").hide(), $("#mdl_gifts_lyt").show(), $(".mdl_gift").css("width", "600px"), window.gift_current_view = "select")
- }, Gifts.select_gift = function(e, t, i, o) {
- $("#mdl_gift_selected_img").attr("src", i), $("#mdl_gift_selected_img").attr("src", t), $("#mdl_gift_selected").show(), $("#mdl_gifts_lyt").hide(), $(".mdl_gift").css("width", "400px"), $("#mdl_gift_selected_id").val(e), window.gift_current_view = "selected"
- }, window.Payments || (window.Payments = {}), Payments.select_method = function(e) {
- return "in_work" == payments_state ? !1 : void("" == e ? ($("#payments_methods").show(), $(".pmnt_methd").hide(), payments_state = "main", $("#payments_close_link").html("Закрыть")) : ($("#payments_methods").hide(), $(".pmnt_methd").hide(), $("#payments_" + e).show(), payments_state = "payment_method", $("#payments_close_link").html("Ðазад")))
- }, Payments.pay_card = function() {
- payments_state = "in_work";
- var e = $("input[name=bank_card_votes]:checked", "#pmnt_form_bank_card").val(),
- t = 0;
- t = parseInt("custom" == e ? $("#bank_card_votes").val() : e), $("#btn_pmnt_bank_cards").html("подождите..."), $("#btn_pmnt_bank_cards").attr("disabled", "disabled"), $.ajax({
- type: "POST",
- url: "/payments/create",
- data: {
- votes: t
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- "ok" == e.status ? ($("#pmnt_pay_form_payment_type").val("AC"), $("#pmnt_pay_form_sum").val(e.amount), $("#pmnt_pay_form_order_number").val(e.order_id), $("#pay_form").submit()) : (payments_state = "payment_method", $("#btn_pmnt_bank_cards").html("Получить голоÑа"), $("#btn_pmnt_bank_cards").removeAttr("disabled"), $("#pmnt_bank_card_error").html(e.message), $("#pmnt_bank_card_error").show())
- },
- error: function(e, t) {
- payments_state = "payment_method", $("#pmnt_bank_card_error").html("Произошла ошибка, попробуйте еще раз"), $("#pmnt_bank_card_error").show(), $("#btn_pmnt_bank_cards").html("Получить голоÑа"), $("#btn_pmnt_bank_cards").removeAttr("disabled")
- }
- })
- }, Payments.pay_ewallet = function() {
- payments_state = "in_work";
- var e = $("input[name=bank_card_votes]:checked", "#pmnt_form_ewallet").val(),
- t = 0;
- t = parseInt("custom" == e ? $("#ewallet_votes").val() : e), $("#btn_pmnt_ewallet").html("подождите..."), $("#btn_pmnt_ewallet").attr("disabled", "disabled"), $("#pmnt_wallet_error").hide(), $.ajax({
- type: "POST",
- url: "/payments/create",
- data: {
- votes: t
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- if ("ok" == e.status) {
- var t = "PC";
- "yandex" == $("input[name=ewallet_type]:checked", "#pmnt_form_ewallet").val() ? t = "PC" : "webmoney" == $("input[name=ewallet_type]:checked", "#pmnt_form_ewallet").val() && (t = "WM"), $("#pmnt_pay_form_payment_type").val(t), $("#pmnt_pay_form_sum").val(e.amount), $("#pmnt_pay_form_order_number").val(e.order_id), $("#pay_form").submit()
- } else payments_state = "payment_method", $("#btn_pmnt_ewallet").html("Получить голоÑа"), $("#btn_pmnt_ewallet").removeAttr("disabled"), $("#pmnt_wallet_error").html(e.message), $("#pmnt_wallet_error").show()
- },
- error: function(e, t) {
- payments_state = "payment_method", $("#btn_pmnt_ewallet").html("Получить голоÑа"), $("#btn_pmnt_ewallet").removeAttr("disabled"), $("#pmnt_wallet_error").html("Произошла ошибка, попробуйте еще раз"), $("#pmnt_wallet_error").show()
- }
- })
- }, Payments.set_ppc_votes = function(e) {
- $(".ppc_link").removeClass("ppc_link_active"), $("#ppc_votes_link_" + e).addClass("ppc_link_active"), $("#ppc_votes").val(e)
- }, Payments.ppc_change_phone = function() {
- Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), $.ajax({
- type: "POST",
- url: "/pay_per_click/unlink",
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- Sprashivai.hide_center_loader(), "ok" == e.status ? ($("#ppc_confirm_phone").hide(), $("#ppc_phone_linked").hide(), $("#ppc_link_phone").show(), $("#ppc_phone_input").focus()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- Sprashivai.show_center_loader("ПожалуйÑта, подождите..."), Sprashivai.show_error(response.message)
- }
- })
- }, Payments.ppc_link = function() {
- $("#btn_pmnt_ppc_phone").html("подождите..."), $("#btn_pmnt_ppc_phone").attr("disabled", "disabled"), $("#pmnt_ppc_link_error").hide(), payments_state = "in_work", $.ajax({
- type: "POST",
- url: "/pay_per_click/link",
- data: {
- phone: $("#ppc_phone_input").val()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- payments_state = "payment_method", "ok" == e.status ? ($("#ppc_link_phone").hide(), $("#ppc_confirm_phone").show(), $("#ppc_phone_code_input").focus(), $("#ppc_phone_number").html(e.phone_html), $("#ppc_phone_to_confirm").val(e.phone)) : ($("#btn_pmnt_ppc_phone").html("Получить голоÑа"), $("#btn_pmnt_ppc_phone").removeAttr("disabled"), $("#pmnt_ppc_link_error").html(e.message), $("#pmnt_ppc_link_error").show())
- },
- error: function(e, t) {
- payments_state = "payment_method", $("#btn_pmnt_ppc_phone").html("Получить голоÑа"), $("#btn_pmnt_ppc_phone").removeAttr("disabled"), $("#pmnt_ppc_link_error").html("Произошла ошибка, попробуйте еще раз"), $("#pmnt_ppc_link_error").show()
- }
- })
- }, Payments.ppc_confirm = function() {
- $("#btn_pmnt_ppc_confirm").html("подождите..."), $("#btn_pmnt_ppc_confirm").attr("disabled", "disabled"), $("#pmnt_ppc_confirm_error").hide(), payments_state = "in_work", $.ajax({
- type: "POST",
- url: "/pay_per_click/check",
- data: {
- votes: $("#ppc_votes").val(),
- code: $("#ppc_phone_code_input").val(),
- phone: $("#ppc_phone_to_confirm").val()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- payments_state = "payment_method", "ok" == e.status ? ($("#ppc_confirm_phone").hide(), $("#ppc_sent").show(), $("#ppc_votes_block").hide()) : ($("#btn_pmnt_ppc_confirm").html("Подтвердить и получить голоÑа"), $("#btn_pmnt_ppc_confirm").removeAttr("disabled"), $("#pmnt_ppc_confirm_error").html(e.message), $("#pmnt_ppc_confirm_error").show())
- },
- error: function(e, t) {
- payments_state = "payment_method", $("#btn_pmnt_ppc_confirm").html("Подтвердить и получить голоÑа"), $("#btn_pmnt_ppc_confirm").removeAttr("disabled"), $("#pmnt_ppc_confirm_error").html("Произошла ошибка, попробуйте еще раз"), $("#pmnt_ppc_confirm_error").show()
- }
- })
- }, Payments.ppc_new_payment = function() {
- $("#ppc_sent").hide(), $("#ppc_votes_block").show(), $("#ppc_phone_linked").show()
- }, Payments.pay_ppc = function() {
- $("#btn_pmnt_ppc_pay").html("подождите..."), $("#btn_pmnt_ppc_pay").attr("disabled", "disabled"), $("#pmnt_ppc_pay_error").hide(), payments_state = "in_work", $.ajax({
- type: "POST",
- url: "/pay_per_click/pay",
- data: {
- votes: $("#ppc_votes").val()
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e) {
- payments_state = "payment_method", $("#btn_pmnt_ppc_pay").html("Получить голоÑа"), $("#btn_pmnt_ppc_pay").removeAttr("disabled"), "ok" == e.status ? ($("#ppc_phone_linked").hide(), $("#ppc_sent").show(), $("#ppc_votes_block").hide()) : ($("#pmnt_ppc_pay_error").html(e.message), $("#pmnt_ppc_pay_error").show())
- },
- error: function(e, t) {
- payments_state = "payment_method", $("#btn_pmnt_ppc_pay").html("Получить голоÑа"), $("#btn_pmnt_ppc_pay").removeAttr("disabled"), $("#pmnt_ppc_pay_error").html("Произошла ошибка, попробуйте еще раз"), $("#pmnt_ppc_pay_error").show()
- }
- })
- }, Payments.close_window = function() {
- return "in_work" == payments_state ? (alert("Ваша оплата в процеÑÑе, дождитеÑÑŒ результата, прежде чем закрыть Ñто окно"), !1) : "payment_method" == payments_state ? (Payments.select_method(""), !0) : void $.magnificPopup.close()
- }, Payments.select_country = function(e) {
- $(".tab_link").removeClass("tab_link_active"), $("#pmnt_country_link_" + e).addClass("tab_link_active"), $(".pmnt_country").hide(), $("#pmnt_country_" + e).show()
- }, Payments.toggle_sms_live_rules = function() {
- $("#sms_live_rules").is(":visible") ? ($("#sms_live_rules_link").html("Показать подробноÑти"), $("#sms_live_rules").hide()) : ($("#sms_live_rules_link").html("Скрыть подробноÑти"), $("#sms_live_rules").show())
- }, Payments.up_balance_from_m = function() {
- $.magnificPopup.close(), setTimeout(function() {
- Sprashivai.open_payments()
- }, 100)
- }, window.Feed || (window.Feed = {}), Feed.load = function() {
- $("#load-more-link").hide(), $("#load-more-preloader").show(), $.ajax({
- type: "POST",
- url: "/feed/load",
- data: {
- offset: feed_offset
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e, t, i) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), "ok" == e.status ? ($(".toolt-n").tooltipster("destroy"), $(".toolt-na").tooltipster("destroy"), $("#feed_items").append(e.q_html), feed_offset = e.q_offset, feed_passed += e.q_passed, feed_passed >= feed_all && $("#load-more-link").hide(), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- }), $(".toolt-na").tooltipster({
- delay: 100,
- position: "top",
- animation: "grow",
- offsetY: -12
- }), Sprashivai.odometer(), Sprashivai.ichecks()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, Feed.load_my = function() {
- $("#load-more-link").hide(), $("#load-more-preloader").show(), $.ajax({
- type: "POST",
- url: "/feed/my/load",
- data: {
- offset: feed_offset
- },
- dataType: "json",
- timeout: 3e4,
- success: function(e, t, i) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), "ok" == e.status ? ($(".toolt-n").tooltipster("destroy"), $(".toolt-na").tooltipster("destroy"), $("#feed_my").append(e.html), feed_offset = e.offset, feed_passed += e.passed, feed_passed >= feed_all && $("#load-more-link").hide(), $(".toolt-n").tooltipster({
- delay: 0,
- position: "top",
- animation: "grow"
- }), $(".toolt-na").tooltipster({
- delay: 100,
- position: "top",
- animation: "grow",
- offsetY: -12
- }), Sprashivai.odometer(), Sprashivai.ichecks()) : Sprashivai.show_error(e.message)
- },
- error: function(e, t) {
- $("#load-more-link").show(), $("#load-more-preloader").hide(), Sprashivai.show_error("Произошла ошибка, попробуйте еще раз")
- }
- })
- }, window.Partners || (window.Partners = {}), Partners.open_podari_zhizn_popup = function() {
- $.magnificPopup.open({
- items: {
- src: "/partners/podari_zhizn/popup"
- },
- type: "ajax",
- showCloseBtn: !1,
- closeOnBgClick: !1
- }, 0)
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement