mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
cleanup and notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
22733f9045
commit
b13206c533
@ -33,11 +33,11 @@ var TagsClassPrototype = {
|
|||||||
// XXX should this sort sets???
|
// XXX should this sort sets???
|
||||||
// XXX should this be .normalizeTags(..) ???
|
// XXX should this be .normalizeTags(..) ???
|
||||||
normalize: function(...tags){
|
normalize: function(...tags){
|
||||||
var tagRemovedCahrs = (this.config || {})['tagRemovedCahrs']
|
var tagRemovedChars = (this.config || {})['tagRemovedChars']
|
||||||
tagRemovedCahrs = tagRemovedCahrs instanceof RegExp ?
|
tagRemovedChars = tagRemovedChars instanceof RegExp ?
|
||||||
tagRemovedCahrs
|
tagRemovedChars
|
||||||
: typeof(tagRemovedCahrs) == typeof('str') ?
|
: typeof(tagRemovedChars) == typeof('str') ?
|
||||||
new RegExp(tagRemovedCahrs, 'g')
|
new RegExp(tagRemovedChars, 'g')
|
||||||
: /[\s-_]/g
|
: /[\s-_]/g
|
||||||
var res = (tags.length == 1 && tags[0] instanceof Array) ?
|
var res = (tags.length == 1 && tags[0] instanceof Array) ?
|
||||||
tags.pop()
|
tags.pop()
|
||||||
@ -47,7 +47,7 @@ var TagsClassPrototype = {
|
|||||||
return tag
|
return tag
|
||||||
.trim()
|
.trim()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.replace(tagRemovedCahrs, '')
|
.replace(tagRemovedChars, '')
|
||||||
// XXX do we need to sort here???
|
// XXX do we need to sort here???
|
||||||
.split(/:/)
|
.split(/:/)
|
||||||
.sort()
|
.sort()
|
||||||
@ -71,9 +71,13 @@ var TagsClassPrototype = {
|
|||||||
// - paths
|
// - paths
|
||||||
// - sets/relations
|
// - sets/relations
|
||||||
// - tag-object references
|
// - tag-object references
|
||||||
|
// XXX should we store normalized and non-normalized tags for reference???
|
||||||
|
// ...there are two ways to think of this:
|
||||||
|
// 1) both (a-la flickr) -- keep both, use normalized internally
|
||||||
|
// 2) only normalized -- simpler but may surprise the user and not be as pretty...
|
||||||
var TagsPrototype = {
|
var TagsPrototype = {
|
||||||
config: {
|
config: {
|
||||||
tagRemovedCahrs: '\\s-_',
|
tagRemovedChars: '\\s-_',
|
||||||
},
|
},
|
||||||
|
|
||||||
// Utils...
|
// Utils...
|
||||||
@ -88,10 +92,22 @@ var TagsPrototype = {
|
|||||||
|
|
||||||
|
|
||||||
get length(){
|
get length(){
|
||||||
|
// XXX number of elements (values)...
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Tags present in the system...
|
||||||
|
//
|
||||||
|
// NOTE: this includes all the .persistent tags as well as all the
|
||||||
|
// tags actually used.
|
||||||
tags: function(){
|
tags: function(){
|
||||||
|
// XXX
|
||||||
|
},
|
||||||
|
// XXX need a way to add/remove these...
|
||||||
|
persistent: function(){
|
||||||
|
// XXX
|
||||||
},
|
},
|
||||||
values: function(){
|
values: function(){
|
||||||
|
// XXX
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user