Skip to content

Commit

Permalink
add minified source to min dir in js + add uglify to make process
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Nov 21, 2011
1 parent 18d2a87 commit 721e7b8
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 2 deletions.
19 changes: 18 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}; \
Expand All @@ -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..."; \
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
18 changes: 18 additions & 0 deletions js/min/bootstrap-alerts.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions js/min/bootstrap-buttons.min.js
Original file line number Diff line number Diff line change
@@ -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);
18 changes: 18 additions & 0 deletions js/min/bootstrap-dropdown.min.js
Original file line number Diff line number Diff line change
@@ -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);
18 changes: 18 additions & 0 deletions js/min/bootstrap-modal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions js/min/bootstrap-popover.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions js/min/bootstrap-scrollspy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions js/min/bootstrap-tabs.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* ========================================================
* bootstrap-tabs.js v1.4.0
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* 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(a,b){b.find("> .active").removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),a.addClass("active"),a.parent(".dropdown-menu")&&a.closest("li.dropdown").addClass("active")}function c(c){var d=a(this),e=d.closest("ul:not(.dropdown-menu)"),f=d.attr("href"),g,h;if(/^#\w+/.test(f)){c.preventDefault();if(d.parent("li").hasClass("active"))return;g=e.find(".active a").last()[0],h=a(f),b(d.parent("li"),e),b(h,h.parent()),d.trigger({type:"change",relatedTarget:g})}}"use strict",a.fn.tabs=a.fn.pills=function(b){return this.each(function(){a(this).delegate(b||".tabs li > a, .pills > li > a","click",c)})},a(document).ready(function(){a("body").tabs("ul[data-tabs] li > a, ul[data-pills] > li > a")})}(window.jQuery||window.ender);
Loading

0 comments on commit 721e7b8

Please sign in to comment.