bootstrap.dev.js 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973
  1. "use strict";
  2. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3. /*!
  4. * Bootstrap v3.3.7 (http://getbootstrap.com)
  5. * Copyright 2011-2016 Twitter, Inc.
  6. * Licensed under the MIT license
  7. */
  8. if (typeof jQuery === 'undefined') {
  9. throw new Error('Bootstrap\'s JavaScript requires jQuery');
  10. }
  11. +function ($) {
  12. 'use strict';
  13. var version = $.fn.jquery.split(' ')[0].split('.');
  14. if (version[0] < 2 && version[1] < 9 || version[0] == 1 && version[1] == 9 && version[2] < 1 || version[0] > 3) {
  15. throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4');
  16. }
  17. }(jQuery);
  18. /* ========================================================================
  19. * Bootstrap: transition.js v3.3.7
  20. * http://getbootstrap.com/javascript/#transitions
  21. * ========================================================================
  22. * Copyright 2011-2016 Twitter, Inc.
  23. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  24. * ======================================================================== */
  25. +function ($) {
  26. 'use strict'; // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
  27. // ============================================================
  28. function transitionEnd() {
  29. var el = document.createElement('bootstrap');
  30. var transEndEventNames = {
  31. WebkitTransition: 'webkitTransitionEnd',
  32. MozTransition: 'transitionend',
  33. OTransition: 'oTransitionEnd otransitionend',
  34. transition: 'transitionend'
  35. };
  36. for (var name in transEndEventNames) {
  37. if (el.style[name] !== undefined) {
  38. return {
  39. end: transEndEventNames[name]
  40. };
  41. }
  42. }
  43. return false; // explicit for ie8 ( ._.)
  44. } // http://blog.alexmaccaw.com/css-transitions
  45. $.fn.emulateTransitionEnd = function (duration) {
  46. var called = false;
  47. var $el = this;
  48. $(this).one('bsTransitionEnd', function () {
  49. called = true;
  50. });
  51. var callback = function callback() {
  52. if (!called) $($el).trigger($.support.transition.end);
  53. };
  54. setTimeout(callback, duration);
  55. return this;
  56. };
  57. $(function () {
  58. $.support.transition = transitionEnd();
  59. if (!$.support.transition) return;
  60. $.event.special.bsTransitionEnd = {
  61. bindType: $.support.transition.end,
  62. delegateType: $.support.transition.end,
  63. handle: function handle(e) {
  64. if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments);
  65. }
  66. };
  67. });
  68. }(jQuery);
  69. /* ========================================================================
  70. * Bootstrap: alert.js v3.3.7
  71. * http://getbootstrap.com/javascript/#alerts
  72. * ========================================================================
  73. * Copyright 2011-2016 Twitter, Inc.
  74. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  75. * ======================================================================== */
  76. +function ($) {
  77. 'use strict'; // ALERT CLASS DEFINITION
  78. // ======================
  79. var dismiss = '[data-dismiss="alert"]';
  80. var Alert = function Alert(el) {
  81. $(el).on('click', dismiss, this.close);
  82. };
  83. Alert.VERSION = '3.3.7';
  84. Alert.TRANSITION_DURATION = 150;
  85. Alert.prototype.close = function (e) {
  86. var $this = $(this);
  87. var selector = $this.attr('data-target');
  88. if (!selector) {
  89. selector = $this.attr('href');
  90. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7
  91. }
  92. var $parent = $(selector === '#' ? [] : selector);
  93. if (e) e.preventDefault();
  94. if (!$parent.length) {
  95. $parent = $this.closest('.alert');
  96. }
  97. $parent.trigger(e = $.Event('close.bs.alert'));
  98. if (e.isDefaultPrevented()) return;
  99. $parent.removeClass('in');
  100. function removeElement() {
  101. // detach from parent, fire event then clean up data
  102. $parent.detach().trigger('closed.bs.alert').remove();
  103. }
  104. $.support.transition && $parent.hasClass('fade') ? $parent.one('bsTransitionEnd', removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement();
  105. }; // ALERT PLUGIN DEFINITION
  106. // =======================
  107. function Plugin(option) {
  108. return this.each(function () {
  109. var $this = $(this);
  110. var data = $this.data('bs.alert');
  111. if (!data) $this.data('bs.alert', data = new Alert(this));
  112. if (typeof option == 'string') data[option].call($this);
  113. });
  114. }
  115. var old = $.fn.alert;
  116. $.fn.alert = Plugin;
  117. $.fn.alert.Constructor = Alert; // ALERT NO CONFLICT
  118. // =================
  119. $.fn.alert.noConflict = function () {
  120. $.fn.alert = old;
  121. return this;
  122. }; // ALERT DATA-API
  123. // ==============
  124. $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close);
  125. }(jQuery);
  126. /* ========================================================================
  127. * Bootstrap: button.js v3.3.7
  128. * http://getbootstrap.com/javascript/#buttons
  129. * ========================================================================
  130. * Copyright 2011-2016 Twitter, Inc.
  131. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  132. * ======================================================================== */
  133. +function ($) {
  134. 'use strict'; // BUTTON PUBLIC CLASS DEFINITION
  135. // ==============================
  136. var Button = function Button(element, options) {
  137. this.$element = $(element);
  138. this.options = $.extend({}, Button.DEFAULTS, options);
  139. this.isLoading = false;
  140. };
  141. Button.VERSION = '3.3.7';
  142. Button.DEFAULTS = {
  143. loadingText: 'loading...'
  144. };
  145. Button.prototype.setState = function (state) {
  146. var d = 'disabled';
  147. var $el = this.$element;
  148. var val = $el.is('input') ? 'val' : 'html';
  149. var data = $el.data();
  150. state += 'Text';
  151. if (data.resetText == null) $el.data('resetText', $el[val]()); // push to event loop to allow forms to submit
  152. setTimeout($.proxy(function () {
  153. $el[val](data[state] == null ? this.options[state] : data[state]);
  154. if (state == 'loadingText') {
  155. this.isLoading = true;
  156. $el.addClass(d).attr(d, d).prop(d, true);
  157. } else if (this.isLoading) {
  158. this.isLoading = false;
  159. $el.removeClass(d).removeAttr(d).prop(d, false);
  160. }
  161. }, this), 0);
  162. };
  163. Button.prototype.toggle = function () {
  164. var changed = true;
  165. var $parent = this.$element.closest('[data-toggle="buttons"]');
  166. if ($parent.length) {
  167. var $input = this.$element.find('input');
  168. if ($input.prop('type') == 'radio') {
  169. if ($input.prop('checked')) changed = false;
  170. $parent.find('.active').removeClass('active');
  171. this.$element.addClass('active');
  172. } else if ($input.prop('type') == 'checkbox') {
  173. if ($input.prop('checked') !== this.$element.hasClass('active')) changed = false;
  174. this.$element.toggleClass('active');
  175. }
  176. $input.prop('checked', this.$element.hasClass('active'));
  177. if (changed) $input.trigger('change');
  178. } else {
  179. this.$element.attr('aria-pressed', !this.$element.hasClass('active'));
  180. this.$element.toggleClass('active');
  181. }
  182. }; // BUTTON PLUGIN DEFINITION
  183. // ========================
  184. function Plugin(option) {
  185. return this.each(function () {
  186. var $this = $(this);
  187. var data = $this.data('bs.button');
  188. var options = _typeof(option) == 'object' && option;
  189. if (!data) $this.data('bs.button', data = new Button(this, options));
  190. if (option == 'toggle') data.toggle();else if (option) data.setState(option);
  191. });
  192. }
  193. var old = $.fn.button;
  194. $.fn.button = Plugin;
  195. $.fn.button.Constructor = Button; // BUTTON NO CONFLICT
  196. // ==================
  197. $.fn.button.noConflict = function () {
  198. $.fn.button = old;
  199. return this;
  200. }; // BUTTON DATA-API
  201. // ===============
  202. $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
  203. var $btn = $(e.target).closest('.btn');
  204. Plugin.call($btn, 'toggle');
  205. if (!$(e.target).is('input[type="radio"], input[type="checkbox"]')) {
  206. // Prevent double click on radios, and the double selections (so cancellation) on checkboxes
  207. e.preventDefault(); // The target component still receive the focus
  208. if ($btn.is('input,button')) $btn.trigger('focus');else $btn.find('input:visible,button:visible').first().trigger('focus');
  209. }
  210. }).on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
  211. $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type));
  212. });
  213. }(jQuery);
  214. /* ========================================================================
  215. * Bootstrap: carousel.js v3.3.7
  216. * http://getbootstrap.com/javascript/#carousel
  217. * ========================================================================
  218. * Copyright 2011-2016 Twitter, Inc.
  219. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  220. * ======================================================================== */
  221. +function ($) {
  222. 'use strict'; // CAROUSEL CLASS DEFINITION
  223. // =========================
  224. var Carousel = function Carousel(element, options) {
  225. this.$element = $(element);
  226. this.$indicators = this.$element.find('.carousel-indicators');
  227. this.options = options;
  228. this.paused = null;
  229. this.sliding = null;
  230. this.interval = null;
  231. this.$active = null;
  232. this.$items = null;
  233. this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this));
  234. this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element.on('mouseenter.bs.carousel', $.proxy(this.pause, this)).on('mouseleave.bs.carousel', $.proxy(this.cycle, this));
  235. };
  236. Carousel.VERSION = '3.3.7';
  237. Carousel.TRANSITION_DURATION = 600;
  238. Carousel.DEFAULTS = {
  239. interval: 5000,
  240. pause: 'hover',
  241. wrap: true,
  242. keyboard: true
  243. };
  244. Carousel.prototype.keydown = function (e) {
  245. if (/input|textarea/i.test(e.target.tagName)) return;
  246. switch (e.which) {
  247. case 37:
  248. this.prev();
  249. break;
  250. case 39:
  251. this.next();
  252. break;
  253. default:
  254. return;
  255. }
  256. e.preventDefault();
  257. };
  258. Carousel.prototype.cycle = function (e) {
  259. e || (this.paused = false);
  260. this.interval && clearInterval(this.interval);
  261. this.options.interval && !this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval));
  262. return this;
  263. };
  264. Carousel.prototype.getItemIndex = function (item) {
  265. this.$items = item.parent().children('.item');
  266. return this.$items.index(item || this.$active);
  267. };
  268. Carousel.prototype.getItemForDirection = function (direction, active) {
  269. var activeIndex = this.getItemIndex(active);
  270. var willWrap = direction == 'prev' && activeIndex === 0 || direction == 'next' && activeIndex == this.$items.length - 1;
  271. if (willWrap && !this.options.wrap) return active;
  272. var delta = direction == 'prev' ? -1 : 1;
  273. var itemIndex = (activeIndex + delta) % this.$items.length;
  274. return this.$items.eq(itemIndex);
  275. };
  276. Carousel.prototype.to = function (pos) {
  277. var that = this;
  278. var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'));
  279. if (pos > this.$items.length - 1 || pos < 0) return;
  280. if (this.sliding) return this.$element.one('slid.bs.carousel', function () {
  281. that.to(pos);
  282. }); // yes, "slid"
  283. if (activeIndex == pos) return this.pause().cycle();
  284. return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos));
  285. };
  286. Carousel.prototype.pause = function (e) {
  287. e || (this.paused = true);
  288. if (this.$element.find('.next, .prev').length && $.support.transition) {
  289. this.$element.trigger($.support.transition.end);
  290. this.cycle(true);
  291. }
  292. this.interval = clearInterval(this.interval);
  293. return this;
  294. };
  295. Carousel.prototype.next = function () {
  296. if (this.sliding) return;
  297. return this.slide('next');
  298. };
  299. Carousel.prototype.prev = function () {
  300. if (this.sliding) return;
  301. return this.slide('prev');
  302. };
  303. Carousel.prototype.slide = function (type, next) {
  304. var $active = this.$element.find('.item.active');
  305. var $next = next || this.getItemForDirection(type, $active);
  306. var isCycling = this.interval;
  307. var direction = type == 'next' ? 'left' : 'right';
  308. var that = this;
  309. if ($next.hasClass('active')) return this.sliding = false;
  310. var relatedTarget = $next[0];
  311. var slideEvent = $.Event('slide.bs.carousel', {
  312. relatedTarget: relatedTarget,
  313. direction: direction
  314. });
  315. this.$element.trigger(slideEvent);
  316. if (slideEvent.isDefaultPrevented()) return;
  317. this.sliding = true;
  318. isCycling && this.pause();
  319. if (this.$indicators.length) {
  320. this.$indicators.find('.active').removeClass('active');
  321. var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]);
  322. $nextIndicator && $nextIndicator.addClass('active');
  323. }
  324. var slidEvent = $.Event('slid.bs.carousel', {
  325. relatedTarget: relatedTarget,
  326. direction: direction
  327. }); // yes, "slid"
  328. if ($.support.transition && this.$element.hasClass('slide')) {
  329. $next.addClass(type);
  330. $next[0].offsetWidth; // force reflow
  331. $active.addClass(direction);
  332. $next.addClass(direction);
  333. $active.one('bsTransitionEnd', function () {
  334. $next.removeClass([type, direction].join(' ')).addClass('active');
  335. $active.removeClass(['active', direction].join(' '));
  336. that.sliding = false;
  337. setTimeout(function () {
  338. that.$element.trigger(slidEvent);
  339. }, 0);
  340. }).emulateTransitionEnd(Carousel.TRANSITION_DURATION);
  341. } else {
  342. $active.removeClass('active');
  343. $next.addClass('active');
  344. this.sliding = false;
  345. this.$element.trigger(slidEvent);
  346. }
  347. isCycling && this.cycle();
  348. return this;
  349. }; // CAROUSEL PLUGIN DEFINITION
  350. // ==========================
  351. function Plugin(option) {
  352. return this.each(function () {
  353. var $this = $(this);
  354. var data = $this.data('bs.carousel');
  355. var options = $.extend({}, Carousel.DEFAULTS, $this.data(), _typeof(option) == 'object' && option);
  356. var action = typeof option == 'string' ? option : options.slide;
  357. if (!data) $this.data('bs.carousel', data = new Carousel(this, options));
  358. if (typeof option == 'number') data.to(option);else if (action) data[action]();else if (options.interval) data.pause().cycle();
  359. });
  360. }
  361. var old = $.fn.carousel;
  362. $.fn.carousel = Plugin;
  363. $.fn.carousel.Constructor = Carousel; // CAROUSEL NO CONFLICT
  364. // ====================
  365. $.fn.carousel.noConflict = function () {
  366. $.fn.carousel = old;
  367. return this;
  368. }; // CAROUSEL DATA-API
  369. // =================
  370. var clickHandler = function clickHandler(e) {
  371. var href;
  372. var $this = $(this);
  373. var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')); // strip for ie7
  374. if (!$target.hasClass('carousel')) return;
  375. var options = $.extend({}, $target.data(), $this.data());
  376. var slideIndex = $this.attr('data-slide-to');
  377. if (slideIndex) options.interval = false;
  378. Plugin.call($target, options);
  379. if (slideIndex) {
  380. $target.data('bs.carousel').to(slideIndex);
  381. }
  382. e.preventDefault();
  383. };
  384. $(document).on('click.bs.carousel.data-api', '[data-slide]', clickHandler).on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler);
  385. $(window).on('load', function () {
  386. $('[data-ride="carousel"]').each(function () {
  387. var $carousel = $(this);
  388. Plugin.call($carousel, $carousel.data());
  389. });
  390. });
  391. }(jQuery);
  392. /* ========================================================================
  393. * Bootstrap: collapse.js v3.3.7
  394. * http://getbootstrap.com/javascript/#collapse
  395. * ========================================================================
  396. * Copyright 2011-2016 Twitter, Inc.
  397. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  398. * ======================================================================== */
  399. /* jshint latedef: false */
  400. +function ($) {
  401. 'use strict'; // COLLAPSE PUBLIC CLASS DEFINITION
  402. // ================================
  403. var Collapse = function Collapse(element, options) {
  404. this.$element = $(element);
  405. this.options = $.extend({}, Collapse.DEFAULTS, options);
  406. this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + '[data-toggle="collapse"][data-target="#' + element.id + '"]');
  407. this.transitioning = null;
  408. if (this.options.parent) {
  409. this.$parent = this.getParent();
  410. } else {
  411. this.addAriaAndCollapsedClass(this.$element, this.$trigger);
  412. }
  413. if (this.options.toggle) this.toggle();
  414. };
  415. Collapse.VERSION = '3.3.7';
  416. Collapse.TRANSITION_DURATION = 350;
  417. Collapse.DEFAULTS = {
  418. toggle: true
  419. };
  420. Collapse.prototype.dimension = function () {
  421. var hasWidth = this.$element.hasClass('width');
  422. return hasWidth ? 'width' : 'height';
  423. };
  424. Collapse.prototype.show = function () {
  425. if (this.transitioning || this.$element.hasClass('in')) return;
  426. var activesData;
  427. var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing');
  428. if (actives && actives.length) {
  429. activesData = actives.data('bs.collapse');
  430. if (activesData && activesData.transitioning) return;
  431. }
  432. var startEvent = $.Event('show.bs.collapse');
  433. this.$element.trigger(startEvent);
  434. if (startEvent.isDefaultPrevented()) return;
  435. if (actives && actives.length) {
  436. Plugin.call(actives, 'hide');
  437. activesData || actives.data('bs.collapse', null);
  438. }
  439. var dimension = this.dimension();
  440. this.$element.removeClass('collapse').addClass('collapsing')[dimension](0).attr('aria-expanded', true);
  441. this.$trigger.removeClass('collapsed').attr('aria-expanded', true);
  442. this.transitioning = 1;
  443. var complete = function complete() {
  444. this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('');
  445. this.transitioning = 0;
  446. this.$element.trigger('shown.bs.collapse');
  447. };
  448. if (!$.support.transition) return complete.call(this);
  449. var scrollSize = $.camelCase(['scroll', dimension].join('-'));
  450. this.$element.one('bsTransitionEnd', $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]);
  451. };
  452. Collapse.prototype.hide = function () {
  453. if (this.transitioning || !this.$element.hasClass('in')) return;
  454. var startEvent = $.Event('hide.bs.collapse');
  455. this.$element.trigger(startEvent);
  456. if (startEvent.isDefaultPrevented()) return;
  457. var dimension = this.dimension();
  458. this.$element[dimension](this.$element[dimension]())[0].offsetHeight;
  459. this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded', false);
  460. this.$trigger.addClass('collapsed').attr('aria-expanded', false);
  461. this.transitioning = 1;
  462. var complete = function complete() {
  463. this.transitioning = 0;
  464. this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse');
  465. };
  466. if (!$.support.transition) return complete.call(this);
  467. this.$element[dimension](0).one('bsTransitionEnd', $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION);
  468. };
  469. Collapse.prototype.toggle = function () {
  470. this[this.$element.hasClass('in') ? 'hide' : 'show']();
  471. };
  472. Collapse.prototype.getParent = function () {
  473. return $(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each($.proxy(function (i, element) {
  474. var $element = $(element);
  475. this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element);
  476. }, this)).end();
  477. };
  478. Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
  479. var isOpen = $element.hasClass('in');
  480. $element.attr('aria-expanded', isOpen);
  481. $trigger.toggleClass('collapsed', !isOpen).attr('aria-expanded', isOpen);
  482. };
  483. function getTargetFromTrigger($trigger) {
  484. var href;
  485. var target = $trigger.attr('data-target') || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ''); // strip for ie7
  486. return $(target);
  487. } // COLLAPSE PLUGIN DEFINITION
  488. // ==========================
  489. function Plugin(option) {
  490. return this.each(function () {
  491. var $this = $(this);
  492. var data = $this.data('bs.collapse');
  493. var options = $.extend({}, Collapse.DEFAULTS, $this.data(), _typeof(option) == 'object' && option);
  494. if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false;
  495. if (!data) $this.data('bs.collapse', data = new Collapse(this, options));
  496. if (typeof option == 'string') data[option]();
  497. });
  498. }
  499. var old = $.fn.collapse;
  500. $.fn.collapse = Plugin;
  501. $.fn.collapse.Constructor = Collapse; // COLLAPSE NO CONFLICT
  502. // ====================
  503. $.fn.collapse.noConflict = function () {
  504. $.fn.collapse = old;
  505. return this;
  506. }; // COLLAPSE DATA-API
  507. // =================
  508. $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
  509. var $this = $(this);
  510. if (!$this.attr('data-target')) e.preventDefault();
  511. var $target = getTargetFromTrigger($this);
  512. var data = $target.data('bs.collapse');
  513. var option = data ? 'toggle' : $this.data();
  514. Plugin.call($target, option);
  515. });
  516. }(jQuery);
  517. /* ========================================================================
  518. * Bootstrap: dropdown.js v3.3.7
  519. * http://getbootstrap.com/javascript/#dropdowns
  520. * ========================================================================
  521. * Copyright 2011-2016 Twitter, Inc.
  522. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  523. * ======================================================================== */
  524. +function ($) {
  525. 'use strict'; // DROPDOWN CLASS DEFINITION
  526. // =========================
  527. var backdrop = '.dropdown-backdrop';
  528. var toggle = '[data-toggle="dropdown"]';
  529. var Dropdown = function Dropdown(element) {
  530. $(element).on('click.bs.dropdown', this.toggle);
  531. };
  532. Dropdown.VERSION = '3.3.7';
  533. function getParent($this) {
  534. var selector = $this.attr('data-target');
  535. if (!selector) {
  536. selector = $this.attr('href');
  537. selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7
  538. }
  539. var $parent = selector && $(selector);
  540. return $parent && $parent.length ? $parent : $this.parent();
  541. }
  542. function clearMenus(e) {
  543. if (e && e.which === 3) return;
  544. $(backdrop).remove();
  545. $(toggle).each(function () {
  546. var $this = $(this);
  547. var $parent = getParent($this);
  548. var relatedTarget = {
  549. relatedTarget: this
  550. };
  551. if (!$parent.hasClass('open')) return;
  552. if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return;
  553. $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget));
  554. if (e.isDefaultPrevented()) return;
  555. $this.attr('aria-expanded', 'false');
  556. $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget));
  557. });
  558. }
  559. Dropdown.prototype.toggle = function (e) {
  560. var $this = $(this);
  561. if ($this.is('.disabled, :disabled')) return;
  562. var $parent = getParent($this);
  563. var isActive = $parent.hasClass('open');
  564. clearMenus();
  565. if (!isActive) {
  566. if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
  567. // if mobile we use a backdrop because click events don't delegate
  568. $(document.createElement('div')).addClass('dropdown-backdrop').insertAfter($(this)).on('click', clearMenus);
  569. }
  570. var relatedTarget = {
  571. relatedTarget: this
  572. };
  573. $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget));
  574. if (e.isDefaultPrevented()) return;
  575. $this.trigger('focus').attr('aria-expanded', 'true');
  576. $parent.toggleClass('open').trigger($.Event('shown.bs.dropdown', relatedTarget));
  577. }
  578. return false;
  579. };
  580. Dropdown.prototype.keydown = function (e) {
  581. if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return;
  582. var $this = $(this);
  583. e.preventDefault();
  584. e.stopPropagation();
  585. if ($this.is('.disabled, :disabled')) return;
  586. var $parent = getParent($this);
  587. var isActive = $parent.hasClass('open');
  588. if (!isActive && e.which != 27 || isActive && e.which == 27) {
  589. if (e.which == 27) $parent.find(toggle).trigger('focus');
  590. return $this.trigger('click');
  591. }
  592. var desc = ' li:not(.disabled):visible a';
  593. var $items = $parent.find('.dropdown-menu' + desc);
  594. if (!$items.length) return;
  595. var index = $items.index(e.target);
  596. if (e.which == 38 && index > 0) index--; // up
  597. if (e.which == 40 && index < $items.length - 1) index++; // down
  598. if (!~index) index = 0;
  599. $items.eq(index).trigger('focus');
  600. }; // DROPDOWN PLUGIN DEFINITION
  601. // ==========================
  602. function Plugin(option) {
  603. return this.each(function () {
  604. var $this = $(this);
  605. var data = $this.data('bs.dropdown');
  606. if (!data) $this.data('bs.dropdown', data = new Dropdown(this));
  607. if (typeof option == 'string') data[option].call($this);
  608. });
  609. }
  610. var old = $.fn.dropdown;
  611. $.fn.dropdown = Plugin;
  612. $.fn.dropdown.Constructor = Dropdown; // DROPDOWN NO CONFLICT
  613. // ====================
  614. $.fn.dropdown.noConflict = function () {
  615. $.fn.dropdown = old;
  616. return this;
  617. }; // APPLY TO STANDARD DROPDOWN ELEMENTS
  618. // ===================================
  619. $(document).on('click.bs.dropdown.data-api', clearMenus).on('click.bs.dropdown.data-api', '.dropdown form', function (e) {
  620. e.stopPropagation();
  621. }).on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown);
  622. }(jQuery);
  623. /* ========================================================================
  624. * Bootstrap: modal.js v3.3.7
  625. * http://getbootstrap.com/javascript/#modals
  626. * ========================================================================
  627. * Copyright 2011-2016 Twitter, Inc.
  628. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  629. * ======================================================================== */
  630. +function ($) {
  631. 'use strict'; // MODAL CLASS DEFINITION
  632. // ======================
  633. var Modal = function Modal(element, options) {
  634. this.options = options;
  635. this.$body = $(document.body);
  636. this.$element = $(element);
  637. this.$dialog = this.$element.find('.modal-dialog');
  638. this.$backdrop = null;
  639. this.isShown = null;
  640. this.originalBodyPad = null;
  641. this.scrollbarWidth = 0;
  642. this.ignoreBackdropClick = false;
  643. if (this.options.remote) {
  644. this.$element.find('.modal-content').load(this.options.remote, $.proxy(function () {
  645. this.$element.trigger('loaded.bs.modal');
  646. }, this));
  647. }
  648. };
  649. Modal.VERSION = '3.3.7';
  650. Modal.TRANSITION_DURATION = 300;
  651. Modal.BACKDROP_TRANSITION_DURATION = 150;
  652. Modal.DEFAULTS = {
  653. backdrop: true,
  654. keyboard: true,
  655. show: true
  656. };
  657. Modal.prototype.toggle = function (_relatedTarget) {
  658. return this.isShown ? this.hide() : this.show(_relatedTarget);
  659. };
  660. Modal.prototype.show = function (_relatedTarget) {
  661. var that = this;
  662. var e = $.Event('show.bs.modal', {
  663. relatedTarget: _relatedTarget
  664. });
  665. this.$element.trigger(e);
  666. if (this.isShown || e.isDefaultPrevented()) return;
  667. this.isShown = true;
  668. this.checkScrollbar();
  669. this.setScrollbar();
  670. this.$body.addClass('modal-open');
  671. this.escape();
  672. this.resize();
  673. this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this));
  674. this.$dialog.on('mousedown.dismiss.bs.modal', function () {
  675. that.$element.one('mouseup.dismiss.bs.modal', function (e) {
  676. if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true;
  677. });
  678. });
  679. this.backdrop(function () {
  680. var transition = $.support.transition && that.$element.hasClass('fade');
  681. if (!that.$element.parent().length) {
  682. that.$element.appendTo(that.$body); // don't move modals dom position
  683. }
  684. that.$element.show().scrollTop(0);
  685. that.adjustDialog();
  686. if (transition) {
  687. that.$element[0].offsetWidth; // force reflow
  688. }
  689. that.$element.addClass('in');
  690. that.enforceFocus();
  691. var e = $.Event('shown.bs.modal', {
  692. relatedTarget: _relatedTarget
  693. });
  694. transition ? that.$dialog // wait for modal to slide in
  695. .one('bsTransitionEnd', function () {
  696. that.$element.trigger('focus').trigger(e);
  697. }).emulateTransitionEnd(Modal.TRANSITION_DURATION) : that.$element.trigger('focus').trigger(e);
  698. });
  699. };
  700. Modal.prototype.hide = function (e) {
  701. if (e) e.preventDefault();
  702. e = $.Event('hide.bs.modal');
  703. this.$element.trigger(e);
  704. if (!this.isShown || e.isDefaultPrevented()) return;
  705. this.isShown = false;
  706. this.escape();
  707. this.resize();
  708. $(document).off('focusin.bs.modal');
  709. this.$element.removeClass('in').off('click.dismiss.bs.modal').off('mouseup.dismiss.bs.modal');
  710. this.$dialog.off('mousedown.dismiss.bs.modal');
  711. $.support.transition && this.$element.hasClass('fade') ? this.$element.one('bsTransitionEnd', $.proxy(this.hideModal, this)).emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal();
  712. };
  713. Modal.prototype.enforceFocus = function () {
  714. $(document).off('focusin.bs.modal') // guard against infinite focus loop
  715. .on('focusin.bs.modal', $.proxy(function (e) {
  716. if (document !== e.target && this.$element[0] !== e.target && !this.$element.has(e.target).length) {
  717. this.$element.trigger('focus');
  718. }
  719. }, this));
  720. };
  721. Modal.prototype.escape = function () {
  722. if (this.isShown && this.options.keyboard) {
  723. this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
  724. e.which == 27 && this.hide();
  725. }, this));
  726. } else if (!this.isShown) {
  727. this.$element.off('keydown.dismiss.bs.modal');
  728. }
  729. };
  730. Modal.prototype.resize = function () {
  731. if (this.isShown) {
  732. $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this));
  733. } else {
  734. $(window).off('resize.bs.modal');
  735. }
  736. };
  737. Modal.prototype.hideModal = function () {
  738. var that = this;
  739. this.$element.hide();
  740. this.backdrop(function () {
  741. that.$body.removeClass('modal-open');
  742. that.resetAdjustments();
  743. that.resetScrollbar();
  744. that.$element.trigger('hidden.bs.modal');
  745. });
  746. };
  747. Modal.prototype.removeBackdrop = function () {
  748. this.$backdrop && this.$backdrop.remove();
  749. this.$backdrop = null;
  750. };
  751. Modal.prototype.backdrop = function (callback) {
  752. var that = this;
  753. var animate = this.$element.hasClass('fade') ? 'fade' : '';
  754. if (this.isShown && this.options.backdrop) {
  755. var doAnimate = $.support.transition && animate;
  756. this.$backdrop = $(document.createElement('div')).addClass('modal-backdrop ' + animate).appendTo(this.$body);
  757. this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
  758. if (this.ignoreBackdropClick) {
  759. this.ignoreBackdropClick = false;
  760. return;
  761. }
  762. if (e.target !== e.currentTarget) return;
  763. this.options.backdrop == 'static' ? this.$element[0].focus() : this.hide();
  764. }, this));
  765. if (doAnimate) this.$backdrop[0].offsetWidth; // force reflow
  766. this.$backdrop.addClass('in');
  767. if (!callback) return;
  768. doAnimate ? this.$backdrop.one('bsTransitionEnd', callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callback();
  769. } else if (!this.isShown && this.$backdrop) {
  770. this.$backdrop.removeClass('in');
  771. var callbackRemove = function callbackRemove() {
  772. that.removeBackdrop();
  773. callback && callback();
  774. };
  775. $.support.transition && this.$element.hasClass('fade') ? this.$backdrop.one('bsTransitionEnd', callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove();
  776. } else if (callback) {
  777. callback();
  778. }
  779. }; // these following methods are used to handle overflowing modals
  780. Modal.prototype.handleUpdate = function () {
  781. this.adjustDialog();
  782. };
  783. Modal.prototype.adjustDialog = function () {
  784. var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight;
  785. this.$element.css({
  786. paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
  787. paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
  788. });
  789. };
  790. Modal.prototype.resetAdjustments = function () {
  791. this.$element.css({
  792. paddingLeft: '',
  793. paddingRight: ''
  794. });
  795. };
  796. Modal.prototype.checkScrollbar = function () {
  797. var fullWindowWidth = window.innerWidth;
  798. if (!fullWindowWidth) {
  799. // workaround for missing window.innerWidth in IE8
  800. var documentElementRect = document.documentElement.getBoundingClientRect();
  801. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
  802. }
  803. this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth;
  804. this.scrollbarWidth = this.measureScrollbar();
  805. };
  806. Modal.prototype.setScrollbar = function () {
  807. var bodyPad = parseInt(this.$body.css('padding-right') || 0, 10);
  808. this.originalBodyPad = document.body.style.paddingRight || '';
  809. if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth);
  810. };
  811. Modal.prototype.resetScrollbar = function () {
  812. this.$body.css('padding-right', this.originalBodyPad);
  813. };
  814. Modal.prototype.measureScrollbar = function () {
  815. // thx walsh
  816. var scrollDiv = document.createElement('div');
  817. scrollDiv.className = 'modal-scrollbar-measure';
  818. this.$body.append(scrollDiv);
  819. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
  820. this.$body[0].removeChild(scrollDiv);
  821. return scrollbarWidth;
  822. }; // MODAL PLUGIN DEFINITION
  823. // =======================
  824. function Plugin(option, _relatedTarget) {
  825. return this.each(function () {
  826. var $this = $(this);
  827. var data = $this.data('bs.modal');
  828. var options = $.extend({}, Modal.DEFAULTS, $this.data(), _typeof(option) == 'object' && option);
  829. if (!data) $this.data('bs.modal', data = new Modal(this, options));
  830. if (typeof option == 'string') data[option](_relatedTarget);else if (options.show) data.show(_relatedTarget);
  831. });
  832. }
  833. var old = $.fn.modal;
  834. $.fn.modal = Plugin;
  835. $.fn.modal.Constructor = Modal; // MODAL NO CONFLICT
  836. // =================
  837. $.fn.modal.noConflict = function () {
  838. $.fn.modal = old;
  839. return this;
  840. }; // MODAL DATA-API
  841. // ==============
  842. $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
  843. var $this = $(this);
  844. var href = $this.attr('href');
  845. var $target = $($this.attr('data-target') || href && href.replace(/.*(?=#[^\s]+$)/, '')); // strip for ie7
  846. var option = $target.data('bs.modal') ? 'toggle' : $.extend({
  847. remote: !/#/.test(href) && href
  848. }, $target.data(), $this.data());
  849. if ($this.is('a')) e.preventDefault();
  850. $target.one('show.bs.modal', function (showEvent) {
  851. if (showEvent.isDefaultPrevented()) return; // only register focus restorer if modal will actually get shown
  852. $target.one('hidden.bs.modal', function () {
  853. $this.is(':visible') && $this.trigger('focus');
  854. });
  855. });
  856. Plugin.call($target, option, this);
  857. });
  858. }(jQuery);
  859. /* ========================================================================
  860. * Bootstrap: tooltip.js v3.3.7
  861. * http://getbootstrap.com/javascript/#tooltip
  862. * Inspired by the original jQuery.tipsy by Jason Frame
  863. * ========================================================================
  864. * Copyright 2011-2016 Twitter, Inc.
  865. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  866. * ======================================================================== */
  867. +function ($) {
  868. 'use strict'; // TOOLTIP PUBLIC CLASS DEFINITION
  869. // ===============================
  870. var Tooltip = function Tooltip(element, options) {
  871. this.type = null;
  872. this.options = null;
  873. this.enabled = null;
  874. this.timeout = null;
  875. this.hoverState = null;
  876. this.$element = null;
  877. this.inState = null;
  878. this.init('tooltip', element, options);
  879. };
  880. Tooltip.VERSION = '3.3.7';
  881. Tooltip.TRANSITION_DURATION = 150;
  882. Tooltip.DEFAULTS = {
  883. animation: true,
  884. placement: 'top',
  885. selector: false,
  886. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  887. trigger: 'hover focus',
  888. title: '',
  889. delay: 0,
  890. html: false,
  891. container: false,
  892. viewport: {
  893. selector: 'body',
  894. padding: 0
  895. }
  896. };
  897. Tooltip.prototype.init = function (type, element, options) {
  898. this.enabled = true;
  899. this.type = type;
  900. this.$element = $(element);
  901. this.options = this.getOptions(options);
  902. this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport);
  903. this.inState = {
  904. click: false,
  905. hover: false,
  906. focus: false
  907. };
  908. if (this.$element[0] instanceof document.constructor && !this.options.selector) {
  909. throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!');
  910. }
  911. var triggers = this.options.trigger.split(' ');
  912. for (var i = triggers.length; i--;) {
  913. var trigger = triggers[i];
  914. if (trigger == 'click') {
  915. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this));
  916. } else if (trigger != 'manual') {
  917. var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin';
  918. var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout';
  919. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this));
  920. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this));
  921. }
  922. }
  923. this.options.selector ? this._options = $.extend({}, this.options, {
  924. trigger: 'manual',
  925. selector: ''
  926. }) : this.fixTitle();
  927. };
  928. Tooltip.prototype.getDefaults = function () {
  929. return Tooltip.DEFAULTS;
  930. };
  931. Tooltip.prototype.getOptions = function (options) {
  932. options = $.extend({}, this.getDefaults(), this.$element.data(), options);
  933. if (options.delay && typeof options.delay == 'number') {
  934. options.delay = {
  935. show: options.delay,
  936. hide: options.delay
  937. };
  938. }
  939. return options;
  940. };
  941. Tooltip.prototype.getDelegateOptions = function () {
  942. var options = {};
  943. var defaults = this.getDefaults();
  944. this._options && $.each(this._options, function (key, value) {
  945. if (defaults[key] != value) options[key] = value;
  946. });
  947. return options;
  948. };
  949. Tooltip.prototype.enter = function (obj) {
  950. var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type);
  951. if (!self) {
  952. self = new this.constructor(obj.currentTarget, this.getDelegateOptions());
  953. $(obj.currentTarget).data('bs.' + this.type, self);
  954. }
  955. if (obj instanceof $.Event) {
  956. self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true;
  957. }
  958. if (self.tip().hasClass('in') || self.hoverState == 'in') {
  959. self.hoverState = 'in';
  960. return;
  961. }
  962. clearTimeout(self.timeout);
  963. self.hoverState = 'in';
  964. if (!self.options.delay || !self.options.delay.show) return self.show();
  965. self.timeout = setTimeout(function () {
  966. if (self.hoverState == 'in') self.show();
  967. }, self.options.delay.show);
  968. };
  969. Tooltip.prototype.isInStateTrue = function () {
  970. for (var key in this.inState) {
  971. if (this.inState[key]) return true;
  972. }
  973. return false;
  974. };
  975. Tooltip.prototype.leave = function (obj) {
  976. var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data('bs.' + this.type);
  977. if (!self) {
  978. self = new this.constructor(obj.currentTarget, this.getDelegateOptions());
  979. $(obj.currentTarget).data('bs.' + this.type, self);
  980. }
  981. if (obj instanceof $.Event) {
  982. self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false;
  983. }
  984. if (self.isInStateTrue()) return;
  985. clearTimeout(self.timeout);
  986. self.hoverState = 'out';
  987. if (!self.options.delay || !self.options.delay.hide) return self.hide();
  988. self.timeout = setTimeout(function () {
  989. if (self.hoverState == 'out') self.hide();
  990. }, self.options.delay.hide);
  991. };
  992. Tooltip.prototype.show = function () {
  993. var e = $.Event('show.bs.' + this.type);
  994. if (this.hasContent() && this.enabled) {
  995. this.$element.trigger(e);
  996. var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]);
  997. if (e.isDefaultPrevented() || !inDom) return;
  998. var that = this;
  999. var $tip = this.tip();
  1000. var tipId = this.getUID(this.type);
  1001. this.setContent();
  1002. $tip.attr('id', tipId);
  1003. this.$element.attr('aria-describedby', tipId);
  1004. if (this.options.animation) $tip.addClass('fade');
  1005. var placement = typeof this.options.placement == 'function' ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement;
  1006. var autoToken = /\s?auto?\s?/i;
  1007. var autoPlace = autoToken.test(placement);
  1008. if (autoPlace) placement = placement.replace(autoToken, '') || 'top';
  1009. $tip.detach().css({
  1010. top: 0,
  1011. left: 0,
  1012. display: 'block'
  1013. }).addClass(placement).data('bs.' + this.type, this);
  1014. this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element);
  1015. this.$element.trigger('inserted.bs.' + this.type);
  1016. var pos = this.getPosition();
  1017. var actualWidth = $tip[0].offsetWidth;
  1018. var actualHeight = $tip[0].offsetHeight;
  1019. if (autoPlace) {
  1020. var orgPlacement = placement;
  1021. var viewportDim = this.getPosition(this.$viewport);
  1022. placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : placement;
  1023. $tip.removeClass(orgPlacement).addClass(placement);
  1024. }
  1025. var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight);
  1026. this.applyPlacement(calculatedOffset, placement);
  1027. var complete = function complete() {
  1028. var prevHoverState = that.hoverState;
  1029. that.$element.trigger('shown.bs.' + that.type);
  1030. that.hoverState = null;
  1031. if (prevHoverState == 'out') that.leave(that);
  1032. };
  1033. $.support.transition && this.$tip.hasClass('fade') ? $tip.one('bsTransitionEnd', complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete();
  1034. }
  1035. };
  1036. Tooltip.prototype.applyPlacement = function (offset, placement) {
  1037. var $tip = this.tip();
  1038. var width = $tip[0].offsetWidth;
  1039. var height = $tip[0].offsetHeight; // manually read margins because getBoundingClientRect includes difference
  1040. var marginTop = parseInt($tip.css('margin-top'), 10);
  1041. var marginLeft = parseInt($tip.css('margin-left'), 10); // we must check for NaN for ie 8/9
  1042. if (isNaN(marginTop)) marginTop = 0;
  1043. if (isNaN(marginLeft)) marginLeft = 0;
  1044. offset.top += marginTop;
  1045. offset.left += marginLeft; // $.fn.offset doesn't round pixel values
  1046. // so we use setOffset directly with our own function B-0
  1047. $.offset.setOffset($tip[0], $.extend({
  1048. using: function using(props) {
  1049. $tip.css({
  1050. top: Math.round(props.top),
  1051. left: Math.round(props.left)
  1052. });
  1053. }
  1054. }, offset), 0);
  1055. $tip.addClass('in'); // check to see if placing tip in new offset caused the tip to resize itself
  1056. var actualWidth = $tip[0].offsetWidth;
  1057. var actualHeight = $tip[0].offsetHeight;
  1058. if (placement == 'top' && actualHeight != height) {
  1059. offset.top = offset.top + height - actualHeight;
  1060. }
  1061. var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight);
  1062. if (delta.left) offset.left += delta.left;else offset.top += delta.top;
  1063. var isVertical = /top|bottom/.test(placement);
  1064. var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight;
  1065. var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight';
  1066. $tip.offset(offset);
  1067. this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical);
  1068. };
  1069. Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
  1070. this.arrow().css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%').css(isVertical ? 'top' : 'left', '');
  1071. };
  1072. Tooltip.prototype.setContent = function () {
  1073. var $tip = this.tip();
  1074. var title = this.getTitle();
  1075. $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title);
  1076. $tip.removeClass('fade in top bottom left right');
  1077. };
  1078. Tooltip.prototype.hide = function (callback) {
  1079. var that = this;
  1080. var $tip = $(this.$tip);
  1081. var e = $.Event('hide.bs.' + this.type);
  1082. function complete() {
  1083. if (that.hoverState != 'in') $tip.detach();
  1084. if (that.$element) {
  1085. // TODO: Check whether guarding this code with this `if` is really necessary.
  1086. that.$element.removeAttr('aria-describedby').trigger('hidden.bs.' + that.type);
  1087. }
  1088. callback && callback();
  1089. }
  1090. this.$element.trigger(e);
  1091. if (e.isDefaultPrevented()) return;
  1092. $tip.removeClass('in');
  1093. $.support.transition && $tip.hasClass('fade') ? $tip.one('bsTransitionEnd', complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete();
  1094. this.hoverState = null;
  1095. return this;
  1096. };
  1097. Tooltip.prototype.fixTitle = function () {
  1098. var $e = this.$element;
  1099. if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
  1100. $e.attr('data-original-title', $e.attr('title') || '').attr('title', '');
  1101. }
  1102. };
  1103. Tooltip.prototype.hasContent = function () {
  1104. return this.getTitle();
  1105. };
  1106. Tooltip.prototype.getPosition = function ($element) {
  1107. $element = $element || this.$element;
  1108. var el = $element[0];
  1109. var isBody = el.tagName == 'BODY';
  1110. var elRect = el.getBoundingClientRect();
  1111. if (elRect.width == null) {
  1112. // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
  1113. elRect = $.extend({}, elRect, {
  1114. width: elRect.right - elRect.left,
  1115. height: elRect.bottom - elRect.top
  1116. });
  1117. }
  1118. var isSvg = window.SVGElement && el instanceof window.SVGElement; // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
  1119. // See https://github.com/twbs/bootstrap/issues/20280
  1120. var elOffset = isBody ? {
  1121. top: 0,
  1122. left: 0
  1123. } : isSvg ? null : $element.offset();
  1124. var scroll = {
  1125. scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop()
  1126. };
  1127. var outerDims = isBody ? {
  1128. width: $(window).width(),
  1129. height: $(window).height()
  1130. } : null;
  1131. return $.extend({}, elRect, scroll, outerDims, elOffset);
  1132. };
  1133. Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
  1134. return placement == 'bottom' ? {
  1135. top: pos.top + pos.height,
  1136. left: pos.left + pos.width / 2 - actualWidth / 2
  1137. } : placement == 'top' ? {
  1138. top: pos.top - actualHeight,
  1139. left: pos.left + pos.width / 2 - actualWidth / 2
  1140. } : placement == 'left' ? {
  1141. top: pos.top + pos.height / 2 - actualHeight / 2,
  1142. left: pos.left - actualWidth
  1143. } :
  1144. /* placement == 'right' */
  1145. {
  1146. top: pos.top + pos.height / 2 - actualHeight / 2,
  1147. left: pos.left + pos.width
  1148. };
  1149. };
  1150. Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
  1151. var delta = {
  1152. top: 0,
  1153. left: 0
  1154. };
  1155. if (!this.$viewport) return delta;
  1156. var viewportPadding = this.options.viewport && this.options.viewport.padding || 0;
  1157. var viewportDimensions = this.getPosition(this.$viewport);
  1158. if (/right|left/.test(placement)) {
  1159. var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll;
  1160. var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight;
  1161. if (topEdgeOffset < viewportDimensions.top) {
  1162. // top overflow
  1163. delta.top = viewportDimensions.top - topEdgeOffset;
  1164. } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) {
  1165. // bottom overflow
  1166. delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset;
  1167. }
  1168. } else {
  1169. var leftEdgeOffset = pos.left - viewportPadding;
  1170. var rightEdgeOffset = pos.left + viewportPadding + actualWidth;
  1171. if (leftEdgeOffset < viewportDimensions.left) {
  1172. // left overflow
  1173. delta.left = viewportDimensions.left - leftEdgeOffset;
  1174. } else if (rightEdgeOffset > viewportDimensions.right) {
  1175. // right overflow
  1176. delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset;
  1177. }
  1178. }
  1179. return delta;
  1180. };
  1181. Tooltip.prototype.getTitle = function () {
  1182. var title;
  1183. var $e = this.$element;
  1184. var o = this.options;
  1185. title = $e.attr('data-original-title') || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title);
  1186. return title;
  1187. };
  1188. Tooltip.prototype.getUID = function (prefix) {
  1189. do {
  1190. prefix += ~~(Math.random() * 1000000);
  1191. } while (document.getElementById(prefix));
  1192. return prefix;
  1193. };
  1194. Tooltip.prototype.tip = function () {
  1195. if (!this.$tip) {
  1196. this.$tip = $(this.options.template);
  1197. if (this.$tip.length != 1) {
  1198. throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!');
  1199. }
  1200. }
  1201. return this.$tip;
  1202. };
  1203. Tooltip.prototype.arrow = function () {
  1204. return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow');
  1205. };
  1206. Tooltip.prototype.enable = function () {
  1207. this.enabled = true;
  1208. };
  1209. Tooltip.prototype.disable = function () {
  1210. this.enabled = false;
  1211. };
  1212. Tooltip.prototype.toggleEnabled = function () {
  1213. this.enabled = !this.enabled;
  1214. };
  1215. Tooltip.prototype.toggle = function (e) {
  1216. var self = this;
  1217. if (e) {
  1218. self = $(e.currentTarget).data('bs.' + this.type);
  1219. if (!self) {
  1220. self = new this.constructor(e.currentTarget, this.getDelegateOptions());
  1221. $(e.currentTarget).data('bs.' + this.type, self);
  1222. }
  1223. }
  1224. if (e) {
  1225. self.inState.click = !self.inState.click;
  1226. if (self.isInStateTrue()) self.enter(self);else self.leave(self);
  1227. } else {
  1228. self.tip().hasClass('in') ? self.leave(self) : self.enter(self);
  1229. }
  1230. };
  1231. Tooltip.prototype.destroy = function () {
  1232. var that = this;
  1233. clearTimeout(this.timeout);
  1234. this.hide(function () {
  1235. that.$element.off('.' + that.type).removeData('bs.' + that.type);
  1236. if (that.$tip) {
  1237. that.$tip.detach();
  1238. }
  1239. that.$tip = null;
  1240. that.$arrow = null;
  1241. that.$viewport = null;
  1242. that.$element = null;
  1243. });
  1244. }; // TOOLTIP PLUGIN DEFINITION
  1245. // =========================
  1246. function Plugin(option) {
  1247. return this.each(function () {
  1248. var $this = $(this);
  1249. var data = $this.data('bs.tooltip');
  1250. var options = _typeof(option) == 'object' && option;
  1251. if (!data && /destroy|hide/.test(option)) return;
  1252. if (!data) $this.data('bs.tooltip', data = new Tooltip(this, options));
  1253. if (typeof option == 'string') data[option]();
  1254. });
  1255. }
  1256. var old = $.fn.tooltip;
  1257. $.fn.tooltip = Plugin;
  1258. $.fn.tooltip.Constructor = Tooltip; // TOOLTIP NO CONFLICT
  1259. // ===================
  1260. $.fn.tooltip.noConflict = function () {
  1261. $.fn.tooltip = old;
  1262. return this;
  1263. };
  1264. }(jQuery);
  1265. /* ========================================================================
  1266. * Bootstrap: popover.js v3.3.7
  1267. * http://getbootstrap.com/javascript/#popovers
  1268. * ========================================================================
  1269. * Copyright 2011-2016 Twitter, Inc.
  1270. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1271. * ======================================================================== */
  1272. +function ($) {
  1273. 'use strict'; // POPOVER PUBLIC CLASS DEFINITION
  1274. // ===============================
  1275. var Popover = function Popover(element, options) {
  1276. this.init('popover', element, options);
  1277. };
  1278. if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js');
  1279. Popover.VERSION = '3.3.7';
  1280. Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
  1281. placement: 'right',
  1282. trigger: 'click',
  1283. content: '',
  1284. template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  1285. }); // NOTE: POPOVER EXTENDS tooltip.js
  1286. // ================================
  1287. Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype);
  1288. Popover.prototype.constructor = Popover;
  1289. Popover.prototype.getDefaults = function () {
  1290. return Popover.DEFAULTS;
  1291. };
  1292. Popover.prototype.setContent = function () {
  1293. var $tip = this.tip();
  1294. var title = this.getTitle();
  1295. var content = this.getContent();
  1296. $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title);
  1297. $tip.find('.popover-content').children().detach().end()[// we use append for html objects to maintain js events
  1298. this.options.html ? typeof content == 'string' ? 'html' : 'append' : 'text'](content);
  1299. $tip.removeClass('fade top bottom left right in'); // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
  1300. // this manually by checking the contents.
  1301. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide();
  1302. };
  1303. Popover.prototype.hasContent = function () {
  1304. return this.getTitle() || this.getContent();
  1305. };
  1306. Popover.prototype.getContent = function () {
  1307. var $e = this.$element;
  1308. var o = this.options;
  1309. return $e.attr('data-content') || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content);
  1310. };
  1311. Popover.prototype.arrow = function () {
  1312. return this.$arrow = this.$arrow || this.tip().find('.arrow');
  1313. }; // POPOVER PLUGIN DEFINITION
  1314. // =========================
  1315. function Plugin(option) {
  1316. return this.each(function () {
  1317. var $this = $(this);
  1318. var data = $this.data('bs.popover');
  1319. var options = _typeof(option) == 'object' && option;
  1320. if (!data && /destroy|hide/.test(option)) return;
  1321. if (!data) $this.data('bs.popover', data = new Popover(this, options));
  1322. if (typeof option == 'string') data[option]();
  1323. });
  1324. }
  1325. var old = $.fn.popover;
  1326. $.fn.popover = Plugin;
  1327. $.fn.popover.Constructor = Popover; // POPOVER NO CONFLICT
  1328. // ===================
  1329. $.fn.popover.noConflict = function () {
  1330. $.fn.popover = old;
  1331. return this;
  1332. };
  1333. }(jQuery);
  1334. /* ========================================================================
  1335. * Bootstrap: scrollspy.js v3.3.7
  1336. * http://getbootstrap.com/javascript/#scrollspy
  1337. * ========================================================================
  1338. * Copyright 2011-2016 Twitter, Inc.
  1339. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1340. * ======================================================================== */
  1341. +function ($) {
  1342. 'use strict'; // SCROLLSPY CLASS DEFINITION
  1343. // ==========================
  1344. function ScrollSpy(element, options) {
  1345. this.$body = $(document.body);
  1346. this.$scrollElement = $(element).is(document.body) ? $(window) : $(element);
  1347. this.options = $.extend({}, ScrollSpy.DEFAULTS, options);
  1348. this.selector = (this.options.target || '') + ' .nav li > a';
  1349. this.offsets = [];
  1350. this.targets = [];
  1351. this.activeTarget = null;
  1352. this.scrollHeight = 0;
  1353. this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this));
  1354. this.refresh();
  1355. this.process();
  1356. }
  1357. ScrollSpy.VERSION = '3.3.7';
  1358. ScrollSpy.DEFAULTS = {
  1359. offset: 10
  1360. };
  1361. ScrollSpy.prototype.getScrollHeight = function () {
  1362. return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight);
  1363. };
  1364. ScrollSpy.prototype.refresh = function () {
  1365. var that = this;
  1366. var offsetMethod = 'offset';
  1367. var offsetBase = 0;
  1368. this.offsets = [];
  1369. this.targets = [];
  1370. this.scrollHeight = this.getScrollHeight();
  1371. if (!$.isWindow(this.$scrollElement[0])) {
  1372. offsetMethod = 'position';
  1373. offsetBase = this.$scrollElement.scrollTop();
  1374. }
  1375. this.$body.find(this.selector).map(function () {
  1376. var $el = $(this);
  1377. var href = $el.data('target') || $el.attr('href');
  1378. var $href = /^#./.test(href) && $(href);
  1379. return $href && $href.length && $href.is(':visible') && [[$href[offsetMethod]().top + offsetBase, href]] || null;
  1380. }).sort(function (a, b) {
  1381. return a[0] - b[0];
  1382. }).each(function () {
  1383. that.offsets.push(this[0]);
  1384. that.targets.push(this[1]);
  1385. });
  1386. };
  1387. ScrollSpy.prototype.process = function () {
  1388. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset;
  1389. var scrollHeight = this.getScrollHeight();
  1390. var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height();
  1391. var offsets = this.offsets;
  1392. var targets = this.targets;
  1393. var activeTarget = this.activeTarget;
  1394. var i;
  1395. if (this.scrollHeight != scrollHeight) {
  1396. this.refresh();
  1397. }
  1398. if (scrollTop >= maxScroll) {
  1399. return activeTarget != (i = targets[targets.length - 1]) && this.activate(i);
  1400. }
  1401. if (activeTarget && scrollTop < offsets[0]) {
  1402. this.activeTarget = null;
  1403. return this.clear();
  1404. }
  1405. for (i = offsets.length; i--;) {
  1406. activeTarget != targets[i] && scrollTop >= offsets[i] && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) && this.activate(targets[i]);
  1407. }
  1408. };
  1409. ScrollSpy.prototype.activate = function (target) {
  1410. this.activeTarget = target;
  1411. this.clear();
  1412. var selector = this.selector + '[data-target="' + target + '"],' + this.selector + '[href="' + target + '"]';
  1413. var active = $(selector).parents('li').addClass('active');
  1414. if (active.parent('.dropdown-menu').length) {
  1415. active = active.closest('li.dropdown').addClass('active');
  1416. }
  1417. active.trigger('activate.bs.scrollspy');
  1418. };
  1419. ScrollSpy.prototype.clear = function () {
  1420. $(this.selector).parentsUntil(this.options.target, '.active').removeClass('active');
  1421. }; // SCROLLSPY PLUGIN DEFINITION
  1422. // ===========================
  1423. function Plugin(option) {
  1424. return this.each(function () {
  1425. var $this = $(this);
  1426. var data = $this.data('bs.scrollspy');
  1427. var options = _typeof(option) == 'object' && option;
  1428. if (!data) $this.data('bs.scrollspy', data = new ScrollSpy(this, options));
  1429. if (typeof option == 'string') data[option]();
  1430. });
  1431. }
  1432. var old = $.fn.scrollspy;
  1433. $.fn.scrollspy = Plugin;
  1434. $.fn.scrollspy.Constructor = ScrollSpy; // SCROLLSPY NO CONFLICT
  1435. // =====================
  1436. $.fn.scrollspy.noConflict = function () {
  1437. $.fn.scrollspy = old;
  1438. return this;
  1439. }; // SCROLLSPY DATA-API
  1440. // ==================
  1441. $(window).on('load.bs.scrollspy.data-api', function () {
  1442. $('[data-spy="scroll"]').each(function () {
  1443. var $spy = $(this);
  1444. Plugin.call($spy, $spy.data());
  1445. });
  1446. });
  1447. }(jQuery);
  1448. /* ========================================================================
  1449. * Bootstrap: tab.js v3.3.7
  1450. * http://getbootstrap.com/javascript/#tabs
  1451. * ========================================================================
  1452. * Copyright 2011-2016 Twitter, Inc.
  1453. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1454. * ======================================================================== */
  1455. +function ($) {
  1456. 'use strict'; // TAB CLASS DEFINITION
  1457. // ====================
  1458. var Tab = function Tab(element) {
  1459. // jscs:disable requireDollarBeforejQueryAssignment
  1460. this.element = $(element); // jscs:enable requireDollarBeforejQueryAssignment
  1461. };
  1462. Tab.VERSION = '3.3.7';
  1463. Tab.TRANSITION_DURATION = 150;
  1464. Tab.prototype.show = function () {
  1465. var $this = this.element;
  1466. var $ul = $this.closest('ul:not(.dropdown-menu)');
  1467. var selector = $this.data('target');
  1468. if (!selector) {
  1469. selector = $this.attr('href');
  1470. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7
  1471. }
  1472. if ($this.parent('li').hasClass('active')) return;
  1473. var $previous = $ul.find('.active:last a');
  1474. var hideEvent = $.Event('hide.bs.tab', {
  1475. relatedTarget: $this[0]
  1476. });
  1477. var showEvent = $.Event('show.bs.tab', {
  1478. relatedTarget: $previous[0]
  1479. });
  1480. $previous.trigger(hideEvent);
  1481. $this.trigger(showEvent);
  1482. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return;
  1483. var $target = $(selector);
  1484. this.activate($this.closest('li'), $ul);
  1485. this.activate($target, $target.parent(), function () {
  1486. $previous.trigger({
  1487. type: 'hidden.bs.tab',
  1488. relatedTarget: $this[0]
  1489. });
  1490. $this.trigger({
  1491. type: 'shown.bs.tab',
  1492. relatedTarget: $previous[0]
  1493. });
  1494. });
  1495. };
  1496. Tab.prototype.activate = function (element, container, callback) {
  1497. var $active = container.find('> .active');
  1498. var transition = callback && $.support.transition && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length);
  1499. function next() {
  1500. $active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded', false);
  1501. element.addClass('active').find('[data-toggle="tab"]').attr('aria-expanded', true);
  1502. if (transition) {
  1503. element[0].offsetWidth; // reflow for transition
  1504. element.addClass('in');
  1505. } else {
  1506. element.removeClass('fade');
  1507. }
  1508. if (element.parent('.dropdown-menu').length) {
  1509. element.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded', true);
  1510. }
  1511. callback && callback();
  1512. }
  1513. $active.length && transition ? $active.one('bsTransitionEnd', next).emulateTransitionEnd(Tab.TRANSITION_DURATION) : next();
  1514. $active.removeClass('in');
  1515. }; // TAB PLUGIN DEFINITION
  1516. // =====================
  1517. function Plugin(option) {
  1518. return this.each(function () {
  1519. var $this = $(this);
  1520. var data = $this.data('bs.tab');
  1521. if (!data) $this.data('bs.tab', data = new Tab(this));
  1522. if (typeof option == 'string') data[option]();
  1523. });
  1524. }
  1525. var old = $.fn.tab;
  1526. $.fn.tab = Plugin;
  1527. $.fn.tab.Constructor = Tab; // TAB NO CONFLICT
  1528. // ===============
  1529. $.fn.tab.noConflict = function () {
  1530. $.fn.tab = old;
  1531. return this;
  1532. }; // TAB DATA-API
  1533. // ============
  1534. var clickHandler = function clickHandler(e) {
  1535. e.preventDefault();
  1536. Plugin.call($(this), 'show');
  1537. };
  1538. $(document).on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler).on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler);
  1539. }(jQuery);
  1540. /* ========================================================================
  1541. * Bootstrap: affix.js v3.3.7
  1542. * http://getbootstrap.com/javascript/#affix
  1543. * ========================================================================
  1544. * Copyright 2011-2016 Twitter, Inc.
  1545. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1546. * ======================================================================== */
  1547. +function ($) {
  1548. 'use strict'; // AFFIX CLASS DEFINITION
  1549. // ======================
  1550. var Affix = function Affix(element, options) {
  1551. this.options = $.extend({}, Affix.DEFAULTS, options);
  1552. this.$target = $(this.options.target).on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)).on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this));
  1553. this.$element = $(element);
  1554. this.affixed = null;
  1555. this.unpin = null;
  1556. this.pinnedOffset = null;
  1557. this.checkPosition();
  1558. };
  1559. Affix.VERSION = '3.3.7';
  1560. Affix.RESET = 'affix affix-top affix-bottom';
  1561. Affix.DEFAULTS = {
  1562. offset: 0,
  1563. target: window
  1564. };
  1565. Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
  1566. var scrollTop = this.$target.scrollTop();
  1567. var position = this.$element.offset();
  1568. var targetHeight = this.$target.height();
  1569. if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false;
  1570. if (this.affixed == 'bottom') {
  1571. if (offsetTop != null) return scrollTop + this.unpin <= position.top ? false : 'bottom';
  1572. return scrollTop + targetHeight <= scrollHeight - offsetBottom ? false : 'bottom';
  1573. }
  1574. var initializing = this.affixed == null;
  1575. var colliderTop = initializing ? scrollTop : position.top;
  1576. var colliderHeight = initializing ? targetHeight : height;
  1577. if (offsetTop != null && scrollTop <= offsetTop) return 'top';
  1578. if (offsetBottom != null && colliderTop + colliderHeight >= scrollHeight - offsetBottom) return 'bottom';
  1579. return false;
  1580. };
  1581. Affix.prototype.getPinnedOffset = function () {
  1582. if (this.pinnedOffset) return this.pinnedOffset;
  1583. this.$element.removeClass(Affix.RESET).addClass('affix');
  1584. var scrollTop = this.$target.scrollTop();
  1585. var position = this.$element.offset();
  1586. return this.pinnedOffset = position.top - scrollTop;
  1587. };
  1588. Affix.prototype.checkPositionWithEventLoop = function () {
  1589. setTimeout($.proxy(this.checkPosition, this), 1);
  1590. };
  1591. Affix.prototype.checkPosition = function () {
  1592. if (!this.$element.is(':visible')) return;
  1593. var height = this.$element.height();
  1594. var offset = this.options.offset;
  1595. var offsetTop = offset.top;
  1596. var offsetBottom = offset.bottom;
  1597. var scrollHeight = Math.max($(document).height(), $(document.body).height());
  1598. if (_typeof(offset) != 'object') offsetBottom = offsetTop = offset;
  1599. if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element);
  1600. if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element);
  1601. var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom);
  1602. if (this.affixed != affix) {
  1603. if (this.unpin != null) this.$element.css('top', '');
  1604. var affixType = 'affix' + (affix ? '-' + affix : '');
  1605. var e = $.Event(affixType + '.bs.affix');
  1606. this.$element.trigger(e);
  1607. if (e.isDefaultPrevented()) return;
  1608. this.affixed = affix;
  1609. this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null;
  1610. this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace('affix', 'affixed') + '.bs.affix');
  1611. }
  1612. if (affix == 'bottom') {
  1613. this.$element.offset({
  1614. top: scrollHeight - height - offsetBottom
  1615. });
  1616. }
  1617. }; // AFFIX PLUGIN DEFINITION
  1618. // =======================
  1619. function Plugin(option) {
  1620. return this.each(function () {
  1621. var $this = $(this);
  1622. var data = $this.data('bs.affix');
  1623. var options = _typeof(option) == 'object' && option;
  1624. if (!data) $this.data('bs.affix', data = new Affix(this, options));
  1625. if (typeof option == 'string') data[option]();
  1626. });
  1627. }
  1628. var old = $.fn.affix;
  1629. $.fn.affix = Plugin;
  1630. $.fn.affix.Constructor = Affix; // AFFIX NO CONFLICT
  1631. // =================
  1632. $.fn.affix.noConflict = function () {
  1633. $.fn.affix = old;
  1634. return this;
  1635. }; // AFFIX DATA-API
  1636. // ==============
  1637. $(window).on('load', function () {
  1638. $('[data-spy="affix"]').each(function () {
  1639. var $spy = $(this);
  1640. var data = $spy.data();
  1641. data.offset = data.offset || {};
  1642. if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom;
  1643. if (data.offsetTop != null) data.offset.top = data.offsetTop;
  1644. Plugin.call($spy, data);
  1645. });
  1646. });
  1647. }(jQuery);