mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +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({
|
actions: actions.Actions({
|
||||||
loadDemoIndex: ['File/Load demo data',
|
loadDemoIndex: ['File/Load demo data',
|
||||||
|
{mode: 'advancedBrowseModeAction'},
|
||||||
function(){
|
function(){
|
||||||
this.load({
|
this.load({
|
||||||
data: data.Data(demo_data),
|
data: data.Data(demo_data),
|
||||||
@ -107,9 +108,7 @@ module.Demo = core.ImageGridFeatures.Feature({
|
|||||||
load: 'loadDemoIndex',
|
load: 'loadDemoIndex',
|
||||||
sync: 'loadDemoIndex',
|
sync: 'loadDemoIndex',
|
||||||
check: true,
|
check: true,
|
||||||
}
|
} }) }],
|
||||||
})
|
|
||||||
}],
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -103,8 +103,7 @@ module.gGlob = function(){
|
|||||||
var listIndexes =
|
var listIndexes =
|
||||||
module.listIndexes =
|
module.listIndexes =
|
||||||
function(base, index_dir){
|
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
|
// 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){
|
.on('end', function(paths){
|
||||||
// skip nested indexes...
|
// skip nested indexes...
|
||||||
resolve(skipNested(paths, index_dir, logger))
|
resolve(skipNested(paths, index_dir, logger))
|
||||||
})
|
}) }) }
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var listPreviews =
|
var listPreviews =
|
||||||
module.listPreviews =
|
module.listPreviews =
|
||||||
function(base, img_pattern){
|
function(base, img_pattern){
|
||||||
//return gGlob(base +'/*px/*jpg')
|
//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 (???)
|
// XXX return a promise rather than an event emitter (???)
|
||||||
@ -144,8 +140,7 @@ module.listJSON =
|
|||||||
function(path, pattern){
|
function(path, pattern){
|
||||||
pattern = pattern || '*'
|
pattern = pattern || '*'
|
||||||
path = util.normalizePath(path)
|
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...
|
// wrap a node style callback function into a Promise...
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user