diff --git a/Makefile b/Makefile index b3dce89ac4..294f0ed72e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=1.2.0 +VERSION=2.0.0 DATE=$(shell DATE) BOOTSTRAP = ./bootstrap.css BOOTSTRAP_MIN = ./bootstrap.min.css diff --git a/bootstrap.css b/bootstrap.css index e17c454d5c..d6cc76b6d8 100644 --- a/bootstrap.css +++ b/bootstrap.css @@ -1,12 +1,12 @@ /*! - * Bootstrap v1.2.0 + * Bootstrap v2.0.0 * * Copyright 2011 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. - * Date: Sun Nov 20 18:13:58 PST 2011 + * Date: Sun Nov 20 20:05:48 PST 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). @@ -2269,11 +2269,11 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { visibility: visible; padding: 5px; font-size: 11px; - filter: alpha(opacity=80); - -moz-opacity: 0.8; - opacity: 0.8; + filter: alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; } -.twipsy.fade.in { +.twipsy.in { filter: alpha(opacity=80); -moz-opacity: 0.8; opacity: 0.8; diff --git a/bootstrap.min.css b/bootstrap.min.css index e0584b480f..69441b76e7 100644 --- a/bootstrap.min.css +++ b/bootstrap.min.css @@ -329,7 +329,7 @@ button.btn::-moz-focus-inner,input[type=submit].btn::-moz-focus-inner{padding:0; .modal-footer{padding:14px 15px 15px;margin-bottom:0;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;zoom:1;}.modal-footer:before,.modal-footer:after{display:table;*display:inline;content:"";zoom:1;} .modal-footer:after{clear:both;} .modal-footer .btn{float:right;margin-left:5px;} -.twipsy{position:absolute;z-index:1000;display:block;visibility:visible;padding:5px;font-size:11px;filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;}.twipsy.fade.in{filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;} +.twipsy{position:absolute;z-index:1000;display:block;visibility:visible;padding:5px;font-size:11px;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;}.twipsy.in{filter:alpha(opacity=80);-moz-opacity:0.8;opacity:0.8;} .twipsy.above .twipsy-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} .twipsy.left .twipsy-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} .twipsy.below .twipsy-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index b503c23e43..cde8ff1e0d 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -304,6 +304,13 @@ body > .navbar-fixed .brand:hover { margin-left: 10px; } +/* scrollspy docs */ + +.scrollspy-example { + overflow: auto; + height: 200px; + position: relative; +} /* Popover docs -------------------------------------------------- */ diff --git a/docs/base-css.html b/docs/base-css.html index aa4a2ebfc0..11346b5b02 100644 --- a/docs/base-css.html +++ b/docs/base-css.html @@ -37,7 +37,7 @@
  • Scaffolding
  • Base CSS
  • Components
  • -
  • Javascript
  • +
  • Javascript plugins
  • Using LESS
  • diff --git a/docs/javascript.html b/docs/javascript.html index a962e043c8..c9709d35fb 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -22,6 +22,40 @@ + + + + + + + + + + + + + + + + + @@ -44,26 +78,6 @@ - -
    @@ -105,7 +119,7 @@ The alert plugin is a super tiny class for adding close functionality to alerts. - bootstrap-dropdown.js + bootstrap-dropdown.js This plugin is for adding dropdown interaction to the bootstrap navbar or tabbed navigations. @@ -164,35 +178,35 @@ backdrop boolean - false + true Includes a modal-backdrop element keyboard boolean - false + true Closes the modal when escape key is pressed show boolean - false + true Opens modal on class initialization

    Markup

    -

    You can activate modals on your page easily without having to write a single line of javascript. Just give an element a data-controls-modal attribute which corresponds to a modal element id, and when clicked, it will launch your modal. To add modal options, just include them as data attributes as well.

    +

    You can activate modals on your page easily without having to write a single line of javascript. Just give an element a data-controls-modal attribute which corresponds to a modal element id, and when clicked, it will launch your modal. To add modal options, just include them as data attributes.

     <a class="btn" data-controls-modal="my-modal" data-backdrop="true" >Launch Modal</a>
     
    -

    Notice If you want your modal to animate in and out, just add a .fade class to your .modal element (refer to the demo to see this in action).

    +

    Notice If you want your modal to animate in and out, just add a .fade class to the .modal element (refer to the demo to see this in action).

    Methods

    .modal(options)

    Activates your content as a modal. Accepts an optional options object.

     $('#my-modal').modal({
    -  closeOnEscape: true
    +  keyboard: false
     })

    .modal('toggle')

    Manually toggles a modal.

    @@ -203,10 +217,6 @@ $('#my-modal').modal({

    .modal('hide')

    Manually hides a modal.

    $('#my-modal').modal('hide')
    -

    .modal(true)

    -

    Returns an elements modal class instance.

    -
    $('#my-modal').modal(true)
    -

    Notice Alternatively, this can be retrieved with $().data('modal').

    Events

    Bootstrap's modal class exposes a few events for hooking into modal functionality.

    @@ -255,7 +265,7 @@ $('#my-modal').bind('hidden', function () { Close - + @@ -275,14 +285,14 @@ $('#my-modal').bind('hidden', function () {

    Using boostrap-dropdown.js

    -
    $('#navbar').dropdown()
    +
    $('.dropdown-toggle').dropdown()

    Markup

    -

    To quickly add dropdown functionality to any nav element, use the data-dropdown attribute. Any valid bootstrap dropdown will automatically be activated.

    +

    To quickly add dropdown functionality to any element just add data-toggle="dropdown". Any valid bootstrap dropdown will automatically be activated.

     <ul class="tabs">
       <li class="active"><a href="#">Home</a></li>
    -  <li class="dropdown" data-dropdown="true" >
    -    <a href="#" class="dropdown-toggle">Dropdown</a>
    +  <li class="dropdown">
    +    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown</a>
         <ul class="dropdown-menu">
           <li><a href="#">Secondary link</a></li>
           <li><a href="#">Something else here</a></li>
    @@ -310,7 +320,7 @@ $('#my-modal').bind('hidden', function () {
                     
                     
    @@ -414,27 +463,59 @@ $('#my-modal').bind('hidden', function () { }) </script>

    +

    Events

    +
    + + + + + + + + + + + + +
    EventDescription
    changeThis event fires on tab change. Use event.target and event.relatedTarget to target the active tab and the previous active tab respectively.
    + +
    +$('.tabs a').bind('change', function (e) {
    +  e.target // activated tab
    +  e.relatedTarget // previous tab
    +})

    Demo

    -
    - -
    -
    -

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    -
    -
    -

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    -
    -
    -

    Banksy do proident, brooklyn photo booth delectus sunt artisan sed organic exercitation eiusmod four loko. Quis tattooed iphone esse aliqua. Master cleanse vero fixie mcsweeney's. Ethical portland aute, irony food truck pitchfork lomo eu anim. Aesthetic blog DIY, ethical beard leggings tofu consequat whatever cardigan nostrud. Helvetica you probably haven't heard of them carles, marfa veniam occaecat lomo before they sold out in shoreditch scenester sustainable thundercats. Consectetur tofu craft beer, mollit brunch fap echo park pitchfork mustache dolor.

    -
    -
    -

    Sunt qui biodiesel mollit officia, fanny pack put a bird on it thundercats seitan squid ad wolf bicycle rights blog. Et aute readymade farm-to-table carles 8-bit, nesciunt nulla etsy adipisicing organic ea. Master cleanse mollit high life, next level Austin nesciunt american apparel twee mustache adipisicing reprehenderit hoodie portland irony. Aliqua tofu quinoa +1 commodo eiusmod. High life williamsburg cupidatat twee homo leggings. Four loko vinyl DIY consectetur nisi, marfa retro keffiyeh vegan. Fanny pack viral retro consectetur gentrify fap.

    -
    + +
    +
    +

    Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

    +
    +
    +

    Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.

    +
    +
    +

    Banksy do proident, brooklyn photo booth delectus sunt artisan sed organic exercitation eiusmod four loko. Quis tattooed iphone esse aliqua. Master cleanse vero fixie mcsweeney's. Ethical portland aute, irony food truck pitchfork lomo eu anim. Aesthetic blog DIY, ethical beard leggings tofu consequat whatever cardigan nostrud. Helvetica you probably haven't heard of them carles, marfa veniam occaecat lomo before they sold out in shoreditch scenester sustainable thundercats. Consectetur tofu craft beer, mollit brunch fap echo park pitchfork mustache dolor.

    +
    +
    +

    Sunt qui biodiesel mollit officia, fanny pack put a bird on it thundercats seitan squid ad wolf bicycle rights blog. Et aute readymade farm-to-table carles 8-bit, nesciunt nulla etsy adipisicing organic ea. Master cleanse mollit high life, next level Austin nesciunt american apparel twee mustache adipisicing reprehenderit hoodie portland irony. Aliqua tofu quinoa +1 commodo eiusmod. High life williamsburg cupidatat twee homo leggings. Four loko vinyl DIY consectetur nisi, marfa retro keffiyeh vegan. Fanny pack viral retro consectetur gentrify fap.

    +
    + +
    @@ -473,36 +554,12 @@ $('#my-modal').bind('hidden', function () { true apply a css fade transition to the tooltip - - delayIn - number - 0 - delay before showing tooltip (ms) - - - delayOut - number - 0 - delay before hiding tooltip (ms) - - - fallback - string - '' - text to use when no tooltip title is present - placement string 'above' how to position the tooltip - above | below | left | right - - html - boolean - false - allows html content within tooltip - live boolean @@ -515,20 +572,28 @@ $('#my-modal').bind('hidden', function () { 0 pixel offset of tooltip from target element - - title - string | function - 'title' - attribute or method for retrieving title text - trigger string 'hover' how tooltip is triggered - hover | focus | manual + + delay + number | object + 0 + +

    delay showing/hiding the tooltip (ms)

    +

    If a number is supplied, delay is applied to both hide/show

    +

    Object structure is: delay: { show: 500, hide: 100 }

    + + +

    Notice Individual twipsy instance options can alternatively be specified through the use of data attributes.

    +

    Markup

    +

    Twipsy's should contain a title tag which will be use to fill the tip content.

    +

    <a href="#" rel='twipsy' title='twipsy text'>@fat</a>

    Methods

    $().twipsy(options)

    Attaches a twipsy handler to an element collection.

    @@ -538,22 +603,11 @@ $('#my-modal').bind('hidden', function () {

    .twipsy('hide')

    Hides an elements twipsy.

    $('#element').twipsy('hide')
    -

    .twipsy(true)

    -

    Returns an elements twipsy class instance.

    -
    $('#element').twipsy(true)
    -

    Notice Alternatively, this can be retrieved with $().data('twipsy').

    Demo

    Tight pants next level keffiyeh you probably haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel have a terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan whatever keytar, scenester farm-to-table banksy Austin twitter handle freegan cred raw denim single-origin coffee viral.

    -
    @@ -591,34 +645,16 @@ $('#my-modal').bind('hidden', function () { apply a css fade transition to the tooltip - delayIn - number + delay + number | object 0 - delay before showing tooltip (ms) - - - delayOut - number - 0 - delay before hiding tooltip (ms) - - - fallback - string - '' - text to use when no tooltip title is present + delay before showing/hiding the tooltip (ms) placement string 'right' - how to position the tooltip - above | below | left | right - - - html - boolean - false - allows html content within tooltip + how to position the popover - above | below | left | right live @@ -632,18 +668,6 @@ $('#my-modal').bind('hidden', function () { 0 pixel offset of tooltip from target element - - title - string | function - 'title' - attribute or method for retrieving title text - - - content - string | function - 'data-content' - attribute or method for retrieving content text - trigger string @@ -652,6 +676,12 @@ $('#my-modal').bind('hidden', function () { +

    Notice Individual popover instance options can alternatively be specified through the use of data attributes.

    +

    Markup

    +

    Popover's should contain a title tag and a data-content attribute.

    +

    <a href="#" class="btn" rel="popover" title="A Title" data-content="Some content">
    +  hover for popover
    +</a>

    Methods

    $().popover(options)

    Initializes popovers for an element collection.

    @@ -663,17 +693,6 @@ $('#my-modal').bind('hidden', function () {
    $('#element').popover('hide')

    Demo

    hover for popover - @@ -695,7 +714,8 @@ $('#my-modal').bind('hidden', function () {

    Using bootstrap-alerts.js

    $(".alert-message").alert()

    Markup

    -

    Just add a data-alert attribute to your alert messages to automatically give them close functionality.

    +

    Just add data-dismiss="alert" to your close button to automatically give an alert close functionality.

    +
    <a class="close" data-dismiss="alert" href="#">&times;</a>

    Methods

    $().alert()

    Wraps all alerts with close functionality. To have your alerts animate out when closed, make sure they have the .fade and .in class already applied to them.

    @@ -703,12 +723,12 @@ $('#my-modal').bind('hidden', function () {

    Closes an alert.

    $(".alert-message").alert('close')

    Demo

    -
    - × +
    + ×

    Holy guacamole! Best check yo self, you’re not looking too good.

    -
    - × +
    + ×

    Oh snap! You got an error! Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

    Take this action Or do this @@ -729,17 +749,5 @@ $('#my-modal').bind('hidden', function () {

    - - - - - - - - - - - - diff --git a/js/bootstrap-alerts.js b/js/bootstrap-alerts.js index 3ef1672bc0..600440e40e 100644 --- a/js/bootstrap-alerts.js +++ b/js/bootstrap-alerts.js @@ -1,5 +1,5 @@ /* ========================================================== - * bootstrap-alerts.js v1.4.0 + * bootstrap-alerts.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== * Copyright 2011 Twitter, Inc. @@ -22,34 +22,6 @@ "use strict" - /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) - * ======================================================= */ - - var transitionEnd - - $(document).ready(function () { - - $.support.transition = (function () { - var thisBody = document.body || document.documentElement - , thisStyle = thisBody.style - , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined - return support - })() - - // set CSS transition event type - if ( $.support.transition ) { - transitionEnd = "TransitionEnd" - if ( $.browser.webkit ) { - transitionEnd = "webkitTransitionEnd" - } else if ( $.browser.mozilla ) { - transitionEnd = "transitionend" - } else if ( $.browser.opera ) { - transitionEnd = "oTransitionEnd" - } - } - - }) - /* ALERT CLASS DEFINITION * ====================== */ @@ -76,7 +48,7 @@ } $.support.transition && $element.hasClass('fade') ? - $element.bind(transitionEnd, removeElement) : + $element.bind($.support.transition.end, removeElement) : removeElement() } @@ -88,10 +60,6 @@ $.fn.alert = function ( options ) { - if ( options === true ) { - return this.data('alert') - } - return this.each(function () { var $this = $(this) , data @@ -112,13 +80,11 @@ } $.fn.alert.defaults = { - selector: '.close' + selector: '[data-dismiss="alert"]' } - $(document).ready(function () { - new Alert($('body'), { - selector: '.alert-message[data-alert] .close' - }) + $(function () { + new Alert( $('body') ) }) }( window.jQuery || window.ender ); \ No newline at end of file diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js index cab0ec27ed..bb7d11b1fa 100644 --- a/js/bootstrap-dropdown.js +++ b/js/bootstrap-dropdown.js @@ -1,5 +1,5 @@ /* ============================================================ - * bootstrap-dropdown.js v1.4.0 + * bootstrap-dropdown.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#dropdown * ============================================================ * Copyright 2011 Twitter, Inc. @@ -22,34 +22,45 @@ "use strict" + /* SIMPLE DROPDOWN LOGIC + * ===================== */ + + var s = '[data-toggle="dropdown"]' + + function clearMenus() { + $(s).parent('li').removeClass('open') + } + + function toggle(e) { + var li = $(this).parent('li') + , isActive = li.hasClass('open') + + clearMenus() + !isActive && li.toggleClass('open') + + return false + } + + /* DROPDOWN PLUGIN DEFINITION * ========================== */ $.fn.dropdown = function ( selector ) { return this.each(function () { - $(this).delegate(selector || d, 'click', function (e) { - var li = $(this).parent('li') - , isActive = li.hasClass('open') - - clearMenus() - !isActive && li.toggleClass('open') - return false - }) + var args = ['click', toggle] + , $this = $(this) + selector && args.unshift(selector) + $this[selector ? 'delegate' : 'bind'].apply($this, args) }) } + /* APPLY TO STANDARD DROPDOWN ELEMENTS * =================================== */ - var d = 'a.menu, .dropdown-toggle' - - function clearMenus() { - $(d).parent('li').removeClass('open') - } - $(function () { $('html').bind("click", clearMenus) - $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' ) + $('body').dropdown(s) }) }( window.jQuery || window.ender ); \ No newline at end of file diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index be2315afba..ccc7b133b2 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -22,35 +22,6 @@ "use strict" - /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) - * ======================================================= */ - - var transitionEnd - - $(document).ready(function () { - - $.support.transition = (function () { - var thisBody = document.body || document.documentElement - , thisStyle = thisBody.style - , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined - return support - })() - - // set CSS transition event type - if ( $.support.transition ) { - transitionEnd = "TransitionEnd" - if ( $.browser.webkit ) { - transitionEnd = "webkitTransitionEnd" - } else if ( $.browser.mozilla ) { - transitionEnd = "transitionend" - } else if ( $.browser.opera ) { - transitionEnd = "oTransitionEnd" - } - } - - }) - - /* MODAL PUBLIC CLASS DEFINITION * ============================= */ @@ -92,7 +63,7 @@ that.$element.addClass('in') transition ? - that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) : + that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : that.$element.trigger('shown') }) @@ -130,14 +101,13 @@ * ===================== */ function hideWithTransition() { - // firefox drops transitionEnd events :{o var that = this , timeout = setTimeout(function () { - that.$element.unbind(transitionEnd) + that.$element.unbind($.support.transition.end) hideModal.call(that) }, 500) - this.$element.one(transitionEnd, function () { + this.$element.one($.support.transition.end, function () { clearTimeout(timeout) hideModal.call(that) }) @@ -171,14 +141,14 @@ this.$backdrop.addClass('in') doAnimate ? - this.$backdrop.one(transitionEnd, callback) : + this.$backdrop.one($.support.transition.end, callback) : callback() } else if ( !this.isShown && this.$backdrop ) { this.$backdrop.removeClass('in') $.support.transition && this.$element.hasClass('fade')? - this.$backdrop.one(transitionEnd, $.proxy(removeBackdrop, this)) : + this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) : removeBackdrop.call(this) } else if ( callback ) { @@ -240,9 +210,9 @@ $.fn.modal.Modal = Modal $.fn.modal.defaults = { - backdrop: false - , keyboard: false - , show: false + backdrop: true + , keyboard: true + , show: true } @@ -252,7 +222,7 @@ $(document).ready(function () { $('body').delegate('[data-controls-modal]', 'click', function (e) { e.preventDefault() - var $this = $(this).data('show', true) + var $this = $(this) $('#' + $this.attr('data-controls-modal')).modal( $this.data() ) }) }) diff --git a/js/bootstrap-popover.js b/js/bootstrap-popover.js index c23741735b..d0bd831317 100644 --- a/js/bootstrap-popover.js +++ b/js/bootstrap-popover.js @@ -1,5 +1,5 @@ /* =========================================================== - * bootstrap-popover.js v1.4.0 + * bootstrap-popover.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#popover * =========================================================== * Copyright 2011 Twitter, Inc. @@ -36,8 +36,8 @@ setContent: function () { var $tip = this.tip() - $tip.find('.title')[this.options.html ? 'html' : 'text'](this.getTitle()) - $tip.find('.content > *')[this.options.html ? 'html' : 'text'](this.getContent()) + $tip.find('.title')['html'](this.getTitle()) + $tip.find('.content > *')['html'](this.getContent()) $tip[0].className = 'popover' } diff --git a/js/bootstrap-scrollspy.js b/js/bootstrap-scrollspy.js index 1269d91ecb..91c2dcb1ed 100644 --- a/js/bootstrap-scrollspy.js +++ b/js/bootstrap-scrollspy.js @@ -20,33 +20,34 @@ !function ( $ ) { - var $window = $(window) - function ScrollSpy() { var process = $.proxy(this.process, this) - this.$topbar = $('body') - this.selector = '[data-scrollspy] li > a' + this.selector = '.nav li > a' + + this.$body = $('body').delegate(this.selector, 'click', process) + this.$scrollElement = $('[data-spy="scroll"]').bind('scroll', process) + this.refresh() - this.$topbar.delegate(this.selector, 'click', process) - $window.scroll(process) this.process() } ScrollSpy.prototype = { refresh: function () { - this.targets = this.$topbar.find(this.selector).map(function () { - var href = $(this).attr('href') - return /^#\w/.test(href) && $(href).length ? href : null - }) + this.targets = this.$body + .find(this.selector) + .map(function () { + var href = $(this).attr('href') + return /^#\w/.test(href) && $(href).length ? href : null + }) this.offsets = $.map(this.targets, function (id) { - return $(id).offset().top + return $(id).position().top }) } , process: function () { - var scrollTop = $window.scrollTop() + 10 + var scrollTop = this.$scrollElement.scrollTop() + 10 , offsets = this.offsets , targets = this.targets , activeTarget = this.activeTarget @@ -65,11 +66,11 @@ this.activeTarget = target - this.$topbar + this.$body .find(this.selector).parent('.active') .removeClass('active') - active = this.$topbar + active = this.$body .find(this.selector + '[href="' + target + '"]') .parent('li') .addClass('active') @@ -82,8 +83,6 @@ } - $(function () { - new ScrollSpy() - }) + $(function () { new ScrollSpy() }) }( window.jQuery || window.ender ) \ No newline at end of file diff --git a/js/bootstrap-tabs.js b/js/bootstrap-tabs.js index 790180ca2e..35418fd447 100644 --- a/js/bootstrap-tabs.js +++ b/js/bootstrap-tabs.js @@ -1,5 +1,5 @@ /* ======================================================== - * bootstrap-tabs.js v1.4.0 + * bootstrap-tabs.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#tabs * ======================================================== * Copyright 2011 Twitter, Inc. diff --git a/js/bootstrap-transitions.js b/js/bootstrap-transitions.js index 49b5338a8f..25f8b111f1 100644 --- a/js/bootstrap-transitions.js +++ b/js/bootstrap-transitions.js @@ -38,7 +38,7 @@ $(function () { transitionEnd = "oTransitionEnd" } return transitionEnd - })() + }()) } })() diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js index fc22d0218b..19e43a7234 100644 --- a/js/bootstrap-twipsy.js +++ b/js/bootstrap-twipsy.js @@ -1,5 +1,5 @@ /* ========================================================== - * bootstrap-twipsy.js v1.4.0 + * bootstrap-twipsy.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#twipsy * Adapted from the original jQuery.tipsy by Jason Frame * ========================================================== @@ -18,40 +18,10 @@ * limitations under the License. * ========================================================== */ - !function( $ ) { "use strict" - /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) - * ======================================================= */ - - var transitionEnd - - $(document).ready(function () { - - $.support.transition = (function () { - var thisBody = document.body || document.documentElement - , thisStyle = thisBody.style - , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined - return support - })() - - // set CSS transition event type - if ( $.support.transition ) { - transitionEnd = "TransitionEnd" - if ( $.browser.webkit ) { - transitionEnd = "webkitTransitionEnd" - } else if ( $.browser.mozilla ) { - transitionEnd = "transitionend" - } else if ( $.browser.opera ) { - transitionEnd = "oTransitionEnd" - } - } - - }) - - /* TWIPSY PUBLIC CLASS DEFINITION * ============================== */ @@ -119,7 +89,7 @@ , setContent: function () { var $tip = this.tip() - $tip.find('.twipsy-inner')[this.options.html ? 'html' : 'text'](this.getTitle()) + $tip.find('.twipsy-inner').html(this.getTitle()) $tip[0].className = 'twipsy' } @@ -134,7 +104,7 @@ } $.support.transition && this.$tip.hasClass('fade') ? - $tip.bind(transitionEnd, removeElement) : + $tip.bind( $.support.transition.end, removeElement) : removeElement() } @@ -164,7 +134,7 @@ title = ('' + title).replace(/(^\s*|\s*$)/, "") - return title || o.fallback + return title } , tip: function() { @@ -219,18 +189,21 @@ , eventIn , eventOut - if (options === true) { - return this.data(name) - } else if (typeof options == 'string') { + if (typeof options == 'string') { twipsy = this.data(name) - if (twipsy) { - twipsy[options]() - } + if (twipsy) twipsy[options]() return this } options = $.extend({}, $.fn[name].defaults, options) + if (options.delay && typeof options.delay == 'number') { + options.delay = { + show: options.delay + , hide: options.delay + } + } + function get(ele) { var twipsy = $.data(ele, name) @@ -246,7 +219,7 @@ var twipsy = get(this) twipsy.hoverState = 'in' - if (options.delayIn == 0) { + if (!options.delay || !options.delay.show) { twipsy.show() } else { twipsy.fixTitle() @@ -254,21 +227,21 @@ if (twipsy.hoverState == 'in') { twipsy.show() } - }, options.delayIn) + }, options.delay.show) } } function leave() { var twipsy = get(this) twipsy.hoverState = 'out' - if (options.delayOut == 0) { + if (!options.delay || !options.delay.hide) { twipsy.hide() } else { setTimeout(function() { if (twipsy.hoverState == 'out') { twipsy.hide() } - }, options.delayOut) + }, options.delay.hide) } } @@ -292,15 +265,12 @@ $.fn.twipsy.defaults = { animate: true - , delayIn: 0 - , delayOut: 0 - , fallback: '' + , delay: 0 , placement: 'above' - , html: false , live: false , offset: 0 - , title: 'title' , trigger: 'hover' + , title: 'title' , template: '
    ' } diff --git a/lib/twipsy.less b/lib/twipsy.less index 4193eda5fb..3fa21fa012 100644 --- a/lib/twipsy.less +++ b/lib/twipsy.less @@ -8,8 +8,8 @@ visibility: visible; padding: 5px; font-size: 11px; - .opacity(80); - &.fade.in { + .opacity(0); + &.in { .opacity(80); } &.above .twipsy-arrow { #popoverArrow > .above(); }