Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
67d87893
Commit
67d87893
authored
May 18, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore highlight events
parent
e69eff91
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
guest.coffee
h/static/scripts/annotator/guest.coffee
+15
-11
No files found.
h/static/scripts/annotator/guest.coffee
View file @
67d87893
...
...
@@ -15,6 +15,9 @@ module.exports = class Guest extends Annotator
".annotator-adder button click"
:
"onAdderClick"
".annotator-adder button mousedown"
:
"onAdderMousedown"
".annotator-adder button mouseup"
:
"onAdderMouseup"
".annotator-hl click"
:
"onHighlightClick"
".annotator-hl mouseover"
:
"onHighlightMouseover"
".annotator-hl mouseout"
:
"onHighlightMouseout"
"setVisibleHighlights"
:
"setVisibleHighlights"
# Plugin configuration
...
...
@@ -233,8 +236,6 @@ module.exports = class Guest extends Annotator
method
:
"focusAnnotations"
params
:
(
a
.
$
$tag
for
a
in
annotations
)
onAnchorMousedown
:
->
onSuccessfulSelection
:
(
event
,
immediate
)
->
unless
event
?
throw
"Called onSuccessfulSelection without an event!"
...
...
@@ -272,25 +273,28 @@ module.exports = class Guest extends Annotator
this
.
triggerShowFrame
()
this
.
showAnnotations
annotations
# When Mousing over a highlight, tell the sidebar to focus the relevant annotations
onAnchorMouseover
:
(
event
)
->
onHighlightMouseover
:
(
event
)
->
if
@
visibleHighlights
event
.
stopPropagation
()
annotations
=
event
.
data
.
getAnnotations
(
event
)
annotations
=
[]
for
obj
in
@
anchored
if
event
.
target
in
obj
.
highlights
annotations
.
push
(
obj
.
annotation
)
this
.
focusAnnotations
annotations
# Tell the sidebar to stop highlighting the relevant annotations
onAnchorMouseout
:
(
event
)
->
onHighlightMouseout
:
(
event
)
->
if
@
visibleHighlights
event
.
stopPropagation
()
this
.
focusAnnotations
[]
# When clicking on a highlight, tell the sidebar to bring up the viewer for the relevant annotations
onAnchorClick
:
(
event
)
=>
onHighlightClick
:
(
event
)
=>
if
@
visibleHighlights
event
.
stopPropagation
()
this
.
selectAnnotations
(
event
.
data
.
getAnnotations
event
),
(
event
.
metaKey
or
event
.
ctrlKey
)
annotations
=
[]
for
obj
in
@
anchored
if
event
.
target
in
obj
.
highlights
annotations
.
push
(
obj
.
annotation
)
this
.
selectAnnotations
annotations
,
(
event
.
metaKey
or
event
.
ctrlKey
)
# Pass true to show the highlights in the frame or false to disable.
setVisibleHighlights
:
(
shouldShowHighlights
)
->
...
...
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