A ChatGPT based emulation of the therapist Doctor Kernel from the book "A digital Affair" by Neora Shem Shaul
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 68KB

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