bootstrap.min.js 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. /*!
  2. * Bootstrap.js by @fat & @mdo
  3. * Copyright 2012 Twitter, Inc.
  4. * http://www.apache.org/licenses/LICENSE-2.0.txt
  5. 创建人:FH fh313596790qq(青苔)
  6. */
  7. !
  8. function (e) {
  9. "use strict";
  10. e(function () {
  11. e.support.transition = function () {
  12. var e = function () {
  13. var e = document.createElement("bootstrap"),
  14. t = {
  15. WebkitTransition: "webkitTransitionEnd",
  16. MozTransition: "transitionend",
  17. OTransition: "oTransitionEnd otransitionend",
  18. transition: "transitionend"
  19. },
  20. n;
  21. for (n in t) if (e.style[n] !== undefined) return t[n]
  22. }();
  23. return e && {
  24. end: e
  25. }
  26. }()
  27. })
  28. }(window.jQuery),
  29. !
  30. function (e) {
  31. "use strict";
  32. var t = '[data-dismiss="alert"]',
  33. n = function (n) {
  34. e(n).on("click", t, this.close)
  35. };
  36. n.prototype.close = function (t) {
  37. function s() {
  38. i.trigger("closed").remove()
  39. }
  40. var n = e(this),
  41. r = n.attr("data-target"),
  42. i;
  43. r || (r = n.attr("href"), r = r && r.replace(/.*(?=#[^\s]*$)/, "")),
  44. i = e(r),
  45. t && t.preventDefault(),
  46. i.length || (i = n.hasClass("alert") ? n : n.parent()),
  47. i.trigger(t = e.Event("close"));
  48. if (t.isDefaultPrevented()) return;
  49. i.removeClass("in"),
  50. e.support.transition && i.hasClass("fade") ? i.on(e.support.transition.end, s) : s()
  51. };
  52. var r = e.fn.alert;
  53. e.fn.alert = function (t) {
  54. return this.each(function () {
  55. var r = e(this),
  56. i = r.data("alert");
  57. i || r.data("alert", i = new n(this)),
  58. typeof t == "string" && i[t].call(r)
  59. })
  60. },
  61. e.fn.alert.Constructor = n,
  62. e.fn.alert.noConflict = function () {
  63. return e.fn.alert = r,
  64. this
  65. }
  66. }(window.jQuery),
  67. !
  68. function (e) {
  69. "use strict";
  70. var t = function (t, n) {
  71. this.$element = e(t),
  72. this.options = e.extend({}, e.fn.button.defaults, n)
  73. };
  74. t.prototype.setState = function (e) {
  75. var t = "disabled",
  76. n = this.$element,
  77. r = n.data(),
  78. i = n.is("input") ? "val" : "html";
  79. e += "Text",
  80. r.resetText || n.data("resetText", n[i]()),
  81. n[i](r[e] || this.options[e]),
  82. setTimeout(function () {
  83. e == "loadingText" ? n.addClass(t).attr(t, t) : n.removeClass(t).removeAttr(t)
  84. }, 0)
  85. },
  86. t.prototype.toggle = function () {
  87. var e = this.$element.closest('[data-toggle="buttons-radio"]');
  88. e && e.find(".active").removeClass("active"),
  89. this.$element.toggleClass("active")
  90. };
  91. var n = e.fn.button;
  92. e.fn.button = function (n) {
  93. return this.each(function () {
  94. var r = e(this),
  95. i = r.data("button"),
  96. s = typeof n == "object" && n;
  97. i || r.data("button", i = new t(this, s)),
  98. n == "toggle" ? i.toggle() : n && i.setState(n)
  99. })
  100. },
  101. e.fn.button.defaults = {
  102. loadingText: "loading..."
  103. },
  104. e.fn.button.Constructor = t,
  105. e.fn.button.noConflict = function () {
  106. return e.fn.button = n,
  107. this
  108. }
  109. }(window.jQuery),
  110. !
  111. function (e) {
  112. "use strict";
  113. var t = function (t, n) {
  114. this.$element = e(t),
  115. this.$indicators = this.$element.find(".carousel-indicators"),
  116. this.options = n,
  117. this.options.pause == "hover" && this.$element.on("mouseenter", e.proxy(this.pause, this)).on("mouseleave", e.proxy(this.cycle, this))
  118. };
  119. t.prototype = {
  120. cycle: function (t) {
  121. return t || (this.paused = !1),
  122. this.interval && clearInterval(this.interval),
  123. this.options.interval && !this.paused && (this.interval = setInterval(e.proxy(this.next, this), this.options.interval)),
  124. this
  125. },
  126. getActiveIndex: function () {
  127. return this.$active = this.$element.find(".item.active"),
  128. this.$items = this.$active.parent().children(),
  129. this.$items.index(this.$active)
  130. },
  131. to: function (t) {
  132. var n = this.getActiveIndex(),
  133. r = this;
  134. if (t > this.$items.length - 1 || t < 0) return;
  135. return this.sliding ? this.$element.one("slid", function () {
  136. r.to(t)
  137. }) : n == t ? this.pause().cycle() : this.slide(t > n ? "next" : "prev", e(this.$items[t]))
  138. },
  139. pause: function (t) {
  140. return t || (this.paused = !0),
  141. this.$element.find(".next, .prev").length && e.support.transition.end && (this.$element.trigger(e.support.transition.end), this.cycle(!0)),
  142. clearInterval(this.interval),
  143. this.interval = null,
  144. this
  145. },
  146. next: function () {
  147. if (this.sliding) return;
  148. return this.slide("next")
  149. },
  150. prev: function () {
  151. if (this.sliding) return;
  152. return this.slide("prev")
  153. },
  154. slide: function (t, n) {
  155. var r = this.$element.find(".item.active"),
  156. i = n || r[t](),
  157. s = this.interval,
  158. o = t == "next" ? "left" : "right",
  159. u = t == "next" ? "first" : "last",
  160. a = this,
  161. f;
  162. this.sliding = !0,
  163. s && this.pause(),
  164. i = i.length ? i : this.$element.find(".item")[u](),
  165. f = e.Event("slide", {
  166. relatedTarget: i[0],
  167. direction: o
  168. });
  169. if (i.hasClass("active")) return;
  170. this.$indicators.length && (this.$indicators.find(".active").removeClass("active"), this.$element.one("slid", function () {
  171. var t = e(a.$indicators.children()[a.getActiveIndex()]);
  172. t && t.addClass("active")
  173. }));
  174. if (e.support.transition && this.$element.hasClass("slide")) {
  175. this.$element.trigger(f);
  176. if (f.isDefaultPrevented()) return;
  177. i.addClass(t),
  178. i[0].offsetWidth,
  179. r.addClass(o),
  180. i.addClass(o),
  181. this.$element.one(e.support.transition.end, function () {
  182. i.removeClass([t, o].join(" ")).addClass("active"),
  183. r.removeClass(["active", o].join(" ")),
  184. a.sliding = !1,
  185. setTimeout(function () {
  186. a.$element.trigger("slid")
  187. }, 0)
  188. })
  189. } else {
  190. this.$element.trigger(f);
  191. if (f.isDefaultPrevented()) return;
  192. r.removeClass("active"),
  193. i.addClass("active"),
  194. this.sliding = !1,
  195. this.$element.trigger("slid")
  196. }
  197. return s && this.cycle(),
  198. this
  199. }
  200. };
  201. var n = e.fn.carousel;
  202. e.fn.carousel = function (n) {
  203. return this.each(function () {
  204. var r = e(this),
  205. i = r.data("carousel"),
  206. s = e.extend({}, e.fn.carousel.defaults, typeof n == "object" && n),
  207. o = typeof n == "string" ? n : s.slide;
  208. i || r.data("carousel", i = new t(this, s)),
  209. typeof n == "number" ? i.to(n) : o ? i[o]() : s.interval && i.pause().cycle()
  210. })
  211. },
  212. e.fn.carousel.defaults = {
  213. interval: 5e3,
  214. pause: "hover"
  215. },
  216. e.fn.carousel.Constructor = t,
  217. e.fn.carousel.noConflict = function () {
  218. return e.fn.carousel = n,
  219. this
  220. }
  221. }(window.jQuery),
  222. !
  223. function (e) {
  224. "use strict";
  225. var t = function (t, n) {
  226. this.$element = e(t),
  227. this.options = e.extend({}, e.fn.collapse.defaults, n),
  228. this.options.parent && (this.$parent = e(this.options.parent)),
  229. this.options.toggle && this.toggle()
  230. };
  231. t.prototype = {
  232. constructor: t,
  233. dimension: function () {
  234. var e = this.$element.hasClass("width");
  235. return e ? "width" : "height"
  236. },
  237. show: function () {
  238. var t, n, r, i;
  239. if (this.transitioning || this.$element.hasClass("in")) return;
  240. t = this.dimension(),
  241. n = e.camelCase(["scroll", t].join("-")),
  242. r = this.$parent && this.$parent.find("> .accordion-group > .in");
  243. if (r && r.length) {
  244. i = r.data("collapse");
  245. if (i && i.transitioning) return;
  246. r.collapse("hide"),
  247. i || r.data("collapse", null)
  248. }
  249. this.$element[t](0),
  250. this.transition("addClass", e.Event("show"), "shown"),
  251. e.support.transition && this.$element[t](this.$element[0][n])
  252. },
  253. hide: function () {
  254. var t;
  255. if (this.transitioning || !this.$element.hasClass("in")) return;
  256. t = this.dimension(),
  257. this.reset(this.$element[t]()),
  258. this.transition("removeClass", e.Event("hide"), "hidden"),
  259. this.$element[t](0)
  260. },
  261. reset: function (e) {
  262. var t = this.dimension();
  263. return this.$element.removeClass("collapse")[t](e || "auto")[0].offsetWidth,
  264. this.$element[e !== null ? "addClass" : "removeClass"]("collapse"),
  265. this
  266. },
  267. transition: function (t, n, r) {
  268. var i = this,
  269. s = function () {
  270. n.type == "show" && i.reset(),
  271. i.transitioning = 0,
  272. i.$element.trigger(r)
  273. };
  274. this.$element.trigger(n);
  275. if (n.isDefaultPrevented()) return;
  276. this.transitioning = 1,
  277. this.$element[t]("in"),
  278. e.support.transition && this.$element.hasClass("collapse") ? this.$element.one(e.support.transition.end, s) : s()
  279. },
  280. toggle: function () {
  281. this[this.$element.hasClass("in") ? "hide" : "show"]()
  282. }
  283. };
  284. var n = e.fn.collapse;
  285. e.fn.collapse = function (n) {
  286. return this.each(function () {
  287. var r = e(this),
  288. i = r.data("collapse"),
  289. s = e.extend({}, e.fn.collapse.defaults, r.data(), typeof n == "object" && n);
  290. i || r.data("collapse", i = new t(this, s)),
  291. typeof n == "string" && i[n]()
  292. })
  293. },
  294. e.fn.collapse.defaults = {
  295. toggle: !0
  296. },
  297. e.fn.collapse.Constructor = t,
  298. e.fn.collapse.noConflict = function () {
  299. return e.fn.collapse = n,
  300. this
  301. }
  302. }(window.jQuery),
  303. !
  304. function (e) {
  305. "use strict";
  306. function r() {
  307. e(t).each(function () {
  308. i(e(this)).removeClass("open")
  309. })
  310. }
  311. function i(t) {
  312. var n = t.attr("data-target"),
  313. r;
  314. n || (n = t.attr("href"), n = n && /#/.test(n) && n.replace(/.*(?=#[^\s]*$)/, "")),
  315. r = n && e(n);
  316. if (!r || !r.length) r = t.parent();
  317. return r
  318. }
  319. var t = "[data-toggle=dropdown]",
  320. n = function (t) {
  321. var n = e(t).on("click.dropdown.data-api", this.toggle);
  322. e("html").on("click.dropdown.data-api", function () {
  323. n.parent().removeClass("open")
  324. })
  325. };
  326. n.prototype = {
  327. constructor: n,
  328. toggle: function (t) {
  329. var n = e(this),
  330. s, o;
  331. if (n.is(".disabled, :disabled")) return;
  332. return s = i(n),
  333. o = s.hasClass("open"),
  334. r(),
  335. o || s.toggleClass("open"),
  336. n.focus(),
  337. !1
  338. },
  339. keydown: function (n) {
  340. var r, s, o, u, a, f;
  341. if (!/(38|40|27)/.test(n.keyCode)) return;
  342. r = e(this),
  343. n.preventDefault(),
  344. n.stopPropagation();
  345. if (r.is(".disabled, :disabled")) return;
  346. u = i(r),
  347. a = u.hasClass("open");
  348. if (!a || a && n.keyCode == 27) return n.which == 27 && u.find(t).focus(),
  349. r.click();
  350. s = e("[role=menu] li:not(.divider):visible a", u);
  351. if (!s.length) return;
  352. f = s.index(s.filter(":focus")),
  353. n.keyCode == 38 && f > 0 && f--,
  354. n.keyCode == 40 && f < s.length - 1 && f++,
  355. ~f || (f = 0),
  356. s.eq(f).focus()
  357. }
  358. };
  359. var s = e.fn.dropdown;
  360. e.fn.dropdown = function (t) {
  361. return this.each(function () {
  362. var r = e(this),
  363. i = r.data("dropdown");
  364. i || r.data("dropdown", i = new n(this)),
  365. typeof t == "string" && i[t].call(r)
  366. })
  367. },
  368. e.fn.dropdown.Constructor = n,
  369. e.fn.dropdown.noConflict = function () {
  370. return e.fn.dropdown = s,
  371. this
  372. }
  373. }(window.jQuery),
  374. !
  375. function (e) {
  376. "use strict";
  377. var t = function (t, n) {
  378. this.options = n,
  379. this.$element = e(t).delegate('[data-dismiss="modal"]', "click.dismiss.modal", e.proxy(this.hide, this)),
  380. this.options.remote && this.$element.find(".modal-body").load(this.options.remote)
  381. };
  382. t.prototype = {
  383. constructor: t,
  384. toggle: function () {
  385. return this[this.isShown ? "hide" : "show"]()
  386. },
  387. show: function () {
  388. var t = this,
  389. n = e.Event("show");
  390. this.$element.trigger(n);
  391. if (this.isShown || n.isDefaultPrevented()) return;
  392. this.isShown = !0,
  393. this.escape(),
  394. this.backdrop(function () {
  395. var n = e.support.transition && t.$element.hasClass("fade");
  396. t.$element.parent().length || t.$element.appendTo(document.body),
  397. t.$element.show(),
  398. n && t.$element[0].offsetWidth,
  399. t.$element.addClass("in").attr("aria-hidden", !1),
  400. t.enforceFocus(),
  401. n ? t.$element.one(e.support.transition.end, function () {
  402. t.$element.focus().trigger("shown")
  403. }) : t.$element.focus().trigger("shown")
  404. })
  405. },
  406. hide: function (t) {
  407. t && t.preventDefault();
  408. var n = this;
  409. t = e.Event("hide"),
  410. this.$element.trigger(t);
  411. if (!this.isShown || t.isDefaultPrevented()) return;
  412. this.isShown = !1,
  413. this.escape(),
  414. e(document).off("focusin.modal"),
  415. this.$element.removeClass("in").attr("aria-hidden", !0),
  416. e.support.transition && this.$element.hasClass("fade") ? this.hideWithTransition() : this.hideModal()
  417. },
  418. enforceFocus: function () {
  419. var t = this;
  420. e(document).on("focusin.modal", function (e) {
  421. t.$element[0] !== e.target && !t.$element.has(e.target).length && t.$element.focus()
  422. })
  423. },
  424. escape: function () {
  425. var e = this;
  426. this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.modal", function (t) {
  427. t.which == 27 && e.hide()
  428. }) : this.isShown || this.$element.off("keyup.dismiss.modal")
  429. },
  430. hideWithTransition: function () {
  431. var t = this,
  432. n = setTimeout(function () {
  433. t.$element.off(e.support.transition.end),
  434. t.hideModal()
  435. }, 500);
  436. this.$element.one(e.support.transition.end, function () {
  437. clearTimeout(n),
  438. t.hideModal()
  439. })
  440. },
  441. hideModal: function () {
  442. var e = this;
  443. this.$element.hide(),
  444. this.backdrop(function () {
  445. e.removeBackdrop(),
  446. e.$element.trigger("hidden")
  447. })
  448. },
  449. removeBackdrop: function () {
  450. this.$backdrop && this.$backdrop.remove(),
  451. this.$backdrop = null
  452. },
  453. backdrop: function (t) {
  454. var n = this,
  455. r = this.$element.hasClass("fade") ? "fade" : "";
  456. if (this.isShown && this.options.backdrop) {
  457. var i = e.support.transition && r;
  458. this.$backdrop = e('<div class="modal-backdrop ' + r + '" />').appendTo(document.body),
  459. this.$backdrop.click(this.options.backdrop == "static" ? e.proxy(this.$element[0].focus, this.$element[0]) : e.proxy(this.hide, this)),
  460. i && this.$backdrop[0].offsetWidth,
  461. this.$backdrop.addClass("in");
  462. if (!t) return;
  463. i ? this.$backdrop.one(e.support.transition.end, t) : t()
  464. } else!this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), e.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(e.support.transition.end, t) : t()) : t && t()
  465. }
  466. };
  467. var n = e.fn.modal;
  468. e.fn.modal = function (n) {
  469. return this.each(function () {
  470. var r = e(this),
  471. i = r.data("modal"),
  472. s = e.extend({}, e.fn.modal.defaults, r.data(), typeof n == "object" && n);
  473. i || r.data("modal", i = new t(this, s)),
  474. typeof n == "string" ? i[n]() : s.show && i.show()
  475. })
  476. },
  477. e.fn.modal.defaults = {
  478. backdrop: !0,
  479. keyboard: !0,
  480. show: !0
  481. },
  482. e.fn.modal.Constructor = t,
  483. e.fn.modal.noConflict = function () {
  484. return e.fn.modal = n,
  485. this
  486. }
  487. }(window.jQuery),
  488. !
  489. function (e) {
  490. "use strict";
  491. var t = function (e, t) {
  492. this.init("tooltip", e, t)
  493. };
  494. t.prototype = {
  495. constructor: t,
  496. init: function (t, n, r) {
  497. var i, s, o, u, a;
  498. this.type = t,
  499. this.$element = e(n),
  500. this.options = this.getOptions(r),
  501. this.enabled = !0,
  502. o = this.options.trigger.split(" ");
  503. for (a = o.length; a--;) u = o[a],
  504. u == "click" ? this.$element.on("click." + this.type, this.options.selector, e.proxy(this.toggle, this)) : u != "manual" && (i = u == "hover" ? "mouseenter" : "focus", s = u == "hover" ? "mouseleave" : "blur", this.$element.on(i + "." + this.type, this.options.selector, e.proxy(this.enter, this)), this.$element.on(s + "." + this.type, this.options.selector, e.proxy(this.leave, this)));
  505. this.options.selector ? this._options = e.extend({}, this.options, {
  506. trigger: "manual",
  507. selector: ""
  508. }) : this.fixTitle()
  509. },
  510. getOptions: function (t) {
  511. return t = e.extend({}, e.fn[this.type].defaults, this.$element.data(), t),
  512. t.delay && typeof t.delay == "number" && (t.delay = {
  513. show: t.delay,
  514. hide: t.delay
  515. }),
  516. t
  517. },
  518. enter: function (t) {
  519. var n = e.fn[this.type].defaults,
  520. r = {},
  521. i;
  522. this._options && e.each(this._options, function (e, t) {
  523. n[e] != t && (r[e] = t)
  524. }, this),
  525. i = e(t.currentTarget)[this.type](r).data(this.type);
  526. if (!i.options.delay || !i.options.delay.show) return i.show();
  527. clearTimeout(this.timeout),
  528. i.hoverState = "in",
  529. this.timeout = setTimeout(function () {
  530. i.hoverState == "in" && i.show()
  531. }, i.options.delay.show)
  532. },
  533. leave: function (t) {
  534. var n = e(t.currentTarget)[this.type](this._options).data(this.type);
  535. this.timeout && clearTimeout(this.timeout);
  536. if (!n.options.delay || !n.options.delay.hide) return n.hide();
  537. n.hoverState = "out",
  538. this.timeout = setTimeout(function () {
  539. n.hoverState == "out" && n.hide()
  540. }, n.options.delay.hide)
  541. },
  542. show: function () {
  543. var t, n, r, i, s, o, u = e.Event("show");
  544. if (this.hasContent() && this.enabled) {
  545. this.$element.trigger(u);
  546. if (u.isDefaultPrevented()) return;
  547. t = this.tip(),
  548. this.setContent(),
  549. this.options.animation && t.addClass("fade"),
  550. s = typeof this.options.placement == "function" ? this.options.placement.call(this, t[0], this.$element[0]) : this.options.placement,
  551. t.detach().css({
  552. top: 0,
  553. left: 0,
  554. display: "block"
  555. }),
  556. this.options.container ? t.appendTo(this.options.container) : t.insertAfter(this.$element),
  557. n = this.getPosition(),
  558. r = t[0].offsetWidth,
  559. i = t[0].offsetHeight;
  560. switch (s) {
  561. case "bottom":
  562. o = {
  563. top: n.top + n.height,
  564. left: n.left + n.width / 2 - r / 2
  565. };
  566. break;
  567. case "top":
  568. o = {
  569. top: n.top - i,
  570. left: n.left + n.width / 2 - r / 2
  571. };
  572. break;
  573. case "left":
  574. o = {
  575. top: n.top + n.height / 2 - i / 2,
  576. left: n.left - r
  577. };
  578. break;
  579. case "right":
  580. o = {
  581. top: n.top + n.height / 2 - i / 2,
  582. left: n.left + n.width
  583. }
  584. }
  585. this.applyPlacement(o, s),
  586. this.$element.trigger("shown")
  587. }
  588. },
  589. applyPlacement: function (e, t) {
  590. var n = this.tip(),
  591. r = n[0].offsetWidth,
  592. i = n[0].offsetHeight,
  593. s, o, u, a;
  594. n.offset(e).addClass(t).addClass("in"),
  595. s = n[0].offsetWidth,
  596. o = n[0].offsetHeight,
  597. t == "top" && o != i && (e.top = e.top + i - o, a = !0),
  598. t == "bottom" || t == "top" ? (u = 0, e.left < 0 && (u = e.left * -2, e.left = 0, n.offset(e), s = n[0].offsetWidth, o = n[0].offsetHeight), this.replaceArrow(u - r + s, s, "left")) : this.replaceArrow(o - i, o, "top"),
  599. a && n.offset(e)
  600. },
  601. replaceArrow: function (e, t, n) {
  602. this.arrow().css(n, e ? 50 * (1 - e / t) + "%" : "")
  603. },
  604. setContent: function () {
  605. var e = this.tip(),
  606. t = this.getTitle();
  607. e.find(".tooltip-inner")[this.options.html ? "html" : "text"](t),
  608. e.removeClass("fade in top bottom left right")
  609. },
  610. hide: function () {
  611. function i() {
  612. var t = setTimeout(function () {
  613. n.off(e.support.transition.end).detach()
  614. }, 500);
  615. n.one(e.support.transition.end, function () {
  616. clearTimeout(t),
  617. n.detach()
  618. })
  619. }
  620. var t = this,
  621. n = this.tip(),
  622. r = e.Event("hide");
  623. this.$element.trigger(r);
  624. if (r.isDefaultPrevented()) return;
  625. return n.removeClass("in"),
  626. e.support.transition && this.$tip.hasClass("fade") ? i() : n.detach(),
  627. this.$element.trigger("hidden"),
  628. this
  629. },
  630. fixTitle: function () {
  631. var e = this.$element;
  632. (e.attr("title") || typeof e.attr("data-original-title") != "string") && e.attr("data-original-title", e.attr("title") || "").attr("title", "")
  633. },
  634. hasContent: function () {
  635. return this.getTitle()
  636. },
  637. getPosition: function () {
  638. var t = this.$element[0];
  639. return e.extend({}, typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect() : {
  640. width: t.offsetWidth,
  641. height: t.offsetHeight
  642. }, this.$element.offset())
  643. },
  644. getTitle: function () {
  645. var e, t = this.$element,
  646. n = this.options;
  647. return e = t.attr("data-original-title") || (typeof n.title == "function" ? n.title.call(t[0]) : n.title),
  648. e
  649. },
  650. tip: function () {
  651. return this.$tip = this.$tip || e(this.options.template)
  652. },
  653. arrow: function () {
  654. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  655. },
  656. validate: function () {
  657. this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
  658. },
  659. enable: function () {
  660. this.enabled = !0
  661. },
  662. disable: function () {
  663. this.enabled = !1
  664. },
  665. toggleEnabled: function () {
  666. this.enabled = !this.enabled
  667. },
  668. toggle: function (t) {
  669. var n = t ? e(t.currentTarget)[this.type](this._options).data(this.type) : this;
  670. n.tip().hasClass("in") ? n.hide() : n.show()
  671. },
  672. destroy: function () {
  673. this.hide().$element.off("." + this.type).removeData(this.type)
  674. }
  675. };
  676. var n = e.fn.tooltip;
  677. e.fn.tooltip = function (n) {
  678. return this.each(function () {
  679. var r = e(this),
  680. i = r.data("tooltip"),
  681. s = typeof n == "object" && n;
  682. i || r.data("tooltip", i = new t(this, s)),
  683. typeof n == "string" && i[n]()
  684. })
  685. },
  686. e.fn.tooltip.Constructor = t,
  687. e.fn.tooltip.defaults = {
  688. animation: !0,
  689. placement: "top",
  690. selector: !1,
  691. template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  692. trigger: "hover focus",
  693. title: "",
  694. delay: 0,
  695. html: !1,
  696. container: !1
  697. },
  698. e.fn.tooltip.noConflict = function () {
  699. return e.fn.tooltip = n,
  700. this
  701. }
  702. }(window.jQuery),
  703. !
  704. function (e) {
  705. "use strict";
  706. var t = function (e, t) {
  707. this.init("popover", e, t)
  708. };
  709. t.prototype = e.extend({}, e.fn.tooltip.Constructor.prototype, {
  710. constructor: t,
  711. setContent: function () {
  712. var e = this.tip(),
  713. t = this.getTitle(),
  714. n = this.getContent();
  715. e.find(".popover-title")[this.options.html ? "html" : "text"](t),
  716. e.find(".popover-content")[this.options.html ? "html" : "text"](n),
  717. e.removeClass("fade top bottom left right in")
  718. },
  719. hasContent: function () {
  720. return this.getTitle() || this.getContent()
  721. },
  722. getContent: function () {
  723. var e, t = this.$element,
  724. n = this.options;
  725. return e = (typeof n.content == "function" ? n.content.call(t[0]) : n.content) || t.attr("data-content"),
  726. e
  727. },
  728. tip: function () {
  729. return this.$tip || (this.$tip = e(this.options.template)),
  730. this.$tip
  731. },
  732. destroy: function () {
  733. this.hide().$element.off("." + this.type).removeData(this.type)
  734. }
  735. });
  736. var n = e.fn.popover;
  737. e.fn.popover = function (n) {
  738. return this.each(function () {
  739. var r = e(this),
  740. i = r.data("popover"),
  741. s = typeof n == "object" && n;
  742. i || r.data("popover", i = new t(this, s)),
  743. typeof n == "string" && i[n]()
  744. })
  745. },
  746. e.fn.popover.Constructor = t,
  747. e.fn.popover.defaults = e.extend({}, e.fn.tooltip.defaults, {
  748. placement: "right",
  749. trigger: "click",
  750. content: "",
  751. template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  752. }),
  753. e.fn.popover.noConflict = function () {
  754. return e.fn.popover = n,
  755. this
  756. }
  757. }(window.jQuery),
  758. !
  759. function (e) {
  760. "use strict";
  761. function t(t, n) {
  762. var r = e.proxy(this.process, this),
  763. i = e(t).is("body") ? e(window) : e(t),
  764. s;
  765. this.options = e.extend({}, e.fn.scrollspy.defaults, n),
  766. this.$scrollElement = i.on("scroll.scroll-spy.data-api", r),
  767. this.selector = (this.options.target || (s = e(t).attr("href")) && s.replace(/.*(?=#[^\s]+$)/, "") || "") + " .nav li > a",
  768. this.$body = e("body"),
  769. this.refresh(),
  770. this.process()
  771. }
  772. t.prototype = {
  773. constructor: t,
  774. refresh: function () {
  775. var t = this,
  776. n;
  777. this.offsets = e([]),
  778. this.targets = e([]),
  779. n = this.$body.find(this.selector).map(function () {
  780. var n = e(this),
  781. r = n.data("target") || n.attr("href"),
  782. i = /^#\w/.test(r) && e(r);
  783. return i && i.length && [
  784. [i.position().top + (!e.isWindow(t.$scrollElement.get(0)) && t.$scrollElement.scrollTop()), r]
  785. ] || null
  786. }).sort(function (e, t) {
  787. return e[0] - t[0]
  788. }).each(function () {
  789. t.offsets.push(this[0]),
  790. t.targets.push(this[1])
  791. })
  792. },
  793. process: function () {
  794. var e = this.$scrollElement.scrollTop() + this.options.offset,
  795. t = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight,
  796. n = t - this.$scrollElement.height(),
  797. r = this.offsets,
  798. i = this.targets,
  799. s = this.activeTarget,
  800. o;
  801. if (e >= n) return s != (o = i.last()[0]) && this.activate(o);
  802. for (o = r.length; o--;) s != i[o] && e >= r[o] && (!r[o + 1] || e <= r[o + 1]) && this.activate(i[o])
  803. },
  804. activate: function (t) {
  805. var n, r;
  806. this.activeTarget = t,
  807. e(this.selector).parent(".active").removeClass("active"),
  808. r = this.selector + '[data-target="' + t + '"],' + this.selector + '[href="' + t + '"]',
  809. n = e(r).parent("li").addClass("active"),
  810. n.parent(".dropdown-menu").length && (n = n.closest("li.dropdown").addClass("active")),
  811. n.trigger("activate")
  812. }
  813. };
  814. var n = e.fn.scrollspy;
  815. e.fn.scrollspy = function (n) {
  816. return this.each(function () {
  817. var r = e(this),
  818. i = r.data("scrollspy"),
  819. s = typeof n == "object" && n;
  820. i || r.data("scrollspy", i = new t(this, s)),
  821. typeof n == "string" && i[n]()
  822. })
  823. },
  824. e.fn.scrollspy.Constructor = t,
  825. e.fn.scrollspy.defaults = {
  826. offset: 10
  827. },
  828. e.fn.scrollspy.noConflict = function () {
  829. return e.fn.scrollspy = n,
  830. this
  831. }
  832. }(window.jQuery),
  833. !
  834. function (e) {
  835. "use strict";
  836. var t = function (t) {
  837. this.element = e(t)
  838. };
  839. t.prototype = {
  840. constructor: t,
  841. show: function () {
  842. var t = this.element,
  843. n = t.closest("ul:not(.dropdown-menu)"),
  844. r = t.attr("data-target"),
  845. i, s, o;
  846. r || (r = t.attr("href"), r = r && r.replace(/.*(?=#[^\s]*$)/, ""));
  847. if (t.parent("li").hasClass("active")) return;
  848. i = n.find(".active:last a")[0],
  849. o = e.Event("show", {
  850. relatedTarget: i
  851. }),
  852. t.trigger(o);
  853. if (o.isDefaultPrevented()) return;
  854. s = e(r),
  855. this.activate(t.parent("li"), n),
  856. this.activate(s, s.parent(), function () {
  857. t.trigger({
  858. type: "shown",
  859. relatedTarget: i
  860. })
  861. })
  862. },
  863. activate: function (t, n, r) {
  864. function o() {
  865. i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),
  866. t.addClass("active"),
  867. s ? (t[0].offsetWidth, t.addClass("in")) : t.removeClass("fade"),
  868. t.parent(".dropdown-menu") && t.closest("li.dropdown").addClass("active"),
  869. r && r()
  870. }
  871. var i = n.find("> .active"),
  872. s = r && e.support.transition && i.hasClass("fade");
  873. s ? i.one(e.support.transition.end, o) : o(),
  874. i.removeClass("in")
  875. }
  876. };
  877. var n = e.fn.tab;
  878. e.fn.tab = function (n) {
  879. return this.each(function () {
  880. var r = e(this),
  881. i = r.data("tab");
  882. i || r.data("tab", i = new t(this)),
  883. typeof n == "string" && i[n]()
  884. })
  885. },
  886. e.fn.tab.Constructor = t,
  887. e.fn.tab.noConflict = function () {
  888. return e.fn.tab = n,
  889. this
  890. }
  891. }(window.jQuery),
  892. !
  893. function (e) {
  894. "use strict";
  895. var t = function (t, n) {
  896. this.$element = e(t),
  897. this.options = e.extend({}, e.fn.typeahead.defaults, n),
  898. this.matcher = this.options.matcher || this.matcher,
  899. this.sorter = this.options.sorter || this.sorter,
  900. this.highlighter = this.options.highlighter || this.highlighter,
  901. this.updater = this.options.updater || this.updater,
  902. this.source = this.options.source,
  903. this.$menu = e(this.options.menu),
  904. this.shown = !1,
  905. this.listen()
  906. };
  907. t.prototype = {
  908. constructor: t,
  909. select: function () {
  910. var e = this.$menu.find(".active").attr("data-value");
  911. return this.$element.val(this.updater(e)).change(),
  912. this.hide()
  913. },
  914. updater: function (e) {
  915. return e
  916. },
  917. show: function () {
  918. var t = e.extend({}, this.$element.position(), {
  919. height: this.$element[0].offsetHeight
  920. });
  921. return this.$menu.insertAfter(this.$element).css({
  922. top: t.top + t.height,
  923. left: t.left
  924. }).show(),
  925. this.shown = !0,
  926. this
  927. },
  928. hide: function () {
  929. return this.$menu.hide(),
  930. this.shown = !1,
  931. this
  932. },
  933. lookup: function (t) {
  934. var n;
  935. return this.query = this.$element.val(),
  936. !this.query || this.query.length < this.options.minLength ? this.shown ? this.hide() : this : (n = e.isFunction(this.source) ? this.source(this.query, e.proxy(this.process, this)) : this.source, n ? this.process(n) : this)
  937. },
  938. process: function (t) {
  939. var n = this;
  940. return t = e.grep(t, function (e) {
  941. return n.matcher(e)
  942. }),
  943. t = this.sorter(t),
  944. t.length ? this.render(t.slice(0, this.options.items)).show() : this.shown ? this.hide() : this
  945. },
  946. matcher: function (e) {
  947. return~e.toLowerCase().indexOf(this.query.toLowerCase())
  948. },
  949. sorter: function (e) {
  950. var t = [],
  951. n = [],
  952. r = [],
  953. i;
  954. while (i = e.shift()) i.toLowerCase().indexOf(this.query.toLowerCase()) ? ~i.indexOf(this.query) ? n.push(i) : r.push(i) : t.push(i);
  955. return t.concat(n, r)
  956. },
  957. highlighter: function (e) {
  958. var t = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
  959. return e.replace(new RegExp("(" + t + ")", "ig"), function (e, t) {
  960. return "<strong>" + t + "</strong>"
  961. })
  962. },
  963. render: function (t) {
  964. var n = this;
  965. return t = e(t).map(function (t, r) {
  966. return t = e(n.options.item).attr("data-value", r),
  967. t.find("a").html(n.highlighter(r)),
  968. t[0]
  969. }),
  970. t.first().addClass("active"),
  971. this.$menu.html(t),
  972. this
  973. },
  974. next: function (t) {
  975. var n = this.$menu.find(".active").removeClass("active"),
  976. r = n.next();
  977. r.length || (r = e(this.$menu.find("li")[0])),
  978. r.addClass("active")
  979. },
  980. prev: function (e) {
  981. var t = this.$menu.find(".active").removeClass("active"),
  982. n = t.prev();
  983. n.length || (n = this.$menu.find("li").last()),
  984. n.addClass("active")
  985. },
  986. listen: function () {
  987. this.$element.on("focus", e.proxy(this.focus, this)).on("blur", e.proxy(this.blur, this)).on("keypress", e.proxy(this.keypress, this)).on("keyup", e.proxy(this.keyup, this)),
  988. this.eventSupported("keydown") && this.$element.on("keydown", e.proxy(this.keydown, this)),
  989. this.$menu.on("click", e.proxy(this.click, this)).on("mouseenter", "li", e.proxy(this.mouseenter, this)).on("mouseleave", "li", e.proxy(this.mouseleave, this))
  990. },
  991. eventSupported: function (e) {
  992. var t = e in this.$element;
  993. return t || (this.$element.setAttribute(e, "return;"), t = typeof this.$element[e] == "function"),
  994. t
  995. },
  996. move: function (e) {
  997. if (!this.shown) return;
  998. switch (e.keyCode) {
  999. case 9:
  1000. case 13:
  1001. case 27:
  1002. e.preventDefault();
  1003. break;
  1004. case 38:
  1005. e.preventDefault(),
  1006. this.prev();
  1007. break;
  1008. case 40:
  1009. e.preventDefault(),
  1010. this.next()
  1011. }
  1012. e.stopPropagation()
  1013. },
  1014. keydown: function (t) {
  1015. this.suppressKeyPressRepeat = ~e.inArray(t.keyCode, [40, 38, 9, 13, 27]),
  1016. this.move(t)
  1017. },
  1018. keypress: function (e) {
  1019. if (this.suppressKeyPressRepeat) return;
  1020. this.move(e)
  1021. },
  1022. keyup: function (e) {
  1023. switch (e.keyCode) {
  1024. case 40:
  1025. case 38:
  1026. case 16:
  1027. case 17:
  1028. case 18:
  1029. break;
  1030. case 9:
  1031. case 13:
  1032. if (!this.shown) return;
  1033. this.select();
  1034. break;
  1035. case 27:
  1036. if (!this.shown) return;
  1037. this.hide();
  1038. break;
  1039. default:
  1040. this.lookup()
  1041. }
  1042. e.stopPropagation(),
  1043. e.preventDefault()
  1044. },
  1045. focus: function (e) {
  1046. this.focused = !0
  1047. },
  1048. blur: function (e) {
  1049. this.focused = !1,
  1050. !this.mousedover && this.shown && this.hide()
  1051. },
  1052. click: function (e) {
  1053. e.stopPropagation(),
  1054. e.preventDefault(),
  1055. this.select(),
  1056. this.$element.focus()
  1057. },
  1058. mouseenter: function (t) {
  1059. this.mousedover = !0,
  1060. this.$menu.find(".active").removeClass("active"),
  1061. e(t.currentTarget).addClass("active")
  1062. },
  1063. mouseleave: function (e) {
  1064. this.mousedover = !1,
  1065. !this.focused && this.shown && this.hide()
  1066. }
  1067. };
  1068. var n = e.fn.typeahead;
  1069. e.fn.typeahead = function (n) {
  1070. return this.each(function () {
  1071. var r = e(this),
  1072. i = r.data("typeahead"),
  1073. s = typeof n == "object" && n;
  1074. i || r.data("typeahead", i = new t(this, s)),
  1075. typeof n == "string" && i[n]()
  1076. })
  1077. },
  1078. e.fn.typeahead.defaults = {
  1079. source: [],
  1080. items: 8,
  1081. menu: '<ul class="typeahead dropdown-menu"></ul>',
  1082. item: '<li><a href="#"></a></li>',
  1083. minLength: 1
  1084. },
  1085. e.fn.typeahead.Constructor = t,
  1086. e.fn.typeahead.noConflict = function () {
  1087. return e.fn.typeahead = n,
  1088. this
  1089. }
  1090. }(window.jQuery),
  1091. !
  1092. function (e) {
  1093. "use strict";
  1094. var t = function (t, n) {
  1095. this.options = e.extend({}, e.fn.affix.defaults, n),
  1096. this.$window = e(window).on("scroll.affix.data-api", e.proxy(this.checkPosition, this)).on("click.affix.data-api", e.proxy(function () {
  1097. setTimeout(e.proxy(this.checkPosition, this), 1)
  1098. }, this)),
  1099. this.$element = e(t),
  1100. this.checkPosition()
  1101. };
  1102. t.prototype.checkPosition = function () {
  1103. if (!this.$element.is(":visible")) return;
  1104. var t = e(document).height(),
  1105. n = this.$window.scrollTop(),
  1106. r = this.$element.offset(),
  1107. i = this.options.offset,
  1108. s = i.bottom,
  1109. o = i.top,
  1110. u = "affix affix-top affix-bottom",
  1111. a;
  1112. typeof i != "object" && (s = o = i),
  1113. typeof o == "function" && (o = i.top()),
  1114. typeof s == "function" && (s = i.bottom()),
  1115. a = this.unpin != null && n + this.unpin <= r.top ? !1 : s != null && r.top + this.$element.height() >= t - s ? "bottom" : o != null && n <= o ? "top" : !1;
  1116. if (this.affixed === a) return;
  1117. this.affixed = a,
  1118. this.unpin = a == "bottom" ? r.top - n : null,
  1119. this.$element.removeClass(u).addClass("affix" + (a ? "-" + a : ""))
  1120. };
  1121. var n = e.fn.affix;
  1122. e.fn.affix = function (n) {
  1123. return this.each(function () {
  1124. var r = e(this),
  1125. i = r.data("affix"),
  1126. s = typeof n == "object" && n;
  1127. i || r.data("affix", i = new t(this, s)),
  1128. typeof n == "string" && i[n]()
  1129. })
  1130. },
  1131. e.fn.affix.Constructor = t,
  1132. e.fn.affix.defaults = {
  1133. offset: 0
  1134. },
  1135. e.fn.affix.noConflict = function () {
  1136. return e.fn.affix = n,
  1137. this
  1138. }
  1139. }(window.jQuery);