first commit

This commit is contained in:
kizzroyal
2022-02-16 14:01:00 +07:00
commit f876f79060
294 changed files with 92083 additions and 0 deletions

3736
public/js/Chart.js vendored Normal file

File diff suppressed because it is too large Load Diff

13
public/js/adminlte.min.js vendored Normal file

File diff suppressed because one or more lines are too long

94
public/js/alert.js vendored Normal file
View File

@@ -0,0 +1,94 @@
var i = 0,
a = 0,
isBackspacing = false,
isParagraph = false;
var textArray = [" Hệ thống chẵn lẻ MoMo|Uy tín, giao dịch tự động 24/7 !"];
var speedForward = 0,
speedWait = 30000,
speedBetweenLines = 10,
speedBackspace = 0;
typeWriter("output", textArray);
function typeWriter(id, ar) {
var element = $("#" + id),
aString = ar[a],
eHeader = element.children("h3"),
eParagraph = element.children("h4");
if (!isBackspacing) {
if (i < aString.length) {
if (aString.charAt(i) == "|") {
isParagraph = true;
eHeader.removeClass("cursor");
eParagraph.addClass("cursor");
i++;
setTimeout(function () {
typeWriter(id, ar);
}, speedBetweenLines);
} else {
if (!isParagraph) {
eHeader.text(eHeader.text() + aString.charAt(i));
} else {
eParagraph.text(eParagraph.text() + aString.charAt(i));
}
i++;
setTimeout(function () {
typeWriter(id, ar);
}, speedForward);
}
} else if (i == aString.length) {
isBackspacing = true;
setTimeout(function () {
typeWriter(id, ar);
}, speedWait);
}
} else {
if (eHeader.text().length > 0 || eParagraph.text().length > 0) {
if (eParagraph.text().length > 0) {
eParagraph.text(eParagraph.text().substring(0, eParagraph.text().length - 1));
} else if (eHeader.text().length > 0) {
eParagraph.removeClass("cursor");
eHeader.addClass("cursor");
eHeader.text(eHeader.text().substring(0, eHeader.text().length - 1));
}
setTimeout(function () {
typeWriter(id, ar);
}, speedBackspace);
} else {
isBackspacing = false;
i = 0;
isParagraph = false;
a = (a + 1) % ar.length;
setTimeout(function () {
typeWriter(id, ar);
}, 50);
}
}
}
function setCookie(cname, cvalue, exhour) {
var d = new Date();
d.setTime(d.getTime() + (exhour * 60 * 60 * 1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return false;
}
let cookie = getCookie('modal_alert');
if(!cookie) {
$("#modalAlert").modal("show");
setCookie('modal_alert', true, 0.5);
}

565
public/js/app.js vendored Normal file

File diff suppressed because one or more lines are too long

374
public/js/bootbox.js vendored Normal file
View File

@@ -0,0 +1,374 @@
! function(t, e) {
"use strict";
"function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e(require("jquery")) : t.bootbox = e(t.jQuery)
}(this, function e(p, u) {
"use strict";
var r, n, i, l;
Object.keys || (Object.keys = (r = Object.prototype.hasOwnProperty, n = !{
toString: null
}.propertyIsEnumerable("toString"), l = (i = ["toString", "toLocaleString", "valueOf", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "constructor"]).length, function(t) {
if ("function" != typeof t && ("object" != typeof t || null === t)) throw new TypeError("Object.keys called on non-object");
var e, o, a = [];
for (e in t) r.call(t, e) && a.push(e);
if (n)
for (o = 0; o < l; o++) r.call(t, i[o]) && a.push(i[o]);
return a
}));
var d = {};
d.VERSION = "5.0.0";
var b = {
en: {
OK: "OK",
CANCEL: "Cancel",
CONFIRM: "OK"
}
},
f = {
dialog: '<div class="bootbox modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-body"><div class="bootbox-body"></div></div></div></div></div>',
header: '<div class="modal-header"><h5 class="modal-title"></h5></div>',
footer: '<div class="modal-footer"></div>',
closeButton: '<button type="button" class="bootbox-close-button close" aria-hidden="true">&times;</button>',
form: '<form class="bootbox-form"></form>',
button: '<button type="button" class="btn"></button>',
option: "<option></option>",
promptMessage: '<div class="bootbox-prompt-message"></div>',
inputs: {
text: '<input class="bootbox-input bootbox-input-text form-control" autocomplete="off" type="text" />',
textarea: '<textarea class="bootbox-input bootbox-input-textarea form-control"></textarea>',
email: '<input class="bootbox-input bootbox-input-email form-control" autocomplete="off" type="email" />',
select: '<select class="bootbox-input bootbox-input-select form-control"></select>',
checkbox: '<div class="form-check checkbox"><label class="form-check-label"><input class="form-check-input bootbox-input bootbox-input-checkbox" type="checkbox" /></label></div>',
radio: '<div class="form-check radio"><label class="form-check-label"><input class="form-check-input bootbox-input bootbox-input-radio" type="radio" name="bootbox-radio" /></label></div>',
date: '<input class="bootbox-input bootbox-input-date form-control" autocomplete="off" type="date" />',
time: '<input class="bootbox-input bootbox-input-time form-control" autocomplete="off" type="time" />',
number: '<input class="bootbox-input bootbox-input-number form-control" autocomplete="off" type="number" />',
password: '<input class="bootbox-input bootbox-input-password form-control" autocomplete="off" type="password" />',
range: '<input class="bootbox-input bootbox-input-range form-control-range" autocomplete="off" type="range" />'
}
},
m = {
locale: "en",
backdrop: "static",
animate: !0,
className: null,
closeButton: !0,
show: !0,
container: "body",
value: "",
inputType: "text",
swapButtonOrder: !1,
centerVertical: !1,
multiple: !1,
scrollable: !1
};
function c(t, e, o) {
return p.extend(!0, {}, t, function(t, e) {
var o = t.length,
a = {};
if (o < 1 || 2 < o) throw new Error("Invalid argument length");
return 2 === o || "string" == typeof t[0] ? (a[e[0]] = t[0], a[e[1]] = t[1]) : a = t[0], a
}(e, o))
}
function h(t, e, o, a) {
var r;
a && a[0] && (r = a[0].locale || m.locale, (a[0].swapButtonOrder || m.swapButtonOrder) && (e = e.reverse()));
var n, i, l, s = {
className: "bootbox-" + t,
buttons: function(t, e) {
for (var o = {}, a = 0, r = t.length; a < r; a++) {
var n = t[a],
i = n.toLowerCase(),
l = n.toUpperCase();
o[i] = {
label: (s = l, (c = b[e]) ? c[s] : b.en[s])
}
}
var s, c;
return o
}(e, r)
};
return n = c(s, a, o), l = {}, v(i = e, function(t, e) {
l[e] = !0
}), v(n.buttons, function(t) {
if (l[t] === u) throw new Error('button key "' + t + '" is not allowed (options are ' + i.join(" ") + ")")
}), n
}
function w(t) {
return Object.keys(t).length
}
function v(t, o) {
var a = 0;
p.each(t, function(t, e) {
o(t, e, a++)
})
}
function g(t) {
t.data.dialog.find(".bootbox-accept").first().trigger("focus")
}
function y(t) {
t.target === t.data.dialog[0] && t.data.dialog.remove()
}
function x(t) {
t.target === t.data.dialog[0] && (t.data.dialog.off("escape.close.bb"), t.data.dialog.off("click"))
}
function k(t, e, o) {
t.stopPropagation(), t.preventDefault(), p.isFunction(o) && !1 === o.call(e, t) || e.modal("hide")
}
function E(t) {
return /([01][0-9]|2[0-3]):[0-5][0-9]?:[0-5][0-9]/.test(t)
}
function O(t) {
return /(\d{4})-(\d{2})-(\d{2})/.test(t)
}
return d.locales = function(t) {
return t ? b[t] : b
}, d.addLocale = function(t, o) {
return p.each(["OK", "CANCEL", "CONFIRM"], function(t, e) {
if (!o[e]) throw new Error('Please supply a translation for "' + e + '"')
}), b[t] = {
OK: o.OK,
CANCEL: o.CANCEL,
CONFIRM: o.CONFIRM
}, d
}, d.removeLocale = function(t) {
if ("en" === t) throw new Error('"en" is used as the default and fallback locale and cannot be removed.');
return delete b[t], d
}, d.setLocale = function(t) {
return d.setDefaults("locale", t)
}, d.setDefaults = function() {
var t = {};
return 2 === arguments.length ? t[arguments[0]] = arguments[1] : t = arguments[0], p.extend(m, t), d
}, d.hideAll = function() {
return p(".bootbox").modal("hide"), d
}, d.init = function(t) {
return e(t || p)
}, d.dialog = function(t) {
if (p.fn.modal === u) throw new Error('"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/4.4/getting-started/javascript/ for more details.');
if (t = function(r) {
var n, i;
if ("object" != typeof r) throw new Error("Please supply an object of options");
if (!r.message) throw new Error('"message" option must not be null or an empty string.');
(r = p.extend({}, m, r)).buttons || (r.buttons = {});
return n = r.buttons, i = w(n), v(n, function(t, e, o) {
if (p.isFunction(e) && (e = n[t] = {
callback: e
}), "object" !== p.type(e)) throw new Error('button with key "' + t + '" must be an object');
if (e.label || (e.label = t), !e.className) {
var a = !1;
a = r.swapButtonOrder ? 0 === o : o === i - 1, e.className = i <= 2 && a ? "btn-primary" : "btn-secondary btn-default"
}
}), r
}(t), p.fn.modal.Constructor.VERSION) {
t.fullBootstrapVersion = p.fn.modal.Constructor.VERSION;
var e = t.fullBootstrapVersion.indexOf(".");
t.bootstrap = t.fullBootstrapVersion.substring(0, e)
} else t.bootstrap = "2", t.fullBootstrapVersion = "2.3.2", console.warn("Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.");
var o = p(f.dialog),
a = o.find(".modal-dialog"),
r = o.find(".modal-body"),
n = p(f.header),
i = p(f.footer),
l = t.buttons,
s = {
onEscape: t.onEscape
};
if (r.find(".bootbox-body").html(t.message), 0 < w(t.buttons) && (v(l, function(t, e) {
var o = p(f.button);
switch (o.data("bb-handler", t), o.addClass(e.className), t) {
case "ok":
case "confirm":
o.addClass("bootbox-accept");
break;
case "cancel":
o.addClass("bootbox-cancel")
}
o.html(e.label), i.append(o), s[t] = e.callback
}), r.after(i)), !0 === t.animate && o.addClass("fade"), t.className && o.addClass(t.className), t.size) switch (t.fullBootstrapVersion.substring(0, 3) < "3.1" && console.warn('"size" requires Bootstrap 3.1.0 or higher. You appear to be using ' + t.fullBootstrapVersion + ". Please upgrade to use this option."), t.size) {
case "small":
case "sm":
a.addClass("modal-sm");
break;
case "large":
case "lg":
a.addClass("modal-lg");
break;
case "extra-large":
case "xl":
a.addClass("modal-xl"), t.fullBootstrapVersion.substring(0, 3) < "4.2" && console.warn('Using size "xl"/"extra-large" requires Bootstrap 4.2.0 or higher. You appear to be using ' + t.fullBootstrapVersion + ". Please upgrade to use this option.")
}
if (t.scrollable && (a.addClass("modal-dialog-scrollable"), t.fullBootstrapVersion.substring(0, 3) < "4.3" && console.warn('Using "scrollable" requires Bootstrap 4.3.0 or higher. You appear to be using ' + t.fullBootstrapVersion + ". Please upgrade to use this option.")), t.title && (r.before(n), o.find(".modal-title").html(t.title)), t.closeButton) {
var c = p(f.closeButton);
t.title ? 3 < t.bootstrap ? o.find(".modal-header").append(c) : o.find(".modal-header").prepend(c) : c.prependTo(r)
}
if (t.centerVertical && (a.addClass("modal-dialog-centered"), t.fullBootstrapVersion < "4.0.0" && console.warn('"centerVertical" requires Bootstrap 4.0.0-beta.3 or higher. You appear to be using ' + t.fullBootstrapVersion + ". Please upgrade to use this option.")), o.one("hide.bs.modal", {
dialog: o
}, x), t.onHide) {
if (!p.isFunction(t.onHide)) throw new Error('Argument supplied to "onHide" must be a function');
o.on("hide.bs.modal", t.onHide)
}
if (o.one("hidden.bs.modal", {
dialog: o
}, y), t.onHidden) {
if (!p.isFunction(t.onHidden)) throw new Error('Argument supplied to "onHidden" must be a function');
o.on("hidden.bs.modal", t.onHidden)
}
if (t.onShow) {
if (!p.isFunction(t.onShow)) throw new Error('Argument supplied to "onShow" must be a function');
o.on("show.bs.modal", t.onShow)
}
if (o.one("shown.bs.modal", {
dialog: o
}, g), t.onShown) {
if (!p.isFunction(t.onShown)) throw new Error('Argument supplied to "onShown" must be a function');
o.on("shown.bs.modal", t.onShown)
}
return "static" !== t.backdrop && o.on("click.dismiss.bs.modal", function(t) {
o.children(".modal-backdrop").length && (t.currentTarget = o.children(".modal-backdrop").get(0)), t.target === t.currentTarget && o.trigger("escape.close.bb")
}), o.on("escape.close.bb", function(t) {
s.onEscape && k(t, o, s.onEscape)
}), o.on("click", ".modal-footer button:not(.disabled)", function(t) {
var e = p(this).data("bb-handler");
e !== u && k(t, o, s[e])
}), o.on("click", ".bootbox-close-button", function(t) {
k(t, o, s.onEscape)
}), o.on("keyup", function(t) {
27 === t.which && o.trigger("escape.close.bb")
}), p(t.container).append(o), o.modal({
backdrop: !!t.backdrop && "static",
keyboard: !1,
show: !1
}), t.show && o.modal("show"), o
}, d.alert = function() {
var t;
if ((t = h("alert", ["ok"], ["message", "callback"], arguments)).callback && !p.isFunction(t.callback)) throw new Error('alert requires the "callback" property to be a function when provided');
return t.buttons.ok.callback = t.onEscape = function() {
return !p.isFunction(t.callback) || t.callback.call(this)
}, d.dialog(t)
}, d.confirm = function() {
var t;
if (t = h("confirm", ["cancel", "confirm"], ["message", "callback"], arguments), !p.isFunction(t.callback)) throw new Error("confirm requires a callback");
return t.buttons.cancel.callback = t.onEscape = function() {
return t.callback.call(this, !1)
}, t.buttons.confirm.callback = function() {
return t.callback.call(this, !0)
}, d.dialog(t)
}, d.prompt = function() {
var r, e, t, n, o, a;
if (t = p(f.form), (r = h("prompt", ["cancel", "confirm"], ["title", "callback"], arguments)).value || (r.value = m.value), r.inputType || (r.inputType = m.inputType), o = r.show === u ? m.show : r.show, r.show = !1, r.buttons.cancel.callback = r.onEscape = function() {
return r.callback.call(this, null)
}, r.buttons.confirm.callback = function() {
var t;
if ("checkbox" === r.inputType) t = n.find("input:checked").map(function() {
return p(this).val()
}).get();
else if ("radio" === r.inputType) t = n.find("input:checked").val();
else {
if (n[0].checkValidity && !n[0].checkValidity()) return !1;
t = "select" === r.inputType && !0 === r.multiple ? n.find("option:selected").map(function() {
return p(this).val()
}).get() : n.val()
}
return r.callback.call(this, t)
}, !r.title) throw new Error("prompt requires a title");
if (!p.isFunction(r.callback)) throw new Error("prompt requires a callback");
if (!f.inputs[r.inputType]) throw new Error("Invalid prompt type");
switch (n = p(f.inputs[r.inputType]), r.inputType) {
case "text":
case "textarea":
case "email":
case "password":
n.val(r.value), r.placeholder && n.attr("placeholder", r.placeholder), r.pattern && n.attr("pattern", r.pattern), r.maxlength && n.attr("maxlength", r.maxlength), r.required && n.prop({
required: !0
}), r.rows && !isNaN(parseInt(r.rows)) && "textarea" === r.inputType && n.attr({
rows: r.rows
});
break;
case "date":
case "time":
case "number":
case "range":
if (n.val(r.value), r.placeholder && n.attr("placeholder", r.placeholder), r.pattern && n.attr("pattern", r.pattern), r.required && n.prop({
required: !0
}), "date" !== r.inputType && r.step) {
if (!("any" === r.step || !isNaN(r.step) && 0 < parseFloat(r.step))) throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');
n.attr("step", r.step)
}! function(t, e, o) {
var a = !1,
r = !0,
n = !0;
if ("date" === t) e === u || (r = O(e)) ? o === u || (n = O(o)) || console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.') : console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.');
else if ("time" === t) {
if (e !== u && !(r = E(e))) throw new Error('"min" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');
if (o !== u && !(n = E(o))) throw new Error('"max" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.')
} else {
if (e !== u && isNaN(e)) throw r = !1, new Error('"min" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.');
if (o !== u && isNaN(o)) throw n = !1, new Error('"max" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.')
}
if (r && n) {
if (o <= e) throw new Error('"max" must be greater than "min". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');
a = !0
}
return a
}(r.inputType, r.min, r.max) || (r.min !== u && n.attr("min", r.min), r.max !== u && n.attr("max", r.max));
break;
case "select":
var i = {};
if (a = r.inputOptions || [], !p.isArray(a)) throw new Error("Please pass an array of input options");
if (!a.length) throw new Error('prompt with "inputType" set to "select" requires at least one option');
r.placeholder && n.attr("placeholder", r.placeholder), r.required && n.prop({
required: !0
}), r.multiple && n.prop({
multiple: !0
}), v(a, function(t, e) {
var o = n;
if (e.value === u || e.text === u) throw new Error('each option needs a "value" property and a "text" property');
e.group && (i[e.group] || (i[e.group] = p("<optgroup />").attr("label", e.group)), o = i[e.group]);
var a = p(f.option);
a.attr("value", e.value).text(e.text), o.append(a)
}), v(i, function(t, e) {
n.append(e)
}), n.val(r.value);
break;
case "checkbox":
var l = p.isArray(r.value) ? r.value : [r.value];
if (!(a = r.inputOptions || []).length) throw new Error('prompt with "inputType" set to "checkbox" requires at least one option');
n = p('<div class="bootbox-checkbox-list"></div>'), v(a, function(t, o) {
if (o.value === u || o.text === u) throw new Error('each option needs a "value" property and a "text" property');
var a = p(f.inputs[r.inputType]);
a.find("input").attr("value", o.value), a.find("label").append("\n" + o.text), v(l, function(t, e) {
e === o.value && a.find("input").prop("checked", !0)
}), n.append(a)
});
break;
case "radio":
if (r.value !== u && p.isArray(r.value)) throw new Error('prompt with "inputType" set to "radio" requires a single, non-array value for "value"');
if (!(a = r.inputOptions || []).length) throw new Error('prompt with "inputType" set to "radio" requires at least one option');
n = p('<div class="bootbox-radiobutton-list"></div>');
var s = !0;
v(a, function(t, e) {
if (e.value === u || e.text === u) throw new Error('each option needs a "value" property and a "text" property');
var o = p(f.inputs[r.inputType]);
o.find("input").attr("value", e.value), o.find("label").append("\n" + e.text), r.value !== u && e.value === r.value && (o.find("input").prop("checked", !0), s = !1), n.append(o)
}), s && n.find('input[type="radio"]').first().prop("checked", !0)
}
if (t.append(n), t.on("submit", function(t) {
t.preventDefault(), t.stopPropagation(), e.find(".bootbox-accept").trigger("click")
}), "" !== p.trim(r.message)) {
var c = p(f.promptMessage).html(r.message);
t.prepend(c), r.message = t
} else r.message = t;
return (e = d.dialog(r)).off("shown.bs.modal", g), e.on("shown.bs.modal", function() {
n.focus()
}), !0 === o && e.modal("show"), e
}, d
});

File diff suppressed because one or more lines are too long

759
public/js/bootstrap.min.js vendored Normal file
View File

@@ -0,0 +1,759 @@
/*!
* Bootstrap v3.1.1 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if ("undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); + function(a) {
"use strict";
function b() {
var a = document.createElement("bootstrap"),
b = {
WebkitTransition: "webkitTransitionEnd",
MozTransition: "transitionend",
OTransition: "oTransitionEnd otransitionend",
transition: "transitionend"
};
for (var c in b)
if (void 0 !== a.style[c]) return {
end: b[c]
};
return !1
}
a.fn.emulateTransitionEnd = function(b) {
var c = !1,
d = this;
a(this).one(a.support.transition.end, function() {
c = !0
});
var e = function() {
c || a(d).trigger(a.support.transition.end)
};
return setTimeout(e, b), this
}, a(function() {
a.support.transition = b()
})
}(jQuery), + function(a) {
"use strict";
var b = '[data-dismiss="alert"]',
c = function(c) {
a(c).on("click", b, this.close)
};
c.prototype.close = function(b) {
function c() {
f.trigger("closed.bs.alert").remove()
}
var d = a(this),
e = d.attr("data-target");
e || (e = d.attr("href"), e = e && e.replace(/.*(?=#[^\s]*$)/, ""));
var f = a(e);
b && b.preventDefault(), f.length || (f = d.hasClass("alert") ? d : d.parent()), f.trigger(b = a.Event("close.bs.alert")), b.isDefaultPrevented() || (f.removeClass("in"), a.support.transition && f.hasClass("fade") ? f.one(a.support.transition.end, c).emulateTransitionEnd(150) : c())
};
var d = a.fn.alert;
a.fn.alert = function(b) {
return this.each(function() {
var d = a(this),
e = d.data("bs.alert");
e || d.data("bs.alert", e = new c(this)), "string" == typeof b && e[b].call(d)
})
}, a.fn.alert.Constructor = c, a.fn.alert.noConflict = function() {
return a.fn.alert = d, this
}, a(document).on("click.bs.alert.data-api", b, c.prototype.close)
}(jQuery), + function(a) {
"use strict";
var b = function(c, d) {
this.$element = a(c), this.options = a.extend({}, b.DEFAULTS, d), this.isLoading = !1
};
b.DEFAULTS = {
loadingText: "loading..."
}, b.prototype.setState = function(b) {
var c = "disabled",
d = this.$element,
e = d.is("input") ? "val" : "html",
f = d.data();
b += "Text", f.resetText || d.data("resetText", d[e]()), d[e](f[b] || this.options[b]), setTimeout(a.proxy(function() {
"loadingText" == b ? (this.isLoading = !0, d.addClass(c).attr(c, c)) : this.isLoading && (this.isLoading = !1, d.removeClass(c).removeAttr(c))
}, this), 0)
}, b.prototype.toggle = function() {
var a = !0,
b = this.$element.closest('[data-toggle="buttons"]');
if (b.length) {
var c = this.$element.find("input");
"radio" == c.prop("type") && (c.prop("checked") && this.$element.hasClass("active") ? a = !1 : b.find(".active").removeClass("active")), a && c.prop("checked", !this.$element.hasClass("active")).trigger("change")
}
a && this.$element.toggleClass("active")
};
var c = a.fn.button;
a.fn.button = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.button"),
f = "object" == typeof c && c;
e || d.data("bs.button", e = new b(this, f)), "toggle" == c ? e.toggle() : c && e.setState(c)
})
}, a.fn.button.Constructor = b, a.fn.button.noConflict = function() {
return a.fn.button = c, this
}, a(document).on("click.bs.button.data-api", "[data-toggle^=button]", function(b) {
var c = a(b.target);
c.hasClass("btn") || (c = c.closest(".btn")), c.button("toggle"), b.preventDefault()
})
}(jQuery), + function(a) {
"use strict";
var b = function(b, c) {
this.$element = a(b), this.$indicators = this.$element.find(".carousel-indicators"), this.options = c, this.paused = this.sliding = this.interval = this.$active = this.$items = null, "hover" == this.options.pause && this.$element.on("mouseenter", a.proxy(this.pause, this)).on("mouseleave", a.proxy(this.cycle, this))
};
b.DEFAULTS = {
interval: 5e3,
pause: "hover",
wrap: !0
}, b.prototype.cycle = function(b) {
return b || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), this
}, b.prototype.getActiveIndex = function() {
return this.$active = this.$element.find(".item.active"), this.$items = this.$active.parent().children(), this.$items.index(this.$active)
}, b.prototype.to = function(b) {
var c = this,
d = this.getActiveIndex();
return b > this.$items.length - 1 || 0 > b ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() {
c.to(b)
}) : d == b ? this.pause().cycle() : this.slide(b > d ? "next" : "prev", a(this.$items[b]))
}, b.prototype.pause = function(b) {
return b || (this.paused = !0), this.$element.find(".next, .prev").length && a.support.transition && (this.$element.trigger(a.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this
}, b.prototype.next = function() {
return this.sliding ? void 0 : this.slide("next")
}, b.prototype.prev = function() {
return this.sliding ? void 0 : this.slide("prev")
}, b.prototype.slide = function(b, c) {
var d = this.$element.find(".item.active"),
e = c || d[b](),
f = this.interval,
g = "next" == b ? "left" : "right",
h = "next" == b ? "first" : "last",
i = this;
if (!e.length) {
if (!this.options.wrap) return;
e = this.$element.find(".item")[h]()
}
if (e.hasClass("active")) return this.sliding = !1;
var j = a.Event("slide.bs.carousel", {
relatedTarget: e[0],
direction: g
});
return this.$element.trigger(j), j.isDefaultPrevented() ? void 0 : (this.sliding = !0, f && this.pause(), this.$indicators.length && (this.$indicators.find(".active").removeClass("active"), this.$element.one("slid.bs.carousel", function() {
var b = a(i.$indicators.children()[i.getActiveIndex()]);
b && b.addClass("active")
})), a.support.transition && this.$element.hasClass("slide") ? (e.addClass(b), e[0].offsetWidth, d.addClass(g), e.addClass(g), d.one(a.support.transition.end, function() {
e.removeClass([b, g].join(" ")).addClass("active"), d.removeClass(["active", g].join(" ")), i.sliding = !1, setTimeout(function() {
i.$element.trigger("slid.bs.carousel")
}, 0)
}).emulateTransitionEnd(1e3 * d.css("transition-duration").slice(0, -1))) : (d.removeClass("active"), e.addClass("active"), this.sliding = !1, this.$element.trigger("slid.bs.carousel")), f && this.cycle(), this)
};
var c = a.fn.carousel;
a.fn.carousel = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.carousel"),
f = a.extend({}, b.DEFAULTS, d.data(), "object" == typeof c && c),
g = "string" == typeof c ? c : f.slide;
e || d.data("bs.carousel", e = new b(this, f)), "number" == typeof c ? e.to(c) : g ? e[g]() : f.interval && e.pause().cycle()
})
}, a.fn.carousel.Constructor = b, a.fn.carousel.noConflict = function() {
return a.fn.carousel = c, this
}, a(document).on("click.bs.carousel.data-api", "[data-slide], [data-slide-to]", function(b) {
var c, d = a(this),
e = a(d.attr("data-target") || (c = d.attr("href")) && c.replace(/.*(?=#[^\s]+$)/, "")),
f = a.extend({}, e.data(), d.data()),
g = d.attr("data-slide-to");
g && (f.interval = !1), e.carousel(f), (g = d.attr("data-slide-to")) && e.data("bs.carousel").to(g), b.preventDefault()
}), a(window).on("load", function() {
a('[data-ride="carousel"]').each(function() {
var b = a(this);
b.carousel(b.data())
})
})
}(jQuery), + function(a) {
"use strict";
var b = function(c, d) {
this.$element = a(c), this.options = a.extend({}, b.DEFAULTS, d), this.transitioning = null, this.options.parent && (this.$parent = a(this.options.parent)), this.options.toggle && this.toggle()
};
b.DEFAULTS = {
toggle: !0
}, b.prototype.dimension = function() {
var a = this.$element.hasClass("width");
return a ? "width" : "height"
}, b.prototype.show = function() {
if (!this.transitioning && !this.$element.hasClass("in")) {
var b = a.Event("show.bs.collapse");
if (this.$element.trigger(b), !b.isDefaultPrevented()) {
var c = this.$parent && this.$parent.find("> .panel > .in");
if (c && c.length) {
var d = c.data("bs.collapse");
if (d && d.transitioning) return;
c.collapse("hide"), d || c.data("bs.collapse", null)
}
var e = this.dimension();
this.$element.removeClass("collapse").addClass("collapsing")[e](0), this.transitioning = 1;
var f = function() {
this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"), this.transitioning = 0, this.$element.trigger("shown.bs.collapse")
};
if (!a.support.transition) return f.call(this);
var g = a.camelCase(["scroll", e].join("-"));
this.$element.one(a.support.transition.end, a.proxy(f, this)).emulateTransitionEnd(350)[e](this.$element[0][g])
}
}
}, b.prototype.hide = function() {
if (!this.transitioning && this.$element.hasClass("in")) {
var b = a.Event("hide.bs.collapse");
if (this.$element.trigger(b), !b.isDefaultPrevented()) {
var c = this.dimension();
this.$element[c](this.$element[c]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"), this.transitioning = 1;
var d = function() {
this.transitioning = 0, this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")
};
return a.support.transition ? void this.$element[c](0).one(a.support.transition.end, a.proxy(d, this)).emulateTransitionEnd(350) : d.call(this)
}
}
}, b.prototype.toggle = function() {
this[this.$element.hasClass("in") ? "hide" : "show"]()
};
var c = a.fn.collapse;
a.fn.collapse = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.collapse"),
f = a.extend({}, b.DEFAULTS, d.data(), "object" == typeof c && c);
!e && f.toggle && "show" == c && (c = !c), e || d.data("bs.collapse", e = new b(this, f)), "string" == typeof c && e[c]()
})
}, a.fn.collapse.Constructor = b, a.fn.collapse.noConflict = function() {
return a.fn.collapse = c, this
}, a(document).on("click.bs.collapse.data-api", "[data-toggle=collapse]", function(b) {
var c, d = a(this),
e = d.attr("data-target") || b.preventDefault() || (c = d.attr("href")) && c.replace(/.*(?=#[^\s]+$)/, ""),
f = a(e),
g = f.data("bs.collapse"),
h = g ? "toggle" : d.data(),
i = d.attr("data-parent"),
j = i && a(i);
g && g.transitioning || (j && j.find('[data-toggle=collapse][data-parent="' + i + '"]').not(d).addClass("collapsed"), d[f.hasClass("in") ? "addClass" : "removeClass"]("collapsed")), f.collapse(h)
})
}(jQuery), + function(a) {
"use strict";
function b(b) {
a(d).remove(), a(e).each(function() {
var d = c(a(this)),
e = {
relatedTarget: this
};
d.hasClass("open") && (d.trigger(b = a.Event("hide.bs.dropdown", e)), b.isDefaultPrevented() || d.removeClass("open").trigger("hidden.bs.dropdown", e))
})
}
function c(b) {
var c = b.attr("data-target");
c || (c = b.attr("href"), c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, ""));
var d = c && a(c);
return d && d.length ? d : b.parent()
}
var d = ".dropdown-backdrop",
e = "[data-toggle=dropdown]",
f = function(b) {
a(b).on("click.bs.dropdown", this.toggle)
};
f.prototype.toggle = function(d) {
var e = a(this);
if (!e.is(".disabled, :disabled")) {
var f = c(e),
g = f.hasClass("open");
if (b(), !g) {
"ontouchstart" in document.documentElement && !f.closest(".navbar-nav").length && a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click", b);
var h = {
relatedTarget: this
};
if (f.trigger(d = a.Event("show.bs.dropdown", h)), d.isDefaultPrevented()) return;
f.toggleClass("open").trigger("shown.bs.dropdown", h), e.focus()
}
return !1
}
}, f.prototype.keydown = function(b) {
if (/(38|40|27)/.test(b.keyCode)) {
var d = a(this);
if (b.preventDefault(), b.stopPropagation(), !d.is(".disabled, :disabled")) {
var f = c(d),
g = f.hasClass("open");
if (!g || g && 27 == b.keyCode) return 27 == b.which && f.find(e).focus(), d.click();
var h = " li:not(.divider):visible a",
i = f.find("[role=menu]" + h + ", [role=listbox]" + h);
if (i.length) {
var j = i.index(i.filter(":focus"));
38 == b.keyCode && j > 0 && j--, 40 == b.keyCode && j < i.length - 1 && j++, ~j || (j = 0), i.eq(j).focus()
}
}
}
};
var g = a.fn.dropdown;
a.fn.dropdown = function(b) {
return this.each(function() {
var c = a(this),
d = c.data("bs.dropdown");
d || c.data("bs.dropdown", d = new f(this)), "string" == typeof b && d[b].call(c)
})
}, a.fn.dropdown.Constructor = f, a.fn.dropdown.noConflict = function() {
return a.fn.dropdown = g, this
}, a(document).on("click.bs.dropdown.data-api", b).on("click.bs.dropdown.data-api", ".dropdown form", function(a) {
a.stopPropagation()
}).on("click.bs.dropdown.data-api", e, f.prototype.toggle).on("keydown.bs.dropdown.data-api", e + ", [role=menu], [role=listbox]", f.prototype.keydown)
}(jQuery), + function(a) {
"use strict";
var b = function(b, c) {
this.options = c, this.$element = a(b), this.$backdrop = this.isShown = null, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, a.proxy(function() {
this.$element.trigger("loaded.bs.modal")
}, this))
};
b.DEFAULTS = {
backdrop: !0,
keyboard: !0,
show: !0
}, b.prototype.toggle = function(a) {
return this[this.isShown ? "hide" : "show"](a)
}, b.prototype.show = function(b) {
var c = this,
d = a.Event("show.bs.modal", {
relatedTarget: b
});
this.$element.trigger(d), this.isShown || d.isDefaultPrevented() || (this.isShown = !0, this.escape(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)), this.backdrop(function() {
var d = a.support.transition && c.$element.hasClass("fade");
c.$element.parent().length || c.$element.appendTo(document.body), c.$element.show().scrollTop(0), d && c.$element[0].offsetWidth, c.$element.addClass("in").attr("aria-hidden", !1), c.enforceFocus();
var e = a.Event("shown.bs.modal", {
relatedTarget: b
});
d ? c.$element.find(".modal-dialog").one(a.support.transition.end, function() {
c.$element.focus().trigger(e)
}).emulateTransitionEnd(300) : c.$element.focus().trigger(e)
}))
}, b.prototype.hide = function(b) {
b && b.preventDefault(), b = a.Event("hide.bs.modal"), this.$element.trigger(b), this.isShown && !b.isDefaultPrevented() && (this.isShown = !1, this.escape(), a(document).off("focusin.bs.modal"), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.bs.modal"), a.support.transition && this.$element.hasClass("fade") ? this.$element.one(a.support.transition.end, a.proxy(this.hideModal, this)).emulateTransitionEnd(300) : this.hideModal())
}, b.prototype.enforceFocus = function() {
a(document).off("focusin.bs.modal").on("focusin.bs.modal", a.proxy(function(a) {
this.$element[0] === a.target || this.$element.has(a.target).length || this.$element.focus()
}, this))
}, b.prototype.escape = function() {
this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.bs.modal", a.proxy(function(a) {
27 == a.which && this.hide()
}, this)) : this.isShown || this.$element.off("keyup.dismiss.bs.modal")
}, b.prototype.hideModal = function() {
var a = this;
this.$element.hide(), this.backdrop(function() {
a.removeBackdrop(), a.$element.trigger("hidden.bs.modal")
})
}, b.prototype.removeBackdrop = function() {
this.$backdrop && this.$backdrop.remove(), this.$backdrop = null
}, b.prototype.backdrop = function(b) {
var c = this.$element.hasClass("fade") ? "fade" : "";
if (this.isShown && this.options.backdrop) {
var d = a.support.transition && c;
if (this.$backdrop = a('<div class="modal-backdrop ' + c + '" />').appendTo(document.body), this.$element.on("click.dismiss.bs.modal", a.proxy(function(a) {
a.target === a.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this))
}, this)), d && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !b) return;
d ? this.$backdrop.one(a.support.transition.end, b).emulateTransitionEnd(150) : b()
} else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(a.support.transition.end, b).emulateTransitionEnd(150) : b()) : b && b()
};
var c = a.fn.modal;
a.fn.modal = function(c, d) {
return this.each(function() {
var e = a(this),
f = e.data("bs.modal"),
g = a.extend({}, b.DEFAULTS, e.data(), "object" == typeof c && c);
f || e.data("bs.modal", f = new b(this, g)), "string" == typeof c ? f[c](d) : g.show && f.show(d)
})
}, a.fn.modal.Constructor = b, a.fn.modal.noConflict = function() {
return a.fn.modal = c, this
}, a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(b) {
var c = a(this),
d = c.attr("href"),
e = a(c.attr("data-target") || d && d.replace(/.*(?=#[^\s]+$)/, "")),
f = e.data("bs.modal") ? "toggle" : a.extend({
remote: !/#/.test(d) && d
}, e.data(), c.data());
c.is("a") && b.preventDefault(), e.modal(f, this).one("hide", function() {
c.is(":visible") && c.focus()
})
}), a(document).on("show.bs.modal", ".modal", function() {
a(document.body).addClass("modal-open")
}).on("hidden.bs.modal", ".modal", function() {
a(document.body).removeClass("modal-open")
})
}(jQuery), + function(a) {
"use strict";
var b = function(a, b) {
this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null, this.init("tooltip", a, b)
};
b.DEFAULTS = {
animation: !0,
placement: "top",
selector: !1,
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
trigger: "hover focus",
title: "",
delay: 0,
html: !1,
container: !1
}, b.prototype.init = function(b, c, d) {
this.enabled = !0, this.type = b, this.$element = a(c), this.options = this.getOptions(d);
for (var e = this.options.trigger.split(" "), f = e.length; f--;) {
var g = e[f];
if ("click" == g) this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this));
else if ("manual" != g) {
var h = "hover" == g ? "mouseenter" : "focusin",
i = "hover" == g ? "mouseleave" : "focusout";
this.$element.on(h + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(i + "." + this.type, this.options.selector, a.proxy(this.leave, this))
}
}
this.options.selector ? this._options = a.extend({}, this.options, {
trigger: "manual",
selector: ""
}) : this.fixTitle()
}, b.prototype.getDefaults = function() {
return b.DEFAULTS
}, b.prototype.getOptions = function(b) {
return b = a.extend({}, this.getDefaults(), this.$element.data(), b), b.delay && "number" == typeof b.delay && (b.delay = {
show: b.delay,
hide: b.delay
}), b
}, b.prototype.getDelegateOptions = function() {
var b = {},
c = this.getDefaults();
return this._options && a.each(this._options, function(a, d) {
c[a] != d && (b[a] = d)
}), b
}, b.prototype.enter = function(b) {
var c = b instanceof this.constructor ? b : a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
return clearTimeout(c.timeout), c.hoverState = "in", c.options.delay && c.options.delay.show ? void(c.timeout = setTimeout(function() {
"in" == c.hoverState && c.show()
}, c.options.delay.show)) : c.show()
}, b.prototype.leave = function(b) {
var c = b instanceof this.constructor ? b : a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
return clearTimeout(c.timeout), c.hoverState = "out", c.options.delay && c.options.delay.hide ? void(c.timeout = setTimeout(function() {
"out" == c.hoverState && c.hide()
}, c.options.delay.hide)) : c.hide()
}, b.prototype.show = function() {
var b = a.Event("show.bs." + this.type);
if (this.hasContent() && this.enabled) {
if (this.$element.trigger(b), b.isDefaultPrevented()) return;
var c = this,
d = this.tip();
this.setContent(), this.options.animation && d.addClass("fade");
var e = "function" == typeof this.options.placement ? this.options.placement.call(this, d[0], this.$element[0]) : this.options.placement,
f = /\s?auto?\s?/i,
g = f.test(e);
g && (e = e.replace(f, "") || "top"), d.detach().css({
top: 0,
left: 0,
display: "block"
}).addClass(e), this.options.container ? d.appendTo(this.options.container) : d.insertAfter(this.$element);
var h = this.getPosition(),
i = d[0].offsetWidth,
j = d[0].offsetHeight;
if (g) {
var k = this.$element.parent(),
l = e,
m = document.documentElement.scrollTop || document.body.scrollTop,
n = "body" == this.options.container ? window.innerWidth : k.outerWidth(),
o = "body" == this.options.container ? window.innerHeight : k.outerHeight(),
p = "body" == this.options.container ? 0 : k.offset().left;
e = "bottom" == e && h.top + h.height + j - m > o ? "top" : "top" == e && h.top - m - j < 0 ? "bottom" : "right" == e && h.right + i > n ? "left" : "left" == e && h.left - i < p ? "right" : e, d.removeClass(l).addClass(e)
}
var q = this.getCalculatedOffset(e, h, i, j);
this.applyPlacement(q, e), this.hoverState = null;
var r = function() {
c.$element.trigger("shown.bs." + c.type)
};
a.support.transition && this.$tip.hasClass("fade") ? d.one(a.support.transition.end, r).emulateTransitionEnd(150) : r()
}
}, b.prototype.applyPlacement = function(b, c) {
var d, e = this.tip(),
f = e[0].offsetWidth,
g = e[0].offsetHeight,
h = parseInt(e.css("margin-top"), 10),
i = parseInt(e.css("margin-left"), 10);
isNaN(h) && (h = 0), isNaN(i) && (i = 0), b.top = b.top + h, b.left = b.left + i, a.offset.setOffset(e[0], a.extend({
using: function(a) {
e.css({
top: Math.round(a.top),
left: Math.round(a.left)
})
}
}, b), 0), e.addClass("in");
var j = e[0].offsetWidth,
k = e[0].offsetHeight;
if ("top" == c && k != g && (d = !0, b.top = b.top + g - k), /bottom|top/.test(c)) {
var l = 0;
b.left < 0 && (l = -2 * b.left, b.left = 0, e.offset(b), j = e[0].offsetWidth, k = e[0].offsetHeight), this.replaceArrow(l - f + j, j, "left")
} else this.replaceArrow(k - g, k, "top");
d && e.offset(b)
}, b.prototype.replaceArrow = function(a, b, c) {
this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "")
}, b.prototype.setContent = function() {
var a = this.tip(),
b = this.getTitle();
a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right")
}, b.prototype.hide = function() {
function b() {
"in" != c.hoverState && d.detach(), c.$element.trigger("hidden.bs." + c.type)
}
var c = this,
d = this.tip(),
e = a.Event("hide.bs." + this.type);
return this.$element.trigger(e), e.isDefaultPrevented() ? void 0 : (d.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? d.one(a.support.transition.end, b).emulateTransitionEnd(150) : b(), this.hoverState = null, this)
}, b.prototype.fixTitle = function() {
var a = this.$element;
(a.attr("title") || "string" != typeof a.attr("data-original-title")) && a.attr("data-original-title", a.attr("title") || "").attr("title", "")
}, b.prototype.hasContent = function() {
return this.getTitle()
}, b.prototype.getPosition = function() {
var b = this.$element[0];
return a.extend({}, "function" == typeof b.getBoundingClientRect ? b.getBoundingClientRect() : {
width: b.offsetWidth,
height: b.offsetHeight
}, this.$element.offset())
}, b.prototype.getCalculatedOffset = function(a, b, c, d) {
return "bottom" == a ? {
top: b.top + b.height,
left: b.left + b.width / 2 - c / 2
} : "top" == a ? {
top: b.top - d,
left: b.left + b.width / 2 - c / 2
} : "left" == a ? {
top: b.top + b.height / 2 - d / 2,
left: b.left - c
} : {
top: b.top + b.height / 2 - d / 2,
left: b.left + b.width
}
}, b.prototype.getTitle = function() {
var a, b = this.$element,
c = this.options;
return a = b.attr("data-original-title") || ("function" == typeof c.title ? c.title.call(b[0]) : c.title)
}, b.prototype.tip = function() {
return this.$tip = this.$tip || a(this.options.template)
}, b.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
}, b.prototype.validate = function() {
this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
}, b.prototype.enable = function() {
this.enabled = !0
}, b.prototype.disable = function() {
this.enabled = !1
}, b.prototype.toggleEnabled = function() {
this.enabled = !this.enabled
}, b.prototype.toggle = function(b) {
var c = b ? a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type) : this;
c.tip().hasClass("in") ? c.leave(c) : c.enter(c)
}, b.prototype.destroy = function() {
clearTimeout(this.timeout), this.hide().$element.off("." + this.type).removeData("bs." + this.type)
};
var c = a.fn.tooltip;
a.fn.tooltip = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.tooltip"),
f = "object" == typeof c && c;
(e || "destroy" != c) && (e || d.data("bs.tooltip", e = new b(this, f)), "string" == typeof c && e[c]())
})
}, a.fn.tooltip.Constructor = b, a.fn.tooltip.noConflict = function() {
return a.fn.tooltip = c, this
}
}(jQuery), + function(a) {
"use strict";
var b = function(a, b) {
this.init("popover", a, b)
};
if (!a.fn.tooltip) throw new Error("Popover requires tooltip.js");
b.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, {
placement: "right",
trigger: "click",
content: "",
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
}), b.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype), b.prototype.constructor = b, b.prototype.getDefaults = function() {
return b.DEFAULTS
}, b.prototype.setContent = function() {
var a = this.tip(),
b = this.getTitle(),
c = this.getContent();
a.find(".popover-title")[this.options.html ? "html" : "text"](b), a.find(".popover-content")[this.options.html ? "string" == typeof c ? "html" : "append" : "text"](c), a.removeClass("fade top bottom left right in"), a.find(".popover-title").html() || a.find(".popover-title").hide()
}, b.prototype.hasContent = function() {
return this.getTitle() || this.getContent()
}, b.prototype.getContent = function() {
var a = this.$element,
b = this.options;
return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content)
}, b.prototype.arrow = function() {
return this.$arrow = this.$arrow || this.tip().find(".arrow")
}, b.prototype.tip = function() {
return this.$tip || (this.$tip = a(this.options.template)), this.$tip
};
var c = a.fn.popover;
a.fn.popover = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.popover"),
f = "object" == typeof c && c;
(e || "destroy" != c) && (e || d.data("bs.popover", e = new b(this, f)), "string" == typeof c && e[c]())
})
}, a.fn.popover.Constructor = b, a.fn.popover.noConflict = function() {
return a.fn.popover = c, this
}
}(jQuery), + function(a) {
"use strict";
function b(c, d) {
var e, f = a.proxy(this.process, this);
this.$element = a(a(c).is("body") ? window : c), this.$body = a("body"), this.$scrollElement = this.$element.on("scroll.bs.scroll-spy.data-api", f), this.options = a.extend({}, b.DEFAULTS, d), this.selector = (this.options.target || (e = a(c).attr("href")) && e.replace(/.*(?=#[^\s]+$)/, "") || "") + " .nav li > a", this.offsets = a([]), this.targets = a([]), this.activeTarget = null, this.refresh(), this.process()
}
b.DEFAULTS = {
offset: 10
}, b.prototype.refresh = function() {
var b = this.$element[0] == window ? "offset" : "position";
this.offsets = a([]), this.targets = a([]); {
var c = this;
this.$body.find(this.selector).map(function() {
var d = a(this),
e = d.data("target") || d.attr("href"),
f = /^#./.test(e) && a(e);
return f && f.length && f.is(":visible") && [
[f[b]().top + (!a.isWindow(c.$scrollElement.get(0)) && c.$scrollElement.scrollTop()), e]
] || null
}).sort(function(a, b) {
return a[0] - b[0]
}).each(function() {
c.offsets.push(this[0]), c.targets.push(this[1])
})
}
}, b.prototype.process = function() {
var a, b = this.$scrollElement.scrollTop() + this.options.offset,
c = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight,
d = c - this.$scrollElement.height(),
e = this.offsets,
f = this.targets,
g = this.activeTarget;
if (b >= d) return g != (a = f.last()[0]) && this.activate(a);
if (g && b <= e[0]) return g != (a = f[0]) && this.activate(a);
for (a = e.length; a--;) g != f[a] && b >= e[a] && (!e[a + 1] || b <= e[a + 1]) && this.activate(f[a])
}, b.prototype.activate = function(b) {
this.activeTarget = b, a(this.selector).parentsUntil(this.options.target, ".active").removeClass("active");
var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]',
d = a(c).parents("li").addClass("active");
d.parent(".dropdown-menu").length && (d = d.closest("li.dropdown").addClass("active")), d.trigger("activate.bs.scrollspy")
};
var c = a.fn.scrollspy;
a.fn.scrollspy = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.scrollspy"),
f = "object" == typeof c && c;
e || d.data("bs.scrollspy", e = new b(this, f)), "string" == typeof c && e[c]()
})
}, a.fn.scrollspy.Constructor = b, a.fn.scrollspy.noConflict = function() {
return a.fn.scrollspy = c, this
}, a(window).on("load", function() {
a('[data-spy="scroll"]').each(function() {
var b = a(this);
b.scrollspy(b.data())
})
})
}(jQuery), + function(a) {
"use strict";
var b = function(b) {
this.element = a(b)
};
b.prototype.show = function() {
var b = this.element,
c = b.closest("ul:not(.dropdown-menu)"),
d = b.data("target");
if (d || (d = b.attr("href"), d = d && d.replace(/.*(?=#[^\s]*$)/, "")), !b.parent("li").hasClass("active")) {
var e = c.find(".active:last a")[0],
f = a.Event("show.bs.tab", {
relatedTarget: e
});
if (b.trigger(f), !f.isDefaultPrevented()) {
var g = a(d);
this.activate(b.parent("li"), c), this.activate(g, g.parent(), function() {
b.trigger({
type: "shown.bs.tab",
relatedTarget: e
})
})
}
}
}, b.prototype.activate = function(b, c, d) {
function e() {
f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), b.addClass("active"), g ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"), b.parent(".dropdown-menu") && b.closest("li.dropdown").addClass("active"), d && d()
}
var f = c.find("> .active"),
g = d && a.support.transition && f.hasClass("fade");
g ? f.one(a.support.transition.end, e).emulateTransitionEnd(150) : e(), f.removeClass("in")
};
var c = a.fn.tab;
a.fn.tab = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.tab");
e || d.data("bs.tab", e = new b(this)), "string" == typeof c && e[c]()
})
}, a.fn.tab.Constructor = b, a.fn.tab.noConflict = function() {
return a.fn.tab = c, this
}, a(document).on("click.bs.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function(b) {
b.preventDefault(), a(this).tab("show")
})
}(jQuery), + function(a) {
"use strict";
var b = function(c, d) {
this.options = a.extend({}, b.DEFAULTS, d), this.$window = a(window).on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this)), this.$element = a(c), this.affixed = this.unpin = this.pinnedOffset = null, this.checkPosition()
};
b.RESET = "affix affix-top affix-bottom", b.DEFAULTS = {
offset: 0
}, b.prototype.getPinnedOffset = function() {
if (this.pinnedOffset) return this.pinnedOffset;
this.$element.removeClass(b.RESET).addClass("affix");
var a = this.$window.scrollTop(),
c = this.$element.offset();
return this.pinnedOffset = c.top - a
}, b.prototype.checkPositionWithEventLoop = function() {
setTimeout(a.proxy(this.checkPosition, this), 1)
}, b.prototype.checkPosition = function() {
if (this.$element.is(":visible")) {
var c = a(document).height(),
d = this.$window.scrollTop(),
e = this.$element.offset(),
f = this.options.offset,
g = f.top,
h = f.bottom;
"top" == this.affixed && (e.top += d), "object" != typeof f && (h = g = f), "function" == typeof g && (g = f.top(this.$element)), "function" == typeof h && (h = f.bottom(this.$element));
var i = null != this.unpin && d + this.unpin <= e.top ? !1 : null != h && e.top + this.$element.height() >= c - h ? "bottom" : null != g && g >= d ? "top" : !1;
if (this.affixed !== i) {
this.unpin && this.$element.css("top", "");
var j = "affix" + (i ? "-" + i : ""),
k = a.Event(j + ".bs.affix");
this.$element.trigger(k), k.isDefaultPrevented() || (this.affixed = i, this.unpin = "bottom" == i ? this.getPinnedOffset() : null, this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix", "affixed"))), "bottom" == i && this.$element.offset({
top: c - h - this.$element.height()
}))
}
}
};
var c = a.fn.affix;
a.fn.affix = function(c) {
return this.each(function() {
var d = a(this),
e = d.data("bs.affix"),
f = "object" == typeof c && c;
e || d.data("bs.affix", e = new b(this, f)), "string" == typeof c && e[c]()
})
}, a.fn.affix.Constructor = b, a.fn.affix.noConflict = function() {
return a.fn.affix = c, this
}, a(window).on("load", function() {
a('[data-spy="affix"]').each(function() {
var b = a(this),
c = b.data();
c.offset = c.offset || {}, c.offsetBottom && (c.offset.bottom = c.offsetBottom), c.offsetTop && (c.offset.top = c.offsetTop), b.affix(c)
})
})
}(jQuery);

274
public/js/dashboard2.js vendored Normal file
View File

@@ -0,0 +1,274 @@
$(function () {
'use strict';
/* ChartJS
* -------
* Here we will create a few charts using ChartJS
*/
// -----------------------
// - MONTHLY SALES CHART -
// -----------------------
// Get context with jQuery - using jQuery's .get() method.
var salesChartCanvas = $('#salesChart').get(0).getContext('2d');
// This will get the first returned node in the jQuery collection.
var salesChart = new Chart(salesChartCanvas);
var salesChartData = {
labels : ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label : 'Electronics',
fillColor : 'rgb(210, 214, 222)',
strokeColor : 'rgb(210, 214, 222)',
pointColor : 'rgb(210, 214, 222)',
pointStrokeColor : '#c1c7d1',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgb(220,220,220)',
data : [65, 59, 80, 81, 56, 55, 40]
},
{
label : 'Digital Goods',
fillColor : 'rgba(60,141,188,0.9)',
strokeColor : 'rgba(60,141,188,0.8)',
pointColor : '#3b8bba',
pointStrokeColor : 'rgba(60,141,188,1)',
pointHighlightFill : '#fff',
pointHighlightStroke: 'rgba(60,141,188,1)',
data : [28, 48, 40, 19, 86, 27, 90]
}
]
};
var salesChartOptions = {
// Boolean - If we should show the scale at all
showScale : true,
// Boolean - Whether grid lines are shown across the chart
scaleShowGridLines : false,
// String - Colour of the grid lines
scaleGridLineColor : 'rgba(0,0,0,.05)',
// Number - Width of the grid lines
scaleGridLineWidth : 1,
// Boolean - Whether to show horizontal lines (except X axis)
scaleShowHorizontalLines: true,
// Boolean - Whether to show vertical lines (except Y axis)
scaleShowVerticalLines : true,
// Boolean - Whether the line is curved between points
bezierCurve : true,
// Number - Tension of the bezier curve between points
bezierCurveTension : 0.3,
// Boolean - Whether to show a dot for each point
pointDot : false,
// Number - Radius of each point dot in pixels
pointDotRadius : 4,
// Number - Pixel width of point dot stroke
pointDotStrokeWidth : 1,
// Number - amount extra to add to the radius to cater for hit detection outside the drawn point
pointHitDetectionRadius : 20,
// Boolean - Whether to show a stroke for datasets
datasetStroke : true,
// Number - Pixel width of dataset stroke
datasetStrokeWidth : 2,
// Boolean - Whether to fill the dataset with a color
datasetFill : true,
// String - A legend template
legendTemplate : '<ul class=\'<%=name.toLowerCase()%>-legend\'><% for (var i=0; i<datasets.length; i++){%><li><span style=\'background-color:<%=datasets[i].lineColor%>\'></span><%=datasets[i].label%></li><%}%></ul>',
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio : true,
// Boolean - whether to make the chart responsive to window resizing
responsive : true
};
// Create the line chart
salesChart.Line(salesChartData, salesChartOptions);
// ---------------------------
// - END MONTHLY SALES CHART -
// ---------------------------
// -------------
// - PIE CHART -
// -------------
// Get context with jQuery - using jQuery's .get() method.
var pieChartCanvas = $('#pieChart').get(0).getContext('2d');
var pieChart = new Chart(pieChartCanvas);
var PieData = [
{
value : 700,
color : '#f56954',
highlight: '#f56954',
label : 'Chrome'
},
{
value : 500,
color : '#00a65a',
highlight: '#00a65a',
label : 'IE'
},
{
value : 400,
color : '#f39c12',
highlight: '#f39c12',
label : 'FireFox'
},
{
value : 600,
color : '#00c0ef',
highlight: '#00c0ef',
label : 'Safari'
},
{
value : 300,
color : '#3c8dbc',
highlight: '#3c8dbc',
label : 'Opera'
},
{
value : 100,
color : '#d2d6de',
highlight: '#d2d6de',
label : 'Navigator'
}
];
var pieOptions = {
// Boolean - Whether we should show a stroke on each segment
segmentShowStroke : true,
// String - The colour of each segment stroke
segmentStrokeColor : '#fff',
// Number - The width of each segment stroke
segmentStrokeWidth : 1,
// Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
// Number - Amount of animation steps
animationSteps : 100,
// String - Animation easing effect
animationEasing : 'easeOutBounce',
// Boolean - Whether we animate the rotation of the Doughnut
animateRotate : true,
// Boolean - Whether we animate scaling the Doughnut from the centre
animateScale : false,
// Boolean - whether to make the chart responsive to window resizing
responsive : true,
// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
maintainAspectRatio : false,
// String - A legend template
legendTemplate : '<ul class=\'<%=name.toLowerCase()%>-legend\'><% for (var i=0; i<segments.length; i++){%><li><span style=\'background-color:<%=segments[i].fillColor%>\'></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>',
// String - A tooltip template
tooltipTemplate : '<%=value %> <%=label%> users'
};
// Create pie or douhnut chart
// You can switch between pie and douhnut using the method below.
pieChart.Doughnut(PieData, pieOptions);
// -----------------
// - END PIE CHART -
// -----------------
/* jVector Maps
* ------------
* Create a world map with markers
*/
$('#world-map-markers').vectorMap({
map : 'world_mill_en',
normalizeFunction: 'polynomial',
hoverOpacity : 0.7,
hoverColor : false,
backgroundColor : 'transparent',
regionStyle : {
initial : {
fill : 'rgba(210, 214, 222, 1)',
'fill-opacity' : 1,
stroke : 'none',
'stroke-width' : 0,
'stroke-opacity': 1
},
hover : {
'fill-opacity': 0.7,
cursor : 'pointer'
},
selected : {
fill: 'yellow'
},
selectedHover: {}
},
markerStyle : {
initial: {
fill : '#00a65a',
stroke: '#111'
}
},
markers : [
{ latLng: [41.90, 12.45], name: 'Vatican City' },
{ latLng: [43.73, 7.41], name: 'Monaco' },
{ latLng: [-0.52, 166.93], name: 'Nauru' },
{ latLng: [-8.51, 179.21], name: 'Tuvalu' },
{ latLng: [43.93, 12.46], name: 'San Marino' },
{ latLng: [47.14, 9.52], name: 'Liechtenstein' },
{ latLng: [7.11, 171.06], name: 'Marshall Islands' },
{ latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis' },
{ latLng: [3.2, 73.22], name: 'Maldives' },
{ latLng: [35.88, 14.5], name: 'Malta' },
{ latLng: [12.05, -61.75], name: 'Grenada' },
{ latLng: [13.16, -61.23], name: 'Saint Vincent and the Grenadines' },
{ latLng: [13.16, -59.55], name: 'Barbados' },
{ latLng: [17.11, -61.85], name: 'Antigua and Barbuda' },
{ latLng: [-4.61, 55.45], name: 'Seychelles' },
{ latLng: [7.35, 134.46], name: 'Palau' },
{ latLng: [42.5, 1.51], name: 'Andorra' },
{ latLng: [14.01, -60.98], name: 'Saint Lucia' },
{ latLng: [6.91, 158.18], name: 'Federated States of Micronesia' },
{ latLng: [1.3, 103.8], name: 'Singapore' },
{ latLng: [1.46, 173.03], name: 'Kiribati' },
{ latLng: [-21.13, -175.2], name: 'Tonga' },
{ latLng: [15.3, -61.38], name: 'Dominica' },
{ latLng: [-20.2, 57.5], name: 'Mauritius' },
{ latLng: [26.02, 50.55], name: 'Bahrain' },
{ latLng: [0.33, 6.73], name: 'São Tomé and Príncipe' }
]
});
/* SPARKLINE CHARTS
* ----------------
* Create a inline charts with spark line
*/
// -----------------
// - SPARKLINE BAR -
// -----------------
$('.sparkbar').each(function () {
var $this = $(this);
$this.sparkline('html', {
type : 'bar',
height : $this.data('height') ? $this.data('height') : '30',
barColor: $this.data('color')
});
});
// -----------------
// - SPARKLINE PIE -
// -----------------
$('.sparkpie').each(function () {
var $this = $(this);
$this.sparkline('html', {
type : 'pie',
height : $this.data('height') ? $this.data('height') : '90',
sliceColors: $this.data('color')
});
});
// ------------------
// - SPARKLINE LINE -
// ------------------
$('.sparkline').each(function () {
var $this = $(this);
$this.sparkline('html', {
type : 'line',
height : $this.data('height') ? $this.data('height') : '90',
width : '100%',
lineColor: $this.data('linecolor'),
fillColor: $this.data('fillcolor'),
spotColor: $this.data('spotcolor')
});
});
});

354
public/js/demo.js vendored Normal file
View File

@@ -0,0 +1,354 @@
/**
* AdminLTE Demo Menu
* ------------------
* You should not use this file in production.
* This file is for demo purposes only.
*/
$(function () {
'use strict'
/**
* Get access to plugins
*/
$('[data-toggle="control-sidebar"]').controlSidebar()
$('[data-toggle="push-menu"]').pushMenu()
var $pushMenu = $('[data-toggle="push-menu"]').data('lte.pushmenu')
var $controlSidebar = $('[data-toggle="control-sidebar"]').data('lte.controlsidebar')
var $layout = $('body').data('lte.layout')
$(window).on('load', function() {
// Reinitialize variables on load
$pushMenu = $('[data-toggle="push-menu"]').data('lte.pushmenu')
$controlSidebar = $('[data-toggle="control-sidebar"]').data('lte.controlsidebar')
$layout = $('body').data('lte.layout')
})
/**
* List of all the available skins
*
* @type Array
*/
var mySkins = [
'skin-blue',
'skin-black',
'skin-red',
'skin-yellow',
'skin-purple',
'skin-green',
'skin-blue-light',
'skin-black-light',
'skin-red-light',
'skin-yellow-light',
'skin-purple-light',
'skin-green-light'
]
/**
* Get a prestored setting
*
* @param String name Name of of the setting
* @returns String The value of the setting | null
*/
function get(name) {
if (typeof (Storage) !== 'undefined') {
return localStorage.getItem(name)
} else {
window.alert('Please use a modern browser to properly view this template!')
}
}
/**
* Store a new settings in the browser
*
* @param String name Name of the setting
* @param String val Value of the setting
* @returns void
*/
function store(name, val) {
if (typeof (Storage) !== 'undefined') {
localStorage.setItem(name, val)
} else {
window.alert('Please use a modern browser to properly view this template!')
}
}
/**
* Toggles layout classes
*
* @param String cls the layout class to toggle
* @returns void
*/
function changeLayout(cls) {
$('body').toggleClass(cls)
$layout.fixSidebar()
if ($('body').hasClass('fixed') && cls == 'fixed') {
$pushMenu.expandOnHover()
$layout.activate()
}
$controlSidebar.fix()
}
/**
* Replaces the old skin with the new skin
* @param String cls the new skin class
* @returns Boolean false to prevent link's default action
*/
function changeSkin(cls) {
$.each(mySkins, function (i) {
$('body').removeClass(mySkins[i])
})
$('body').addClass(cls)
store('skin', cls)
return false
}
/**
* Retrieve default settings and apply them to the template
*
* @returns void
*/
function setup() {
var tmp = get('skin')
if (tmp && $.inArray(tmp, mySkins))
changeSkin(tmp)
// Add the change skin listener
$('[data-skin]').on('click', function (e) {
if ($(this).hasClass('knob'))
return
e.preventDefault()
changeSkin($(this).data('skin'))
})
// Add the layout manager
$('[data-layout]').on('click', function () {
changeLayout($(this).data('layout'))
})
$('[data-controlsidebar]').on('click', function () {
changeLayout($(this).data('controlsidebar'))
var slide = !$controlSidebar.options.slide
$controlSidebar.options.slide = slide
if (!slide)
$('.control-sidebar').removeClass('control-sidebar-open')
})
$('[data-sidebarskin="toggle"]').on('click', function () {
var $sidebar = $('.control-sidebar')
if ($sidebar.hasClass('control-sidebar-dark')) {
$sidebar.removeClass('control-sidebar-dark')
$sidebar.addClass('control-sidebar-light')
} else {
$sidebar.removeClass('control-sidebar-light')
$sidebar.addClass('control-sidebar-dark')
}
})
$('[data-enable="expandOnHover"]').on('click', function () {
$(this).attr('disabled', true)
$pushMenu.expandOnHover()
if (!$('body').hasClass('sidebar-collapse'))
$('[data-layout="sidebar-collapse"]').click()
})
// Reset options
if ($('body').hasClass('fixed')) {
$('[data-layout="fixed"]').attr('checked', 'checked')
}
if ($('body').hasClass('layout-boxed')) {
$('[data-layout="layout-boxed"]').attr('checked', 'checked')
}
if ($('body').hasClass('sidebar-collapse')) {
$('[data-layout="sidebar-collapse"]').attr('checked', 'checked')
}
}
// Create the new tab
var $tabPane = $('<div />', {
'id': 'control-sidebar-theme-demo-options-tab',
'class': 'tab-pane active'
})
// Create the tab button
var $tabButton = $('<li />', {'class': 'active'})
.html('<a href=\'#control-sidebar-theme-demo-options-tab\' data-toggle=\'tab\'>'
+ '<i class="fa fa-wrench"></i>'
+ '</a>')
// Add the tab button to the right sidebar tabs
$('[href="#control-sidebar-home-tab"]')
.parent()
.before($tabButton)
// Create the menu
var $demoSettings = $('<div />')
// Layout options
$demoSettings.append(
'<h4 class="control-sidebar-heading">'
+ 'Layout Options'
+ '</h4>'
// Fixed layout
+ '<div class="form-group">'
+ '<label class="control-sidebar-subheading">'
+ '<input type="checkbox"data-layout="fixed"class="pull-right"/> '
+ 'Fixed layout'
+ '</label>'
+ '<p>Activate the fixed layout. You can\'t use fixed and boxed layouts together</p>'
+ '</div>'
// Boxed layout
+ '<div class="form-group">'
+ '<label class="control-sidebar-subheading">'
+ '<input type="checkbox"data-layout="layout-boxed" class="pull-right"/> '
+ 'Boxed Layout'
+ '</label>'
+ '<p>Activate the boxed layout</p>'
+ '</div>'
// Sidebar Toggle
+ '<div class="form-group">'
+ '<label class="control-sidebar-subheading">'
+ '<input type="checkbox"data-layout="sidebar-collapse"class="pull-right"/> '
+ 'Toggle Sidebar'
+ '</label>'
+ '<p>Toggle the left sidebar\'s state (open or collapse)</p>'
+ '</div>'
// Sidebar mini expand on hover toggle
+ '<div class="form-group">'
+ '<label class="control-sidebar-subheading">'
+ '<input type="checkbox"data-enable="expandOnHover"class="pull-right"/> '
+ 'Sidebar Expand on Hover'
+ '</label>'
+ '<p>Let the sidebar mini expand on hover</p>'
+ '</div>'
// Control Sidebar Toggle
+ '<div class="form-group">'
+ '<label class="control-sidebar-subheading">'
+ '<input type="checkbox"data-controlsidebar="control-sidebar-open"class="pull-right"/> '
+ 'Toggle Right Sidebar Slide'
+ '</label>'
+ '<p>Toggle between slide over content and push content effects</p>'
+ '</div>'
// Control Sidebar Skin Toggle
+ '<div class="form-group">'
+ '<label class="control-sidebar-subheading">'
+ '<input type="checkbox"data-sidebarskin="toggle"class="pull-right"/> '
+ 'Toggle Right Sidebar Skin'
+ '</label>'
+ '<p>Toggle between dark and light skins for the right sidebar</p>'
+ '</div>'
)
var $skinsList = $('<ul />', {'class': 'list-unstyled clearfix'})
// Dark sidebar skins
var $skinBlue =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-blue" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px; background: #367fa9"></span><span class="bg-light-blue" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin">Blue</p>')
$skinsList.append($skinBlue)
var $skinBlack =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-black" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div style="box-shadow: 0 0 2px rgba(0,0,0,0.1)" class="clearfix"><span style="display:block; width: 20%; float: left; height: 7px; background: #fefefe"></span><span style="display:block; width: 80%; float: left; height: 7px; background: #fefefe"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin">Black</p>')
$skinsList.append($skinBlack)
var $skinPurple =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-purple" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-purple-active"></span><span class="bg-purple" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin">Purple</p>')
$skinsList.append($skinPurple)
var $skinGreen =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-green" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-green-active"></span><span class="bg-green" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin">Green</p>')
$skinsList.append($skinGreen)
var $skinRed =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-red" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-red-active"></span><span class="bg-red" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin">Red</p>')
$skinsList.append($skinRed)
var $skinYellow =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-yellow" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-yellow-active"></span><span class="bg-yellow" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin">Yellow</p>')
$skinsList.append($skinYellow)
// Light sidebar skins
var $skinBlueLight =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-blue-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px; background: #367fa9"></span><span class="bg-light-blue" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin" style="font-size: 12px">Blue Light</p>')
$skinsList.append($skinBlueLight)
var $skinBlackLight =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-black-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div style="box-shadow: 0 0 2px rgba(0,0,0,0.1)" class="clearfix"><span style="display:block; width: 20%; float: left; height: 7px; background: #fefefe"></span><span style="display:block; width: 80%; float: left; height: 7px; background: #fefefe"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin" style="font-size: 12px">Black Light</p>')
$skinsList.append($skinBlackLight)
var $skinPurpleLight =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-purple-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-purple-active"></span><span class="bg-purple" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin" style="font-size: 12px">Purple Light</p>')
$skinsList.append($skinPurpleLight)
var $skinGreenLight =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-green-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-green-active"></span><span class="bg-green" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin" style="font-size: 12px">Green Light</p>')
$skinsList.append($skinGreenLight)
var $skinRedLight =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-red-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-red-active"></span><span class="bg-red" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin" style="font-size: 12px">Red Light</p>')
$skinsList.append($skinRedLight)
var $skinYellowLight =
$('<li />', {style: 'float:left; width: 33.33333%; padding: 5px;'})
.append('<a href="javascript:void(0)" data-skin="skin-yellow-light" style="display: block; box-shadow: 0 0 3px rgba(0,0,0,0.4)" class="clearfix full-opacity-hover">'
+ '<div><span style="display:block; width: 20%; float: left; height: 7px;" class="bg-yellow-active"></span><span class="bg-yellow" style="display:block; width: 80%; float: left; height: 7px;"></span></div>'
+ '<div><span style="display:block; width: 20%; float: left; height: 20px; background: #f9fafc"></span><span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span></div>'
+ '</a>'
+ '<p class="text-center no-margin" style="font-size: 12px">Yellow Light</p>')
$skinsList.append($skinYellowLight)
$demoSettings.append('<h4 class="control-sidebar-heading">Skins</h4>')
$demoSettings.append($skinsList)
$tabPane.append($demoSettings)
$('#control-sidebar-home-tab').after($tabPane)
setup()
$('[data-toggle="tooltip"]').tooltip()
})

841
public/js/fastclick.js vendored Normal file
View File

@@ -0,0 +1,841 @@
;(function () {
'use strict';
/**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
*
* @codingstandard ftlabs-jsv2
* @copyright The Financial Times Limited [All Rights Reserved]
* @license MIT License (see LICENSE.txt)
*/
/*jslint browser:true, node:true*/
/*global define, Event, Node*/
/**
* Instantiate fast-clicking listeners on the specified layer.
*
* @constructor
* @param {Element} layer The layer to listen on
* @param {Object} [options={}] The options to override the defaults
*/
function FastClick(layer, options) {
var oldOnClick;
options = options || {};
/**
* Whether a click is currently being tracked.
*
* @type boolean
*/
this.trackingClick = false;
/**
* Timestamp for when click tracking started.
*
* @type number
*/
this.trackingClickStart = 0;
/**
* The element being tracked for a click.
*
* @type EventTarget
*/
this.targetElement = null;
/**
* X-coordinate of touch start event.
*
* @type number
*/
this.touchStartX = 0;
/**
* Y-coordinate of touch start event.
*
* @type number
*/
this.touchStartY = 0;
/**
* ID of the last touch, retrieved from Touch.identifier.
*
* @type number
*/
this.lastTouchIdentifier = 0;
/**
* Touchmove boundary, beyond which a click will be cancelled.
*
* @type number
*/
this.touchBoundary = options.touchBoundary || 10;
/**
* The FastClick layer.
*
* @type Element
*/
this.layer = layer;
/**
* The minimum time between tap(touchstart and touchend) events
*
* @type number
*/
this.tapDelay = options.tapDelay || 200;
/**
* The maximum time for a tap
*
* @type number
*/
this.tapTimeout = options.tapTimeout || 700;
if (FastClick.notNeeded(layer)) {
return;
}
// Some old versions of Android don't have Function.prototype.bind
function bind(method, context) {
return function() { return method.apply(context, arguments); };
}
var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
var context = this;
for (var i = 0, l = methods.length; i < l; i++) {
context[methods[i]] = bind(context[methods[i]], context);
}
// Set up event handlers as required
if (deviceIsAndroid) {
layer.addEventListener('mouseover', this.onMouse, true);
layer.addEventListener('mousedown', this.onMouse, true);
layer.addEventListener('mouseup', this.onMouse, true);
}
layer.addEventListener('click', this.onClick, true);
layer.addEventListener('touchstart', this.onTouchStart, false);
layer.addEventListener('touchmove', this.onTouchMove, false);
layer.addEventListener('touchend', this.onTouchEnd, false);
layer.addEventListener('touchcancel', this.onTouchCancel, false);
// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
// layer when they are cancelled.
if (!Event.prototype.stopImmediatePropagation) {
layer.removeEventListener = function(type, callback, capture) {
var rmv = Node.prototype.removeEventListener;
if (type === 'click') {
rmv.call(layer, type, callback.hijacked || callback, capture);
} else {
rmv.call(layer, type, callback, capture);
}
};
layer.addEventListener = function(type, callback, capture) {
var adv = Node.prototype.addEventListener;
if (type === 'click') {
adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
if (!event.propagationStopped) {
callback(event);
}
}), capture);
} else {
adv.call(layer, type, callback, capture);
}
};
}
// If a handler is already declared in the element's onclick attribute, it will be fired before
// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
// adding it as listener.
if (typeof layer.onclick === 'function') {
// Android browser on at least 3.2 requires a new reference to the function in layer.onclick
// - the old one won't work if passed to addEventListener directly.
oldOnClick = layer.onclick;
layer.addEventListener('click', function(event) {
oldOnClick(event);
}, false);
layer.onclick = null;
}
}
/**
* Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
*
* @type boolean
*/
var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
/**
* Android requires exceptions.
*
* @type boolean
*/
var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
/**
* iOS requires exceptions.
*
* @type boolean
*/
var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
/**
* iOS 4 requires an exception for select elements.
*
* @type boolean
*/
var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
/**
* iOS 6.0-7.* requires the target element to be manually derived
*
* @type boolean
*/
var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
/**
* BlackBerry requires exceptions.
*
* @type boolean
*/
var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
/**
* Determine whether a given element requires a native click.
*
* @param {EventTarget|Element} target Target DOM element
* @returns {boolean} Returns true if the element needs a native click
*/
FastClick.prototype.needsClick = function(target) {
switch (target.nodeName.toLowerCase()) {
// Don't send a synthetic click to disabled inputs (issue #62)
case 'button':
case 'select':
case 'textarea':
if (target.disabled) {
return true;
}
break;
case 'input':
// File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
if ((deviceIsIOS && target.type === 'file') || target.disabled) {
return true;
}
break;
case 'label':
case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
case 'video':
return true;
}
return (/\bneedsclick\b/).test(target.className);
};
/**
* Determine whether a given element requires a call to focus to simulate click into element.
*
* @param {EventTarget|Element} target Target DOM element
* @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
*/
FastClick.prototype.needsFocus = function(target) {
switch (target.nodeName.toLowerCase()) {
case 'textarea':
return true;
case 'select':
return !deviceIsAndroid;
case 'input':
switch (target.type) {
case 'button':
case 'checkbox':
case 'file':
case 'image':
case 'radio':
case 'submit':
return false;
}
// No point in attempting to focus disabled inputs
return !target.disabled && !target.readOnly;
default:
return (/\bneedsfocus\b/).test(target.className);
}
};
/**
* Send a click event to the specified element.
*
* @param {EventTarget|Element} targetElement
* @param {Event} event
*/
FastClick.prototype.sendClick = function(targetElement, event) {
var clickEvent, touch;
// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
if (document.activeElement && document.activeElement !== targetElement) {
document.activeElement.blur();
}
touch = event.changedTouches[0];
// Synthesise a click event, with an extra attribute so it can be tracked
clickEvent = document.createEvent('MouseEvents');
clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
clickEvent.forwardedTouchEvent = true;
targetElement.dispatchEvent(clickEvent);
};
FastClick.prototype.determineEventType = function(targetElement) {
//Issue #159: Android Chrome Select Box does not open with a synthetic click event
if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
return 'mousedown';
}
return 'click';
};
/**
* @param {EventTarget|Element} targetElement
*/
FastClick.prototype.focus = function(targetElement) {
var length;
// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
length = targetElement.value.length;
targetElement.setSelectionRange(length, length);
} else {
targetElement.focus();
}
};
/**
* Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
*
* @param {EventTarget|Element} targetElement
*/
FastClick.prototype.updateScrollParent = function(targetElement) {
var scrollParent, parentElement;
scrollParent = targetElement.fastClickScrollParent;
// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
// target element was moved to another parent.
if (!scrollParent || !scrollParent.contains(targetElement)) {
parentElement = targetElement;
do {
if (parentElement.scrollHeight > parentElement.offsetHeight) {
scrollParent = parentElement;
targetElement.fastClickScrollParent = parentElement;
break;
}
parentElement = parentElement.parentElement;
} while (parentElement);
}
// Always update the scroll top tracker if possible.
if (scrollParent) {
scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
}
};
/**
* @param {EventTarget} targetElement
* @returns {Element|EventTarget}
*/
FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
if (eventTarget.nodeType === Node.TEXT_NODE) {
return eventTarget.parentNode;
}
return eventTarget;
};
/**
* On touch start, record the position and scroll offset.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchStart = function(event) {
var targetElement, touch, selection;
// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
if (event.targetTouches.length > 1) {
return true;
}
targetElement = this.getTargetElementFromEventTarget(event.target);
touch = event.targetTouches[0];
if (deviceIsIOS) {
// Only trusted events will deselect text on iOS (issue #49)
selection = window.getSelection();
if (selection.rangeCount && !selection.isCollapsed) {
return true;
}
if (!deviceIsIOS4) {
// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
// with the same identifier as the touch event that previously triggered the click that triggered the alert.
// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
// random integers, it's safe to to continue if the identifier is 0 here.
if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
event.preventDefault();
return false;
}
this.lastTouchIdentifier = touch.identifier;
// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
// 1) the user does a fling scroll on the scrollable layer
// 2) the user stops the fling scroll with another tap
// then the event.target of the last 'touchend' event will be the element that was under the user's finger
// when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
// is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
this.updateScrollParent(targetElement);
}
}
this.trackingClick = true;
this.trackingClickStart = event.timeStamp;
this.targetElement = targetElement;
this.touchStartX = touch.pageX;
this.touchStartY = touch.pageY;
// Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
event.preventDefault();
}
return true;
};
/**
* Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.touchHasMoved = function(event) {
var touch = event.changedTouches[0], boundary = this.touchBoundary;
if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
return true;
}
return false;
};
/**
* Update the last position.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchMove = function(event) {
if (!this.trackingClick) {
return true;
}
// If the touch has moved, cancel the click tracking
if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
this.trackingClick = false;
this.targetElement = null;
}
return true;
};
/**
* Attempt to find the labelled control for the given label element.
*
* @param {EventTarget|HTMLLabelElement} labelElement
* @returns {Element|null}
*/
FastClick.prototype.findControl = function(labelElement) {
// Fast path for newer browsers supporting the HTML5 control attribute
if (labelElement.control !== undefined) {
return labelElement.control;
}
// All browsers under test that support touch events also support the HTML5 htmlFor attribute
if (labelElement.htmlFor) {
return document.getElementById(labelElement.htmlFor);
}
// If no for attribute exists, attempt to retrieve the first labellable descendant element
// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
};
/**
* On touch end, determine whether to send a click event at once.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchEnd = function(event) {
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
return true;
}
// Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
this.cancelNextClick = true;
return true;
}
if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
return true;
}
// Reset to prevent wrong click cancel on input (issue #156).
this.cancelNextClick = false;
this.lastClickTime = event.timeStamp;
trackingClickStart = this.trackingClickStart;
this.trackingClick = false;
this.trackingClickStart = 0;
// On some iOS devices, the targetElement supplied with the event is invalid if the layer
// is performing a transition or scroll, and has to be re-detected manually. Note that
// for this to function correctly, it must be called *after* the event target is checked!
// See issue #57; also filed as rdar://13048589 .
if (deviceIsIOSWithBadTarget) {
touch = event.changedTouches[0];
// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
}
targetTagName = targetElement.tagName.toLowerCase();
if (targetTagName === 'label') {
forElement = this.findControl(targetElement);
if (forElement) {
this.focus(targetElement);
if (deviceIsAndroid) {
return false;
}
targetElement = forElement;
}
} else if (this.needsFocus(targetElement)) {
// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
this.targetElement = null;
return false;
}
this.focus(targetElement);
this.sendClick(targetElement, event);
// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
if (!deviceIsIOS || targetTagName !== 'select') {
this.targetElement = null;
event.preventDefault();
}
return false;
}
if (deviceIsIOS && !deviceIsIOS4) {
// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
scrollParent = targetElement.fastClickScrollParent;
if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
return true;
}
}
// Prevent the actual click from going though - unless the target node is marked as requiring
// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
if (!this.needsClick(targetElement)) {
event.preventDefault();
this.sendClick(targetElement, event);
}
return false;
};
/**
* On touch cancel, stop tracking the click.
*
* @returns {void}
*/
FastClick.prototype.onTouchCancel = function() {
this.trackingClick = false;
this.targetElement = null;
};
/**
* Determine mouse events which should be permitted.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onMouse = function(event) {
// If a target element was never set (because a touch event was never fired) allow the event
if (!this.targetElement) {
return true;
}
if (event.forwardedTouchEvent) {
return true;
}
// Programmatically generated events targeting a specific element should be permitted
if (!event.cancelable) {
return true;
}
// Derive and check the target element to see whether the mouse event needs to be permitted;
// unless explicitly enabled, prevent non-touch click events from triggering actions,
// to prevent ghost/doubleclicks.
if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
// Prevent any user-added listeners declared on FastClick element from being fired.
if (event.stopImmediatePropagation) {
event.stopImmediatePropagation();
} else {
// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
event.propagationStopped = true;
}
// Cancel the event
event.stopPropagation();
event.preventDefault();
return false;
}
// If the mouse event is permitted, return true for the action to go through.
return true;
};
/**
* On actual clicks, determine whether this is a touch-generated click, a click action occurring
* naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
* an actual click which should be permitted.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onClick = function(event) {
var permitted;
// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
if (this.trackingClick) {
this.targetElement = null;
this.trackingClick = false;
return true;
}
// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
if (event.target.type === 'submit' && event.detail === 0) {
return true;
}
permitted = this.onMouse(event);
// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
if (!permitted) {
this.targetElement = null;
}
// If clicks are permitted, return true for the action to go through.
return permitted;
};
/**
* Remove all FastClick's event listeners.
*
* @returns {void}
*/
FastClick.prototype.destroy = function() {
var layer = this.layer;
if (deviceIsAndroid) {
layer.removeEventListener('mouseover', this.onMouse, true);
layer.removeEventListener('mousedown', this.onMouse, true);
layer.removeEventListener('mouseup', this.onMouse, true);
}
layer.removeEventListener('click', this.onClick, true);
layer.removeEventListener('touchstart', this.onTouchStart, false);
layer.removeEventListener('touchmove', this.onTouchMove, false);
layer.removeEventListener('touchend', this.onTouchEnd, false);
layer.removeEventListener('touchcancel', this.onTouchCancel, false);
};
/**
* Check whether FastClick is needed.
*
* @param {Element} layer The layer to listen on
*/
FastClick.notNeeded = function(layer) {
var metaViewport;
var chromeVersion;
var blackberryVersion;
var firefoxVersion;
// Devices that don't support touch don't need FastClick
if (typeof window.ontouchstart === 'undefined') {
return true;
}
// Chrome version - zero for other browsers
chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
if (chromeVersion) {
if (deviceIsAndroid) {
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) {
// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
return true;
}
// Chrome 32 and above with width=device-width or less don't need FastClick
if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
return true;
}
}
// Chrome desktop doesn't need FastClick (issue #15)
} else {
return true;
}
}
if (deviceIsBlackBerry10) {
blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
// BlackBerry 10.3+ does not require Fastclick library.
// https://github.com/ftlabs/fastclick/issues/251
if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) {
// user-scalable=no eliminates click delay.
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
return true;
}
// width=device-width (or less than device-width) eliminates click delay.
if (document.documentElement.scrollWidth <= window.outerWidth) {
return true;
}
}
}
}
// IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
return true;
}
// Firefox version - zero for other browsers
firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
if (firefoxVersion >= 27) {
// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
return true;
}
}
// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
return true;
}
return false;
};
/**
* Factory method for creating a FastClick object
*
* @param {Element} layer The layer to listen on
* @param {Object} [options={}] The options to override the defaults
*/
FastClick.attach = function(layer, options) {
return new FastClick(layer, options);
};
if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// AMD. Register as an anonymous module.
define(function() {
return FastClick;
});
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = FastClick.attach;
module.exports.FastClick = FastClick;
} else {
window.FastClick = FastClick;
}
}());

4
public/js/html5shiv.min.js vendored Normal file
View File

@@ -0,0 +1,4 @@
/**
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
*/
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);

3385
public/js/jquery-1.10.1.min.js vendored Normal file

File diff suppressed because it is too large Load Diff

4
public/js/jquery-1.11.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
public/js/jquery-3.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2519
public/js/jquery-ui-1.9.2.custom.min.js vendored Normal file

File diff suppressed because it is too large Load Diff

2
public/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

16
public/js/jquery.slimscroll.min.js vendored Normal file
View File

@@ -0,0 +1,16 @@
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version: 1.3.8
*
*/
(function(e){e.fn.extend({slimScroll:function(f){var a=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},f);this.each(function(){function v(d){if(r){d=d||window.event;
var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);e(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&n(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function n(d,g,e){k=!1;var f=b.outerHeight()-c.outerHeight();g&&(g=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),g=Math.min(Math.max(g,0),f),g=0<d?Math.ceil(g):Math.floor(g),c.css({top:g+"px"}));l=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());g=
l*(b[0].scrollHeight-b.outerHeight());e&&(g=d,d=g/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),f),c.css({top:d+"px"}));b.scrollTop(g);b.trigger("slimscrolling",~~g);w();p()}function x(){u=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),30);c.css({height:u+"px"});var a=u==b.outerHeight()?"none":"block";c.css({display:a})}function w(){x();clearTimeout(B);l==~~l?(k=a.allowPageScroll,C!=l&&b.trigger("slimscroll",0==~~l?"top":"bottom")):k=!1;C=l;u>=b.outerHeight()?k=!0:(c.stop(!0,
!0).fadeIn("fast"),a.railVisible&&m.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(B=setTimeout(function(){a.disableFadeOut&&r||y||z||(c.fadeOut("slow"),m.fadeOut("slow"))},1E3))}var r,y,z,B,A,u,l,C,k=!1,b=e(this);if(b.parent().hasClass(a.wrapperClass)){var q=b.scrollTop(),c=b.siblings("."+a.barClass),m=b.siblings("."+a.railClass);x();if(e.isPlainObject(f)){if("height"in f&&"auto"==f.height){b.parent().css("height","auto");b.css("height","auto");var h=b.parent().parent().height();b.parent().css("height",
h);b.css("height",h)}else"height"in f&&(h=f.height,b.parent().css("height",h),b.css("height",h));if("scrollTo"in f)q=parseInt(a.scrollTo);else if("scrollBy"in f)q+=parseInt(a.scrollBy);else if("destroy"in f){c.remove();m.remove();b.unwrap();return}n(q,!1,!0)}}else if(!(e.isPlainObject(f)&&"destroy"in f)){a.height="auto"==a.height?b.parent().height():a.height;q=e("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",
width:a.width,height:a.height});var m=e("<div></div>").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=e("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,
WebkitBorderRadius:a.borderRadius,zIndex:99}),h="right"==a.position?{right:a.distance}:{left:a.distance};m.css(h);c.css(h);b.wrap(q);b.parent().append(c);b.parent().append(m);a.railDraggable&&c.bind("mousedown",function(a){var b=e(document);z=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);n(0,c.position().top,!1)});b.bind("mouseup.slimscroll",function(a){z=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",
function(a){a.stopPropagation();a.preventDefault();return!1});m.hover(function(){w()},function(){p()});c.hover(function(){y=!0},function(){y=!1});b.hover(function(){r=!0;w();p()},function(){r=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(A=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&(n((A-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),A=b.originalEvent.touches[0].pageY)});
x();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),n(0,!0)):"top"!==a.start&&(n(e(a.start).position().top,null,!0),a.alwaysVisible||c.hide());window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)}});return this}});e.fn.extend({slimscroll:e.fn.slimScroll})})(jQuery);

6
public/js/jquery.sparkline.min.js vendored Normal file

File diff suppressed because one or more lines are too long

603
public/js/jquery.validate.min.js vendored Normal file
View File

@@ -0,0 +1,603 @@
/* NUGET: BEGIN LICENSE TEXT
*
* Microsoft grants you the right to use these script files for the sole
* purpose of either: (i) interacting through your browser with the Microsoft
* website or online service, subject to the applicable licensing or use
* terms; or (ii) using the files as included with a Microsoft product subject
* to that product's license terms. Microsoft reserves all other rights to the
* files not expressly granted by Microsoft, whether by implication, estoppel
* or otherwise. Insofar as a script file is dual licensed under GPL,
* Microsoft neither took the code under GPL nor distributes it thereunder but
* under the terms set out in this paragraph. All notices and licenses
* below are for informational purposes only.
*
* NUGET: END LICENSE TEXT */
/*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */
(function(t) {
t.extend(t.fn, {
validate: function(e) {
if (!this.length) return e && e.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing."), void 0;
var i = t.data(this[0], "validator");
return i ? i : (this.attr("novalidate", "novalidate"), i = new t.validator(e, this[0]), t.data(this[0], "validator", i), i.settings.onsubmit && (this.validateDelegate(":submit", "click", function(e) {
i.settings.submitHandler && (i.submitButton = e.target), t(e.target).hasClass("cancel") && (i.cancelSubmit = !0), void 0 !== t(e.target).attr("formnovalidate") && (i.cancelSubmit = !0)
}), this.submit(function(e) {
function s() {
var s;
return i.settings.submitHandler ? (i.submitButton && (s = t("<input type='hidden'/>").attr("name", i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)), i.settings.submitHandler.call(i, i.currentForm, e), i.submitButton && s.remove(), !1) : !0
}
return i.settings.debug && e.preventDefault(), i.cancelSubmit ? (i.cancelSubmit = !1, s()) : i.form() ? i.pendingRequest ? (i.formSubmitted = !0, !1) : s() : (i.focusInvalid(), !1)
})), i)
},
valid: function() {
if (t(this[0]).is("form")) return this.validate().form();
var e = !0,
i = t(this[0].form).validate();
return this.each(function() {
e = e && i.element(this)
}), e
},
removeAttrs: function(e) {
var i = {},
s = this;
return t.each(e.split(/\s/), function(t, e) {
i[e] = s.attr(e), s.removeAttr(e)
}), i
},
rules: function(e, i) {
var s = this[0];
if (e) {
var r = t.data(s.form, "validator").settings,
n = r.rules,
a = t.validator.staticRules(s);
switch (e) {
case "add":
t.extend(a, t.validator.normalizeRule(i)), delete a.messages, n[s.name] = a, i.messages && (r.messages[s.name] = t.extend(r.messages[s.name], i.messages));
break;
case "remove":
if (!i) return delete n[s.name], a;
var u = {};
return t.each(i.split(/\s/), function(t, e) {
u[e] = a[e], delete a[e]
}), u
}
}
var o = t.validator.normalizeRules(t.extend({}, t.validator.classRules(s), t.validator.attributeRules(s), t.validator.dataRules(s), t.validator.staticRules(s)), s);
if (o.required) {
var l = o.required;
delete o.required, o = t.extend({
required: l
}, o)
}
return o
}
}), t.extend(t.expr[":"], {
blank: function(e) {
return !t.trim("" + t(e).val())
},
filled: function(e) {
return !!t.trim("" + t(e).val())
},
unchecked: function(e) {
return !t(e).prop("checked")
}
}), t.validator = function(e, i) {
this.settings = t.extend(!0, {}, t.validator.defaults, e), this.currentForm = i, this.init()
}, t.validator.format = function(e, i) {
return 1 === arguments.length ? function() {
var i = t.makeArray(arguments);
return i.unshift(e), t.validator.format.apply(this, i)
} : (arguments.length > 2 && i.constructor !== Array && (i = t.makeArray(arguments).slice(1)), i.constructor !== Array && (i = [i]), t.each(i, function(t, i) {
e = e.replace(RegExp("\\{" + t + "\\}", "g"), function() {
return i
})
}), e)
}, t.extend(t.validator, {
defaults: {
messages: {},
groups: {},
rules: {},
errorClass: "error",
validClass: "valid",
errorElement: "label",
focusInvalid: !0,
errorContainer: t([]),
errorLabelContainer: t([]),
onsubmit: !0,
ignore: ":hidden",
ignoreTitle: !1,
onfocusin: function(t) {
this.lastActive = t, this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, t, this.settings.errorClass, this.settings.validClass), this.addWrapper(this.errorsFor(t)).hide())
},
onfocusout: function(t) {
this.checkable(t) || !(t.name in this.submitted) && this.optional(t) || this.element(t)
},
onkeyup: function(t, e) {
(9 !== e.which || "" !== this.elementValue(t)) && (t.name in this.submitted || t === this.lastElement) && this.element(t)
},
onclick: function(t) {
t.name in this.submitted ? this.element(t) : t.parentNode.name in this.submitted && this.element(t.parentNode)
},
highlight: function(e, i, s) {
"radio" === e.type ? this.findByName(e.name).addClass(i).removeClass(s) : t(e).addClass(i).removeClass(s)
},
unhighlight: function(e, i, s) {
"radio" === e.type ? this.findByName(e.name).removeClass(i).addClass(s) : t(e).removeClass(i).addClass(s)
}
},
setDefaults: function(e) {
t.extend(t.validator.defaults, e)
},
messages: {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",
creditcard: "Please enter a valid credit card number.",
equalTo: "Please enter the same value again.",
maxlength: t.validator.format("Please enter no more than {0} characters."),
minlength: t.validator.format("Please enter at least {0} characters."),
rangelength: t.validator.format("Please enter a value between {0} and {1} characters long."),
range: t.validator.format("Please enter a value between {0} and {1}."),
max: t.validator.format("Please enter a value less than or equal to {0}."),
min: t.validator.format("Please enter a value greater than or equal to {0}.")
},
autoCreateRanges: !1,
prototype: {
init: function() {
function e(e) {
var i = t.data(this[0].form, "validator"),
s = "on" + e.type.replace(/^validate/, "");
i.settings[s] && i.settings[s].call(i, this[0], e)
}
this.labelContainer = t(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || t(this.currentForm), this.containers = t(this.settings.errorContainer).add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset();
var i = this.groups = {};
t.each(this.settings.groups, function(e, s) {
"string" == typeof s && (s = s.split(/\s/)), t.each(s, function(t, s) {
i[s] = e
})
});
var s = this.settings.rules;
t.each(s, function(e, i) {
s[e] = t.validator.normalizeRule(i)
}), t(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", e).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", e), this.settings.invalidHandler && t(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
},
form: function() {
return this.checkForm(), t.extend(this.submitted, this.errorMap), this.invalid = t.extend({}, this.errorMap), this.valid() || t(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid()
},
checkForm: function() {
this.prepareForm();
for (var t = 0, e = this.currentElements = this.elements(); e[t]; t++) this.check(e[t]);
return this.valid()
},
element: function(e) {
e = this.validationTargetFor(this.clean(e)), this.lastElement = e, this.prepareElement(e), this.currentElements = t(e);
var i = this.check(e) !== !1;
return i ? delete this.invalid[e.name] : this.invalid[e.name] = !0, this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), i
},
showErrors: function(e) {
if (e) {
t.extend(this.errorMap, e), this.errorList = [];
for (var i in e) this.errorList.push({
message: e[i],
element: this.findByName(i)[0]
});
this.successList = t.grep(this.successList, function(t) {
return !(t.name in e)
})
}
this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
},
resetForm: function() {
t.fn.resetForm && t(this.currentForm).resetForm(), this.submitted = {}, this.lastElement = null, this.prepareForm(), this.hideErrors(), this.elements().removeClass(this.settings.errorClass).removeData("previousValue")
},
numberOfInvalids: function() {
return this.objectLength(this.invalid)
},
objectLength: function(t) {
var e = 0;
for (var i in t) e++;
return e
},
hideErrors: function() {
this.addWrapper(this.toHide).hide()
},
valid: function() {
return 0 === this.size()
},
size: function() {
return this.errorList.length
},
focusInvalid: function() {
if (this.settings.focusInvalid) try {
t(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
} catch (e) {}
},
findLastActive: function() {
var e = this.lastActive;
return e && 1 === t.grep(this.errorList, function(t) {
return t.element.name === e.name
}).length && e
},
elements: function() {
var e = this,
i = {};
return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function() {
return !this.name && e.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in i || !e.objectLength(t(this).rules()) ? !1 : (i[this.name] = !0, !0)
})
},
clean: function(e) {
return t(e)[0]
},
errors: function() {
var e = this.settings.errorClass.replace(" ", ".");
return t(this.settings.errorElement + "." + e, this.errorContext)
},
reset: function() {
this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = t([]), this.toHide = t([]), this.currentElements = t([])
},
prepareForm: function() {
this.reset(), this.toHide = this.errors().add(this.containers)
},
prepareElement: function(t) {
this.reset(), this.toHide = this.errorsFor(t)
},
elementValue: function(e) {
var i = t(e).attr("type"),
s = t(e).val();
return "radio" === i || "checkbox" === i ? t("input[name='" + t(e).attr("name") + "']:checked").val() : "string" == typeof s ? s.replace(/\r/g, "") : s
},
check: function(e) {
e = this.validationTargetFor(this.clean(e));
var i, s = t(e).rules(),
r = !1,
n = this.elementValue(e);
for (var a in s) {
var u = {
method: a,
parameters: s[a]
};
try {
if (i = t.validator.methods[a].call(this, n, e, u.parameters), "dependency-mismatch" === i) {
r = !0;
continue
}
if (r = !1, "pending" === i) return this.toHide = this.toHide.not(this.errorsFor(e)), void 0;
if (!i) return this.formatAndAdd(e, u), !1
} catch (o) {
throw this.settings.debug && window.console && console.log("Exception occurred when checking element " + e.id + ", check the '" + u.method + "' method.", o), o
}
}
return r ? void 0 : (this.objectLength(s) && this.successList.push(e), !0)
},
customDataMessage: function(e, i) {
return t(e).data("msg-" + i.toLowerCase()) || e.attributes && t(e).attr("data-msg-" + i.toLowerCase())
},
customMessage: function(t, e) {
var i = this.settings.messages[t];
return i && (i.constructor === String ? i : i[e])
},
findDefined: function() {
for (var t = 0; arguments.length > t; t++)
if (void 0 !== arguments[t]) return arguments[t];
return void 0
},
defaultMessage: function(e, i) {
return this.findDefined(this.customMessage(e.name, i), this.customDataMessage(e, i), !this.settings.ignoreTitle && e.title || void 0, t.validator.messages[i], "<strong>Warning: No message defined for " + e.name + "</strong>")
},
formatAndAdd: function(e, i) {
var s = this.defaultMessage(e, i.method),
r = /\$?\{(\d+)\}/g;
"function" == typeof s ? s = s.call(this, i.parameters, e) : r.test(s) && (s = t.validator.format(s.replace(r, "{$1}"), i.parameters)), this.errorList.push({
message: s,
element: e
}), this.errorMap[e.name] = s, this.submitted[e.name] = s
},
addWrapper: function(t) {
return this.settings.wrapper && (t = t.add(t.parent(this.settings.wrapper))), t
},
defaultShowErrors: function() {
var t, e;
for (t = 0; this.errorList[t]; t++) {
var i = this.errorList[t];
this.settings.highlight && this.settings.highlight.call(this, i.element, this.settings.errorClass, this.settings.validClass), this.showLabel(i.element, i.message)
}
if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success)
for (t = 0; this.successList[t]; t++) this.showLabel(this.successList[t]);
if (this.settings.unhighlight)
for (t = 0, e = this.validElements(); e[t]; t++) this.settings.unhighlight.call(this, e[t], this.settings.errorClass, this.settings.validClass);
this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow).show()
},
validElements: function() {
return this.currentElements.not(this.invalidElements())
},
invalidElements: function() {
return t(this.errorList).map(function() {
return this.element
})
},
showLabel: function(e, i) {
var s = this.errorsFor(e);
s.length ? (s.removeClass(this.settings.validClass).addClass(this.settings.errorClass), s.html(i)) : (s = t("<" + this.settings.errorElement + ">").attr("for", this.idOrName(e)).addClass(this.settings.errorClass).html(i || ""), this.settings.wrapper && (s = s.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelContainer.append(s).length || (this.settings.errorPlacement ? this.settings.errorPlacement(s, t(e)) : s.insertAfter(e))), !i && this.settings.success && (s.text(""), "string" == typeof this.settings.success ? s.addClass(this.settings.success) : this.settings.success(s, e)), this.toShow = this.toShow.add(s)
},
errorsFor: function(e) {
var i = this.idOrName(e);
return this.errors().filter(function() {
return t(this).attr("for") === i
})
},
idOrName: function(t) {
return this.groups[t.name] || (this.checkable(t) ? t.name : t.id || t.name)
},
validationTargetFor: function(t) {
return this.checkable(t) && (t = this.findByName(t.name).not(this.settings.ignore)[0]), t
},
checkable: function(t) {
return /radio|checkbox/i.test(t.type)
},
findByName: function(e) {
return t(this.currentForm).find("[name='" + e + "']")
},
getLength: function(e, i) {
switch (i.nodeName.toLowerCase()) {
case "select":
return t("option:selected", i).length;
case "input":
if (this.checkable(i)) return this.findByName(i.name).filter(":checked").length
}
return e.length
},
depend: function(t, e) {
return this.dependTypes[typeof t] ? this.dependTypes[typeof t](t, e) : !0
},
dependTypes: {
"boolean": function(t) {
return t
},
string: function(e, i) {
return !!t(e, i.form).length
},
"function": function(t, e) {
return t(e)
}
},
optional: function(e) {
var i = this.elementValue(e);
return !t.validator.methods.required.call(this, i, e) && "dependency-mismatch"
},
startRequest: function(t) {
this.pending[t.name] || (this.pendingRequest++, this.pending[t.name] = !0)
},
stopRequest: function(e, i) {
this.pendingRequest--, 0 > this.pendingRequest && (this.pendingRequest = 0), delete this.pending[e.name], i && 0 === this.pendingRequest && this.formSubmitted && this.form() ? (t(this.currentForm).submit(), this.formSubmitted = !1) : !i && 0 === this.pendingRequest && this.formSubmitted && (t(this.currentForm).triggerHandler("invalid-form", [this]), this.formSubmitted = !1)
},
previousValue: function(e) {
return t.data(e, "previousValue") || t.data(e, "previousValue", {
old: null,
valid: !0,
message: this.defaultMessage(e, "remote")
})
}
},
classRuleSettings: {
required: {
required: !0
},
email: {
email: !0
},
url: {
url: !0
},
date: {
date: !0
},
dateISO: {
dateISO: !0
},
number: {
number: !0
},
digits: {
digits: !0
},
creditcard: {
creditcard: !0
}
},
addClassRules: function(e, i) {
e.constructor === String ? this.classRuleSettings[e] = i : t.extend(this.classRuleSettings, e)
},
classRules: function(e) {
var i = {},
s = t(e).attr("class");
return s && t.each(s.split(" "), function() {
this in t.validator.classRuleSettings && t.extend(i, t.validator.classRuleSettings[this])
}), i
},
attributeRules: function(e) {
var i = {},
s = t(e),
r = s[0].getAttribute("type");
for (var n in t.validator.methods) {
var a;
"required" === n ? (a = s.get(0).getAttribute(n), "" === a && (a = !0), a = !!a) : a = s.attr(n), /min|max/.test(n) && (null === r || /number|range|text/.test(r)) && (a = Number(a)), a ? i[n] = a : r === n && "range" !== r && (i[n] = !0)
}
return i.maxlength && /-1|2147483647|524288/.test(i.maxlength) && delete i.maxlength, i
},
dataRules: function(e) {
var i, s, r = {},
n = t(e);
for (i in t.validator.methods) s = n.data("rule-" + i.toLowerCase()), void 0 !== s && (r[i] = s);
return r
},
staticRules: function(e) {
var i = {},
s = t.data(e.form, "validator");
return s.settings.rules && (i = t.validator.normalizeRule(s.settings.rules[e.name]) || {}), i
},
normalizeRules: function(e, i) {
return t.each(e, function(s, r) {
if (r === !1) return delete e[s], void 0;
if (r.param || r.depends) {
var n = !0;
switch (typeof r.depends) {
case "string":
n = !!t(r.depends, i.form).length;
break;
case "function":
n = r.depends.call(i, i)
}
n ? e[s] = void 0 !== r.param ? r.param : !0 : delete e[s]
}
}), t.each(e, function(s, r) {
e[s] = t.isFunction(r) ? r(i) : r
}), t.each(["minlength", "maxlength"], function() {
e[this] && (e[this] = Number(e[this]))
}), t.each(["rangelength", "range"], function() {
var i;
e[this] && (t.isArray(e[this]) ? e[this] = [Number(e[this][0]), Number(e[this][1])] : "string" == typeof e[this] && (i = e[this].split(/[\s,]+/), e[this] = [Number(i[0]), Number(i[1])]))
}), t.validator.autoCreateRanges && (e.min && e.max && (e.range = [e.min, e.max], delete e.min, delete e.max), e.minlength && e.maxlength && (e.rangelength = [e.minlength, e.maxlength], delete e.minlength, delete e.maxlength)), e
},
normalizeRule: function(e) {
if ("string" == typeof e) {
var i = {};
t.each(e.split(/\s/), function() {
i[this] = !0
}), e = i
}
return e
},
addMethod: function(e, i, s) {
t.validator.methods[e] = i, t.validator.messages[e] = void 0 !== s ? s : t.validator.messages[e], 3 > i.length && t.validator.addClassRules(e, t.validator.normalizeRule(e))
},
methods: {
required: function(e, i, s) {
if (!this.depend(s, i)) return "dependency-mismatch";
if ("select" === i.nodeName.toLowerCase()) {
var r = t(i).val();
return r && r.length > 0
}
return this.checkable(i) ? this.getLength(e, i) > 0 : t.trim(e).length > 0
},
email: function(t, e) {
return this.optional(e) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(t)
},
url: function(t, e) {
return this.optional(e) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)
},
date: function(t, e) {
return this.optional(e) || !/Invalid|NaN/.test("" + new Date(t))
},
dateISO: function(t, e) {
return this.optional(e) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)
},
number: function(t, e) {
return this.optional(e) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)
},
digits: function(t, e) {
return this.optional(e) || /^\d+$/.test(t)
},
creditcard: function(t, e) {
if (this.optional(e)) return "dependency-mismatch";
if (/[^0-9 \-]+/.test(t)) return !1;
var i = 0,
s = 0,
r = !1;
t = t.replace(/\D/g, "");
for (var n = t.length - 1; n >= 0; n--) {
var a = t.charAt(n);
s = parseInt(a, 10), r && (s *= 2) > 9 && (s -= 9), i += s, r = !r
}
return 0 === i % 10
},
minlength: function(e, i, s) {
var r = t.isArray(e) ? e.length : this.getLength(t.trim(e), i);
return this.optional(i) || r >= s
},
maxlength: function(e, i, s) {
var r = t.isArray(e) ? e.length : this.getLength(t.trim(e), i);
return this.optional(i) || s >= r
},
rangelength: function(e, i, s) {
var r = t.isArray(e) ? e.length : this.getLength(t.trim(e), i);
return this.optional(i) || r >= s[0] && s[1] >= r
},
min: function(t, e, i) {
return this.optional(e) || t >= i
},
max: function(t, e, i) {
return this.optional(e) || i >= t
},
range: function(t, e, i) {
return this.optional(e) || t >= i[0] && i[1] >= t
},
equalTo: function(e, i, s) {
var r = t(s);
return this.settings.onfocusout && r.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
t(i).valid()
}), e === r.val()
},
remote: function(e, i, s) {
if (this.optional(i)) return "dependency-mismatch";
var r = this.previousValue(i);
if (this.settings.messages[i.name] || (this.settings.messages[i.name] = {}), r.originalMessage = this.settings.messages[i.name].remote, this.settings.messages[i.name].remote = r.message, s = "string" == typeof s && {
url: s
} || s, r.old === e) return r.valid;
r.old = e;
var n = this;
this.startRequest(i);
var a = {};
return a[i.name] = e, t.ajax(t.extend(!0, {
url: s,
mode: "abort",
port: "validate" + i.name,
dataType: "json",
data: a,
success: function(s) {
n.settings.messages[i.name].remote = r.originalMessage;
var a = s === !0 || "true" === s;
if (a) {
var u = n.formSubmitted;
n.prepareElement(i), n.formSubmitted = u, n.successList.push(i), delete n.invalid[i.name], n.showErrors()
} else {
var o = {},
l = s || n.defaultMessage(i, "remote");
o[i.name] = r.message = t.isFunction(l) ? l(e) : l, n.invalid[i.name] = !0, n.showErrors(o)
}
r.valid = a, n.stopRequest(i, a)
}
}, s)), "pending"
}
}
}), t.format = t.validator.format
})(jQuery),
function(t) {
var e = {};
if (t.ajaxPrefilter) t.ajaxPrefilter(function(t, i, s) {
var r = t.port;
"abort" === t.mode && (e[r] && e[r].abort(), e[r] = s)
});
else {
var i = t.ajax;
t.ajax = function(s) {
var r = ("mode" in s ? s : t.ajaxSettings).mode,
n = ("port" in s ? s : t.ajaxSettings).port;
return "abort" === r ? (e[n] && e[n].abort(), e[n] = i.apply(this, arguments), e[n]) : i.apply(this, arguments)
}
}
}(jQuery),
function(t) {
t.extend(t.fn, {
validateDelegate: function(e, i, s) {
return this.bind(i, function(i) {
var r = t(i.target);
return r.is(e) ? s.apply(r, arguments) : void 0
})
}
})
}(jQuery);

2
public/js/moment.min.js vendored Normal file

File diff suppressed because one or more lines are too long

BIN
public/js/phao-hoa.mp3 Normal file

Binary file not shown.

5
public/js/respond.min.js vendored Normal file
View File

@@ -0,0 +1,5 @@
/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
* */
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='&shy;<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);

224
public/js/ss_countdown.js vendored Normal file
View File

@@ -0,0 +1,224 @@
var jQuery_1_11_1 = jQuery_1_11_1 || $.noConflict();
(function ($, window, undefined) {
function SSCountdown(opts) {
if (!(this instanceof SSCountdown)) {
return new SSCountdown(opts);
}
this.options = {};
this.total = null;
this.days = null;
this.hours = 1;
this.minutes = null;
this.seconds = null;
this.intervalId = null;
this.timezone_key = [];
this.timezone_value = [];
this.init(opts);
}
SSCountdown.prototype = {
init: function (opts) {
var self = this;
self.$container = $(".ss-countdown-container");
self.$container.on("click", ".ssCountdownSubscribeSelector", function(e){
if (e && e.preventDefault) {
e.preventDefault();
}
var $this = $(this),
$form = $this.closest('form'),
$emailAddress = $form.find("input[name='email_address']"),
$errorContainer = $form.find(".ss-error-container");
$errorContainer.css({"color": "#FF0000"}).html("").hide();
if($emailAddress.val() == "") {
$errorContainer.html("Vui lòng điền địa chỉ email của bạn!").fadeIn();
}
else {
var re = /([0-9a-zA-Z\.\-\_]+)@([0-9a-zA-Z\.\-\_]+)\.([0-9a-zA-Z\.\-\_]+)/,
email_address = $emailAddress.val();
if(email_address.match(re) == null) {
$errorContainer.html("Email không đúng!").fadeIn();
}
else {
$.ajax({
type: "POST",
data: {
email: email_address
},
url: "subscribe/subscribe.php",
success: function(){
$emailAddress.val("");
$errorContainer.css({"color": "#39F"}).html("Cảm ơn bạn đã đăng ký!").fadeIn();
setTimeout(function(){
$errorContainer.css({"color": "#FF0000"}).html("").hide();
}, 3000);
}
});
}
}
return false;
});
if(typeof opts.now == "undefined") {
if (!Date.now) {
Date.now = function() { return new Date().getTime(); };
}
opts.now = (Date.now() / 1000);
}
if(typeof opts.startDate == "undefined") {
opts.startDate = opts.now;
}
if(typeof opts.endDate == "undefined") {
/*Expect PHP Timestamp*/
var GMT = opts.timezone.replace(/GMT/, ""),
date_string = opts.date + "T" + opts.time + GMT,
endDate = new Date(date_string);
/* console.log(endDate); */
opts.endDate = (endDate.getTime() / 1000);
}
for (var attr in opts) {
if (opts.hasOwnProperty(attr)) {
self.options[attr] = opts[attr];
}
}
if (self.options.now >= self.options.endDate) {
return;
}
self.total = Math.floor((opts.endDate - opts.startDate)/86400);
self.days = Math.floor((opts.endDate - opts.now ) / 86400);
self.hours = 24 - Math.floor(((opts.endDate - opts.now) % 86400) / 3600);
self.minutes = 60 - Math.floor((((opts.endDate - opts.now) % 86400) % 3600) / 60) ;
self.seconds = 60 - Math.floor((opts.endDate - opts.now) % 86400 % 3600 % 60);
self.setSeconds();
self.setMinutes();
self.setHours();
self.setDays();
self.start();
},
start: function()
{
var self = this;
if (self.options.now >= self.options.endDate) {
return;
}
self.intervalId = setInterval(function(){
if ( self.seconds > 59 ) {
if (60 - self.minutes == 0 && 24 - self.hours == 0 && self.days == 0) {
clearInterval(self.intervalId);
return;
}
self.seconds = 1;
if (self.minutes > 59) {
self.minutes = 1;
self.setMinutes();
if (self.hours > 23) {
self.hours = 1;
if (self.days > 0) {
self.days--;
self.setDays();
}
} else {
self.hours++;
}
self.setHours();
} else {
self.minutes++;
}
self.setMinutes();
} else {
self.seconds++;
}
self.setSeconds();
}, 1000);
},
setDays: function(){
var self = this;
var cdays = $(".ss-days-canvas").get(0);
var ctx = cdays.getContext("2d");
ctx.clearRect(0, 0, cdays.width, cdays.height);
ctx.beginPath();
ctx.strokeStyle = self.options.daysColor;
ctx.shadowBlur = 10;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.arc(108,108,105, self.getDegree(0), self.getDegree((360/self.total)*(self.total - self.days)));
ctx.lineWidth = 3;
ctx.stroke();
self.$container.find(".ss-clock-days-container .ss-value").text(self.days);
},
setHours: function(){
var self = this;
var cHr = $(".ss-hours-canvas").get(0);
var ctx = cHr.getContext("2d");
ctx.clearRect(0, 0, cHr.width, cHr.height);
ctx.beginPath();
ctx.strokeStyle = self.options.hoursColor;
ctx.shadowBlur = 10;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.arc(108,108,105, self.getDegree(0), self.getDegree(15*self.hours));
ctx.lineWidth = 3;
ctx.stroke();
self.$container.find(".ss-clock-hours-container .ss-value").text(24 - self.hours);
},
setMinutes : function(){
var self = this;
var cMin = $(".ss-minutes-canvas").get(0);
var ctx = cMin.getContext("2d");
ctx.clearRect(0, 0, cMin.width, cMin.height);
ctx.beginPath();
ctx.strokeStyle = self.options.minutesColor;
ctx.shadowBlur = 10;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.arc(108,108,105, self.getDegree(0), self.getDegree(6*self.minutes));
ctx.lineWidth = 3;
ctx.stroke();
self.$container.find(".ss-clock-minutes-container .ss-value").text(60 - self.minutes);
},
setSeconds: function(){
var self = this;
var cSec = $(".ss-seconds-canvas").get(0);
var ctx = cSec.getContext("2d");
ctx.clearRect(0, 0, cSec.width, cSec.height);
ctx.beginPath();
ctx.strokeStyle = self.options.secondsColor;
ctx.shadowBlur = 10;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.arc(108,108,105, self.getDegree(0), self.getDegree(6*self.seconds));
ctx.lineWidth = 3;
ctx.stroke();
self.$container.find(".ss-clock-seconds-container .ss-value").text(60 - self.seconds);
},
getDegree: function(d) {
return (Math.PI/180)*d - (Math.PI/180)*90;
}
};
return (window.SSCountdown = SSCountdown);
})(jQuery_1_11_1, window);

88
public/js/ss_load.js vendored Normal file
View File

@@ -0,0 +1,88 @@
(function () {
"use strict";
var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor),
loadCssHack = function(url, callback){
var link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = url;
document.getElementsByTagName('head')[0].appendChild(link);
var img = document.createElement('img');
img.onerror = function(){
if (callback && typeof callback === "function") {
callback();
}
};
img.src = url;
},
loadRemote = function(url, type, callback) {
if (type === "css" && isSafari) {
loadCssHack(url, callback);
return;
}
var _element, _type, _attr, scr, s, element;
switch (type) {
case 'css':
_element = "link";
_type = "text/css";
_attr = "href";
break;
case 'js':
_element = "script";
_type = "text/javascript";
_attr = "src";
break;
}
scr = document.getElementsByTagName(_element);
s = scr[scr.length - 1];
if(typeof s == "undefined") {
scr = document.getElementsByTagName("script");
s = scr[scr.length - 1];
}
element = document.createElement(_element);
element.type = _type;
if (type == "css") {
element.rel = "stylesheet";
}
if (element.readyState) {
element.onreadystatechange = function () {
if (element.readyState == "loaded" || element.readyState == "complete") {
element.onreadystatechange = null;
if (callback && typeof callback === "function") {
callback();
}
}
};
} else {
element.onload = function () {
if (callback && typeof callback === "function") {
callback();
}
};
}
element[_attr] = url;
s.parentNode.insertBefore(element, s.nextSibling);
},
loadScript = function (url, callback) {
loadRemote(url, "js", callback);
},
loadCss = function (url, callback) {
loadRemote(url, "css", callback);
};
loadScript("js/jquery-1.11.1.min.js", function () {
loadScript("js/ss_options.js", function () {
loadScript("js/ss_countdown.js", function () {
loadCss("css/ss_countdown.css", function() {
new SSCountdown(ssCountdownDefaultOptions);
});
});
});
});
})();

8
public/js/ss_options.js vendored Normal file
View File

@@ -0,0 +1,8 @@
var ssCountdownDefaultOptions = ssCountdownDefaultOptions || {};
ssCountdownDefaultOptions.secondsColor = "#11c8ea";
ssCountdownDefaultOptions.minutesColor = "#ff5153";
ssCountdownDefaultOptions.hoursColor = "#23d0a2";
ssCountdownDefaultOptions.daysColor = "#f9b401";
ssCountdownDefaultOptions.date = "2022-02-14";
ssCountdownDefaultOptions.time = "15:00:00";
ssCountdownDefaultOptions.timezone = "GMT+07:00";

1
public/js/sweetalert.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
public/js/sweetalert2.all.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1711
public/js/tip.js vendored Normal file

File diff suppressed because one or more lines are too long

1
public/js/tracking.js vendored Normal file

File diff suppressed because one or more lines are too long