官网 管理后台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

bootstrap.js 74KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580
  1. /*!
  2. * Bootstrap v3.4.1 (https://getbootstrap.com/)
  3. * Copyright 2011-2019 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.js v3.4.1
  18. * https://getbootstrap.com/docs/3.4/javascript/#transitions
  19. * ========================================================================
  20. * Copyright 2011-2019 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: https://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. // https://blog.alexmaccaw.com/css-transitions
  43. $.fn.emulateTransitionEnd = function (duration) {
  44. var called = false
  45. var $el = this
  46. $(this).one('bsTransitionEnd', function () { called = true })
  47. var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
  48. setTimeout(callback, duration)
  49. return this
  50. }
  51. $(function () {
  52. $.support.transition = transitionEnd()
  53. if (!$.support.transition) return
  54. $.event.special.bsTransitionEnd = {
  55. bindType: $.support.transition.end,
  56. delegateType: $.support.transition.end,
  57. handle: function (e) {
  58. if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
  59. }
  60. }
  61. })
  62. }(jQuery);
  63. /* ========================================================================
  64. * Bootstrap: alert.js v3.4.1
  65. * https://getbootstrap.com/docs/3.4/javascript/#alerts
  66. * ========================================================================
  67. * Copyright 2011-2019 Twitter, Inc.
  68. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  69. * ======================================================================== */
  70. +function ($) {
  71. 'use strict';
  72. // ALERT CLASS DEFINITION
  73. // ======================
  74. var dismiss = '[data-dismiss="alert"]'
  75. var Alert = function (el) {
  76. $(el).on('click', dismiss, this.close)
  77. }
  78. Alert.VERSION = '3.4.1'
  79. Alert.TRANSITION_DURATION = 150
  80. Alert.prototype.close = function (e) {
  81. var $this = $(this)
  82. var selector = $this.attr('data-target')
  83. if (!selector) {
  84. selector = $this.attr('href')
  85. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  86. }
  87. selector = selector === '#' ? [] : selector
  88. var $parent = $(document).find(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.4.1
  131. * https://getbootstrap.com/docs/3.4/javascript/#buttons
  132. * ========================================================================
  133. * Copyright 2011-2019 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.4.1'
  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).prop(d, true)
  162. } else if (this.isLoading) {
  163. this.isLoading = false
  164. $el.removeClass(d).removeAttr(d).prop(d, false)
  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.4.1
  229. * https://getbootstrap.com/docs/3.4/javascript/#carousel
  230. * ========================================================================
  231. * Copyright 2011-2019 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.4.1'
  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. if (typeof $next === 'object' && $next.length) {
  340. $next[0].offsetWidth // force reflow
  341. }
  342. $active.addClass(direction)
  343. $next.addClass(direction)
  344. $active
  345. .one('bsTransitionEnd', function () {
  346. $next.removeClass([type, direction].join(' ')).addClass('active')
  347. $active.removeClass(['active', direction].join(' '))
  348. that.sliding = false
  349. setTimeout(function () {
  350. that.$element.trigger(slidEvent)
  351. }, 0)
  352. })
  353. .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
  354. } else {
  355. $active.removeClass('active')
  356. $next.addClass('active')
  357. this.sliding = false
  358. this.$element.trigger(slidEvent)
  359. }
  360. isCycling && this.cycle()
  361. return this
  362. }
  363. // CAROUSEL PLUGIN DEFINITION
  364. // ==========================
  365. function Plugin(option) {
  366. return this.each(function () {
  367. var $this = $(this)
  368. var data = $this.data('bs.carousel')
  369. var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
  370. var action = typeof option == 'string' ? option : options.slide
  371. if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
  372. if (typeof option == 'number') data.to(option)
  373. else if (action) data[action]()
  374. else if (options.interval) data.pause().cycle()
  375. })
  376. }
  377. var old = $.fn.carousel
  378. $.fn.carousel = Plugin
  379. $.fn.carousel.Constructor = Carousel
  380. // CAROUSEL NO CONFLICT
  381. // ====================
  382. $.fn.carousel.noConflict = function () {
  383. $.fn.carousel = old
  384. return this
  385. }
  386. // CAROUSEL DATA-API
  387. // =================
  388. var clickHandler = function (e) {
  389. var $this = $(this)
  390. var href = $this.attr('href')
  391. if (href) {
  392. href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
  393. }
  394. var target = $this.attr('data-target') || href
  395. var $target = $(document).find(target)
  396. if (!$target.hasClass('carousel')) return
  397. var options = $.extend({}, $target.data(), $this.data())
  398. var slideIndex = $this.attr('data-slide-to')
  399. if (slideIndex) options.interval = false
  400. Plugin.call($target, options)
  401. if (slideIndex) {
  402. $target.data('bs.carousel').to(slideIndex)
  403. }
  404. e.preventDefault()
  405. }
  406. $(document)
  407. .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
  408. .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
  409. $(window).on('load', function () {
  410. $('[data-ride="carousel"]').each(function () {
  411. var $carousel = $(this)
  412. Plugin.call($carousel, $carousel.data())
  413. })
  414. })
  415. }(jQuery);
  416. /* ========================================================================
  417. * Bootstrap: collapse.js v3.4.1
  418. * https://getbootstrap.com/docs/3.4/javascript/#collapse
  419. * ========================================================================
  420. * Copyright 2011-2019 Twitter, Inc.
  421. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  422. * ======================================================================== */
  423. /* jshint latedef: false */
  424. +function ($) {
  425. 'use strict';
  426. // COLLAPSE PUBLIC CLASS DEFINITION
  427. // ================================
  428. var Collapse = function (element, options) {
  429. this.$element = $(element)
  430. this.options = $.extend({}, Collapse.DEFAULTS, options)
  431. this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
  432. '[data-toggle="collapse"][data-target="#' + element.id + '"]')
  433. this.transitioning = null
  434. if (this.options.parent) {
  435. this.$parent = this.getParent()
  436. } else {
  437. this.addAriaAndCollapsedClass(this.$element, this.$trigger)
  438. }
  439. if (this.options.toggle) this.toggle()
  440. }
  441. Collapse.VERSION = '3.4.1'
  442. Collapse.TRANSITION_DURATION = 350
  443. Collapse.DEFAULTS = {
  444. toggle: true
  445. }
  446. Collapse.prototype.dimension = function () {
  447. var hasWidth = this.$element.hasClass('width')
  448. return hasWidth ? 'width' : 'height'
  449. }
  450. Collapse.prototype.show = function () {
  451. if (this.transitioning || this.$element.hasClass('in')) return
  452. var activesData
  453. var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
  454. if (actives && actives.length) {
  455. activesData = actives.data('bs.collapse')
  456. if (activesData && activesData.transitioning) return
  457. }
  458. var startEvent = $.Event('show.bs.collapse')
  459. this.$element.trigger(startEvent)
  460. if (startEvent.isDefaultPrevented()) return
  461. if (actives && actives.length) {
  462. Plugin.call(actives, 'hide')
  463. activesData || actives.data('bs.collapse', null)
  464. }
  465. var dimension = this.dimension()
  466. this.$element
  467. .removeClass('collapse')
  468. .addClass('collapsing')[dimension](0)
  469. .attr('aria-expanded', true)
  470. this.$trigger
  471. .removeClass('collapsed')
  472. .attr('aria-expanded', true)
  473. this.transitioning = 1
  474. var complete = function () {
  475. this.$element
  476. .removeClass('collapsing')
  477. .addClass('collapse in')[dimension]('')
  478. this.transitioning = 0
  479. this.$element
  480. .trigger('shown.bs.collapse')
  481. }
  482. if (!$.support.transition) return complete.call(this)
  483. var scrollSize = $.camelCase(['scroll', dimension].join('-'))
  484. this.$element
  485. .one('bsTransitionEnd', $.proxy(complete, this))
  486. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
  487. }
  488. Collapse.prototype.hide = function () {
  489. if (this.transitioning || !this.$element.hasClass('in')) return
  490. var startEvent = $.Event('hide.bs.collapse')
  491. this.$element.trigger(startEvent)
  492. if (startEvent.isDefaultPrevented()) return
  493. var dimension = this.dimension()
  494. this.$element[dimension](this.$element[dimension]())[0].offsetHeight
  495. this.$element
  496. .addClass('collapsing')
  497. .removeClass('collapse in')
  498. .attr('aria-expanded', false)
  499. this.$trigger
  500. .addClass('collapsed')
  501. .attr('aria-expanded', false)
  502. this.transitioning = 1
  503. var complete = function () {
  504. this.transitioning = 0
  505. this.$element
  506. .removeClass('collapsing')
  507. .addClass('collapse')
  508. .trigger('hidden.bs.collapse')
  509. }
  510. if (!$.support.transition) return complete.call(this)
  511. this.$element
  512. [dimension](0)
  513. .one('bsTransitionEnd', $.proxy(complete, this))
  514. .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
  515. }
  516. Collapse.prototype.toggle = function () {
  517. this[this.$element.hasClass('in') ? 'hide' : 'show']()
  518. }
  519. Collapse.prototype.getParent = function () {
  520. return $(document).find(this.options.parent)
  521. .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
  522. .each($.proxy(function (i, element) {
  523. var $element = $(element)
  524. this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
  525. }, this))
  526. .end()
  527. }
  528. Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
  529. var isOpen = $element.hasClass('in')
  530. $element.attr('aria-expanded', isOpen)
  531. $trigger
  532. .toggleClass('collapsed', !isOpen)
  533. .attr('aria-expanded', isOpen)
  534. }
  535. function getTargetFromTrigger($trigger) {
  536. var href
  537. var target = $trigger.attr('data-target')
  538. || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
  539. return $(document).find(target)
  540. }
  541. // COLLAPSE PLUGIN DEFINITION
  542. // ==========================
  543. function Plugin(option) {
  544. return this.each(function () {
  545. var $this = $(this)
  546. var data = $this.data('bs.collapse')
  547. var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
  548. if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
  549. if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
  550. if (typeof option == 'string') data[option]()
  551. })
  552. }
  553. var old = $.fn.collapse
  554. $.fn.collapse = Plugin
  555. $.fn.collapse.Constructor = Collapse
  556. // COLLAPSE NO CONFLICT
  557. // ====================
  558. $.fn.collapse.noConflict = function () {
  559. $.fn.collapse = old
  560. return this
  561. }
  562. // COLLAPSE DATA-API
  563. // =================
  564. $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
  565. var $this = $(this)
  566. if (!$this.attr('data-target')) e.preventDefault()
  567. var $target = getTargetFromTrigger($this)
  568. var data = $target.data('bs.collapse')
  569. var option = data ? 'toggle' : $this.data()
  570. Plugin.call($target, option)
  571. })
  572. }(jQuery);
  573. /* ========================================================================
  574. * Bootstrap: dropdown.js v3.4.1
  575. * https://getbootstrap.com/docs/3.4/javascript/#dropdowns
  576. * ========================================================================
  577. * Copyright 2011-2019 Twitter, Inc.
  578. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  579. * ======================================================================== */
  580. +function ($) {
  581. 'use strict';
  582. // DROPDOWN CLASS DEFINITION
  583. // =========================
  584. var backdrop = '.dropdown-backdrop'
  585. var toggle = '[data-toggle="dropdown"]'
  586. var Dropdown = function (element) {
  587. $(element).on('click.bs.dropdown', this.toggle)
  588. }
  589. Dropdown.VERSION = '3.4.1'
  590. function getParent($this) {
  591. var selector = $this.attr('data-target')
  592. if (!selector) {
  593. selector = $this.attr('href')
  594. selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  595. }
  596. var $parent = selector !== '#' ? $(document).find(selector) : null
  597. return $parent && $parent.length ? $parent : $this.parent()
  598. }
  599. function clearMenus(e) {
  600. if (e && e.which === 3) return
  601. $(backdrop).remove()
  602. $(toggle).each(function () {
  603. var $this = $(this)
  604. var $parent = getParent($this)
  605. var relatedTarget = { relatedTarget: this }
  606. if (!$parent.hasClass('open')) return
  607. if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return
  608. $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
  609. if (e.isDefaultPrevented()) return
  610. $this.attr('aria-expanded', 'false')
  611. $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget))
  612. })
  613. }
  614. Dropdown.prototype.toggle = function (e) {
  615. var $this = $(this)
  616. if ($this.is('.disabled, :disabled')) return
  617. var $parent = getParent($this)
  618. var isActive = $parent.hasClass('open')
  619. clearMenus()
  620. if (!isActive) {
  621. if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
  622. // if mobile we use a backdrop because click events don't delegate
  623. $(document.createElement('div'))
  624. .addClass('dropdown-backdrop')
  625. .insertAfter($(this))
  626. .on('click', clearMenus)
  627. }
  628. var relatedTarget = { relatedTarget: this }
  629. $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
  630. if (e.isDefaultPrevented()) return
  631. $this
  632. .trigger('focus')
  633. .attr('aria-expanded', 'true')
  634. $parent
  635. .toggleClass('open')
  636. .trigger($.Event('shown.bs.dropdown', relatedTarget))
  637. }
  638. return false
  639. }
  640. Dropdown.prototype.keydown = function (e) {
  641. if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
  642. var $this = $(this)
  643. e.preventDefault()
  644. e.stopPropagation()
  645. if ($this.is('.disabled, :disabled')) return
  646. var $parent = getParent($this)
  647. var isActive = $parent.hasClass('open')
  648. if (!isActive && e.which != 27 || isActive && e.which == 27) {
  649. if (e.which == 27) $parent.find(toggle).trigger('focus')
  650. return $this.trigger('click')
  651. }
  652. var desc = ' li:not(.disabled):visible a'
  653. var $items = $parent.find('.dropdown-menu' + desc)
  654. if (!$items.length) return
  655. var index = $items.index(e.target)
  656. if (e.which == 38 && index > 0) index-- // up
  657. if (e.which == 40 && index < $items.length - 1) index++ // down
  658. if (!~index) index = 0
  659. $items.eq(index).trigger('focus')
  660. }
  661. // DROPDOWN PLUGIN DEFINITION
  662. // ==========================
  663. function Plugin(option) {
  664. return this.each(function () {
  665. var $this = $(this)
  666. var data = $this.data('bs.dropdown')
  667. if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
  668. if (typeof option == 'string') data[option].call($this)
  669. })
  670. }
  671. var old = $.fn.dropdown
  672. $.fn.dropdown = Plugin
  673. $.fn.dropdown.Constructor = Dropdown
  674. // DROPDOWN NO CONFLICT
  675. // ====================
  676. $.fn.dropdown.noConflict = function () {
  677. $.fn.dropdown = old
  678. return this
  679. }
  680. // APPLY TO STANDARD DROPDOWN ELEMENTS
  681. // ===================================
  682. $(document)
  683. .on('click.bs.dropdown.data-api', clearMenus)
  684. .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
  685. .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
  686. .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
  687. .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)
  688. }(jQuery);
  689. /* ========================================================================
  690. * Bootstrap: modal.js v3.4.1
  691. * https://getbootstrap.com/docs/3.4/javascript/#modals
  692. * ========================================================================
  693. * Copyright 2011-2019 Twitter, Inc.
  694. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  695. * ======================================================================== */
  696. +function ($) {
  697. 'use strict';
  698. // MODAL CLASS DEFINITION
  699. // ======================
  700. var Modal = function (element, options) {
  701. this.options = options
  702. this.$body = $(document.body)
  703. this.$element = $(element)
  704. this.$dialog = this.$element.find('.modal-dialog')
  705. this.$backdrop = null
  706. this.isShown = null
  707. this.originalBodyPad = null
  708. this.scrollbarWidth = 0
  709. this.ignoreBackdropClick = false
  710. this.fixedContent = '.navbar-fixed-top, .navbar-fixed-bottom'
  711. if (this.options.remote) {
  712. this.$element
  713. .find('.modal-content')
  714. .load(this.options.remote, $.proxy(function () {
  715. this.$element.trigger('loaded.bs.modal')
  716. }, this))
  717. }
  718. }
  719. Modal.VERSION = '3.4.1'
  720. Modal.TRANSITION_DURATION = 300
  721. Modal.BACKDROP_TRANSITION_DURATION = 150
  722. Modal.DEFAULTS = {
  723. backdrop: true,
  724. keyboard: true,
  725. show: true
  726. }
  727. Modal.prototype.toggle = function (_relatedTarget) {
  728. return this.isShown ? this.hide() : this.show(_relatedTarget)
  729. }
  730. Modal.prototype.show = function (_relatedTarget) {
  731. var that = this
  732. var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
  733. this.$element.trigger(e)
  734. if (this.isShown || e.isDefaultPrevented()) return
  735. this.isShown = true
  736. this.checkScrollbar()
  737. this.setScrollbar()
  738. this.$body.addClass('modal-open')
  739. this.escape()
  740. this.resize()
  741. this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
  742. this.$dialog.on('mousedown.dismiss.bs.modal', function () {
  743. that.$element.one('mouseup.dismiss.bs.modal', function (e) {
  744. if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
  745. })
  746. })
  747. this.backdrop(function () {
  748. var transition = $.support.transition && that.$element.hasClass('fade')
  749. if (!that.$element.parent().length) {
  750. that.$element.appendTo(that.$body) // don't move modals dom position
  751. }
  752. that.$element
  753. .show()
  754. .scrollTop(0)
  755. that.adjustDialog()
  756. if (transition) {
  757. that.$element[0].offsetWidth // force reflow
  758. }
  759. that.$element.addClass('in')
  760. that.enforceFocus()
  761. var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
  762. transition ?
  763. that.$dialog // wait for modal to slide in
  764. .one('bsTransitionEnd', function () {
  765. that.$element.trigger('focus').trigger(e)
  766. })
  767. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  768. that.$element.trigger('focus').trigger(e)
  769. })
  770. }
  771. Modal.prototype.hide = function (e) {
  772. if (e) e.preventDefault()
  773. e = $.Event('hide.bs.modal')
  774. this.$element.trigger(e)
  775. if (!this.isShown || e.isDefaultPrevented()) return
  776. this.isShown = false
  777. this.escape()
  778. this.resize()
  779. $(document).off('focusin.bs.modal')
  780. this.$element
  781. .removeClass('in')
  782. .off('click.dismiss.bs.modal')
  783. .off('mouseup.dismiss.bs.modal')
  784. this.$dialog.off('mousedown.dismiss.bs.modal')
  785. $.support.transition && this.$element.hasClass('fade') ?
  786. this.$element
  787. .one('bsTransitionEnd', $.proxy(this.hideModal, this))
  788. .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
  789. this.hideModal()
  790. }
  791. Modal.prototype.enforceFocus = function () {
  792. $(document)
  793. .off('focusin.bs.modal') // guard against infinite focus loop
  794. .on('focusin.bs.modal', $.proxy(function (e) {
  795. if (document !== e.target &&
  796. this.$element[0] !== e.target &&
  797. !this.$element.has(e.target).length) {
  798. this.$element.trigger('focus')
  799. }
  800. }, this))
  801. }
  802. Modal.prototype.escape = function () {
  803. if (this.isShown && this.options.keyboard) {
  804. this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
  805. e.which == 27 && this.hide()
  806. }, this))
  807. } else if (!this.isShown) {
  808. this.$element.off('keydown.dismiss.bs.modal')
  809. }
  810. }
  811. Modal.prototype.resize = function () {
  812. if (this.isShown) {
  813. $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
  814. } else {
  815. $(window).off('resize.bs.modal')
  816. }
  817. }
  818. Modal.prototype.hideModal = function () {
  819. var that = this
  820. this.$element.hide()
  821. this.backdrop(function () {
  822. that.$body.removeClass('modal-open')
  823. that.resetAdjustments()
  824. that.resetScrollbar()
  825. that.$element.trigger('hidden.bs.modal')
  826. })
  827. }
  828. Modal.prototype.removeBackdrop = function () {
  829. this.$backdrop && this.$backdrop.remove()
  830. this.$backdrop = null
  831. }
  832. Modal.prototype.backdrop = function (callback) {
  833. var that = this
  834. var animate = this.$element.hasClass('fade') ? 'fade' : ''
  835. if (this.isShown && this.options.backdrop) {
  836. var doAnimate = $.support.transition && animate
  837. this.$backdrop = $(document.createElement('div'))
  838. .addClass('modal-backdrop ' + animate)
  839. .appendTo(this.$body)
  840. this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
  841. if (this.ignoreBackdropClick) {
  842. this.ignoreBackdropClick = false
  843. return
  844. }
  845. if (e.target !== e.currentTarget) return
  846. this.options.backdrop == 'static'
  847. ? this.$element[0].focus()
  848. : this.hide()
  849. }, this))
  850. if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
  851. this.$backdrop.addClass('in')
  852. if (!callback) return
  853. doAnimate ?
  854. this.$backdrop
  855. .one('bsTransitionEnd', callback)
  856. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  857. callback()
  858. } else if (!this.isShown && this.$backdrop) {
  859. this.$backdrop.removeClass('in')
  860. var callbackRemove = function () {
  861. that.removeBackdrop()
  862. callback && callback()
  863. }
  864. $.support.transition && this.$element.hasClass('fade') ?
  865. this.$backdrop
  866. .one('bsTransitionEnd', callbackRemove)
  867. .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
  868. callbackRemove()
  869. } else if (callback) {
  870. callback()
  871. }
  872. }
  873. // these following methods are used to handle overflowing modals
  874. Modal.prototype.handleUpdate = function () {
  875. this.adjustDialog()
  876. }
  877. Modal.prototype.adjustDialog = function () {
  878. var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
  879. this.$element.css({
  880. paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
  881. paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
  882. })
  883. }
  884. Modal.prototype.resetAdjustments = function () {
  885. this.$element.css({
  886. paddingLeft: '',
  887. paddingRight: ''
  888. })
  889. }
  890. Modal.prototype.checkScrollbar = function () {
  891. var fullWindowWidth = window.innerWidth
  892. if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
  893. var documentElementRect = document.documentElement.getBoundingClientRect()
  894. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
  895. }
  896. this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
  897. this.scrollbarWidth = this.measureScrollbar()
  898. }
  899. Modal.prototype.setScrollbar = function () {
  900. var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
  901. this.originalBodyPad = document.body.style.paddingRight || ''
  902. var scrollbarWidth = this.scrollbarWidth
  903. if (this.bodyIsOverflowing) {
  904. this.$body.css('padding-right', bodyPad + scrollbarWidth)
  905. $(this.fixedContent).each(function (index, element) {
  906. var actualPadding = element.style.paddingRight
  907. var calculatedPadding = $(element).css('padding-right')
  908. $(element)
  909. .data('padding-right', actualPadding)
  910. .css('padding-right', parseFloat(calculatedPadding) + scrollbarWidth + 'px')
  911. })
  912. }
  913. }
  914. Modal.prototype.resetScrollbar = function () {
  915. this.$body.css('padding-right', this.originalBodyPad)
  916. $(this.fixedContent).each(function (index, element) {
  917. var padding = $(element).data('padding-right')
  918. $(element).removeData('padding-right')
  919. element.style.paddingRight = padding ? padding : ''
  920. })
  921. }
  922. Modal.prototype.measureScrollbar = function () { // thx walsh
  923. var scrollDiv = document.createElement('div')
  924. scrollDiv.className = 'modal-scrollbar-measure'
  925. this.$body.append(scrollDiv)
  926. var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
  927. this.$body[0].removeChild(scrollDiv)
  928. return scrollbarWidth
  929. }
  930. // MODAL PLUGIN DEFINITION
  931. // =======================
  932. function Plugin(option, _relatedTarget) {
  933. return this.each(function () {
  934. var $this = $(this)
  935. var data = $this.data('bs.modal')
  936. var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
  937. if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
  938. if (typeof option == 'string') data[option](_relatedTarget)
  939. else if (options.show) data.show(_relatedTarget)
  940. })
  941. }
  942. var old = $.fn.modal
  943. $.fn.modal = Plugin
  944. $.fn.modal.Constructor = Modal
  945. // MODAL NO CONFLICT
  946. // =================
  947. $.fn.modal.noConflict = function () {
  948. $.fn.modal = old
  949. return this
  950. }
  951. // MODAL DATA-API
  952. // ==============
  953. $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
  954. var $this = $(this)
  955. var href = $this.attr('href')
  956. var target = $this.attr('data-target') ||
  957. (href && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
  958. var $target = $(document).find(target)
  959. var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
  960. if ($this.is('a')) e.preventDefault()
  961. $target.one('show.bs.modal', function (showEvent) {
  962. if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
  963. $target.one('hidden.bs.modal', function () {
  964. $this.is(':visible') && $this.trigger('focus')
  965. })
  966. })
  967. Plugin.call($target, option, this)
  968. })
  969. }(jQuery);
  970. /* ========================================================================
  971. * Bootstrap: tooltip.js v3.4.1
  972. * https://getbootstrap.com/docs/3.4/javascript/#tooltip
  973. * Inspired by the original jQuery.tipsy by Jason Frame
  974. * ========================================================================
  975. * Copyright 2011-2019 Twitter, Inc.
  976. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  977. * ======================================================================== */
  978. +function ($) {
  979. 'use strict';
  980. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']
  981. var uriAttrs = [
  982. 'background',
  983. 'cite',
  984. 'href',
  985. 'itemtype',
  986. 'longdesc',
  987. 'poster',
  988. 'src',
  989. 'xlink:href'
  990. ]
  991. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i
  992. var DefaultWhitelist = {
  993. // Global attributes allowed on any supplied element below.
  994. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  995. a: ['target', 'href', 'title', 'rel'],
  996. area: [],
  997. b: [],
  998. br: [],
  999. col: [],
  1000. code: [],
  1001. div: [],
  1002. em: [],
  1003. hr: [],
  1004. h1: [],
  1005. h2: [],
  1006. h3: [],
  1007. h4: [],
  1008. h5: [],
  1009. h6: [],
  1010. i: [],
  1011. img: ['src', 'alt', 'title', 'width', 'height'],
  1012. li: [],
  1013. ol: [],
  1014. p: [],
  1015. pre: [],
  1016. s: [],
  1017. small: [],
  1018. span: [],
  1019. sub: [],
  1020. sup: [],
  1021. strong: [],
  1022. u: [],
  1023. ul: []
  1024. }
  1025. /**
  1026. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  1027. *
  1028. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  1029. */
  1030. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi
  1031. /**
  1032. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  1033. *
  1034. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  1035. */
  1036. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
  1037. function allowedAttribute(attr, allowedAttributeList) {
  1038. var attrName = attr.nodeName.toLowerCase()
  1039. if ($.inArray(attrName, allowedAttributeList) !== -1) {
  1040. if ($.inArray(attrName, uriAttrs) !== -1) {
  1041. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
  1042. }
  1043. return true
  1044. }
  1045. var regExp = $(allowedAttributeList).filter(function (index, value) {
  1046. return value instanceof RegExp
  1047. })
  1048. // Check if a regular expression validates the attribute.
  1049. for (var i = 0, l = regExp.length; i < l; i++) {
  1050. if (attrName.match(regExp[i])) {
  1051. return true
  1052. }
  1053. }
  1054. return false
  1055. }
  1056. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  1057. if (unsafeHtml.length === 0) {
  1058. return unsafeHtml
  1059. }
  1060. if (sanitizeFn && typeof sanitizeFn === 'function') {
  1061. return sanitizeFn(unsafeHtml)
  1062. }
  1063. // IE 8 and below don't support createHTMLDocument
  1064. if (!document.implementation || !document.implementation.createHTMLDocument) {
  1065. return unsafeHtml
  1066. }
  1067. var createdDocument = document.implementation.createHTMLDocument('sanitization')
  1068. createdDocument.body.innerHTML = unsafeHtml
  1069. var whitelistKeys = $.map(whiteList, function (el, i) { return i })
  1070. var elements = $(createdDocument.body).find('*')
  1071. for (var i = 0, len = elements.length; i < len; i++) {
  1072. var el = elements[i]
  1073. var elName = el.nodeName.toLowerCase()
  1074. if ($.inArray(elName, whitelistKeys) === -1) {
  1075. el.parentNode.removeChild(el)
  1076. continue
  1077. }
  1078. var attributeList = $.map(el.attributes, function (el) { return el })
  1079. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
  1080. for (var j = 0, len2 = attributeList.length; j < len2; j++) {
  1081. if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
  1082. el.removeAttribute(attributeList[j].nodeName)
  1083. }
  1084. }
  1085. }
  1086. return createdDocument.body.innerHTML
  1087. }
  1088. // TOOLTIP PUBLIC CLASS DEFINITION
  1089. // ===============================
  1090. var Tooltip = function (element, options) {
  1091. this.type = null
  1092. this.options = null
  1093. this.enabled = null
  1094. this.timeout = null
  1095. this.hoverState = null
  1096. this.$element = null
  1097. this.inState = null
  1098. this.init('tooltip', element, options)
  1099. }
  1100. Tooltip.VERSION = '3.4.1'
  1101. Tooltip.TRANSITION_DURATION = 150
  1102. Tooltip.DEFAULTS = {
  1103. animation: true,
  1104. placement: 'top',
  1105. selector: false,
  1106. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  1107. trigger: 'hover focus',
  1108. title: '',
  1109. delay: 0,
  1110. html: false,
  1111. container: false,
  1112. viewport: {
  1113. selector: 'body',
  1114. padding: 0
  1115. },
  1116. sanitize : true,
  1117. sanitizeFn : null,
  1118. whiteList : DefaultWhitelist
  1119. }
  1120. Tooltip.prototype.init = function (type, element, options) {
  1121. this.enabled = true
  1122. this.type = type
  1123. this.$element = $(element)
  1124. this.options = this.getOptions(options)
  1125. this.$viewport = this.options.viewport && $(document).find($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
  1126. this.inState = { click: false, hover: false, focus: false }
  1127. if (this.$element[0] instanceof document.constructor && !this.options.selector) {
  1128. throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
  1129. }
  1130. var triggers = this.options.trigger.split(' ')
  1131. for (var i = triggers.length; i--;) {
  1132. var trigger = triggers[i]
  1133. if (trigger == 'click') {
  1134. this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
  1135. } else if (trigger != 'manual') {
  1136. var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
  1137. var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
  1138. this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
  1139. this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
  1140. }
  1141. }
  1142. this.options.selector ?
  1143. (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
  1144. this.fixTitle()
  1145. }
  1146. Tooltip.prototype.getDefaults = function () {
  1147. return Tooltip.DEFAULTS
  1148. }
  1149. Tooltip.prototype.getOptions = function (options) {
  1150. var dataAttributes = this.$element.data()
  1151. for (var dataAttr in dataAttributes) {
  1152. if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
  1153. delete dataAttributes[dataAttr]
  1154. }
  1155. }
  1156. options = $.extend({}, this.getDefaults(), dataAttributes, options)
  1157. if (options.delay && typeof options.delay == 'number') {
  1158. options.delay = {
  1159. show: options.delay,
  1160. hide: options.delay
  1161. }
  1162. }
  1163. if (options.sanitize) {
  1164. options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
  1165. }
  1166. return options
  1167. }
  1168. Tooltip.prototype.getDelegateOptions = function () {
  1169. var options = {}
  1170. var defaults = this.getDefaults()
  1171. this._options && $.each(this._options, function (key, value) {
  1172. if (defaults[key] != value) options[key] = value
  1173. })
  1174. return options
  1175. }
  1176. Tooltip.prototype.enter = function (obj) {
  1177. var self = obj instanceof this.constructor ?
  1178. obj : $(obj.currentTarget).data('bs.' + this.type)
  1179. if (!self) {
  1180. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  1181. $(obj.currentTarget).data('bs.' + this.type, self)
  1182. }
  1183. if (obj instanceof $.Event) {
  1184. self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
  1185. }
  1186. if (self.tip().hasClass('in') || self.hoverState == 'in') {
  1187. self.hoverState = 'in'
  1188. return
  1189. }
  1190. clearTimeout(self.timeout)
  1191. self.hoverState = 'in'
  1192. if (!self.options.delay || !self.options.delay.show) return self.show()
  1193. self.timeout = setTimeout(function () {
  1194. if (self.hoverState == 'in') self.show()
  1195. }, self.options.delay.show)
  1196. }
  1197. Tooltip.prototype.isInStateTrue = function () {
  1198. for (var key in this.inState) {
  1199. if (this.inState[key]) return true
  1200. }
  1201. return false
  1202. }
  1203. Tooltip.prototype.leave = function (obj) {
  1204. var self = obj instanceof this.constructor ?
  1205. obj : $(obj.currentTarget).data('bs.' + this.type)
  1206. if (!self) {
  1207. self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
  1208. $(obj.currentTarget).data('bs.' + this.type, self)
  1209. }
  1210. if (obj instanceof $.Event) {
  1211. self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
  1212. }
  1213. if (self.isInStateTrue()) return
  1214. clearTimeout(self.timeout)
  1215. self.hoverState = 'out'
  1216. if (!self.options.delay || !self.options.delay.hide) return self.hide()
  1217. self.timeout = setTimeout(function () {
  1218. if (self.hoverState == 'out') self.hide()
  1219. }, self.options.delay.hide)
  1220. }
  1221. Tooltip.prototype.show = function () {
  1222. var e = $.Event('show.bs.' + this.type)
  1223. if (this.hasContent() && this.enabled) {
  1224. this.$element.trigger(e)
  1225. var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
  1226. if (e.isDefaultPrevented() || !inDom) return
  1227. var that = this
  1228. var $tip = this.tip()
  1229. var tipId = this.getUID(this.type)
  1230. this.setContent()
  1231. $tip.attr('id', tipId)
  1232. this.$element.attr('aria-describedby', tipId)
  1233. if (this.options.animation) $tip.addClass('fade')
  1234. var placement = typeof this.options.placement == 'function' ?
  1235. this.options.placement.call(this, $tip[0], this.$element[0]) :
  1236. this.options.placement
  1237. var autoToken = /\s?auto?\s?/i
  1238. var autoPlace = autoToken.test(placement)
  1239. if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
  1240. $tip
  1241. .detach()
  1242. .css({ top: 0, left: 0, display: 'block' })
  1243. .addClass(placement)
  1244. .data('bs.' + this.type, this)
  1245. this.options.container ? $tip.appendTo($(document).find(this.options.container)) : $tip.insertAfter(this.$element)
  1246. this.$element.trigger('inserted.bs.' + this.type)
  1247. var pos = this.getPosition()
  1248. var actualWidth = $tip[0].offsetWidth
  1249. var actualHeight = $tip[0].offsetHeight
  1250. if (autoPlace) {
  1251. var orgPlacement = placement
  1252. var viewportDim = this.getPosition(this.$viewport)
  1253. placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' :
  1254. placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' :
  1255. placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' :
  1256. placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' :
  1257. placement
  1258. $tip
  1259. .removeClass(orgPlacement)
  1260. .addClass(placement)
  1261. }
  1262. var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
  1263. this.applyPlacement(calculatedOffset, placement)
  1264. var complete = function () {
  1265. var prevHoverState = that.hoverState
  1266. that.$element.trigger('shown.bs.' + that.type)
  1267. that.hoverState = null
  1268. if (prevHoverState == 'out') that.leave(that)
  1269. }
  1270. $.support.transition && this.$tip.hasClass('fade') ?
  1271. $tip
  1272. .one('bsTransitionEnd', complete)
  1273. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  1274. complete()
  1275. }
  1276. }
  1277. Tooltip.prototype.applyPlacement = function (offset, placement) {
  1278. var $tip = this.tip()
  1279. var width = $tip[0].offsetWidth
  1280. var height = $tip[0].offsetHeight
  1281. // manually read margins because getBoundingClientRect includes difference
  1282. var marginTop = parseInt($tip.css('margin-top'), 10)
  1283. var marginLeft = parseInt($tip.css('margin-left'), 10)
  1284. // we must check for NaN for ie 8/9
  1285. if (isNaN(marginTop)) marginTop = 0
  1286. if (isNaN(marginLeft)) marginLeft = 0
  1287. offset.top += marginTop
  1288. offset.left += marginLeft
  1289. // $.fn.offset doesn't round pixel values
  1290. // so we use setOffset directly with our own function B-0
  1291. $.offset.setOffset($tip[0], $.extend({
  1292. using: function (props) {
  1293. $tip.css({
  1294. top: Math.round(props.top),
  1295. left: Math.round(props.left)
  1296. })
  1297. }
  1298. }, offset), 0)
  1299. $tip.addClass('in')
  1300. // check to see if placing tip in new offset caused the tip to resize itself
  1301. var actualWidth = $tip[0].offsetWidth
  1302. var actualHeight = $tip[0].offsetHeight
  1303. if (placement == 'top' && actualHeight != height) {
  1304. offset.top = offset.top + height - actualHeight
  1305. }
  1306. var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)
  1307. if (delta.left) offset.left += delta.left
  1308. else offset.top += delta.top
  1309. var isVertical = /top|bottom/.test(placement)
  1310. var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
  1311. var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'
  1312. $tip.offset(offset)
  1313. this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
  1314. }
  1315. Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
  1316. this.arrow()
  1317. .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
  1318. .css(isVertical ? 'top' : 'left', '')
  1319. }
  1320. Tooltip.prototype.setContent = function () {
  1321. var $tip = this.tip()
  1322. var title = this.getTitle()
  1323. if (this.options.html) {
  1324. if (this.options.sanitize) {
  1325. title = sanitizeHtml(title, this.options.whiteList, this.options.sanitizeFn)
  1326. }
  1327. $tip.find('.tooltip-inner').html(title)
  1328. } else {
  1329. $tip.find('.tooltip-inner').text(title)
  1330. }
  1331. $tip.removeClass('fade in top bottom left right')
  1332. }
  1333. Tooltip.prototype.hide = function (callback) {
  1334. var that = this
  1335. var $tip = $(this.$tip)
  1336. var e = $.Event('hide.bs.' + this.type)
  1337. function complete() {
  1338. if (that.hoverState != 'in') $tip.detach()
  1339. if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary.
  1340. that.$element
  1341. .removeAttr('aria-describedby')
  1342. .trigger('hidden.bs.' + that.type)
  1343. }
  1344. callback && callback()
  1345. }
  1346. this.$element.trigger(e)
  1347. if (e.isDefaultPrevented()) return
  1348. $tip.removeClass('in')
  1349. $.support.transition && $tip.hasClass('fade') ?
  1350. $tip
  1351. .one('bsTransitionEnd', complete)
  1352. .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
  1353. complete()
  1354. this.hoverState = null
  1355. return this
  1356. }
  1357. Tooltip.prototype.fixTitle = function () {
  1358. var $e = this.$element
  1359. if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
  1360. $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
  1361. }
  1362. }
  1363. Tooltip.prototype.hasContent = function () {
  1364. return this.getTitle()
  1365. }
  1366. Tooltip.prototype.getPosition = function ($element) {
  1367. $element = $element || this.$element
  1368. var el = $element[0]
  1369. var isBody = el.tagName == 'BODY'
  1370. var elRect = el.getBoundingClientRect()
  1371. if (elRect.width == null) {
  1372. // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
  1373. elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
  1374. }
  1375. var isSvg = window.SVGElement && el instanceof window.SVGElement
  1376. // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3.
  1377. // See https://github.com/twbs/bootstrap/issues/20280
  1378. var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset())
  1379. var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
  1380. var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null
  1381. return $.extend({}, elRect, scroll, outerDims, elOffset)
  1382. }
  1383. Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
  1384. return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  1385. placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
  1386. placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
  1387. /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
  1388. }
  1389. Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
  1390. var delta = { top: 0, left: 0 }
  1391. if (!this.$viewport) return delta
  1392. var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
  1393. var viewportDimensions = this.getPosition(this.$viewport)
  1394. if (/right|left/.test(placement)) {
  1395. var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll
  1396. var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
  1397. if (topEdgeOffset < viewportDimensions.top) { // top overflow
  1398. delta.top = viewportDimensions.top - topEdgeOffset
  1399. } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
  1400. delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
  1401. }
  1402. } else {
  1403. var leftEdgeOffset = pos.left - viewportPadding
  1404. var rightEdgeOffset = pos.left + viewportPadding + actualWidth
  1405. if (leftEdgeOffset < viewportDimensions.left) { // left overflow
  1406. delta.left = viewportDimensions.left - leftEdgeOffset
  1407. } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
  1408. delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
  1409. }
  1410. }
  1411. return delta
  1412. }
  1413. Tooltip.prototype.getTitle = function () {
  1414. var title
  1415. var $e = this.$element
  1416. var o = this.options
  1417. title = $e.attr('data-original-title')
  1418. || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
  1419. return title
  1420. }
  1421. Tooltip.prototype.getUID = function (prefix) {
  1422. do prefix += ~~(Math.random() * 1000000)
  1423. while (document.getElementById(prefix))
  1424. return prefix
  1425. }
  1426. Tooltip.prototype.tip = function () {
  1427. if (!this.$tip) {
  1428. this.$tip = $(this.options.template)
  1429. if (this.$tip.length != 1) {
  1430. throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
  1431. }
  1432. }
  1433. return this.$tip
  1434. }
  1435. Tooltip.prototype.arrow = function () {
  1436. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  1437. }
  1438. Tooltip.prototype.enable = function () {
  1439. this.enabled = true
  1440. }
  1441. Tooltip.prototype.disable = function () {
  1442. this.enabled = false
  1443. }
  1444. Tooltip.prototype.toggleEnabled = function () {
  1445. this.enabled = !this.enabled
  1446. }
  1447. Tooltip.prototype.toggle = function (e) {
  1448. var self = this
  1449. if (e) {
  1450. self = $(e.currentTarget).data('bs.' + this.type)
  1451. if (!self) {
  1452. self = new this.constructor(e.currentTarget, this.getDelegateOptions())
  1453. $(e.currentTarget).data('bs.' + this.type, self)
  1454. }
  1455. }
  1456. if (e) {
  1457. self.inState.click = !self.inState.click
  1458. if (self.isInStateTrue()) self.enter(self)
  1459. else self.leave(self)
  1460. } else {
  1461. self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
  1462. }
  1463. }
  1464. Tooltip.prototype.destroy = function () {
  1465. var that = this
  1466. clearTimeout(this.timeout)
  1467. this.hide(function () {
  1468. that.$element.off('.' + that.type).removeData('bs.' + that.type)
  1469. if (that.$tip) {
  1470. that.$tip.detach()
  1471. }
  1472. that.$tip = null
  1473. that.$arrow = null
  1474. that.$viewport = null
  1475. that.$element = null
  1476. })
  1477. }
  1478. Tooltip.prototype.sanitizeHtml = function (unsafeHtml) {
  1479. return sanitizeHtml(unsafeHtml, this.options.whiteList, this.options.sanitizeFn)
  1480. }
  1481. // TOOLTIP PLUGIN DEFINITION
  1482. // =========================
  1483. function Plugin(option) {
  1484. return this.each(function () {
  1485. var $this = $(this)
  1486. var data = $this.data('bs.tooltip')
  1487. var options = typeof option == 'object' && option
  1488. if (!data && /destroy|hide/.test(option)) return
  1489. if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
  1490. if (typeof option == 'string') data[option]()
  1491. })
  1492. }
  1493. var old = $.fn.tooltip
  1494. $.fn.tooltip = Plugin
  1495. $.fn.tooltip.Constructor = Tooltip
  1496. // TOOLTIP NO CONFLICT
  1497. // ===================
  1498. $.fn.tooltip.noConflict = function () {
  1499. $.fn.tooltip = old
  1500. return this
  1501. }
  1502. }(jQuery);
  1503. /* ========================================================================
  1504. * Bootstrap: popover.js v3.4.1
  1505. * https://getbootstrap.com/docs/3.4/javascript/#popovers
  1506. * ========================================================================
  1507. * Copyright 2011-2019 Twitter, Inc.
  1508. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1509. * ======================================================================== */
  1510. +function ($) {
  1511. 'use strict';
  1512. // POPOVER PUBLIC CLASS DEFINITION
  1513. // ===============================
  1514. var Popover = function (element, options) {
  1515. this.init('popover', element, options)
  1516. }
  1517. if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
  1518. Popover.VERSION = '3.4.1'
  1519. Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
  1520. placement: 'right',
  1521. trigger: 'click',
  1522. content: '',
  1523. template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  1524. })
  1525. // NOTE: POPOVER EXTENDS tooltip.js
  1526. // ================================
  1527. Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
  1528. Popover.prototype.constructor = Popover
  1529. Popover.prototype.getDefaults = function () {
  1530. return Popover.DEFAULTS
  1531. }
  1532. Popover.prototype.setContent = function () {
  1533. var $tip = this.tip()
  1534. var title = this.getTitle()
  1535. var content = this.getContent()
  1536. if (this.options.html) {
  1537. var typeContent = typeof content
  1538. if (this.options.sanitize) {
  1539. title = this.sanitizeHtml(title)
  1540. if (typeContent === 'string') {
  1541. content = this.sanitizeHtml(content)
  1542. }
  1543. }
  1544. $tip.find('.popover-title').html(title)
  1545. $tip.find('.popover-content').children().detach().end()[
  1546. typeContent === 'string' ? 'html' : 'append'
  1547. ](content)
  1548. } else {
  1549. $tip.find('.popover-title').text(title)
  1550. $tip.find('.popover-content').children().detach().end().text(content)
  1551. }
  1552. $tip.removeClass('fade top bottom left right in')
  1553. // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
  1554. // this manually by checking the contents.
  1555. if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
  1556. }
  1557. Popover.prototype.hasContent = function () {
  1558. return this.getTitle() || this.getContent()
  1559. }
  1560. Popover.prototype.getContent = function () {
  1561. var $e = this.$element
  1562. var o = this.options
  1563. return $e.attr('data-content')
  1564. || (typeof o.content == 'function' ?
  1565. o.content.call($e[0]) :
  1566. o.content)
  1567. }
  1568. Popover.prototype.arrow = function () {
  1569. return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
  1570. }
  1571. // POPOVER PLUGIN DEFINITION
  1572. // =========================
  1573. function Plugin(option) {
  1574. return this.each(function () {
  1575. var $this = $(this)
  1576. var data = $this.data('bs.popover')
  1577. var options = typeof option == 'object' && option
  1578. if (!data && /destroy|hide/.test(option)) return
  1579. if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
  1580. if (typeof option == 'string') data[option]()
  1581. })
  1582. }
  1583. var old = $.fn.popover
  1584. $.fn.popover = Plugin
  1585. $.fn.popover.Constructor = Popover
  1586. // POPOVER NO CONFLICT
  1587. // ===================
  1588. $.fn.popover.noConflict = function () {
  1589. $.fn.popover = old
  1590. return this
  1591. }
  1592. }(jQuery);
  1593. /* ========================================================================
  1594. * Bootstrap: scrollspy.js v3.4.1
  1595. * https://getbootstrap.com/docs/3.4/javascript/#scrollspy
  1596. * ========================================================================
  1597. * Copyright 2011-2019 Twitter, Inc.
  1598. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1599. * ======================================================================== */
  1600. +function ($) {
  1601. 'use strict';
  1602. // SCROLLSPY CLASS DEFINITION
  1603. // ==========================
  1604. function ScrollSpy(element, options) {
  1605. this.$body = $(document.body)
  1606. this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
  1607. this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
  1608. this.selector = (this.options.target || '') + ' .nav li > a'
  1609. this.offsets = []
  1610. this.targets = []
  1611. this.activeTarget = null
  1612. this.scrollHeight = 0
  1613. this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
  1614. this.refresh()
  1615. this.process()
  1616. }
  1617. ScrollSpy.VERSION = '3.4.1'
  1618. ScrollSpy.DEFAULTS = {
  1619. offset: 10
  1620. }
  1621. ScrollSpy.prototype.getScrollHeight = function () {
  1622. return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
  1623. }
  1624. ScrollSpy.prototype.refresh = function () {
  1625. var that = this
  1626. var offsetMethod = 'offset'
  1627. var offsetBase = 0
  1628. this.offsets = []
  1629. this.targets = []
  1630. this.scrollHeight = this.getScrollHeight()
  1631. if (!$.isWindow(this.$scrollElement[0])) {
  1632. offsetMethod = 'position'
  1633. offsetBase = this.$scrollElement.scrollTop()
  1634. }
  1635. this.$body
  1636. .find(this.selector)
  1637. .map(function () {
  1638. var $el = $(this)
  1639. var href = $el.data('target') || $el.attr('href')
  1640. var $href = /^#./.test(href) && $(href)
  1641. return ($href
  1642. && $href.length
  1643. && $href.is(':visible')
  1644. && [[$href[offsetMethod]().top + offsetBase, href]]) || null
  1645. })
  1646. .sort(function (a, b) { return a[0] - b[0] })
  1647. .each(function () {
  1648. that.offsets.push(this[0])
  1649. that.targets.push(this[1])
  1650. })
  1651. }
  1652. ScrollSpy.prototype.process = function () {
  1653. var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
  1654. var scrollHeight = this.getScrollHeight()
  1655. var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height()
  1656. var offsets = this.offsets
  1657. var targets = this.targets
  1658. var activeTarget = this.activeTarget
  1659. var i
  1660. if (this.scrollHeight != scrollHeight) {
  1661. this.refresh()
  1662. }
  1663. if (scrollTop >= maxScroll) {
  1664. return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
  1665. }
  1666. if (activeTarget && scrollTop < offsets[0]) {
  1667. this.activeTarget = null
  1668. return this.clear()
  1669. }
  1670. for (i = offsets.length; i--;) {
  1671. activeTarget != targets[i]
  1672. && scrollTop >= offsets[i]
  1673. && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
  1674. && this.activate(targets[i])
  1675. }
  1676. }
  1677. ScrollSpy.prototype.activate = function (target) {
  1678. this.activeTarget = target
  1679. this.clear()
  1680. var selector = this.selector +
  1681. '[data-target="' + target + '"],' +
  1682. this.selector + '[href="' + target + '"]'
  1683. var active = $(selector)
  1684. .parents('li')
  1685. .addClass('active')
  1686. if (active.parent('.dropdown-menu').length) {
  1687. active = active
  1688. .closest('li.dropdown')
  1689. .addClass('active')
  1690. }
  1691. active.trigger('activate.bs.scrollspy')
  1692. }
  1693. ScrollSpy.prototype.clear = function () {
  1694. $(this.selector)
  1695. .parentsUntil(this.options.target, '.active')
  1696. .removeClass('active')
  1697. }
  1698. // SCROLLSPY PLUGIN DEFINITION
  1699. // ===========================
  1700. function Plugin(option) {
  1701. return this.each(function () {
  1702. var $this = $(this)
  1703. var data = $this.data('bs.scrollspy')
  1704. var options = typeof option == 'object' && option
  1705. if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
  1706. if (typeof option == 'string') data[option]()
  1707. })
  1708. }
  1709. var old = $.fn.scrollspy
  1710. $.fn.scrollspy = Plugin
  1711. $.fn.scrollspy.Constructor = ScrollSpy
  1712. // SCROLLSPY NO CONFLICT
  1713. // =====================
  1714. $.fn.scrollspy.noConflict = function () {
  1715. $.fn.scrollspy = old
  1716. return this
  1717. }
  1718. // SCROLLSPY DATA-API
  1719. // ==================
  1720. $(window).on('load.bs.scrollspy.data-api', function () {
  1721. $('[data-spy="scroll"]').each(function () {
  1722. var $spy = $(this)
  1723. Plugin.call($spy, $spy.data())
  1724. })
  1725. })
  1726. }(jQuery);
  1727. /* ========================================================================
  1728. * Bootstrap: tab.js v3.4.1
  1729. * https://getbootstrap.com/docs/3.4/javascript/#tabs
  1730. * ========================================================================
  1731. * Copyright 2011-2019 Twitter, Inc.
  1732. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1733. * ======================================================================== */
  1734. +function ($) {
  1735. 'use strict';
  1736. // TAB CLASS DEFINITION
  1737. // ====================
  1738. var Tab = function (element) {
  1739. // jscs:disable requireDollarBeforejQueryAssignment
  1740. this.element = $(element)
  1741. // jscs:enable requireDollarBeforejQueryAssignment
  1742. }
  1743. Tab.VERSION = '3.4.1'
  1744. Tab.TRANSITION_DURATION = 150
  1745. Tab.prototype.show = function () {
  1746. var $this = this.element
  1747. var $ul = $this.closest('ul:not(.dropdown-menu)')
  1748. var selector = $this.data('target')
  1749. if (!selector) {
  1750. selector = $this.attr('href')
  1751. selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
  1752. }
  1753. if ($this.parent('li').hasClass('active')) return
  1754. var $previous = $ul.find('.active:last a')
  1755. var hideEvent = $.Event('hide.bs.tab', {
  1756. relatedTarget: $this[0]
  1757. })
  1758. var showEvent = $.Event('show.bs.tab', {
  1759. relatedTarget: $previous[0]
  1760. })
  1761. $previous.trigger(hideEvent)
  1762. $this.trigger(showEvent)
  1763. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
  1764. var $target = $(document).find(selector)
  1765. this.activate($this.closest('li'), $ul)
  1766. this.activate($target, $target.parent(), function () {
  1767. $previous.trigger({
  1768. type: 'hidden.bs.tab',
  1769. relatedTarget: $this[0]
  1770. })
  1771. $this.trigger({
  1772. type: 'shown.bs.tab',
  1773. relatedTarget: $previous[0]
  1774. })
  1775. })
  1776. }
  1777. Tab.prototype.activate = function (element, container, callback) {
  1778. var $active = container.find('> .active')
  1779. var transition = callback
  1780. && $.support.transition
  1781. && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length)
  1782. function next() {
  1783. $active
  1784. .removeClass('active')
  1785. .find('> .dropdown-menu > .active')
  1786. .removeClass('active')
  1787. .end()
  1788. .find('[data-toggle="tab"]')
  1789. .attr('aria-expanded', false)
  1790. element
  1791. .addClass('active')
  1792. .find('[data-toggle="tab"]')
  1793. .attr('aria-expanded', true)
  1794. if (transition) {
  1795. element[0].offsetWidth // reflow for transition
  1796. element.addClass('in')
  1797. } else {
  1798. element.removeClass('fade')
  1799. }
  1800. if (element.parent('.dropdown-menu').length) {
  1801. element
  1802. .closest('li.dropdown')
  1803. .addClass('active')
  1804. .end()
  1805. .find('[data-toggle="tab"]')
  1806. .attr('aria-expanded', true)
  1807. }
  1808. callback && callback()
  1809. }
  1810. $active.length && transition ?
  1811. $active
  1812. .one('bsTransitionEnd', next)
  1813. .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
  1814. next()
  1815. $active.removeClass('in')
  1816. }
  1817. // TAB PLUGIN DEFINITION
  1818. // =====================
  1819. function Plugin(option) {
  1820. return this.each(function () {
  1821. var $this = $(this)
  1822. var data = $this.data('bs.tab')
  1823. if (!data) $this.data('bs.tab', (data = new Tab(this)))
  1824. if (typeof option == 'string') data[option]()
  1825. })
  1826. }
  1827. var old = $.fn.tab
  1828. $.fn.tab = Plugin
  1829. $.fn.tab.Constructor = Tab
  1830. // TAB NO CONFLICT
  1831. // ===============
  1832. $.fn.tab.noConflict = function () {
  1833. $.fn.tab = old
  1834. return this
  1835. }
  1836. // TAB DATA-API
  1837. // ============
  1838. var clickHandler = function (e) {
  1839. e.preventDefault()
  1840. Plugin.call($(this), 'show')
  1841. }
  1842. $(document)
  1843. .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
  1844. .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
  1845. }(jQuery);
  1846. /* ========================================================================
  1847. * Bootstrap: affix.js v3.4.1
  1848. * https://getbootstrap.com/docs/3.4/javascript/#affix
  1849. * ========================================================================
  1850. * Copyright 2011-2019 Twitter, Inc.
  1851. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  1852. * ======================================================================== */
  1853. +function ($) {
  1854. 'use strict';
  1855. // AFFIX CLASS DEFINITION
  1856. // ======================
  1857. var Affix = function (element, options) {
  1858. this.options = $.extend({}, Affix.DEFAULTS, options)
  1859. var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)
  1860. this.$target = target
  1861. .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
  1862. .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
  1863. this.$element = $(element)
  1864. this.affixed = null
  1865. this.unpin = null
  1866. this.pinnedOffset = null
  1867. this.checkPosition()
  1868. }
  1869. Affix.VERSION = '3.4.1'
  1870. Affix.RESET = 'affix affix-top affix-bottom'
  1871. Affix.DEFAULTS = {
  1872. offset: 0,
  1873. target: window
  1874. }
  1875. Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
  1876. var scrollTop = this.$target.scrollTop()
  1877. var position = this.$element.offset()
  1878. var targetHeight = this.$target.height()
  1879. if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
  1880. if (this.affixed == 'bottom') {
  1881. if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
  1882. return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
  1883. }
  1884. var initializing = this.affixed == null
  1885. var colliderTop = initializing ? scrollTop : position.top
  1886. var colliderHeight = initializing ? targetHeight : height
  1887. if (offsetTop != null && scrollTop <= offsetTop) return 'top'
  1888. if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
  1889. return false
  1890. }
  1891. Affix.prototype.getPinnedOffset = function () {
  1892. if (this.pinnedOffset) return this.pinnedOffset
  1893. this.$element.removeClass(Affix.RESET).addClass('affix')
  1894. var scrollTop = this.$target.scrollTop()
  1895. var position = this.$element.offset()
  1896. return (this.pinnedOffset = position.top - scrollTop)
  1897. }
  1898. Affix.prototype.checkPositionWithEventLoop = function () {
  1899. setTimeout($.proxy(this.checkPosition, this), 1)
  1900. }
  1901. Affix.prototype.checkPosition = function () {
  1902. if (!this.$element.is(':visible')) return
  1903. var height = this.$element.height()
  1904. var offset = this.options.offset
  1905. var offsetTop = offset.top
  1906. var offsetBottom = offset.bottom
  1907. var scrollHeight = Math.max($(document).height(), $(document.body).height())
  1908. if (typeof offset != 'object') offsetBottom = offsetTop = offset
  1909. if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
  1910. if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
  1911. var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
  1912. if (this.affixed != affix) {
  1913. if (this.unpin != null) this.$element.css('top', '')
  1914. var affixType = 'affix' + (affix ? '-' + affix : '')
  1915. var e = $.Event(affixType + '.bs.affix')
  1916. this.$element.trigger(e)
  1917. if (e.isDefaultPrevented()) return
  1918. this.affixed = affix
  1919. this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
  1920. this.$element
  1921. .removeClass(Affix.RESET)
  1922. .addClass(affixType)
  1923. .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
  1924. }
  1925. if (affix == 'bottom') {
  1926. this.$element.offset({
  1927. top: scrollHeight - height - offsetBottom
  1928. })
  1929. }
  1930. }
  1931. // AFFIX PLUGIN DEFINITION
  1932. // =======================
  1933. function Plugin(option) {
  1934. return this.each(function () {
  1935. var $this = $(this)
  1936. var data = $this.data('bs.affix')
  1937. var options = typeof option == 'object' && option
  1938. if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
  1939. if (typeof option == 'string') data[option]()
  1940. })
  1941. }
  1942. var old = $.fn.affix
  1943. $.fn.affix = Plugin
  1944. $.fn.affix.Constructor = Affix
  1945. // AFFIX NO CONFLICT
  1946. // =================
  1947. $.fn.affix.noConflict = function () {
  1948. $.fn.affix = old
  1949. return this
  1950. }
  1951. // AFFIX DATA-API
  1952. // ==============
  1953. $(window).on('load', function () {
  1954. $('[data-spy="affix"]').each(function () {
  1955. var $spy = $(this)
  1956. var data = $spy.data()
  1957. data.offset = data.offset || {}
  1958. if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
  1959. if (data.offsetTop != null) data.offset.top = data.offsetTop
  1960. Plugin.call($spy, data)
  1961. })
  1962. })
  1963. }(jQuery);