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
4fffc02d
Commit
4fffc02d
authored
Jun 10, 2015
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some edge case handling in Guest
parent
494e58d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
guest.coffee
h/static/scripts/annotator/guest.coffee
+12
-9
No files found.
h/static/scripts/annotator/guest.coffee
View file @
4fffc02d
...
...
@@ -83,8 +83,11 @@ module.exports = class Guest extends Annotator
uriPromise
=
Promise
.
resolve
(
@
plugins
.
Document
.
uri
())
metadataPromise
=
Promise
.
resolve
(
@
plugins
.
Document
.
metadata
)
else
uriPromise
=
Promise
.
resolve
(
decodeURIComponent
(
window
.
location
.
href
))
metadataPromise
=
Promise
.
resolve
({
uriPromise
=
Promise
.
reject
()
metadataPromise
=
Promise
.
reject
()
uriPromise
=
uriPromise
.
catch
(
->
decodeURIComponent
(
window
.
location
.
href
))
metadataPromise
=
metadataPromise
.
catch
(
->
{
title
:
document
.
title
link
:
[{
href
:
decodeURIComponent
(
window
.
location
.
href
)}]
})
...
...
@@ -184,8 +187,8 @@ module.exports = class Guest extends Annotator
annotation
.
$orphan
=
false
self
.
anchors
=
self
.
anchors
.
concat
(
anchors
)
self
.
plugins
.
BucketBar
.
update
()
self
.
plugins
.
CrossFrame
.
sync
([
annotation
])
self
.
plugins
.
BucketBar
?
.
update
()
self
.
plugins
.
CrossFrame
?
.
sync
([
annotation
])
for
anchor
in
self
.
anchors
.
splice
(
0
,
self
.
anchors
.
length
)
if
anchor
.
annotation
is
annotation
...
...
@@ -211,7 +214,7 @@ module.exports = class Guest extends Annotator
return
annotation
createAnnotation
:
(
annotation
=
{})
->
ranges
=
@
selectedRanges
ranges
=
@
selectedRanges
?
[]
@
selectedRanges
=
null
getSelectors
=
(
range
)
->
...
...
@@ -252,7 +255,7 @@ module.exports = class Guest extends Annotator
this
.
anchors
=
anchors
this
.
publish
(
'annotationDeleted'
,
[
annotation
])
this
.
plugins
.
BucketBar
.
update
()
this
.
plugins
.
BucketBar
?
.
update
()
unhighlight
=
Array
::
concat
(
unhighlight
...)
new
Promise
(
raf
).
then
(
->
highlighter
.
removeHighlights
(
unhighlight
))
...
...
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