diff --git a/1.4.0/bootstrap-alerts.js b/1.4.0/bootstrap-alerts.js new file mode 100644 index 00000000..37bb430a --- /dev/null +++ b/1.4.0/bootstrap-alerts.js @@ -0,0 +1,113 @@ +/* ========================================================== + * bootstrap-alerts.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2011 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * 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" + } + } + + }) + + /* ALERT CLASS DEFINITION + * ====================== */ + + var Alert = function ( content, options ) { + this.settings = $.extend({}, $.fn.alert.defaults, options) + this.$element = $(content) + .delegate(this.settings.selector, 'click', this.close) + } + + Alert.prototype = { + + close: function (e) { + var $element = $(this).parent('.alert-message') + + e && e.preventDefault() + $element.removeClass('in') + + function removeElement () { + $element.remove() + } + + $.support.transition && $element.hasClass('fade') ? + $element.bind(transitionEnd, removeElement) : + removeElement() + } + + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + $.fn.alert = function ( options ) { + + if ( options === true ) { + return this.data('alert') + } + + return this.each(function () { + var $this = $(this) + + if ( typeof options == 'string' ) { + return $this.data('alert')[options]() + } + + $(this).data('alert', new Alert( this, options )) + + }) + } + + $.fn.alert.defaults = { + selector: '.close' + } + + $(document).ready(function () { + new Alert($('body'), { + selector: '.alert-message[data-alert] .close' + }) + }) + +}( window.jQuery || window.ender ); \ No newline at end of file diff --git a/1.4.0/bootstrap-buttons.js b/1.4.0/bootstrap-buttons.js new file mode 100644 index 00000000..7639caeb --- /dev/null +++ b/1.4.0/bootstrap-buttons.js @@ -0,0 +1,62 @@ +/* ============================================================ + * bootstrap-dropdown.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#dropdown + * ============================================================ + * Copyright 2011 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + +!function( $ ){ + + "use strict" + + function setState(el, state) { + var d = 'disabled' + , $el = $(el) + , data = $el.data() + + state = state + 'Text' + data.resetText || $el.data('resetText', $el.html()) + + $el.html( data[state] || $.fn.button.defaults[state] ) + + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + } + + function toggle(el) { + $(el).toggleClass('active') + } + + $.fn.button = function(options) { + return this.each(function () { + if (options == 'toggle') { + return toggle(this) + } + options && setState(this, options) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $(function () { + $('body').delegate('.btn[data-toggle]', 'click', function () { + $(this).button('toggle') + }) + }) + +}( window.jQuery || window.ender ); \ No newline at end of file diff --git a/1.4.0/bootstrap-dropdown.js b/1.4.0/bootstrap-dropdown.js new file mode 100644 index 00000000..fda6da59 --- /dev/null +++ b/1.4.0/bootstrap-dropdown.js @@ -0,0 +1,55 @@ +/* ============================================================ + * bootstrap-dropdown.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#dropdown + * ============================================================ + * Copyright 2011 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function( $ ){ + + "use strict" + + /* 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 + }) + }) + } + + /* 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' ) + }) + +}( window.jQuery || window.ender ); diff --git a/1.4.0/bootstrap-modal.js b/1.4.0/bootstrap-modal.js new file mode 100644 index 00000000..b328217f --- /dev/null +++ b/1.4.0/bootstrap-modal.js @@ -0,0 +1,260 @@ +/* ========================================================= + * bootstrap-modal.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#modal + * ========================================================= + * Copyright 2011 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * 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" + } + } + + }) + + + /* MODAL PUBLIC CLASS DEFINITION + * ============================= */ + + var Modal = function ( content, options ) { + this.settings = $.extend({}, $.fn.modal.defaults, options) + this.$element = $(content) + .delegate('.close', 'click.modal', $.proxy(this.hide, this)) + + if ( this.settings.show ) { + this.show() + } + + return this + } + + Modal.prototype = { + + toggle: function () { + return this[!this.isShown ? 'show' : 'hide']() + } + + , show: function () { + var that = this + this.isShown = true + this.$element.trigger('show') + + escape.call(this) + backdrop.call(this, function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + that.$element + .appendTo(document.body) + .show() + + if (transition) { + that.$element[0].offsetWidth // force reflow + } + + that.$element.addClass('in') + + transition ? + that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) : + that.$element.trigger('shown') + + }) + + return this + } + + , hide: function (e) { + e && e.preventDefault() + + if ( !this.isShown ) { + return this + } + + var that = this + this.isShown = false + + escape.call(this) + + this.$element + .trigger('hide') + .removeClass('in') + + $.support.transition && this.$element.hasClass('fade') ? + hideWithTransition.call(this) : + hideModal.call(this) + + return this + } + + } + + + /* MODAL PRIVATE METHODS + * ===================== */ + + function hideWithTransition() { + // firefox drops transitionEnd events :{o + var that = this + , timeout = setTimeout(function () { + that.$element.unbind(transitionEnd) + hideModal.call(that) + }, 500) + + this.$element.one(transitionEnd, function () { + clearTimeout(timeout) + hideModal.call(that) + }) + } + + function hideModal (that) { + this.$element + .hide() + .trigger('hidden') + + backdrop.call(this) + } + + function backdrop ( callback ) { + var that = this + , animate = this.$element.hasClass('fade') ? 'fade' : '' + if ( this.isShown && this.settings.backdrop ) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $(' @@ -1366,6 +1453,8 @@

Great for sub-sections of content like our account settings pages and user timelines for toggling between pages of like content. Available in tabbed or pill styles.

+

Basic tabs example

+

Tabs can be used as regular navigation (loading external pages in the same tab) or as tabbable content areas for swapping out panes of content. We have a tabs plugin that can be used to integrate the latter.

@@ -1518,7 +1608,7 @@
 ================================================== -->
 
@@ -1531,19 +1621,19 @@
× -

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

+

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

× -

Oh snap! Change this and that and try again.

+

Oh snap! Change this and that and try again.

× -

Well done! You successfully read this alert message.

+

Well done! You successfully read this alert message.

× -

Heads up! This is an alert that needs your attention, but it’s not a huge priority just yet.

+

Heads up! This is an alert that needs your attention, but it’s not a huge priority just yet.

Example code

@@ -1573,7 +1663,7 @@
× -

Oh snap! You got an error! Change this and that and try again.

+

Oh snap! You got an error! Change this and that and try again.

  • Duis mollis est non commodo luctus
  • Nisi erat porttitor ligula
  • @@ -1706,43 +1796,47 @@ Lorem ipsum dolar sit amet illo error ipsum verita

    What's included

    Bring some of Bootstrap's primary components to life with new custom plugins that work with jQuery and Ender. We encourage you to extend and modify them to fit your specific development needs.

    - - - - - - - - - - - - - - - - - - - - - - - - - +
    FileDescription
    bootstrap-modal.jsOur Modal plugin is a super slim take on the traditional modal js plugin! We took special care to include only the bare functionality that we require at twitter.
    bootstrap-alerts.jsThe alert plugin is a super tiny class for adding close functionality to alerts.
    bootstrap-dropdown.jsThis plugin is for adding dropdown interaction to the bootstrap topbar or tabbed navigations.
    bootstrap-scrollspy.jsThe ScrollSpy plugin is for adding an auto updating nav based on scroll position to the bootstrap topbar.
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + +
    FileDescription
    bootstrap-modal.jsOur Modal plugin is a super slim take on the traditional modal js plugin! We took special care to include only the bare functionality that we require at twitter.
    bootstrap-alerts.jsThe alert plugin is a super tiny class for adding close functionality to alerts.
    bootstrap-dropdown.jsThis plugin is for adding dropdown interaction to the bootstrap topbar or tabbed navigations.
    bootstrap-scrollspy.jsThe ScrollSpy plugin is for adding an auto updating nav based on scroll position to the bootstrap topbar.
    bootstrap-buttons.jsThe ScrollSpy plugin is for adding an auto updating nav based on scroll position to the bootstrap topbar.
    bootstrap-tabs.jsThis plugin adds quick, dynamic tab and pill functionality for cycling through local content.
    bootstrap-twipsy.jsBased on the excellent jQuery.tipsy plugin written by Jason Frame; twipsy is an updated version, which doesn't rely on images, uses css3 for animations, and data-attributes for local title storage!
    bootstrap-popover.jsThe popover plugin provides a simple interface for adding popovers to your application. It extends the bootstrap-twipsy.js plugin, so be sure to grab that file as well when including popovers in your project!
    This plugin adds quick, dynamic tab and pill functionality for cycling through local content.
    bootstrap-twipsy.jsBased on the excellent jQuery.tipsy plugin written by Jason Frame; twipsy is an updated version, which doesn't rely on images, uses css3 for animations, and data-attributes for local title storage!
    bootstrap-popover.jsThe popover plugin provides a simple interface for adding popovers to your application. It extends the boostrap-twipsy.js plugin, so be sure to grab that file as well when including popovers in your project!

    Is javascript necessary?

    Nope! Bootstrap is designed first and foremost to be a CSS library. This javascript provides a basic interactive layer on top of the included styles.

    @@ -1865,7 +1959,7 @@ Lorem ipsum dolar sit amet illo error ipsum verita

    Compiling Less

    After modifying the .less files in /lib/, you'll need to recompile them in order to regenerate the bootstrap-*.*.*.css and bootstrap-*.*.*.min.css files. If you're submitting a pull request to GitHub, you must always recompile.

    Ways to compile

    - +
    @@ -1877,7 +1971,7 @@ Lorem ipsum dolar sit amet illo error ipsum verita @@ -1928,5 +2022,16 @@ Lorem ipsum dolar sit amet illo error ipsum verita + + + + + + + + + + + diff --git a/javascript.html b/javascript.html index 89d72264..171ae21a 100644 --- a/javascript.html +++ b/javascript.html @@ -15,24 +15,25 @@ - - - - - - - + + + + + + + + - + - - - - + + + + @@ -48,6 +49,7 @@
  • Modals
  • Dropdown
  • ScrollSpy
  • +
  • Buttons
  • Tabs
  • Twipsy
  • Popover
  • @@ -83,7 +85,7 @@

    Our Modal plugin is a super slim take on the traditional modal js plugin, taking special care to include only the bare functionality that we require here at twitter.

    - Download + Download

    Using bootstrap-modal

    @@ -195,7 +197,6 @@ $('#my-modal').bind('hidden', function () {
    -
    @@ -211,7 +212,7 @@ $('#my-modal').bind('hidden', function () {

    This plugin is for adding dropdown interaction to the bootstrap topbar or tabbed navigations.

    - Download + Download

    Using bootstrap-dropdown.js

    @@ -288,7 +289,7 @@ $('#my-modal').bind('hidden', function () {

    This plugin is for adding the scrollspy (auto updating nav) interaction to the bootstrap topbar.

    - Download + Download

    Using bootstrap-scrollspy.js

    @@ -313,6 +314,56 @@ $('#my-modal').bind('hidden', function () {
    + + +
    + +
    +
    +

    This plugin offers additional functionality for managing button state.

    + Download +
    +
    +

    Using bootstrap-buttons.js

    +
    $('.tabs').button()
    +

    Methods

    +

    $().button('toggle')

    +

    Toggles push state. Gives btn the look that it's been activated.

    +

    Notice You can enable auto toggling of a button by using the data-toggle attribute.

    +
    <button class="btn" data-toggle="toggle" >...</button>
    +

    $().button('loading')

    +

    Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element using the data attribute data-loading-text. +

    +
    <button class="btn" data-loading-text="loading stuff..." >...</button>
    +

    $().button('reset')

    +

    Resets button state - swaps text to original text.

    +

    $().button(string)

    +

    Resets button state - swaps text to any data defined text state.

    +
    <button class="btn" data-complete-text="finished!" >...</button>
    +<script>
    +  $('.btn').button('complete')
    +</scrip>
    +

    Demo

    + + + +
    +
    +
    + + @@ -323,7 +374,7 @@ $('#my-modal').bind('hidden', function () {

    This plugin adds quick, dynamic tab and pill functionality.

    - Download + Download

    Using bootstrap-tabs.js

    @@ -372,13 +423,14 @@ $('#my-modal').bind('hidden', function () {
    MethodNode with makefile

    Install the less command line compiler with npm by running the following command:

    -
    $ npm install less
    +
    $ npm install lessc

    Once installed just run make from the root of your bootstrap directory and you're all set.

    Additionally, if you have watchr installed, you may run make watch to have bootstrap automatically rebuilt every time you edit a file in the bootstrap lib (this isn't required, just a convenience method).

    +
     $('#.tabs').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.

      -
      +

      Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.

      -
      +

      Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. Lomo wolf viral, mustache readymade thundercats keffiyeh craft beer marfa ethical. Wolf salvia freegan, sartorial keffiyeh echo park vegan.

      @@ -425,7 +477,7 @@ $('#.tabs').bind('change', function (e) {

      Based on the excellent jQuery.tipsy plugin written by Jason Frame; twipsy is an updated version, which doesn't rely on images, uses css3 for animations, and data-attributes for title storage!

      - Download + Download

      Using bootstrap-twipsy.js

      @@ -501,8 +553,16 @@ $('#.tabs').bind('change', function (e) { 'hover' how tooltip is triggered - hover | focus | manual + + template + string + [default markup] + The html template used for rendering a twipsy. + +

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

      +
      <a href="#" data-placement="below" rel='twipsy' title='Some title text'>text</a>

      Methods

      $().twipsy(options)

      Attaches a twipsy handler to an element collection.

      @@ -543,7 +603,7 @@ $('#.tabs').bind('change', function (e) {

      The popover plugin provides a simple interface for adding popovers to your application. It extends the bootstrap-twipsy.js plugin, so be sure to grab that file as well when including popovers in your project!

      Notice You must include the bootstrap-twipsy.js file before bootstrap-popover.js.

      - Download + Download

      Using bootstrap-popover.js

      @@ -617,7 +677,7 @@ $('#.tabs').bind('change', function (e) { content string, function 'data-content' - attribute or method for retrieving content text + a string or method for retrieving content text. if none are provided, content will be sourced from a data-content attribute. trigger @@ -625,8 +685,16 @@ $('#.tabs').bind('change', function (e) { 'hover' how tooltip is triggered - hover | focus | manual + + template + string + [default markup] + The html template used for rendering a popover. + +

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

      +
      <a data-placement="below" href="#" class="btn danger" rel="popover">text</a>

      Methods

      $().popover(options)

      Initializes popovers for an element collection.

      @@ -637,7 +705,7 @@ $('#.tabs').bind('change', function (e) {

      Hides an elements popover.

      $('#element').popover('hide')

      Demo

      - hover for popover + hover for popover