diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index 8db51cc1..9e79d35c 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -691,6 +691,7 @@ core.ImageGridFeatures.Feature({ var img = images.Images(json.images) + // this is needed for loading multiple indexes... if(base_path){ d.base_path = base_path // XXX STUB remove ASAP... @@ -704,6 +705,7 @@ core.ImageGridFeatures.Feature({ // 2) add/remove on load/save (approach below) // + less to do in real time // - more processing on load/save + //console.warn('STUB: setting image .base_path in .prepareJSONForLoad(..)') img.forEach(function(_, img){ img.base_path = base_path }) } diff --git a/ui (gen4)/features/collections.js b/ui (gen4)/features/collections.js index f3555340..f1616497 100755 --- a/ui (gen4)/features/collections.js +++ b/ui (gen4)/features/collections.js @@ -60,6 +60,9 @@ module.COLLECTION_TRANSFER_CHANGES = [ ] + +//--------------------------------------------------------------------- + // XXX undo... var CollectionActions = actions.Actions({ config: { @@ -1331,7 +1334,8 @@ module.Collection = core.ImageGridFeatures.Feature({ // simplify lazy-loading of the collection // index... if(changes && (changes === true || changes.collections)){ - var index = res.index['collection-index'] = {} + //var index = res.index['collection-index'] = {} + var index = res.index['collections'] = {} // NOTE: we do not need to use .collection_order here // as .json(..) returns the collections in the // correct order... @@ -1400,9 +1404,10 @@ module.Collection = core.ImageGridFeatures.Feature({ // collection index... var collections = {} var collections_index = {} - var index = json['collection-index'] + //var index = json['collection-index'] + var index = json['collections'] index - && index.forEach(function(gid){ + && Object.keys(index).forEach(function(gid){ var title = index[gid] var path = 'collections/'+ gid @@ -1415,6 +1420,12 @@ module.Collection = core.ImageGridFeatures.Feature({ } }) + if(Object.keys(collections).length > 0){ + //console.log('!!!!!', collections) + // XXX this breaks loading... + //res.collections = collections + } + // group collection data... // XXX would be nice to have a mechanism to pass info to // the loader on what paths to load without actually @@ -1691,7 +1702,7 @@ module.CollectionTags = core.ImageGridFeatures.Feature({ // skip loaded collections that are already Data objects... // XXX not sure about this... .filter(function(title){ - return !(json.collections[title] instanceof data.Data) }) + return !(json.collections[title].data instanceof data.Data) }) // do the loading... .forEach(function(title){ var c = that.collections[title] diff --git a/ui (gen4)/features/location.js b/ui (gen4)/features/location.js index f9943507..30597acf 100755 --- a/ui (gen4)/features/location.js +++ b/ui (gen4)/features/location.js @@ -340,10 +340,23 @@ var LocationActions = actions.Actions({ }}], load: [function(){ return function(_, data){ + var that = this + // NOTE: we are setting this after the load because the // loader may .clear() the viewer, thus clearing the // .location too... - this.__location = data.location + var l = this.__location = data.location + + // set default image .base_path + // XXX not sure we need this... + data.location + && Object.keys(this.images || {}).forEach(function(gid){ + var img = that.images[gid] + + if(img.base_path == null){ + img.base_path = l.path + } + }) }}], clone: [function(){ return function(res){ diff --git a/ui (gen4)/imagegrid/file.js b/ui (gen4)/imagegrid/file.js index 74e44a16..4bed16e6 100755 --- a/ui (gen4)/imagegrid/file.js +++ b/ui (gen4)/imagegrid/file.js @@ -278,6 +278,8 @@ function(list, from_date, logger){ var k = s[1] var d = s[2] == 'diff' + k = d ? k : s.slice(1).join('-') + // new keyword... if(index[k] == null){ index[k] = [[d, n]]