forked from jaukia/zoomooz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## Information | ||
|
||
Zoomooz is an easy-to-use jQuery plugin for making any web page element zoom. | ||
|
||
## Installation and usage | ||
|
||
Basically, just have a look at the examples and start hacking away. | ||
|
||
For more information and usage, see: http://janne.aukia.com/zoomooz | ||
|
||
## Building | ||
|
||
There is an optional build process. Currently the only thing it does is that it merges and minifies Javascript files, so running it is not necessary. | ||
|
||
### Setting up the build tools | ||
|
||
1. Download and install Node.js: | ||
|
||
http://nodejs.org/#download | ||
|
||
./configure | ||
make | ||
make install | ||
|
||
1. Install npm (sudo with own risk if problems): | ||
|
||
curl http://npmjs.org/install.sh | sh | ||
sudo chown -R $USER /usr/local/lib/node/ | ||
sudo chown -R $USER /usr/local/bin/ | ||
|
||
1. Install node-jake: | ||
|
||
npm install jake | ||
|
||
1. Install uglify-js: | ||
|
||
npm install uglify-js | ||
|
||
### Running the build | ||
|
||
jake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
if (typeof global.system !== 'undefined') { | ||
print('Narwhal Jake not supported (use node-jake instead)'); | ||
return; | ||
} | ||
|
||
var sys = require('sys'); | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
|
||
var util = require('util'); | ||
|
||
var uglify = require("uglify-js"); | ||
var jsp = uglify.parser; | ||
var pro = uglify.uglify; | ||
|
||
var spawn = require('child_process').spawn; | ||
|
||
var ownFilesMergedFileName = "build/jquery.zoomooz-merged.js"; | ||
var withLibsMergedFileName = "build/jquery.zoomooz-merged-libs.js"; | ||
|
||
var ownFilesMinifiedFileName = "build/jquery.zoomooz-merged-min.js"; | ||
var withLibsMinifiedFileName = "build/jquery.zoomooz-merged-libs-min.js"; | ||
|
||
desc('Concatenates javascript files'); | ||
task('concat', [], function() { | ||
sys.puts('### [jake concat]'); | ||
|
||
path.exists("build",function(exists) { | ||
if(!exists) { | ||
sys.puts('setting up build dir'); | ||
fs.mkdirSync("build",0744); | ||
} | ||
|
||
var ownfiles = ['js/purecssmatrix.js','js/jquery.zoomooz.js','js/jquery.animtrans.js'], | ||
extrafiles = ['lib/sylvester.js'], | ||
pathName = '.'; | ||
|
||
var concatFiles = function(files, outFileName) { | ||
sys.puts('Creating \"'+outFileName+'\" from:'); | ||
outFile = fs.openSync(outFileName, 'w+'); | ||
files.forEach(function(fileName) { | ||
var contents = fs.readFileSync(fileName); | ||
var writeStatus = fs.writeSync(outFile, contents.toString()+'\n'); | ||
sys.puts(' '+fileName); | ||
}); | ||
fs.closeSync(outFile); | ||
} | ||
|
||
var withLibs = ownfiles.concat(extrafiles); | ||
|
||
concatFiles(ownfiles, ownFilesMergedFileName); | ||
concatFiles(withLibs, withLibsMergedFileName); | ||
|
||
complete(); | ||
}); | ||
}, true); | ||
|
||
desc('Minifies js files'); | ||
task('minify', [], function() { | ||
var minifyFile = function(originalFileName,outFileName) { | ||
var contents = fs.readFileSync(originalFileName); | ||
var ast = jsp.parse(contents.toString()); | ||
ast = pro.ast_mangle(ast); | ||
ast = pro.ast_squeeze(ast); | ||
var final_code = pro.gen_code(ast); | ||
outFile = fs.openSync(outFileName, 'w+'); | ||
var writeStatus = fs.writeSync(outFile, final_code); | ||
fs.closeSync(outFile); | ||
} | ||
|
||
minifyFile(ownFilesMergedFileName, ownFilesMinifiedFileName); | ||
minifyFile(withLibsMergedFileName, withLibsMinifiedFileName); | ||
|
||
}); | ||
|
||
/* | ||
desc('Creates Docco documentation'); | ||
task('docs', [], function() { | ||
var tsk = spawn('docco',['js/purecssmatrix.js','js/jquery.zoomooz.js']); | ||
tsk.stdout.on('data', function (data) { | ||
util.print('stdout: ' + data); | ||
}); | ||
tsk.stderr.on('data', function (data) { | ||
util.print('stderr: ' + data); | ||
}); | ||
}); | ||
*/ | ||
|
||
desc('Main build task'); | ||
task('build', ['concat','minify'/*,'docs'*/], function() {}); | ||
|
||
desc('Default task'); | ||
task('default', ['build'], function() {}); |