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
4ce70630
Commit
4ce70630
authored
Jul 02, 2014
by
lduarte1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotation Tools: Fixing Share Indentation, Grep Functions and Equality
parent
eace1413
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
common/static/js/vendor/ova/share-annotator.js
+8
-14
No files found.
common/static/js/vendor/ova/share-annotator.js
View file @
4ce70630
...
...
@@ -60,7 +60,6 @@ Annotator.Plugin.Share = (function(_super) {
Share
.
prototype
.
input
=
null
;
Share
.
prototype
.
pluginInit
=
function
()
{
console
.
log
(
"Share-pluginInit"
);
//Check that annotator is working
if
(
!
Annotator
.
supported
())
{
return
;
...
...
@@ -245,7 +244,6 @@ Annotator.Plugin.Share = (function(_super) {
};
Share
.
prototype
.
initAPI
=
function
()
{
console
.
log
(
"initAPI"
);
// -- Detect API in the URL -- //
/*
The first option is to give a known id of an annotation
...
...
@@ -293,7 +291,6 @@ Annotator.Plugin.Share = (function(_super) {
return
API
;
}
Share
.
prototype
.
runningAPI
=
function
(
annotations
,
API
){
console
.
log
(
"runningAPI"
);
var
wrapper
=
$
(
'.annotator-wrapper'
).
parent
()[
0
],
mplayer
,
osda
,
...
...
@@ -332,10 +329,11 @@ Annotator.Plugin.Share = (function(_super) {
var
bounds
=
new
OpenSeadragon
.
Rect
(
an
.
bounds
.
x
,
an
.
bounds
.
y
,
an
.
bounds
.
width
,
an
.
bounds
.
height
);
setTimeout
(
function
(){
osda
.
viewer
.
viewport
.
fitBounds
(
bounds
,
false
);
$
(
'html,body'
).
animate
({
scrollTop
:
$
(
"#"
+
an
.
target
.
container
).
offset
().
top
},
'slow'
);},
250
);
$
(
'html,body'
).
animate
({
scrollTop
:
$
(
"#"
+
an
.
target
.
container
).
offset
().
top
},
'slow'
);
},
250
);
}
else
{
//It is a text
self
.
_isImage
(
an
);
var
hasRanges
=
typeof
an
.
ranges
!=
'undefined'
&&
typeof
an
.
ranges
[
0
]
!=
'undefined'
,
startOffset
=
hasRanges
?
an
.
ranges
[
0
].
startOffset
:
''
,
endOffset
=
hasRanges
?
an
.
ranges
[
0
].
endOffset
:
''
;
...
...
@@ -452,7 +450,7 @@ Annotator.Plugin.Share = (function(_super) {
}
Share
.
prototype
.
_isImage
=
function
(
annotation
){
return
annotation
.
media
==
'image'
;
return
annotation
.
media
==
=
'image'
;
}
Share
.
prototype
.
getParameterByName
=
function
(
name
)
{
...
...
@@ -476,13 +474,9 @@ Annotator.Plugin.Share = (function(_super) {
Share
.
prototype
.
getAnnotationFromId
=
function
(
ovaId
){
var
annotationList
=
this
.
annotator
.
plugins
.
Store
.
annotations
;
var
value
=
undefined
;
$
.
each
(
annotationList
,
function
(
key
,
val
){
if
(
val
.
id
==
ovaId
.
nodeValue
){
value
=
val
;
}
});
return
value
;
return
$
.
grep
(
annotationList
,
function
(
elementOfArray
,
indexInArray
){
return
parseInt
(
elementOfArray
.
id
)
===
parseInt
(
ovaId
.
nodeValue
);
})[
0
];
}
Share
.
prototype
.
updateViewer
=
function
(
field
,
annotation
)
{
...
...
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