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
cd9c6c5f
Commit
cd9c6c5f
authored
Jun 21, 2014
by
lduarte1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotations Tools: Commented OSDA code and added clarification to catch changes
parent
95c07383
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletions
+18
-1
common/static/js/vendor/ova/OpenSeaDragonAnnotation.js
+0
-0
common/static/js/vendor/ova/catch/js/catch.js
+18
-1
No files found.
common/static/js/vendor/ova/OpenSeaDragonAnnotation.js
View file @
cd9c6c5f
This diff is collapsed.
Click to expand it.
common/static/js/vendor/ova/catch/js/catch.js
View file @
cd9c6c5f
...
@@ -636,14 +636,27 @@ CatchAnnotation.prototype = {
...
@@ -636,14 +636,27 @@ CatchAnnotation.prototype = {
});
});
annotator
.
subscribe
(
"annotationCreated"
,
function
(
annotation
){
annotator
.
subscribe
(
"annotationCreated"
,
function
(
annotation
){
var
attempts
=
0
;
// max 100
var
attempts
=
0
;
// max 100
//wait to get an annotation id
//There is a delay between calls to the backend--especially reading after
//writing. This function listens to when a function is created and waits
//until the server provides it with an annotation id before doing anything
//with it.
var
ischanged
=
function
(){
var
ischanged
=
function
(){
if
(
attempts
<
100
)
if
(
attempts
<
100
)
setTimeout
(
function
(){
setTimeout
(
function
(){
if
(
typeof
annotation
.
id
!=
'undefined'
){
if
(
typeof
annotation
.
id
!=
'undefined'
){
//once it gets the annotation id, the table refreshes to show
//the edits
self
.
refreshCatch
();
self
.
refreshCatch
();
if
(
typeof
annotation
.
parent
!=
'undefined'
&&
annotation
.
parent
!=
'0'
){
if
(
typeof
annotation
.
parent
!=
'undefined'
&&
annotation
.
parent
!=
'0'
){
//if annotation made was actually a replay to an annotation
//i.e. the only difference is that annotations that are
//not replies have no "parent"
var
replies
=
$
(
"[annotationid="
+
annotation
.
parent
+
"]"
).
find
(
".controlReplies .hideReplies"
);
var
replies
=
$
(
"[annotationid="
+
annotation
.
parent
+
"]"
).
find
(
".controlReplies .hideReplies"
);
//forces "Show replies" section to show and then refreshes
//via two clicks
replies
.
show
();
replies
.
show
();
replies
.
click
();
replies
.
click
();
replies
.
click
();
replies
.
click
();
...
@@ -826,6 +839,8 @@ CatchAnnotation.prototype = {
...
@@ -826,6 +839,8 @@ CatchAnnotation.prototype = {
}
}
for
(
var
item
in
allannotations
){
for
(
var
item
in
allannotations
){
var
an
=
allannotations
[
item
];
var
an
=
allannotations
[
item
];
//Makes sure that all images are set to transparent in case one was
//previously selected.
an
.
highlights
[
0
].
style
.
background
=
"rgba(0,0,0,0)"
;
an
.
highlights
[
0
].
style
.
background
=
"rgba(0,0,0,0)"
;
if
(
typeof
an
.
id
!=
'undefined'
&&
an
.
id
==
osdaId
){
//this is the annotation
if
(
typeof
an
.
id
!=
'undefined'
&&
an
.
id
==
osdaId
){
//this is the annotation
var
bounds
=
new
OpenSeadragon
.
Rect
(
an
.
bounds
.
x
,
an
.
bounds
.
y
,
an
.
bounds
.
width
,
an
.
bounds
.
height
);
var
bounds
=
new
OpenSeadragon
.
Rect
(
an
.
bounds
.
x
,
an
.
bounds
.
y
,
an
.
bounds
.
width
,
an
.
bounds
.
height
);
...
@@ -834,6 +849,8 @@ CatchAnnotation.prototype = {
...
@@ -834,6 +849,8 @@ CatchAnnotation.prototype = {
console
.
log
(
an
.
target
.
container
);
console
.
log
(
an
.
target
.
container
);
$
(
'html,body'
).
animate
({
scrollTop
:
$
(
"#"
+
an
.
target
.
container
).
offset
().
top
},
$
(
'html,body'
).
animate
({
scrollTop
:
$
(
"#"
+
an
.
target
.
container
).
offset
().
top
},
'slow'
);
'slow'
);
//signifies a selected annotation once OSD has zoomed in on the
//appropriate area, it turns the background a bit yellow
an
.
highlights
[
0
].
style
.
background
=
"rgba(255,255,10,0.2)"
;
an
.
highlights
[
0
].
style
.
background
=
"rgba(255,255,10,0.2)"
;
}
}
}
}
...
...
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