more refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-01-12 04:47:40 +03:00
parent af0754b3a6
commit 1f7553d39d
3 changed files with 16 additions and 7 deletions

View File

@ -24,7 +24,9 @@ var core = require('features/core')
/*********************************************************************/ /*********************************************************************/
// XXX make metadata a prop of image... // XXX make metadata a prop of image... (???)
// XXX Q: should we standardise metadata field names and adapt them to
// lib???
var MetadataActions = actions.Actions({ var MetadataActions = actions.Actions({
getMetadata: ['- Image/Get metadata data', getMetadata: ['- Image/Get metadata data',
@ -65,9 +67,6 @@ module.Metadata = core.ImageGridFeatures.Feature({
'base', 'base',
], ],
isApplicable: function(){
return this.runtime == 'nw' || this.runtime == 'node' },
actions: MetadataActions, actions: MetadataActions,
}) })
@ -130,13 +129,13 @@ var MetadataReaderActions = actions.Actions({
}) })
var MetadataReader = var MetadataReader =
module.Metadata = core.ImageGridFeatures.Feature({ module.MetadataReader = core.ImageGridFeatures.Feature({
title: '', title: '',
doc: '', doc: '',
tag: 'metadata-reader', tag: 'fs-metadata',
depends: [ depends: [
'base', 'metadata',
], ],
isApplicable: function(){ isApplicable: function(){
@ -164,9 +163,14 @@ module.Metadata = core.ImageGridFeatures.Feature({
// - script layout tweaking (post-update) // - script layout tweaking (post-update)
// //
// ...need to think about this... // ...need to think about this...
// XXX add a way to sort fields...
// XXX this should basically be platform independent... // XXX this should basically be platform independent...
var MetadataUIActions = actions.Actions({ var MetadataUIActions = actions.Actions({
config: {
'metadata-field-order': [
],
}
showMetadata: ['Image/Show metadata', showMetadata: ['Image/Show metadata',
function(image, force){ function(image, force){
image = this.data.getImage(image) image = this.data.getImage(image)

View File

@ -83,6 +83,7 @@ core.ImageGridFeatures.Feature('viewer-testing', [
'ui-fs-writer', 'ui-fs-writer',
'metadata', 'metadata',
'fs-metadata',
'ui-metadata', 'ui-metadata',
'external-editor', 'external-editor',

View File

@ -750,6 +750,10 @@ var BrowserPrototype = {
// NOTE: this will be set to true if make(..) is called at least once... // NOTE: this will be set to true if make(..) is called at least once...
var interactive = false var interactive = false
// XXX p should be understood as:
// - str (done)
// - [str, ...]
// - DOM/jQuery
var make = function(p, traversable, disabled){ var make = function(p, traversable, disabled){
p = p + '' p = p + ''
var dir = /[\\\/]\s*$/ var dir = /[\\\/]\s*$/