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
89d66da8
Commit
89d66da8
authored
Dec 02, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1735 from hypothesis/highlight-state-considation
Highlight state considation
parents
81807551
1b497e2b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
47 deletions
+27
-47
controllers.coffee
h/static/scripts/controllers.coffee
+2
-2
guest.coffee
h/static/scripts/guest.coffee
+7
-9
heatmap.coffee
h/static/scripts/plugin/heatmap.coffee
+3
-7
services.coffee
h/static/scripts/services.coffee
+3
-3
base.scss
h/static/styles/base.scss
+4
-7
inject.scss
h/static/styles/inject.scss
+7
-18
viewer.html
h/templates/client/viewer.html
+1
-1
No files found.
h/static/scripts/controllers.coffee
View file @
89d66da8
...
@@ -337,7 +337,7 @@ class ViewerController
...
@@ -337,7 +337,7 @@ class ViewerController
highlights
=
[]
highlights
=
[]
for
p
in
annotator
.
providers
for
p
in
annotator
.
providers
p
.
channel
.
notify
p
.
channel
.
notify
method
:
'
setFocusedHighlight
s'
method
:
'
focusAnnotation
s'
params
:
highlights
params
:
highlights
$scope
.
scrollTo
=
(
annotation
)
->
$scope
.
scrollTo
=
(
annotation
)
->
...
@@ -353,7 +353,7 @@ class ViewerController
...
@@ -353,7 +353,7 @@ class ViewerController
else
else
true
true
$scope
.
isFocused
=
(
annotation
)
->
$scope
.
hasFocus
=
(
annotation
)
->
annotation
?
.
$
$tag
in
(
$scope
.
focusedAnnotations
?
[])
annotation
?
.
$
$tag
in
(
$scope
.
focusedAnnotations
?
[])
angular
.
module
(
'h'
)
angular
.
module
(
'h'
)
...
...
h/static/scripts/guest.coffee
View file @
89d66da8
...
@@ -143,14 +143,12 @@ class Annotator.Guest extends Annotator
...
@@ -143,14 +143,12 @@ class Annotator.Guest extends Annotator
if
value
then
@
plugins
.
Heatmap
.
_update
()
if
value
then
@
plugins
.
Heatmap
.
_update
()
)
)
.
bind
(
'
setFocusedHighlight
s'
,
(
ctx
,
tags
=
[])
=>
.
bind
(
'
focusAnnotation
s'
,
(
ctx
,
tags
=
[])
=>
for
hl
in
@
getHighlights
()
for
hl
in
@
getHighlights
()
if
hl
.
annotation
.
$
$tag
in
tags
if
hl
.
annotation
.
$
$tag
in
tags
hl
.
set
Active
true
,
true
hl
.
set
Focused
true
else
else
unless
hl
.
isTemporary
()
hl
.
setFocused
false
hl
.
setActive
false
,
true
this
.
publish
"finalizeHighlights"
)
)
.
bind
(
'scrollTo'
,
(
ctx
,
tag
)
=>
.
bind
(
'scrollTo'
,
(
ctx
,
tag
)
=>
...
@@ -250,9 +248,9 @@ class Annotator.Guest extends Annotator
...
@@ -250,9 +248,9 @@ class Annotator.Guest extends Annotator
method
:
"showEditor"
method
:
"showEditor"
params
:
annotation
.
$
$tag
params
:
annotation
.
$
$tag
focus
InViewer
:
(
annotations
)
=>
focus
Annotations
:
(
annotations
)
=>
@
panel
?
.
notify
@
panel
?
.
notify
method
:
"
setViewerFocu
s"
method
:
"
focusAnnotation
s"
params
:
(
a
.
$
$tag
for
a
in
annotations
)
params
:
(
a
.
$
$tag
for
a
in
annotations
)
onAnchorMousedown
:
->
onAnchorMousedown
:
->
...
@@ -303,14 +301,14 @@ class Annotator.Guest extends Annotator
...
@@ -303,14 +301,14 @@ class Annotator.Guest extends Annotator
if
@
visibleHighlights
or
@
tool
is
'highlight'
if
@
visibleHighlights
or
@
tool
is
'highlight'
event
.
stopPropagation
()
event
.
stopPropagation
()
annotations
=
event
.
data
.
getAnnotations
(
event
)
annotations
=
event
.
data
.
getAnnotations
(
event
)
this
.
focus
InViewer
annotations
this
.
focus
Annotations
annotations
# When leaving a highlight (with the cursor) in highlighting mode,
# When leaving a highlight (with the cursor) in highlighting mode,
# tell the sidebar to stop hiliting the relevant annotations
# tell the sidebar to stop hiliting the relevant annotations
onAnchorMouseout
:
(
event
)
->
onAnchorMouseout
:
(
event
)
->
if
@
visibleHighlights
or
@
tool
is
'highlight'
if
@
visibleHighlights
or
@
tool
is
'highlight'
event
.
stopPropagation
()
event
.
stopPropagation
()
this
.
focus
InViewer
[]
this
.
focus
Annotations
[]
# When clicking on a highlight in highlighting mode,
# When clicking on a highlight in highlighting mode,
# tell the sidebar to bring up the viewer for the relevant annotations
# tell the sidebar to bring up the viewer for the relevant annotations
...
...
h/static/scripts/plugin/heatmap.coffee
View file @
89d66da8
...
@@ -320,18 +320,14 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
...
@@ -320,18 +320,14 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
bucket
=
@
tabs
.
index
(
event
.
currentTarget
)
bucket
=
@
tabs
.
index
(
event
.
currentTarget
)
for
hl
in
@
annotator
.
getHighlights
()
for
hl
in
@
annotator
.
getHighlights
()
if
hl
.
annotation
in
@
buckets
[
bucket
]
if
hl
.
annotation
in
@
buckets
[
bucket
]
hl
.
set
Active
true
,
true
hl
.
set
Focus
true
else
else
unless
hl
.
isTemporary
()
hl
.
setFocus
false
hl
.
setActive
false
,
true
@
annotator
.
publish
"finalizeHighlights"
# Gets rid of them after
# Gets rid of them after
.
on
'mouseout'
,
=>
.
on
'mouseout'
,
=>
for
hl
in
@
annotator
.
getHighlights
()
for
hl
in
@
annotator
.
getHighlights
()
unless
hl
.
isTemporary
()
hl
.
setFocus
false
hl
.
setActive
false
,
true
@
annotator
.
publish
"finalizeHighlights"
# Does one of a few things when a tab is clicked depending on type
# Does one of a few things when a tab is clicked depending on type
.
on
'click'
,
(
event
)
=>
.
on
'click'
,
(
event
)
=>
...
...
h/static/scripts/services.coffee
View file @
89d66da8
...
@@ -164,9 +164,9 @@ class Hypothesis extends Annotator
...
@@ -164,9 +164,9 @@ class Hypothesis extends Annotator
this
.
updateViewer
this
.
_getLocalAnnotations
(
tags
)
this
.
updateViewer
this
.
_getLocalAnnotations
(
tags
)
)
)
.
bind
(
'
setViewerFocu
s'
,
(
ctx
,
tags
=
[])
=>
.
bind
(
'
focusAnnotation
s'
,
(
ctx
,
tags
=
[])
=>
@
element
.
scope
().
$apply
=>
@
element
.
scope
().
$apply
=>
this
.
setViewerFocu
s
tags
this
.
focusAnnotation
s
tags
)
)
.
bind
(
'toggleViewerSelection'
,
(
ctx
,
tags
=
[])
=>
.
bind
(
'toggleViewerSelection'
,
(
ctx
,
tags
=
[])
=>
...
@@ -236,7 +236,7 @@ class Hypothesis extends Annotator
...
@@ -236,7 +236,7 @@ class Hypothesis extends Annotator
@
_setSelectedAnnotations
selected
@
_setSelectedAnnotations
selected
this
this
setViewerFocu
s
:
(
tags
)
->
focusAnnotation
s
:
(
tags
)
->
@
element
.
scope
().
focusedAnnotations
=
tags
@
element
.
scope
().
focusedAnnotations
=
tags
updateViewer
:
(
annotations
=
[])
->
updateViewer
:
(
annotations
=
[])
->
...
...
h/static/styles/base.scss
View file @
89d66da8
...
@@ -55,13 +55,10 @@ $negative: #d11c2b;
...
@@ -55,13 +55,10 @@ $negative: #d11c2b;
$neutral
:
#0171ba
;
$neutral
:
#0171ba
;
//OTHER VARIABLES
//OTHER VARIABLES
$highlight-color
:
rgba
(
192
,
236
,
253
,
0
.5
);
$highlight-color
:
rgba
(
255
,
255
,
60
,
0
.3
);
$highlight-color-second
:
rgba
(
181
,
234
,
255
,
0
.8
);
$highlight-color-second
:
rgba
(
206
,
206
,
60
,
0
.4
);
$highlight-color-third
:
rgba
(
149
,
224
,
253
,
0
.8
);
$highlight-color-third
:
rgba
(
192
,
192
,
49
,
0
.4
);
$highlight-mode-color
:
rgba
(
255
,
255
,
60
,
0
.3
);
$highlight-color-focus
:
rgba
(
192
,
236
,
253
,
0
.5
);
$highlight-mode-color-second
:
rgba
(
206
,
206
,
60
,
0
.4
);
$highlight-mode-color-third
:
rgba
(
192
,
192
,
49
,
0
.4
);
$highlight-mode-active-color
:
rgba
(
255
,
255
,
60
,
0
.7
);
$score-width
:
40px
;
$score-width
:
40px
;
$score-height
:
$score-width
;
$score-height
:
$score-width
;
$heatmap-width
:
22px
;
$heatmap-width
:
22px
;
...
...
h/static/styles/inject.scss
View file @
89d66da8
...
@@ -99,18 +99,7 @@ $base-font-size: 14px;
...
@@ -99,18 +99,7 @@ $base-font-size: 14px;
}
}
//HIGHLIGHTS////////////////////////////////
//HIGHLIGHTS////////////////////////////////
.annotator-highlights-always-on
.annotator-hl
,
.annotator-hl
{
.annotator-hl-active
,
.annotator-hl-temporary
,
.annotator-hl-focused
{
background
:
$highlight-color
;
.annotator-hl
{
background-color
:
$highlight-color-second
;
}
.annotator-hl
.annotator-hl
{
background-color
:
$highlight-color-third
;
}
&
:
:-
moz-selection
{
&
:
:-
moz-selection
{
background
:
$highlight-color
;
background
:
$highlight-color
;
}
}
...
@@ -123,20 +112,20 @@ $base-font-size: 14px;
...
@@ -123,20 +112,20 @@ $base-font-size: 14px;
}
}
.annotator-highlights-always-on
.annotator-hl
{
.annotator-highlights-always-on
.annotator-hl
{
background
:
$highlight-
mode-
color
;
background
:
$highlight-color
;
.annotator-hl
{
.annotator-hl
{
background-color
:
$highlight-
mode-
color-second
;
background-color
:
$highlight-color-second
;
}
}
.annotator-hl
.annotator-hl
{
.annotator-hl
.annotator-hl
{
background-color
:
$highlight-
mode-
color-third
;
background-color
:
$highlight-color-third
;
}
}
}
}
.annotator-h
ighlights-always-on
.annotator-hl-active
,
.annotator-h
l-focused
,
.annotator-highlights-always-on
.annotator-hl-focused
{
.annotator-highlights-always-on
.annotator-hl
.annotator-hl
-focused
{
background-color
:
$highlight-
mode-active-color
;
background-color
:
$highlight-
color-focus
;
}
}
// Sidebar
// Sidebar
...
...
h/templates/client/viewer.html
View file @
89d66da8
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
</span>
</span>
</li>
</li>
<li
class=
"paper thread"
<li
class=
"paper thread"
ng-class=
"{'js-hover':
isFocused
(child.message)}"
ng-class=
"{'js-hover':
hasFocus
(child.message)}"
deep-count=
"count"
deep-count=
"count"
thread=
"child"
thread-filter
thread=
"child"
thread-filter
thread-collapsed=
"!search.query"
thread-collapsed=
"!search.query"
...
...
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