Commit 8e71240028334d537affd6a22696575e8ba56de3

Prettify the editor box in image annotation. Editing the annotation is still broken.
  • Diff rendering mode:
  • inline
  • side by side

swtr/static/css/swtmaker.css

3}3}
4/* styles modifying annotorious editor default styles */4/* styles modifying annotorious editor default styles */
5.annotorious-editor {5.annotorious-editor {
6 min-width: 250px;
6 min-width: 270px;
7}7}
8#header {8#header {
9 z-index: 1;9 z-index: 1;

swtr/static/js/img_swtr.js

184 annotation.title = self.new_anno.title;184 annotation.title = self.new_anno.title;
185 }185 }
186 annotation.text = self.new_anno.text;186 annotation.text = self.new_anno.text;
187 console.log(self.new_anno, annotation);
187 //annotation.editable = false;
188 //console.log(self.new_anno, annotation);
188 },189 },
189 // hide the original editor window, when user has completed selecting part190 // hide the original editor window, when user has completed selecting part
190 // of the image to annotate..191 // of the image to annotate..
195 self.new_anno = {};195 self.new_anno = {};
196 $('#tags-input').tags({196 $('#tags-input').tags({
197 tagSize: 'md',197 tagSize: 'md',
198 promptText: 'Type word (and press enter)..',
198 promptText: 'Add tags: type a word (and press enter)',
199 caseInsensitive: true,199 caseInsensitive: true,
200 suggestions: self.tags_suggestions200 suggestions: self.tags_suggestions
201 });201 });
224 self.new_anno['tags'] = $(element).tags().getTags();224 self.new_anno['tags'] = $(element).tags().getTags();
225 console.log(index, $('#tags-input').tags().getTags() );225 console.log(index, $('#tags-input').tags().getTags() );
226 }226 }
227
228 });227 });
229 // show the editor field to input text228 // show the editor field to input text
230 /* var $anno_form = $('.annotorious-editor-text');229 /* var $anno_form = $('.annotorious-editor-text');
251 caseInsensitive: true,251 caseInsensitive: true,
252 suggestions: self.tags_suggestions252 suggestions: self.tags_suggestions
253 });253 });
254
255
256 /* $anno_form.val('');254 /* $anno_form.val('');
257 $anno_form.attr('placeholder', 'Add ' + $selected.text());255 $anno_form.attr('placeholder', 'Add ' + $selected.text());
258 console.log(self.new_anno);*/256 console.log(self.new_anno);*/
264 text += (annotation.comment) ? '<p>' + annotation.comment + '</p>' : '';264 text += (annotation.comment) ? '<p>' + annotation.comment + '</p>' : '';
265265
266 // link266 // link
267 text += (annotation.link) ? '<a target="blank" href="' +
267 text += (annotation.link) ? '<p><a target="blank" href="' +
268 swtr.utils.linkify(annotation.link) + '">' + annotation.link +268 swtr.utils.linkify(annotation.link) + '">' + annotation.link +
269 '</a>' : '';
269 '</a></p>' : '';
270270
271 // tags271 // tags
272 text += (annotation.tags) ? '<p>' + annotation.tags + '</p>' : '';
272 text += (annotation.tags) ? '<p>[' + annotation.tags + ']</p>' : '';
273273
274 // if older annotation i.e w/o comment,title etc fields274 // if older annotation i.e w/o comment,title etc fields
275 // add text field as text275 // add text field as text

swtr/templates/index.html

262 </select>262 </select>
263 </script-->263 </script-->
264 <script type="text/template" id="customEdit-template">264 <script type="text/template" id="customEdit-template">
265 <textarea id="title-input" class="annotorious-editor-text goog-textarea" placeholder="Add
266 Title" tabindex="1" rows="2" style="overflow-y: hidden; overflow-x:
267 auto; box-sizing: border-box; height: 23px; padding-bottom:
268 4px;"></textarea>
269 <textarea id="link-input" class="annotorious-editor-text goog-textarea" placeholder="Add
270 Links" tabindex="1" rows="3" style="overflow-y: hidden; overflow-x: auto;
265 <textarea id="title-input" class="annotorious-editor-text goog-textarea"
266 placeholder="Add Title" tabindex="1" rows="2"
267 style="overflow-y: hidden; overflow-x: auto; box-sizing: border-box; height: 23px;
268 padding-bottom: 4px;"></textarea>
269 <textarea id="link-input" class="annotorious-editor-text goog-textarea"
270 placeholder="Add Links" tabindex="1" rows="3" style="overflow-y: hidden; overflow-x: auto;
271 box-sizing: border-box; height: 23px; padding-bottom: 4px;"></textarea>271 box-sizing: border-box; height: 23px; padding-bottom: 4px;"></textarea>
272 <div id="tags-input" class="annotorious-editor-text goog-textarea"
272 <div id="tags-input" class="annotorious-editor-text goog-textarea"
273 placeholder="" tabindex="1" rows="4" style="overflow-y: auto; overflow-x:273 placeholder="" tabindex="1" rows="4" style="overflow-y: auto; overflow-x:
274 hidden;
275 box-sizing: border-box; height: 23px; padding-bottom: 4px;"></textarea>
274 hidden; box-sizing: border-box; height: 23px; padding-bottom: 4px;"></div>
276 </script>275 </script>
277 <script type="text/template" id="popup-template">276 <script type="text/template" id="popup-template">
278 <span class="annotorious-popup-text">277 <span class="annotorious-popup-text">