Commit e319d5d04685d0ce30025b5a82b1ae420b03f93f
- Diff rendering mode:
- inline
- side by side
swtr/static/js/swtmaker.js
(0 / 37)
  | |||
413 | 413 | //annotation.text = {}; // creating new text object - to contain comments, labels, links and tags | |
414 | 414 | }, | |
415 | 415 | ||
416 | //to add the final annotation | ||
417 | //save button - event bind | ||
418 | addNewAnno: function(event){ | ||
419 | var $selected = $('select option:selected').val(); | ||
420 | var textInput = $('.annotorious-editor textarea').val(); | ||
421 | if($('select option:selected').val() === "Tags") { | ||
422 | //this.newanno.text[$selected] = $("#tagsInput").tags().getTags(); | ||
423 | } | ||
424 | else { | ||
425 | console.log($selected); | ||
426 | //this.newanno.text[$selected] = textInput; | ||
427 | } | ||
428 | // var newanno = this.newanno; | ||
429 | // anno.addAnnotation(newanno); | ||
430 | }, | ||
431 | /*addNewAnno: function(event){ // function for form input UI | ||
432 | var tags = $('#tags').val(); | ||
433 | var label = $('#label').val(); | ||
434 | var link = $('#links').val(); | ||
435 | var text = $('.annotorious-editor textarea').val(); | ||
436 | var finalInput = ' Label: '+label+' Comment: '+text+' Tags: '+tags+' Links: '+link; | ||
437 | //this.annoTemplate(label, text, tags, link); | ||
438 | // this.annoTemplate(label, text, tags, link); | ||
439 | var src = $('#img-url-input').val(); | ||
440 | var newanno = {'src':src, 'text':finalInput, 'shapes': [{'type':annotation.shape.type, 'geometry':{'x':annotation.shape.geometry.x, 'y':annotation.shape.geometry.y, 'width':annotation.shape.geometry.width, 'height':annotation.shape.geometry.height}},], 'context':window.location.origin}; | ||
441 | console.log(newanno); | ||
442 | anno.addAnnotation(newanno); | ||
443 | },*/ | ||
444 | |||
445 | 416 | //dropdown event | |
446 | 417 | getFormValue: function(event) { | |
447 | 418 | console.log('getFormValue()'); | |
… | … | ||
438 | 438 | field = $selected.text().toLowerCase(); | |
439 | 439 | self.new_anno[field] = $("#tagsInput").tags().getTags(); | |
440 | 440 | $("#tagsInput").show(); | |
441 | // if(textInput && !($($selected).val() === "Tags")) { | ||
442 | // //annotation.text[$selected.prev().text()] = textInput; | ||
443 | // annotation.text[$($selected).val()] = textInput; // Gets the current selection from | ||
444 | // // the option menu for choosing comments, tags, etc. | ||
445 | // } else { | ||
446 | // console.log("else tags"); | ||
447 | // console.log(textInput); | ||
448 | // annotation.text[$($selected).val()] = ''; | ||
449 | 441 | ||
450 | 442 | } else { | |
451 | 443 | $("#tagsInput").hide(); |