- ## 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.')}
+
+
+
\ No newline at end of file
diff --git a/lms/templates/notes.html b/lms/templates/notes.html
index 58f81be274..569393daaa 100644
--- a/lms/templates/notes.html
+++ b/lms/templates/notes.html
@@ -1,6 +1,10 @@
<%! from django.utils.translation import ugettext as _ %>
<%namespace name='static' file='static_content.html'/>
+${static.css(group='style-vendor-tinymce-content', raw=True)}
+${static.css(group='style-vendor-tinymce-skin', raw=True)}
+
+
<%inherit file="main.html" />
<%!
from django.core.urlresolvers import reverse
@@ -102,7 +106,7 @@
if (annotation.permissions) {
tokens = annotation.permissions[action] || [];
if (is_staff){
- return true;
+ return true;
}
if (tokens.length === 0) {
return true;
@@ -128,7 +132,7 @@
},
},
auth: {
- tokenUrl: location.protocol+'//'+location.host+"/token?course_id=${course.id.to_deprecated_string()}"
+ token: "${token}"
},
store: {
// The endpoint of the store on your server.
@@ -158,37 +162,34 @@
optionsRichText: {
tinymce:{
selector: "li.annotator-item textarea",
- plugins: "media image insertdatetime link code",
+ plugins: "media image codemirror",
menubar: false,
toolbar_items_size: 'small',
extended_valid_elements : "iframe[src|frameborder|style|scrolling|class|width|height|name|align|id]",
- toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media rubric | code ",
+ toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | image rubric | code ",
}
- return true;
- },
- },
- auth: {
- token: "${token}"
- },
- store: {
- // The endpoint of the store on your server.
- prefix: "${storage}",
-
- annotationData: {},
-
- urls: {
- // These are the default URLs.
- create: '/create',
- read: '/read/:id',
- update: '/update/:id',
- destroy: '/delete/:id',
- search: '/search'
},
+ auth: {
+ token: "${token}"
+ },
+ store: {
+ // The endpoint of the store on your server.
+ prefix: "${storage}",
+
+ annotationData: {},
+
+ urls: {
+ // These are the default URLs.
+ create: '/create',
+ read: '/read/:id',
+ update: '/update/:id',
+ destroy: '/delete/:id',
+ search: '/search'
+ },
+ }
};
- tinyMCE.baseURL = "${settings.STATIC_URL}" + "js/vendor/ova";
var imgURLRoot = "${settings.STATIC_URL}" + "js/vendor/ova/catch/img/";
-
//remove old instances
if (Annotator._instances.length !== 0) {
$('#notesHolder').annotator("destroy");
@@ -207,7 +208,8 @@
showMediaSelector: true,
showPublicPrivate: true,
pagination:pagination,//Number of Annotations per load in the pagination,
- flags:is_staff
+ flags:is_staff,
+ default_tab: "${default_tab}",
},
Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
diff --git a/lms/templates/textannotation.html b/lms/templates/textannotation.html
index 5d97ac11c8..cb0cd23a35 100644
--- a/lms/templates/textannotation.html
+++ b/lms/templates/textannotation.html
@@ -174,17 +174,24 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
//Load the plugin Video/Text Annotation
var ova = new OpenVideoAnnotation.Annotator($('#textHolder'),options);
+ var userId = ('${default_tab}'.toLowerCase() === 'instructor') ?
+ '${instructor_email}':
+ '${user.email}';
+
//Catch
- var annotator = ova.annotator,
- catchOptions = {
+ var annotator = ova.annotator;
+ var catchOptions = {
media:'text',
externalLink:false,
imageUrlRoot:imgURLRoot,
showMediaSelector: false,
showPublicPrivate: true,
- userId:'${user.email}',
+ userId:userId,
pagination:pagination,//Number of Annotations per load in the pagination,
- flags:is_staff
- },
- Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
+ flags:is_staff,
+ default_tab: "${default_tab}",
+ instructor_email: "${instructor_email}",
+ annotation_mode: "${annotation_mode}",
+ };
+ var Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
diff --git a/lms/templates/videoannotation.html b/lms/templates/videoannotation.html
index 539e86909a..07b61213c5 100644
--- a/lms/templates/videoannotation.html
+++ b/lms/templates/videoannotation.html
@@ -175,18 +175,24 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
var ova = new OpenVideoAnnotation.Annotator($('#videoHolder'),options);
ova.annotator.addPlugin('Tags');
+ var userId = ('${default_tab}'.toLowerCase() === 'instructor') ?
+ '${instructor_email}':
+ '${user.email}';
//Catch
- var annotator = ova.annotator,
- catchOptions = {
+ var annotator = ova.annotator;
+ var catchOptions = {
media:'video',
externalLink:false,
imageUrlRoot:imgURLRoot,
showMediaSelector: false,
showPublicPrivate: true,
- userId:'${user.email}',
+ userId:userId,
pagination:pagination,//Number of Annotations per load in the pagination,
- flags:is_staff
- },
- Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
+ flags:is_staff,
+ default_tab: "${default_tab}",
+ instructor_email: "${instructor_email}",
+ annotation_mode: "${annotation_mode}",
+ };
+ var Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
From 848c7165e3a2da42f11986846e0891c44a4f0a54 Mon Sep 17 00:00:00 2001
From: lduarte1991
Date: Fri, 6 Jun 2014 15:40:03 -0400
Subject: [PATCH 3/4] Annotation Tool: PR #4019
Reverting commit @3bfb633 and updating openseadragon.js for latest build
Conflicts:
common/lib/xmodule/xmodule/imageannotation_module.py
common/lib/xmodule/xmodule/textannotation_module.py
common/lib/xmodule/xmodule/videoannotation_module.py
---
common/lib/xmodule/xmodule/annotator_mixin.py | 38 -------------------
.../xmodule/xmodule/imageannotation_module.py | 31 ++++++++++++---
.../xmodule/xmodule/textannotation_module.py | 37 ++++++++++++++++--
.../xmodule/xmodule/videoannotation_module.py | 37 ++++++++++++++++--
common/static/js/vendor/ova/openseadragon.js | 4 +-
5 files changed, 93 insertions(+), 54 deletions(-)
diff --git a/common/lib/xmodule/xmodule/annotator_mixin.py b/common/lib/xmodule/xmodule/annotator_mixin.py
index 93768f564c..aa0a19d4a8 100644
--- a/common/lib/xmodule/xmodule/annotator_mixin.py
+++ b/common/lib/xmodule/xmodule/annotator_mixin.py
@@ -6,10 +6,6 @@ from lxml import etree
from urlparse import urlparse
from os.path import splitext, basename
from HTMLParser import HTMLParser
-from xblock.core import Scope, String
-
-# Make '_' a no-op so we can scrape strings
-_ = lambda text: text
def get_instructions(xmltree):
""" Removes from the xmltree and returns them as a string, otherwise None. """
@@ -56,37 +52,3 @@ def html_to_text(html):
htmlstripper = MLStripper()
htmlstripper.feed(html)
return htmlstripper.get_data()
-
-
-class CommonAnnotatorMixin(object):
- annotation_storage_url = String(
- help=_("Location of Annotation backend"),
- scope=Scope.settings,
- default="http://your_annotation_storage.com",
- display_name=_("Url for Annotation Storage")
- )
- annotation_token_secret = String(
- help=_("Secret string for annotation storage"),
- scope=Scope.settings,
- default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
- display_name=_("Secret Token String for Annotation")
- )
- default_tab = String(
- display_name=_("Default Annotations Tab"),
- help=_("Select which tab will be the default in the annotations table: myNotes, Instructor, or Public."),
- scope=Scope.settings,
- default="myNotes",
- )
- # currently only supports one instructor, will build functionality for multiple later
- instructor_email = String(
- display_name=_("Email for 'Instructor' Annotations"),
- help=_("Email of the user that will be attached to all annotations that will be found in 'Instructor' tab."),
- scope=Scope.settings,
- default="",
- )
- annotation_mode = String(
- display_name=_("Mode for Annotation Tool"),
- help=_("Type in number corresponding to following modes: 'instructor' or 'everyone'"),
- scope=Scope.settings,
- default="everyone",
- )
diff --git a/common/lib/xmodule/xmodule/imageannotation_module.py b/common/lib/xmodule/xmodule/imageannotation_module.py
index e19f5a9100..dd01d9ae2e 100644
--- a/common/lib/xmodule/xmodule/imageannotation_module.py
+++ b/common/lib/xmodule/xmodule/imageannotation_module.py
@@ -7,7 +7,7 @@ from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.core import Scope, String
-from xmodule.annotator_mixin import CommonAnnotatorMixin, get_instructions, html_to_text
+from xmodule.annotator_mixin import get_instructions, html_to_text
from xmodule.annotator_token import retrieve_token
from xblock.fragment import Fragment
@@ -49,20 +49,39 @@ class AnnotatableFields(object):
default='professor:green,teachingAssistant:blue',
)
annotation_storage_url = String(
- help="Location of Annotation backend",
+ help=_("Location of Annotation backend"),
scope=Scope.settings,
default="http://your_annotation_storage.com",
- display_name="Url for Annotation Storage"
+ display_name=_("Url for Annotation Storage")
)
annotation_token_secret = String(
- help="Secret string for annotation storage",
+ help=_("Secret string for annotation storage"),
scope=Scope.settings,
default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
- display_name="Secret Token String for Annotation"
+ display_name=_("Secret Token String for Annotation")
+ )
+ default_tab = String(
+ display_name=_("Default Annotations Tab"),
+ help=_("Select which tab will be the default in the annotations table: myNotes, Instructor, or Public."),
+ scope=Scope.settings,
+ default="myNotes",
+ )
+ # currently only supports one instructor, will build functionality for multiple later
+ instructor_email = String(
+ display_name=_("Email for 'Instructor' Annotations"),
+ help=_("Email of the user that will be attached to all annotations that will be found in 'Instructor' tab."),
+ scope=Scope.settings,
+ default="",
+ )
+ annotation_mode = String(
+ display_name=_("Mode for Annotation Tool"),
+ help=_("Type in number corresponding to following modes: 'instructor' or 'everyone'"),
+ scope=Scope.settings,
+ default="everyone",
)
-class ImageAnnotationModule(AnnotatableFields, CommonAnnotatorMixin, XModule):
+class ImageAnnotationModule(AnnotatableFields, XModule):
'''Image Annotation Module'''
js = {
'coffee': [
diff --git a/common/lib/xmodule/xmodule/textannotation_module.py b/common/lib/xmodule/xmodule/textannotation_module.py
index 1224dc2524..4504ac5b3b 100644
--- a/common/lib/xmodule/xmodule/textannotation_module.py
+++ b/common/lib/xmodule/xmodule/textannotation_module.py
@@ -6,7 +6,7 @@ from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.core import Scope, String
-from xmodule.annotator_mixin import CommonAnnotatorMixin, get_instructions
+from xmodule.annotator_mixin import get_instructions
from xmodule.annotator_token import retrieve_token
from xblock.fragment import Fragment
import textwrap
@@ -53,11 +53,40 @@ class AnnotatableFields(object):
scope=Scope.settings,
default='',
)
- annotation_storage_url = String(help=_("Location of Annotation backend"), scope=Scope.settings, default="http://your_annotation_storage.com", display_name=_("Url for Annotation Storage"))
- annotation_token_secret = String(help=_("Secret string for annotation storage"), scope=Scope.settings, default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", display_name=_("Secret Token String for Annotation"))
+ annotation_storage_url = String(
+ help=_("Location of Annotation backend"),
+ scope=Scope.settings,
+ default="http://your_annotation_storage.com",
+ display_name=_("Url for Annotation Storage")
+ )
+ annotation_token_secret = String(
+ help=_("Secret string for annotation storage"),
+ scope=Scope.settings,
+ default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
+ display_name=_("Secret Token String for Annotation")
+ )
+ default_tab = String(
+ display_name=_("Default Annotations Tab"),
+ help=_("Select which tab will be the default in the annotations table: myNotes, Instructor, or Public."),
+ scope=Scope.settings,
+ default="myNotes",
+ )
+ # currently only supports one instructor, will build functionality for multiple later
+ instructor_email = String(
+ display_name=_("Email for 'Instructor' Annotations"),
+ help=_("Email of the user that will be attached to all annotations that will be found in 'Instructor' tab."),
+ scope=Scope.settings,
+ default="",
+ )
+ annotation_mode = String(
+ display_name=_("Mode for Annotation Tool"),
+ help=_("Type in number corresponding to following modes: 'instructor' or 'everyone'"),
+ scope=Scope.settings,
+ default="everyone",
+ )
-class TextAnnotationModule(AnnotatableFields, CommonAnnotatorMixin, XModule):
+class TextAnnotationModule(AnnotatableFields, XModule):
''' Text Annotation Module '''
js = {'coffee': [],
'js': []}
diff --git a/common/lib/xmodule/xmodule/videoannotation_module.py b/common/lib/xmodule/xmodule/videoannotation_module.py
index b07f9a700f..03fc2f75e3 100644
--- a/common/lib/xmodule/xmodule/videoannotation_module.py
+++ b/common/lib/xmodule/xmodule/videoannotation_module.py
@@ -7,7 +7,7 @@ from pkg_resources import resource_string
from xmodule.x_module import XModule
from xmodule.raw_module import RawDescriptor
from xblock.core import Scope, String
-from xmodule.annotator_mixin import CommonAnnotatorMixin, get_instructions, get_extension
+from xmodule.annotator_mixin import get_instructions, get_extension
from xmodule.annotator_token import retrieve_token
from xblock.fragment import Fragment
@@ -45,11 +45,40 @@ class AnnotatableFields(object):
scope=Scope.settings,
default=""
)
- annotation_storage_url = String(help=_("Location of Annotation backend"), scope=Scope.settings, default="http://your_annotation_storage.com", display_name=_("Url for Annotation Storage"))
- annotation_token_secret = String(help=_("Secret string for annotation storage"), scope=Scope.settings, default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", display_name=_("Secret Token String for Annotation"))
+ annotation_storage_url = String(
+ help=_("Location of Annotation backend"),
+ scope=Scope.settings,
+ default="http://your_annotation_storage.com",
+ display_name=_("Url for Annotation Storage")
+ )
+ annotation_token_secret = String(
+ help=_("Secret string for annotation storage"),
+ scope=Scope.settings,
+ default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
+ display_name=_("Secret Token String for Annotation")
+ )
+ default_tab = String(
+ display_name=_("Default Annotations Tab"),
+ help=_("Select which tab will be the default in the annotations table: myNotes, Instructor, or Public."),
+ scope=Scope.settings,
+ default="myNotes",
+ )
+ # currently only supports one instructor, will build functionality for multiple later
+ instructor_email = String(
+ display_name=_("Email for 'Instructor' Annotations"),
+ help=_("Email of the user that will be attached to all annotations that will be found in 'Instructor' tab."),
+ scope=Scope.settings,
+ default="",
+ )
+ annotation_mode = String(
+ display_name=_("Mode for Annotation Tool"),
+ help=_("Type in number corresponding to following modes: 'instructor' or 'everyone'"),
+ scope=Scope.settings,
+ default="everyone",
+ )
-class VideoAnnotationModule(AnnotatableFields, CommonAnnotatorMixin, XModule):
+class VideoAnnotationModule(AnnotatableFields, XModule):
'''Video Annotation Module'''
js = {
'coffee': [
diff --git a/common/static/js/vendor/ova/openseadragon.js b/common/static/js/vendor/ova/openseadragon.js
index 789c0ce403..559aa5bcd7 100644
--- a/common/static/js/vendor/ova/openseadragon.js
+++ b/common/static/js/vendor/ova/openseadragon.js
@@ -7872,14 +7872,14 @@ $.extend( $.IIIF1_1TileSource.prototype, $.TileSource.prototype, {
uri;
if ( level_width < this.tile_width && level_height < this.tile_height ){
- iiif_size = level_width + "," + level_height;
+ iiif_size = level_width + ",";
iiif_region = 'full';
} else {
iiif_tile_x = x * iiif_tile_size_width;
iiif_tile_y = y * iiif_tile_size_height;
iiif_tile_w = Math.min( iiif_tile_size_width, this.width - iiif_tile_x );
iiif_tile_h = Math.min( iiif_tile_size_height, this.height - iiif_tile_y );
- iiif_size = Math.ceil(iiif_tile_w * scale) + "," + Math.ceil(iiif_tile_h * scale);
+ iiif_size = Math.ceil(iiif_tile_w * scale) + ",";
iiif_region = [ iiif_tile_x, iiif_tile_y, iiif_tile_w, iiif_tile_h ].join(',');
}
uri = [ this['@id'], iiif_region, iiif_size, IIIF_ROTATION, IIIF_QUALITY ].join('/');
From e48cc16d45ceda1ec8fe64b7092b2a1de25329c8 Mon Sep 17 00:00:00 2001
From: lduarte1991
Date: Mon, 9 Jun 2014 14:04:54 -0400
Subject: [PATCH 4/4] Annotations Tools: i18n Make stati strings extractable
Original changes found in this commit
https://github.com/edx/edx-platform/commit/a6bae4d238fdc6a60c8ee9f1b80ca
3512bb085eb
Conflicts:
common/lib/xmodule/xmodule/textannotation_module.py
common/lib/xmodule/xmodule/videoannotation_module.py
---
.../lib/xmodule/xmodule/imageannotation_module.py | 15 ++++++++++-----
.../lib/xmodule/xmodule/textannotation_module.py | 4 +++-
.../lib/xmodule/xmodule/videoannotation_module.py | 4 +++-
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/common/lib/xmodule/xmodule/imageannotation_module.py b/common/lib/xmodule/xmodule/imageannotation_module.py
index dd01d9ae2e..7a37b35334 100644
--- a/common/lib/xmodule/xmodule/imageannotation_module.py
+++ b/common/lib/xmodule/xmodule/imageannotation_module.py
@@ -13,10 +13,15 @@ from xblock.fragment import Fragment
import textwrap
+# Make '_' a no-op so we can scrape strings
+_ = lambda text: text
+
class AnnotatableFields(object):
""" Fields for `ImageModule` and `ImageDescriptor`. """
- data = String(help="XML data for the annotation", scope=Scope.content, default=textwrap.dedent("""\
+ data = String(help=_("XML data for the annotation"),
+ scope=Scope.content,
+ default=textwrap.dedent("""\
@@ -37,14 +42,14 @@ class AnnotatableFields(object):
"""))
display_name = String(
- display_name="Display Name",
- help="Display name for this module",
+ display_name=_("Display Name"),
+ help=_("Display name for this module"),
scope=Scope.settings,
default='Image Annotation',
)
instructor_tags = String(
- display_name="Tags for Assignments",
- help="Add tags that automatically highlight in a certain color using the comma-separated form, i.e. imagery:red,parallelism:blue",
+ display_name=_("Tags for Assignments"),
+ help=_("Add tags that automatically highlight in a certain color using the comma-separated form, i.e. imagery:red,parallelism:blue"),
scope=Scope.settings,
default='professor:green,teachingAssistant:blue',
)
diff --git a/common/lib/xmodule/xmodule/textannotation_module.py b/common/lib/xmodule/xmodule/textannotation_module.py
index 4504ac5b3b..35b1fd8c96 100644
--- a/common/lib/xmodule/xmodule/textannotation_module.py
+++ b/common/lib/xmodule/xmodule/textannotation_module.py
@@ -17,7 +17,9 @@ _ = lambda text: text
class AnnotatableFields(object):
"""Fields for `TextModule` and `TextDescriptor`."""
- data = String(help=_("XML data for the annotation"), scope=Scope.content, default=textwrap.dedent("""\
+ data = String(help=_("XML data for the annotation"),
+ scope=Scope.content,
+ default=textwrap.dedent("""\
diff --git a/common/lib/xmodule/xmodule/videoannotation_module.py b/common/lib/xmodule/xmodule/videoannotation_module.py
index 03fc2f75e3..6a8584505b 100644
--- a/common/lib/xmodule/xmodule/videoannotation_module.py
+++ b/common/lib/xmodule/xmodule/videoannotation_module.py
@@ -19,7 +19,9 @@ _ = lambda text: text
class AnnotatableFields(object):
""" Fields for `VideoModule` and `VideoDescriptor`. """
- data = String(help=_("XML data for the annotation"), scope=Scope.content, default=textwrap.dedent("""\
+ data = String(help=_("XML data for the annotation"),
+ scope=Scope.content,
+ default=textwrap.dedent("""\