add grunt.js, update color libraries

This commit is contained in:
Michael Deal 2012-11-21 02:11:19 -08:00
parent 0560bae4f5
commit 112fc7a688
3 changed files with 35 additions and 18 deletions

View file

@ -1,14 +0,0 @@
#!/bin/bash
mkdir -p build
OUT=build/MIDI.minimal.js
echo "//MIDI.js minimal Browserify wrapper" > $OUT
for file in js/DOMLoader.*.js js/Polyfill/Base64.js inc/base64binary.js js/MIDI.*.js
do
cat $file >> $OUT
echo "" >> $OUT
done
echo "if (typeof module !== 'undefined') module.exports = MIDI;" >> $OUT

22
grunt.js Normal file
View file

@ -0,0 +1,22 @@
/*
Build environment
----------------------------------------
1) Install NodeJS:
http://nodejs.org/
2) Install Grunt
npm install grunt
*/
module.exports = function (grunt) {
grunt.initConfig({
concat: {
'build/MIDI.js': "./js/**"
},
min: {
'build/MIDI.min.js': ['build/MIDI.js']
}
});
///
grunt.registerTask('default', 'concat min');
///
};

View file

@ -1,6 +1,8 @@
/* /*
---------------------------------------------------- ----------------------------------------------------
Color Space : 1.2 : 2012.09.01 : http://mudcu.be Color Space : 1.2 : 2012.11.06
----------------------------------------------------
https://github.com/mudcube/Color.Space.js
---------------------------------------------------- ----------------------------------------------------
RGBA <-> HSLA <-> W3 RGBA <-> HSLA <-> W3
RGBA <-> HSVA RGBA <-> HSVA
@ -25,14 +27,17 @@
#000000 #000000
*/ */
if (typeof(Color) === "undefined") Color = {}; if (typeof(Color) === "undefined") var Color = {};
if (typeof(Color.Space) === "undefined") Color.Space = {}; if (typeof(Color.Space) === "undefined") Color.Space = {};
(function () { "use strict"; (function () { "use strict";
var useEval = false; // caches functions for quicker access.
var functions = { var functions = {
// holds generated cached conversion functions. // holds generated cached conversion functions.
}; };
var shortcuts = { var shortcuts = {
"HEX24>HSL": "HEX24>RGB>HSL", "HEX24>HSL": "HEX24>RGB>HSL",
"HEX32>HSLA": "HEX32>RGBA>HSLA", "HEX32>HSLA": "HEX32>RGBA>HSLA",
@ -65,9 +70,13 @@ var root = Color.Space = function(color, route) {
} }
key += (pos === 0 ? "" : "_") + r[pos]; key += (pos === 0 ? "" : "_") + r[pos];
color = root[key](color); color = root[key](color);
// f = "Color.Space."+key+"("+f+")"; if (useEval) {
f = "Color.Space."+key+"("+f+")";
}
}
if (useEval) {
functions[route] = eval("(function(color) { return "+f+" })");
} }
// functions[route] = eval("(function(color) { return "+f+" })");
return color; return color;
}; };