diff --git a/Viewer/css/layout.css b/Viewer/css/layout.css index dc2a61fd..d8e09196 100755 --- a/Viewer/css/layout.css +++ b/Viewer/css/layout.css @@ -728,6 +728,10 @@ stretching in width... */ /* XXX we are taking care of this in code -- see if we can use this */ image-orientation: none; + + /* XXX does this affect gifs??? + animation-play-state: paused; + */ } .image { diff --git a/Viewer/features/base.js b/Viewer/features/base.js index b7a12e5b..745485e1 100755 --- a/Viewer/features/base.js +++ b/Viewer/features/base.js @@ -35,20 +35,50 @@ var core = require('features/core') /*********************************************************************/ +// Merge indexi into the first/base... +// +// merge(base, ...) +// -> res +// +// res format: +// { +// base: , +// +// // sparse array (optional)... +// conflicts: [ +// ... +// // conflict objects are at positions corresponding to its +// // input index in the arguments.... +// // for format see: Data's .join(..) +// , +// ... +// ], +// } +// var merge = module.merge = function(base, ...others){ // XXX get deconfliction mode... // XXX + var res = { base } + var i = 0 for(var other of others){ + i++ + // merge data... base.data.join(other.data) // deconflict... - for(var c in base.data.deconfliction ?? {}){ - var n = base.data.deconfliction[c] - other.images.replaceGID(c, n) } - delete base.data.deconfliction + // NOTE: .data.join(..) deconflicts data internally, we need to keep + // the deconflicted GIDs in sync with .images... + if(base.data.deconfliction){ + res.conflicts ??= [] + res.conflicts[i] = base.data.deconfliction + for(var c in base.data.deconfliction ?? {}){ + var n = base.data.deconfliction[c] + other.images.replaceGID(c, n) } + delete base.data.deconfliction } + // merge images... base.images.join(other.images) } - return base } + return res } diff --git a/Viewer/features/filesystem.js b/Viewer/features/filesystem.js index 937a433f..f3f64683 100755 --- a/Viewer/features/filesystem.js +++ b/Viewer/features/filesystem.js @@ -367,7 +367,10 @@ var FileSystemLoaderActions = actions.Actions({ //console.log('MERGING:', k, part) logger && logger.emit('merge index', k, res) - index = that.merge(index, part) } + var {base, conflicts} = that.merge(index, part) + index = base + + conflicts && logger && logger.emit('GID conflicts', conflicts) } loaded.push(k) } @@ -780,9 +783,12 @@ var FileSystemLoaderActions = actions.Actions({ var new_data = that.data.constructor.fromArray(gids) // prepend to index... + // NOTE: we are ignoring conflicts here as we are + // generating the index ouselves... var index = that.merge( - { data: new_data, images: imgs }, - that) + { data: new_data, images: imgs }, + that) + .base var cur = that.data.current that.images = index.images that.data = index.data