You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2306 lines
66 KiB

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