From 721e7b85d750de950f4762a8c1cf6a26113eb373 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sun, 20 Nov 2011 21:42:52 -0800 Subject: [PATCH] add minified source to min dir in js + add uglify to make process --- Makefile | 19 ++++++++++++++++++- bootstrap.css | 2 +- js/min/bootstrap-alerts.min.js | 18 ++++++++++++++++++ js/min/bootstrap-buttons.min.js | 18 ++++++++++++++++++ js/min/bootstrap-dropdown.min.js | 18 ++++++++++++++++++ js/min/bootstrap-modal.min.js | 18 ++++++++++++++++++ js/min/bootstrap-popover.min.js | 18 ++++++++++++++++++ js/min/bootstrap-scrollspy.min.js | 18 ++++++++++++++++++ js/min/bootstrap-tabs.min.js | 18 ++++++++++++++++++ js/min/bootstrap-twipsy.min.js | 19 +++++++++++++++++++ 10 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 js/min/bootstrap-alerts.min.js create mode 100644 js/min/bootstrap-buttons.min.js create mode 100644 js/min/bootstrap-dropdown.min.js create mode 100644 js/min/bootstrap-modal.min.js create mode 100644 js/min/bootstrap-popover.min.js create mode 100644 js/min/bootstrap-scrollspy.min.js create mode 100644 js/min/bootstrap-tabs.min.js create mode 100644 js/min/bootstrap-twipsy.min.js diff --git a/Makefile b/Makefile index 16177554ea..940a4388d3 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,10 @@ BOOTSTRAP = ./bootstrap.css BOOTSTRAP_MIN = ./bootstrap.min.css BOOTSTRAP_LESS = ./lib/bootstrap.less LESS_COMPRESSOR ?= `which lessc` +UGLIFY_JS ?= `which uglifyjs` WATCHR ?= `which watchr` -build: +build: uglify @@if test ! -z ${LESS_COMPRESSOR}; then \ sed -e 's/@VERSION/'"v${VERSION}"'/' -e 's/@DATE/'"${DATE}"'/' <${BOOTSTRAP_LESS} >${BOOTSTRAP_LESS}.tmp; \ lessc ${BOOTSTRAP_LESS}.tmp > ${BOOTSTRAP}; \ @@ -18,6 +19,22 @@ build: echo "You can install it by running: npm install less -g"; \ fi +uglify: + @@if test ! -z ${UGLIFY_JS}; then \ + mkdir -p js/min; \ + uglifyjs -o js/min/bootstrap-alerts.min.js js/bootstrap-alerts.js;\ + uglifyjs -o js/min/bootstrap-buttons.min.js js/bootstrap-buttons.js;\ + uglifyjs -o js/min/bootstrap-dropdown.min.js js/bootstrap-dropdown.js;\ + uglifyjs -o js/min/bootstrap-modal.min.js js/bootstrap-modal.js;\ + uglifyjs -o js/min/bootstrap-popover.min.js js/bootstrap-popover.js;\ + uglifyjs -o js/min/bootstrap-scrollspy.min.js js/bootstrap-scrollspy.js;\ + uglifyjs -o js/min/bootstrap-tabs.min.js js/bootstrap-tabs.js;\ + uglifyjs -o js/min/bootstrap-twipsy.min.js js/bootstrap-twipsy.js;\ + else \ + echo "You must have the UGLIFYJS minifier installed in order to minify Bootstrap's js."; \ + echo "You can install it by running: npm install uglify-js -g"; \ + fi + watch: @@if test ! -z ${WATCHR}; then \ echo "Watching less files..."; \ diff --git a/bootstrap.css b/bootstrap.css index e9f2a38228..e5aa166089 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 Nov 16 00:28:10 PST 2011 + * Date: Sun Nov 20 21:42:29 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). diff --git a/js/min/bootstrap-alerts.min.js b/js/min/bootstrap-alerts.min.js new file mode 100644 index 0000000000..cc81a52400 --- /dev/null +++ b/js/min/bootstrap-alerts.min.js @@ -0,0 +1,18 @@ +/* ========================================================== + * 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(a){"use strict";var b;a(document).ready(function(){a.support.transition=function(){var a=document.body||document.documentElement,b=a.style,c=b.transition!==undefined||b.WebkitTransition!==undefined||b.MozTransition!==undefined||b.MsTransition!==undefined||b.OTransition!==undefined;return c}(),a.support.transition&&(b="TransitionEnd",a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"))});var c=function(b,c){if(c=="close")return this.close.call(b);this.settings=a.extend({},a.fn.alert.defaults,c),this.$element=a(b).delegate(this.settings.selector,"click",this.close)};c.prototype={close:function(c){function f(){d.remove()}var d=a(this),e="alert-message";d=d.hasClass(e)?d:d.parent(),c&&c.preventDefault(),d.removeClass("in"),a.support.transition&&d.hasClass("fade")?d.bind(b,f):f()}},a.fn.alert=function(b){return b===!0?this.data("alert"):this.each(function(){var d=a(this),e;if(typeof b=="string"){e=d.data("alert");if(typeof e=="object")return e[b].call(d)}a(this).data("alert",new c(this,b))})},a.fn.alert.defaults={selector:".close"},a(document).ready(function(){new c(a("body"),{selector:".alert-message[data-alert] .close"})})}(window.jQuery||window.ender); \ No newline at end of file diff --git a/js/min/bootstrap-buttons.min.js b/js/min/bootstrap-buttons.min.js new file mode 100644 index 0000000000..a9655d901a --- /dev/null +++ b/js/min/bootstrap-buttons.min.js @@ -0,0 +1,18 @@ +/* ============================================================ + * bootstrap-buttons.js v1.4.0 + * http://twitter.github.com/bootstrap/javascript.html#buttons + * ============================================================ + * 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(a){function b(b,c){var d="disabled",e=a(b),f=e.data();c+="Text",f.resetText||e.data("resetText",e.html()),e.html(f[c]||a.fn.button.defaults[c]),c=="loadingText"?e.addClass(d).attr(d,d):e.removeClass(d).removeAttr(d)}function c(b){a(b).toggleClass("active")}"use strict",a.fn.button=function(a){return this.each(function(){if(a=="toggle")return c(this);a&&b(this,a)})},a.fn.button.defaults={loadingText:"loading..."},a(function(){a("body").delegate(".btn[data-toggle]","click",function(){a(this).button("toggle")})})}(window.jQuery||window.ender); \ No newline at end of file diff --git a/js/min/bootstrap-dropdown.min.js b/js/min/bootstrap-dropdown.min.js new file mode 100644 index 0000000000..774c6a6460 --- /dev/null +++ b/js/min/bootstrap-dropdown.min.js @@ -0,0 +1,18 @@ +/* ============================================================ + * 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(a){function c(){a(b).parent("li").removeClass("open")}"use strict",a.fn.dropdown=function(e){return this.each(function(){a(this).delegate(e||b,"click",function(b){var d=a(this).parent("li"),e=d.hasClass("open");return c(),!e&&d.toggleClass("open"),!1})})};var b="a.menu, .dropdown-toggle";a(function(){a("html").bind("click",c),a("body").dropdown("[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle")})}(window.jQuery||window.ender); \ No newline at end of file diff --git a/js/min/bootstrap-modal.min.js b/js/min/bootstrap-modal.min.js new file mode 100644 index 0000000000..9c19e03b0c --- /dev/null +++ b/js/min/bootstrap-modal.min.js @@ -0,0 +1,18 @@ +/* ========================================================= + * 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(a){function d(){var a=this,c=setTimeout(function(){a.$element.unbind(b),e.call(a)},500);this.$element.one(b,function(){clearTimeout(c),e.call(a)})}function e(a){this.$element.hide().trigger("hidden"),f.call(this)}function f(c){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.settings.backdrop){var f=a.support.transition&&e;this.$backdrop=a('