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
c6554347
Commit
c6554347
authored
Oct 25, 2012
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #196 from jtremback/cssCleaning
close #82
parents
ddc66d2d
cbab975e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
57 deletions
+57
-57
helpers.js
h/js/lib/helpers.js
+1
-1
hypothesis.coffee
h/js/src/hypothesis.coffee
+31
-31
app.scss
h/sass/app.scss
+3
-3
common.scss
h/sass/common.scss
+22
-22
No files found.
h/js/lib/helpers.js
View file @
c6554347
...
...
@@ -50,5 +50,5 @@ Handlebars.registerHelper('formatUser', function (user) {
return
new
Handlebars
.
SafeString
(
user
.
replace
(
/^acct:
([^
@
]
+
)
@
(
.+
)
$/
,
'$1 <span class="
hyp-
provider">on $2</span>'
))
'$1 <span class="provider">on $2</span>'
))
})
h/js/src/hypothesis.coffee
View file @
c6554347
...
...
@@ -152,7 +152,7 @@ class Hypothesis extends Annotator
@
heatmap
.
subscribe
'updated'
,
=>
# Creates tabs var by looking at all buckets on page.
tabs
=
d3
.
select
(
document
.
body
)
.
selectAll
(
'div.h
yp-h
eatmap-tab'
)
.
selectAll
(
'div.heatmap-tab'
)
.
data
=>
buckets
=
[]
@
heatmap
.
index
.
forEach
(
b
,
i
)
=>
...
...
@@ -168,7 +168,7 @@ class Hypothesis extends Annotator
# Enters into tabs var, and generates bucket pointers from them
tabs
.
enter
().
append
(
'div'
)
.
classed
(
'h
yp-h
eatmap-tab'
,
true
)
.
classed
(
'heatmap-tab'
,
true
)
tabs
.
exit
().
remove
()
...
...
@@ -329,8 +329,8 @@ class Hypothesis extends Annotator
.
data
((
m
)
->
m
.
children
),
((
d
)
->
d
.
message
.
id
)
context
=
d3
.
select
(
@
viewer
.
element
[
0
]).
datum
(
messages
)
items
=
thread
context
,
'.
hyp-
annotation'
excerpts
=
thread
context
,
'.
hyp-
excerpt'
items
=
thread
context
,
'.annotation'
excerpts
=
thread
context
,
'.excerpt'
if
not
detail
# Save the state so the bucket view can be restored when exiting
...
...
@@ -340,16 +340,16 @@ class Hypothesis extends Annotator
excerpts
.
remove
()
excerpts
.
exit
().
remove
()
items
.
enter
().
append
(
'li'
).
classed
(
'
hyp-
annotation'
,
true
)
items
.
enter
().
append
(
'li'
).
classed
(
'annotation'
,
true
)
items
.
exit
().
remove
()
items
.
each
(
d
)
->
_t
=
d3
.
select
(
this
)
unless
this
and
_t
.
classed
(
'
hyp-
summary'
)
unless
this
and
_t
.
classed
(
'summary'
)
_t
.
html
Handlebars
.
templates
.
summary
d
.
message
.
annotation
.
classed
(
'
hyp-
detail'
,
false
)
.
classed
(
'
hyp-
summary'
,
true
)
.
classed
(
'
hyp-
paper'
,
true
)
.
classed
(
'detail'
,
false
)
.
classed
(
'summary'
,
true
)
.
classed
(
'paper'
,
true
)
.
on
'mouseup'
,
(
d
,
i
)
=>
a
=
d
.
message
.
annotation
query
=
...
...
@@ -372,9 +372,9 @@ class Hypothesis extends Annotator
@
detail
=
true
excerpts
.
enter
()
.
insert
(
'li'
,
'.
hyp-
annotation'
)
.
classed
(
'
hyp-
paper'
,
true
)
.
classed
(
'
hyp-
excerpt'
,
true
)
.
insert
(
'li'
,
'.annotation'
)
.
classed
(
'paper'
,
true
)
.
classed
(
'excerpt'
,
true
)
.
append
(
'blockquote'
)
excerpts
.
exit
().
remove
()
...
...
@@ -404,16 +404,16 @@ class Hypothesis extends Annotator
@
provider
.
setActiveHighlights
highlights
while
items
.
length
items
.
enter
().
append
(
'li'
).
classed
(
'
hyp-
annotation'
,
true
)
items
.
enter
().
append
(
'li'
).
classed
(
'annotation'
,
true
)
items
.
exit
().
remove
()
items
.
each
(
d
)
->
_t
=
this
and
d3
.
select
(
this
)
unless
_t
and
_t
.
classed
(
'
hyp-
detail'
)
unless
_t
and
_t
.
classed
(
'detail'
)
_t
.
html
Handlebars
.
templates
.
detail
d
.
message
.
annotation
.
classed
(
'
hyp-
paper'
,
(
c
)
->
not
c
.
parent
.
message
?
)
.
classed
(
'
hyp-
detail'
,
true
)
.
classed
(
'
hyp-
summary'
,
false
)
.
classed
(
'paper'
,
(
c
)
->
not
c
.
parent
.
message
?
)
.
classed
(
'detail'
,
true
)
.
classed
(
'summary'
,
false
)
.
sort
(
d
,
e
)
=>
n
=
d
.
message
.
annotation
.
created
...
...
@@ -422,11 +422,11 @@ class Hypothesis extends Annotator
.
on
'mouseover'
,
=>
d3
.
event
.
stopPropagation
()
d3
.
select
(
d3
.
event
.
currentTarget
).
classed
(
'h
yp-h
over'
,
true
)
d3
.
select
(
d3
.
event
.
currentTarget
).
classed
(
'hover'
,
true
)
.
on
'mouseout'
,
=>
d3
.
event
.
stopPropagation
()
d3
.
select
(
d3
.
event
.
currentTarget
).
classed
(
'h
yp-h
over'
,
false
)
d3
.
select
(
d3
.
event
.
currentTarget
).
classed
(
'hover'
,
false
)
.
on
'mouseup'
,
=>
event
=
d3
.
event
...
...
@@ -435,8 +435,8 @@ class Hypothesis extends Annotator
event
.
stopPropagation
()
animate
=
(
parent
)
->
collapsed
=
parent
.
classed
(
'
hyp-
collapsed'
)
parent
.
select
(
'.
hyp-
thread'
)
collapsed
=
parent
.
classed
(
'collapsed'
)
parent
.
select
(
'.thread'
)
.
transition
().
duration
(
200
)
.
style
(
'overflow'
,
'hidden'
)
.
style
'height'
,
->
...
...
@@ -454,15 +454,15 @@ class Hypothesis extends Annotator
switch
d3
.
event
.
target
.
getAttribute
(
'href'
)
when
'#collapse'
d3
.
event
.
preventDefault
()
collapsed
=
parent
.
classed
(
'
hyp-
collapsed'
)
animate
parent
.
classed
(
'
hyp-
collapsed'
,
!
collapsed
)
collapsed
=
parent
.
classed
(
'collapsed'
)
animate
parent
.
classed
(
'collapsed'
,
!
collapsed
)
when
'#reply'
unless
@
plugins
.
Permissions
?
.
user
showAuth
true
break
d3
.
event
.
preventDefault
()
parent
=
d3
.
select
(
event
.
currentTarget
)
animate
parent
.
classed
(
'
hyp-
collapsed'
,
false
)
animate
parent
.
classed
(
'collapsed'
,
false
)
reply
=
this
.
createAnnotation
()
reply
.
thread
=
this
.
threadId
(
parent
.
datum
().
message
.
annotation
)
...
...
@@ -479,16 +479,16 @@ class Hypothesis extends Annotator
item
=
d3
.
select
(
d3
.
event
.
currentTarget
)
.
select
(
'.annotator-listing'
)
.
insert
(
'li'
,
'.
hyp-
annotation'
)
.
classed
(
'
hyp-
annotation'
,
true
)
.
classed
(
'
hyp-
writer'
,
true
)
.
insert
(
'li'
,
'.annotation'
)
.
classed
(
'annotation'
,
true
)
.
classed
(
'writer'
,
true
)
editor
.
element
.
appendTo
(
item
.
node
())
editor
.
on
(
'hide'
,
=>
item
.
remove
())
editor
.
element
.
find
(
":input:first"
).
focus
()
context
=
items
.
select
'.
hyp-
thread'
items
=
thread
context
,
'.
hyp-
annotation'
context
=
items
.
select
'.thread'
items
=
thread
context
,
'.annotation'
@
editor
.
hide
()
@
viewer
.
show
()
...
...
@@ -509,10 +509,10 @@ class Hypothesis extends Annotator
@
editor
.
element
.
find
(
'.annotator-controls'
).
remove
()
quote
=
annotation
.
quote
.
replace
(
/\u00a0/g
,
' '
)
# replace
excerpt
=
$
(
'<li class="
hyp-paper hyp-
excerpt">'
)
excerpt
=
$
(
'<li class="
paper
excerpt">'
)
excerpt
.
append
(
$
(
"<blockquote>
#{
quote
}
</blockquote>"
))
item
=
$
(
'<li class="
hyp-paper hyp-
writer">'
)
item
=
$
(
'<li class="
paper
writer">'
)
item
.
append
(
$
(
Handlebars
.
templates
.
editor
(
annotation
)))
@
editor
.
element
.
find
(
'.annotator-listing'
).
empty
()
...
...
h/sass/app.scss
View file @
c6554347
...
...
@@ -37,7 +37,7 @@ svg { -webkit-tap-highlight-color: rgba(255, 255, 255, 0); }
}
//HEATMAP TABS
.h
yp-h
eatmap-tab
{
.heatmap-tab
{
@include
user-select
(
none
);
background-image
:
url("../images/side_tab.svg")
;
background-position
:
center
1
.025em
;
...
...
@@ -79,7 +79,7 @@ svg { -webkit-tap-highlight-color: rgba(255, 255, 255, 0); }
// .h
yp-h
eatmap-tab {
// .heatmap-tab {
// @include user-select(none);
// color: rgb(238, 238, 238);
// cursor: pointer;
...
...
@@ -187,7 +187,7 @@ svg { -webkit-tap-highlight-color: rgba(255, 255, 255, 0); }
@include
transform-origin
(
50%
,
0
);
z-index
:
4
;
&
.
hyp-
collapsed
{
&
.collapsed
{
@include
rotateX
(
90deg
);
opacity
:
0
;
pointer-events
:
none
;
...
...
h/sass/common.scss
View file @
c6554347
...
...
@@ -192,15 +192,15 @@ label {
color
:
$gray
;
text-align
:
right
;
&
.
hyp-
write
{
&
.write
{
background-image
:
url("../images/pen_1.png")
;
}
&
.
hyp-
fave
{
&
.fave
{
background-image
:
url("../images/fave_1.png")
;
}
&
.
hyp-
flag
{
&
.flag
{
background-image
:
url("../images/flag_1.png")
;
}
...
...
@@ -215,10 +215,10 @@ label {
}
//BODY
.
hyp-content
{
white-space
:
pre-wrap
;
}
.
body
{
white-space
:
pre-wrap
;
}
//Provides the white background upon which items sit
.
hyp-
paper
{
.paper
{
@include
border-radius
(
.2em
);
@include
smallshadow
;
background
:
#fff
;
...
...
@@ -226,7 +226,7 @@ label {
}
//THREAD INDENTATION
.
hyp-
thread
{
.thread
{
margin
:
0
-1em
-1em
(
-
$thread-padding
/
2
);
padding-left
:
$thread-padding
/
2
;
...
...
@@ -237,14 +237,14 @@ label {
padding
:
.5em
1em
1em
$thread-padding
;
}
&
.
hyp-
detail
{
&
.detail
{
font-size
:
1em
;
}
}
}
//THREADEXP OBJECT
.
hyp-
threadexp
{
.threadexp
{
height
:
$threadexp-width
;
width
:
$threadexp-width
;
position
:
absolute
;
...
...
@@ -253,13 +253,13 @@ label {
outline
:
1px
dotted
#aaa
;
@include
icon
(
"minus_1.png"
);
.
hyp-
collapsed
>
&
{
.collapsed
>
&
{
background-image
:
url("../images/plus_1.png")
;
}
}
//EXCERPT
.
hyp-
excerpt
{
.excerpt
{
position
:
relative
;
margin-bottom
:
1em
;
blockquote
{
...
...
@@ -387,7 +387,7 @@ blockquote {
}
//TIMESTAMP
.
hyp-
time
{
.time
{
float
:
right
;
display
:
inline-block
;
line-height
:
2em
;
...
...
@@ -395,7 +395,7 @@ blockquote {
}
//COMMON CLASSES (TODO: put into a class common to all annotations)
.
hyp-content
{
.
body
{
margin-bottom
:
.5em
}
...
...
@@ -404,7 +404,7 @@ blockquote {
}
//ANNOTATION DETAIL
.
hyp-
detail
{
.detail
{
position
:
relative
;
&
>
.annotator-controls
{
position
:
absolute
;
...
...
@@ -417,14 +417,14 @@ blockquote {
opacity
:
0
;
}
&
.h
yp-h
over
{
&
.hover
{
&
>
.annotator-controls
{
opacity
:
1
;
}
}
&
.
hyp-
collapsed
{
&
>
.
hyp-content
{
&
.collapsed
{
&
>
.
body
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
-o-text-overflow
:
ellipsis
;
...
...
@@ -432,8 +432,8 @@ blockquote {
font-style
:
italic
;
margin-top
:
0
;
}
&
>
.
hyp-
thread
{
overflow
:
hidden
;
}
&
>
.
hyp-
user
{
&
>
.thread
{
overflow
:
hidden
;
}
&
>
.user
{
display
:
run-in
;
margin-right
:
.25em
;
}
...
...
@@ -441,18 +441,18 @@ blockquote {
}
// Remove the expander from the top level annotation
.
hyp-paper
>
.hyp-
threadexp
{
.
paper
>
.
threadexp
{
display
:
none
;
}
.
hyp-
user
{
.user
{
margin-bottom
:
.25em
;
font-weight
:
bold
;
text-decoration
:
underline
;
}
//EDITOR
.
hyp-
writer
{
.writer
{
@include
smallshadow
(
0
,
2px
,
.2
);
position
:
relative
;
...
...
@@ -466,7 +466,7 @@ blockquote {
}
//BUCKET VIEW REPLY SUMMARIES
.
hyp-
summary
{
.summary
{
margin-bottom
:
1em
;
position
:
relative
;
cursor
:
pointer
;
...
...
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