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