From 8e71240028334d537affd6a22696575e8ba56de3 Mon Sep 17 00:00:00 2001
From: Anon Ray
Date: Wed, 3 Sep 2014 19:01:03 +0530
Subject: [PATCH] Prettify the editor box in image annotation. Editing the
annotation is still broken.
---
swtr/static/css/swtmaker.css | 2 +-
swtr/static/js/img_swtr.js | 14 ++++++--------
swtr/templates/index.html | 17 ++++++++---------
3 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/swtr/static/css/swtmaker.css b/swtr/static/css/swtmaker.css
index 168d68a..0ba3f98 100644
--- a/swtr/static/css/swtmaker.css
+++ b/swtr/static/css/swtmaker.css
@@ -3,7 +3,7 @@ body {
}
/* styles modifying annotorious editor default styles */
.annotorious-editor {
- min-width: 250px;
+ min-width: 270px;
}
#header {
z-index: 1;
diff --git a/swtr/static/js/img_swtr.js b/swtr/static/js/img_swtr.js
index 341e97a..06ad3e0 100644
--- a/swtr/static/js/img_swtr.js
+++ b/swtr/static/js/img_swtr.js
@@ -184,7 +184,8 @@
annotation.title = self.new_anno.title;
}
annotation.text = self.new_anno.text;
- console.log(self.new_anno, annotation);
+ //annotation.editable = false;
+ //console.log(self.new_anno, annotation);
},
// hide the original editor window, when user has completed selecting part
// of the image to annotate..
@@ -194,7 +195,7 @@
self.new_anno = {};
$('#tags-input').tags({
tagSize: 'md',
- promptText: 'Type word (and press enter)..',
+ promptText: 'Add tags: type a word (and press enter)',
caseInsensitive: true,
suggestions: self.tags_suggestions
});
@@ -223,7 +224,6 @@
self.new_anno['tags'] = $(element).tags().getTags();
console.log(index, $('#tags-input').tags().getTags() );
}
-
});
// show the editor field to input text
/* var $anno_form = $('.annotorious-editor-text');
@@ -251,8 +251,6 @@
caseInsensitive: true,
suggestions: self.tags_suggestions
});
-
-
/* $anno_form.val('');
$anno_form.attr('placeholder', 'Add ' + $selected.text());
console.log(self.new_anno);*/
@@ -266,12 +264,12 @@
text += (annotation.comment) ? '' + annotation.comment + '
' : '';
// link
- text += (annotation.link) ? '' + annotation.link +
- '' : '';
+ '
' : '';
// tags
- text += (annotation.tags) ? '' + annotation.tags + '
' : '';
+ text += (annotation.tags) ? '[' + annotation.tags + ']
' : '';
// if older annotation i.e w/o comment,title etc fields
// add text field as text
diff --git a/swtr/templates/index.html b/swtr/templates/index.html
index b025c1d..7bb3261 100644
--- a/swtr/templates/index.html
+++ b/swtr/templates/index.html
@@ -262,17 +262,16 @@