added gid collection processing to data.join(..)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-03-30 15:24:01 +03:00
parent d2df691301
commit 0f74953a74
5 changed files with 50 additions and 13 deletions

View File

@ -2091,6 +2091,7 @@ var DataPrototype = {
//
// XXX test more complex cases...
// XXX appears to be broken for joining sets via 'base' align...
// XXX appears not to join all the gid lists (tags)...
join: function(){
var args = Array.apply(null, arguments)
var align = typeof(args[0]) == typeof('str') ? args.splice(0, 1)[0] : 'base'
@ -2148,6 +2149,23 @@ var DataPrototype = {
d += 1
}
// merge other stuff...
data.eachImageList(function(list, key, set){
if(set == 'ribbons'){
return
}
if(base[set] == null){
base[set] = {key: base.makeSparseImages(list)}
} else if(base[set][key] == null){
base[set][key] = base.makeSparseImages(list)
} else {
base[set][key] = base.makeSparseImages(base[set][key].concat(list))
}
})
})
// XXX this is slow-ish...

View File

@ -44,6 +44,10 @@ var FileSystemLoaderActions = actions.Actions({
'index-dir': '.ImageGrid',
'image-file-pattern': '*+(jpg|jpeg|png|JPG|JPEG|PNG)',
// XXX if true and multiple indexes found, load only the first
// without merging...
'load-first-index-only': false,
},
clone: [function(full){
@ -151,7 +155,6 @@ var FileSystemLoaderActions = actions.Actions({
logger && logger.emit('merge index', k, res)
// merge...
// XXX this appears to lose bookmarks and other tags...
index.data.join(part.data)
index.images.join(part.images)
}
@ -162,7 +165,9 @@ var FileSystemLoaderActions = actions.Actions({
// ...we either need to lazy-load clustered indexes
// or merge, in both cases base_path should reflet
// the fact that we have multiple indexes...
break
if(that.config['load-first-index-only']){
break
}
}
logger && logger.emit('load index', index)

View File

@ -30,6 +30,9 @@ var _cmpTimes = function(a, b){
/*********************************************************************/
// NOTE: this uses ui-chrome-hidden workspace to set the initial state
// of the slideshow workspace.
//
// XXX would be a good idea to add provision for a timer to indicate
// slideshow progress/status...
var SlideshowActions = actions.Actions({
@ -240,7 +243,7 @@ var SlideshowActions = actions.Actions({
// NOTE: this is partially redundant with the
// loadWorkspace.pre handler in the feature...
if(this.workspaces['slideshow'] == null){
this.toggleChrome('off')
this.loadWorkspace('ui-chrome-hidden')
this.saveWorkspace('slideshow')
}
@ -339,7 +342,7 @@ module.Slideshow = core.ImageGridFeatures.Feature({
function(workspace){
if(workspace == 'slideshow' && this.workspaces['slideshow'] == null){
return function(){
this.toggleChrome('off')
this.loadWorkspace('ui-chrome-hidden')
this.saveWorkspace('slideshow')
}
}

View File

@ -492,6 +492,12 @@ module.StatusBar = core.ImageGridFeatures.Feature({
core.makeWorkspaceConfigLoader(
function(){ return Object.keys(StatusBar.config) },
function(workspace){
// XXX not sure about this protocol yet...
if(this.workspace == 'ui-chrome-hidden'){
this.toggleStatusBar('none')
return
}
'status-bar-mode' in workspace
&& this.toggleStatusBar(workspace['status-bar-mode'])
})],

View File

@ -108,6 +108,13 @@ function updateImagePosition(actions, target){
/*********************************************************************/
// Workspaces:
// ui-chrome-hidden - all features handling chrome elements
// should hide all the chrome when this
// workspace loads.
// NOTE: other workspace functionality
// should be handled without change.
//
// NOTE: this uses the base feature API but does not need it imported...
//
// XXX split this into read and write actions...
@ -162,9 +169,6 @@ module.ViewerActions = actions.Actions({
'last', // select last image
],
'ribbon-focus-mode': 'visual',
'chrome-visible': 'on',
},
// Images...
@ -595,6 +599,7 @@ module.ViewerActions = actions.Actions({
shiftImageRight: [
function(target){ this.ribbons.placeImage(target, 1) }],
/*
// XXX how should these animate???
travelImageUp: [
function(){
@ -602,6 +607,7 @@ module.ViewerActions = actions.Actions({
travelImageDown: [
function(){
}],
*/
shiftRibbonUp: [
function(target){
@ -694,12 +700,6 @@ module.ViewerActions = actions.Actions({
this.reload()
}],
// toggle chrome on and off...
// XXX should this be here???
toggleChrome: ['Interface/Toggle chrome',
core.makeConfigToggler('chrome-visible', ['on', 'off'])],
})
var Viewer =
@ -748,6 +748,11 @@ module.Viewer = core.ImageGridFeatures.Feature({
$(window).resize(this.__viewer_resize)
}
// setup basic workspaces...
if(this.workspaces['ui-chrome-hidden'] == null){
this.workspaces['ui-chrome-hidden'] = {}
}
}],
['stop',
function(){