Browse files

Updated to use jake for building and uglifyjs for minifying

  • Loading branch information...
1 parent f515f4c commit cf61220eb5eaad1316f7584ba3317c75cd63ea3c zoibot committed Jan 1, 2012
View
32 Jakefile.js
@@ -0,0 +1,32 @@
+var fs = require('fs');
+var uglify = require('uglify-js');
+
+desc('Uglify JS');
+task('minify', [], function(params) {
+ var all = '';
+ var files = [ 'ext/js/jquery.js',
+ 'ext/js/glMatrix-0.9.5.min.js',
+ 'js/graphics.js',
+ 'js/world.js',
+ 'js/objects.js',
+ 'js/main.js' ];
+ files.forEach(function(file, i) {
+ all += fs.readFileSync(file).toString();
+ });
+
+ var ast = uglify.parser.parse(all);
+ var out = fs.openSync('pub/all.js', 'w+');
+ if(!params) {
+ ast = uglify.uglify.ast_mangle(ast);
+ ast = uglify.uglify.ast_squeeze(ast);
+ }
+ fs.writeSync(out, uglify.uglify.gen_code(ast));
+});
+
+task('default', [], function(params) {
+ jake.Task['minify'].invoke(true /* debug */);
+});
+
+task('release', [], function(params) {
+ jake.Task['minify'].invoke();
+});
View
0 glMatrix-0.9.5.min.js → ext/js/glMatrix-0.9.5.min.js
File renamed without changes.
View
9,266 ext/js/jquery.js
9,266 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
14 index.htm
@@ -1,14 +0,0 @@
-<!doctype html>
-<html lang=en>
- <head>
- <title>vectormoon</title>
- <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.3.js" type="text/javascript"></script>
- <script src="glMatrix-0.9.5.min.js" type="text/javascript"></script>
- <script src="graphics.js"></script>
- <script src="world.js"></script>
- <script src="objects.js"></script>
- <script src="main.js"></script>
- </head>
- <body>
- </body>
-</html>
View
0 graphics.js → js/graphics.js
File renamed without changes.
View
0 main.js → js/main.js
File renamed without changes.
View
0 objects.js → js/objects.js
File renamed without changes.
View
0 world.js → js/world.js
File renamed without changes.
View
0 config.json → pub/config.json
File renamed without changes.
View
9 pub/index.htm
@@ -0,0 +1,9 @@
+<!doctype html>
+<html lang=en>
+ <head>
+ <title>vectormoon</title>
+ <script src="all.js"></script>
+ </head>
+ <body>
+ </body>
+</html>
View
0 test.json → pub/test.json
File renamed without changes.
View
20 tools/convert_svg.py
@@ -0,0 +1,20 @@
+import sys
+import re
+import json
+
+data = open(sys.argv[1]).read()
+translate = map(float, re.search('translate\((.*),(.*)\)', data).groups())
+point_data = re.search('d="m (.*) z"', data).groups()[0].split()
+points = []
+current_point = translate
+for raw_point in point_data:
+ delta = map(float, raw_point.split(','))
+ current_point = (current_point[0]+delta[0]),(current_point[1]+delta[1])
+ points.append(current_point)
+output = {}
+output['type'] = 'Polygon'
+output['animations'] = {}
+output['animations']['default'] = [points]
+
+print json.dumps(output)
+

0 comments on commit cf61220

Please sign in to comment.