cleanup and refactroing of meta-features...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-12-09 03:14:36 +03:00
parent ca9c39293d
commit 1c9b160e7a
6 changed files with 101 additions and 139 deletions

View File

@ -195,7 +195,7 @@ module.CLI = core.ImageGridFeatures.Feature({
// extend the current instance to a minimal non-ui // extend the current instance to a minimal non-ui
// state... // state...
core.ImageGridFeatures core.ImageGridFeatures
.setup(that, ['viewer-minimal']) .setup(that, ['imagegrid-minimal'])
}) })
.option('repl, --repl', 'start an ImageGrid REPL', function(){ .option('repl, --repl', 'start an ImageGrid REPL', function(){

View File

@ -687,9 +687,10 @@ var ExampleUIActions = actions.Actions({
focusable: true, focusable: true,
}) })
.on('close', function(){ .on('close', function(){
if(that.nested){
that.nested.stop() that.nested.stop()
delete that.nested
//delete that.nested }
}) })
@ -698,15 +699,15 @@ var ExampleUIActions = actions.Actions({
// setup the viewer... // setup the viewer...
this.nested = core.ImageGridFeatures this.nested = core.ImageGridFeatures
// setup actions... // setup actions...
// XXX prune the features a bit better...
.setup([ .setup([
'viewer-testing', 'imagegrid-ui-minimal',
// NOTE: this if not disabled will create a feedback loop... // stuff we do not need...
'-ui-url-hash', '-ui-drag-n-drop',
'-edit',
'-ui-single-image', '-collections',
'-ui-chrome', '-metadata',
'-peer',
]) ])
.run(function(){ .run(function(){
this.close = function(){ widget.close() } this.close = function(){ widget.close() }

View File

@ -19,69 +19,38 @@ var core = require('features/core')
// //
// XXX need to make a set of basic configurations: // XXX need to make a set of basic configurations:
// - commandline - everything but no UI // - commandline - everything but no UI
// - viewer-minimal - basic browser compatible viewer // - imagegrid-minimal - basic browser compatible viewer
// - viewer - full viewer // - viewer - full viewer
// - editor - editing capability // - editor - editing capability
// //
core.ImageGridFeatures.Feature('viewer-commandline', [ core.ImageGridFeatures.Feature('imagegrid-commandline', [
'lifecycle', 'lifecycle',
'commandline', 'commandline',
]) ])
core.ImageGridFeatures.Feature('viewer-minimal', [ core.ImageGridFeatures.Feature('imagegrid-minimal', [
'lifecycle', 'lifecycle',
'base-full', 'alias',
'peer', 'peer',
'image-marks',
'image-bookmarks',
'fs', 'fs',
'sharp', 'sharp',
'base-full',
'marks',
'collections',
'metadata', 'metadata',
]) ])
core.ImageGridFeatures.Feature('viewer-testing', [ core.ImageGridFeatures.Feature('imagegrid-ui-minimal', [
'viewer-commandline', 'imagegrid-minimal',
'viewer-minimal',
// NOTE: this is not strictly needed unless we need to save stuff,
// added here mostly for testing purposes...
// ...this is best included by direct feature dependency.
'index-format',
// XXX
'examples',
'collections',
// XXX remove when done testing...
//'-fs-collections',
'alias',
// read-only mode...
// XXX at this point this needs some more tuneup, the following
// features are completely disabled when 'edit' is not present
// - sort
// - ...
// ...should be split into view/edit sub-features...
// XXX might also be a good idea to make basic marking and bookmarking
// editable (save to localStorage???)
//'-edit',
'peer',
'workspace',
'ui',
'ui-introspection',
'keyboard', 'keyboard',
'ui-cursor',
'ui-control',
'ui-drag-n-drop',
// XXX use one... // XXX use one...
//'ui-blank-render', //'ui-blank-render',
@ -90,11 +59,6 @@ core.ImageGridFeatures.Feature('viewer-testing', [
//'ui-vdom-render', //'ui-vdom-render',
//'ui-react-render', //'ui-react-render',
// features...
'ui-cursor',
'ui-single-image',
/*/ XXX has bugs -- non-current ribbons are not always aligned... /*/ XXX has bugs -- non-current ribbons are not always aligned...
'ui-partial-ribbons-2', 'ui-partial-ribbons-2',
'-ui-partial-ribbons', '-ui-partial-ribbons',
@ -107,65 +71,92 @@ core.ImageGridFeatures.Feature('viewer-testing', [
'-ui-partial-ribbons-2', '-ui-partial-ribbons-2',
//*/ //*/
'marks',
'ui-range',
// local storage + url...
'config-local-storage',
'ui-url-hash',
'url-history',
'external-editor',
'ui-drag-n-drop',
'ui-preview-filters',
// chrome...
'ui-app-buttons',
'ui-buttons',
'ui-progress',
'ui-status-log',
'ui-scale',
'ui-bounds-indicators', 'ui-bounds-indicators',
'ui-current-image-indicator', 'ui-current-image-indicator',
// NOTE: only one of these can be set... ])
'ui-current-image-indicator-hide-on-fast-screen-nav',
//'ui-current-image-indicator-hide-on-screen-nav',
//*/
//'ui-base-ribbon-indicator',
'ui-passive-base-ribbon-indicator',
'ui-status-bar',
'ui-url-history',
'ui-browse-actions',
'ui-context-action-menu',
// slideshow... core.ImageGridFeatures.Feature('imagegrid-ui-chrome', [
'ui-slideshow', 'imagegrid-ui-minimal',
// ui control...
//'ui-clickable',
//'ui-direct-control-jquery',
// XXX BUG: on touch down and first move this gets offset by a distance
// not sure why...
// ...seems to be related to scaling
//'ui-direct-control-gsap',
//'ui-direct-control-hammer',
//'ui-indirect-control',
'ui-control',
// experimental and optional features...
//'auto-single-image',
//'auto-ribbon',
'ui-app-control', 'ui-app-control',
'ui-progress',
'ui-app-buttons',
'ui-buttons',
'ui-status-bar',
'ui-url-history',
'ui-browse-actions',
'ui-context-action-menu',
])
core.ImageGridFeatures.Feature('imagegrid-testing', [
'imagegrid-commandline',
'imagegrid-ui-chrome',
// read-only mode...
// XXX at this point this needs some more tuneup, the following
// ...should be split into view/edit sub-features...
// XXX features are completely disabled when '-edit' is not present:
// - sort
// - ...
// XXX the following features are broken:
// - crop
// - ...
// XXX might also be a good idea to make basic marking and bookmarking
// editable (save to localStorage???)
//'-edit',
//------------------------------------------------------ system ---
// XXX not yet fully tested... // XXX not yet fully tested...
'journal', 'journal',
// NOTE: this is not strictly needed unless we need to save stuff,
// added here mostly for testing purposes...
// ...this is best included by direct feature dependency.
'index-format',
'config-local-storage',
'ui-url-hash',
'fail-safe-devtools', 'fail-safe-devtools',
//------------------------------------------------------ chrome ---
'ui-status-log',
//'ui-scale',
// NOTE: only one of these can be set...
'ui-current-image-indicator-hide-on-fast-screen-nav',
//'ui-current-image-indicator-hide-on-screen-nav',
//'ui-base-ribbon-indicator',
'ui-passive-base-ribbon-indicator',
//---------------------------------------------------- features ---
'ui-introspection',
'ui-single-image',
'ui-slideshow',
'ui-preview-filters',
'url-history',
'external-editor',
// experimental features...
//'ui-range',
//'auto-single-image',
//'auto-ribbon',
//------------------------------------------------------- other ---
'examples',
//----------------------------------------------------- testing ---
'-tests', '-tests',
'-experiments', '-experiments',
@ -173,19 +164,6 @@ core.ImageGridFeatures.Feature('viewer-testing', [
'missing-feature', 'missing-feature',
]) ])
/*
core.ImageGridFeatures.Feature('viewer-minimal', [
'base',
'ui',
'ui-ribbon-align-to-order',
'ui-animation',
'ui-bounds-indicators',
'ui-current-image-indicator',
'ui-current-image-indicator-hide-on-fast-screen-nav',
//'ui-current-image-indicator-hide-on-screen-nav',
'ui-action-tree',
])
*/

View File

@ -571,21 +571,6 @@ function makeConfigListEditorDialog(path, options){
//---------------------------------------------------------------------
var Chrome =
module.Chrome = core.ImageGridFeatures.Feature({
title: '',
doc: '',
tag: 'ui-chrome',
depends: [
'ui',
],
})
//--------------------------------------------------------------------- //---------------------------------------------------------------------
var DialogsActions = actions.Actions({ var DialogsActions = actions.Actions({
@ -869,7 +854,6 @@ module.Dialogs = core.ImageGridFeatures.Feature({
tag: 'ui-dialogs', tag: 'ui-dialogs',
depends: [ depends: [
'ui', 'ui',
'ui-chrome',
], ],
actions: DialogsActions, actions: DialogsActions,
@ -2070,7 +2054,6 @@ module.Buttons = core.ImageGridFeatures.Feature({
tag: 'ui-buttons', tag: 'ui-buttons',
depends: [ depends: [
'ui', 'ui',
'ui-chrome'
], ],
suggested: [ suggested: [
// needed for reporting info in .makeButtonControls(..) // needed for reporting info in .makeButtonControls(..)

View File

@ -45,8 +45,8 @@ module.ImageGridFeatures =
// setup actions and start... // setup actions and start...
ImageGridFeatures ImageGridFeatures
.setup([ .setup([
'viewer-testing', 'imagegrid-testing',
'viewer-commandline', 'imagegrid-commandline',
]) ])
.start() .start()

View File

@ -57,7 +57,7 @@ $(function(){
window.ImageGrid = window.ImageGrid =
viewer.ImageGridFeatures viewer.ImageGridFeatures
.setup([ .setup([
'viewer-testing', 'imagegrid-testing',
'demo', 'demo',