Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !function(t) {
- "use strict";
- var e = function(o, i) {
- this.$element = t(o),
- this.options = t.extend({}, e.DEFAULTS, i),
- this.isLoading = !1
- };
- e.DEFAULTS = {
- loadingText: "loading..."
- },
- e.prototype.setState = function(e) {
- var o = "disabled"
- , i = this.$element
- , n = i.is("input") ? "val" : "html"
- , s = i.data();
- e += "Text",
- s.resetText || i.data("resetText", i[n]()),
- i[n](s[e] || this.options[e]),
- setTimeout(t.proxy(function() {
- "loadingText" == e ? (this.isLoading = !0,
- i.addClass(o).attr(o, o)) : this.isLoading && (this.isLoading = !1,
- i.removeClass(o).removeAttr(o))
- }, this), 0)
- }
- ,
- e.prototype.toggle = function() {
- var t = !0
- , e = this.$element.closest('[data-toggle="buttons"]');
- if (e.length) {
- var o = this.$element.find("input");
- "radio" == o.prop("type") && (o.prop("checked") && this.$element.hasClass("active") ? t = !1 : e.find(".active").removeClass("active")),
- t && o.prop("checked", !this.$element.hasClass("active")).trigger("change")
- }
- t && this.$element.toggleClass("active")
- }
- ;
- var o = t.fn.button;
- t.fn.button = function(o) {
- return this.each(function() {
- var i = t(this)
- , n = i.data("bs.button")
- , s = "object" == typeof o && o;
- n || i.data("bs.button", n = new e(this,s)),
- "toggle" == o ? n.toggle() : o && n.setState(o)
- })
- }
- ,
- t.fn.button.Constructor = e,
- t.fn.button.noConflict = function() {
- return t.fn.button = o,
- this
- }
- ,
- t(document).on("click.bs.button.data-api", "[data-toggle^=button]", function(e) {
- var o = t(e.target);
- o.hasClass("btn") || (o = o.closest(".btn")),
- o.button("toggle"),
- e.preventDefault()
- })
- }(jQuery),
- function(t) {
- "use strict";
- var e = function(o, i) {
- this.$element = t(o),
- this.options = t.extend({}, e.DEFAULTS, i),
- this.transitioning = null,
- this.options.parent && (this.$parent = t(this.options.parent)),
- this.options.toggle && this.toggle()
- };
- e.DEFAULTS = {
- toggle: !0
- },
- e.prototype.dimension = function() {
- var t = this.$element.hasClass("width");
- return t ? "width" : "height"
- }
- ,
- e.prototype.show = function() {
- if (!this.transitioning && !this.$element.hasClass("in")) {
- var e = t.Event("show.bs.collapse");
- if (this.$element.trigger(e),
- !e.isDefaultPrevented()) {
- var o = this.$parent && this.$parent.find("> .panel > .in");
- if (o && o.length) {
- var i = o.data("bs.collapse");
- if (i && i.transitioning)
- return;
- o.collapse("hide"),
- i || o.data("bs.collapse", null)
- }
- var n = this.dimension();
- this.$element.removeClass("collapse").addClass("collapsing")[n](0),
- this.transitioning = 1;
- var s = function() {
- this.$element.removeClass("collapsing").addClass("collapse in")[n]("auto"),
- this.transitioning = 0,
- this.$element.trigger("shown.bs.collapse")
- };
- if (!t.support.transition)
- return s.call(this);
- var a = t.camelCase(["scroll", n].join("-"));
- this.$element.one(t.support.transition.end, t.proxy(s, this)).emulateTransitionEnd(350)[n](this.$element[0][a])
- }
- }
- }
- ,
- e.prototype.hide = function() {
- if (!this.transitioning && this.$element.hasClass("in")) {
- var e = t.Event("hide.bs.collapse");
- if (this.$element.trigger(e),
- !e.isDefaultPrevented()) {
- var o = this.dimension();
- this.$element[o](this.$element[o]())[0].offsetHeight,
- this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),
- this.transitioning = 1;
- var i = function() {
- this.transitioning = 0,
- this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")
- };
- if (!t.support.transition)
- return i.call(this);
- this.$element[o](0).one(t.support.transition.end, t.proxy(i, this)).emulateTransitionEnd(350)
- }
- }
- }
- ,
- e.prototype.toggle = function() {
- this[this.$element.hasClass("in") ? "hide" : "show"]()
- }
- ;
- var o = t.fn.collapse;
- t.fn.collapse = function(o) {
- return this.each(function() {
- var i = t(this)
- , n = i.data("bs.collapse")
- , s = t.extend({}, e.DEFAULTS, i.data(), "object" == typeof o && o);
- !n && s.toggle && "show" == o && (o = !o),
- n || i.data("bs.collapse", n = new e(this,s)),
- "string" == typeof o && n[o]()
- })
- }
- ,
- t.fn.collapse.Constructor = e,
- t.fn.collapse.noConflict = function() {
- return t.fn.collapse = o,
- this
- }
- ,
- t(document).on("click.bs.collapse.data-api", "[data-toggle=collapse]", function(e) {
- var o, i = t(this), n = i.attr("data-target") || e.preventDefault() || (o = i.attr("href")) && o.replace(/.*(?=#[^\s]+$)/, ""), s = t(n), a = s.data("bs.collapse"), r = a ? "toggle" : i.data(), l = i.attr("data-parent"), p = l && t(l);
- a && a.transitioning || (p && p.find('[data-toggle=collapse][data-parent="' + l + '"]').not(i).addClass("collapsed"),
- i[s.hasClass("in") ? "addClass" : "removeClass"]("collapsed")),
- s.collapse(r)
- })
- }(jQuery),
- function(t) {
- "use strict";
- var e = ".dropdown-backdrop"
- , o = "[data-toggle=dropdown]"
- , i = function(e) {
- t(e).on("click.bs.dropdown", this.toggle)
- };
- function n(i) {
- t(e).remove(),
- t(o).each(function() {
- var e = s(t(this))
- , o = {
- relatedTarget: this,
- triggerTarget: null != i && i.currentTarget
- };
- e.hasClass("open") && (e.trigger(i = t.Event("hide.bs.dropdown", o)),
- i.isDefaultPrevented() || e.removeClass("open").removeClass("active").trigger("hidden.bs.dropdown", o))
- })
- }
- function s(e) {
- var o = e.attr("data-target");
- o || (o = e.attr("href"),
- o = o && /#[A-Za-z]/.test(o) && o.replace(/.*(?=#[^\s]*$)/, ""));
- var i = o && t(o);
- return i && i.length ? i : e.parent()
- }
- i.prototype.toggle = function(e) {
- var o = t(this);
- if (!o.is(".disabled, :disabled")) {
- var i = s(o)
- , a = i.hasClass("open");
- if (n(e),
- !a) {
- "ontouchstart"in document.documentElement && !i.closest(".navbar-nav").length && t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click", n);
- var r = {
- relatedTarget: this
- };
- if (i.trigger(e = t.Event("show.bs.dropdown", r)),
- e.isDefaultPrevented())
- return;
- i.toggleClass("open").trigger("shown.bs.dropdown", r),
- o.focus()
- }
- return !1
- }
- }
- ,
- i.prototype.keydown = function(e) {
- if (/(38|40|27)/.test(e.keyCode)) {
- var i = t(this);
- if (e.preventDefault(),
- e.stopPropagation(),
- !i.is(".disabled, :disabled")) {
- var n = s(i)
- , a = n.hasClass("open");
- if (!a || a && 27 == e.keyCode)
- return 27 == e.which && n.find(o).focus(),
- i.click();
- var r = " li:not(.divider):visible a"
- , l = n.find("[role=menu]" + r + ", [role=listbox]" + r);
- if (l.length) {
- var p = l.index(l.filter(":focus"));
- 38 == e.keyCode && p > 0 && p--,
- 40 == e.keyCode && p < l.length - 1 && p++,
- ~p || (p = 0),
- l.eq(p).focus()
- }
- }
- }
- }
- ;
- var a = t.fn.dropdown;
- t.fn.dropdown = function(e) {
- return this.each(function() {
- var o = t(this)
- , n = o.data("bs.dropdown");
- n || o.data("bs.dropdown", n = new i(this)),
- "string" == typeof e && n[e].call(o)
- })
- }
- ,
- t.fn.dropdown.Constructor = i,
- t.fn.dropdown.noConflict = function() {
- return t.fn.dropdown = a,
- this
- }
- ,
- t(document).on("click.bs.dropdown.data-api", n).on("click.bs.dropdown.data-api", ".dropdown form", function(t) {
- t.stopPropagation()
- }).on("click.bs.dropdown.data-api", o, i.prototype.toggle).on("keydown.bs.dropdown.data-api", o + ", [role=menu], [role=listbox]", i.prototype.keydown)
- }(jQuery),
- function(t) {
- "use strict";
- var e = function(t, e) {
- this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
- this.init("tooltip", t, e)
- };
- e.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
- },
- e.prototype.init = function(e, o, i) {
- this.enabled = !0,
- this.type = e,
- this.$element = t(o),
- this.options = this.getOptions(i);
- for (var n = this.options.trigger.split(" "), s = n.length; s--; ) {
- var a = n[s];
- if ("click" == a)
- this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
- else if ("manual" != a) {
- var r = "hover" == a ? "mouseenter" : "focusin"
- , l = "hover" == a ? "mouseleave" : "focusout";
- this.$element.on(r + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
- this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
- }
- }
- this.options.selector ? this._options = t.extend({}, this.options, {
- trigger: "manual",
- selector: ""
- }) : this.fixTitle()
- }
- ,
- e.prototype.getDefaults = function() {
- return e.DEFAULTS
- }
- ,
- e.prototype.getOptions = function(e) {
- return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
- e.delay && "number" == typeof e.delay && (e.delay = {
- show: e.delay,
- hide: e.delay
- }),
- e
- }
- ,
- e.prototype.getDelegateOptions = function() {
- var e = {}
- , o = this.getDefaults();
- return this._options && t.each(this._options, function(t, i) {
- o[t] != i && (e[t] = i)
- }),
- e
- }
- ,
- e.prototype.enter = function(e) {
- var o = e instanceof this.constructor ? e : t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
- if (clearTimeout(o.timeout),
- o.hoverState = "in",
- !o.options.delay || !o.options.delay.show)
- return o.show();
- o.timeout = setTimeout(function() {
- "in" == o.hoverState && o.show()
- }, o.options.delay.show)
- }
- ,
- e.prototype.leave = function(e) {
- var o = e instanceof this.constructor ? e : t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type);
- if (clearTimeout(o.timeout),
- o.hoverState = "out",
- !o.options.delay || !o.options.delay.hide)
- return o.hide();
- o.timeout = setTimeout(function() {
- "out" == o.hoverState && o.hide()
- }, o.options.delay.hide)
- }
- ,
- e.prototype.show = function() {
- var e = t.Event("show.bs." + this.type);
- if (this.hasContent() && this.enabled) {
- if (this.$element.trigger(e),
- e.isDefaultPrevented())
- return;
- var o = this
- , i = this.tip();
- this.setContent(),
- this.options.animation && i.addClass("fade");
- var n = "function" == typeof this.options.placement ? this.options.placement.call(this, i[0], this.$element[0]) : this.options.placement
- , s = /\s?auto?\s?/i
- , a = s.test(n);
- a && (n = n.replace(s, "") || "top"),
- i.detach().css({
- top: 0,
- left: 0,
- display: "block"
- }).addClass(n),
- this.options.container ? i.appendTo(this.options.container) : i.insertAfter(this.$element);
- var r = this.getPosition()
- , l = i[0].offsetWidth
- , p = i[0].offsetHeight;
- if (a) {
- var h = this.$element.parent()
- , d = n
- , c = document.documentElement.scrollTop || document.body.scrollTop
- , f = "body" == this.options.container ? window.innerWidth : h.outerWidth()
- , u = "body" == this.options.container ? window.innerHeight : h.outerHeight()
- , g = "body" == this.options.container ? 0 : h.offset().left;
- n = "bottom" == n && r.top + r.height + p - c > u ? "top" : "top" == n && r.top - c - p < 0 ? "bottom" : "right" == n && r.right + l > f ? "left" : "left" == n && r.left - l < g ? "right" : n,
- i.removeClass(d).addClass(n)
- }
- var v = this.getCalculatedOffset(n, r, l, p);
- this.applyPlacement(v, n),
- this.hoverState = null;
- var m = function() {
- o.$element.trigger("shown.bs." + o.type)
- };
- t.support.transition && this.$tip.hasClass("fade") ? i.one(t.support.transition.end, m).emulateTransitionEnd(150) : m()
- }
- }
- ,
- e.prototype.applyPlacement = function(e, o) {
- var i, n = this.tip(), s = n[0].offsetWidth, a = n[0].offsetHeight, r = parseInt(n.css("margin-top"), 10), l = parseInt(n.css("margin-left"), 10);
- isNaN(r) && (r = 0),
- isNaN(l) && (l = 0),
- e.top = e.top + r,
- e.left = e.left + l,
- t.offset.setOffset(n[0], t.extend({
- using: function(t) {
- n.css({
- top: Math.round(t.top),
- left: Math.round(t.left)
- })
- }
- }, e), 0),
- n.addClass("in");
- var p = n[0].offsetWidth
- , h = n[0].offsetHeight;
- if ("top" == o && h != a && (i = !0,
- e.top = e.top + a - h),
- /bottom|top/.test(o)) {
- var d = 0;
- e.left < 0 && (d = -2 * e.left,
- e.left = 0,
- n.offset(e),
- p = n[0].offsetWidth,
- h = n[0].offsetHeight),
- this.replaceArrow(d - s + p, p, "left")
- } else
- this.replaceArrow(h - a, h, "top");
- i && n.offset(e)
- }
- ,
- e.prototype.replaceArrow = function(t, e, o) {
- this.arrow().css(o, t ? 50 * (1 - t / e) + "%" : "")
- }
- ,
- e.prototype.setContent = function() {
- var t = this.tip()
- , e = this.getTitle();
- t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
- t.removeClass("fade in top bottom left right")
- }
- ,
- e.prototype.hide = function() {
- var e = this
- , o = this.tip()
- , i = t.Event("hide.bs." + this.type);
- function n() {
- "in" != e.hoverState && o.detach(),
- e.$element.trigger("hidden.bs." + e.type)
- }
- if (this.$element.trigger(i),
- !i.isDefaultPrevented())
- return o.removeClass("in"),
- t.support.transition && this.$tip.hasClass("fade") ? o.one(t.support.transition.end, n).emulateTransitionEnd(150) : n(),
- this.hoverState = null,
- this
- }
- ,
- e.prototype.fixTitle = function() {
- var t = this.$element;
- (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
- }
- ,
- e.prototype.hasContent = function() {
- return this.getTitle()
- }
- ,
- e.prototype.getPosition = function() {
- var e = this.$element[0];
- return t.extend({}, "function" == typeof e.getBoundingClientRect ? e.getBoundingClientRect() : {
- width: e.offsetWidth,
- height: e.offsetHeight
- }, this.$element.offset())
- }
- ,
- e.prototype.getCalculatedOffset = function(t, e, o, i) {
- return "bottom" == t ? {
- top: e.top + e.height,
- left: e.left + e.width / 2 - o / 2
- } : "top" == t ? {
- top: e.top - i,
- left: e.left + e.width / 2 - o / 2
- } : "left" == t ? {
- top: e.top + e.height / 2 - i / 2,
- left: e.left - o
- } : {
- top: e.top + e.height / 2 - i / 2,
- left: e.left + e.width
- }
- }
- ,
- e.prototype.getTitle = function() {
- var t, e = this.$element, o = this.options;
- return t = e.attr("data-original-title") || ("function" == typeof o.title ? o.title.call(e[0]) : o.title),
- t
- }
- ,
- e.prototype.tip = function() {
- return this.$tip = this.$tip || t(this.options.template)
- }
- ,
- e.prototype.arrow = function() {
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
- }
- ,
- e.prototype.validate = function() {
- this.$element[0].parentNode || (this.hide(),
- this.$element = null,
- this.options = null)
- }
- ,
- e.prototype.enable = function() {
- this.enabled = !0
- }
- ,
- e.prototype.disable = function() {
- this.enabled = !1
- }
- ,
- e.prototype.toggleEnabled = function() {
- this.enabled = !this.enabled
- }
- ,
- e.prototype.toggle = function(e) {
- var o = e ? t(e.currentTarget)[this.type](this.getDelegateOptions()).data("bs." + this.type) : this;
- o.tip().hasClass("in") ? o.leave(o) : o.enter(o)
- }
- ,
- e.prototype.destroy = function() {
- clearTimeout(this.timeout),
- this.hide().$element.off("." + this.type).removeData("bs." + this.type)
- }
- ;
- var o = t.fn.tooltip;
- t.fn.tooltip = function(o) {
- return this.each(function() {
- var i = t(this)
- , n = i.data("bs.tooltip")
- , s = "object" == typeof o && o;
- (n || "destroy" != o) && (n || i.data("bs.tooltip", n = new e(this,s)),
- "string" == typeof o && n[o]())
- })
- }
- ,
- t.fn.tooltip.Constructor = e,
- t.fn.tooltip.noConflict = function() {
- return t.fn.tooltip = o,
- this
- }
- }(jQuery),
- function(t) {
- "use strict";
- var e = function(t, e) {
- this.init("popover", t, e)
- };
- if (!t.fn.tooltip)
- throw new Error("Popover requires tooltip.js");
- e.DEFAULTS = t.extend({}, t.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>'
- }),
- e.prototype = t.extend({}, t.fn.tooltip.Constructor.prototype),
- e.prototype.constructor = e,
- e.prototype.getDefaults = function() {
- return e.DEFAULTS
- }
- ,
- e.prototype.setContent = function() {
- var t = this.tip()
- , e = this.getTitle()
- , o = this.getContent();
- t.find(".popover-title")[this.options.html ? "html" : "text"](e),
- t.find(".popover-content")[this.options.html ? "string" == typeof o ? "html" : "append" : "text"](o),
- t.removeClass("fade top bottom left right in"),
- t.find(".popover-title").html() || t.find(".popover-title").hide()
- }
- ,
- e.prototype.hasContent = function() {
- return this.getTitle() || this.getContent()
- }
- ,
- e.prototype.getContent = function() {
- var t = this.$element
- , e = this.options;
- return t.attr("data-content") || ("function" == typeof e.content ? e.content.call(t[0]) : e.content)
- }
- ,
- e.prototype.arrow = function() {
- return this.$arrow = this.$arrow || this.tip().find(".arrow")
- }
- ,
- e.prototype.tip = function() {
- return this.$tip || (this.$tip = t(this.options.template)),
- this.$tip
- }
- ;
- var o = t.fn.popover;
- t.fn.popover = function(o) {
- return this.each(function() {
- var i = t(this)
- , n = i.data("bs.popover")
- , s = "object" == typeof o && o;
- (n || "destroy" != o) && (n || i.data("bs.popover", n = new e(this,s)),
- "string" == typeof o && n[o]())
- })
- }
- ,
- t.fn.popover.Constructor = e,
- t.fn.popover.noConflict = function() {
- return t.fn.popover = o,
- this
- }
- }(jQuery),
- function(t) {
- "use strict";
- var e = function(e) {
- this.element = t(e)
- };
- e.prototype.show = function() {
- var e = this.element
- , o = e.closest("ul:not(.dropdown-menu)")
- , i = e.data("target");
- if (i || (i = e.attr("href"),
- i = i && i.replace(/.*(?=#[^\s]*$)/, "")),
- !e.parent("li").hasClass("active")) {
- var n = o.find(".active:last a")[0]
- , s = t.Event("show.bs.tab", {
- relatedTarget: n
- });
- if (e.trigger(s),
- !s.isDefaultPrevented()) {
- var a = t(i);
- this.activate(e.parent("li"), o),
- this.activate(a, a.parent(), function() {
- e.trigger({
- type: "shown.bs.tab",
- relatedTarget: n
- })
- })
- }
- }
- }
- ,
- e.prototype.activate = function(e, o, i) {
- var n = o.find("> .active")
- , s = i && t.support.transition && n.hasClass("fade");
- function a() {
- n.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),
- e.addClass("active"),
- s ? (e[0].offsetWidth,
- e.addClass("in")) : e.removeClass("fade"),
- e.parent(".dropdown-menu") && e.closest("li.dropdown").addClass("active"),
- i && i()
- }
- s ? n.one(t.support.transition.end, a).emulateTransitionEnd(150) : a(),
- n.removeClass("in")
- }
- ;
- var o = t.fn.tab;
- t.fn.tab = function(o) {
- return this.each(function() {
- var i = t(this)
- , n = i.data("bs.tab");
- n || i.data("bs.tab", n = new e(this)),
- "string" == typeof o && n[o]()
- })
- }
- ,
- t.fn.tab.Constructor = e,
- t.fn.tab.noConflict = function() {
- return t.fn.tab = o,
- this
- }
- ,
- t(document).on("click.bs.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function(e) {
- e.preventDefault(),
- t(this).tab("show")
- })
- }(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement