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