diff --git a/bootstrap-1.3.0.css b/bootstrap-1.3.0.css index 0dfa456f9a..c9fc91c494 100644 --- a/bootstrap-1.3.0.css +++ b/bootstrap-1.3.0.css @@ -6,7 +6,7 @@ * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. - * Date: Thu Sep 8 10:45:51 PDT 2011 + * Date: Thu Sep 8 20:00:20 PDT 2011 */ /* Reset.less * Props to Eric Meyer (meyerweb.com) for his CSS reset file. We're using an adapted version here that cuts out some of the reset HTML elements we will never need here (i.e., dfn, samp, etc). @@ -1579,6 +1579,12 @@ a.menu:after, .dropdown-toggle:after { color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); } +.tab-content > *, .pill-content > * { + display: none; +} +.tab-content > .active, .pill-content > .active { + display: block; +} .breadcrumb { margin: 0 0 18px; padding: 7px 14px; diff --git a/bootstrap-1.3.0.min.css b/bootstrap-1.3.0.min.css index 428ccdc6e2..1ff776c04f 100644 --- a/bootstrap-1.3.0.min.css +++ b/bootstrap-1.3.0.min.css @@ -226,6 +226,8 @@ a.menu:after,.dropdown-toggle:after{width:0;height:0;display:inline-block;conten .tabs li.open a.menu:after,.tabs .dropdown.open .dropdown-toggle:after{border-top-color:#555;} .pills a{margin:5px 3px 5px 0;padding:0 15px;text-shadow:0 1px 1px #fff;line-height:30px;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}.pills a:hover{background:#0050a3;color:#fff;text-decoration:none;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);} .pills .active a{background:#0069d6;color:#fff;text-shadow:0 1px 1px rgba(0, 0, 0, 0.25);} +.tab-content>*,.pill-content>*{display:none;} +.tab-content>.active,.pill-content>.active{display:block;} .breadcrumb{margin:0 0 18px;padding:7px 14px;background-color:#f5f5f5;background-repeat:repeat-x;background-image:-khtml-gradient(linear, left top, left bottom, from(#ffffff), to(#f5f5f5));background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline;text-shadow:0 1px 0 #fff;} .breadcrumb .divider{padding:0 5px;color:#bfbfbf;} .breadcrumb .active a{color:#404040;} diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index dd62bcb9e2..b8ac95c426 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -222,6 +222,7 @@ div.topbar-wrapper div.topbar .topbar-inner { position: relative; height: 40px; margin: 5px 0 15px; + z-index: 1; } #bootstrap-js div.topbar-wrapper div.topbar { diff --git a/docs/assets/js/application-scrollspy.js b/docs/assets/js/application-scrollspy.js new file mode 100644 index 0000000000..1f0b7cebe2 --- /dev/null +++ b/docs/assets/js/application-scrollspy.js @@ -0,0 +1,39 @@ +// scroll spy logic +// ================ +$(function () { + + var activeTarget, + position = {}, + $window = $(window), + nav = $('body > .topbar li a'), + targets = nav.map(function () { + return $(this).attr('href'); + }), + offsets = $.map(targets, function (id) { + return $(id).offset().top; + }); + + function setButton(id) { + nav.parent("li").removeClass('active'); + $(nav[$.inArray(id, targets)]).parent("li").addClass('active'); + } + + function processScroll(e) { + var scrollTop = $window.scrollTop() + 10, i; + for (i = offsets.length; i--;) { + if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) { + activeTarget = targets[i]; + setButton(activeTarget); + } + } + } + + nav.click(function () { + processScroll(); + }); + + processScroll(); + + $window.scroll(processScroll); + +}) \ No newline at end of file diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index ec4ae3c06e..4753293980 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,96 +1,46 @@ $(document).ready(function(){ - // Google code prettify - // ==================== - - prettyPrint(); - - - // scroll spy logic - // ================ - - var activeTarget, - position = {}, - $window = $(window), - nav = $('body > .topbar li a'), - targets = nav.map(function () { - return $(this).attr('href'); - }), - offsets = $.map(targets, function (id) { - return $(id).offset().top; - }); - - function setButton(id) { - nav.parent("li").removeClass('active'); - $(nav[$.inArray(id, targets)]).parent("li").addClass('active'); - } - - function processScroll(e) { - var scrollTop = $window.scrollTop() + 10, i; - for (i = offsets.length; i--;) { - if (activeTarget != targets[i] && scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) { - activeTarget = targets[i]; - setButton(activeTarget); - } - } - } - - nav.click(function () { - processScroll(); - }); - - processScroll(); - - $window.scroll(processScroll); - - // Dropdown example for topbar nav // =============================== - $("body").bind("click", function (e) { - $('.dropdown-toggle, .menu').parent("li").removeClass("open"); - }); - $(".dropdown-toggle, .menu").click(function (e) { - var $li = $(this).parent("li").toggleClass('open'); - return false; - }); + $(".topbar").dropdown() // catch any dropdowns on the page // table sort example // ================== - $("#sortTableExample").tablesorter( {sortList: [[1,0]]} ); + $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } ) // add on logic // ============ - $('.add-on :checkbox').click(function() { + $('.add-on :checkbox').click(function () { if ($(this).attr('checked')) { - $(this).parents('.add-on').addClass('active'); + $(this).parents('.add-on').addClass('active') } else { - $(this).parents('.add-on').removeClass('active'); + $(this).parents('.add-on').removeClass('active') } - }); + }) // Disable certain links in docs // ============================= - $('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function(e) { - e.preventDefault(); - }); + $('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function (e) { + e.preventDefault() + }) // Copy code blocks in docs - $(".copy-code").focus(function() { + $(".copy-code").focus(function () { var el = this; // push select to event loop for chrome :{o setTimeout(function () { $(el).select(); }, 1); }); - // POSITION TWIPSIES - // ================= + // POSITION STATIC TWIPSIES + // ======================== $('.twipsies.well a').each(function () { var type = this.title @@ -128,7 +78,6 @@ $(document).ready(function(){ } $twipsy.css(offset[type]) - }); }); diff --git a/docs/assets/js/bootstrap-dropdown.js b/docs/assets/js/bootstrap-dropdown.js index 9fbeb44b09..fe73e79944 100644 --- a/docs/assets/js/bootstrap-dropdown.js +++ b/docs/assets/js/bootstrap-dropdown.js @@ -3,8 +3,10 @@ /* DROPDOWN PLUGIN DEFINITION * ========================== */ + var selector = 'a.menu, .dropdown-toggle' + function clearMenus() { - $('a.menu').parent('li').removeClass('open') + $(selector).parent('li').removeClass('open') } $(function () { @@ -13,7 +15,7 @@ $.fn.dropdown = function ( options ) { return this.each(function () { - $(this).delegate('a.menu', 'click', function (e) { + $(this).delegate(selector, 'click', function (e) { clearMenus() $(this).parent('li').toggleClass('open') return false diff --git a/docs/assets/js/bootstrap-scrollspy.js b/docs/assets/js/bootstrap-scrollspy.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/assets/js/bootstrap-tabs.js b/docs/assets/js/bootstrap-tabs.js index 55fdc7e08d..21386f4cf3 100644 --- a/docs/assets/js/bootstrap-tabs.js +++ b/docs/assets/js/bootstrap-tabs.js @@ -2,33 +2,36 @@ function activate ( element, container ) { container.find('.active').removeClass('active') - element.addClass('active') + element.addClass('active') } function tab( e ) { - debugger - var $this = $(this) - , href = $this.attr('href') + var $this = $(this) + , href = $this.attr('href') + , $ul = $(e.liveFired) + , $controlled - if (/^#/.test(href)) { - e.preventDefault() + if (/^#/.test(href)) { + e.preventDefault() if ($this.hasClass('active')) { return } - activate($this, $ul) - activate($(href), $content) - } + $controlled = $('#' + $ul.attr('aria-controls')) + + activate($this.parent('li'), $ul) + activate($(href, $controlled), $controlled) + } } - /* TABS PLUGIN DEFINITION - * ====================== */ + /* TABS/PILLS PLUGIN DEFINITION + * ============================ */ - $.fn.tabs = function ( content ) { + $.fn.tabs = $.fn.pills = function () { return this.each(function () { - $(this).delegate('> li > a', 'click', tab) + $(this).delegate('.tabs > li > a, .pills > li > a', 'click', tab) }) } diff --git a/docs/index.html b/docs/index.html index 7acafd6c9a..ab9820f4d4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -20,7 +20,10 @@ + + + @@ -1356,6 +1359,10 @@ Lorem ipsum dolar sit amet illo error ipsum verita
This plugin is for adding simple dynamic tab functionality.
- Download +This plugin adds quick, dynamic tab and pill functionality.
+ Download$('#topbar').dropdown()+
$('.tabs').tabs()
- Activates menus for given topbar navigation. + Activates tab and pill functionality for a given container. +
+
+ Note: The controlled container is defined by a required aria-controls
attribute added to your .tabs
or .pills
. The aria-controls attribute must reference an element's id.
+
+<ul class="tabs" aria-controls="my-pill-content"> + <li class="active"><a href="#home">Home</a></li> + <li><a href="#profile">Profile</a></li> + <li><a href="#messages">Messages</a></li> + <li><a href="#settings">Settings</a></li> +</ul> + +<div class="pill-content" id="my-pill-content"> + <div class="active" id="home">...</div> + <div id="profile">...</div> + <div id="messages">...</div> + <div id="settings">...</div> +</ul>