now everything is a feature...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-11-07 19:44:52 +03:00
parent c66eb2e354
commit 5e3d6ead54
4 changed files with 41 additions and 8 deletions

View File

@ -760,11 +760,13 @@ module.MetaActions = {
//
// XXX add doc, ldoc, tags and save them to each action...
// XXX is .config processing correct here???
// XXX should this be a full fledged object???
var Actions =
module.Actions =
function Actions(a, b){
var obj = b == null ? a : b
var proto = b == null ? MetaActions : a
obj = obj || {}
// NOTE: this is intentionally done only for own attributes...
Object.keys(obj).forEach(function(k){

View File

@ -563,6 +563,8 @@ module.FeatureSet = {
setup.call(that[n], obj)
}
})
return obj
},
remove: function(obj, lst){
lst = lst.constructor !== Array ? [lst] : lst

View File

@ -37,7 +37,7 @@ var browser = require('browser')
var nw = require('nw')
// XXX load only the actualy used here modules...
var actions = require('actions')
var actions = require('lib/actions')
var data = require('data')
var ribbons = require('ribbons')
@ -240,8 +240,8 @@ module.GLOBAL_KEYBOARD = {
$(function(){
// XXX
window.a = testing.setupActions()
// XXX stub action set -- this needs to be auto-generated...
window.a = actions.Actions()
// used switch experimental actions on (set to true) or off (unset or false)...
//a.experimental = true
@ -283,6 +283,7 @@ $(function(){
// setup base keyboard for devel, in case something breaks...
// This branch does not drop keys...
if(module.MAX_KEY_REPEAT_RATE < 0 || module.MAX_KEY_REPEAT_RATE == null){
$(document)
.keydown(
@ -293,6 +294,8 @@ $(function(){
},
a))
// drop keys if repeating to fast...
// NOTE: this is done for smoother animations...
} else {
$(document)
.keydown(

View File

@ -142,6 +142,13 @@ function makeTagWalker(direction, dfl_tag){
/*********************************************************************/
var ImageGridFeatures =
module.ImageGridFeatures = Object.create(features.FeatureSet)
/*********************************************************************/
//
// XXX Tasks to accomplish here:
@ -152,8 +159,8 @@ function makeTagWalker(direction, dfl_tag){
//
//
var Client =
module.Client =
var BaseActions =
module.BaseActions =
actions.Actions({
config: {
@ -781,11 +788,19 @@ actions.Actions({
})
var Base =
module.Base = ImageGridFeatures.Feature({
title: 'ImageGrid base',
/*********************************************************************/
tag: 'base',
var ImageGridFeatures =
module.ImageGridFeatures = Object.create(features.FeatureSet)
config: {
// see .direction for details...
'steps-to-change-direction': 3,
},
actions: BaseActions,
})
@ -1298,6 +1313,8 @@ module.Viewer = ImageGridFeatures.Feature({
tag: 'ui',
depends: ['base'],
config: {
// The maximum screen width allowed when zooming...
'max-screen-images': 30,
@ -1342,6 +1359,8 @@ module.Journal = ImageGridFeatures.Feature({
tag: 'system-journal',
depends: ['base'],
actions: actions.Actions({
// XXX might be good to add some kind of metadata to journal...
journalPush: ['Journal/Add an item to journal',
@ -2666,6 +2685,8 @@ module.ImageMarks = ImageGridFeatures.Feature({
tag: 'image-marks',
depends: ['base'],
actions: ImageMarkActions,
handlers: [
@ -2728,6 +2749,8 @@ module.ImageBookmarks = ImageGridFeatures.Feature({
tag: 'image-bookmarks',
depends: ['base'],
actions: ImageBookmarkActions,
handlers: [
@ -2818,6 +2841,8 @@ module.FileSystemLoader = ImageGridFeatures.Feature({
//
ImageGridFeatures.Feature('viewer-testing', [
'base',
'ui',
// features...
@ -2850,6 +2875,7 @@ ImageGridFeatures.Feature('viewer-testing', [
])
ImageGridFeatures.Feature('viewer-minimal', [
'base',
'ui',
'ui-ribbon-align-to-order',
'ui-animation',