Skip to content

Instantly share code, notes, and snippets.

@gwillem
Created April 7, 2017 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwillem/8e0203e57e53ab977bdbf975a4ba1d03 to your computer and use it in GitHub Desktop.
Save gwillem/8e0203e57e53ab977bdbf975a4ba1d03 to your computer and use it in GitHub Desktop.
function loadReports() {
$.post("/home/getReports", {
page: 1
}, function(n) {
document.pageNumber = 1;
document.additionalNumber = 1;
viewReports(n)
});
$.post("/home/getServers", function(n) {
viewServers(n)
});
$.post("/home/GetCountGoodLastDay", function(n) {
$("#goodLastDay").text(n)
});
$.post("/home/GetCountServerLastDay", function(n) {
$("#serverLastDay").text(n)
});
$.post("/home/GetCountSuccessLastDay", function(n) {
$("#successLastDay").text(n)
})
}
function viewReports(n) {
var u = /(https?:\/\/?[\da-z\.-]+\.[a-z\.]{2,6}[\/\w \.?=-]+)*\s/,
t, i, r;
$.each(n.reports, function(n, t) {
t.Log = t.Log.replace(u, "<a href='$1' target='_blank'>$1<\/a> ")
});
t = $("#reportsTemplate").html();
i = Mustache.to_html(t, n);
$("#forReportsTpl").html(i);
r = $(".js-switch");
$.each(r, function(n, t) {
var i = new Switchery(t, {
size: "small"
})
});
$("#fountainG").hide()
}
function viewServers(n) {
var t = $("#serversTemplate").html(),
i = Mustache.to_html(t, n);
$("#forServersTpl").html(i)
}
function showNotify() {
$("#notify").show();
setTimeout(function() {
$("#notify").hide()
}, 3e3)
}
function showError() {
$("#errorNotify").show();
setTimeout(function() {
$("#errorNotify").hide()
}, 3e3)
}
if (function(n, t) {
typeof exports == "object" && exports && typeof exports.nodeName != "string" ? t(exports) : typeof define == "function" && define.amd ? define(["exports"], t) : (n.Mustache = {}, t(n.Mustache))
}(this, function(n) {
function f(n) {
return typeof n == "function"
}
function l(n) {
return u(n) ? "array" : typeof n
}
function o(n) {
return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
}
function s(n, t) {
return n != null && typeof n == "object" && t in n
}
function v(n, t) {
return a.call(n, t)
}
function p(n) {
return !v(y, n)
}
function b(n) {
return String(n).replace(/[&<>"'`=\/]/g, function(n) {
return w[n]
})
}
function tt(t, i) {
function lt() {
if (ft && !w)
while (y.length) delete a[y.pop()];
else y = [];
ft = !1;
w = !1
}
function ht(n) {
if (typeof n == "string" && (n = n.split(d, 2)), !u(n) || n.length !== 2) throw new Error("Invalid tags: " + n);
et = new RegExp(o(n[0]) + "\\s*");
v = new RegExp("\\s*" + o(n[1]));
st = new RegExp("\\s*" + o("}" + n[1]))
}
var et, v, st, f, c, e, s, b, ot, l, tt, ct;
if (!t) return [];
var ut = [],
a = [],
y = [],
ft = !1,
w = !1;
for (ht(i || n.tags), f = new r(t); !f.eos();) {
if (c = f.pos, s = f.scanUntil(et), s)
for (tt = 0, ct = s.length; tt < ct; ++tt) b = s.charAt(tt), p(b) ? y.push(a.length) : w = !0, a.push(["text", b, c, c + 1]), c += 1, b === "\n" && lt();
if (!f.scan(et)) break;
if (ft = !0, e = f.scan(nt) || "name", f.scan(k), e === "=" ? (s = f.scanUntil(h), f.scan(h), f.scanUntil(v)) : e === "{" ? (s = f.scanUntil(st), f.scan(g), f.scanUntil(v), e = "&") : s = f.scanUntil(v), !f.scan(v)) throw new Error("Unclosed tag at " + f.pos);
if (ot = [e, s, c, f.pos], a.push(ot), e === "#" || e === "^") ut.push(ot);
else if (e === "/") {
if (l = ut.pop(), !l) throw new Error('Unopened section "' + s + '" at ' + c);
if (l[1] !== s) throw new Error('Unclosed section "' + l[1] + '" at ' + c);
} else e === "name" || e === "{" || e === "&" ? w = !0 : e === "=" && ht(s)
}
if (l = ut.pop(), l) throw new Error('Unclosed section "' + l[1] + '" at ' + f.pos);
return rt(it(a))
}
function it(n) {
for (var u = [], t, i, r = 0, f = n.length; r < f; ++r) t = n[r], t && (t[0] === "text" && i && i[0] === "text" ? (i[1] += t[1], i[3] = t[3]) : (u.push(t), i = t));
return u
}
function rt(n) {
for (var f = [], r = f, i = [], t, e, u = 0, o = n.length; u < o; ++u) {
t = n[u];
switch (t[0]) {
case "#":
case "^":
r.push(t);
i.push(t);
r = t[4] = [];
break;
case "/":
e = i.pop();
e[5] = t[2];
r = i.length > 0 ? i[i.length - 1][4] : f;
break;
default:
r.push(t)
}
}
return f
}
function r(n) {
this.string = n;
this.tail = n;
this.pos = 0
}
function i(n, t) {
this.view = n;
this.cache = {
".": this.view
};
this.parent = t
}
function t() {
this.cache = {}
}
var c = Object.prototype.toString,
u = Array.isArray || function(n) {
return c.call(n) === "[object Array]"
},
a = RegExp.prototype.test,
y = /\S/,
w = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#39;",
"/": "&#x2F;",
"`": "&#x60;",
"=": "&#x3D;"
},
k = /\s*/,
d = /\s+/,
h = /\s*=/,
g = /\s*\}/,
nt = /#|\^|\/|>|\{|&|=|!/,
e;
r.prototype.eos = function() {
return this.tail === ""
};
r.prototype.scan = function(n) {
var i = this.tail.match(n),
t;
return !i || i.index !== 0 ? "" : (t = i[0], this.tail = this.tail.substring(t.length), this.pos += t.length, t)
};
r.prototype.scanUntil = function(n) {
var i = this.tail.search(n),
t;
switch (i) {
case -1:
t = this.tail;
this.tail = "";
break;
case 0:
t = "";
break;
default:
t = this.tail.substring(0, i);
this.tail = this.tail.substring(i)
}
return this.pos += t.length, t
};
i.prototype.push = function(n) {
return new i(n, this)
};
i.prototype.lookup = function(n) {
var o = this.cache,
t, i, r, u, e;
if (o.hasOwnProperty(n)) t = o[n];
else {
for (i = this, e = !1; i;) {
if (n.indexOf(".") > 0)
for (t = i.view, r = n.split("."), u = 0; t != null && u < r.length;) u === r.length - 1 && (e = s(t, r[u])), t = t[r[u++]];
else t = i.view[n], e = s(i.view, n);
if (e) break;
i = i.parent
}
o[n] = t
}
return f(t) && (t = t.call(this.view)), t
};
t.prototype.clearCache = function() {
this.cache = {}
};
t.prototype.parse = function(n, t) {
var r = this.cache,
i = r[n];
return i == null && (i = r[n] = tt(n, t)), i
};
t.prototype.render = function(n, t, r) {
var u = this.parse(n),
f = t instanceof i ? t : new i(t);
return this.renderTokens(u, f, r, n)
};
t.prototype.renderTokens = function(n, t, i, r) {
for (var s = "", f, e, u, o = 0, h = n.length; o < h; ++o) u = undefined, f = n[o], e = f[0], e === "#" ? u = this.renderSection(f, t, i, r) : e === "^" ? u = this.renderInverted(f, t, i, r) : e === ">" ? u = this.renderPartial(f, t, i, r) : e === "&" ? u = this.unescapedValue(f, t) : e === "name" ? u = this.escapedValue(f, t) : e === "text" && (u = this.rawValue(f)), u !== undefined && (s += u);
return s
};
t.prototype.renderSection = function(n, t, i, r) {
function l(n) {
return c.render(n, t, i)
}
var c = this,
o = "",
e = t.lookup(n[1]),
s, h;
if (e) {
if (u(e))
for (s = 0, h = e.length; s < h; ++s) o += this.renderTokens(n[4], t.push(e[s]), i, r);
else if (typeof e == "object" || typeof e == "string" || typeof e == "number") o += this.renderTokens(n[4], t.push(e), i, r);
else if (f(e)) {
if (typeof r != "string") throw new Error("Cannot use higher-order sections without the original template");
e = e.call(t.view, r.slice(n[3], n[5]), l);
e != null && (o += e)
} else o += this.renderTokens(n[4], t, i, r);
return o
}
};
t.prototype.renderInverted = function(n, t, i, r) {
var f = t.lookup(n[1]);
if (!f || u(f) && f.length === 0) return this.renderTokens(n[4], t, i, r)
};
t.prototype.renderPartial = function(n, t, i) {
if (i) {
var r = f(i) ? i(n[1]) : i[n[1]];
if (r != null) return this.renderTokens(this.parse(r), t, i, r)
}
};
t.prototype.unescapedValue = function(n, t) {
var i = t.lookup(n[1]);
if (i != null) return i
};
t.prototype.escapedValue = function(t, i) {
var r = i.lookup(t[1]);
if (r != null) return n.escape(r)
};
t.prototype.rawValue = function(n) {
return n[1]
};
n.name = "mustache.js";
n.version = "2.2.1";
n.tags = ["{{", "}}"];
e = new t;
n.clearCache = function() {
return e.clearCache()
};
n.parse = function(n, t) {
return e.parse(n, t)
};
n.render = function(n, t, i) {
if (typeof n != "string") throw new TypeError('Invalid template! Template should be a "string" but "' + l(n) + '" was given as the first argument for mustache#render(template, view, partials)');
return e.render(n, t, i)
};
n.to_html = function(t, i, r, u) {
var e = n.render(t, i, r);
if (f(u)) u(e);
else return e
};
n.escape = b;
n.Scanner = r;
n.Context = i;
n.Writer = t
}), "undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); + function(n) {
"use strict";
var t = n.fn.jquery.split(" ")[0].split(".");
if (t[0] < 2 && t[1] < 9 || 1 == t[0] && 9 == t[1] && t[2] < 1 || t[0] > 3) throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4");
}(jQuery); + function(n) {
"use strict";
function t() {
var i = document.createElement("bootstrap"),
t = {
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd otransitionend",
transition: "transitionend"
},
n;
for (n in t)
if (void 0 !== i.style[n]) return {
end: t[n]
};
return !1
}
n.fn.emulateTransitionEnd = function(t) {
var i = !1,
u = this,
r;
n(this).one("bsTransitionEnd", function() {
i = !0
});
return r = function() {
i || n(u).trigger(n.support.transition.end)
}, setTimeout(r, t), this
};
n(function() {
n.support.transition = t();
n.support.transition && (n.event.special.bsTransitionEnd = {
bindType: n.support.transition.end,
delegateType: n.support.transition.end,
handle: function(t) {
if (n(t.target).is(this)) return t.handleObj.handler.apply(this, arguments)
}
})
})
}(jQuery); + function(n) {
"use strict";
function u(i) {
return this.each(function() {
var r = n(this),
u = r.data("bs.alert");
u || r.data("bs.alert", u = new t(this));
"string" == typeof i && u[i].call(r)
})
}
var i = '[data-dismiss="alert"]',
t = function(t) {
n(t).on("click", i, this.close)
},
r;
t.VERSION = "3.3.7";
t.TRANSITION_DURATION = 150;
t.prototype.close = function(i) {
function e() {
r.detach().trigger("closed.bs.alert").remove()
}
var f = n(this),
u = f.attr("data-target"),
r;
u || (u = f.attr("href"), u = u && u.replace(/.*(?=#[^\s]*$)/, ""));
r = n("#" === u ? [] : u);
i && i.preventDefault();
r.length || (r = f.closest(".alert"));
r.trigger(i = n.Event("close.bs.alert"));
i.isDefaultPrevented() || (r.removeClass("in"), n.support.transition && r.hasClass("fade") ? r.one("bsTransitionEnd", e).emulateTransitionEnd(t.TRANSITION_DURATION) : e())
};
r = n.fn.alert;
n.fn.alert = u;
n.fn.alert.Constructor = t;
n.fn.alert.noConflict = function() {
return n.fn.alert = r, this
};
n(document).on("click.bs.alert.data-api", i, t.prototype.close)
}(jQuery); + function(n) {
"use strict";
function i(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.button"),
f = "object" == typeof i && i;
r || u.data("bs.button", r = new t(this, f));
"toggle" == i ? r.toggle() : i && r.setState(i)
})
}
var t = function(i, r) {
this.$element = n(i);
this.options = n.extend({}, t.DEFAULTS, r);
this.isLoading = !1
},
r;
t.VERSION = "3.3.7";
t.DEFAULTS = {
loadingText: "loading..."
};
t.prototype.setState = function(t) {
var i = "disabled",
r = this.$element,
f = r.is("input") ? "val" : "html",
u = r.data();
t += "Text";
null == u.resetText && r.data("resetText", r[f]());
setTimeout(n.proxy(function() {
r[f](null == u[t] ? this.options[t] : u[t]);
"loadingText" == t ? (this.isLoading = !0, r.addClass(i).attr(i, i).prop(i, !0)) : this.isLoading && (this.isLoading = !1, r.removeClass(i).removeAttr(i).prop(i, !1))
}, this), 0)
};
t.prototype.toggle = function() {
var t = !0,
i = this.$element.closest('[data-toggle="buttons"]'),
n;
i.length ? (n = this.$element.find("input"), "radio" == n.prop("type") ? (n.prop("checked") && (t = !1), i.find(".active").removeClass("active"), this.$element.addClass("active")) : "checkbox" == n.prop("type") && (n.prop("checked") !== this.$element.hasClass("active") && (t = !1), this.$element.toggleClass("active")), n.prop("checked", this.$element.hasClass("active")), t && n.trigger("change")) : (this.$element.attr("aria-pressed", !this.$element.hasClass("active")), this.$element.toggleClass("active"))
};
r = n.fn.button;
n.fn.button = i;
n.fn.button.Constructor = t;
n.fn.button.noConflict = function() {
return n.fn.button = r, this
};
n(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(t) {
var r = n(t.target).closest(".btn");
i.call(r, "toggle");
n(t.target).is('input[type="radio"], input[type="checkbox"]') || (t.preventDefault(), r.is("input,button") ? r.trigger("focus") : r.find("input:visible,button:visible").first().trigger("focus"))
}).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function(t) {
n(t.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(t.type))
})
}(jQuery); + function(n) {
"use strict";
function i(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.carousel"),
f = n.extend({}, t.DEFAULTS, u.data(), "object" == typeof i && i),
e = "string" == typeof i ? i : f.slide;
r || u.data("bs.carousel", r = new t(this, f));
"number" == typeof i ? r.to(i) : e ? r[e]() : f.interval && r.pause().cycle()
})
}
var t = function(t, i) {
this.$element = n(t);
this.$indicators = this.$element.find(".carousel-indicators");
this.options = i;
this.paused = null;
this.sliding = null;
this.interval = null;
this.$active = null;
this.$items = null;
this.options.keyboard && this.$element.on("keydown.bs.carousel", n.proxy(this.keydown, this));
"hover" == this.options.pause && !("ontouchstart" in document.documentElement) && this.$element.on("mouseenter.bs.carousel", n.proxy(this.pause, this)).on("mouseleave.bs.carousel", n.proxy(this.cycle, this))
},
u, r;
t.VERSION = "3.3.7";
t.TRANSITION_DURATION = 600;
t.DEFAULTS = {
interval: 5e3,
pause: "hover",
wrap: !0,
keyboard: !0
};
t.prototype.keydown = function(n) {
if (!/input|textarea/i.test(n.target.tagName)) {
switch (n.which) {
case 37:
this.prev();
break;
case 39:
this.next();
break;
default:
return
}
n.preventDefault()
}
};
t.prototype.cycle = function(t) {
return t || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(n.proxy(this.next, this), this.options.interval)), this
};
t.prototype.getItemIndex = function(n) {
return this.$items = n.parent().children(".item"), this.$items.index(n || this.$active)
};
t.prototype.getItemForDirection = function(n, t) {
var i = this.getItemIndex(t),
f = "prev" == n && 0 === i || "next" == n && i == this.$items.length - 1,
r, u;
return f && !this.options.wrap ? t : (r = "prev" == n ? -1 : 1, u = (i + r) % this.$items.length, this.$items.eq(u))
};
t.prototype.to = function(n) {
var i = this,
t = this.getItemIndex(this.$active = this.$element.find(".item.active"));
if (!(n > this.$items.length - 1 || n < 0)) return this.sliding ? this.$element.one("slid.bs.carousel", function() {
i.to(n)
}) : t == n ? this.pause().cycle() : this.slide(n > t ? "next" : "prev", this.$items.eq(n))
};
t.prototype.pause = function(t) {
return t || (this.paused = !0), this.$element.find(".next, .prev").length && n.support.transition && (this.$element.trigger(n.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this
};
t.prototype.next = function() {
if (!this.sliding) return this.slide("next")
};
t.prototype.prev = function() {
if (!this.sliding) return this.slide("prev")
};
t.prototype.slide = function(i, r) {
var e = this.$element.find(".item.active"),
u = r || this.getItemForDirection(i, e),
l = this.interval,
f = "next" == i ? "left" : "right",
a = this,
o, s, h, c;
return u.hasClass("active") ? this.sliding = !1 : (o = u[0], s = n.Event("slide.bs.carousel", {
relatedTarget: o,
direction: f
}), (this.$element.trigger(s), !s.isDefaultPrevented()) ? ((this.sliding = !0, l && this.pause(), this.$indicators.length) && (this.$indicators.find(".active").removeClass("active"), h = n(this.$indicators.children()[this.getItemIndex(u)]), h && h.addClass("active")), c = n.Event("slid.bs.carousel", {
relatedTarget: o,
direction: f
}), n.support.transition && this.$element.hasClass("slide") ? (u.addClass(i), u[0].offsetWidth, e.addClass(f), u.addClass(f), e.one("bsTransitionEnd", function() {
u.removeClass([i, f].join(" ")).addClass("active");
e.removeClass(["active", f].join(" "));
a.sliding = !1;
setTimeout(function() {
a.$element.trigger(c)
}, 0)
}).emulateTransitionEnd(t.TRANSITION_DURATION)) : (e.removeClass("active"), u.addClass("active"), this.sliding = !1, this.$element.trigger(c)), l && this.cycle(), this) : void 0)
};
u = n.fn.carousel;
n.fn.carousel = i;
n.fn.carousel.Constructor = t;
n.fn.carousel.noConflict = function() {
return n.fn.carousel = u, this
};
r = function(t) {
var o, r = n(this),
u = n(r.attr("data-target") || (o = r.attr("href")) && o.replace(/.*(?=#[^\s]+$)/, "")),
e, f;
u.hasClass("carousel") && (e = n.extend({}, u.data(), r.data()), f = r.attr("data-slide-to"), f && (e.interval = !1), i.call(u, e), f && u.data("bs.carousel").to(f), t.preventDefault())
};
n(document).on("click.bs.carousel.data-api", "[data-slide]", r).on("click.bs.carousel.data-api", "[data-slide-to]", r);
n(window).on("load", function() {
n('[data-ride="carousel"]').each(function() {
var t = n(this);
i.call(t, t.data())
})
})
}(jQuery); + function(n) {
"use strict";
function r(t) {
var i, r = t.attr("data-target") || (i = t.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, "");
return n(r)
}
function i(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.collapse"),
f = n.extend({}, t.DEFAULTS, u.data(), "object" == typeof i && i);
!r && f.toggle && /show|hide/.test(i) && (f.toggle = !1);
r || u.data("bs.collapse", r = new t(this, f));
"string" == typeof i && r[i]()
})
}
var t = function(i, r) {
this.$element = n(i);
this.options = n.extend({}, t.DEFAULTS, r);
this.$trigger = n('[data-toggle="collapse"][href="#' + i.id + '"],[data-toggle="collapse"][data-target="#' + i.id + '"]');
this.transitioning = null;
this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger);
this.options.toggle && this.toggle()
},
u;
t.VERSION = "3.3.7";
t.TRANSITION_DURATION = 350;
t.DEFAULTS = {
toggle: !0
};
t.prototype.dimension = function() {
var n = this.$element.hasClass("width");
return n ? "width" : "height"
};
t.prototype.show = function() {
var f, r, e, u, o, s;
if (!this.transitioning && !this.$element.hasClass("in") && (r = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"), !(r && r.length && (f = r.data("bs.collapse"), f && f.transitioning)) && (e = n.Event("show.bs.collapse"), this.$element.trigger(e), !e.isDefaultPrevented()))) {
if (r && r.length && (i.call(r, "hide"), f || r.data("bs.collapse", null)), u = this.dimension(), this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1, o = function() {
this.$element.removeClass("collapsing").addClass("collapse in")[u]("");
this.transitioning = 0;
this.$element.trigger("shown.bs.collapse")
}, !n.support.transition) return o.call(this);
s = n.camelCase(["scroll", u].join("-"));
this.$element.one("bsTransitionEnd", n.proxy(o, this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])
}
};
t.prototype.hide = function() {
var r, i, u;
if (!this.transitioning && this.$element.hasClass("in") && (r = n.Event("hide.bs.collapse"), this.$element.trigger(r), !r.isDefaultPrevented())) return i = this.dimension(), this.$element[i](this.$element[i]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1, u = function() {
this.transitioning = 0;
this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")
}, n.support.transition ? void this.$element[i](0).one("bsTransitionEnd", n.proxy(u, this)).emulateTransitionEnd(t.TRANSITION_DURATION) : u.call(this)
};
t.prototype.toggle = function() {
this[this.$element.hasClass("in") ? "hide" : "show"]()
};
t.prototype.getParent = function() {
return n(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(n.proxy(function(t, i) {
var u = n(i);
this.addAriaAndCollapsedClass(r(u), u)
}, this)).end()
};
t.prototype.addAriaAndCollapsedClass = function(n, t) {
var i = n.hasClass("in");
n.attr("aria-expanded", i);
t.toggleClass("collapsed", !i).attr("aria-expanded", i)
};
u = n.fn.collapse;
n.fn.collapse = i;
n.fn.collapse.Constructor = t;
n.fn.collapse.noConflict = function() {
return n.fn.collapse = u, this
};
n(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(t) {
var u = n(this);
u.attr("data-target") || t.preventDefault();
var f = r(u),
e = f.data("bs.collapse"),
o = e ? "toggle" : u.data();
i.call(f, o)
})
}(jQuery); + function(n) {
"use strict";
function r(t) {
var i = t.attr("data-target"),
r;
return i || (i = t.attr("href"), i = i && /#[A-Za-z]/.test(i) && i.replace(/.*(?=#[^\s]*$)/, "")), r = i && n(i), r && r.length ? r : t.parent()
}
function u(t) {
t && 3 === t.which || (n(o).remove(), n(i).each(function() {
var u = n(this),
i = r(u),
f = {
relatedTarget: this
};
i.hasClass("open") && (t && "click" == t.type && /input|textarea/i.test(t.target.tagName) && n.contains(i[0], t.target) || (i.trigger(t = n.Event("hide.bs.dropdown", f)), t.isDefaultPrevented() || (u.attr("aria-expanded", "false"), i.removeClass("open").trigger(n.Event("hidden.bs.dropdown", f)))))
}))
}
function e(i) {
return this.each(function() {
var r = n(this),
u = r.data("bs.dropdown");
u || r.data("bs.dropdown", u = new t(this));
"string" == typeof i && u[i].call(r)
})
}
var o = ".dropdown-backdrop",
i = '[data-toggle="dropdown"]',
t = function(t) {
n(t).on("click.bs.dropdown", this.toggle)
},
f;
t.VERSION = "3.3.7";
t.prototype.toggle = function(t) {
var f = n(this),
i, o, e;
if (!f.is(".disabled, :disabled")) {
if (i = r(f), o = i.hasClass("open"), u(), !o) {
if ("ontouchstart" in document.documentElement && !i.closest(".navbar-nav").length && n(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(n(this)).on("click", u), e = {
relatedTarget: this
}, i.trigger(t = n.Event("show.bs.dropdown", e)), t.isDefaultPrevented()) return;
f.trigger("focus").attr("aria-expanded", "true");
i.toggleClass("open").trigger(n.Event("shown.bs.dropdown", e))
}
return !1
}
};
t.prototype.keydown = function(t) {
var e, o, s, h, f, u;
if (/(38|40|27|32)/.test(t.which) && !/input|textarea/i.test(t.target.tagName) && (e = n(this), t.preventDefault(), t.stopPropagation(), !e.is(".disabled, :disabled"))) {
if (o = r(e), s = o.hasClass("open"), !s && 27 != t.which || s && 27 == t.which) return 27 == t.which && o.find(i).trigger("focus"), e.trigger("click");
h = " li:not(.disabled):visible a";
f = o.find(".dropdown-menu" + h);
f.length && (u = f.index(t.target), 38 == t.which && u > 0 && u--, 40 == t.which && u < f.length - 1 && u++, ~u || (u = 0), f.eq(u).trigger("focus"))
}
};
f = n.fn.dropdown;
n.fn.dropdown = e;
n.fn.dropdown.Constructor = t;
n.fn.dropdown.noConflict = function() {
return n.fn.dropdown = f, this
};
n(document).on("click.bs.dropdown.data-api", u).on("click.bs.dropdown.data-api", ".dropdown form", function(n) {
n.stopPropagation()
}).on("click.bs.dropdown.data-api", i, t.prototype.toggle).on("keydown.bs.dropdown.data-api", i, t.prototype.keydown).on("keydown.bs.dropdown.data-api", ".dropdown-menu", t.prototype.keydown)
}(jQuery); + function(n) {
"use strict";
function i(i, r) {
return this.each(function() {
var f = n(this),
u = f.data("bs.modal"),
e = n.extend({}, t.DEFAULTS, f.data(), "object" == typeof i && i);
u || f.data("bs.modal", u = new t(this, e));
"string" == typeof i ? u[i](r) : e.show && u.show(r)
})
}
var t = function(t, i) {
this.options = i;
this.$body = n(document.body);
this.$element = n(t);
this.$dialog = this.$element.find(".modal-dialog");
this.$backdrop = null;
this.isShown = null;
this.originalBodyPad = null;
this.scrollbarWidth = 0;
this.ignoreBackdropClick = !1;
this.options.remote && this.$element.find(".modal-content").load(this.options.remote, n.proxy(function() {
this.$element.trigger("loaded.bs.modal")
}, this))
},
r;
t.VERSION = "3.3.7";
t.TRANSITION_DURATION = 300;
t.BACKDROP_TRANSITION_DURATION = 150;
t.DEFAULTS = {
backdrop: !0,
keyboard: !0,
show: !0
};
t.prototype.toggle = function(n) {
return this.isShown ? this.hide() : this.show(n)
};
t.prototype.show = function(i) {
var r = this,
u = n.Event("show.bs.modal", {
relatedTarget: i
});
this.$element.trigger(u);
this.isShown || u.isDefaultPrevented() || (this.isShown = !0, this.checkScrollbar(), this.setScrollbar(), this.$body.addClass("modal-open"), this.escape(), this.resize(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', n.proxy(this.hide, this)), this.$dialog.on("mousedown.dismiss.bs.modal", function() {
r.$element.one("mouseup.dismiss.bs.modal", function(t) {
n(t.target).is(r.$element) && (r.ignoreBackdropClick = !0)
})
}), this.backdrop(function() {
var f = n.support.transition && r.$element.hasClass("fade"),
u;
r.$element.parent().length || r.$element.appendTo(r.$body);
r.$element.show().scrollTop(0);
r.adjustDialog();
f && r.$element[0].offsetWidth;
r.$element.addClass("in");
r.enforceFocus();
u = n.Event("shown.bs.modal", {
relatedTarget: i
});
f ? r.$dialog.one("bsTransitionEnd", function() {
r.$element.trigger("focus").trigger(u)
}).emulateTransitionEnd(t.TRANSITION_DURATION) : r.$element.trigger("focus").trigger(u)
}))
};
t.prototype.hide = function(i) {
i && i.preventDefault();
i = n.Event("hide.bs.modal");
this.$element.trigger(i);
this.isShown && !i.isDefaultPrevented() && (this.isShown = !1, this.escape(), this.resize(), n(document).off("focusin.bs.modal"), this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"), this.$dialog.off("mousedown.dismiss.bs.modal"), n.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", n.proxy(this.hideModal, this)).emulateTransitionEnd(t.TRANSITION_DURATION) : this.hideModal())
};
t.prototype.enforceFocus = function() {
n(document).off("focusin.bs.modal").on("focusin.bs.modal", n.proxy(function(n) {
document === n.target || this.$element[0] === n.target || this.$element.has(n.target).length || this.$element.trigger("focus")
}, this))
};
t.prototype.escape = function() {
this.isShown && this.options.keyboard ? this.$element.on("keydown.dismiss.bs.modal", n.proxy(function(n) {
27 == n.which && this.hide()
}, this)) : this.isShown || this.$element.off("keydown.dismiss.bs.modal")
};
t.prototype.resize = function() {
this.isShown ? n(window).on("resize.bs.modal", n.proxy(this.handleUpdate, this)) : n(window).off("resize.bs.modal")
};
t.prototype.hideModal = function() {
var n = this;
this.$element.hide();
this.backdrop(function() {
n.$body.removeClass("modal-open");
n.resetAdjustments();
n.resetScrollbar();
n.$element.trigger("hidden.bs.modal")
})
};
t.prototype.removeBackdrop = function() {
this.$backdrop && this.$backdrop.remove();
this.$backdrop = null
};
t.prototype.backdrop = function(i) {
var e = this,
f = this.$element.hasClass("fade") ? "fade" : "",
r, u;
if (this.isShown && this.options.backdrop) {
if (r = n.support.transition && f, this.$backdrop = n(document.createElement("div")).addClass("modal-backdrop " + f).appendTo(this.$body), this.$element.on("click.dismiss.bs.modal", n.proxy(function(n) {
return this.ignoreBackdropClick ? void(this.ignoreBackdropClick = !1) : void(n.target === n.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus() : this.hide()))
}, this)), r && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !i) return;
r ? this.$backdrop.one("bsTransitionEnd", i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION) : i()
} else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), u = function() {
e.removeBackdrop();
i && i()
}, n.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION) : u()) : i && i()
};
t.prototype.handleUpdate = function() {
this.adjustDialog()
};
t.prototype.adjustDialog = function() {
var n = this.$element[0].scrollHeight > document.documentElement.clientHeight;
this.$element.css({
paddingLeft: !this.bodyIsOverflowing && n ? this.scrollbarWidth : "",
paddingRight: this.bodyIsOverflowing && !n ? this.scrollbarWidth : ""
})
};
t.prototype.resetAdjustments = function() {
this.$element.css({
paddingLeft: "",
paddingRight: ""
})
};
t.prototype.checkScrollbar = function() {
var n = window.innerWidth,
t;
n || (t = document.documentElement.getBoundingClientRect(), n = t.right - Math.abs(t.left));
this.bodyIsOverflowing = document.body.clientWidth < n;
this.scrollbarWidth = this.measureScrollbar()
};
t.prototype.setScrollbar = function() {
var n = parseInt(this.$body.css("padding-right") || 0, 10);
this.originalBodyPad = document.body.style.paddingRight || "";
this.bodyIsOverflowing && this.$body.css("padding-right", n + this.scrollbarWidth)
};
t.prototype.resetScrollbar = function() {
this.$body.css("padding-right", this.originalBodyPad)
};
t.prototype.measureScrollbar = function() {
var n = document.createElement("div"),
t;
return n.className = "modal-scrollbar-measure", this.$body.append(n), t = n.offsetWidth - n.clientWidth, this.$body[0].removeChild(n), t
};
r = n.fn.modal;
n.fn.modal = i;
n.fn.modal.Constructor = t;
n.fn.modal.noConflict = function() {
return n.fn.modal = r, this
};
n(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(t) {
var r = n(this),
f = r.attr("href"),
u = n(r.attr("data-target") || f && f.replace(/.*(?=#[^\s]+$)/, "")),
e = u.data("bs.modal") ? "toggle" : n.extend({
remote: !/#/.test(f) && f
}, u.data(), r.data());
r.is("a") && t.preventDefault();
u.one("show.bs.modal", function(n) {
n.isDefaultPrevented() || u.one("hidden.bs.modal", function() {
r.is(":visible") && r.trigger("focus")
})
});
i.call(u, e, this)
})
}(jQuery); + function(n) {
"use strict";
function r(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.tooltip"),
f = "object" == typeof i && i;
!r && /destroy|hide/.test(i) || (r || u.data("bs.tooltip", r = new t(this, f)), "string" == typeof i && r[i]())
})
}
var t = function(n, t) {
this.type = null;
this.options = null;
this.enabled = null;
this.timeout = null;
this.hoverState = null;
this.$element = null;
this.inState = null;
this.init("tooltip", n, t)
},
i;
t.VERSION = "3.3.7";
t.TRANSITION_DURATION = 150;
t.DEFAULTS = {
animation: !0,
placement: "top",
selector: !1,
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',
trigger: "hover focus",
title: "",
delay: 0,
html: !1,
container: !1,
viewport: {
selector: "body",
padding: 0
}
};
t.prototype.init = function(t, i, r) {
var f, e, u, o, s;
if (this.enabled = !0, this.type = t, this.$element = n(i), this.options = this.getOptions(r), this.$viewport = this.options.viewport && n(n.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport), this.inState = {
click: !1,
hover: !1,
focus: !1
}, this.$element[0] instanceof document.constructor && !this.options.selector) throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!");
for (f = this.options.trigger.split(" "), e = f.length; e--;)
if (u = f[e], "click" == u) this.$element.on("click." + this.type, this.options.selector, n.proxy(this.toggle, this));
else "manual" != u && (o = "hover" == u ? "mouseenter" : "focusin", s = "hover" == u ? "mouseleave" : "focusout", this.$element.on(o + "." + this.type, this.options.selector, n.proxy(this.enter, this)), this.$element.on(s + "." + this.type, this.options.selector, n.proxy(this.leave, this)));
this.options.selector ? this._options = n.extend({}, this.options, {
trigger: "manual",
selector: ""
}) : this.fixTitle()
};
t.prototype.getDefaults = function() {
return t.DEFAULTS
};
t.prototype.getOptions = function(t) {
return t = n.extend({}, this.getDefaults(), this.$element.data(), t), t.delay && "number" == typeof t.delay && (t.delay = {
show: t.delay,
hide: t.delay
}), t
};
t.prototype.getDelegateOptions = function() {
var t = {},
i = this.getDefaults();
return this._options && n.each(this._options, function(n, r) {
i[n] != r && (t[n] = r)
}), t
};
t.prototype.enter = function(t) {
var i = t instanceof this.constructor ? t : n(t.currentTarget).data("bs." + this.type);
return i || (i = new this.constructor(t.currentTarget, this.getDelegateOptions()), n(t.currentTarget).data("bs." + this.type, i)), t instanceof n.Event && (i.inState["focusin" == t.type ? "focus" : "hover"] = !0), i.tip().hasClass("in") || "in" == i.hoverState ? void(i.hoverState = "in") : (clearTimeout(i.timeout), i.hoverState = "in", i.options.delay && i.options.delay.show ? void(i.timeout = setTimeout(function() {
"in" == i.hoverState && i.show()
}, i.options.delay.show)) : i.show())
};
t.prototype.isInStateTrue = function() {
for (var n in this.inState)
if (this.inState[n]) return !0;
return !1
};
t.prototype.leave = function(t) {
var i = t instanceof this.constructor ? t : n(t.currentTarget).data("bs." + this.type);
if (i || (i = new this.constructor(t.currentTarget, this.getDelegateOptions()), n(t.currentTarget).data("bs." + this.type, i)), t instanceof n.Event && (i.inState["focusout" == t.type ? "focus" : "hover"] = !1), !i.isInStateTrue()) return clearTimeout(i.timeout), i.hoverState = "out", i.options.delay && i.options.delay.hide ? void(i.timeout = setTimeout(function() {
"out" == i.hoverState && i.hide()
}, i.options.delay.hide)) : i.hide()
};
t.prototype.show = function() {
var c = n.Event("show.bs." + this.type),
l, p, e, w, h;
if (this.hasContent() && this.enabled) {
if (this.$element.trigger(c), l = n.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]), c.isDefaultPrevented() || !l) return;
var u = this,
r = this.tip(),
a = this.getUID(this.type);
this.setContent();
r.attr("id", a);
this.$element.attr("aria-describedby", a);
this.options.animation && r.addClass("fade");
var i = "function" == typeof this.options.placement ? this.options.placement.call(this, r[0], this.$element[0]) : this.options.placement,
v = /\s?auto?\s?/i,
y = v.test(i);
y && (i = i.replace(v, "") || "top");
r.detach().css({
top: 0,
left: 0,
display: "block"
}).addClass(i).data("bs." + this.type, this);
this.options.container ? r.appendTo(this.options.container) : r.insertAfter(this.$element);
this.$element.trigger("inserted.bs." + this.type);
var f = this.getPosition(),
o = r[0].offsetWidth,
s = r[0].offsetHeight;
y && (p = i, e = this.getPosition(this.$viewport), i = "bottom" == i && f.bottom + s > e.bottom ? "top" : "top" == i && f.top - s < e.top ? "bottom" : "right" == i && f.right + o > e.width ? "left" : "left" == i && f.left - o < e.left ? "right" : i, r.removeClass(p).addClass(i));
w = this.getCalculatedOffset(i, f, o, s);
this.applyPlacement(w, i);
h = function() {
var n = u.hoverState;
u.$element.trigger("shown.bs." + u.type);
u.hoverState = null;
"out" == n && u.leave(u)
};
n.support.transition && this.$tip.hasClass("fade") ? r.one("bsTransitionEnd", h).emulateTransitionEnd(t.TRANSITION_DURATION) : h()
}
};
t.prototype.applyPlacement = function(t, i) {
var r = this.tip(),
l = r[0].offsetWidth,
e = r[0].offsetHeight,
o = parseInt(r.css("margin-top"), 10),
s = parseInt(r.css("margin-left"), 10),
h, f, u;
isNaN(o) && (o = 0);
isNaN(s) && (s = 0);
t.top += o;
t.left += s;
n.offset.setOffset(r[0], n.extend({
using: function(n) {
r.css({
top: Math.round(n.top),
left: Math.round(n.left)
})
}
}, t), 0);
r.addClass("in");
h = r[0].offsetWidth;
f = r[0].offsetHeight;
"top" == i && f != e && (t.top = t.top + e - f);
u = this.getViewportAdjustedDelta(i, t, h, f);
u.left ? t.left += u.left : t.top += u.top;
var c = /top|bottom/.test(i),
a = c ? 2 * u.left - l + h : 2 * u.top - e + f,
v = c ? "offsetWidth" : "offsetHeight";
r.offset(t);
this.replaceArrow(a, r[0][v], c)
};
t.prototype.replaceArrow = function(n, t, i) {
this.arrow().css(i ? "left" : "top", 50 * (1 - n / t) + "%").css(i ? "top" : "left", "")
};
t.prototype.setContent = function() {
var n = this.tip(),
t = this.getTitle();
n.find(".tooltip-inner")[this.options.html ? "html" : "text"](t);
n.removeClass("fade in top bottom left right")
};
t.prototype.hide = function(i) {
function f() {
"in" != r.hoverState && u.detach();
r.$element && r.$element.removeAttr("aria-describedby").trigger("hidden.bs." + r.type);
i && i()
}
var r = this,
u = n(this.$tip),
e = n.Event("hide.bs." + this.type);
if (this.$element.trigger(e), !e.isDefaultPrevented()) return u.removeClass("in"), n.support.transition && u.hasClass("fade") ? u.one("bsTransitionEnd", f).emulateTransitionEnd(t.TRANSITION_DURATION) : f(), this.hoverState = null, this
};
t.prototype.fixTitle = function() {
var n = this.$element;
(n.attr("title") || "string" != typeof n.attr("data-original-title")) && n.attr("data-original-title", n.attr("title") || "").attr("title", "")
};
t.prototype.hasContent = function() {
return this.getTitle()
};
t.prototype.getPosition = function(t) {
t = t || this.$element;
var r = t[0],
u = "BODY" == r.tagName,
i = r.getBoundingClientRect();
null == i.width && (i = n.extend({}, i, {
width: i.right - i.left,
height: i.bottom - i.top
}));
var f = window.SVGElement && r instanceof window.SVGElement,
e = u ? {
top: 0,
left: 0
} : f ? null : t.offset(),
o = {
scroll: u ? document.documentElement.scrollTop || document.body.scrollTop : t.scrollTop()
},
s = u ? {
width: n(window).width(),
height: n(window).height()
} : null;
return n.extend({}, i, o, s, e)
};
t.prototype.getCalculatedOffset = function(n, t, i, r) {
return "bottom" == n ? {
top: t.top + t.height,
left: t.left + t.width / 2 - i / 2
} : "top" == n ? {
top: t.top - r,
left: t.left + t.width / 2 - i / 2
} : "left" == n ? {
top: t.top + t.height / 2 - r / 2,
left: t.left - i
} : {
top: t.top + t.height / 2 - r / 2,
left: t.left + t.width
}
};
t.prototype.getViewportAdjustedDelta = function(n, t, i, r) {
var f = {
top: 0,
left: 0
},
e, u, o, s, h, c;
return this.$viewport ? (e = this.options.viewport && this.options.viewport.padding || 0, u = this.getPosition(this.$viewport), /right|left/.test(n) ? (o = t.top - e - u.scroll, s = t.top + e - u.scroll + r, o < u.top ? f.top = u.top - o : s > u.top + u.height && (f.top = u.top + u.height - s)) : (h = t.left - e, c = t.left + e + i, h < u.left ? f.left = u.left - h : c > u.right && (f.left = u.left + u.width - c)), f) : f
};
t.prototype.getTitle = function() {
var t = this.$element,
n = this.options;
return t.attr("data-original-title") || ("function" == typeof n.title ? n.title.call(t[0]) : n.title)
};
t.prototype.getUID = function(n) {
do n += ~~(1e6 * Math.random()); while (document.getElementById(n));
return n
};
t.prototype.tip = function() {
if (!this.$tip && (this.$tip = n(this.options.template), 1 != this.$tip.length)) throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!");
return this.$tip
};
t.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
};
t.prototype.enable = function() {
this.enabled = !0
};
t.prototype.disable = function() {
this.enabled = !1
};
t.prototype.toggleEnabled = function() {
this.enabled = !this.enabled
};
t.prototype.toggle = function(t) {
var i = this;
t && (i = n(t.currentTarget).data("bs." + this.type), i || (i = new this.constructor(t.currentTarget, this.getDelegateOptions()), n(t.currentTarget).data("bs." + this.type, i)));
t ? (i.inState.click = !i.inState.click, i.isInStateTrue() ? i.enter(i) : i.leave(i)) : i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
};
t.prototype.destroy = function() {
var n = this;
clearTimeout(this.timeout);
this.hide(function() {
n.$element.off("." + n.type).removeData("bs." + n.type);
n.$tip && n.$tip.detach();
n.$tip = null;
n.$arrow = null;
n.$viewport = null;
n.$element = null
})
};
i = n.fn.tooltip;
n.fn.tooltip = r;
n.fn.tooltip.Constructor = t;
n.fn.tooltip.noConflict = function() {
return n.fn.tooltip = i, this
}
}(jQuery); + function(n) {
"use strict";
function r(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.popover"),
f = "object" == typeof i && i;
!r && /destroy|hide/.test(i) || (r || u.data("bs.popover", r = new t(this, f)), "string" == typeof i && r[i]())
})
}
var t = function(n, t) {
this.init("popover", n, t)
},
i;
if (!n.fn.tooltip) throw new Error("Popover requires tooltip.js");
t.VERSION = "3.3.7";
t.DEFAULTS = n.extend({}, n.fn.tooltip.Constructor.DEFAULTS, {
placement: "right",
trigger: "click",
content: "",
template: '<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'
});
t.prototype = n.extend({}, n.fn.tooltip.Constructor.prototype);
t.prototype.constructor = t;
t.prototype.getDefaults = function() {
return t.DEFAULTS
};
t.prototype.setContent = function() {
var n = this.tip(),
i = this.getTitle(),
t = this.getContent();
n.find(".popover-title")[this.options.html ? "html" : "text"](i);
n.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof t ? "html" : "append" : "text"](t);
n.removeClass("fade top bottom left right in");
n.find(".popover-title").html() || n.find(".popover-title").hide()
};
t.prototype.hasContent = function() {
return this.getTitle() || this.getContent()
};
t.prototype.getContent = function() {
var t = this.$element,
n = this.options;
return t.attr("data-content") || ("function" == typeof n.content ? n.content.call(t[0]) : n.content)
};
t.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".arrow")
};
i = n.fn.popover;
n.fn.popover = r;
n.fn.popover.Constructor = t;
n.fn.popover.noConflict = function() {
return n.fn.popover = i, this
}
}(jQuery); + function(n) {
"use strict";
function t(i, r) {
this.$body = n(document.body);
this.$scrollElement = n(n(i).is(document.body) ? window : i);
this.options = n.extend({}, t.DEFAULTS, r);
this.selector = (this.options.target || "") + " .nav li > a";
this.offsets = [];
this.targets = [];
this.activeTarget = null;
this.scrollHeight = 0;
this.$scrollElement.on("scroll.bs.scrollspy", n.proxy(this.process, this));
this.refresh();
this.process()
}
function i(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.scrollspy"),
f = "object" == typeof i && i;
r || u.data("bs.scrollspy", r = new t(this, f));
"string" == typeof i && r[i]()
})
}
t.VERSION = "3.3.7";
t.DEFAULTS = {
offset: 10
};
t.prototype.getScrollHeight = function() {
return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
};
t.prototype.refresh = function() {
var t = this,
i = "offset",
r = 0;
this.offsets = [];
this.targets = [];
this.scrollHeight = this.getScrollHeight();
n.isWindow(this.$scrollElement[0]) || (i = "position", r = this.$scrollElement.scrollTop());
this.$body.find(this.selector).map(function() {
var f = n(this),
u = f.data("target") || f.attr("href"),
t = /^#./.test(u) && n(u);
return t && t.length && t.is(":visible") && [
[t[i]().top + r, u]
] || null
}).sort(function(n, t) {
return n[0] - t[0]
}).each(function() {
t.offsets.push(this[0]);
t.targets.push(this[1])
})
};
t.prototype.process = function() {
var n, i = this.$scrollElement.scrollTop() + this.options.offset,
f = this.getScrollHeight(),
e = this.options.offset + f - this.$scrollElement.height(),
t = this.offsets,
r = this.targets,
u = this.activeTarget;
if (this.scrollHeight != f && this.refresh(), i >= e) return u != (n = r[r.length - 1]) && this.activate(n);
if (u && i < t[0]) return this.activeTarget = null, this.clear();
for (n = t.length; n--;) u != r[n] && i >= t[n] && (void 0 === t[n + 1] || i < t[n + 1]) && this.activate(r[n])
};
t.prototype.activate = function(t) {
this.activeTarget = t;
this.clear();
var r = this.selector + '[data-target="' + t + '"],' + this.selector + '[href="' + t + '"]',
i = n(r).parents("li").addClass("active");
i.parent(".dropdown-menu").length && (i = i.closest("li.dropdown").addClass("active"));
i.trigger("activate.bs.scrollspy")
};
t.prototype.clear = function() {
n(this.selector).parentsUntil(this.options.target, ".active").removeClass("active")
};
var r = n.fn.scrollspy;
n.fn.scrollspy = i;
n.fn.scrollspy.Constructor = t;
n.fn.scrollspy.noConflict = function() {
return n.fn.scrollspy = r, this
};
n(window).on("load.bs.scrollspy.data-api", function() {
n('[data-spy="scroll"]').each(function() {
var t = n(this);
i.call(t, t.data())
})
})
}(jQuery); + function(n) {
"use strict";
function r(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.tab");
r || u.data("bs.tab", r = new t(this));
"string" == typeof i && r[i]()
})
}
var t = function(t) {
this.element = n(t)
},
u, i;
t.VERSION = "3.3.7";
t.TRANSITION_DURATION = 150;
t.prototype.show = function() {
var t = this.element,
f = t.closest("ul:not(.dropdown-menu)"),
i = t.data("target"),
u;
if (i || (i = t.attr("href"), i = i && i.replace(/.*(?=#[^\s]*$)/, "")), !t.parent("li").hasClass("active")) {
var r = f.find(".active:last a"),
e = n.Event("hide.bs.tab", {
relatedTarget: t[0]
}),
o = n.Event("show.bs.tab", {
relatedTarget: r[0]
});
(r.trigger(e), t.trigger(o), o.isDefaultPrevented() || e.isDefaultPrevented()) || (u = n(i), this.activate(t.closest("li"), f), this.activate(u, u.parent(), function() {
r.trigger({
type: "hidden.bs.tab",
relatedTarget: t[0]
});
t.trigger({
type: "shown.bs.tab",
relatedTarget: r[0]
})
}))
}
};
t.prototype.activate = function(i, r, u) {
function e() {
f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1);
i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0);
o ? (i[0].offsetWidth, i.addClass("in")) : i.removeClass("fade");
i.parent(".dropdown-menu").length && i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0);
u && u()
}
var f = r.find("> .active"),
o = u && n.support.transition && (f.length && f.hasClass("fade") || !!r.find("> .fade").length);
f.length && o ? f.one("bsTransitionEnd", e).emulateTransitionEnd(t.TRANSITION_DURATION) : e();
f.removeClass("in")
};
u = n.fn.tab;
n.fn.tab = r;
n.fn.tab.Constructor = t;
n.fn.tab.noConflict = function() {
return n.fn.tab = u, this
};
i = function(t) {
t.preventDefault();
r.call(n(this), "show")
};
n(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', i).on("click.bs.tab.data-api", '[data-toggle="pill"]', i)
}(jQuery); + function(n) {
"use strict";
function i(i) {
return this.each(function() {
var u = n(this),
r = u.data("bs.affix"),
f = "object" == typeof i && i;
r || u.data("bs.affix", r = new t(this, f));
"string" == typeof i && r[i]()
})
}
var t = function(i, r) {
this.options = n.extend({}, t.DEFAULTS, r);
this.$target = n(this.options.target).on("scroll.bs.affix.data-api", n.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", n.proxy(this.checkPositionWithEventLoop, this));
this.$element = n(i);
this.affixed = null;
this.unpin = null;
this.pinnedOffset = null;
this.checkPosition()
},
r;
t.VERSION = "3.3.7";
t.RESET = "affix affix-top affix-bottom";
t.DEFAULTS = {
offset: 0,
target: window
};
t.prototype.getState = function(n, t, i, r) {
var u = this.$target.scrollTop(),
f = this.$element.offset(),
e = this.$target.height();
if (null != i && "top" == this.affixed) return u < i && "top";
if ("bottom" == this.affixed) return null != i ? !(u + this.unpin <= f.top) && "bottom" : !(u + e <= n - r) && "bottom";
var o = null == this.affixed,
s = o ? u : f.top,
h = o ? e : t;
return null != i && u <= i ? "top" : null != r && s + h >= n - r && "bottom"
};
t.prototype.getPinnedOffset = function() {
if (this.pinnedOffset) return this.pinnedOffset;
this.$element.removeClass(t.RESET).addClass("affix");
var n = this.$target.scrollTop(),
i = this.$element.offset();
return this.pinnedOffset = i.top - n
};
t.prototype.checkPositionWithEventLoop = function() {
setTimeout(n.proxy(this.checkPosition, this), 1)
};
t.prototype.checkPosition = function() {
var i, e, o;
if (this.$element.is(":visible")) {
var s = this.$element.height(),
r = this.options.offset,
f = r.top,
u = r.bottom,
h = Math.max(n(document).height(), n(document.body).height());
if ("object" != typeof r && (u = f = r), "function" == typeof f && (f = r.top(this.$element)), "function" == typeof u && (u = r.bottom(this.$element)), i = this.getState(h, s, f, u), this.affixed != i) {
if (null != this.unpin && this.$element.css("top", ""), e = "affix" + (i ? "-" + i : ""), o = n.Event(e + ".bs.affix"), this.$element.trigger(o), o.isDefaultPrevented()) return;
this.affixed = i;
this.unpin = "bottom" == i ? this.getPinnedOffset() : null;
this.$element.removeClass(t.RESET).addClass(e).trigger(e.replace("affix", "affixed") + ".bs.affix")
}
"bottom" == i && this.$element.offset({
top: h - s - u
})
}
};
r = n.fn.affix;
n.fn.affix = i;
n.fn.affix.Constructor = t;
n.fn.affix.noConflict = function() {
return n.fn.affix = r, this
};
n(window).on("load", function() {
n('[data-spy="affix"]').each(function() {
var r = n(this),
t = r.data();
t.offset = t.offset || {};
null != t.offsetBottom && (t.offset.bottom = t.offsetBottom);
null != t.offsetTop && (t.offset.top = t.offsetTop);
i.call(r, t)
})
})
}(jQuery),
function() {
function n(t) {
var i = n.modules[t];
if (!i) throw new Error('failed to require "' + t + '"');
return "exports" in i || typeof i.definition != "function" || (i.client = i.component = !0, i.definition.call(this, i.exports = {}, i), delete i.definition), i.exports
}
n.loader = "component";
n.helper = {};
n.helper.semVerSort = function(n, t) {
for (var o = n.version.split("."), s = t.version.split("."), f, e, r, u, i = 0; i < o.length; ++i)
if (f = parseInt(o[i], 10), e = parseInt(s[i], 10), f === e) {
if (r = o[i].substr(("" + f).length), u = s[i].substr(("" + e).length), r === "" && u !== "") return 1;
if (r !== "" && u === "") return -1;
if (r !== "" && u !== "") return r > u ? 1 : -1;
continue
} else return f > e ? 1 : -1;
return 0
};
n.latest = function(t, i) {
function h(n) {
throw new Error('failed to find latest module of "' + n + '"');
}
var e, u, s, l, r;
/(.*)~(.*)/.test(t) || h(t);
var c = Object.keys(n.modules),
f = [],
o = [];
for (e = 0; e < c.length; e++) u = c[e], new RegExp(t + "@").test(u) && (s = u.substr(t.length + 1), l = /(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/.exec(u), l != null ? f.push({
version: s,
name: u
}) : o.push({
version: s,
name: u
}));
return (f.concat(o).length === 0 && h(t), f.length > 0) ? (r = f.sort(n.helper.semVerSort).pop().name, i === !0) ? r : n(r) : (r = o.sort(function(n, t) {
return n.name > t.name
})[0].name, i === !0) ? r : n(r)
};
n.modules = {};
n.register = function(t, i) {
n.modules[t] = {
definition: i
}
};
n.define = function(t, i) {
n.modules[t] = {
exports: i
}
};
n.register("abpetkov~transitionize@0.0.3", function(n, t) {
function i(n, t) {
if (!(this instanceof i)) return new i(n, t);
this.element = n;
this.props = t || {};
this.init()
}
t.exports = i;
i.prototype.isSafari = function() {
return /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor)
};
i.prototype.init = function() {
var n = [],
t;
for (t in this.props) n.push(t + " " + this.props[t]);
this.element.style.transition = n.join(", ");
this.isSafari() && (this.element.style.webkitTransition = n.join(", "))
}
});
n.register("ftlabs~fastclick@v0.6.11", function(n, t) {
function i(n) {
"use strict";
var r, t = this;
if (this.trackingClick = !1, this.trackingClickStart = 0, this.targetElement = null, this.touchStartX = 0, this.touchStartY = 0, this.lastTouchIdentifier = 0, this.touchBoundary = 10, this.layer = n, !n || !n.nodeType) throw new TypeError("Layer must be a document node");
(this.onClick = function() {
return i.prototype.onClick.apply(t, arguments)
}, this.onMouse = function() {
return i.prototype.onMouse.apply(t, arguments)
}, this.onTouchStart = function() {
return i.prototype.onTouchStart.apply(t, arguments)
}, this.onTouchMove = function() {
return i.prototype.onTouchMove.apply(t, arguments)
}, this.onTouchEnd = function() {
return i.prototype.onTouchEnd.apply(t, arguments)
}, this.onTouchCancel = function() {
return i.prototype.onTouchCancel.apply(t, arguments)
}, i.notNeeded(n)) || (this.deviceIsAndroid && (n.addEventListener("mouseover", this.onMouse, !0), n.addEventListener("mousedown", this.onMouse, !0), n.addEventListener("mouseup", this.onMouse, !0)), n.addEventListener("click", this.onClick, !0), n.addEventListener("touchstart", this.onTouchStart, !1), n.addEventListener("touchmove", this.onTouchMove, !1), n.addEventListener("touchend", this.onTouchEnd, !1), n.addEventListener("touchcancel", this.onTouchCancel, !1), Event.prototype.stopImmediatePropagation || (n.removeEventListener = function(t, i, r) {
var u = Node.prototype.removeEventListener;
t === "click" ? u.call(n, t, i.hijacked || i, r) : u.call(n, t, i, r)
}, n.addEventListener = function(t, i, r) {
var u = Node.prototype.addEventListener;
t === "click" ? u.call(n, t, i.hijacked || (i.hijacked = function(n) {
n.propagationStopped || i(n)
}), r) : u.call(n, t, i, r)
}), typeof n.onclick == "function" && (r = n.onclick, n.addEventListener("click", function(n) {
r(n)
}, !1), n.onclick = null))
}
i.prototype.deviceIsAndroid = navigator.userAgent.indexOf("Android") > 0;
i.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent);
i.prototype.deviceIsIOS4 = i.prototype.deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent);
i.prototype.deviceIsIOSWithBadTarget = i.prototype.deviceIsIOS && /OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);
i.prototype.needsClick = function(n) {
"use strict";
switch (n.nodeName.toLowerCase()) {
case "button":
case "select":
case "textarea":
if (n.disabled) return !0;
break;
case "input":
if (this.deviceIsIOS && n.type === "file" || n.disabled) return !0;
break;
case "label":
case "video":
return !0
}
return /\bneedsclick\b/.test(n.className)
};
i.prototype.needsFocus = function(n) {
"use strict";
switch (n.nodeName.toLowerCase()) {
case "textarea":
return !0;
case "select":
return !this.deviceIsAndroid;
case "input":
switch (n.type) {
case "button":
case "checkbox":
case "file":
case "image":
case "radio":
case "submit":
return !1
}
return !n.disabled && !n.readOnly;
default:
return /\bneedsfocus\b/.test(n.className)
}
};
i.prototype.sendClick = function(n, t) {
"use strict";
var r, i;
document.activeElement && document.activeElement !== n && document.activeElement.blur();
i = t.changedTouches[0];
r = document.createEvent("MouseEvents");
r.initMouseEvent(this.determineEventType(n), !0, !0, window, 1, i.screenX, i.screenY, i.clientX, i.clientY, !1, !1, !1, !1, 0, null);
r.forwardedTouchEvent = !0;
n.dispatchEvent(r)
};
i.prototype.determineEventType = function(n) {
"use strict";
return this.deviceIsAndroid && n.tagName.toLowerCase() === "select" ? "mousedown" : "click"
};
i.prototype.focus = function(n) {
"use strict";
var t;
this.deviceIsIOS && n.setSelectionRange && n.type.indexOf("date") !== 0 && n.type !== "time" ? (t = n.value.length, n.setSelectionRange(t, t)) : n.focus()
};
i.prototype.updateScrollParent = function(n) {
"use strict";
var i, t;
if (i = n.fastClickScrollParent, !i || !i.contains(n)) {
t = n;
do {
if (t.scrollHeight > t.offsetHeight) {
i = t;
n.fastClickScrollParent = t;
break
}
t = t.parentElement
} while (t)
}
i && (i.fastClickLastScrollTop = i.scrollTop)
};
i.prototype.getTargetElementFromEventTarget = function(n) {
"use strict";
return n.nodeType === Node.TEXT_NODE ? n.parentNode : n
};
i.prototype.onTouchStart = function(n) {
"use strict";
var i, t, r;
if (n.targetTouches.length > 1) return !0;
if (i = this.getTargetElementFromEventTarget(n.target), t = n.targetTouches[0], this.deviceIsIOS) {
if (r = window.getSelection(), r.rangeCount && !r.isCollapsed) return !0;
if (!this.deviceIsIOS4) {
if (t.identifier === this.lastTouchIdentifier) return n.preventDefault(), !1;
this.lastTouchIdentifier = t.identifier;
this.updateScrollParent(i)
}
}
return this.trackingClick = !0, this.trackingClickStart = n.timeStamp, this.targetElement = i, this.touchStartX = t.pageX, this.touchStartY = t.pageY, n.timeStamp - this.lastClickTime < 200 && n.preventDefault(), !0
};
i.prototype.touchHasMoved = function(n) {
"use strict";
var t = n.changedTouches[0],
i = this.touchBoundary;
return Math.abs(t.pageX - this.touchStartX) > i || Math.abs(t.pageY - this.touchStartY) > i ? !0 : !1
};
i.prototype.onTouchMove = function(n) {
"use strict";
return this.trackingClick ? ((this.targetElement !== this.getTargetElementFromEventTarget(n.target) || this.touchHasMoved(n)) && (this.trackingClick = !1, this.targetElement = null), !0) : !0
};
i.prototype.findControl = function(n) {
"use strict";
return n.control !== undefined ? n.control : n.htmlFor ? document.getElementById(n.htmlFor) : n.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")
};
i.prototype.onTouchEnd = function(n) {
"use strict";
var u, e, i, r, f, t = this.targetElement;
if (!this.trackingClick) return !0;
if (n.timeStamp - this.lastClickTime < 200) return this.cancelNextClick = !0, !0;
if (this.cancelNextClick = !1, this.lastClickTime = n.timeStamp, e = this.trackingClickStart, this.trackingClick = !1, this.trackingClickStart = 0, this.deviceIsIOSWithBadTarget && (f = n.changedTouches[0], t = document.elementFromPoint(f.pageX - window.pageXOffset, f.pageY - window.pageYOffset) || t, t.fastClickScrollParent = this.targetElement.fastClickScrollParent), i = t.tagName.toLowerCase(), i === "label") {
if (u = this.findControl(t), u) {
if (this.focus(t), this.deviceIsAndroid) return !1;
t = u
}
} else if (this.needsFocus(t)) return n.timeStamp - e > 100 || this.deviceIsIOS && window.top !== window && i === "input" ? (this.targetElement = null, !1) : (this.focus(t), this.deviceIsIOS4 && i === "select" || (this.targetElement = null, n.preventDefault()), !1);
return this.deviceIsIOS && !this.deviceIsIOS4 && (r = t.fastClickScrollParent, r && r.fastClickLastScrollTop !== r.scrollTop) ? !0 : (this.needsClick(t) || (n.preventDefault(), this.sendClick(t, n)), !1)
};
i.prototype.onTouchCancel = function() {
"use strict";
this.trackingClick = !1;
this.targetElement = null
};
i.prototype.onMouse = function(n) {
"use strict";
return this.targetElement ? n.forwardedTouchEvent ? !0 : n.cancelable ? !this.needsClick(this.targetElement) || this.cancelNextClick ? (n.stopImmediatePropagation ? n.stopImmediatePropagation() : n.propagationStopped = !0, n.stopPropagation(), n.preventDefault(), !1) : !0 : !0 : !0
};
i.prototype.onClick = function(n) {
"use strict";
var t;
return this.trackingClick ? (this.targetElement = null, this.trackingClick = !1, !0) : n.target.type === "submit" && n.detail === 0 ? !0 : (t = this.onMouse(n), t || (this.targetElement = null), t)
};
i.prototype.destroy = function() {
"use strict";
var n = this.layer;
this.deviceIsAndroid && (n.removeEventListener("mouseover", this.onMouse, !0), n.removeEventListener("mousedown", this.onMouse, !0), n.removeEventListener("mouseup", this.onMouse, !0));
n.removeEventListener("click", this.onClick, !0);
n.removeEventListener("touchstart", this.onTouchStart, !1);
n.removeEventListener("touchmove", this.onTouchMove, !1);
n.removeEventListener("touchend", this.onTouchEnd, !1);
n.removeEventListener("touchcancel", this.onTouchCancel, !1)
};
i.notNeeded = function(n) {
"use strict";
var t, r;
if (typeof window.ontouchstart == "undefined") return !0;
if (r = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1], r)
if (i.prototype.deviceIsAndroid) {
if (t = document.querySelector("meta[name=viewport]"), t && (t.content.indexOf("user-scalable=no") !== -1 || r > 31 && window.innerWidth <= window.screen.width)) return !0
} else return !0;
return n.style.msTouchAction === "none" ? !0 : !1
};
i.attach = function(n) {
"use strict";
return new i(n)
};
typeof define != "undefined" && define.amd ? define(function() {
"use strict";
return i
}) : typeof t != "undefined" && t.exports ? (t.exports = i.attach, t.exports.FastClick = i) : window.FastClick = i
});
n.register("component~indexof@0.0.3", function(n, t) {
t.exports = function(n, t) {
if (n.indexOf) return n.indexOf(t);
for (var i = 0; i < n.length; ++i)
if (n[i] === t) return i;
return -1
}
});
n.register("component~classes@1.2.1", function(t, i) {
function r(n) {
if (!n) throw new Error("A DOM element reference is required");
this.el = n;
this.list = n.classList
}
var u = n("component~indexof@0.0.3"),
f = /\s+/,
e = Object.prototype.toString;
i.exports = function(n) {
return new r(n)
};
r.prototype.add = function(n) {
if (this.list) return this.list.add(n), this;
var t = this.array(),
i = u(t, n);
return ~i || t.push(n), this.el.className = t.join(" "), this
};
r.prototype.remove = function(n) {
if ("[object RegExp]" == e.call(n)) return this.removeMatching(n);
if (this.list) return this.list.remove(n), this;
var t = this.array(),
i = u(t, n);
return ~i && t.splice(i, 1), this.el.className = t.join(" "), this
};
r.prototype.removeMatching = function(n) {
for (var i = this.array(), t = 0; t < i.length; t++) n.test(i[t]) && this.remove(i[t]);
return this
};
r.prototype.toggle = function(n, t) {
return this.list ? ("undefined" != typeof t ? t !== this.list.toggle(n, t) && this.list.toggle(n) : this.list.toggle(n), this) : ("undefined" != typeof t ? t ? this.add(n) : this.remove(n) : this.has(n) ? this.remove(n) : this.add(n), this)
};
r.prototype.array = function() {
var t = this.el.className.replace(/^\s+|\s+$/g, ""),
n = t.split(f);
return "" === n[0] && n.shift(), n
};
r.prototype.has = r.prototype.contains = function(n) {
return this.list ? this.list.contains(n) : !!~u(this.array(), n)
}
});
n.register("component~event@0.1.4", function(n) {
var t = window.addEventListener ? "addEventListener" : "attachEvent",
r = window.removeEventListener ? "removeEventListener" : "detachEvent",
i = t !== "addEventListener" ? "on" : "";
n.bind = function(n, r, u, f) {
return n[t](i + r, u, f || !1), u
};
n.unbind = function(n, t, u, f) {
return n[r](i + t, u, f || !1), u
}
});
n.register("component~query@0.0.3", function(n, t) {
function i(n, t) {
return t.querySelector(n)
}
n = t.exports = function(n, t) {
return t = t || document, i(n, t)
};
n.all = function(n, t) {
return t = t || document, t.querySelectorAll(n)
};
n.engine = function(t) {
if (!t.one) throw new Error(".one callback required");
if (!t.all) throw new Error(".all callback required");
return i = t.one, n.all = t.all, n
}
});
n.register("component~matches-selector@0.1.5", function(t, i) {
function e(n, t) {
var r, i;
if (!n || n.nodeType !== 1) return !1;
if (u) return u.call(n, t);
for (r = f.all(t, n.parentNode), i = 0; i < r.length; ++i)
if (r[i] == n) return !0;
return !1
}
var f = n("component~query@0.0.3"),
r = Element.prototype,
u = r.matches || r.webkitMatchesSelector || r.mozMatchesSelector || r.msMatchesSelector || r.oMatchesSelector;
i.exports = e
});
n.register("component~closest@0.1.4", function(t, i) {
var r = n("component~matches-selector@0.1.5");
i.exports = function(n, t, i, u) {
for (n = i ? {
parentNode: n
} : n, u = u || document;
(n = n.parentNode) && n !== document;) {
if (r(n, t)) return n;
if (n === u) return
}
}
});
n.register("component~delegate@0.2.3", function(t) {
var r = n("component~closest@0.1.4"),
i = n("component~event@0.1.4");
t.bind = function(n, t, u, f, e) {
return i.bind(n, u, function(i) {
var u = i.target || i.srcElement;
i.delegateTarget = r(u, t, !0, n);
i.delegateTarget && f.call(n, i)
}, e)
};
t.unbind = function(n, t, r, u) {
i.unbind(n, t, r, u)
}
});
n.register("component~events@1.0.9", function(t, i) {
function r(n, t) {
if (!(this instanceof r)) return new r(n, t);
if (!n) throw new Error("element required");
if (!t) throw new Error("object required");
this.el = n;
this.obj = t;
this._events = {}
}
function e(n) {
var t = n.split(/ +/);
return {
name: t.shift(),
selector: t.join(" ")
}
}
var u = n("component~event@0.1.4"),
f = n("component~delegate@0.2.3");
i.exports = r;
r.prototype.sub = function(n, t, i) {
this._events[n] = this._events[n] || {};
this._events[n][t] = i
};
r.prototype.bind = function(n, t) {
function i() {
var n = [].slice.call(arguments).concat(c);
h[t].apply(h, n)
}
var o = e(n),
s = this.el,
h = this.obj,
r = o.name,
t = t || "on" + r,
c = [].slice.call(arguments, 2);
return o.selector ? i = f.bind(s, o.selector, r, i) : u.bind(s, r, i), this.sub(r, t, i), i
};
r.prototype.unbind = function(n, t) {
var i, r;
if (0 == arguments.length) return this.unbindAll();
if (1 == arguments.length) return this.unbindAllOf(n);
(i = this._events[n], i) && (r = i[t], r) && u.unbind(this.el, n, r)
};
r.prototype.unbindAll = function() {
for (var n in this._events) this.unbindAllOf(n)
};
r.prototype.unbindAllOf = function(n) {
var t = this._events[n],
i;
if (t)
for (i in t) this.unbind(n, i)
}
});
n.register("switchery", function(t, i) {
function r(n, t) {
if (!(this instanceof r)) return new r(n, t);
this.element = n;
this.options = t || {};
for (var i in u) this.options[i] == null && (this.options[i] = u[i]);
this.element != null && this.element.type == "checkbox" && this.init();
this.isDisabled() === !0 && this.disable()
}
var e = n("abpetkov~transitionize@0.0.3"),
o = n("ftlabs~fastclick@v0.6.11"),
f = n("component~classes@1.2.1"),
s = n("component~events@1.0.9"),
u;
i.exports = r;
u = {
color: "#64bd63",
secondaryColor: "#dfdfdf",
jackColor: "#fff",
jackSecondaryColor: null,
className: "switchery",
disabled: !1,
disabledOpacity: .5,
speed: "0.4s",
size: "default"
};
r.prototype.hide = function() {
this.element.style.display = "none"
};
r.prototype.show = function() {
var n = this.create();
this.insertAfter(this.element, n)
};
r.prototype.create = function() {
return this.switcher = document.createElement("span"), this.jack = document.createElement("small"), this.switcher.appendChild(this.jack), this.switcher.className = this.options.className, this.events = s(this.switcher, this), this.switcher
};
r.prototype.insertAfter = function(n, t) {
n.parentNode.insertBefore(t, n.nextSibling)
};
r.prototype.setPosition = function(n) {
var t = this.isChecked(),
r = this.switcher,
i = this.jack;
n && t ? t = !1 : n && !t && (t = !0);
t === !0 ? (this.element.checked = !0, i.style.left = window.getComputedStyle ? parseInt(window.getComputedStyle(r).width) - parseInt(window.getComputedStyle(i).width) + "px" : parseInt(r.currentStyle.width) - parseInt(i.currentStyle.width) + "px", this.options.color && this.colorize(), this.setSpeed()) : (i.style.left = 0, this.element.checked = !1, this.switcher.style.boxShadow = "inset 0 0 0 0 " + this.options.secondaryColor, this.switcher.style.borderColor = this.options.secondaryColor, this.switcher.style.backgroundColor = this.options.secondaryColor !== u.secondaryColor ? this.options.secondaryColor : "#fff", this.jack.style.backgroundColor = this.options.jackSecondaryColor !== this.options.jackColor ? this.options.jackSecondaryColor : this.options.jackColor, this.setSpeed())
};
r.prototype.setSpeed = function() {
var n = {},
t = {
"background-color": this.options.speed,
left: this.options.speed.replace(/[a-z]/, "") / 2 + "s"
};
n = this.isChecked() ? {
border: this.options.speed,
"box-shadow": this.options.speed,
"background-color": this.options.speed.replace(/[a-z]/, "") * 3 + "s"
} : {
border: this.options.speed,
"box-shadow": this.options.speed
};
e(this.switcher, n);
e(this.jack, t)
};
r.prototype.setSize = function() {
switch (this.options.size) {
case "small":
f(this.switcher).add("switchery-small");
break;
case "large":
f(this.switcher).add("switchery-large");
break;
default:
f(this.switcher).add("switchery-default")
}
};
r.prototype.colorize = function() {
var n = this.switcher.offsetHeight / 2;
this.switcher.style.backgroundColor = this.options.color;
this.switcher.style.borderColor = this.options.color;
this.switcher.style.boxShadow = "inset 0 0 0 " + n + "px " + this.options.color;
this.jack.style.backgroundColor = this.options.jackColor
};
r.prototype.handleOnchange = function() {
if (document.dispatchEvent) {
var n = document.createEvent("HTMLEvents");
n.initEvent("change", !0, !0);
this.element.dispatchEvent(n)
} else this.element.fireEvent("onchange")
};
r.prototype.handleChange = function() {
var t = this,
n = this.element;
n.addEventListener ? n.addEventListener("change", function() {
t.setPosition()
}) : n.attachEvent("onchange", function() {
t.setPosition()
})
};
r.prototype.handleClick = function() {
var n = this.switcher;
o(n);
this.events.bind("click", "bindClick")
};
r.prototype.bindClick = function() {
var n = this.element.parentNode.tagName.toLowerCase(),
t = n === "label" ? !1 : !0;
this.setPosition(t);
this.handleOnchange(this.element.checked)
};
r.prototype.markAsSwitched = function() {
this.element.setAttribute("data-switchery", !0)
};
r.prototype.markedAsSwitched = function() {
return this.element.getAttribute("data-switchery")
};
r.prototype.init = function() {
this.hide();
this.show();
this.setSize();
this.setPosition();
this.markAsSwitched();
this.handleChange();
this.handleClick()
};
r.prototype.isChecked = function() {
return this.element.checked
};
r.prototype.isDisabled = function() {
return this.options.disabled || this.element.disabled || this.element.readOnly
};
r.prototype.destroy = function() {
this.events.unbind()
};
r.prototype.enable = function() {
this.options.disabled && (this.options.disabled = !1);
this.element.disabled && (this.element.disabled = !1);
this.element.readOnly && (this.element.readOnly = !1);
this.switcher.style.opacity = 1;
this.events.bind("click", "bindClick")
};
r.prototype.disable = function() {
this.options.disabled || (this.options.disabled = !0);
this.element.disabled || (this.element.disabled = !0);
this.element.readOnly || (this.element.readOnly = !0);
this.switcher.style.opacity = this.options.disabledOpacity;
this.destroy()
}
});
typeof exports == "object" ? module.exports = n("switchery") : typeof define == "function" && define.amd ? define("Switchery", [], function() {
return n("switchery")
}) : (this || window).Switchery = n("switchery")
}();
loadReports();
window.onscroll = function() {
if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
if (document.isAllReports) return;
if (!$("#logs").hasClass("active")) {
console.log("Открыта другая вкладка");
return
}
document.pageNumber++;
document.additionalNumber++;
document.additionalNumber % 2 == 0 && (console.log("Запрос следующей страницы..."), $.post("/home/getReports", {
page: document.pageNumber
}, function(n) {
viewReports(n)
}))
}
};
$(document).on("click", "#showAllReports", function() {
$("#showAllReports").hide();
$("#fountainG").show();
setTimeout(function() {
document.isAllReports = !0;
$.post("/home/getReportsAll", function(n) {
viewReports(n)
})
}, 500)
});
$(document).on("click", ".switchery", function() {
var n = $(this).parent().parent(),
t;
$(n).hasClass("success") ? $(n).removeClass("success") : $(n).addClass("success");
t = $(n).find(".idReport").text();
$.post("/home/ChangeMarkState", {
idReport: t
}).done(function() {
showNotify()
}).fail(function() {
showError()
})
});
$(document).on("change", ".reportComment", function() {
var n = $(this).val(),
t = $(this).parent().parent(),
i = $(t).find(".idReport").text();
$.post("/home/ChangeComment", {
idReport: i,
comment: n
}).done(function() {
showNotify()
}).fail(function() {
showError()
})
});
$(document).on("click", ".calculate", function() {
var n = $(this),
t = $(this).parent().parent(),
i = $(t).find(".idReport").text();
$.post("/home/getCount", {
idReport: i
}).done(function(t) {
$(n).text(t)
}).fail(function() {
showError()
})
});
$(document).on("change", ".reportShell", function() {
var n = $(this).val(),
t = $(this).parent().parent(),
i = $(t).find(".idReport").text();
$.post("/home/ChangeShell", {
idReport: i,
shell: n
}).done(function() {
showNotify()
}).fail(function() {
showError()
})
});
$(document).on("change", ".reportReserveLogins", function() {
var n = $(this).val(),
t = $(this).parent().parent(),
i = $(t).find(".idReport").text();
$.post("/home/ChangeReservedLogins", {
idReport: i,
logins: n
}).done(function() {
showNotify()
}).fail(function() {
showError()
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment