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
abb2c6bc
Commit
abb2c6bc
authored
Sep 12, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5146 from lduarte1991/lduarte-harvardx-pr23
Text Annotation Tool: Reply/Grouping Bug Fix
parents
698c9b59
5dc9e79d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
20 deletions
+32
-20
common/static/js/vendor/ova/catch/js/catch.js
+7
-5
common/static/js/vendor/ova/grouping-annotator.js
+25
-15
No files found.
common/static/js/vendor/ova/catch/js/catch.js
View file @
abb2c6bc
...
@@ -546,9 +546,11 @@ CatchAnnotation.prototype = {
...
@@ -546,9 +546,11 @@ CatchAnnotation.prototype = {
// public or is equal to the person with update access, then we leave it alone,
// public or is equal to the person with update access, then we leave it alone,
// otherwise we need to clean them up (i.e. disable them).
// otherwise we need to clean them up (i.e. disable them).
if
(
self
.
options
.
userId
!==
''
&&
self
.
options
.
userId
!==
value
.
permissions
.
update
[
0
])
{
if
(
self
.
options
.
userId
!==
''
&&
self
.
options
.
userId
!==
value
.
permissions
.
update
[
0
])
{
$
.
each
(
value
.
highlights
,
function
(
key1
,
value1
){
if
(
value
.
highlights
!==
undefined
)
{
$
(
value1
).
removeClass
(
'annotator-hl'
);
$
.
each
(
value
.
highlights
,
function
(
key1
,
value1
){
});
$
(
value1
).
removeClass
(
'annotator-hl'
);
});
}
}
}
});
});
},
},
...
@@ -1199,11 +1201,11 @@ CatchAnnotation.prototype = {
...
@@ -1199,11 +1201,11 @@ CatchAnnotation.prototype = {
annotations
.
forEach
(
function
(
ann
){
annotations
.
forEach
(
function
(
ann
){
var
child
,
h
,
_i
,
_len
,
_ref
;
var
child
,
h
,
_i
,
_len
,
_ref
;
if
(
ann
.
highlights
!==
null
)
{
if
(
ann
.
highlights
!==
undefined
)
{
_ref
=
ann
.
highlights
;
_ref
=
ann
.
highlights
;
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
h
=
_ref
[
_i
];
h
=
_ref
[
_i
];
if
(
!
(
h
.
parentNode
!==
null
))
{
if
(
!
(
h
.
parentNode
!==
undefined
))
{
continue
;
continue
;
}
}
child
=
h
.
childNodes
[
0
];
child
=
h
.
childNodes
[
0
];
...
...
common/static/js/vendor/ova/grouping-annotator.js
View file @
abb2c6bc
...
@@ -145,15 +145,19 @@ Annotator.Plugin.Grouping = (function(_super) {
...
@@ -145,15 +145,19 @@ Annotator.Plugin.Grouping = (function(_super) {
$
.
each
(
lineAnnDict
,
function
(
key
,
val
)
{
$
.
each
(
lineAnnDict
,
function
(
key
,
val
)
{
if
(
val
.
length
>
self
.
groupthreshold
)
{
if
(
val
.
length
>
self
.
groupthreshold
)
{
val
.
forEach
(
function
(
anno
){
val
.
forEach
(
function
(
anno
){
$
.
each
(
anno
.
highlights
,
function
(
key
,
anno
)
{
if
(
anno
.
highlights
!==
undefined
)
{
$
(
anno
).
css
(
"background-color"
,
"inherit"
);
$
.
each
(
anno
.
highlights
,
function
(
key
,
anno
)
{
});
$
(
anno
).
css
(
"background-color"
,
"inherit"
);
});
}
});
});
}
else
{
}
else
{
val
.
forEach
(
function
(
anno
)
{
val
.
forEach
(
function
(
anno
)
{
$
.
each
(
anno
.
highlights
,
function
(
key
,
anno
)
{
if
(
anno
.
highlights
!==
undefined
)
{
$
(
anno
).
css
(
"background-color"
,
"rgba(255, 255, 10, .3)"
);
$
.
each
(
anno
.
highlights
,
function
(
key
,
anno
)
{
});
$
(
anno
).
css
(
"background-color"
,
"rgba(255, 255, 10, .3)"
);
});
}
});
});
}
}
});
});
...
@@ -187,14 +191,18 @@ Annotator.Plugin.Grouping = (function(_super) {
...
@@ -187,14 +191,18 @@ Annotator.Plugin.Grouping = (function(_super) {
$
(
newdiv
).
click
(
function
(
evt
){
$
(
newdiv
).
click
(
function
(
evt
){
if
(
$
(
evt
.
srcElement
).
attr
(
"data-selected"
)
===
'0'
)
{
if
(
$
(
evt
.
srcElement
).
attr
(
"data-selected"
)
===
'0'
)
{
annotations
.
forEach
(
function
(
annot
){
annotations
.
forEach
(
function
(
annot
){
$
.
each
(
annot
.
highlights
,
function
(
key
,
ann
)
{
if
(
annot
.
highlights
!==
undefined
)
{
$
(
ann
).
css
(
"background-color"
,
"inherit"
);
$
.
each
(
annot
.
highlights
,
function
(
key
,
ann
)
{
});
$
(
ann
).
css
(
"background-color"
,
"inherit"
);
});
}
});
});
self
.
groupedAnnotations
[
$
(
evt
.
srcElement
).
css
(
"top"
).
replace
(
"px"
,
""
)].
forEach
(
function
(
item
)
{
self
.
groupedAnnotations
[
$
(
evt
.
srcElement
).
css
(
"top"
).
replace
(
"px"
,
""
)].
forEach
(
function
(
item
)
{
$
.
each
(
item
.
highlights
,
function
(
key
,
ann
)
{
if
(
item
.
highlights
!==
undefined
)
{
$
(
ann
).
css
(
"background-color"
,
"rgba(255, 255, 10, 0.3)"
);
$
.
each
(
item
.
highlights
,
function
(
key
,
ann
)
{
});
$
(
ann
).
css
(
"background-color"
,
"rgba(255, 255, 10, 0.3)"
);
});
}
});
});
$
(
evt
.
srcElement
).
attr
(
"data-selected"
,
'1'
);
$
(
evt
.
srcElement
).
attr
(
"data-selected"
,
'1'
);
}
else
{
}
else
{
...
@@ -237,9 +245,11 @@ Annotator.Plugin.Grouping = (function(_super) {
...
@@ -237,9 +245,11 @@ Annotator.Plugin.Grouping = (function(_super) {
$
(
".onOffGroupButton"
).
html
(
"Annotation Grouping: OFF"
);
$
(
".onOffGroupButton"
).
html
(
"Annotation Grouping: OFF"
);
$
(
".onOffGroupButton"
).
addClass
(
"buttonOff"
);
$
(
".onOffGroupButton"
).
addClass
(
"buttonOff"
);
this
.
annotator
.
plugins
.
Store
.
annotations
.
forEach
(
function
(
annot
)
{
this
.
annotator
.
plugins
.
Store
.
annotations
.
forEach
(
function
(
annot
)
{
$
.
each
(
annot
.
highlights
,
function
(
key
,
ann
)
{
if
(
annot
.
highlights
!==
undefined
)
{
$
(
ann
).
css
(
"background-color"
,
""
);
$
.
each
(
annot
.
highlights
,
function
(
key
,
ann
)
{
});
$
(
ann
).
css
(
"background-color"
,
""
);
});
}
});
});
// deals with the HighlightTags Plug-In
// deals with the HighlightTags Plug-In
...
...
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