diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index 28864bf6..c2297395 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -174,8 +174,10 @@ actions.Actions({ }], clear: ['File|Interface/Clear viewer', function(){ - delete this.data - delete this.images + //delete this.data + //delete this.images + this.data = null + this.images = null }], // NOTE: for complete isolation it is best to completely copy the @@ -1069,7 +1071,7 @@ module.Journal = core.ImageGridFeatures.Feature({ function(data){ this.journal = (this.hasOwnProperty('journal') || this.journal) ? - this.journal + this.journal || [] : [] this.journal.push(data) }], diff --git a/ui (gen4)/features/core.js b/ui (gen4)/features/core.js index 15e536be..dbbce014 100755 --- a/ui (gen4)/features/core.js +++ b/ui (gen4)/features/core.js @@ -60,16 +60,16 @@ function(attr, states, a, b){ // Root ImageGrid.viewer object constructor... // -var ImageGrid = object.makeConstructor('ImageGrid', actions.MetaActions) +var ImageGrid = +module.ImageGrid = object.makeConstructor('ImageGrid', actions.MetaActions) // Root ImageGrid feature set.... var ImageGridFeatures = module.ImageGridFeatures = new features.FeatureSet() // setup base instance constructor... -ImageGridFeatures.__actions__ = function(){ - return actions.Actions(ImageGrid()) -} +ImageGridFeatures.__actions__ = + function(){ return actions.Actions(ImageGrid()) } diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index 35801951..c0e7e138 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -54,51 +54,53 @@ $(function(){ // setup actions... - window.a = viewer.ImageGridFeatures - .setup([ - 'viewer-testing', + window.ig = + window.ImageGrid = + viewer.ImageGridFeatures + .setup([ + 'viewer-testing', - 'demo', + 'demo', - // XXX this is not for production... - 'experiments', - ]) + // XXX this is not for production... + 'experiments', + ]) // used to switch experimental actions on (set to true) or off (unset or false)... - //a.experimental = true + //ig.experimental = true // report stuff... // XXX we also have .conflicts and .missing - a.features.excluded.length > 0 + ig.features.excluded.length > 0 && console.warn('Features excluded (%d):', - a.features.excluded.length, - a.features.excluded) - a.features.disabled.length > 0 + ig.features.excluded.length, + ig.features.excluded) + ig.features.disabled.length > 0 && console.log('Features disabled (%d):', - a.features.disabled.length, - a.features.disabled) + ig.features.disabled.length, + ig.features.disabled) console.log('Features not applicable (%d):', - a.features.unapplicable.length, - a.features.unapplicable) + ig.features.unapplicable.length, + ig.features.unapplicable) console.log('Features loaded (%d):', - a.features.features.length, - a.features.features) + ig.features.features.length, + ig.features.features) - a.logger = a.logger || {emit: function(e, v){ console.log(' ', e, v) }} + ig.logger = ig.logger || {emit: function(e, v){ console.log(' ', e, v) }} // setup the viewer... - a + ig .load({ viewer: $('.viewer') }) .start() // load some testing data if nothing else loaded... - if(!a.url_history || Object.keys(a.url_history).length == 0){ + if(!ig.url_history || Object.keys(ig.url_history).length == 0){ // NOTE: we can (and do) load this in parts... - a.loadDemoIndex() + ig.loadDemoIndex() // this is needed when loading legacy sources that do not have tags // synced...