vendor: 14,130 bytes, lines 1-400
1/* Module Bootstrap - Utilisation par le filtre avancé sur la page liste des hébergements : Tooltip, tab, collapse, transition + jQuery Bootstrap Responsive Tabs */ 2 3/* ======================================================================== 4 * Bootstrap: tooltip.js v3.3.7 5 * http://getbootstrap.com/javascript/#tooltip 6 * Inspired by the original jQuery.tipsy by Jason Frame 7 * ======================================================================== 8 * Copyright 2011-2016 Twitter, Inc. 9 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 10 * ======================================================================== */ 11 12 13+function ($) { 14 'use strict'; 15 16 // TOOLTIP PUBLIC CLASS DEFINITION 17 // =============================== 18 19 var Tooltip = function (element, options) { 20 this.type = null 21 this.options = null 22 this.enabled = null 23 this.timeout = null 24 this.hoverState = null 25 this.$element = null 26 this.inState = null 27 28 this.init('tooltip', element, options) 29 } 30 31 Tooltip.VERSION = '3.3.7' 32 33 Tooltip.TRANSITION_DURATION = 150 34 35 Tooltip.DEFAULTS = { 36 animation: true, 37 placement: 'top', 38 selector: false, 39 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 40 trigger: 'hover focus', 41 title: '', 42 delay: 0, 43 html: false, 44 container: false, 45 viewport: { 46 selector: 'body', 47 padding: 0 48 } 49 } 50 51 Tooltip.prototype.init = function (type, element, options) { 52 this.enabled = true 53 this.type = type 54 this.$element = $(element) 55 this.options = this.getOptions(options) 56 this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) 57 this.inState = { click: false, hover: false, focus: false } 58 59 if (this.$element[0] instanceof document.constructor && !this.options.selector) { 60 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') 61 } 62 63 var triggers = this.options.trigger.split(' ') 64 65 for (var i = triggers.length; i--;) { 66 var trigger = triggers[i] 67 68 if (trigger == 'click') { 69 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 70 } else if (trigger != 'manual') { 71 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' 72 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' 73 74 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 75 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 76 } 77 } 78 79 this.options.selector ? 80 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 81 this.fixTitle() 82 } 83 84 Tooltip.prototype.getDefaults = function () { 85 return Tooltip.DEFAULTS 86 } 87 88 Tooltip.prototype.getOptions = function (options) { 89 options = $.extend({}, this.getDefaults(), this.$element.data(), options) 90 91 if (options.delay && typeof options.delay == 'number') { 92 options.delay = { 93 show: options.delay, 94 hide: options.delay 95 } 96 } 97 98 return options 99 } 100 101 Tooltip.prototype.getDelegateOptions = function () { 102 var options = {} 103 var defaults = this.getDefaults() 104 105 this._options && $.each(this._options, function (key, value) { 106 if (defaults[key] != value) options[key] = value 107 }) 108 109 return options 110 } 111 112 Tooltip.prototype.enter = function (obj) { 113 var self = obj instanceof this.constructor ? 114 obj : $(obj.currentTarget).data('bs.' + this.type) 115 116 if (!self) { 117 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 118 $(obj.currentTarget).data('bs.' + this.type, self) 119 } 120 121 if (obj instanceof $.Event) { 122 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true 123 } 124 125 if (self.tip().hasClass('in') || self.hoverState == 'in') { 126 self.hoverState = 'in' 127 return 128 } 129 130 clearTimeout(self.timeout) 131 132 self.hoverState = 'in' 133 134 if (!self.options.delay || !self.options.delay.show) return self.show() 135 136 self.timeout = setTimeout(function () { 137 if (self.hoverState == 'in') self.show() 138 }, self.options.delay.show) 139 } 140 141 Tooltip.prototype.isInStateTrue = function () { 142 for (var key in this.inState) { 143 if (this.inState[key]) return true 144 } 145 146 return false 147 } 148 149 Tooltip.prototype.leave = function (obj) { 150 var self = obj instanceof this.constructor ? 151 obj : $(obj.currentTarget).data('bs.' + this.type) 152 153 if (!self) { 154 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 155 $(obj.currentTarget).data('bs.' + this.type, self) 156 } 157 158 if (obj instanceof $.Event) { 159 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false 160 } 161 162 if (self.isInStateTrue()) return 163 164 clearTimeout(self.timeout) 165 166 self.hoverState = 'out' 167 168 if (!self.options.delay || !self.options.delay.hide) return self.hide() 169 170 self.timeout = setTimeout(function () { 171 if (self.hoverState == 'out') self.hide() 172 }, self.options.delay.hide) 173 } 174 175 Tooltip.prototype.show = function () { 176 var e = $.Event('show.bs.' + this.type) 177 178 if (this.hasContent() && this.enabled) { 179 this.$element.trigger(e) 180 181 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) 182 if (e.isDefaultPrevented() || !inDom) return 183 var that = this 184 185 var $tip = this.tip() 186 187 var tipId = this.getUID(this.type) 188 189 this.setContent() 190 $tip.attr('id', tipId) 191 this.$element.attr('aria-describedby', tipId) 192 193 if (this.options.animation) $tip.addClass('fade') 194 195 var placement = typeof this.options.placement == 'function' ? 196 this.options.placement.call(this, $tip[0], this.$element[0]) : 197 this.options.placement 198 199 var autoToken = /\s?auto?\s?/i 200 var autoPlace = autoToken.test(placement) 201 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 202 203 $tip 204 .detach() 205 .css({ top: 0, left: 0, display: 'block' }) 206 .addClass(placement) 207 .data('bs.' + this.type, this) 208 209 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) 210 this.$element.trigger('inserted.bs.' + this.type) 211 212 var pos = this.getPosition() 213 var actualWidth = $tip[0].offsetWidth 214 var actualHeight = $tip[0].offsetHeight 215 216 if (autoPlace) { 217 var orgPlacement = placement 218 var viewportDim = this.getPosition(this.$viewport) 219 220 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : 221 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : 222 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : 223 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : 224 placement 225 226 $tip 227 .removeClass(orgPlacement) 228 .addClass(placement) 229 } 230 231 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 232 233 this.applyPlacement(calculatedOffset, placement) 234 235 var complete = function () { 236 var prevHoverState = that.hoverState 237 that.$element.trigger('shown.bs.' + that.type) 238 that.hoverState = null 239 240 if (prevHoverState == 'out') that.leave(that) 241 } 242 243 $.support.transition && this.$tip.hasClass('fade') ? 244 $tip 245 .one('bsTransitionEnd', complete) 246 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 247 complete() 248 } 249 } 250 251 Tooltip.prototype.applyPlacement = function (offset, placement) { 252 var $tip = this.tip() 253 var width = $tip[0].offsetWidth 254 var height = $tip[0].offsetHeight 255 256 // manually read margins because getBoundingClientRect includes difference 257 var marginTop = parseInt($tip.css('margin-top'), 10) 258 var marginLeft = parseInt($tip.css('margin-left'), 10) 259 260 // we must check for NaN for ie 8/9 261 if (isNaN(marginTop)) marginTop = 0 262 if (isNaN(marginLeft)) marginLeft = 0 263 264 offset.top += marginTop 265 offset.left += marginLeft 266 267 // $.fn.offset doesn't round pixel values 268 // so we use setOffset directly with our own function B-0 269 $.offset.setOffset($tip[0], $.extend({ 270 using: function (props) { 271 $tip.css({ 272 top: Math.round(props.top), 273 left: Math.round(props.left) 274 }) 275 } 276 }, offset), 0) 277 278 $tip.addClass('in') 279 280 // check to see if placing tip in new offset caused the tip to resize itself 281 var actualWidth = $tip[0].offsetWidth 282 var actualHeight = $tip[0].offsetHeight 283 284 if (placement == 'top' && actualHeight != height) { 285 offset.top = offset.top + height - actualHeight 286 } 287 288 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) 289 290 if (delta.left) offset.left += delta.left 291 else offset.top += delta.top 292 293 var isVertical = /top|bottom/.test(placement) 294 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight 295 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' 296 297 $tip.offset(offset) 298 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) 299 } 300 301 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { 302 this.arrow() 303 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') 304 .css(isVertical ? 'top' : 'left', '') 305 } 306 307 Tooltip.prototype.setContent = function () { 308 var $tip = this.tip() 309 var title = this.getTitle() 310 311 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) 312 $tip.removeClass('fade in top bottom left right') 313 } 314 315 Tooltip.prototype.hide = function (callback) { 316 var that = this 317 var $tip = $(this.$tip) 318 var e = $.Event('hide.bs.' + this.type) 319 320 function complete() { 321 if (that.hoverState != 'in') $tip.detach() 322 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. 323 that.$element 324 .removeAttr('aria-describedby') 325 .trigger('hidden.bs.' + that.type) 326 } 327 callback && callback() 328 } 329 330 this.$element.trigger(e) 331 332 if (e.isDefaultPrevented()) return 333 334 $tip.removeClass('in') 335 336 $.support.transition && $tip.hasClass('fade') ? 337 $tip 338 .one('bsTransitionEnd', complete) 339 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 340 complete() 341 342 this.hoverState = null 343 344 return this 345 } 346 347 Tooltip.prototype.fixTitle = function () { 348 var $e = this.$element 349 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { 350 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 351 } 352 } 353 354 Tooltip.prototype.hasContent = function () { 355 return this.getTitle() 356 } 357 358 Tooltip.prototype.getPosition = function ($element) { 359 $element = $element || this.$element 360 361 var el = $element[0] 362 var isBody = el.tagName == 'BODY' 363 364 var elRect = el.getBoundingClientRect() 365 if (elRect.width == null) { 366 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 367 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) 368 } 369 var isSvg = window.SVGElement && el instanceof window.SVGElement 370 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. 371 // See https://github.com/twbs/bootstrap/issues/20280 372 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) 373 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } 374 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null 375 376 return $.extend({}, elRect, scroll, outerDims, elOffset) 377 } 378 379 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 380 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 381 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 382 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 383 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 384 385 } 386 387 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { 388 var delta = { top: 0, left: 0 } 389 if (!this.$viewport) return delta 390 391 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 392 var viewportDimensions = this.getPosition(this.$viewport) 393 394 if (/right|left/.test(placement)) { 395 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll 396 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight 397 if (topEdgeOffset < viewportDimensions.top) { // top overflow 398 delta.top = viewportDimensions.top - topEdgeOffset 399 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow 400 delta.top = viewportDimensions.top + viewportDimensions.height - bottom
vendor: 8,151 bytes, lines 400-699
400EdgeOffset 401 } 402 } else { 403 var leftEdgeOffset = pos.left - viewportPadding 404 var rightEdgeOffset = pos.left + viewportPadding + actualWidth 405 if (leftEdgeOffset < viewportDimensions.left) { // left overflow 406 delta.left = viewportDimensions.left - leftEdgeOffset 407 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow 408 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset 409 } 410 } 411 412 return delta 413 } 414 415 Tooltip.prototype.getTitle = function () { 416 var title 417 var $e = this.$element 418 var o = this.options 419 420 title = $e.attr('data-original-title') 421 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 422 423 return title 424 } 425 426 Tooltip.prototype.getUID = function (prefix) { 427 do prefix += ~~(Math.random() * 1000000) 428 while (document.getElementById(prefix)) 429 return prefix 430 } 431 432 Tooltip.prototype.tip = function () { 433 if (!this.$tip) { 434 this.$tip = $(this.options.template) 435 if (this.$tip.length != 1) { 436 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') 437 } 438 } 439 return this.$tip 440 } 441 442 Tooltip.prototype.arrow = function () { 443 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) 444 } 445 446 Tooltip.prototype.enable = function () { 447 this.enabled = true 448 } 449 450 Tooltip.prototype.disable = function () { 451 this.enabled = false 452 } 453 454 Tooltip.prototype.toggleEnabled = function () { 455 this.enabled = !this.enabled 456 } 457 458 Tooltip.prototype.toggle = function (e) { 459 var self = this 460 if (e) { 461 self = $(e.currentTarget).data('bs.' + this.type) 462 if (!self) { 463 self = new this.constructor(e.currentTarget, this.getDelegateOptions()) 464 $(e.currentTarget).data('bs.' + this.type, self) 465 } 466 } 467 468 if (e) { 469 self.inState.click = !self.inState.click 470 if (self.isInStateTrue()) self.enter(self) 471 else self.leave(self) 472 } else { 473 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 474 } 475 } 476 477 Tooltip.prototype.destroy = function () { 478 var that = this 479 clearTimeout(this.timeout) 480 this.hide(function () { 481 that.$element.off('.' + that.type).removeData('bs.' + that.type) 482 if (that.$tip) { 483 that.$tip.detach() 484 } 485 that.$tip = null 486 that.$arrow = null 487 that.$viewport = null 488 that.$element = null 489 }) 490 } 491 492 493 // TOOLTIP PLUGIN DEFINITION 494 // ========================= 495 496 function Plugin(option) { 497 return this.each(function () { 498 var $this = $(this) 499 var data = $this.data('bs.tooltip') 500 var options = typeof option == 'object' && option 501 502 if (!data && /destroy|hide/.test(option)) return 503 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 504 if (typeof option == 'string') data[option]() 505 }) 506 } 507 508 var old = $.fn.tooltip 509 510 $.fn.tooltip = Plugin 511 $.fn.tooltip.Constructor = Tooltip 512 513 514 // TOOLTIP NO CONFLICT 515 // =================== 516 517 $.fn.tooltip.noConflict = function () { 518 $.fn.tooltip = old 519 return this 520 } 521 522}(jQuery); 523 524/* ======================================================================== 525 * Bootstrap: tab.js v3.3.7 526 * http://getbootstrap.com/javascript/#tabs 527 * ======================================================================== 528 * Copyright 2011-2016 Twitter, Inc. 529 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 530 * ======================================================================== */ 531 532 533+function ($) { 534 'use strict'; 535 536 // TAB CLASS DEFINITION 537 // ==================== 538 539 var Tab = function (element) { 540 // jscs:disable requireDollarBeforejQueryAssignment 541 this.element = $(element) 542 // jscs:enable requireDollarBeforejQueryAssignment 543 } 544 545 Tab.VERSION = '3.3.7' 546 547 Tab.TRANSITION_DURATION = 150 548 549 Tab.prototype.show = function () { 550 var $this = this.element 551 var $ul = $this.closest('ul:not(.dropdown-menu)') 552 var selector = $this.data('target') 553 554 if (!selector) { 555 selector = $this.attr('href') 556 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 557 } 558 559 if ($this.parent('li').hasClass('active')) return 560 561 var $previous = $ul.find('.active:last a') 562 var hideEvent = $.Event('hide.bs.tab', { 563 relatedTarget: $this[0] 564 }) 565 var showEvent = $.Event('show.bs.tab', { 566 relatedTarget: $previous[0] 567 }) 568 569 $previous.trigger(hideEvent) 570 $this.trigger(showEvent) 571 572 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return 573 574 var $target = $(selector) 575 576 this.activate($this.closest('li'), $ul) 577 this.activate($target, $target.parent(), function () { 578 $previous.trigger({ 579 type: 'hidden.bs.tab', 580 relatedTarget: $this[0] 581 }) 582 $this.trigger({ 583 type: 'shown.bs.tab', 584 relatedTarget: $previous[0] 585 }) 586 }) 587 } 588 589 Tab.prototype.activate = function (element, container, callback) { 590 var $active = container.find('> .active') 591 var transition = callback 592 && $.support.transition 593 && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length) 594 595 function next() { 596 $active 597 .removeClass('active') 598 .find('> .dropdown-menu > .active') 599 .removeClass('active') 600 .end() 601 .find('[data-toggle="tab"]') 602 .attr('aria-expanded', false) 603 604 element 605 .addClass('active') 606 .find('[data-toggle="tab"]') 607 .attr('aria-expanded', true) 608 609 if (transition) { 610 element[0].offsetWidth // reflow for transition 611 element.addClass('in') 612 } else { 613 element.removeClass('fade') 614 } 615 616 if (element.parent('.dropdown-menu').length) { 617 element 618 .closest('li.dropdown') 619 .addClass('active') 620 .end() 621 .find('[data-toggle="tab"]') 622 .attr('aria-expanded', true) 623 } 624 625 callback && callback() 626 } 627 628 $active.length && transition ? 629 $active 630 .one('bsTransitionEnd', next) 631 .emulateTransitionEnd(Tab.TRANSITION_DURATION) : 632 next() 633 634 $active.removeClass('in') 635 } 636 637 638 // TAB PLUGIN DEFINITION 639 // ===================== 640 641 function Plugin(option) { 642 return this.each(function () { 643 var $this = $(this) 644 var data = $this.data('bs.tab') 645 646 if (!data) $this.data('bs.tab', (data = new Tab(this))) 647 if (typeof option == 'string') data[option]() 648 }) 649 } 650 651 var old = $.fn.tab 652 653 $.fn.tab = Plugin 654 $.fn.tab.Constructor = Tab 655 656 657 // TAB NO CONFLICT 658 // =============== 659 660 $.fn.tab.noConflict = function () { 661 $.fn.tab = old 662 return this 663 } 664 665 666 // TAB DATA-API 667 // ============ 668 669 var clickHandler = function (e) { 670 e.preventDefault() 671 Plugin.call($(this), 'show') 672 } 673 674 $(document) 675 .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) 676 .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) 677 678}(jQuery); 679 680/* ======================================================================== 681 * Bootstrap: collapse.js v3.3.7 682 * http://getbootstrap.com/javascript/#collapse 683 * ======================================================================== 684 * Copyright 2011-2016 Twitter, Inc. 685 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 686 * ======================================================================== */ 687 688/* jshint latedef: false */ 689 690+function ($) { 691 'use strict'; 692 693 // COLLAPSE PUBLIC CLASS DEFINITION 694 // ================================ 695 696 var Collapse = function (element, options) { 697 this.$element = $(element) 698 this.options = $.extend({}, Collapse.DEFAULTS, options) 699 this.$trigger = $('[data-toggle="collapse"][href="#' + element.i
vendor: 5,876 bytes, lines 699-904
699d + '"],' + 700 '[data-toggle="collapse"][data-target="#' + element.id + '"]') 701 this.transitioning = null 702 703 if (this.options.parent) { 704 this.$parent = this.getParent() 705 } else { 706 this.addAriaAndCollapsedClass(this.$element, this.$trigger) 707 } 708 709 if (this.options.toggle) this.toggle() 710 } 711 712 Collapse.VERSION = '3.3.7' 713 714 Collapse.TRANSITION_DURATION = 350 715 716 Collapse.DEFAULTS = { 717 toggle: true 718 } 719 720 Collapse.prototype.dimension = function () { 721 var hasWidth = this.$element.hasClass('width') 722 return hasWidth ? 'width' : 'height' 723 } 724 725 Collapse.prototype.show = function () { 726 if (this.transitioning || this.$element.hasClass('in')) return 727 728 var activesData 729 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') 730 731 if (actives && actives.length) { 732 activesData = actives.data('bs.collapse') 733 if (activesData && activesData.transitioning) return 734 } 735 736 var startEvent = $.Event('show.bs.collapse') 737 this.$element.trigger(startEvent) 738 if (startEvent.isDefaultPrevented()) return 739 740 if (actives && actives.length) { 741 Plugin.call(actives, 'hide') 742 activesData || actives.data('bs.collapse', null) 743 } 744 745 var dimension = this.dimension() 746 747 this.$element 748 .removeClass('collapse') 749 .addClass('collapsing')[dimension](0) 750 .attr('aria-expanded', true) 751 752 this.$trigger 753 .removeClass('collapsed') 754 .attr('aria-expanded', true) 755 756 this.transitioning = 1 757 758 var complete = function () { 759 this.$element 760 .removeClass('collapsing') 761 .addClass('collapse in')[dimension]('') 762 this.transitioning = 0 763 this.$element 764 .trigger('shown.bs.collapse') 765 } 766 767 if (!$.support.transition) return complete.call(this) 768 769 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 770 771 this.$element 772 .one('bsTransitionEnd', $.proxy(complete, this)) 773 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) 774 } 775 776 Collapse.prototype.hide = function () { 777 if (this.transitioning || !this.$element.hasClass('in')) return 778 779 var startEvent = $.Event('hide.bs.collapse') 780 this.$element.trigger(startEvent) 781 if (startEvent.isDefaultPrevented()) return 782 783 var dimension = this.dimension() 784 785 this.$element[dimension](this.$element[dimension]())[0].offsetHeight 786 787 this.$element 788 .addClass('collapsing') 789 .removeClass('collapse in') 790 .attr('aria-expanded', false) 791 792 this.$trigger 793 .addClass('collapsed') 794 .attr('aria-expanded', false) 795 796 this.transitioning = 1 797 798 var complete = function () { 799 this.transitioning = 0 800 this.$element 801 .removeClass('collapsing') 802 .addClass('collapse') 803 .trigger('hidden.bs.collapse') 804 } 805 806 if (!$.support.transition) return complete.call(this) 807 808 this.$element 809 [dimension](0) 810 .one('bsTransitionEnd', $.proxy(complete, this)) 811 .emulateTransitionEnd(Collapse.TRANSITION_DURATION) 812 } 813 814 Collapse.prototype.toggle = function () { 815 this[this.$element.hasClass('in') ? 'hide' : 'show']() 816 } 817 818 Collapse.prototype.getParent = function () { 819 return $(this.options.parent) 820 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') 821 .each($.proxy(function (i, element) { 822 var $element = $(element) 823 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) 824 }, this)) 825 .end() 826 } 827 828 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { 829 var isOpen = $element.hasClass('in') 830 831 $element.attr('aria-expanded', isOpen) 832 $trigger 833 .toggleClass('collapsed', !isOpen) 834 .attr('aria-expanded', isOpen) 835 } 836 837 function getTargetFromTrigger($trigger) { 838 var href 839 var target = $trigger.attr('data-target') 840 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 841 842 return $(target) 843 } 844 845 846 // COLLAPSE PLUGIN DEFINITION 847 // ========================== 848 849 function Plugin(option) { 850 return this.each(function () { 851 var $this = $(this) 852 var data = $this.data('bs.collapse') 853 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 854 855 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false 856 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 857 if (typeof option == 'string') data[option]() 858 }) 859 } 860 861 var old = $.fn.collapse 862 863 $.fn.collapse = Plugin 864 $.fn.collapse.Constructor = Collapse 865 866 867 // COLLAPSE NO CONFLICT 868 // ==================== 869 870 $.fn.collapse.noConflict = function () { 871 $.fn.collapse = old 872 return this 873 } 874 875 876 // COLLAPSE DATA-API 877 // ================= 878 879 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { 880 var $this = $(this) 881 882 if (!$this.attr('data-target')) e.preventDefault() 883 884 var $target = getTargetFromTrigger($this) 885 var data = $target.data('bs.collapse') 886 var option = data ? 'toggle' : $this.data() 887 888 Plugin.call($target, option) 889 }) 890 891}(jQuery); 892 893/* ======================================================================== 894 * Bootstrap: transition.js v3.3.7 895 * http://getbootstrap.com/javascript/#transitions 896 * ======================================================================== 897 * Copyright 2011-2016 Twitter, Inc. 898 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 899 * ======================================================================== */ 900 901 902+function ($) { 903 'use strict'; 904
905 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 906 // ============================================================ 907 908 function transitionEnd() { 909 var el = document.createElement('bootstrap') 910 911 var transEndEventNames = { 912 WebkitTransition : 'webkitTransitionEnd', 913 MozTransition : 'transitionend', 914 OTransition : 'oTransitionEnd otransitionend', 915 transition : 'transitionend' 916 } 917 918 for (var name in transEndEventNames) { 919 if (el.style[name] !== undefined) { 920 return { end: transEndEventNames[name] } 921 } 922 } 923 924 return false // explicit for ie8 ( ._.) 925 } 926 927 // http://blog.alexmaccaw.com/css-transitions 928 $.fn.emulateTransitionEnd = function (duration) { 929 var called = false 930 var $el = this 931 $(this).one('bsTransitionEnd', function () { called = true }) 932 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 933 setTimeout(callback, duration) 934 return this 935 } 936 937 $(function () { 938 $.support.transition = transitionEnd() 939 940 if (!$.support.transition) return 941 942 $.event.special.bsTransitionEnd = { 943 bindType: $.support.transition.end, 944 delegateType: $.support.transition.end, 945 handle: function (e) { 946 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 947 } 948 } 949 }) 950 951}(jQuery); 952 953/* 954 * jQuery Bootstrap Responsive Tabs v2.0.1 | Valeriu Timbuc - vtimbuc.com 955 * github.com/vtimbuc/bootstrap-responsive-tabs 956 * @license WTFPL http://www.wtfpl.net/about/ 957 */ 958 959;(function($) { 960 961 "use strict"; 962 963 var defaults = { 964 accordionOn: ['xs'] // xs, sm, md, lg 965 }; 966 967 $.fn.responsiveTabs = function (options) { 968 969 var config = $.extend({}, defaults, options), 970 accordion = ''; 971 972 $.each(config.accordionOn, function (index, value) { 973 accordion += ' accordion-' + value; 974 }); 975 976 return this.each(function () { 977 978 var $self = $(this), 979 $navTabs = $self.find('> li > a'), 980 $tabContent = $($navTabs.first().attr('href')).parent('.tab-content'), 981 $tabs = $tabContent.children('.tab-pane'); 982 983 // Wrap the tabs 984 $self.add($tabContent).wrapAll('<div class="responsive-tabs-container" />'); 985 986 var $container = $self.parent('.responsive-tabs-container'); 987 988 $container.addClass(accordion); 989 990 // Duplicate links for accordion 991 $navTabs.each(function (i) { 992 var $this = $(this), 993 id = $this.attr('href'), 994 active = '', 995 first = '', 996 last = ''; 997 998 // Add active class 999 if ($this.parent('li').hasClass('active')) { 1000 active = ' active'; 1001 } 1002 1003 // Add first class 1004 if (i === 0) { 1005 first = ' first'; 1006 } 1007 1008 // Add last class 1009 if (i === $navTabs.length - 1) { 1010 last = ' last'; 1011 } 1012 1013 $this.clone(false).addClass('accordion-link' + active + first + last).insertBefore(id); 1014 }); 1015 1016 var $accordionLinks = $tabContent.children('.accordion-link'); 1017 1018 // Tabs Click Event 1019 $navTabs.on('click', function (event) { 1020 event.preventDefault(); 1021 1022 var $this = $(this), 1023 $li = $this.parent('li'), 1024 $siblings = $li.siblings('li'), 1025 id = $this.attr('href'), 1026 $accordionLink = $tabContent.children('a[href="' + id + '"]'); 1027 1028 if (!$li.hasClass('active')) { 1029 $li.addClass('active'); 1030 $siblings.removeClass('active'); 1031 1032 $tabs.removeClass('active'); 1033 $(id).addClass('active'); 1034 1035 $accordionLinks.removeClass('active'); 1036 $accordionLink.addClass('active'); 1037 } 1038 }); 1039 1040 // Accordion Click Event 1041 $accordionLinks.on('click', function (event) { 1042 event.preventDefault(); 1043 1044 var $this = $(this), 1045 id = $this.attr('href'), 1046 $tabLink = $self.find('li > a[href="' + id + '"]').parent('li'); 1047 1048 if (!$this.hasClass('active')) { 1049 $accordionLinks.removeClass('active'); 1050 $this.addClass('active'); 1051 1052 $tabs.removeClass('active'); 1053 $(id).addClass('active'); 1054 1055 $navTabs.parent('li').removeClass('active'); 1056 $tabLink.addClass('active'); 1057 } 1058 }); 1059 1060 });
1061 1062 }; 1063 1064}(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.