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
76b8891b
Commit
76b8891b
authored
Aug 13, 2014
by
lduarte1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotation Tools: Adding try-catch in case Annotator is missing from LMS
parent
8cfdb8f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
lms/templates/imageannotation.html
+10
-3
lms/templates/textannotation.html
+8
-3
lms/templates/videoannotation.html
+7
-3
No files found.
lms/templates/imageannotation.html
View file @
76b8891b
...
...
@@ -221,11 +221,17 @@
if
(
"${annotation_mode}"
==
"instructor"
&&
"${instructor_email}"
==
""
&&
!
is_staff
)
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
{
require
([
"osda"
],
function
(
osda
){
startosda
();
});
try
{
require
([
"osda"
],
function
(
osda
){
startosda
();
});
}
catch
(
error
)
{
console
.
log
(
"Error: "
+
error
.
message
+
" - Annotator not loaded in LMS."
);
}
}
</script>
\ No newline at end of file
lms/templates/textannotation.html
View file @
76b8891b
...
...
@@ -204,11 +204,16 @@ ${static.css(group='style-xmodule-annotations', raw=True)}
Catch
=
new
CatchAnnotation
(
$
(
'#catchDIV'
),
catchOptions
);
}
// if the following is true, template is being rendered in LMS, otherwise it is in Studio
if
(
typeof
Annotator
!==
'undefined'
)
{
startova
();
}
else
{
require
([
"ova"
],
function
(
ova
){
startova
();
});
try
{
require
([
"ova"
],
function
(
ova
)
{
startova
();
});
}
catch
(
error
)
{
console
.
log
(
"Error: "
+
error
.
message
+
" - Annotator not loaded in LMS."
);
}
}
</script>
lms/templates/videoannotation.html
View file @
76b8891b
...
...
@@ -201,8 +201,12 @@ ${static.css(group='style-xmodule-annotations', raw=True)}
if
(
typeof
Annotator
!==
'undefined'
)
{
startova
();
}
else
{
require
([
"ova"
],
function
(
ova
){
startova
();
});
try
{
require
([
"ova"
],
function
(
ova
)
{
startova
();
});
}
catch
(
error
)
{
console
.
log
(
"Error: "
+
error
.
message
+
" - Annotator not loaded in LMS."
);
}
}
</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