Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rake file build system with rego-js-builder gem

  • Loading branch information...
commit 31891dbd4c459c23c81986bdd884b02ccff09828 1 parent 1c58a58
@alextk authored
View
89 Makefile
@@ -1,89 +0,0 @@
-SRC_DIR = src
-BUILD_DIR = build
-
-PREFIX = .
-DIST_DIR = ${PREFIX}/dist
-
-JS_FILES = license.txt\
- ${SRC_DIR}/jquery.progress-bar.js
-
-JS = ${DIST_DIR}/jquery.progress-bar.js
-JS_MIN = ${DIST_DIR}/jquery.progress-bar.min.js
-JS_PACK = ${DIST_DIR}/jquery.progress-bar.pack.js
-
-JS_ENGINE ?= `which node nodejs`
-COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
-MINIFIER = java -Xmx96m -jar ${BUILD_DIR}/yuicompressor.jar
-PACKER = java -jar ${BUILD_DIR}/rhino.jar ${BUILD_DIR}/packer.js
-JSDOC = /c/devl/js/tools/jsdoc-toolkit-2.4.0
-ANT_HOME = /c/devl/java/tools/apache-ant-1.7.0/bin/ant
-JGROUSE_DOC = /c/devl/js/tools/jGrouseDoc-2.1
-
-
-VERSION = `cat version.txt`
-DATE = `git log --pretty=format:'%ad' -1`
-
-all: clean js css hint min pack doc
- @@echo "done"
-
-doc:
- @@echo "Creating documentation using jsdoc-toolkit...."
-# java -Djsdoc=${JSDOC} -jar ${JSDOC}/jsrun.jar ${JSDOC}/app/run.js -t=${JSDOC}/templates/jsdoc -r -a -d=./dist/docs ./src/
- ${ANT_HOME} -Dbasedir=. -DjGrouseHome=${JGROUSE_DOC} -DoutputDir=${DIST_DIR}/docs -DinputDir=${SRC_DIR} -f ${JGROUSE_DOC}/build.xml
-
-build/create_dist:
- @@mkdir -p ${DIST_DIR}
- @@mkdir -p ${DIST_DIR}/css
-
-#join all files into one, add version and licence to the head of the file
-js: build/create_dist
- @@echo "Building" ${JS}
-# join all files into one | replace @Date variable with date command eval | replace @VERSION variable with version number
- @@cat ${JS_FILES} | sed 's/@DATE/'"${DATE}"'/' | sed s/@VERSION/${VERSION}/ > ${JS}
-
-css: build/create_dist
- @@echo "Building" ${JS} " css files"
- sass --update ${SRC_DIR}/sass:dist/css
- cp -R ${SRC_DIR}/sass/images dist/css
-
-#run JSLint checks on the joined file (using node.js)
-lint: js
- @@if test ! -z ${JS_ENGINE}; then \
- echo "Checking jQuery against JSLint..."; \
- ${JS_ENGINE} $(BUILD_DIR)/jslint-check.js ${JS} ; \
- else \
- echo "You must have NodeJS installed in order to test JS against JSLint."; \
- fi
-
-#run JSHint checks on the joined file (using node.js)
-hint: js
- @@if test ! -z ${JS_ENGINE}; then \
- echo "Checking jQuery against JSHint..."; \
- ${JS_ENGINE} $(BUILD_DIR)/jshint-check.js ${JS} ; \
- else \
- echo "You must have NodeJS installed in order to test JS against JSHint."; \
- fi
-
-#run node.js with uglify script that compresses the js, remove all comments. add copyright notice to the head of the file (head -12)
-min: js
- @@if test ! -z ${JS_ENGINE}; then \
- echo "Building" ${JS_MIN}; \
- head -12 ${JS} > ${JS_MIN}; \
- ${COMPILER} ${JS} > ${JS_MIN}.tmp; \
- sed '$ s#^\( \*/\)\(.\+\)#\1\n\2;#' ${JS_MIN}.tmp >> ${JS_MIN}; \
- rm -rf $(JS_MIN).tmp; \
- else \
- echo "You must have NodeJS installed in order to minify JS."; \
- fi
-
-#run rhino server and pack minified js file into even smaller size. add copyright notice at the start (head -12)
-pack: min
- @@echo "Building" ${JS_PACK}
-
- @@head -12 ${JS} > ${JS_PACK}
- @@${PACKER} ${JS_MIN} ${JS_PACK}.tmp
- @@cat ${JS_PACK}.tmp >> ${JS_PACK} && rm ${JS_PACK}.tmp
-
-clean:
- @@echo "Removing distribution directory:" ${DIST_DIR}
- @@rm -rf ${DIST_DIR}
View
50 README.md
@@ -5,20 +5,19 @@ Usage
---------------------
See wiki on github: https://github.com/alextk/progressBar/wiki
-Pre-compiled scripts
---------------------
-If you're not interested in compiling your own version of progressBar, you can grab the pre-compiled scripts from the
-[dist](https://github.com/alextk/progressBar/tree/master/dist/) directory and get started quickly. Otherwise, take a look below.
-
-
What you need to build progressBar
----------------------------
-In order to build progressBar, you need to have GNU make 3.8 or later, Node.js 0.2 or later, and git 1.7 or later.
+In order to build progressBar, you need to ruby 1.8.7, Node.js 0.2 or later, and git 1.7 or later.
(Earlier versions might work OK, but are not tested.)
-Windows users have two options:
+`rego-js-builder` gem installed:
+
+ gem install rego-js-builder
+
+
+Windows users:
-1. Install [msysgit](https://code.google.com/p/msysgit/) (Full installer for official Git),
+ Install [msysgit](https://code.google.com/p/msysgit/) (Full installer for official Git),
[GNU make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm).
Next you gonna need to build node js exe file and then copy it into mingw/bin folder. To build node js follow this guide:
(https://github.com/joyent/node/wiki/Building-node.js-on-mingw). To install c++/g++ compilers run:
@@ -27,41 +26,10 @@ Windows users have two options:
To install phyton, simply download it from link on the guide, and add it to PATH variable.
-How to build progressBar
-------------------
-First, clone a copy of the main progressBar git repo by running `git clone git@github.com:alextk/progressBar.git`.
-
-Then, in the main directory of the distribution (the one that this file is in), type
-the following to build progressBar:
-
- make
-
-You can also create each individually using these commands:
-
- make js # Build non-minified progressBar source
- make css # Generate css from sass and copy images into dist folder
- make min # Build minified JS and CSS
- make pack # Build minified and packed progressBar JS (smallest filesize!)
-
-To generate documentation using jGrouseDoc-2.1 (will create docs folder inside dist folder) run:
-
- make doc
-
-To build and test the source code against JSLint type this:
-
- make lint
-
-Finally, you can remove all the built files using the command:
-
- make clean
-
-
Building to a different directory
---------------------------------
-If you want to build progressBar to a directory that is different from the default location, you can specify the PREFIX
-directory: `make PREFIX=/home/alex/jqext/ [command]`
+If you want to build jqLog to a directory that is different from the default location, you need to edit the Rakefile.
-With this example, the output files would end up in `/home/craig/qtip/dist/`.
Special thanks
--------------
View
16 Rakefile
@@ -0,0 +1,16 @@
+require 'rubygems'
+gem 'rego-ruby-ext'
+require "rego-ruby-ext"
+gem 'rego-js-builder'
+require "rego-js-builder"
+gem 'rake-hooks'
+require 'rake/hooks'
+
+project = JsProjectBuilder.new(
+ :name => 'progressBar',
+ :description => 'jQuery plugin for progress bar ui widget',
+ :file_name => 'jquery.progress-bar.js',
+ :js_files => %w{progress-bar.js},
+ :sass => true
+)
+JsProjectBuilder::Tasks.new(project)
View
42 build/jslint-check.js
@@ -1,42 +0,0 @@
-var JSLINT = require("./lib/jslint").JSLINT,
- print = require("sys").print;
-
-if(process.argv.length < 3){
- print("Missing 3rd parameter to file path to run checks on");
- process.exit(1);
-}
-
-var src = require("fs").readFileSync(process.argv[2], "utf8");
-
-JSLINT(src, { evil: true, eqeq: true, forin: true, maxerr: 100, 'continue': true });
-
-// All of the following are known issues that we think are 'ok'
-// (in contradiction with JSLint) more information here:
-// http://docs.jquery.com/JQuery_Core_Style_Guidelines
-var ok = {
- "Expected an identifier and instead saw 'undefined' (a reserved word).": true,
- "Expected a conditional expression and instead saw an assignment.": true,
- "Insecure '.'.": true,
- "Insecure '^'.": true,
- 'Missing "use strict" statement.': true
-};
-
-var e = JSLINT.errors, found = 0, w;
-
-for ( var i = 0; i < e.length; i++ ) {
- w = e[i];
-
- if ( !ok[ w.reason ] ) {
- found++;
- print( "\n" + w.evidence + "\n" );
- print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
- }
-}
-
-if ( found > 0 ) {
- print( "\n" + found + " Error(s) found.\n" );
-
-} else {
- print( "JSLint check passed.\n" );
-}
-
View
5,504 build/lib/jslint.js
0 additions, 5,504 deletions not shown
View
14 build/license.tpl.txt
@@ -0,0 +1,14 @@
+/*
+* %{project_name} - %{project_description}
+*
+* Version: %{project_version}
+* Build: %{build_number}
+* Copyright 2011 Alex Tkachev
+*
+* Dual licensed under MIT or GPLv2 licenses
+* http://en.wikipedia.org/wiki/MIT_License
+* http://en.wikipedia.org/wiki/GNU_General_Public_License
+*
+* Date: %{date}
+*/
+
View
0  build/jshint-check.js → build/tools/jshint-check.js
File renamed without changes
View
0  build/lib/jshint.js → build/tools/lib/jshint.js
File renamed without changes
View
0  build/lib/parse-js.js → build/tools/lib/parse-js.js
File renamed without changes
View
0  build/lib/process.js → build/tools/lib/process.js
File renamed without changes
View
0  build/lib/squeeze-more.js → build/tools/lib/squeeze-more.js
File renamed without changes
View
0  build/packer.js → build/tools/packer.js
File renamed without changes
View
0  build/rhino.jar → build/tools/rhino.jar
File renamed without changes
View
0  build/uglify.js → build/tools/uglify.js
File renamed without changes
View
0  build/yuicompressor.jar → build/tools/yuicompressor.jar
File renamed without changes
View
7 dist/css/jquery.progress-bar.css
@@ -15,7 +15,6 @@ div.progress-bar-container {
-moz-box-shadow: 1px 1px 2px #888888;
background-color: #aaaaaa;
width: 10px;
- float: left;
background-repeat: repeat-x;
background-position: top left; }
div.progress-bar-container div.percent {
@@ -23,8 +22,9 @@ div.progress-bar-container {
top: 0px;
font-size: 11px;
padding: 0px 5px;
- font-style: italic;
- font-weight: normal; }
+ font-weight: bold;
+ color: black;
+ font-family: Arial, serif; }
div.progress-bar-container.red div.bar {
background-image: url(images/bg_fill_red.png); }
div.progress-bar-container.orange div.bar {
@@ -32,6 +32,5 @@ div.progress-bar-container {
div.progress-bar-container.green div.bar {
background-image: url(images/bg_fill_green.png); }
div.progress-bar-container.rtl div.bar {
- float: right;
-webkit-box-shadow: -1px 1px 2px #888888;
-moz-box-shadow: -1px 1px 2px #888888; }
View
28 dist/jquery.progress-bar.js
@@ -1,14 +1,15 @@
/*
-* progressBar - jQuery framework extensions
+* progressBar - jQuery plugin for progress bar ui widget
*
-* Version: 0.0.1a
+* Version: 0.0.1
+* Build: 26
* Copyright 2011 Alex Tkachev
*
* Dual licensed under MIT or GPLv2 licenses
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
-* Date: Tue Jul 5 18:13:50 2011 +0300
+* Date: 13 Dec 2011 21:41:37
*/
(function($) {
@@ -53,7 +54,7 @@
syncUI: function() {
var percent = Math.round(this.value() / this.total() * 100);
- if (jQuery.isNaN(percent)) {
+ if (!jQuery.isNumeric(percent)) {
percent = 0;
}
//move bar
@@ -83,7 +84,7 @@
'<div class="progress-bar-container">' +
'<div class="bar"/>' +
'<div class="percent"/>' +
- '</div>'
+ '</div>'
);
target.html(el);
return el;
@@ -115,18 +116,19 @@
return this.each(function() {
var target = $(this);
if ($.type(options) === "object") {
- target.data('api', new ProgressBarClass(target, $.extend({}, $.progressBar.defaults, options || {})));
+ target.data('api', new ProgressBarClass(target, $.extend({}, $.fn.progressBar.defaults, options || {})));
}
});
}
};
- $.progressBar = {
- defaults: {
- start: 0,
- total: 100,
- cssRange: {0: 'red', 30: 'orange', 75: 'green'}
- }
+ $.fn.progressBar.defaults = {
+ start: 0,
+ total: 100,
+ cssRange: {0: 'red', 30: 'orange', 75: 'green'}
};
-})(jQuery);
+ //in jquery 1.7 isNumeric is added, but prior 1.7 isNaN method present
+ if($().jquery < "1.7") $.isNumeric = function(){ return !$.isNaN.apply($, arguments); };
+
+})(jQuery);
View
10 dist/jquery.progress-bar.min.js
@@ -1,13 +1,15 @@
/*
-* progressBar - jQuery framework extensions
+* progressBar - jQuery plugin for progress bar ui widget
*
-* Version: 0.0.1a
+* Version: 0.0.1
+* Build: 26
* Copyright 2011 Alex Tkachev
*
* Dual licensed under MIT or GPLv2 licenses
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
-* Date: Tue Jul 5 18:13:50 2011 +0300
+* Date: 13 Dec 2011 21:41:37
*/
-(function(a){function d(a){var b=[];for(var c in a)b.push({from:parseInt(c,10),css:a[c]});b.sort(function(a,b){a=a.from,b=b.from;return a<b?-1:a===b?0:1});for(var d=1;d<b.length;d++){var e=b[d-1];e.to=b[d].from-1}b[b.length-1].to=100;return b}function c(b){var c=a('<div class="progress-bar-container"><div class="bar"/><div class="percent"/></div>');b.html(c);return c}var b=function(){this.initialize.apply(this,arguments)};a.extend(b.prototype,{initialize:function(a,b){this.rtl=a.css("direction")=="rtl",this.el=c(a).toggleClass("rtl",this.rtl),this.cssRange=d(b.cssRange),this._total=b.total,this._value=b.start,this.syncUI()},value:function(a){var b=this._value;if(arguments.length===0)return b;this._value=a%(this._total+1),this.syncUI();return this},total:function(a){var b=this._total;if(arguments.length===0)return b;this._total=a,this.value(this.value());return this},syncUI:function(){var b=Math.round(this.value()/this.total()*100);jQuery.isNaN(b)&&(b=0);var c=this.el.height(),d=this.el.width(),e=Math.round(b/100*d);a(".bar",this.el).width(e).height(c);var f=a(".percent",this.el);f.html(b+"%").height(c).css({"line-height":c+"px"});var g=e-f.outerWidth(!0);g<0&&(g=0),f.css(this.rtl?{right:g+"px"}:{left:g+"px"});for(var h=0;h<this.cssRange.length;h++){var i=this.cssRange[h];this.el.toggleClass(i.css,i.to>=b&&i.from<=b)}}}),a.fn.progressBar=function(c){return c=="api"?this.data("api"):this.each(function(){var d=a(this);a.type(c)==="object"&&d.data("api",new b(d,a.extend({},a.progressBar.defaults,c||{})))})},a.progressBar={defaults:{start:0,total:100,cssRange:{0:"red",30:"orange",75:"green"}}}})(jQuery)
+
+(function(a){function d(a){var b=[];for(var c in a)b.push({from:parseInt(c,10),css:a[c]});b.sort(function(a,b){a=a.from,b=b.from;return a<b?-1:a===b?0:1});for(var d=1;d<b.length;d++){var e=b[d-1];e.to=b[d].from-1}b[b.length-1].to=100;return b}function c(b){var c=a('<div class="progress-bar-container"><div class="bar"/><div class="percent"/></div>');b.html(c);return c}var b=function(){this.initialize.apply(this,arguments)};a.extend(b.prototype,{initialize:function(a,b){this.rtl=a.css("direction")=="rtl",this.el=c(a).toggleClass("rtl",this.rtl),this.cssRange=d(b.cssRange),this._total=b.total,this._value=b.start,this.syncUI()},value:function(a){var b=this._value;if(arguments.length===0)return b;this._value=a%(this._total+1),this.syncUI();return this},total:function(a){var b=this._total;if(arguments.length===0)return b;this._total=a,this.value(this.value());return this},syncUI:function(){var b=Math.round(this.value()/this.total()*100);jQuery.isNumeric(b)||(b=0);var c=this.el.height(),d=this.el.width(),e=Math.round(b/100*d);a(".bar",this.el).width(e).height(c);var f=a(".percent",this.el);f.html(b+"%").height(c).css({"line-height":c+"px"});var g=e-f.outerWidth(!0);g<0&&(g=0),f.css(this.rtl?{right:g+"px"}:{left:g+"px"});for(var h=0;h<this.cssRange.length;h++){var i=this.cssRange[h];this.el.toggleClass(i.css,i.to>=b&&i.from<=b)}}}),a.fn.progressBar=function(c){return c=="api"?this.data("api"):this.each(function(){var d=a(this);a.type(c)==="object"&&d.data("api",new b(d,a.extend({},a.fn.progressBar.defaults,c||{})))})},a.fn.progressBar.defaults={start:0,total:100,cssRange:{0:"red",30:"orange",75:"green"}},a().jquery<"1.7"&&(a.isNumeric=function(){return!a.isNaN.apply(a,arguments)})})(jQuery)
View
10 dist/jquery.progress-bar.pack.js
@@ -1,13 +1,15 @@
/*
-* progressBar - jQuery framework extensions
+* progressBar - jQuery plugin for progress bar ui widget
*
-* Version: 0.0.1a
+* Version: 0.0.1
+* Build: 26
* Copyright 2011 Alex Tkachev
*
* Dual licensed under MIT or GPLv2 licenses
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
-* Date: Tue Jul 5 18:13:50 2011 +0300
+* Date: 13 Dec 2011 21:41:37
*/
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(4(a){4 d(a){3 b=[];y(3 c 17 a)b.14({8:15(c,10),7:a[c]});b.12(4(a,b){a=a.8,b=b.8;5 a<b?-1:a===b?0:1});y(3 d=1;d<b.9;d++){3 e=b[d-1];e.v=b[d].8-1}b[b.9-1].v=n;5 b}4 c(b){3 c=a(\'<p z="18-u-19"><p z="u"/><p z="E"/></p>\');b.F(c);5 c}3 b=4(){2.M.1a(2,t)};a.N(b.1b,{M:4(a,b){2.j=a.7("O")=="j",2.6=c(a).L("j",2.j),2.k=d(b.k),2.o=b.m,2.r=b.I,2.s()},q:4(a){3 b=2.r;B(t.9===0)5 b;2.r=a%(2.o+1),2.s();5 2},m:4(a){3 b=2.o;B(t.9===0)5 b;2.o=a,2.q(2.q());5 2},s:4(){3 b=K.C(2.q()/2.m()*n);D.R(b)&&(b=0);3 c=2.6.l(),d=2.6.H(),e=K.C(b/n*d);a(".u",2.6).H(e).l(c);3 f=a(".E",2.6);f.F(b+"%").l(c).7({"T-l":c+"x"});3 g=e-f.W(!0);g<0&&(g=0),f.7(2.j?{Y:g+"x"}:{Z:g+"x"});y(3 h=0;h<2.k.9;h++){3 i=2.k[h];2.6.L(i.7,i.v>=b&&i.8<=b)}}}),a.P.w=4(c){5 c=="A"?2.J("A"):2.S(4(){3 d=a(2);a.V(c)==="X"&&d.J("A",13 b(d,a.N({},a.w.G,c||{})))})},a.w={G:{I:0,m:n,k:{0:"U",11:"1c",Q:"16"}}}})(D)',62,75,'||this|var|function|return|el|css|from|length||||||||||rtl|cssRange|height|total|100|_total|div|value|_value|syncUI|arguments|bar|to|progressBar|px|for|class|api|if|round|jQuery|percent|html|defaults|width|start|data|Math|toggleClass|initialize|extend|direction|fn|75|isNaN|each|line|red|type|outerWidth|object|right|left||30|sort|new|push|parseInt|green|in|progress|container|apply|prototype|orange'.split('|'),0,{}))
+
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(4(a){4 d(a){3 b=[];x(3 c 14 a)b.15({9:16(c,10),8:a[c]});b.17(4(a,b){a=a.9,b=b.9;5 a<b?-1:a===b?0:1});x(3 d=1;d<b.k;d++){3 e=b[d-1];e.u=b[d].9-1}b[b.k-1].u=s;5 b}4 c(b){3 c=a(\'<n B="18-y-19"><n B="y"/><n B="M"/></n>\');b.G(c);5 c}3 b=4(){2.F.Q(2,m)};a.R(b.1b,{F:4(a,b){2.j=a.8("1c")=="j",2.6=c(a).J("j",2.j),2.l=d(b.l),2.r=b.p,2.C=b.I,2.z()},q:4(a){3 b=2.C;P(m.k===0)5 b;2.C=a%(2.r+1),2.z();5 2},p:4(a){3 b=2.r;P(m.k===0)5 b;2.r=a,2.q(2.q());5 2},z:4(){3 b=L.E(2.q()/2.p()*s);O.N(b)||(b=0);3 c=2.6.o(),d=2.6.K(),e=L.E(b/s*d);a(".y",2.6).K(e).o(c);3 f=a(".M",2.6);f.G(b+"%").o(c).8({"V-o":c+"w"});3 g=e-f.W(!0);g<0&&(g=0),f.8(2.j?{Z:g+"w"}:{11:g+"w"});x(3 h=0;h<2.l.k;h++){3 i=2.l[h];2.6.J(i.8,i.u>=b&&i.9<=b)}}}),a.v.t=4(c){5 c=="A"?2.D("A"):2.1a(4(){3 d=a(2);a.1d(c)==="1e"&&d.D("A",T b(d,a.R({},a.v.t.H,c||{})))})},a.v.t.H={I:0,p:s,l:{0:"1f",S:"U",X:"Y"}},a().12<"1.7"&&(a.N=4(){5!a.13.Q(a,m)})})(O)',62,78,'||this|var|function|return|el||css|from||||||||||rtl|length|cssRange|arguments|div|height|total|value|_total|100|progressBar|to|fn|px|for|bar|syncUI|api|class|_value|data|round|initialize|html|defaults|start|toggleClass|width|Math|percent|isNumeric|jQuery|if|apply|extend|30|new|orange|line|outerWidth|75|green|right||left|jquery|isNaN|in|push|parseInt|sort|progress|container|each|prototype|direction|type|object|red'.split('|'),0,{}))
View
7 license.txt
@@ -1,13 +1,14 @@
/*
-* progressBar - jQuery framework extensions
+* progressBar - jQuery plugin for progress bar ui widget
*
-* Version: @VERSION
+* Version: 0.0.1
+* Build: 26
* Copyright 2011 Alex Tkachev
*
* Dual licensed under MIT or GPLv2 licenses
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
-* Date: @DATE
+* Date: 13 Dec 2011 21:41:37
*/
View
19 src/jquery.progress-bar.js → src/progress-bar.js
@@ -40,7 +40,7 @@
syncUI: function() {
var percent = Math.round(this.value() / this.total() * 100);
- if (jQuery.isNaN(percent)) {
+ if (!jQuery.isNumeric(percent)) {
percent = 0;
}
//move bar
@@ -70,7 +70,7 @@
'<div class="progress-bar-container">' +
'<div class="bar"/>' +
'<div class="percent"/>' +
- '</div>'
+ '</div>'
);
target.html(el);
return el;
@@ -102,18 +102,19 @@
return this.each(function() {
var target = $(this);
if ($.type(options) === "object") {
- target.data('api', new ProgressBarClass(target, $.extend({}, $.progressBar.defaults, options || {})));
+ target.data('api', new ProgressBarClass(target, $.extend({}, $.fn.progressBar.defaults, options || {})));
}
});
}
};
- $.progressBar = {
- defaults: {
- start: 0,
- total: 100,
- cssRange: {0: 'red', 30: 'orange', 75: 'green'}
- }
+ $.fn.progressBar.defaults = {
+ start: 0,
+ total: 100,
+ cssRange: {0: 'red', 30: 'orange', 75: 'green'}
};
+ //in jquery 1.7 isNumeric is added, but prior 1.7 isNaN method present
+ if($().jquery < "1.7") $.isNumeric = function(){ return !$.isNaN.apply($, arguments); };
+
})(jQuery);
View
9 src/sass/jquery.progress-bar.sass
@@ -21,7 +21,6 @@ div.progress-bar-container
@include shadow(1px 1px 2px #888)
background-color: #aaa
width: 10px
- float: left
background-repeat: repeat-x
background-position: top left
@@ -31,8 +30,10 @@ div.progress-bar-container
top: 0px
font-size: 11px
padding: 0px 5px
- font-style: italic
- font-weight: normal
+ //font-style: italic
+ font-weight: bold
+ color: #000
+ font-family: Arial, serif
&.red
div.bar
@@ -48,5 +49,5 @@ div.progress-bar-container
&.rtl
div.bar
- float: right
+ //float: right
@include shadow(-1px 1px 2px #888)
View
1  version.txt
@@ -1 +0,0 @@
-0.0.1a
View
4 version.yml
@@ -0,0 +1,4 @@
+---
+built_at: Tue 12 Dec 2011 21:41:37
+build_number: 26
+version: 0.0.1
Please sign in to comment.
Something went wrong with that request. Please try again.