bootstrap.js 75 KB

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