bootstrap.js 68 KB

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