bootstrap-3.3.6.js 68 KB

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