diff --git a/ui (gen4)/css/experimenting.css b/ui (gen4)/css/experimenting.css index 6ae62c82..ccd10dfc 100755 --- a/ui (gen4)/css/experimenting.css +++ b/ui (gen4)/css/experimenting.css @@ -1,3 +1,12 @@ +/********************************************************************** +* +* This module is intended for quick and dirty tests and CSS experiments +* +* For production move the code from here to a more appropriate location +* +* +**********************************************************************/ + body { margin: 0; diff --git a/ui (gen4)/features/cli.js b/ui (gen4)/features/cli.js index 10e12d06..f7b20b26 100755 --- a/ui (gen4)/features/cli.js +++ b/ui (gen4)/features/cli.js @@ -109,6 +109,12 @@ module.CLI = core.ImageGridFeatures.Feature({ .version('0.0.1') //.usage('[command] [options] ..') + .option('-v, --verbose', 'verbose mode', function(){ + that.logger = { + emit: function(){ console.log.apply(console, arguments) } + } + }) + // list features... // XXX make this a core action... (???) .option('lf, --list-features', 'list loaded features', function(){ @@ -164,8 +170,16 @@ module.CLI = core.ImageGridFeatures.Feature({ .setup(that, ['viewer-minimal']) }) - .option('repl, --repl', 'start an ImageGrin REPL', function(){ - //var repl = require('repl') + .option('repl, --repl', 'start an ImageGrid REPL', function(){ + var repl = requirejs('repl') + + // setup the global ns... + global.ig = + global.ImageGrid = + that + + require('features/all') + global.ImageGridFeatures = core.ImageGridFeatures //var ig = core.ImageGridFeatures @@ -176,30 +190,6 @@ module.CLI = core.ImageGridFeatures.Feature({ output: process.stdout, ignoreUndefined: true, - - /* - eval: function(str, context, filename, callback){ - var res - - var lst = str.split(/\s+/) - var cmd = lst.shift() - - // we got an action... - if(cmd == 'var'){ - eval(str, context, filename, callback) - - // action... - } else if(cmd in ig){ - ig[cmd].apply(ig, lst.map(eval)) - - // err - } else { - // XXX - } - - callback(null, res) - }, - */ }) }) @@ -217,7 +207,7 @@ module.CLI = core.ImageGridFeatures.Feature({ .arguments(' [args]') .action(function(action, args){ // XXX - console.log('>>>>', action, args, !!that[action]) + //console.log('>>>>', action, args, !!that[action]) that[action](args) }) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index aeb4da16..d11aa837 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -1301,7 +1301,7 @@ var FileSystemWriterActions = actions.Actions({ : this.hasOwnProperty('changes') ? this.changes : null return { - date: window.Date.timeStamp(), + date: Date.timeStamp(), raw: json, prepared: file.prepareIndex(json, changes), } diff --git a/ui (gen4)/lib/toggler.js b/ui (gen4)/lib/toggler.js index 6749e2b9..7cad5b92 100755 --- a/ui (gen4)/lib/toggler.js +++ b/ui (gen4)/lib/toggler.js @@ -174,7 +174,7 @@ function(elem, state_accessor, states, callback_a, callback_b){ var bool_action = (state_set.length == 2 && state_set[0] == 'none') // XXX is this correct??? - var args = args2array(arguments).slice(2) + var args = [].slice.call(arguments).slice(2) // option number... if(typeof(action) == typeof(1)){ diff --git a/ui (gen4)/lib/util.js b/ui (gen4)/lib/util.js index 47951fc3..19c4a284 100755 --- a/ui (gen4)/lib/util.js +++ b/ui (gen4)/lib/util.js @@ -83,6 +83,12 @@ Array.prototype.setCmp = function(other){ } +var args2array = +module.args2array = +Array.fromArgs = + function(args){ return [].slice.call(args) } + + module.chainCmp = function(cmp_chain){ return function(a, b, get, data){ var res @@ -141,15 +147,6 @@ Object.defineProperty(Array.prototype, 'len', { - -// convert JS arguments to Array... -var args2array = -module.args2array = -function(args){ - //return Array.apply(null, args) - return [].slice.call(args) -} - // Quote a string and convert to RegExp to match self literally. var quoteRegExp = RegExp.quoteRegExp =