From f35aae597f499e4e8bd1b516d019394e0bcb8c35 Mon Sep 17 00:00:00 2001 From: Paul Rayes Date: Tue, 21 Apr 2015 10:07:17 -0700 Subject: [PATCH 1/2] Add rotate option --- README.md | 15 +++++++++------ bin/discify | 4 ++++ index.js | 1 + src/index.js | 15 ++++++++------- 4 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 97845ed..c097201 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ sudo npm install -g disc ## Command-Line Interface ## -***Note:*** *you'll need to build your bundle with the `--full-paths` flag, +***Note:*** *you'll need to build your bundle with the `--full-paths` flag, and pass a fully qualified (not relative) input path to browserify for disc to do its thing.* @@ -29,11 +29,12 @@ for disc to do its thing.* discify [bundle(s)...] {options} Options: - -h, --help Displays these instructions. - -o, --output Output path of the bundle. Defaults to stdout. - -O, --open Opens disc in a new browser window automatically - -m, --mode the default file scale mode to display: should be - either "count" or "size". Default: size + -h, --help Displays these instructions. + -o, --output Output path of the bundle. Defaults to stdout. + -O, --open Opens disc in a new browser window automatically + -m, --mode the default file scale mode to display: should be + either "count" or "size". Default: size + -r, --no-rotate Turns off rotate animation ``` When you install disc globally, you the `discify` command-line tool is made @@ -97,6 +98,8 @@ This method takes the following options: description on the demo page. * `mode`: the default file scale mode to display: one of either `"count"` or `"size"`, defaulting to `"size"`. +* `rotate`: whether visualization should use a rotate animation: boolean, + defaulting to `true` ### `disc.bundle(bundles, [opts], callback)` ### diff --git a/bin/discify b/bin/discify index 7801ef4..b4999ba 100755 --- a/bin/discify +++ b/bin/discify @@ -25,6 +25,9 @@ var argv = optimist .alias('m', 'mode') .describe('m', 'the default file scale mode to display: should be either "count" or "size". Default: size') + .alias('r', 'no-rotate') + .describe('r', 'Turns off rotate animation') + .argv if (argv.help) { @@ -55,6 +58,7 @@ if (!files.length) { function handle(bundles) { disc.bundle(bundles, { mode: argv.mode + , rotate: argv['no-rotate'] ? false : true }, function(err, html) { if (err) throw err if (argv.output) return fs.writeFileSync(argv.output, html) diff --git a/index.js b/index.js index 5529fb8..02c1e20 100644 --- a/index.js +++ b/index.js @@ -130,6 +130,7 @@ function bundle(bundles, opts, callback) { if (err) return callback(err) data.mode = opts.mode || 'size' + data.rotate = typeof opts.rotate === 'undefined' ? true : opts.rotate data = '