bootstrap.min.js 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498
  1. /* ========================================================================
  2. * Bootstrap: dropdown.js v3.3.7
  3. * http://getbootstrap.com/javascript/#dropdowns
  4. * ========================================================================
  5. * Copyright 2011-2016 Twitter, Inc.
  6. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  7. * ======================================================================== */
  8. +function ($) {
  9. 'use strict';
  10. // DROPDOWN CLASS DEFINITION
  11. // =========================
  12. var backdrop = '.dropdown-backdrop'
  13. var toggle = '[data-toggle="dropdown"]'
  14. var Dropdown = function (element) {
  15. $(element).on('click.bs.dropdown', this.toggle)
  16. }
  17. Dropdown.VERSION = '3.3.7'
  18. function getParent($this) {
  19. var selector = $this.attr('data-target')
  20. if (!selector) {
  21. selector = $this.attr('href')
  22. selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  23. }
  24. var $parent = selector && $(selector)
  25. return $parent && $parent.length ? $parent : $this.parent()
  26. }
  27. function clearMenus(e) {
  28. if (e && e.which === 3) return
  29. $(backdrop).remove()
  30. $(toggle).each(function () {
  31. var $this = $(this)
  32. var $parent = getParent($this)
  33. var relatedTarget = { relatedTarget: this }
  34. if (!$parent.hasClass('open')) return
  35. if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
  36. $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
  37. if (e.isDefaultPrevented()) return
  38. $this.attr('aria-expanded', 'false')
  39. $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
  40. })
  41. }
  42. Dropdown.prototype.toggle = function (e) {
  43. var $this = $(this)
  44. if ($this.is('.disabled, :disabled')) return
  45. var $parent = getParent($this)
  46. var isActive = $parent.hasClass('open')
  47. clearMenus()
  48. if (!isActive) {
  49. if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
  50. // if mobile we use a backdrop because click events don't delegate
  51. $(document.createElement('div'))
  52. .addClass('dropdown-backdrop')
  53. .insertAfter($(this))
  54. .on('click', clearMenus)
  55. }
  56. var relatedTarget = { relatedTarget: this }
  57. $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
  58. if (e.isDefaultPrevented()) return
  59. $this
  60. .trigger('focus')
  61. .attr('aria-expanded', 'true')
  62. $parent
  63. .toggleClass('open')
  64. .trigger($.Event('shown.bs.dropdown', relatedTarget))
  65. }
  66. return false
  67. }
  68. Dropdown.prototype.keydown = function (e) {
  69. if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
  70. var $this = $(this)
  71. e.preventDefault()
  72. e.stopPropagation()
  73. if ($this.is('.disabled, :disabled')) return
  74. var $parent = getParent($this)
  75. var isActive = $parent.hasClass('open')
  76. if (!isActive && e.which != 27 || isActive && e.which == 27) {
  77. if (e.which == 27) $parent.find(toggle).trigger('focus')
  78. return $this.trigger('click')
  79. }
  80. var desc = ' li:not(.disabled):visible a'
  81. var $items = $parent.find('.dropdown-menu' + desc)
  82. if (!$items.length) return
  83. var index = $items.index(e.target)
  84. if (e.which == 38 && index > 0) index-- // up
  85. if (e.which == 40 && index < $items.length - 1) index++ // down
  86. if (!~index) index = 0
  87. $items.eq(index).trigger('focus')
  88. }
  89. // DROPDOWN PLUGIN DEFINITION
  90. // ==========================
  91. function Plugin(option) {
  92. return this.each(function () {
  93. var $this = $(this)
  94. var data = $this.data('bs.dropdown')
  95. if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
  96. if (typeof option == 'string') data[option].call($this)
  97. })
  98. }
  99. var old = $.fn.dropdown
  100. $.fn.dropdown = Plugin
  101. $.fn.dropdown.Constructor = Dropdown
  102. // DROPDOWN NO CONFLICT
  103. // ====================
  104. $.fn.dropdown.noConflict = function () {
  105. $.fn.dropdown = old
  106. return this
  107. }
  108. // APPLY TO STANDARD DROPDOWN ELEMENTS
  109. // ===================================
  110. $(document)
  111. .on('click.bs.dropdown.data-api', clearMenus)
  112. .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
  113. .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
  114. .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
  115. .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
  116. }(jQuery);
  117. /* ========================================================================
  118. * Bootstrap: modal.js v3.3.7
  119. * http://getbootstrap.com/javascript/#modals
  120. * ========================================================================
  121. * Copyright 2011-2016 Twitter, Inc.
  122. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  123. * ======================================================================== */
  124. +function ($) {
  125. 'use strict';
  126. // MODAL CLASS DEFINITION
  127. // ======================
  128. var Modal = function (element, options) {
  129. this.options = options
  130. this.$body = $(document.body)
  131. this.$element = $(element)
  132. this.$dialog = this.$element.find('.modal-dialog')
  133. this.$backdrop = null
  134. this.isShown = null
  135. this.originalBodyPad = null
  136. this.scrollbarWidth = 0
  137. this.ignoreBackdropClick = false
  138. if (this.options.remote) {
  139. this.$element
  140. .find('.modal-content')
  141. .load(this.options.remote, $.proxy(function () {
  142. this.$element.trigger('loaded.bs.modal')
  143. }, this))
  144. }
  145. }
  146. Modal.VERSION = '3.3.7'
  147. Modal.TRANSITION_DURATION = 300
  148. Modal.BACKDROP_TRANSITION_DURATION = 150
  149. Modal.DEFAULTS = {
  150. backdrop: true,
  151. keyboard: true,
  152. show: true
  153. }
  154. Modal.prototype.toggle = function (_relatedTarget) {
  155. return this.isShown ? this.hide() : this.show(_relatedTarget)
  156. }
  157. Modal.prototype.show = function (_relatedTarget) {
  158. var that = this
  159. var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
  160. this.$element.trigger(e)
  161. if (this.isShown || e.isDefaultPrevented()) return
  162. this.isShown = true
  163. this.checkScrollbar()
  164. this.setScrollbar()
  165. this.$body.addClass('modal-open')
  166. this.escape()
  167. this.resize()
  168. this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
  169. this.$dialog.on('mousedown.dismiss.bs.modal', function () {
  170. that.$element.one('mouseup.dismiss.bs.modal', function (e) {
  171. if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
  172. })
  173. })
  174. this.backdrop(function () {
  175. var transition = $.support.transition && that.$element.hasClass('fade')
  176. if (!that.$element.parent().length) {
  177. that.$element.appendTo(that.$body) // don't move modals dom position
  178. }
  179. that.$element
  180. .show()
  181. .scrollTop(0)
  182. that.adjustDialog()
  183. if (transition) {
  184. that.$element[0].offsetWidth // force reflow
  185. }
  186. that.$element.addClass('in')
  187. that.enforceFocus()
  188. var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
  189. transition ?
  190. that.$dialog // wait for modal to slide in
  191. .one('bsTransitionEnd', function () {
  192. that.$element.trigger('focus').trigger(e)
  193. })
  194. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  195. that.$element.trigger('focus').trigger(e)
  196. })
  197. }
  198. Modal.prototype.hide = function (e) {
  199. if (e) e.preventDefault()
  200. e = $.Event('hide.bs.modal')
  201. this.$element.trigger(e)
  202. if (!this.isShown || e.isDefaultPrevented()) return
  203. this.isShown = false
  204. this.escape()
  205. this.resize()
  206. $(document).off('focusin.bs.modal')
  207. this.$element
  208. .removeClass('in')
  209. .off('click.dismiss.bs.modal')
  210. .off('mouseup.dismiss.bs.modal')
  211. this.$dialog.off('mousedown.dismiss.bs.modal')
  212. $.support.transition && this.$element.hasClass('fade') ?
  213. this.$element
  214. .one('bsTransitionEnd', $.proxy(this.hideModal, this))
  215. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  216. this.hideModal()
  217. }
  218. Modal.prototype.enforceFocus = function () {
  219. $(document)
  220. .off('focusin.bs.modal') // guard against infinite focus loop
  221. .on('focusin.bs.modal', $.proxy(function (e) {
  222. if (document !== e.target &&
  223. this.$element[0] !== e.target &&
  224. !this.$element.has(e.target).length) {
  225. this.$element.trigger('focus')
  226. }
  227. }, this))
  228. }
  229. Modal.prototype.escape = function () {
  230. if (this.isShown && this.options.keyboard) {
  231. this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
  232. e.which == 27 && this.hide()
  233. }, this))
  234. } else if (!this.isShown) {
  235. this.$element.off('keydown.dismiss.bs.modal')
  236. }
  237. }
  238. Modal.prototype.resize = function () {
  239. if (this.isShown) {
  240. $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
  241. } else {
  242. $(window).off('resize.bs.modal')
  243. }
  244. }
  245. Modal.prototype.hideModal = function () {
  246. var that = this
  247. this.$element.hide()
  248. this.backdrop(function () {
  249. that.$body.removeClass('modal-open')
  250. that.resetAdjustments()
  251. that.resetScrollbar()
  252. that.$element.trigger('hidden.bs.modal')
  253. })
  254. }
  255. Modal.prototype.removeBackdrop = function () {
  256. this.$backdrop && this.$backdrop.remove()
  257. this.$backdrop = null
  258. }
  259. Modal.prototype.backdrop = function (callback) {
  260. var that = this
  261. var animate = this.$element.hasClass('fade') ? 'fade' : ''
  262. if (this.isShown && this.options.backdrop) {
  263. var doAnimate = $.support.transition && animate
  264. this.$backdrop = $(document.createElement('div'))
  265. .addClass('modal-backdrop ' + animate)
  266. .appendTo(this.$body)
  267. this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
  268. if (this.ignoreBackdropClick) {
  269. this.ignoreBackdropClick = false
  270. return
  271. }
  272. if (e.target !== e.currentTarget) return
  273. this.options.backdrop == 'static'
  274. ? this.$element[0].focus()
  275. : this.hide()
  276. }, this))
  277. if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  278. this.$backdrop.addClass('in')
  279. if (!callback) return
  280. doAnimate ?
  281. this.$backdrop
  282. .one('bsTransitionEnd', callback)
  283. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  284. callback()
  285. } else if (!this.isShown && this.$backdrop) {
  286. this.$backdrop.removeClass('in')
  287. var callbackRemove = function () {
  288. that.removeBackdrop()
  289. callback && callback()
  290. }
  291. $.support.transition && this.$element.hasClass('fade') ?
  292. this.$backdrop
  293. .one('bsTransitionEnd', callbackRemove)
  294. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  295. callbackRemove()
  296. } else if (callback) {
  297. callback()
  298. }
  299. }
  300. // these following methods are used to handle overflowing modals
  301. Modal.prototype.handleUpdate = function () {
  302. this.adjustDialog()
  303. }
  304. Modal.prototype.adjustDialog = function () {
  305. var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
  306. this.$element.css({
  307. paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
  308. paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
  309. })
  310. }
  311. Modal.prototype.resetAdjustments = function () {
  312. this.$element.css({
  313. paddingLeft: '',
  314. paddingRight: ''
  315. })
  316. }
  317. Modal.prototype.checkScrollbar = function () {
  318. var fullWindowWidth = window.innerWidth
  319. if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
  320. var documentElementRect = document.documentElement.getBoundingClientRect()
  321. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
  322. }
  323. this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
  324. this.scrollbarWidth = this.measureScrollbar()
  325. }
  326. Modal.prototype.setScrollbar = function () {
  327. var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
  328. this.originalBodyPad = document.body.style.paddingRight || ''
  329. if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
  330. }
  331. Modal.prototype.resetScrollbar = function () {
  332. this.$body.css('padding-right', this.originalBodyPad)
  333. }
  334. Modal.prototype.measureScrollbar = function () { // thx walsh
  335. var scrollDiv = document.createElement('div')
  336. scrollDiv.className = 'modal-scrollbar-measure'
  337. this.$body.append(scrollDiv)
  338. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
  339. this.$body[0].removeChild(scrollDiv)
  340. return scrollbarWidth
  341. }
  342. // MODAL PLUGIN DEFINITION
  343. // =======================
  344. function Plugin(option, _relatedTarget) {
  345. return this.each(function () {
  346. var $this = $(this)
  347. var data = $this.data('bs.modal')
  348. var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
  349. if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
  350. if (typeof option == 'string') data[option](_relatedTarget)
  351. else if (options.show) data.show(_relatedTarget)
  352. })
  353. }
  354. var old = $.fn.modal
  355. $.fn.modal = Plugin
  356. $.fn.modal.Constructor = Modal
  357. // MODAL NO CONFLICT
  358. // =================
  359. $.fn.modal.noConflict = function () {
  360. $.fn.modal = old
  361. return this
  362. }
  363. // MODAL DATA-API
  364. // ==============
  365. $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
  366. var $this = $(this)
  367. var href = $this.attr('href')
  368. var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
  369. var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
  370. if ($this.is('a')) e.preventDefault()
  371. $target.one('show.bs.modal', function (showEvent) {
  372. if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
  373. $target.one('hidden.bs.modal', function () {
  374. $this.is(':visible') && $this.trigger('focus')
  375. })
  376. })
  377. Plugin.call($target, option, this)
  378. })
  379. }(jQuery);
  380. /* ========================================================================
  381. * Bootstrap: tab.js v3.3.7
  382. * http://getbootstrap.com/javascript/#tabs
  383. * ========================================================================
  384. * Copyright 2011-2016 Twitter, Inc.
  385. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  386. * ======================================================================== */
  387. +function ($) {
  388. 'use strict';
  389. // TAB CLASS DEFINITION
  390. // ====================
  391. var Tab = function (element) {
  392. // jscs:disable requireDollarBeforejQueryAssignment
  393. this.element = $(element)
  394. // jscs:enable requireDollarBeforejQueryAssignment
  395. }
  396. Tab.VERSION = '3.3.7'
  397. Tab.TRANSITION_DURATION = 150
  398. Tab.prototype.show = function () {
  399. var $this = this.element
  400. var $ul = $this.closest('ul:not(.dropdown-menu)')
  401. var selector = $this.data('target')
  402. if (!selector) {
  403. selector = $this.attr('href')
  404. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  405. }
  406. if ($this.parent('li').hasClass('active')) return
  407. var $previous = $ul.find('.active:last a')
  408. var hideEvent = $.Event('hide.bs.tab', {
  409. relatedTarget: $this[0]
  410. })
  411. var showEvent = $.Event('show.bs.tab', {
  412. relatedTarget: $previous[0]
  413. })
  414. $previous.trigger(hideEvent)
  415. $this.trigger(showEvent)
  416. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
  417. var $target = $(selector)
  418. this.activate($this.closest('li'), $ul)
  419. this.activate($target, $target.parent(), function () {
  420. $previous.trigger({
  421. type: 'hidden.bs.tab',
  422. relatedTarget: $this[0]
  423. })
  424. $this.trigger({
  425. type: 'shown.bs.tab',
  426. relatedTarget: $previous[0]
  427. })
  428. })
  429. }
  430. Tab.prototype.activate = function (element, container, callback) {
  431. var $active = container.find('> .active')
  432. var transition = callback
  433. && $.support.transition
  434. && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
  435. function next() {
  436. $active
  437. .removeClass('active')
  438. .find('> .dropdown-menu > .active')
  439. .removeClass('active')
  440. .end()
  441. .find('[data-toggle="tab"]')
  442. .attr('aria-expanded', false)
  443. element
  444. .addClass('active')
  445. .find('[data-toggle="tab"]')
  446. .attr('aria-expanded', true)
  447. if (transition) {
  448. element[0].offsetWidth // reflow for transition
  449. element.addClass('in')
  450. } else {
  451. element.removeClass('fade')
  452. }
  453. if (element.parent('.dropdown-menu').length) {
  454. element
  455. .closest('li.dropdown')
  456. .addClass('active')
  457. .end()
  458. .find('[data-toggle="tab"]')
  459. .attr('aria-expanded', true)
  460. }
  461. callback && callback()
  462. }
  463. $active.length && transition ?
  464. $active
  465. .one('bsTransitionEnd', next)
  466. .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
  467. next()
  468. $active.removeClass('in')
  469. }
  470. // TAB PLUGIN DEFINITION
  471. // =====================
  472. function Plugin(option) {
  473. return this.each(function () {
  474. var $this = $(this)
  475. var data = $this.data('bs.tab')
  476. if (!data) $this.data('bs.tab', (data = new Tab(this)))
  477. if (typeof option == 'string') data[option]()
  478. })
  479. }
  480. var old = $.fn.tab
  481. $.fn.tab = Plugin
  482. $.fn.tab.Constructor = Tab
  483. // TAB NO CONFLICT
  484. // ===============
  485. $.fn.tab.noConflict = function () {
  486. $.fn.tab = old
  487. return this
  488. }
  489. // TAB DATA-API
  490. // ============
  491. var clickHandler = function (e) {
  492. e.preventDefault()
  493. Plugin.call($(this), 'show')
  494. }
  495. $(document)
  496. .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
  497. .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
  498. }(jQuery);
  499. /* ========================================================================
  500. * Bootstrap: tooltip.js v3.3.7
  501. * http://getbootstrap.com/javascript/#tooltip
  502. * Inspired by the original jQuery.tipsy by Jason Frame
  503. * ========================================================================
  504. * Copyright 2011-2016 Twitter, Inc.
  505. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  506. * ======================================================================== */
  507. +function ($) {
  508. 'use strict';
  509. // TOOLTIP PUBLIC CLASS DEFINITION
  510. // ===============================
  511. var Tooltip = function (element, options) {
  512. this.type = null
  513. this.options = null
  514. this.enabled = null
  515. this.timeout = null
  516. this.hoverState = null
  517. this.$element = null
  518. this.inState = null
  519. this.init('tooltip', element, options)
  520. }
  521. Tooltip.VERSION = '3.3.7'
  522. Tooltip.TRANSITION_DURATION = 150
  523. Tooltip.DEFAULTS = {
  524. animation: true,
  525. placement: 'top',
  526. selector: false,
  527. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  528. trigger: 'hover focus',
  529. title: '',
  530. delay: 0,
  531. html: false,
  532. container: false,
  533. viewport: {
  534. selector: 'body',
  535. padding: 0
  536. }
  537. }
  538. Tooltip.prototype.init = function (type, element, options) {
  539. this.enabled = true
  540. this.type = type
  541. this.$element = $(element)
  542. this.options = this.getOptions(options)
  543. this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
  544. this.inState = { click: false, hover: false, focus: false }
  545. if (this.$element[0] instanceof document.constructor && !this.options.selector) {
  546. throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
  547. }
  548. var triggers = this.options.trigger.split(' ')
  549. for (var i = triggers.length; i--;) {
  550. var trigger = triggers[i]
  551. if (trigger == 'click') {
  552. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
  553. } else if (trigger != 'manual') {
  554. var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
  555. var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
  556. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
  557. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
  558. }
  559. }
  560. this.options.selector ?
  561. (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
  562. this.fixTitle()
  563. }
  564. Tooltip.prototype.getDefaults = function () {
  565. return Tooltip.DEFAULTS
  566. }
  567. Tooltip.prototype.getOptions = function (options) {
  568. options = $.extend({}, this.getDefaults(), this.$element.data(), options)
  569. if (options.delay && typeof options.delay == 'number') {
  570. options.delay = {
  571. show: options.delay,
  572. hide: options.delay
  573. }
  574. }
  575. return options
  576. }
  577. Tooltip.prototype.getDelegateOptions = function () {
  578. var options = {}
  579. var defaults = this.getDefaults()
  580. this._options && $.each(this._options, function (key, value) {
  581. if (defaults[key] != value) options[key] = value
  582. })
  583. return options
  584. }
  585. Tooltip.prototype.enter = function (obj) {
  586. var self = obj instanceof this.constructor ?
  587. obj : $(obj.currentTarget).data('bs.' + this.type)
  588. if (!self) {
  589. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  590. $(obj.currentTarget).data('bs.' + this.type, self)
  591. }
  592. if (obj instanceof $.Event) {
  593. self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
  594. }
  595. if (self.tip().hasClass('in') || self.hoverState == 'in') {
  596. self.hoverState = 'in'
  597. return
  598. }
  599. clearTimeout(self.timeout)
  600. self.hoverState = 'in'
  601. if (!self.options.delay || !self.options.delay.show) return self.show()
  602. self.timeout = setTimeout(function () {
  603. if (self.hoverState == 'in') self.show()
  604. }, self.options.delay.show)
  605. }
  606. Tooltip.prototype.isInStateTrue = function () {
  607. for (var key in this.inState) {
  608. if (this.inState[key]) return true
  609. }
  610. return false
  611. }
  612. Tooltip.prototype.leave = function (obj) {
  613. var self = obj instanceof this.constructor ?
  614. obj : $(obj.currentTarget).data('bs.' + this.type)
  615. if (!self) {
  616. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  617. $(obj.currentTarget).data('bs.' + this.type, self)
  618. }
  619. if (obj instanceof $.Event) {
  620. self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
  621. }
  622. if (self.isInStateTrue()) return
  623. clearTimeout(self.timeout)
  624. self.hoverState = 'out'
  625. if (!self.options.delay || !self.options.delay.hide) return self.hide()
  626. self.timeout = setTimeout(function () {
  627. if (self.hoverState == 'out') self.hide()
  628. }, self.options.delay.hide)
  629. }
  630. Tooltip.prototype.show = function () {
  631. var e = $.Event('show.bs.' + this.type)
  632. if (this.hasContent() && this.enabled) {
  633. this.$element.trigger(e)
  634. var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
  635. if (e.isDefaultPrevented() || !inDom) return
  636. var that = this
  637. var $tip = this.tip()
  638. var tipId = this.getUID(this.type)
  639. this.setContent()
  640. $tip.attr('id', tipId)
  641. this.$element.attr('aria-describedby', tipId)
  642. if (this.options.animation) $tip.addClass('fade')
  643. var placement = typeof this.options.placement == 'function' ?
  644. this.options.placement.call(this, $tip[0], this.$element[0]) :
  645. this.options.placement
  646. var autoToken = /\s?auto?\s?/i
  647. var autoPlace = autoToken.test(placement)
  648. if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
  649. $tip
  650. .detach()
  651. .css({ top: 0, left: 0, display: 'block' })
  652. .addClass(placement)
  653. .data('bs.' + this.type, this)
  654. this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
  655. this.$element.trigger('inserted.bs.' + this.type)
  656. var pos = this.getPosition()
  657. var actualWidth = $tip[0].offsetWidth
  658. var actualHeight = $tip[0].offsetHeight
  659. if (autoPlace) {
  660. var orgPlacement = placement
  661. var viewportDim = this.getPosition(this.$viewport)
  662. placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
  663. placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
  664. placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
  665. placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
  666. placement
  667. $tip
  668. .removeClass(orgPlacement)
  669. .addClass(placement)
  670. }
  671. var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
  672. this.applyPlacement(calculatedOffset, placement)
  673. var complete = function () {
  674. var prevHoverState = that.hoverState
  675. that.$element.trigger('shown.bs.' + that.type)
  676. that.hoverState = null
  677. if (prevHoverState == 'out') that.leave(that)
  678. }
  679. $.support.transition && this.$tip.hasClass('fade') ?
  680. $tip
  681. .one('bsTransitionEnd', complete)
  682. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  683. complete()
  684. }
  685. }
  686. Tooltip.prototype.applyPlacement = function (offset, placement) {
  687. var $tip = this.tip()
  688. var width = $tip[0].offsetWidth
  689. var height = $tip[0].offsetHeight
  690. // manually read margins because getBoundingClientRect includes difference
  691. var marginTop = parseInt($tip.css('margin-top'), 10)
  692. var marginLeft = parseInt($tip.css('margin-left'), 10)
  693. // we must check for NaN for ie 8/9
  694. if (isNaN(marginTop)) marginTop = 0
  695. if (isNaN(marginLeft)) marginLeft = 0
  696. offset.top += marginTop
  697. offset.left += marginLeft
  698. // $.fn.offset doesn't round pixel values
  699. // so we use setOffset directly with our own function B-0
  700. $.offset.setOffset($tip[0], $.extend({
  701. using: function (props) {
  702. $tip.css({
  703. top: Math.round(props.top),
  704. left: Math.round(props.left)
  705. })
  706. }
  707. }, offset), 0)
  708. $tip.addClass('in')
  709. // check to see if placing tip in new offset caused the tip to resize itself
  710. var actualWidth = $tip[0].offsetWidth
  711. var actualHeight = $tip[0].offsetHeight
  712. if (placement == 'top' && actualHeight != height) {
  713. offset.top = offset.top + height - actualHeight
  714. }
  715. var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
  716. if (delta.left) offset.left += delta.left
  717. else offset.top += delta.top
  718. var isVertical = /top|bottom/.test(placement)
  719. var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
  720. var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
  721. $tip.offset(offset)
  722. this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
  723. }
  724. Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
  725. this.arrow()
  726. .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
  727. .css(isVertical ? 'top' : 'left', '')
  728. }
  729. Tooltip.prototype.setContent = function () {
  730. var $tip = this.tip()
  731. var title = this.getTitle()
  732. $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
  733. $tip.removeClass('fade in top bottom left right')
  734. }
  735. Tooltip.prototype.hide = function (callback) {
  736. var that = this
  737. var $tip = $(this.$tip)
  738. var e = $.Event('hide.bs.' + this.type)
  739. function complete() {
  740. if (that.hoverState != 'in') $tip.detach()
  741. if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
  742. that.$element
  743. .removeAttr('aria-describedby')
  744. .trigger('hidden.bs.' + that.type)
  745. }
  746. callback && callback()
  747. }
  748. this.$element.trigger(e)
  749. if (e.isDefaultPrevented()) return
  750. $tip.removeClass('in')
  751. $.support.transition && $tip.hasClass('fade') ?
  752. $tip
  753. .one('bsTransitionEnd', complete)
  754. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  755. complete()
  756. this.hoverState = null
  757. return this
  758. }
  759. Tooltip.prototype.fixTitle = function () {
  760. var $e = this.$element
  761. if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
  762. $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
  763. }
  764. }
  765. Tooltip.prototype.hasContent = function () {
  766. return this.getTitle()
  767. }
  768. Tooltip.prototype.getPosition = function ($element) {
  769. $element = $element || this.$element
  770. var el = $element[0]
  771. var isBody = el.tagName == 'BODY'
  772. var elRect = el.getBoundingClientRect()
  773. if (elRect.width == null) {
  774. // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
  775. elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
  776. }
  777. var isSvg = window.SVGElement && el instanceof window.SVGElement
  778. // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
  779. // See https://github.com/twbs/bootstrap/issues/20280
  780. var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
  781. var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
  782. var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
  783. return $.extend({}, elRect, scroll, outerDims, elOffset)
  784. }
  785. Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
  786. return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  787. placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  788. placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
  789. /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
  790. }
  791. Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
  792. var delta = { top: 0, left: 0 }
  793. if (!this.$viewport) return delta
  794. var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
  795. var viewportDimensions = this.getPosition(this.$viewport)
  796. if (/right|left/.test(placement)) {
  797. var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
  798. var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
  799. if (topEdgeOffset < viewportDimensions.top) { // top overflow
  800. delta.top = viewportDimensions.top - topEdgeOffset
  801. } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
  802. delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
  803. }
  804. } else {
  805. var leftEdgeOffset = pos.left - viewportPadding
  806. var rightEdgeOffset = pos.left + viewportPadding + actualWidth
  807. if (leftEdgeOffset < viewportDimensions.left) { // left overflow
  808. delta.left = viewportDimensions.left - leftEdgeOffset
  809. } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
  810. delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
  811. }
  812. }
  813. return delta
  814. }
  815. Tooltip.prototype.getTitle = function () {
  816. var title
  817. var $e = this.$element
  818. var o = this.options
  819. title = $e.attr('data-original-title')
  820. || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
  821. return title
  822. }
  823. Tooltip.prototype.getUID = function (prefix) {
  824. do prefix += ~~(Math.random() * 1000000)
  825. while (document.getElementById(prefix))
  826. return prefix
  827. }
  828. Tooltip.prototype.tip = function () {
  829. if (!this.$tip) {
  830. this.$tip = $(this.options.template)
  831. if (this.$tip.length != 1) {
  832. throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
  833. }
  834. }
  835. return this.$tip
  836. }
  837. Tooltip.prototype.arrow = function () {
  838. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  839. }
  840. Tooltip.prototype.enable = function () {
  841. this.enabled = true
  842. }
  843. Tooltip.prototype.disable = function () {
  844. this.enabled = false
  845. }
  846. Tooltip.prototype.toggleEnabled = function () {
  847. this.enabled = !this.enabled
  848. }
  849. Tooltip.prototype.toggle = function (e) {
  850. var self = this
  851. if (e) {
  852. self = $(e.currentTarget).data('bs.' + this.type)
  853. if (!self) {
  854. self = new this.constructor(e.currentTarget, this.getDelegateOptions())
  855. $(e.currentTarget).data('bs.' + this.type, self)
  856. }
  857. }
  858. if (e) {
  859. self.inState.click = !self.inState.click
  860. if (self.isInStateTrue()) self.enter(self)
  861. else self.leave(self)
  862. } else {
  863. self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
  864. }
  865. }
  866. Tooltip.prototype.destroy = function () {
  867. var that = this
  868. clearTimeout(this.timeout)
  869. this.hide(function () {
  870. that.$element.off('.' + that.type).removeData('bs.' + that.type)
  871. if (that.$tip) {
  872. that.$tip.detach()
  873. }
  874. that.$tip = null
  875. that.$arrow = null
  876. that.$viewport = null
  877. that.$element = null
  878. })
  879. }
  880. // TOOLTIP PLUGIN DEFINITION
  881. // =========================
  882. function Plugin(option) {
  883. return this.each(function () {
  884. var $this = $(this)
  885. var data = $this.data('bs.tooltip')
  886. var options = typeof option == 'object' && option
  887. if (!data && /destroy|hide/.test(option)) return
  888. if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
  889. if (typeof option == 'string') data[option]()
  890. })
  891. }
  892. var old = $.fn.tooltip
  893. $.fn.tooltip = Plugin
  894. $.fn.tooltip.Constructor = Tooltip
  895. // TOOLTIP NO CONFLICT
  896. // ===================
  897. $.fn.tooltip.noConflict = function () {
  898. $.fn.tooltip = old
  899. return this
  900. }
  901. }(jQuery);
  902. /* ========================================================================
  903. * Bootstrap: collapse.js v3.3.7
  904. * http://getbootstrap.com/javascript/#collapse
  905. * ========================================================================
  906. * Copyright 2011-2016 Twitter, Inc.
  907. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  908. * ======================================================================== */
  909. /* jshint latedef: false */
  910. +function ($) {
  911. 'use strict';
  912. // COLLAPSE PUBLIC CLASS DEFINITION
  913. // ================================
  914. var Collapse = function (element, options) {
  915. this.$element = $(element)
  916. this.options = $.extend({}, Collapse.DEFAULTS, options)
  917. this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
  918. '[data-toggle="collapse"][data-target="#' + element.id + '"]')
  919. this.transitioning = null
  920. if (this.options.parent) {
  921. this.$parent = this.getParent()
  922. } else {
  923. this.addAriaAndCollapsedClass(this.$element, this.$trigger)
  924. }
  925. if (this.options.toggle) this.toggle()
  926. }
  927. Collapse.VERSION = '3.3.7'
  928. Collapse.TRANSITION_DURATION = 350
  929. Collapse.DEFAULTS = {
  930. toggle: true
  931. }
  932. Collapse.prototype.dimension = function () {
  933. var hasWidth = this.$element.hasClass('width')
  934. return hasWidth ? 'width' : 'height'
  935. }
  936. Collapse.prototype.show = function () {
  937. if (this.transitioning || this.$element.hasClass('in')) return
  938. var activesData
  939. var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
  940. if (actives && actives.length) {
  941. activesData = actives.data('bs.collapse')
  942. if (activesData && activesData.transitioning) return
  943. }
  944. var startEvent = $.Event('show.bs.collapse')
  945. this.$element.trigger(startEvent)
  946. if (startEvent.isDefaultPrevented()) return
  947. if (actives && actives.length) {
  948. Plugin.call(actives, 'hide')
  949. activesData || actives.data('bs.collapse', null)
  950. }
  951. var dimension = this.dimension()
  952. this.$element
  953. .removeClass('collapse')
  954. .addClass('collapsing')[dimension](0)
  955. .attr('aria-expanded', true)
  956. this.$trigger
  957. .removeClass('collapsed')
  958. .attr('aria-expanded', true)
  959. this.transitioning = 1
  960. var complete = function () {
  961. this.$element
  962. .removeClass('collapsing')
  963. .addClass('collapse in')[dimension]('')
  964. this.transitioning = 0
  965. this.$element
  966. .trigger('shown.bs.collapse')
  967. }
  968. if (!$.support.transition) return complete.call(this)
  969. var scrollSize = $.camelCase(['scroll', dimension].join('-'))
  970. this.$element
  971. .one('bsTransitionEnd', $.proxy(complete, this))
  972. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
  973. }
  974. Collapse.prototype.hide = function () {
  975. if (this.transitioning || !this.$element.hasClass('in')) return
  976. var startEvent = $.Event('hide.bs.collapse')
  977. this.$element.trigger(startEvent)
  978. if (startEvent.isDefaultPrevented()) return
  979. var dimension = this.dimension()
  980. this.$element[dimension](this.$element[dimension]())[0].offsetHeight
  981. this.$element
  982. .addClass('collapsing')
  983. .removeClass('collapse in')
  984. .attr('aria-expanded', false)
  985. this.$trigger
  986. .addClass('collapsed')
  987. .attr('aria-expanded', false)
  988. this.transitioning = 1
  989. var complete = function () {
  990. this.transitioning = 0
  991. this.$element
  992. .removeClass('collapsing')
  993. .addClass('collapse')
  994. .trigger('hidden.bs.collapse')
  995. }
  996. if (!$.support.transition) return complete.call(this)
  997. this.$element
  998. [dimension](0)
  999. .one('bsTransitionEnd', $.proxy(complete, this))
  1000. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
  1001. }
  1002. Collapse.prototype.toggle = function () {
  1003. this[this.$element.hasClass('in') ? 'hide' : 'show']()
  1004. }
  1005. Collapse.prototype.getParent = function () {
  1006. return $(this.options.parent)
  1007. .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
  1008. .each($.proxy(function (i, element) {
  1009. var $element = $(element)
  1010. this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
  1011. }, this))
  1012. .end()
  1013. }
  1014. Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
  1015. var isOpen = $element.hasClass('in')
  1016. $element.attr('aria-expanded', isOpen)
  1017. $trigger
  1018. .toggleClass('collapsed', !isOpen)
  1019. .attr('aria-expanded', isOpen)
  1020. }
  1021. function getTargetFromTrigger($trigger) {
  1022. var href
  1023. var target = $trigger.attr('data-target')
  1024. || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
  1025. return $(target)
  1026. }
  1027. // COLLAPSE PLUGIN DEFINITION
  1028. // ==========================
  1029. function Plugin(option) {
  1030. return this.each(function () {
  1031. var $this = $(this)
  1032. var data = $this.data('bs.collapse')
  1033. var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
  1034. if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
  1035. if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
  1036. if (typeof option == 'string') data[option]()
  1037. })
  1038. }
  1039. var old = $.fn.collapse
  1040. $.fn.collapse = Plugin
  1041. $.fn.collapse.Constructor = Collapse
  1042. // COLLAPSE NO CONFLICT
  1043. // ====================
  1044. $.fn.collapse.noConflict = function () {
  1045. $.fn.collapse = old
  1046. return this
  1047. }
  1048. // COLLAPSE DATA-API
  1049. // =================
  1050. $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
  1051. var $this = $(this)
  1052. if (!$this.attr('data-target')) e.preventDefault()
  1053. var $target = getTargetFromTrigger($this)
  1054. var data = $target.data('bs.collapse')
  1055. var option = data ? 'toggle' : $this.data()
  1056. Plugin.call($target, option)
  1057. })
  1058. }(jQuery);
  1059. /* ==========================================================
  1060. * bootstrap-alert.js v2.3.2
  1061. * http://twitter.github.com/bootstrap/javascript.html#alerts
  1062. * ==========================================================
  1063. * Copyright 2012 Twitter, Inc.
  1064. *
  1065. * Licensed under the Apache License, Version 2.0 (the "License");
  1066. * you may not use this file except in compliance with the License.
  1067. * You may obtain a copy of the License at
  1068. *
  1069. * http://www.apache.org/licenses/LICENSE-2.0
  1070. *
  1071. * Unless required by applicable law or agreed to in writing, software
  1072. * distributed under the License is distributed on an "AS IS" BASIS,
  1073. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1074. * See the License for the specific language governing permissions and
  1075. * limitations under the License.
  1076. * ========================================================== */
  1077. !function ($) {
  1078. "use strict"; // jshint ;_;
  1079. /* ALERT CLASS DEFINITION
  1080. * ====================== */
  1081. var dismiss = '[data-dismiss="alert"]'
  1082. , Alert = function (el) {
  1083. $(el).on('click', dismiss, this.close)
  1084. }
  1085. Alert.prototype.close = function (e) {
  1086. var $this = $(this)
  1087. , selector = $this.attr('data-target')
  1088. , $parent
  1089. if (!selector) {
  1090. selector = $this.attr('href')
  1091. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
  1092. }
  1093. $parent = $(selector)
  1094. e && e.preventDefault()
  1095. $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
  1096. $parent.trigger(e = $.Event('close'))
  1097. if (e.isDefaultPrevented()) return
  1098. $parent.removeClass('in')
  1099. function removeElement() {
  1100. $parent
  1101. .trigger('closed')
  1102. .remove()
  1103. }
  1104. $.support.transition && $parent.hasClass('fade') ?
  1105. $parent.on($.support.transition.end, removeElement) :
  1106. removeElement()
  1107. }
  1108. /* ALERT PLUGIN DEFINITION
  1109. * ======================= */
  1110. var old = $.fn.alert
  1111. $.fn.alert = function (option) {
  1112. return this.each(function () {
  1113. var $this = $(this)
  1114. , data = $this.data('alert')
  1115. if (!data) $this.data('alert', (data = new Alert(this)))
  1116. if (typeof option == 'string') data[option].call($this)
  1117. })
  1118. }
  1119. $.fn.alert.Constructor = Alert
  1120. /* ALERT NO CONFLICT
  1121. * ================= */
  1122. $.fn.alert.noConflict = function () {
  1123. $.fn.alert = old
  1124. return this
  1125. }
  1126. /* ALERT DATA-API
  1127. * ============== */
  1128. $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
  1129. }(window.jQuery);