diff --git a/common/lib/xmodule/xmodule/textannotation_module.py b/common/lib/xmodule/xmodule/textannotation_module.py index 1d732d8709..fa183dab51 100644 --- a/common/lib/xmodule/xmodule/textannotation_module.py +++ b/common/lib/xmodule/xmodule/textannotation_module.py @@ -81,6 +81,7 @@ class TextAnnotationModule(AnnotatableFields, XModule): def get_html(self): """ Renders parameters to template. """ context = { + 'course_id': self.runtime.course_id, 'display_name': self.display_name_with_default, 'tag': self.tags, 'source': self.source, diff --git a/common/lib/xmodule/xmodule/videoannotation_module.py b/common/lib/xmodule/xmodule/videoannotation_module.py index 5f31509d01..3bd0607044 100644 --- a/common/lib/xmodule/xmodule/videoannotation_module.py +++ b/common/lib/xmodule/xmodule/videoannotation_module.py @@ -149,6 +149,7 @@ class VideoAnnotationModule(AnnotatableFields, XModule): extension = self._get_extension(self.sourceurl) context = { + 'course_id': self.runtime.course_id, 'display_name': self.display_name_with_default, 'instructions_html': self.instructions, 'sourceUrl': self.sourceurl, diff --git a/lms/templates/textannotation.html b/lms/templates/textannotation.html index 3532681051..5d2a3c48ff 100644 --- a/lms/templates/textannotation.html +++ b/lms/templates/textannotation.html @@ -43,17 +43,14 @@ $(this).parents('.annotatable-section:first').find('.annotatable-instructions')[slideMethod](); } $('.annotatable-toggle-instructions').on('click', onClickHideInstructions); - + //Grab uri of the course - var parts = window.location.href.split("/"), + var parts = window.location.href.split("/"), uri = '', - courseid; for (var index = 0; index <= 9; index += 1) uri += parts[index]+"/"; //Get the unit url - courseid = parts[4] + "/" + parts[5] + "/" + parts[6]; //Change uri in cms var lms_location = $('.sidebar .preview-button').attr('href'); if (typeof lms_location!='undefined'){ - courseid = parts[4].split(".").join("/"); uri = window.location.protocol; for (var index = 0; index <= 9; index += 1) uri += lms_location.split("/")[index]+"/"; //Get the unit url } @@ -63,16 +60,16 @@ optionsAnnotator: { permissions:{ user: { - id:"${user.email}", + id:"${user.email}", name:"${user.username}" }, userString: function (user) { - if (user && user.name) + if (user && user.name) return user.name; return user; }, userId: function (user) { - if (user && user.id) + if (user && user.id) return user.id; return user; }, @@ -96,7 +93,7 @@ } for (_i = 0, _len = tokens.length; _i < _len; _i++) { token = tokens[_i]; - + if (this.userId(user) === token) { return true; @@ -115,7 +112,7 @@ }, }, auth: { - tokenUrl: location.protocol+'//'+location.host+"/token?course_id="+courseid + tokenUrl: location.protocol+'//'+location.host+"/token?course_id=${course_id.to_deprecated_string()}" }, store: { // The endpoint of the store on your server. @@ -161,11 +158,11 @@ } }, }; - + var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/"; tinyMCE.baseURL = "${settings.STATIC_URL}" + "js/vendor/ova"; - + //remove old instances if (Annotator._instances.length !== 0) { $('#textHolder').annotator("destroy"); @@ -173,8 +170,8 @@ delete ova; //Load the plugin Video/Text Annotation var ova = new OpenVideoAnnotation.Annotator($('#textHolder'),options); - - + + //Catch var annotator = ova.annotator, catchOptions = { diff --git a/lms/templates/videoannotation.html b/lms/templates/videoannotation.html index 407ec43193..589b24af19 100644 --- a/lms/templates/videoannotation.html +++ b/lms/templates/videoannotation.html @@ -23,14 +23,14 @@ - +