diff --git a/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js b/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js index d8c2f595c0..4fbadc4f47 100644 --- a/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js +++ b/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js @@ -380,19 +380,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. clickTimeThreshold: viewer.clickTimeThreshold, clickDistThreshold: viewer.clickDistThreshold }); - - /* Set elements to the control menu */ - viewer.annotatorControl = viewer.wrapperAnnotation.element; - if( viewer.toolbar ){ - viewer.toolbar.addControl( - viewer.annotatorControl, - {anchor: $.ControlAnchor.BOTTOM_RIGHT} - ); - }else{ - viewer.addControl( - viewer.annotatorControl, - {anchor: $.ControlAnchor.TOP_LEFT} - ); + if(this.options.viewer.annotation_mode == "2" || this.options.viewer.flags){ + /* Set elements to the control menu */ + viewer.annotatorControl = viewer.wrapperAnnotation.element; + if( viewer.toolbar ){ + viewer.toolbar.addControl( + viewer.annotatorControl, + {anchor: $.ControlAnchor.BOTTOM_RIGHT} + ); + }else{ + viewer.addControl( + viewer.annotatorControl, + {anchor: $.ControlAnchor.TOP_LEFT} + ); + } } }, _reset: function(){ diff --git a/lms/templates/imageannotation.html b/lms/templates/imageannotation.html index dce0304516..e938abee42 100644 --- a/lms/templates/imageannotation.html +++ b/lms/templates/imageannotation.html @@ -34,7 +34,7 @@
## Translators: Notes below refer to annotations. They wil later be put under a "Notes" section. -
${_('You do not have any notes.')}
+
${_('Note: only instructors may annotate.')}
@@ -72,7 +72,7 @@ var unit_id = $('#sequence-list').find('.active').attr("data-element"); uri += unit_id; var pagination = 100, - is_staff = !('${user.is_staff}'=='False'), + is_staff = ('${user.email}'=='${instructor_username}'), options = { optionsAnnotator: { permissions:{ @@ -172,6 +172,8 @@ }, optionsOpenSeadragon:{ id: "imageHolder", + annotation_mode: "${annotation_mode}", + flags: is_staff, prefixUrl: "${settings.STATIC_URL}" + "js/vendor/ova/images/", ${openseadragonjson} }, @@ -195,8 +197,8 @@ } //Catch - var annotator = osda.annotator, - catchOptions = { + var annotator = osda.annotator; + var catchOptions = { media:'image', externalLink:false, imageUrlRoot:imgURLRoot, @@ -208,8 +210,10 @@ default_tab: "${default_tab}", instructor_username: "${instructor_username}", annotation_mode: "${annotation_mode}", - }, - Catch = new CatchAnnotation($('#catchDIV'),catchOptions); - + }; + if ("${annotation_mode}" == "2" || ("${annotation_mode}" == 1 && "${instructor_username}" != "")) + var Catch = new CatchAnnotation($('#catchDIV'),catchOptions); + if ("${annotation_mode}" == 1 && "${instructor_username}" == "" && !is_staff) + osda.annotator.destroy(); } \ No newline at end of file diff --git a/lms/templates/textannotation.html b/lms/templates/textannotation.html index 4a817cafd8..5a55410434 100644 --- a/lms/templates/textannotation.html +++ b/lms/templates/textannotation.html @@ -183,8 +183,8 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} } //Catch - var annotator = ova.annotator, - catchOptions = { + var annotator = ova.annotator; + var catchOptions = { media:'text', externalLink:false, imageUrlRoot:imgURLRoot, @@ -196,6 +196,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} default_tab: "${default_tab}", instructor_username: "${instructor_username}", annotation_mode: "${annotation_mode}", - }, - Catch = new CatchAnnotation($('#catchDIV'),catchOptions); + }; + var Catch = new CatchAnnotation($('#catchDIV'),catchOptions); diff --git a/lms/templates/videoannotation.html b/lms/templates/videoannotation.html index 2259257d68..1ec4e18751 100644 --- a/lms/templates/videoannotation.html +++ b/lms/templates/videoannotation.html @@ -181,8 +181,8 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} } //Catch - var annotator = ova.annotator, - catchOptions = { + var annotator = ova.annotator; + var catchOptions = { media:'video', externalLink:false, imageUrlRoot:imgURLRoot, @@ -190,11 +190,10 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} showPublicPrivate: true, userId:userId, pagination:pagination,//Number of Annotations per load in the pagination, - flags:is_staff flags:is_staff, default_tab: "${default_tab}", instructor_username: "${instructor_username}", annotation_mode: "${annotation_mode}", - }, - Catch = new CatchAnnotation($('#catchDIV'),catchOptions); + }; + var Catch = new CatchAnnotation($('#catchDIV'),catchOptions);