twaked dependencies and some minor stuff...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-12-20 04:40:30 +03:00
parent 0548f0f9b3
commit d50f5c9c0e
3 changed files with 115 additions and 4 deletions

View File

@ -23,6 +23,71 @@ if(typeof(process) != 'undefined'){
} }
/*********************************************************************/
// setup logger...
// XXX STUB...
var logger = {
root: true,
message: null,
log: null,
emit: function(e, v){
var msg = this.message
var log = this.log = this.log || []
// report progress...
// XXX HACK -- need meaningful status...
if(e == 'queued'
|| e == 'found'){
ig.showProgress(msg || ['Progress', e], '+0', '+1')
} else if(e == 'loaded' || e == 'done' || e == 'written'
|| e == 'index'){
ig.showProgress(msg || ['Progress', e], '+1')
} else if(e == 'skipping' || e == 'skipped'){
// XXX if everything is skipped the indicator does not
// get hidden...
//ig.showProgress(msg || ['Progress', e], '+0', '-1')
ig.showProgress(msg || ['Progress', e], '+1')
// XXX STUB...
} else if(e == 'error' ){
ig.showProgress(['Error'].concat(msg), '+0', '+1')
console.log(msg ?
' '+ msg.join(': ') + ':'
: '', ...arguments)
} else {
// console...
console.log(msg ?
' '+ msg.join(': ') + ':'
: '', ...arguments)
}
// XXX
//log.push([msg, e, v])
},
push: function(msg){
if(msg == null){
return this
}
var logger = Object.create(this)
logger.root = false
logger.message = logger.message == null ? [msg] : logger.message.concat([msg])
logger.log = this.log = this.log || []
return logger
},
pop: function(){
return !this.__proto__.root ? this.__proto__ : this
},
}
/*********************************************************************/ /*********************************************************************/
// XXX what we need here is: // XXX what we need here is:
@ -51,10 +116,50 @@ if(typeof(process) != 'undefined'){
var CLIActions = actions.Actions({ var CLIActions = actions.Actions({
// XXX should this be here???
// ...move this to progress...
__progress: null,
showProgress: ['- System/',
function(text, value, max){
var msg = text instanceof Array ? text.slice(1).join(': ') : null
text = text instanceof Array ? text[0] : text
var state = this.__progress = this.__progress || {}
state = state[text] = state[text] || {}
// normalize max and value...
max = state.max = max != null ?
(typeof(max) == typeof('str') && /[+-][0-9]+/.test(max) ?
(state.max || 0) + parseInt(max)
: max)
: state.max
value = state.value = value != null ?
(typeof(value) == typeof('str') && /[+-][0-9]+/.test(value) ?
(state.value || 0) + parseInt(value)
: value)
: state.value
// format the message...
msg = msg ? ': '+msg : ''
msg = ' '+ msg
//+ (value && value >= (max || 0) ? ' ('+value+' done)'
+ (value && value >= (max || 0) ? ' (done)'
: value && max && value != max ? ' ('+ value +' of '+ max +')'
: '...')
msg != state.msg
&& console.log(msg)
state.msg = msg
}],
makeIndex: ['- System/', makeIndex: ['- System/',
function(path){ function(path){
var that = this var that = this
this.logger = logger
// XXX is this correct??? // XXX is this correct???
path = path || this.location.path path = path || this.location.path
@ -67,7 +172,9 @@ var CLIActions = actions.Actions({
}) })
// make the previews... // make the previews...
.then(function(){ .then(function(){
return that.makePreviews('all') if(that.makePreviews){
return that.makePreviews('all')
}
}) })
.then(function(){ .then(function(){
//that.readAllMetadata() //that.readAllMetadata()

View File

@ -708,7 +708,7 @@ module.TagUI = core.ImageGridFeatures.Feature({
// XXX // XXX
tag: 'ui-tags', tag: 'ui-tags',
depends: [ depends: [
// XXX 'ui',
], ],
actions: TagUIActions, actions: TagUIActions,

View File

@ -444,7 +444,7 @@ core.ImageGridFeatures.Feature({
tag: 'ui-ribbons-render', tag: 'ui-ribbons-render',
exclusive: ['ui-render'], exclusive: ['ui-render'],
depends: [ depends: [
// XXX BUG: for some reason this causes a dependency conflict... // XXX this causes a dependency loop -- ui <-> ui-render...
//'ui', //'ui',
'base', 'base',
], ],
@ -454,6 +454,8 @@ core.ImageGridFeatures.Feature({
'ui-partial-ribbons', 'ui-partial-ribbons',
], ],
isApplicable: function(){ return this.runtime.browser },
actions: RibbonsActions, actions: RibbonsActions,
handlers: [], handlers: [],
@ -532,6 +534,7 @@ core.ImageGridFeatures.Feature({
tag: 'ui-ribbons-edit-render', tag: 'ui-ribbons-edit-render',
depends: [ depends: [
'ui',
'edit', 'edit',
'tags', 'tags',
'sort', 'sort',
@ -701,7 +704,7 @@ core.ImageGridFeatures.Feature({
tag: 'ui-partial-ribbons', tag: 'ui-partial-ribbons',
exclusive: ['ui-partial-ribbons'], exclusive: ['ui-partial-ribbons'],
depends: [ depends: [
//'ui', 'ui',
'ui-ribbons-render', 'ui-ribbons-render',
], ],
suggested: [ suggested: [
@ -769,6 +772,7 @@ module.ShiftAnimation = core.ImageGridFeatures.Feature({
tag: 'ui-animation', tag: 'ui-animation',
depends: [ depends: [
'ui',
'ui-ribbons-render', 'ui-ribbons-render',
], ],
// NOTE: this will allow the animations to start as early as possible // NOTE: this will allow the animations to start as early as possible