mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
experimenting with text tag search...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
74517e5c03
commit
228c5a1dc2
@ -163,6 +163,12 @@ var TagUIActions = actions.Actions({
|
|||||||
.concat(this.data ? this.data.tags.tags() : [])
|
.concat(this.data ? this.data.tags.tags() : [])
|
||||||
.unique() },
|
.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...
|
// XXX add support for tag sets and paths...
|
||||||
showTagCloud: ['Tag|Edit|Image/$Tags...',
|
showTagCloud: ['Tag|Edit|Image/$Tags...',
|
||||||
core.doc`Show tags in cloud format...
|
core.doc`Show tags in cloud format...
|
||||||
|
|||||||
@ -354,8 +354,6 @@ function(path, index_dir, logger){
|
|||||||
.on('end', function(files){
|
.on('end', function(files){
|
||||||
var data = groupByDate(files)
|
var data = groupByDate(files)
|
||||||
|
|
||||||
console.log('>>>>>', data)
|
|
||||||
|
|
||||||
// XXX should we mark the root timestamp in any way???
|
// XXX should we mark the root timestamp in any way???
|
||||||
if('root' in data && data.root.length > 0){
|
if('root' in data && data.root.length > 0){
|
||||||
// XXX handle stat error...
|
// XXX handle stat error...
|
||||||
|
|||||||
@ -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...
|
// Introspection...
|
||||||
//
|
//
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user