experimenting with text tag search...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-12-08 17:52:03 +03:00
parent 74517e5c03
commit 228c5a1dc2
3 changed files with 27 additions and 2 deletions

View File

@ -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...

View File

@ -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...

View File

@ -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...
//