Annotation Tools: Bug fixes - tinymce bug after exiting full screen, stupid check for type, missing tag subscriptions
This commit is contained in:
@@ -1053,6 +1053,14 @@ OpenSeadragonAnnotation = function (element, options) {
|
||||
document.addEventListener("msfullscreenchange", function () {
|
||||
reloadEditor();
|
||||
}, 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;
|
||||
|
||||
|
||||
26
common/static/js/vendor/ova/reply-annotator.js
vendored
26
common/static/js/vendor/ova/reply-annotator.js
vendored
@@ -64,14 +64,24 @@ Annotator.Plugin.Reply = (function(_super) {
|
||||
|
||||
// New JSON for the database
|
||||
Reply.prototype.pluginSubmit = function(field, annotation) {
|
||||
var replyItem = $(this.annotator.editor.element).find(".reply-item span.parent-annotation"),
|
||||
parent = replyItem.html()!=''?replyItem.html():'0';
|
||||
console.log(parent);
|
||||
console.log(replyItem.html());
|
||||
if (parent!='0') annotation.media = 'comment';
|
||||
annotation.parent = parent;//set 0, because it is not a reply
|
||||
console.log(annotation.parent);
|
||||
return annotation.parent;
|
||||
// since each annotation has their own reply item, this "find" is element specific
|
||||
var replyItem = $(this.annotator.editor.element).find(".reply-item span.parent-annotation");
|
||||
// checks to see if the current annotation is a reply by checking parent numbers
|
||||
var parent = replyItem.html() !== '' ? replyItem.html() : '0';
|
||||
// if the parent number is not empty or zero, we know that this is a comment
|
||||
if (parent !== '0') {
|
||||
annotation.media = 'comment';
|
||||
}
|
||||
|
||||
// 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) {
|
||||
case KEY.COMMA:
|
||||
if(selected_dropdown_item) {
|
||||
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();
|
||||
return false;
|
||||
} else{
|
||||
@@ -903,6 +905,7 @@ Annotator.Plugin.HighlightTags = (function(_super) {
|
||||
this.colorize = __bind(this.colorize, this);
|
||||
this.updateField = __bind(this.updateField, this);
|
||||
this.externalCall = __bind(this.externalCall, this);
|
||||
this.colorizeEditorTags = __bind(this.colorizeEditorTags, this);
|
||||
|
||||
this.options = options;
|
||||
_ref = HighlightTags.__super__.constructor.apply(this, arguments);
|
||||
@@ -954,7 +957,7 @@ Annotator.Plugin.HighlightTags = (function(_super) {
|
||||
this.annotator.subscribe('flaggedAnnotation', this.updateViewer);
|
||||
this.annotator.subscribe('annotationCreated', function(){setTimeout(function(){self.colorize()}, 1000)});
|
||||
this.annotator.subscribe('externalCallToHighlightTags', function(){setTimeout(function(){self.externalCall()}, 1000)});
|
||||
|
||||
this.annotator.subscribe('colorEditorTags', this.colorizeEditorTags);
|
||||
};
|
||||
|
||||
HighlightTags.prototype.getHighlightTags = function(){
|
||||
|
||||
Reference in New Issue
Block a user