diff --git a/ui/index.html b/ui/index.html
index 261fa95c..b4790a1d 100755
--- a/ui/index.html
+++ b/ui/index.html
@@ -38,6 +38,7 @@
+
diff --git a/ui/tags.js b/ui/tags.js
index c9c2cca1..0dabadeb 100755
--- a/ui/tags.js
+++ b/ui/tags.js
@@ -25,11 +25,16 @@ function buildTagsFromImages(images){
/*********************************************************************/
function addTag(tags, gid, tagset, images){
- tags = typeof(tag) == typeof('str') ? [ tags ] : tag
+ tags = typeof(tags) == typeof('str') ? [ tags ] : tags
gid = gid == null ? getImageGID() : gid
tagset = tagset == null ? TAGS : tagset
images = images == null ? IMAGES : images
-
+
+ var img = images[gid]
+ if(img.tags == null){
+ img.tags = []
+ }
+
// add tags to tagset...
tags.map(function(tag){
var set = tagset[tag]
@@ -37,13 +42,15 @@ function addTag(tags, gid, tagset, images){
set = []
tagset[tag] = set
}
- set.push(tag)
- set.sort()
- })
+ if(set.indexOf(tag) < 0){
+ set.push(tag)
+ set.sort()
+ }
- // add tag to image...
- var img = images[gid]
- img.tags = img.tags == null ? tags : img.tags.concat(tags)
+ if(img.tags.indexOf(tag) < 0){
+ img.tags.push(tag)
+ }
+ })
// XXX hardcoded and not customizable...
IMAGES_UPDATED.push(gid)
@@ -51,7 +58,7 @@ function addTag(tags, gid, tagset, images){
function removeTag(tags, gid, tagset, images){
- tags = typeof(tag) == typeof('str') ? [ tags ] : tag
+ tags = typeof(tags) == typeof('str') ? [ tags ] : tags
gid = gid == null ? getImageGID() : gid
tagset = tagset == null ? TAGS : tagset
images = images == null ? IMAGES : images
@@ -63,9 +70,10 @@ function removeTag(tags, gid, tagset, images){
tags.map(function(tag){
var set = tagset[tag]
if(set != null && set.indexOf(tag) >= 0){
- updated = true
-
set.splice(set.indexOf(tag), 1)
+ }
+ if(img.tags != null && img.tags.indexOf(tag) >= 0){
+ updated = true
img.tags.splice(img.tags.indexOf(tag), 1)
// clear the tags...
@@ -116,10 +124,11 @@ function selectByTags(tags, tagset){
}
-function getTags(){
+function getTags(gid){
}
+// XXX don't remember the semantics...
function getRelatedTags(){
}
diff --git a/ui/ui.js b/ui/ui.js
index 587006cf..64362d6e 100755
--- a/ui/ui.js
+++ b/ui/ui.js
@@ -1203,6 +1203,8 @@ function showImageInfo(){
var comment = data.comment
comment = comment == null ? '' : comment
comment = comment.replace(/\n/g, '
')
+ var tags = data.tags
+ tags = tags == null ? '' : tags.join(', ')
return formDialog(null,
('