From b4b143f5be2eef9aa15ac8fa660fd3004f737336 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 19 Nov 2018 03:15:58 +0300 Subject: [PATCH] playing with tags api... Signed-off-by: Alex A. Naanou --- ui (gen4)/imagegrid/tags.js | 98 +++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/ui (gen4)/imagegrid/tags.js b/ui (gen4)/imagegrid/tags.js index 57deb659..b08553a9 100755 --- a/ui (gen4)/imagegrid/tags.js +++ b/ui (gen4)/imagegrid/tags.js @@ -1,5 +1,11 @@ /********************************************************************** * +* Features: +* - tag paths +* a/b/c +* - tag sets/relations +* a:b +* - serializable tag queries * * **********************************************************************/ @@ -14,6 +20,98 @@ var util = require('lib/util') /*********************************************************************/ +var TagsClassPrototype = { +} + + +// XXX this should have the following sections: +// - tag-tag relations -- persistent +// - tags +// - paths +// - sets/relations +// - content (tag-object) -- volatile +// - tags +// - paths +// - sets/relations +// - tag-object references +var TagsPrototype = { + + // Add/Remove/Modify tags API... + // XXX + path: function(){ + // XXX + return this + }, + alias: function(){ + // XXX + return this + }, + + + // Add/Remove/Modify content API... + // XXX + tag: function(){ + // XXX + return this + }, + untag: function(){ + // XXX + return this + }, + + + // Query API... + // XXX + get: function(){ + }, + + + // Object utility API... + // + // .clone() + // .clone('full') + // -> tags + // + // .clone('tags') + // -> tags + // + clone: function(mode){ + return new this.constructor(this.json(mode)) }, + + // serialization... + // + // .json() + // .json('full') + // -> json + // + // .json('tags') + // -> json + // + // + // Format: + // { + // } + // + json: function(mode){ + // XXX + }, + load: function(json){ + // XXX + return this + }, + + // constructor... + __init__: function(json){ + json + && this.load(json) }, +} + + +var Tags = +module.Tags = +object.makeConstructor('Tags', + TagssClassPrototype, + TagsPrototype)