mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
added gid collection processing to data.join(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d2df691301
commit
0f74953a74
@ -2091,6 +2091,7 @@ var DataPrototype = {
|
|||||||
//
|
//
|
||||||
// XXX test more complex cases...
|
// XXX test more complex cases...
|
||||||
// XXX appears to be broken for joining sets via 'base' align...
|
// XXX appears to be broken for joining sets via 'base' align...
|
||||||
|
// XXX appears not to join all the gid lists (tags)...
|
||||||
join: function(){
|
join: function(){
|
||||||
var args = Array.apply(null, arguments)
|
var args = Array.apply(null, arguments)
|
||||||
var align = typeof(args[0]) == typeof('str') ? args.splice(0, 1)[0] : 'base'
|
var align = typeof(args[0]) == typeof('str') ? args.splice(0, 1)[0] : 'base'
|
||||||
@ -2148,6 +2149,23 @@ var DataPrototype = {
|
|||||||
|
|
||||||
d += 1
|
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...
|
// XXX this is slow-ish...
|
||||||
|
|||||||
@ -44,6 +44,10 @@ var FileSystemLoaderActions = actions.Actions({
|
|||||||
'index-dir': '.ImageGrid',
|
'index-dir': '.ImageGrid',
|
||||||
|
|
||||||
'image-file-pattern': '*+(jpg|jpeg|png|JPG|JPEG|PNG)',
|
'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){
|
clone: [function(full){
|
||||||
@ -151,7 +155,6 @@ var FileSystemLoaderActions = actions.Actions({
|
|||||||
logger && logger.emit('merge index', k, res)
|
logger && logger.emit('merge index', k, res)
|
||||||
|
|
||||||
// merge...
|
// merge...
|
||||||
// XXX this appears to lose bookmarks and other tags...
|
|
||||||
index.data.join(part.data)
|
index.data.join(part.data)
|
||||||
index.images.join(part.images)
|
index.images.join(part.images)
|
||||||
}
|
}
|
||||||
@ -162,7 +165,9 @@ var FileSystemLoaderActions = actions.Actions({
|
|||||||
// ...we either need to lazy-load clustered indexes
|
// ...we either need to lazy-load clustered indexes
|
||||||
// or merge, in both cases base_path should reflet
|
// or merge, in both cases base_path should reflet
|
||||||
// the fact that we have multiple indexes...
|
// the fact that we have multiple indexes...
|
||||||
break
|
if(that.config['load-first-index-only']){
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger && logger.emit('load index', index)
|
logger && logger.emit('load index', index)
|
||||||
|
|||||||
@ -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
|
// XXX would be a good idea to add provision for a timer to indicate
|
||||||
// slideshow progress/status...
|
// slideshow progress/status...
|
||||||
var SlideshowActions = actions.Actions({
|
var SlideshowActions = actions.Actions({
|
||||||
@ -240,7 +243,7 @@ var SlideshowActions = actions.Actions({
|
|||||||
// NOTE: this is partially redundant with the
|
// NOTE: this is partially redundant with the
|
||||||
// loadWorkspace.pre handler in the feature...
|
// loadWorkspace.pre handler in the feature...
|
||||||
if(this.workspaces['slideshow'] == null){
|
if(this.workspaces['slideshow'] == null){
|
||||||
this.toggleChrome('off')
|
this.loadWorkspace('ui-chrome-hidden')
|
||||||
this.saveWorkspace('slideshow')
|
this.saveWorkspace('slideshow')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,7 +342,7 @@ module.Slideshow = core.ImageGridFeatures.Feature({
|
|||||||
function(workspace){
|
function(workspace){
|
||||||
if(workspace == 'slideshow' && this.workspaces['slideshow'] == null){
|
if(workspace == 'slideshow' && this.workspaces['slideshow'] == null){
|
||||||
return function(){
|
return function(){
|
||||||
this.toggleChrome('off')
|
this.loadWorkspace('ui-chrome-hidden')
|
||||||
this.saveWorkspace('slideshow')
|
this.saveWorkspace('slideshow')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -492,6 +492,12 @@ module.StatusBar = core.ImageGridFeatures.Feature({
|
|||||||
core.makeWorkspaceConfigLoader(
|
core.makeWorkspaceConfigLoader(
|
||||||
function(){ return Object.keys(StatusBar.config) },
|
function(){ return Object.keys(StatusBar.config) },
|
||||||
function(workspace){
|
function(workspace){
|
||||||
|
// XXX not sure about this protocol yet...
|
||||||
|
if(this.workspace == 'ui-chrome-hidden'){
|
||||||
|
this.toggleStatusBar('none')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
'status-bar-mode' in workspace
|
'status-bar-mode' in workspace
|
||||||
&& this.toggleStatusBar(workspace['status-bar-mode'])
|
&& this.toggleStatusBar(workspace['status-bar-mode'])
|
||||||
})],
|
})],
|
||||||
|
|||||||
@ -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...
|
// NOTE: this uses the base feature API but does not need it imported...
|
||||||
//
|
//
|
||||||
// XXX split this into read and write actions...
|
// XXX split this into read and write actions...
|
||||||
@ -162,9 +169,6 @@ module.ViewerActions = actions.Actions({
|
|||||||
'last', // select last image
|
'last', // select last image
|
||||||
],
|
],
|
||||||
'ribbon-focus-mode': 'visual',
|
'ribbon-focus-mode': 'visual',
|
||||||
|
|
||||||
|
|
||||||
'chrome-visible': 'on',
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Images...
|
// Images...
|
||||||
@ -595,6 +599,7 @@ module.ViewerActions = actions.Actions({
|
|||||||
shiftImageRight: [
|
shiftImageRight: [
|
||||||
function(target){ this.ribbons.placeImage(target, 1) }],
|
function(target){ this.ribbons.placeImage(target, 1) }],
|
||||||
|
|
||||||
|
/*
|
||||||
// XXX how should these animate???
|
// XXX how should these animate???
|
||||||
travelImageUp: [
|
travelImageUp: [
|
||||||
function(){
|
function(){
|
||||||
@ -602,6 +607,7 @@ module.ViewerActions = actions.Actions({
|
|||||||
travelImageDown: [
|
travelImageDown: [
|
||||||
function(){
|
function(){
|
||||||
}],
|
}],
|
||||||
|
*/
|
||||||
|
|
||||||
shiftRibbonUp: [
|
shiftRibbonUp: [
|
||||||
function(target){
|
function(target){
|
||||||
@ -694,12 +700,6 @@ module.ViewerActions = actions.Actions({
|
|||||||
|
|
||||||
this.reload()
|
this.reload()
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
|
||||||
// toggle chrome on and off...
|
|
||||||
// XXX should this be here???
|
|
||||||
toggleChrome: ['Interface/Toggle chrome',
|
|
||||||
core.makeConfigToggler('chrome-visible', ['on', 'off'])],
|
|
||||||
})
|
})
|
||||||
|
|
||||||
var Viewer =
|
var Viewer =
|
||||||
@ -748,6 +748,11 @@ module.Viewer = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
$(window).resize(this.__viewer_resize)
|
$(window).resize(this.__viewer_resize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// setup basic workspaces...
|
||||||
|
if(this.workspaces['ui-chrome-hidden'] == null){
|
||||||
|
this.workspaces['ui-chrome-hidden'] = {}
|
||||||
|
}
|
||||||
}],
|
}],
|
||||||
['stop',
|
['stop',
|
||||||
function(){
|
function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user