From 6d5b5065176a9e46ce71ec5fc16ae4a079e9e636 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 21 Dec 2011 17:38:05 -0800 Subject: [PATCH 01/13] minor cleanups --- Makefile | 11 ++++++----- js/bootstrap-collapse.js | 4 ++-- js/bootstrap-transition.js | 2 ++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e5c083ae6f..1f38338f80 100644 --- a/Makefile +++ b/Makefile @@ -22,15 +22,16 @@ build: uglify: @@if test ! -z ${UGLIFY_JS}; then \ mkdir -p js/min; \ - uglifyjs -o js/min/bootstrap-accordion.js js/bootstrap-accordion.js;\ - uglifyjs -o js/min/bootstrap-alerts.js js/bootstrap-alerts.js;\ - uglifyjs -o js/min/bootstrap-buttons.js js/bootstrap-buttons.js;\ + uglifyjs -o js/min/bootstrap-alerts.js js/bootstrap-alert.js;\ + uglifyjs -o js/min/bootstrap-buttons.js js/bootstrap-button.js;\ + uglifyjs -o js/min/bootstrap-carousel.js js/bootstrap-carousel.js;\ + uglifyjs -o js/min/bootstrap-collapse.js js/bootstrap-collapse.js;\ uglifyjs -o js/min/bootstrap-dropdown.js js/bootstrap-dropdown.js;\ uglifyjs -o js/min/bootstrap-modal.js js/bootstrap-modal.js;\ uglifyjs -o js/min/bootstrap-popover.js js/bootstrap-popover.js;\ uglifyjs -o js/min/bootstrap-scrollspy.js js/bootstrap-scrollspy.js;\ - uglifyjs -o js/min/bootstrap-tabs.js js/bootstrap-tabs.js;\ - uglifyjs -o js/min/bootstrap-transitions.js js/bootstrap-transitions.js;\ + uglifyjs -o js/min/bootstrap-tabs.js js/bootstrap-tab.js;\ + uglifyjs -o js/min/bootstrap-transitions.js js/bootstrap-transition.js;\ uglifyjs -o js/min/bootstrap-twipsy.js js/bootstrap-twipsy.js;\ else \ echo "You must have the UGLIFYJS minifier installed in order to minify Bootstrap's js."; \ diff --git a/js/bootstrap-collapse.js b/js/bootstrap-collapse.js index 313c0abcab..9301c7309d 100644 --- a/js/bootstrap-collapse.js +++ b/js/bootstrap-collapse.js @@ -17,7 +17,7 @@ * limitations under the License. * ============================================================ */ -(function( $ ){ +!function( $ ){ "use strict" @@ -132,4 +132,4 @@ }) }) -})( window.jQuery ) \ No newline at end of file +}( window.jQuery ) \ No newline at end of file diff --git a/js/bootstrap-transition.js b/js/bootstrap-transition.js index 25f8b111f1..29fa1bdebc 100644 --- a/js/bootstrap-transition.js +++ b/js/bootstrap-transition.js @@ -19,6 +19,8 @@ $(function () { + "use strict" + /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) * ======================================================= */ From efacac0d6c812abffa8a84a48fa760f5f56c92f0 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Wed, 21 Dec 2011 18:42:43 -0800 Subject: [PATCH 02/13] clean up all the js across all the doc pages --- bootstrap.css | 2 +- docs/assets/js/application.js | 88 ++++++++++++++++++-------------- docs/base-css.html | 19 +------ docs/components.html | 89 +++++++++++++++----------------- docs/index.html | 37 ++------------ docs/javascript.html | 95 ++++++++++++++++------------------- docs/less.html | 20 +------- docs/scaffolding.html | 74 +++++++++------------------ docs/upgrading.html | 39 -------------- 9 files changed, 165 insertions(+), 298 deletions(-) diff --git a/bootstrap.css b/bootstrap.css index 612fe24bc7..6515b12b5f 100644 --- a/bootstrap.css +++ b/bootstrap.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: Wed Dec 21 13:29:41 PST 2011 + * Date: Wed Dec 21 18:41:55 PST 2011 */ html, body { margin: 0; diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index dd759bf8b2..c653233e6b 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -1,52 +1,64 @@ $(function(){ + // NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT + // IT'S ALL JUST JUNK FOR OUR DOCS! + // ++++++++++++++++++++++++++++++++++++++++++ + + // make code pretty + prettyPrint && prettyPrint() + // table sort example - // ================== - - $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } ) - + if ($.fn.tableSorter) { + $("#sortTableExample").tablesorter( { sortList: [[ 1, 0 ]] } ) + } // add on logic - // ============ - - $('.add-on :checkbox').click(function () { - if ($(this).attr('checked')) { - $(this).parents('.add-on').addClass('active') - } else { - $(this).parents('.add-on').removeClass('active') - } + $('.add-on :checkbox').on('click', function () { + var $this = $(this) + , method = $this.attr('checked') ? 'addClass' : 'removeClass' + $(this).parents('.add-on')[method]('active') }) - // Disable certain links in docs - // ============================= - // Please do not carry these styles over to your projects, it's merely here to prevent button clicks form taking you away from your spot on page + // Please do not carry these styles over to your projects + // it's merely here to prevent button clicks form taking you + // away from your spot on page!! - $('ul.tabs a, ul.pills a, .pagination a, .well .btn, .actions .btn, .alert-message .btn, a.close').click(function (e) { + $('[href^=#]').click(function (e) { e.preventDefault() }) // Copy code blocks in docs - $(".copy-code").focus(function () { - var el = this; - // push select to event loop for chrome :{o - setTimeout(function () { $(el).select(); }, 1); - }); - - - // POSITION STATIC TWIPSIES - // ======================== - - $(window).on('load resize', function () { - $(".twipsies a").each(function () { - $(this) - .twipsy({ - live: false - , placement: $(this).attr('title') - , trigger: 'manual' - , offset: 2 - }) - .twipsy('show') - }) + $(".copy-code").on('focus', function () { + var el = this + setTimeout(function () { $(el).select() }, 0) }) -}); + + if ($.fn.twipsy) { + + // position static twipsies for components page + if ($(".twipsies a").length) { + $(window).on('load resize', function () { + $(".twipsies a").each(function () { + $(this) + .twipsy({ + placement: $(this).attr('title') + , trigger: 'manual' + }) + .twipsy('show') + }) + }) + } + + // add tipsies to grid for scaffolding + if ($('#grid-system').length) { + + $('#grid-system').twipsy({ + selector: '.show-grid > div' + , title: function () { return $(this).width() + 'px' } + }) + + } + } + +}) \ No newline at end of file diff --git a/docs/base-css.html b/docs/base-css.html index 2098974027..6173a4de6e 100644 --- a/docs/base-css.html +++ b/docs/base-css.html @@ -1110,25 +1110,10 @@ - - - - - + + - - - - diff --git a/docs/components.html b/docs/components.html index 56e71b0f7f..4d2c608230 100644 --- a/docs/components.html +++ b/docs/components.html @@ -208,7 +208,7 @@

Navigation

Fixed navbar

-