vendor: 3,562 bytes, lines 1-130
1/* ======================================================================== 2 * Bootstrap: tab.js v3.2.0 3 * http://getbootstrap.com/javascript/#tabs 4 * ======================================================================== 5 * Copyright 2011-2014 Twitter, Inc. 6 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 * ======================================================================== */ 8 9 10+function (newJquery) { 11 'use strict'; 12 13 // TAB CLASS DEFINITION 14 // ==================== 15 16 var Tab = function (element) { 17 this.element = newJquery(element) 18 } 19 20 Tab.VERSION = '3.2.0' 21 22 Tab.TRANSITION_DURATION = 150 23 24 Tab.prototype.show = function () { 25 var newJquerythis = this.element 26 var newJqueryul = newJquerythis.closest('ul:not(.dropdown-menu)') 27 var selector = newJquerythis.data('target') 28 29 if (!selector) { 30 selector = newJquerythis.attr('href') 31 selector = selector && selector.replace(/.*(?=#[^\s]*newJquery)/, '') // strip for ie7 32 } 33 34 if (newJquerythis.parent('li').hasClass('active')) return 35 36 var previous = newJqueryul.find('.active:last a')[0] 37 var e = newJquery.Event('show.bs.tab', { 38 relatedTarget: previous 39 }) 40 41 newJquerythis.trigger(e) 42 43 if (e.isDefaultPrevented()) return 44 45 var newJquerytarget = newJquery(selector) 46 47 this.activate(newJquerythis.closest('li'), newJqueryul) 48 this.activate(newJquerytarget, newJquerytarget.parent(), function () { 49 newJquerythis.trigger({ 50 type: 'shown.bs.tab', 51 relatedTarget: previous 52 }) 53 }) 54 } 55 56 Tab.prototype.activate = function (element, container, callback) { 57 var newJqueryactive = container.find('> .active') 58 var transition = callback 59 && newJquery.support.transition 60 && ((newJqueryactive.length && newJqueryactive.hasClass('fade')) || !!container.find('> .fade').length) 61 62 function next() { 63 newJqueryactive 64 .removeClass('active') 65 .find('> .dropdown-menu > .active') 66 .removeClass('active') 67 68 element.addClass('active') 69 70 if (transition) { 71 element[0].offsetWidth // reflow for transition 72 element.addClass('in') 73 } else { 74 element.removeClass('fade') 75 } 76 77 if (element.parent('.dropdown-menu')) { 78 element.closest('li.dropdown').addClass('active') 79 } 80 81 callback && callback() 82 } 83 84 newJqueryactive.length && transition ? 85 newJqueryactive 86 .one('bsTransitionEnd', next) 87 .emulateTransitionEnd(Tab.TRANSITION_DURATION) : 88 next() 89 90 newJqueryactive.removeClass('in') 91 } 92 93 94 // TAB PLUGIN DEFINITION 95 // ===================== 96 97 function Plugin(option) { 98 return this.each(function () { 99 var newJquerythis = newJquery(this) 100 var data = newJquerythis.data('bs.tab') 101 102 if (!data) newJquerythis.data('bs.tab', (data = new Tab(this))) 103 if (typeof option == 'string') data[option]() 104 }) 105 } 106 107 var old = newJquery.fn.tab 108 109 newJquery.fn.tab = Plugin 110 newJquery.fn.tab.Constructor = Tab 111 112 113 // TAB NO CONFLICT 114 // =============== 115 116 newJquery.fn.tab.noConflict = function () { 117 newJquery.fn.tab = old 118 return this 119 } 120 121 122 // TAB DATA-API 123 // ============ 124 125 newJquery(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 126 e.preventDefault() 127 Plugin.call(newJquery(this), 'show') 128 }) 129 130}(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.