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