Commit fea2ba5e by lduarte1991

Annotation Tools: Bug fixes - tinymce bug after exiting full screen, stupid…

Annotation Tools: Bug fixes - tinymce bug after exiting full screen, stupid check for type, missing tag subscriptions
parent 14dfe9a1
...@@ -1053,6 +1053,14 @@ OpenSeadragonAnnotation = function (element, options) { ...@@ -1053,6 +1053,14 @@ OpenSeadragonAnnotation = function (element, options) {
document.addEventListener("msfullscreenchange", function () { document.addEventListener("msfullscreenchange", function () {
reloadEditor(); reloadEditor();
}, false); }, false);
// for some reason the above doesn't work when person hits ESC to exit full screen...
$(document).keyup(function(e) {
// esc key reloads editor as well
if (e.keyCode == 27) {
reloadEditor();
}
});
this.options = options; this.options = options;
......
...@@ -64,14 +64,24 @@ Annotator.Plugin.Reply = (function(_super) { ...@@ -64,14 +64,24 @@ Annotator.Plugin.Reply = (function(_super) {
// New JSON for the database // New JSON for the database
Reply.prototype.pluginSubmit = function(field, annotation) { Reply.prototype.pluginSubmit = function(field, annotation) {
var replyItem = $(this.annotator.editor.element).find(".reply-item span.parent-annotation"), // since each annotation has their own reply item, this "find" is element specific
parent = replyItem.html()!=''?replyItem.html():'0'; var replyItem = $(this.annotator.editor.element).find(".reply-item span.parent-annotation");
console.log(parent); // checks to see if the current annotation is a reply by checking parent numbers
console.log(replyItem.html()); var parent = replyItem.html() !== '' ? replyItem.html() : '0';
if (parent!='0') annotation.media = 'comment'; // if the parent number is not empty or zero, we know that this is a comment
annotation.parent = parent;//set 0, because it is not a reply if (parent !== '0') {
console.log(annotation.parent); annotation.media = 'comment';
return annotation.parent; }
// apparently some browsers continue adding <font> tags here for nonreplies
// this will check and set to 0 (nonreply) if it fails
if (parseInt(parent, 10) === NaN){
parent = '0';
}
// set 0, because it is not a reply
annotation.parent = parent;
return annotation.parent;
}; };
......
...@@ -293,6 +293,8 @@ $.TokenList = function (input, url_or_data, settings) { ...@@ -293,6 +293,8 @@ $.TokenList = function (input, url_or_data, settings) {
case KEY.COMMA: case KEY.COMMA:
if(selected_dropdown_item) { if(selected_dropdown_item) {
add_token($(selected_dropdown_item).data("tokeninput")); add_token($(selected_dropdown_item).data("tokeninput"));
// this allows for tags to be color-coded based on instructor set-up
annotator.publish("colorEditorTags")
hidden_input.change(); hidden_input.change();
return false; return false;
} else{ } else{
...@@ -903,6 +905,7 @@ Annotator.Plugin.HighlightTags = (function(_super) { ...@@ -903,6 +905,7 @@ Annotator.Plugin.HighlightTags = (function(_super) {
this.colorize = __bind(this.colorize, this); this.colorize = __bind(this.colorize, this);
this.updateField = __bind(this.updateField, this); this.updateField = __bind(this.updateField, this);
this.externalCall = __bind(this.externalCall, this); this.externalCall = __bind(this.externalCall, this);
this.colorizeEditorTags = __bind(this.colorizeEditorTags, this);
this.options = options; this.options = options;
_ref = HighlightTags.__super__.constructor.apply(this, arguments); _ref = HighlightTags.__super__.constructor.apply(this, arguments);
...@@ -954,7 +957,7 @@ Annotator.Plugin.HighlightTags = (function(_super) { ...@@ -954,7 +957,7 @@ Annotator.Plugin.HighlightTags = (function(_super) {
this.annotator.subscribe('flaggedAnnotation', this.updateViewer); this.annotator.subscribe('flaggedAnnotation', this.updateViewer);
this.annotator.subscribe('annotationCreated', function(){setTimeout(function(){self.colorize()}, 1000)}); this.annotator.subscribe('annotationCreated', function(){setTimeout(function(){self.colorize()}, 1000)});
this.annotator.subscribe('externalCallToHighlightTags', function(){setTimeout(function(){self.externalCall()}, 1000)}); this.annotator.subscribe('externalCallToHighlightTags', function(){setTimeout(function(){self.externalCall()}, 1000)});
this.annotator.subscribe('colorEditorTags', this.colorizeEditorTags);
}; };
HighlightTags.prototype.getHighlightTags = function(){ HighlightTags.prototype.getHighlightTags = function(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment