mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
minor refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
0f23ba8a15
commit
47a56706bc
@ -96,6 +96,7 @@ module.Demo = core.ImageGridFeatures.Feature({
|
||||
|
||||
actions: actions.Actions({
|
||||
loadDemoIndex: ['File/Load demo data',
|
||||
{mode: 'advancedBrowseModeAction'},
|
||||
function(){
|
||||
this.load({
|
||||
data: data.Data(demo_data),
|
||||
@ -107,9 +108,7 @@ module.Demo = core.ImageGridFeatures.Feature({
|
||||
load: 'loadDemoIndex',
|
||||
sync: 'loadDemoIndex',
|
||||
check: true,
|
||||
}
|
||||
})
|
||||
}],
|
||||
} }) }],
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -103,8 +103,7 @@ module.gGlob = function(){
|
||||
var listIndexes =
|
||||
module.listIndexes =
|
||||
function(base, index_dir){
|
||||
return gGlob(base +'/**/'+ (index_dir || INDEX_DIR), {strict: false})
|
||||
}
|
||||
return gGlob(base +'/**/'+ (index_dir || INDEX_DIR), {strict: false}) }
|
||||
|
||||
|
||||
// NOTE: this is similar to listIndexes(..) but will return a promise and
|
||||
@ -125,17 +124,14 @@ function(base, index_dir, logger){
|
||||
.on('end', function(paths){
|
||||
// skip nested indexes...
|
||||
resolve(skipNested(paths, index_dir, logger))
|
||||
})
|
||||
})
|
||||
}
|
||||
}) }) }
|
||||
|
||||
|
||||
var listPreviews =
|
||||
module.listPreviews =
|
||||
function(base, img_pattern){
|
||||
//return gGlob(base +'/*px/*jpg')
|
||||
return gGlob(base +'/*px/'+(img_pattern || '*')+'.jpg', {strict: false})
|
||||
}
|
||||
return gGlob(base +'/*px/'+(img_pattern || '*')+'.jpg', {strict: false}) }
|
||||
|
||||
|
||||
// XXX return a promise rather than an event emitter (???)
|
||||
@ -144,8 +140,7 @@ module.listJSON =
|
||||
function(path, pattern){
|
||||
pattern = pattern || '*'
|
||||
path = util.normalizePath(path)
|
||||
return gGlob(path +'/'+ pattern +'.json', {strict: false})
|
||||
}
|
||||
return gGlob(path +'/'+ pattern +'.json', {strict: false}) }
|
||||
|
||||
// wrap a node style callback function into a Promise...
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user