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
852084c7
Commit
852084c7
authored
Nov 19, 2012
by
Ujvari Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #181 -Extended close-confirm functionality to newly created annotations too.
parent
5c82eb04
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
hypothesis.coffee
h/js/src/hypothesis.coffee
+10
-5
No files found.
h/js/src/hypothesis.coffee
View file @
852084c7
...
...
@@ -29,6 +29,10 @@ class Hypothesis extends Annotator
this
.
publish
event
,
[
annotation
]
addPlugin
:
=>
this
.
addPlugin
arguments
...
createAnnotation
:
=>
if
not
this
.
_canCloseUnsaved
()
@
editor
.
hide
()
this
.
show
()
return
@
cache
[
h
=
++
@
hash
]
=
this
.
createAnnotation
()
h
showEditor
:
(
stub
)
=>
...
...
@@ -42,6 +46,7 @@ class Hypothesis extends Annotator
else
showAuth
true
@
editor
.
hide
()
if
@
unsaved_drafts
.
indexOf
(
@
editor
)
>
-
1
then
@
unsaved_drafts
.
splice
(
@
unsaved_drafts
.
indexOf
(
@
editor
),
1
)
this
.
show
()
# This guy does stuff when you "back out" of the interface.
# (Currently triggered by a click on the source page.)
...
...
@@ -324,9 +329,8 @@ class Hypothesis extends Annotator
@
provider
.
setupAnnotation
stub
showViewer
:
(
annotations
=
[],
detail
=
false
)
=>
if
@
visible
and
not
detail
if
not
this
.
_canCloseUnsaved
()
return
if
(
@
visible
and
not
detail
)
or
@
unsaved_drafts
.
indexOf
(
@
editor
)
>
-
1
if
not
this
.
_canCloseUnsaved
()
then
return
# Thread the messages using JWZ
messages
=
mail
.
messageThread
().
thread
annotations
.
map
(
a
)
->
...
...
@@ -407,7 +411,6 @@ class Hypothesis extends Annotator
else
d3
.
select
(
this
).
html
(
quote
)
highlights
=
[]
excerpts
.
each
(
d
)
=>
h
=
d
.
message
.
annotation
.
hash
...
...
@@ -514,6 +517,7 @@ class Hypothesis extends Annotator
items
=
thread
context
,
'.annotation'
@
editor
.
hide
()
if
@
unsaved_drafts
.
indexOf
(
@
editor
)
>
-
1
then
@
unsaved_drafts
.
splice
(
@
unsaved_drafts
.
indexOf
(
@
editor
),
1
)
@
viewer
.
show
()
updateViewer
:
(
annotations
)
=>
...
...
@@ -527,6 +531,7 @@ class Hypothesis extends Annotator
if
not
annotation
.
user
?
@
plugins
.
Permissions
.
addFieldsToAnnotation
(
annotation
)
@
unsaved_drafts
.
push
@
editor
@
viewer
.
hide
()
@
editor
.
load
(
annotation
)
@
editor
.
element
.
find
(
'.annotator-controls'
).
remove
()
...
...
@@ -571,7 +576,7 @@ class Hypothesis extends Annotator
for
editor
in
@
unsaved_drafts
editor
.
show
()
unsaved_text
=
editor
.
element
[
0
].
ownerDocument
.
activeElement
.
value
if
unsaved_text
!=
null
and
unsaved_text
.
toString
().
length
>
0
then
open_editors
+=
1
if
typeof
unsaved_text
!=
'undefined'
and
unsaved_text
.
toString
().
length
>
0
then
open_editors
+=
1
if
open_editors
>
0
ctext
=
if
open_editors
>
1
then
"You have "
+
open_editors
+
" unsaved replies. Do you really want to close the view?"
else
"You have an unsaved reply. Do you really want to close the view?"
...
...
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