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
04de6f74
Commit
04de6f74
authored
Oct 09, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
On highlight mode, check social view / auth
For #798
parent
add53021
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
31 deletions
+21
-31
controllers.coffee
h/js/controllers.coffee
+3
-30
services.coffee
h/js/services.coffee
+18
-1
No files found.
h/js/controllers.coffee
View file @
04de6f74
...
...
@@ -31,9 +31,9 @@ class App
authentication
.
token
=
null
# Leave Highlighting mode when logging out
if
$scope
.
highlightingMode
if
annotator
.
tool
is
'highlight'
# Because of logging out, we must leave Highlighting Mode.
$scope
.
toggleHighlightingMode
()
annotator
.
setTool
'comment'
# No need to reload annotations after login, since the Social View
# change (caused by leaving Highlighting Mode) will trigger
# a reload anyway.
...
...
@@ -67,7 +67,7 @@ class App
if
$scope
.
ongoingHighlightSwitch
$timeout
=>
$scope
.
toggleHighlightingMode
()
annotator
.
setTool
'highlight'
,
500
else
plugins
.
Permissions
.
setUser
(
null
)
...
...
@@ -176,33 +176,6 @@ class App
method
:
'setAlwaysOnMode'
params
:
$scope
.
alwaysOnMode
$scope
.
highlightingMode
=
false
$scope
.
toggleHighlightingMode
=
->
# Check for drafts
return
unless
annotator
.
discardDrafts
()
# Check login state first
unless
plugins
.
Auth
?
and
plugins
.
Auth
.
haveValidToken
()
# If we are not logged in, start the auth process
$scope
.
ongoingHighlightSwitch
=
true
# No need to reload annotations upon login, since Social View change
# will trigger a reload anyway.
$scope
.
skipAuthChangeReload
=
true
annotator
.
show
()
$scope
.
sheet
.
collapsed
=
false
$scope
.
sheet
.
tab
=
'login'
return
delete
$scope
.
ongoingHighlightSwitch
$scope
.
highlightingMode
=
not
$scope
.
highlightingMode
annotator
.
socialView
.
name
=
if
$scope
.
highlightingMode
then
"single-player"
else
"none"
for
p
in
providers
p
.
channel
.
notify
method
:
'setHighlightingMode'
params
:
$scope
.
highlightingMode
$scope
.
createUnattachedAnnotation
=
->
return
unless
annotator
.
discardDrafts
()
provider
.
notify
method
:
'addComment'
...
...
h/js/services.coffee
View file @
04de6f74
...
...
@@ -450,9 +450,26 @@ class Hypothesis extends Annotator
setTool
:
(
name
)
=>
return
if
name
is
@
tool
if
tool
is
'highlight'
scope
=
@
element
.
scope
()
if
name
is
'highlight'
return
unless
this
.
discardDrafts
()
# Check login state first
unless
@
plugins
.
Auth
?
and
@
plugins
.
Auth
.
haveValidToken
()
# If we are not logged in, start the auth process
scope
.
ongoingHighlightSwitch
=
true
# No need to reload annotations upon login, since Social View change
# will trigger a reload anyway.
scope
.
skipAuthChangeReload
=
true
scope
.
sheet
.
collapsed
=
false
scope
.
sheet
.
tab
=
'login'
this
.
show
()
return
this
.
socialView
.
name
=
'single-player'
else
this
.
socialView
.
name
=
'none'
@
tool
=
name
this
.
publish
'setTool'
,
name
for
p
in
@
providers
...
...
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