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
7967c7c1
Commit
7967c7c1
authored
Jun 05, 2012
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exceprt in editor view -- fixes #17
parent
cb6352cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
hypothesis.coffee
hypothesis/js/src/hypothesis.coffee
+24
-3
No files found.
hypothesis/js/src/hypothesis.coffee
View file @
7967c7c1
...
...
@@ -106,8 +106,20 @@ class Hypothesis extends Annotator
_createEditor
:
->
editor
=
new
Annotator
.
Editor
()
editor
.
hide
()
.
on
(
'hide'
,
this
.
onEditorHide
)
.
on
(
'save'
,
this
.
onEditorSubmit
)
# TODO: this is ugly... we shouldn't need to do this in both clauses --
# Annotator should handle highlights better
.
on
(
'hide'
,
=>
if
editor
.
annotation
?
.
highlights
?
and
not
editor
.
annotation
.
ranges
?
for
h
in
editor
.
annotation
.
highlights
$
(
h
).
replaceWith
(
h
.
childNodes
)
this
.
onEditorHide
()
)
.
on
(
'save'
,
(
annotation
)
=>
if
annotation
?
.
highlights
?
for
h
in
annotation
.
highlights
$
(
h
).
replaceWith
(
h
.
childNodes
)
this
.
onEditorSubmit
(
annotation
)
)
editor
.
fields
=
[{
element
:
editor
.
element
,
load
:
(
field
,
annotation
)
->
...
...
@@ -285,9 +297,18 @@ class Hypothesis extends Annotator
@
viewer
.
hide
()
@
editor
.
load
(
annotation
)
this
.
setupAnnotation
(
annotation
,
false
)
delete
annotation
.
ranges
excerpt
=
$
(
'<li class="hyp-widget hyp-excerpt">'
)
excerpt
.
append
(
$
(
"<div>
#{
annotation
.
quote
}
</div>"
))
item
=
$
(
'<li class="hyp-widget hyp-writer">'
)
item
.
append
(
$
(
Handlebars
.
templates
.
editor
(
annotation
)))
@
editor
.
element
.
find
(
'.annotator-listing'
).
empty
().
append
(
item
)
@
editor
.
element
.
find
(
'.annotator-listing'
).
empty
()
.
append
(
excerpt
)
.
append
(
item
)
d3
.
select
(
@
viewer
.
element
.
get
(
0
)).
datum
(
null
)
this
.
showSidebar
()
...
...
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