diff --git a/ui (gen4)/features/tags.js b/ui (gen4)/features/tags.js index 62f403e9..d381800a 100755 --- a/ui (gen4)/features/tags.js +++ b/ui (gen4)/features/tags.js @@ -163,6 +163,12 @@ var TagUIActions = actions.Actions({ .concat(this.data ? this.data.tags.tags() : []) .unique() }, + // XXX lazy tag search/add dialog... + // - initially empty + // - focus dialog search + // - on update show list of matching tags + // XXX + // XXX add support for tag sets and paths... showTagCloud: ['Tag|Edit|Image/$Tags...', core.doc`Show tags in cloud format... diff --git a/ui (gen4)/imagegrid/file.js b/ui (gen4)/imagegrid/file.js index f1ef5255..edcc5b77 100755 --- a/ui (gen4)/imagegrid/file.js +++ b/ui (gen4)/imagegrid/file.js @@ -354,8 +354,6 @@ function(path, index_dir, logger){ .on('end', function(files){ var data = groupByDate(files) - console.log('>>>>>', data) - // XXX should we mark the root timestamp in any way??? if('root' in data && data.root.length > 0){ // XXX handle stat error... diff --git a/ui (gen4)/imagegrid/tags.js b/ui (gen4)/imagegrid/tags.js index 7230d354..ad954dca 100755 --- a/ui (gen4)/imagegrid/tags.js +++ b/ui (gen4)/imagegrid/tags.js @@ -351,6 +351,27 @@ var TagsPrototype = { } }, + // + // .search(str) + // .search(regexp) + // -> matches + // + // .search(str, list) + // .search(regexp, list) + // -> matches + // + // XXX should this return a list of matching tags of a list of values??? + // ....or should we have a similar method to search values?? + // XXX should we .match(..) the results??? + // ...not sure if this is needed as we are taking .tags() as input... + // on the other hand we'd need to normalize the search string somehow... + search: function(str, tags){ + // XXX should we do any pre-processing??? + str = str instanceof RegExp ? str : RegExp(str) + return (tags || this.tags()) + .filter(function(tag){ + return str.test(tag) }) }, + // Introspection... //