From c30b12d6b8e4f68d9bc549c639a6502196c1e041 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 5 Dec 2015 07:50:04 +0300 Subject: [PATCH] some tweaking... Signed-off-by: Alex A. Naanou --- ui (gen4)/file.js | 1 + ui (gen4)/testing.js | 10 ++++++---- ui (gen4)/viewer.js | 10 +++++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ui (gen4)/file.js b/ui (gen4)/file.js index dc4714bb..aa93c8f1 100755 --- a/ui (gen4)/file.js +++ b/ui (gen4)/file.js @@ -591,6 +591,7 @@ function(json, changes){ // clean out some stuff from data... delete res.data.tags.bookmark + delete res.data.tags.bookmark_data delete res.data.tags.selected delete res.data.tags diff --git a/ui (gen4)/testing.js b/ui (gen4)/testing.js index bb7a0832..9a5d895d 100755 --- a/ui (gen4)/testing.js +++ b/ui (gen4)/testing.js @@ -114,14 +114,16 @@ module.setupActions = function(viewer){ if(typeof(glob) != 'undefined'){ window.load2014 = function(){ - return glob('l:/media/img/my/2014/*jpg') - .on('end', function(l){ window.a.loadURLs(l) }) + return a.loadImages('l:/media/img/my/2014/') + //return glob('l:/media/img/my/2014/*jpg') + // .on('end', function(l){ window.a.loadURLs(l) }) } window.loadInsta = function(){ - return glob('l:/mnt/Dropbox/Instagram/fav/ALL/*+(jpg|png)') - .on('end', function(l){ window.a.loadURLs(l) }) + return a.loadImages('l:/mnt/Dropbox/Instagram/fav/ALL/') + //return glob('l:/mnt/Dropbox/Instagram/fav/ALL/*+(jpg|png)') + // .on('end', function(l){ window.a.loadURLs(l) }) } diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index 1b5c38d9..e0ec88c9 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -264,6 +264,8 @@ actions.Actions({ // XXX should this be here??? loadURLs: ['File/Load a URL list', function(lst){ + this.clear() + this.images = images.Images.fromArray(lst) this.data = data.Data.fromArray(this.images.keys()) }], @@ -3331,6 +3333,9 @@ if(window.nodejs != null){ } +// XXX revise base path mechanics... +// .base_path +// .loaded_paths var FileSystemLoaderActions = actions.Actions({ config: { //'index-dir': '.ImageGrid', @@ -3464,6 +3469,9 @@ var FileSystemLoaderActions = actions.Actions({ return glob(path + '/*+(jpg|png)') .on('end', function(lst){ that.loadURLs(lst) + + // XXX not sure if this is the way to go... + that.base_path = path }) }], @@ -3677,7 +3685,7 @@ var FileSystemWriterActions = actions.Actions({ logger = logger || this.logger // XXX get real base path... - path = path || this.base_path +'/'+ this.config['index-dir'] + //path = path || this.base_path +'/'+ this.config['index-dir'] file.writeIndex( this.prepareIndexForWrite().prepared,