Commit 3c6a3bac by Sarina Canelake

Merge pull request #4825 from edx/sarina/annotations-fixes

Sarina/annotations fixes
parents 9b53c809 c5f85eff
...@@ -371,6 +371,23 @@ PIPELINE_CSS = { ...@@ -371,6 +371,23 @@ PIPELINE_CSS = {
], ],
'output_filename': 'css/cms-style-xmodule.css', 'output_filename': 'css/cms-style-xmodule.css',
}, },
'style-xmodule-annotations': {
'source_filenames': [
'css/vendor/ova/annotator.css',
'css/vendor/ova/edx-annotator.css',
'css/vendor/ova/video-js.min.css',
'css/vendor/ova/rangeslider.css',
'css/vendor/ova/share-annotator.css',
'css/vendor/ova/richText-annotator.css',
'css/vendor/ova/tags-annotator.css',
'css/vendor/ova/flagging-annotator.css',
'css/vendor/ova/diacritic-annotator.css',
'css/vendor/ova/grouping-annotator.css',
'css/vendor/ova/ova.css',
'js/vendor/ova/catch/css/main.css'
],
'output_filename': 'css/cms-style-xmodule-annotations.css',
},
} }
# test_order: Determines the position of this chunk of javascript on # test_order: Determines the position of this chunk of javascript on
......
...@@ -82,6 +82,27 @@ ...@@ -82,6 +82,27 @@
"URI": "js/vendor/URI.min", "URI": "js/vendor/URI.min",
"ieshim": "js/src/ie_shim", "ieshim": "js/src/ie_shim",
"tooltip_manager": "js/src/tooltip_manager", "tooltip_manager": "js/src/tooltip_manager",
// Files needed for Annotations feature
"annotator": "js/vendor/ova/annotator-full",
"annotator-harvardx": "js/vendor/ova/annotator-full-firebase-auth",
"video.dev": "js/vendor/ova/video.dev",
"vjs.youtube": 'js/vendor/ova/vjs.youtube',
"rangeslider": 'js/vendor/ova/rangeslider',
"share-annotator": 'js/vendor/ova/share-annotator',
"richText-annotator": 'js/vendor/ova/richText-annotator',
"reply-annotator": 'js/vendor/ova/reply-annotator',
"grouping-annotator": 'js/vendor/ova/grouping-annotator',
"tags-annotator": 'js/vendor/ova/tags-annotator',
"diacritic-annotator": 'js/vendor/ova/diacritic-annotator',
"flagging-annotator": 'js/vendor/ova/flagging-annotator',
"jquery-Watch": 'js/vendor/ova/jquery-Watch',
"openseadragon": 'js/vendor/ova/openseadragon',
"osda": 'js/vendor/ova/OpenSeaDragonAnnotation',
"ova": 'js/vendor/ova/ova',
"catch": 'js/vendor/ova/catch/js/catch',
"handlebars": 'js/vendor/ova/catch/js/handlebars-1.1.2',
// end of Annotation tool files
// externally hosted files // externally hosted files
"tender": [ "tender": [
...@@ -232,7 +253,54 @@ ...@@ -232,7 +253,54 @@
"coffee/src/logger": { "coffee/src/logger": {
exports: "Logger", exports: "Logger",
deps: ["coffee/src/ajax_prefix"] deps: ["coffee/src/ajax_prefix"]
} },
// the following are all needed for annotation tools
"video.dev": {
exports:"videojs"
},
"vjs.youtube": {
deps: ["video.dev"]
},
"rangeslider": {
deps: ["video.dev"]
},
"annotator": {
exports: "Annotator"
},
"annotator-harvardx":{
deps: ["annotator"]
},
"share-annotator": {
deps: ["annotator"]
},
"richText-annotator": {
deps: ["annotator", "tinymce"]
},
"reply-annotator": {
deps: ["annotator"]
},
"tags-annotator": {
deps: ["annotator"]
},
"diacritic-annotator": {
deps: ["annotator"]
},
"flagging-annotator": {
deps: ["annotator"]
},
"grouping-annotator": {
deps: ["annotator"]
},
"ova":{
exports: "ova",
deps: ["annotator", "annotator-harvardx", "video.dev", "vjs.youtube", "rangeslider", "share-annotator", "richText-annotator", "reply-annotator", "tags-annotator", "flagging-annotator", "grouping-annotator", "diacritic-annotator", "jquery-Watch", "catch", "handlebars", "URI"]
},
"osda":{
exports: "osda",
deps: ["annotator", "annotator-harvardx", "video.dev", "vjs.youtube", "rangeslider", "share-annotator", "richText-annotator", "reply-annotator", "tags-annotator", "flagging-annotator", "grouping-annotator", "diacritic-annotator", "openseadragon", "jquery-Watch", "catch", "handlebars", "URI"]
},
// end of annotation tool files
}, },
// load jquery and gettext automatically // load jquery and gettext automatically
deps: ["jquery", "gettext"], deps: ["jquery", "gettext"],
......
...@@ -130,8 +130,8 @@ class ImageAnnotationModule(AnnotatableFields, XModule): ...@@ -130,8 +130,8 @@ class ImageAnnotationModule(AnnotatableFields, XModule):
'annotation_mode': self.annotation_mode, 'annotation_mode': self.annotation_mode,
} }
fragment = Fragment(self.system.render_template('imageannotation.html', context)) fragment = Fragment(self.system.render_template('imageannotation.html', context))
fragment.add_javascript_url("/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js") fragment.add_javascript_url(self.runtime.STATIC_URL + "js/vendor/tinymce/js/tinymce/tinymce.full.min.js")
fragment.add_javascript_url("/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js") fragment.add_javascript_url(self.runtime.STATIC_URL + "js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js")
return fragment return fragment
......
...@@ -127,8 +127,8 @@ class TextAnnotationModule(AnnotatableFields, XModule): ...@@ -127,8 +127,8 @@ class TextAnnotationModule(AnnotatableFields, XModule):
'annotation_mode': self.annotation_mode, 'annotation_mode': self.annotation_mode,
} }
fragment = Fragment(self.system.render_template('textannotation.html', context)) fragment = Fragment(self.system.render_template('textannotation.html', context))
fragment.add_javascript_url("/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js") fragment.add_javascript_url(self.runtime.STATIC_URL + "js/vendor/tinymce/js/tinymce/tinymce.full.min.js")
fragment.add_javascript_url("/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js") fragment.add_javascript_url(self.runtime.STATIC_URL + "js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js")
return fragment return fragment
......
...@@ -133,8 +133,8 @@ class VideoAnnotationModule(AnnotatableFields, XModule): ...@@ -133,8 +133,8 @@ class VideoAnnotationModule(AnnotatableFields, XModule):
'annotation_mode': self.annotation_mode, 'annotation_mode': self.annotation_mode,
} }
fragment = Fragment(self.system.render_template('videoannotation.html', context)) fragment = Fragment(self.system.render_template('videoannotation.html', context))
fragment.add_javascript_url("/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js") fragment.add_javascript_url(self.runtime.STATIC_URL + "js/vendor/tinymce/js/tinymce/tinymce.full.min.js")
fragment.add_javascript_url("/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js") fragment.add_javascript_url(self.runtime.STATIC_URL + "js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js")
return fragment return fragment
......
...@@ -352,7 +352,7 @@ CatchAnnotation.prototype = { ...@@ -352,7 +352,7 @@ CatchAnnotation.prototype = {
// if the default tab is instructor, we must refresh the catch to pull the ones // if the default tab is instructor, we must refresh the catch to pull the ones
// under the instructor's email. Calling changeUserId will update this.options.userId // under the instructor's email. Calling changeUserId will update this.options.userId
// and most importantly refresh not only the highlights (from Annotator) // and most importantly refresh not only the highlights (from Annotator)
// but also the table below from the annotations database server (called Catch). // but also the table below from the annotations database server (called Catch).
if(this.options.default_tab.toLowerCase() === 'instructor') { if(this.options.default_tab.toLowerCase() === 'instructor') {
this.changeUserId(this.options.instructor_email); this.changeUserId(this.options.instructor_email);
} }
...@@ -717,7 +717,7 @@ CatchAnnotation.prototype = { ...@@ -717,7 +717,7 @@ CatchAnnotation.prototype = {
var isInList = false; var isInList = false;
var list = $('#mainCatch .annotationList .annotationRow.item'); var list = $('#mainCatch .annotationList .annotationRow.item');
for (_i = 0, _len = list.length; _i < _len; _i++) { for (_i = 0, _len = list.length; _i < _len; _i++) {
if ($(list[_i]).parent().attr('annotationid') === an.id) if (parseInt($(list[_i]).parent().attr('annotationid'), 10) === an.id)
isInList = true; isInList = true;
} }
return isInList; return isInList;
...@@ -800,7 +800,7 @@ CatchAnnotation.prototype = { ...@@ -800,7 +800,7 @@ CatchAnnotation.prototype = {
$(evt.target).parents('.detailHeader:first').find('#myLocationMap .map').html(imgSrc); $(evt.target).parents('.detailHeader:first').find('#myLocationMap .map').html(imgSrc);
}, },
_onPlaySelectionClick: function(evt) { _onPlaySelectionClick: function(evt) {
var id = $(evt.target).find('.idAnnotation').html(); var id = parseInt($(evt.target).find('.idAnnotation').html(), 10);
var uri = $(evt.target).find('.uri').html(); var uri = $(evt.target).find('.uri').html();
var container = $(evt.target).find('.container').html(); var container = $(evt.target).find('.container').html();
if (this.options.externalLink) { if (this.options.externalLink) {
...@@ -858,7 +858,7 @@ CatchAnnotation.prototype = { ...@@ -858,7 +858,7 @@ CatchAnnotation.prototype = {
}, },
_onZoomToImageBoundsButtonClick: function(evt){ _onZoomToImageBoundsButtonClick: function(evt){
var zoomToBounds = $(evt.target).hasClass('zoomToImageBounds')?$(evt.target):$(evt.target).parents('.zoomToImageBounds:first'); var zoomToBounds = $(evt.target).hasClass('zoomToImageBounds')?$(evt.target):$(evt.target).parents('.zoomToImageBounds:first');
var osdaId = zoomToBounds.find('.idAnnotation').html(); var osdaId = parseInt(zoomToBounds.find('.idAnnotation').html(), 10);
var uri = zoomToBounds.find('.uri').html(); var uri = zoomToBounds.find('.uri').html();
var allannotations = this.annotator.plugins['Store'].annotations; var allannotations = this.annotator.plugins['Store'].annotations;
...@@ -887,7 +887,7 @@ CatchAnnotation.prototype = { ...@@ -887,7 +887,7 @@ CatchAnnotation.prototype = {
}, },
_onQuoteMediaButton: function(evt) { _onQuoteMediaButton: function(evt) {
var quote = $(evt.target).hasClass('quote')?$(evt.target):$(evt.target).parents('.quote:first'); var quote = $(evt.target).hasClass('quote')?$(evt.target):$(evt.target).parents('.quote:first');
var id = quote.find('.idAnnotation').html(); var id = parseInt(quote.find('.idAnnotation').html(), 10);
var uri = quote.find('.uri').html(); var uri = quote.find('.uri').html();
if (typeof id === 'undefined' || id === ''){ if (typeof id === 'undefined' || id === ''){
this.refreshCatch(); this.refreshCatch();
...@@ -927,7 +927,7 @@ CatchAnnotation.prototype = { ...@@ -927,7 +927,7 @@ CatchAnnotation.prototype = {
}, },
_refreshReplies: function(evt) { _refreshReplies: function(evt) {
var item = $(evt.target).parents('.annotationItem:first'); var item = $(evt.target).parents('.annotationItem:first');
var anId = item.attr('annotationId'); var anId = parseInt(item.attr('annotationId'), 10);
var replyElem = $(evt.target).parents('.annotationItem:first').find('.replies'); var replyElem = $(evt.target).parents('.annotationItem:first').find('.replies');
var annotator = this.annotator; var annotator = this.annotator;
...@@ -954,7 +954,7 @@ CatchAnnotation.prototype = { ...@@ -954,7 +954,7 @@ CatchAnnotation.prototype = {
if (typeof replyItems !== 'undefined' && replyItems.length > 0) { if (typeof replyItems !== 'undefined' && replyItems.length > 0) {
annotations.forEach(function(ann) { annotations.forEach(function(ann) {
replyItems.each(function(item) { replyItems.each(function(item) {
var id = $(replyItems[item]).attr('annotationid'); var id = parseInt($(replyItems[item]).attr('annotationid'), 10);
if (id === ann.id) { if (id === ann.id) {
var perm = self.annotator.plugins.Permissions; var perm = self.annotator.plugins.Permissions;
if (!perm.options.userAuthorize('delete', ann, perm.user)) { if (!perm.options.userAuthorize('delete', ann, perm.user)) {
...@@ -1031,7 +1031,7 @@ CatchAnnotation.prototype = { ...@@ -1031,7 +1031,7 @@ CatchAnnotation.prototype = {
if (confirm("Would you like to delete the annotation?")) { if (confirm("Would you like to delete the annotation?")) {
var annotator = this.annotator; var annotator = this.annotator;
var item = $(evt.target).parents('.annotationItem:first'); var item = $(evt.target).parents('.annotationItem:first');
var id = item.attr('annotationId'); var id = parseInt(item.attr('annotationId'), 10);
var store = annotator.plugins.Store; var store = annotator.plugins.Store;
var annotations = store.annotations; var annotations = store.annotations;
var permissions = annotator.plugins.Permissions; var permissions = annotator.plugins.Permissions;
...@@ -1048,7 +1048,7 @@ CatchAnnotation.prototype = { ...@@ -1048,7 +1048,7 @@ CatchAnnotation.prototype = {
var annotator = this.annotator; var annotator = this.annotator;
var item = $(evt.target).parents('.annotationItem:first'); var item = $(evt.target).parents('.annotationItem:first');
var id = item.attr('annotationId'); var id = parseInt(item.attr('annotationId'), 10);
var store = annotator.plugins.Store; var store = annotator.plugins.Store;
var annotations = store.annotations; var annotations = store.annotations;
var permissions = annotator.plugins.Permissions; var permissions = annotator.plugins.Permissions;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -934,18 +934,6 @@ PIPELINE_CSS = { ...@@ -934,18 +934,6 @@ PIPELINE_CSS = {
'css/vendor/jquery.qtip.min.css', 'css/vendor/jquery.qtip.min.css',
'css/vendor/responsive-carousel/responsive-carousel.css', 'css/vendor/responsive-carousel/responsive-carousel.css',
'css/vendor/responsive-carousel/responsive-carousel.slide.css', 'css/vendor/responsive-carousel/responsive-carousel.slide.css',
'css/vendor/ova/annotator.css',
'css/vendor/ova/edx-annotator.css',
'css/vendor/ova/video-js.min.css',
'css/vendor/ova/rangeslider.css',
'css/vendor/ova/share-annotator.css',
'css/vendor/ova/richText-annotator.css',
'css/vendor/ova/tags-annotator.css',
'css/vendor/ova/flagging-annotator.css',
'css/vendor/ova/diacritic-annotator.css',
'css/vendor/ova/grouping-annotator.css',
'css/vendor/ova/ova.css',
'js/vendor/ova/catch/css/main.css'
], ],
'output_filename': 'css/lms-style-vendor.css', 'output_filename': 'css/lms-style-vendor.css',
}, },
...@@ -995,6 +983,23 @@ PIPELINE_CSS = { ...@@ -995,6 +983,23 @@ PIPELINE_CSS = {
], ],
'output_filename': 'css/lms-style-course.css', 'output_filename': 'css/lms-style-course.css',
}, },
'style-xmodule-annotations': {
'source_filenames': [
'css/vendor/ova/annotator.css',
'css/vendor/ova/edx-annotator.css',
'css/vendor/ova/video-js.min.css',
'css/vendor/ova/rangeslider.css',
'css/vendor/ova/share-annotator.css',
'css/vendor/ova/richText-annotator.css',
'css/vendor/ova/tags-annotator.css',
'css/vendor/ova/flagging-annotator.css',
'css/vendor/ova/diacritic-annotator.css',
'css/vendor/ova/grouping-annotator.css',
'css/vendor/ova/ova.css',
'js/vendor/ova/catch/css/main.css'
],
'output_filename': 'css/lms-style-xmodule-annotations.css',
},
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<%namespace name='static' file='/static_content.html'/> <%namespace name='static' file='/static_content.html'/>
${static.css(group='style-vendor-tinymce-content', raw=True)} ${static.css(group='style-vendor-tinymce-content', raw=True)}
${static.css(group='style-vendor-tinymce-skin', raw=True)} ${static.css(group='style-vendor-tinymce-skin', raw=True)}
${static.css(group='style-xmodule-annotations', raw=True)}
</div> </div>
<div id="catchDIV"> <div id="catchDIV">
<div class="annotationListContainer">${_('Note: only instructors may annotate.')}</div> <div class="annotationListContainer">${_('Note: only instructors may annotate.')}</div>
...@@ -181,23 +182,23 @@ ...@@ -181,23 +182,23 @@
}; };
var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/"; var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/";
var osda, annotator, catchOptions, Catch;
if (typeof Annotator != 'undefined'){ var startosda = function() {
//remove old instances //remove old instances
if (Annotator._instances.length !== 0) { if (Annotator._instances.length !== 0) {
$('#imageHolder').annotator("destroy"); $('#imageHolder').annotator("destroy");
} }
delete osda; delete osda;
//Load the plugin Image/Text Annotation //Load the plugin Image/Text Annotation
var osda = new OpenSeadragonAnnotation($('#imageHolder'),options); osda = new OpenSeadragonAnnotation($('#imageHolder'),options);
var userId = ('${default_tab}'.toLowerCase() === 'instructor') ? var userId = ('${default_tab}'.toLowerCase() === 'instructor') ?
'${instructor_email}': '${instructor_email}':
'${user.email}'; '${user.email}';
//Catch //Catch
var annotator = osda.annotator; annotator = osda.annotator;
var catchOptions = { catchOptions = {
media:'image', media:'image',
externalLink:false, externalLink:false,
imageUrlRoot:imgURLRoot, imageUrlRoot:imgURLRoot,
...@@ -214,10 +215,23 @@ ...@@ -214,10 +215,23 @@
// if annotations are opened to everyone (2) or if they want to create no annotations (1 with no instructor) // if annotations are opened to everyone (2) or if they want to create no annotations (1 with no instructor)
// then the table at the bottom of the source should be displayed // then the table at the bottom of the source should be displayed
if ("${annotation_mode}" == "everyone" || ("${annotation_mode}" == "instructor" && "${instructor_email}" != "")) if ("${annotation_mode}" == "everyone" || ("${annotation_mode}" == "instructor" && "${instructor_email}" != ""))
var Catch = new CatchAnnotation($('#catchDIV'),catchOptions); Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
// if it is in instructor mode only (1), the annotator should be destroyed for all except the instructor // if it is in instructor mode only (1), the annotator should be destroyed for all except the instructor
if ("${annotation_mode}" == "instructor" && "${instructor_email}" == "" && !is_staff) if ("${annotation_mode}" == "instructor" && "${instructor_email}" == "" && !is_staff)
osda.annotator.destroy(); osda.annotator.destroy();
} }
// if the following is true, template is being rendered in LMS, otherwise it is in Studio
if (typeof Annotator !== 'undefined') {
startosda();
} else {
try {
require(["osda"], function(osda){
startosda();
});
} catch(error) {
console.log("Error: " + error.message + " - Annotator not loaded in LMS.");
}
}
</script> </script>
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<%namespace name='static' file='/static_content.html'/> <%namespace name='static' file='/static_content.html'/>
${static.css(group='style-vendor-tinymce-content', raw=True)} ${static.css(group='style-vendor-tinymce-content', raw=True)}
${static.css(group='style-vendor-tinymce-skin', raw=True)} ${static.css(group='style-vendor-tinymce-skin', raw=True)}
${static.css(group='style-xmodule-annotations', raw=True)}
<div class="annotatable-wrapper"> <div class="annotatable-wrapper">
<div class="annotatable-header"> <div class="annotatable-header">
...@@ -168,36 +169,51 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} ...@@ -168,36 +169,51 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
}; };
var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/"; var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/";
var ova, Catch, annotator, catchOptions;
var startova = function(){
//remove old instances
if (Annotator._instances.length !== 0) {
$('#textHolder').annotator("destroy");
}
delete ova;
//Load the plugin Video/Text Annotation
ova = new OpenVideoAnnotation.Annotator($('#textHolder'),options);
//remove old instances if (typeof Annotator.Plugin["Grouping"] === 'function')
if (Annotator._instances.length !== 0) { ova.annotator.addPlugin("Grouping");
$('#textHolder').annotator("destroy");
}
delete ova;
//Load the plugin Video/Text Annotation
var ova = new OpenVideoAnnotation.Annotator($('#textHolder'),options);
if (typeof Annotator.Plugin["Grouping"] === 'function') var userId = ('${default_tab}'.toLowerCase() === 'instructor') ?
ova.annotator.addPlugin("Grouping"); '${instructor_email}':
'${user.email}';
var userId = ('${default_tab}'.toLowerCase() === 'instructor') ? //Catch
'${instructor_email}': annotator = ova.annotator;
'${user.email}'; catchOptions = {
media:'text',
externalLink:false,
imageUrlRoot:imgURLRoot,
showMediaSelector: false,
showPublicPrivate: true,
userId:userId,
pagination:pagination,//Number of Annotations per load in the pagination,
flags:is_staff,
default_tab: "${default_tab}",
instructor_email: "${instructor_email}",
annotation_mode: "${annotation_mode}",
};
Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
}
//Catch // if the following is true, template is being rendered in LMS, otherwise it is in Studio
var annotator = ova.annotator; if (typeof Annotator !== 'undefined') {
var catchOptions = { startova();
media:'text', } else {
externalLink:false, try {
imageUrlRoot:imgURLRoot, require(["ova"], function(ova) {
showMediaSelector: false, startova();
showPublicPrivate: true, });
userId:userId, } catch(error) {
pagination:pagination,//Number of Annotations per load in the pagination, console.log("Error: " + error.message + " - Annotator not loaded in LMS.");
flags:is_staff, }
default_tab: "${default_tab}", }
instructor_email: "${instructor_email}",
annotation_mode: "${annotation_mode}",
};
var Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
</script> </script>
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<%namespace name='static' file='/static_content.html'/> <%namespace name='static' file='/static_content.html'/>
${static.css(group='style-vendor-tinymce-content', raw=True)} ${static.css(group='style-vendor-tinymce-content', raw=True)}
${static.css(group='style-vendor-tinymce-skin', raw=True)} ${static.css(group='style-vendor-tinymce-skin', raw=True)}
${static.css(group='style-xmodule-annotations', raw=True)}
<div class="annotatable-wrapper"> <div class="annotatable-wrapper">
<div class="annotatable-header"> <div class="annotatable-header">
...@@ -165,34 +166,47 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} ...@@ -165,34 +166,47 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
}; };
var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/"; var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/";
var ova, Catch, annotator, catchOptions;
var startova = function() {
//remove old instances
if (Annotator._instances.length !== 0) {
$('#videoHolder').annotator("destroy");
}
delete ova;
//Load the plugin Video/Text Annotation
ova = new OpenVideoAnnotation.Annotator($('#videoHolder'),options);
//remove old instances ova.annotator.addPlugin('Tags');
if (Annotator._instances.length !== 0) { var userId = ('${default_tab}'.toLowerCase() === 'instructor') ?
$('#videoHolder').annotator("destroy"); '${instructor_email}':
} '${user.email}';
delete ova;
//Load the plugin Video/Text Annotation
var ova = new OpenVideoAnnotation.Annotator($('#videoHolder'),options);
ova.annotator.addPlugin('Tags');
var userId = ('${default_tab}'.toLowerCase() === 'instructor') ?
'${instructor_email}':
'${user.email}';
//Catch //Catch
var annotator = ova.annotator; annotator = ova.annotator;
var catchOptions = { catchOptions = {
media:'video', media:'video',
externalLink:false, externalLink:false,
imageUrlRoot:imgURLRoot, imageUrlRoot:imgURLRoot,
showMediaSelector: false, showMediaSelector: false,
showPublicPrivate: true, showPublicPrivate: true,
userId:userId, userId:userId,
pagination:pagination,//Number of Annotations per load in the pagination, pagination:pagination,//Number of Annotations per load in the pagination,
flags:is_staff, flags:is_staff,
default_tab: "${default_tab}", default_tab: "${default_tab}",
instructor_email: "${instructor_email}", instructor_email: "${instructor_email}",
annotation_mode: "${annotation_mode}", annotation_mode: "${annotation_mode}",
}; };
var Catch = new CatchAnnotation($('#catchDIV'),catchOptions); Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
}
if (typeof Annotator !== 'undefined') {
startova();
} else {
try {
require(["ova"], function(ova) {
startova();
});
} catch(error) {
console.log("Error: " + error.message + " - Annotator not loaded in LMS.");
}
}
</script> </script>
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