Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
5c859c71
Commit
5c859c71
authored
Aug 13, 2014
by
lduarte1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotation Tools: Adding Annotator to CMS
parent
76516f52
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
166 additions
and
66 deletions
+166
-66
cms/envs/common.py
+12
-0
cms/templates/base.html
+63
-1
common/lib/xmodule/xmodule/imageannotation_module.py
+2
-2
common/lib/xmodule/xmodule/textannotation_module.py
+2
-2
common/lib/xmodule/xmodule/videoannotation_module.py
+2
-2
lms/templates/imageannotation.html
+10
-2
lms/templates/textannotation.html
+40
-30
lms/templates/videoannotation.html
+35
-27
No files found.
cms/envs/common.py
View file @
5c859c71
...
@@ -339,6 +339,18 @@ PIPELINE_CSS = {
...
@@ -339,6 +339,18 @@ PIPELINE_CSS = {
'css/vendor/jquery.qtip.min.css'
,
'css/vendor/jquery.qtip.min.css'
,
'js/vendor/markitup/skins/simple/style.css'
,
'js/vendor/markitup/skins/simple/style.css'
,
'js/vendor/markitup/sets/wiki/style.css'
,
'js/vendor/markitup/sets/wiki/style.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/cms-style-vendor.css'
,
'output_filename'
:
'css/cms-style-vendor.css'
,
},
},
...
...
cms/templates/base.html
View file @
5c859c71
...
@@ -82,6 +82,24 @@
...
@@ -82,6 +82,24 @@
"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"
,
"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'
,
// externally hosted files
// externally hosted files
"tender"
:
[
"tender"
:
[
...
@@ -235,7 +253,51 @@
...
@@ -235,7 +253,51 @@
"coffee/src/logger"
:
{
"coffee/src/logger"
:
{
exports
:
"Logger"
,
exports
:
"Logger"
,
deps
:
[
"coffee/src/ajax_prefix"
]
deps
:
[
"coffee/src/ajax_prefix"
]
}
},
"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"
]
},
},
},
// load jquery and gettext automatically
// load jquery and gettext automatically
deps
:
[
"jquery"
,
"gettext"
],
deps
:
[
"jquery"
,
"gettext"
],
...
...
common/lib/xmodule/xmodule/imageannotation_module.py
View file @
5c859c71
...
@@ -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
...
...
common/lib/xmodule/xmodule/textannotation_module.py
View file @
5c859c71
...
@@ -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
...
...
common/lib/xmodule/xmodule/videoannotation_module.py
View file @
5c859c71
...
@@ -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
...
...
lms/templates/imageannotation.html
View file @
5c859c71
...
@@ -182,8 +182,8 @@
...
@@ -182,8 +182,8 @@
};
};
var
imgURLRoot
=
"${settings.STATIC_URL}"
+
"js/vendor/ova/catch/img/"
;
var
imgURLRoot
=
"${settings.STATIC_URL}"
+
"js/vendor/ova/catch/img/"
;
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"
);
}
}
...
@@ -220,4 +220,11 @@
...
@@ -220,4 +220,11 @@
if
(
"${annotation_mode}"
==
"instructor"
&&
"${instructor_email}"
==
""
&&
!
is_staff
)
if
(
"${annotation_mode}"
==
"instructor"
&&
"${instructor_email}"
==
""
&&
!
is_staff
)
osda
.
annotator
.
destroy
();
osda
.
annotator
.
destroy
();
}
}
if
(
typeof
Annotator
!==
'undefined'
)
{
startosda
();
}
else
{
require
([
"osda"
],
function
(
osda
){
startosda
();
});
}
</script>
</script>
\ No newline at end of file
lms/templates/textannotation.html
View file @
5c859c71
...
@@ -169,35 +169,45 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
...
@@ -169,35 +169,45 @@ ${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/"
;
//remove old instances
var
startova
=
function
(){
if
(
Annotator
.
_instances
.
length
!==
0
)
{
//remove old instances
$
(
'#textHolder'
).
annotator
(
"destroy"
);
if
(
Annotator
.
_instances
.
length
!==
0
)
{
$
(
'#textHolder'
).
annotator
(
"destroy"
);
}
delete
ova
;
//Load the plugin Video/Text Annotation
var
ova
=
new
OpenVideoAnnotation
.
Annotator
(
$
(
'#textHolder'
),
options
);
if
(
typeof
Annotator
.
Plugin
[
"Grouping"
]
===
'function'
)
ova
.
annotator
.
addPlugin
(
"Grouping"
);
var
userId
=
(
'${default_tab}'
.
toLowerCase
()
===
'instructor'
)
?
'${instructor_email}'
:
'${user.email}'
;
//Catch
var
annotator
=
ova
.
annotator
;
var
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}"
,
};
var
Catch
=
new
CatchAnnotation
(
$
(
'#catchDIV'
),
catchOptions
);
}
if
(
typeof
Annotator
!==
'undefined'
)
{
startova
();
}
else
{
require
([
"ova"
],
function
(
ova
){
startova
();
});
}
}
delete
ova
;
//Load the plugin Video/Text Annotation
var
ova
=
new
OpenVideoAnnotation
.
Annotator
(
$
(
'#textHolder'
),
options
);
if
(
typeof
Annotator
.
Plugin
[
"Grouping"
]
===
'function'
)
ova
.
annotator
.
addPlugin
(
"Grouping"
);
var
userId
=
(
'${default_tab}'
.
toLowerCase
()
===
'instructor'
)
?
'${instructor_email}'
:
'${user.email}'
;
//Catch
var
annotator
=
ova
.
annotator
;
var
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}"
,
};
var
Catch
=
new
CatchAnnotation
(
$
(
'#catchDIV'
),
catchOptions
);
</script>
</script>
lms/templates/videoannotation.html
View file @
5c859c71
...
@@ -165,34 +165,42 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
...
@@ -165,34 +165,42 @@ ${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
startova
=
function
()
{
//remove old instances
if
(
Annotator
.
_instances
.
length
!==
0
)
{
$
(
'#videoHolder'
).
annotator
(
"destroy"
);
}
delete
ova
;
//Load the plugin Video/Text Annotation
var
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
;
var
annotator
=
ova
.
annotator
;
var
catchOptions
=
{
var
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
);
var
Catch
=
new
CatchAnnotation
(
$
(
'#catchDIV'
),
catchOptions
);
}
if
(
typeof
Annotator
!==
'undefined'
)
{
startova
();
}
else
{
require
([
"ova"
],
function
(
ova
){
startova
();
});
}
</script>
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment