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
bd0b5822
Commit
bd0b5822
authored
Jan 19, 2015
by
Aron Carroll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1863 from hypothesis/view-resolve-auth
Resolve user authorization before view render.
parents
d9f44498
ca2083cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
app.coffee
h/static/scripts/app.coffee
+8
-0
controllers.coffee
h/static/scripts/controllers.coffee
+4
-2
streamsearch.coffee
h/static/scripts/streamsearch.coffee
+5
-6
No files found.
h/static/scripts/app.coffee
View file @
bd0b5822
...
...
@@ -12,6 +12,14 @@ imports = [
resolve
=
auth
:
[
'$q'
,
'$rootScope'
,
'auth'
,
(
$q
,
$rootScope
,
auth
)
->
dfd
=
$q
.
defer
()
unwatch
=
$rootScope
.
$watch
(
->
auth
.
user
),
(
user
)
->
return
if
user
is
undefined
dfd
.
resolve
(
auth
)
unwatch
()
dfd
.
promise
]
store
:
[
'store'
,
(
store
)
->
store
.
$promise
]
...
...
h/static/scripts/controllers.coffee
View file @
bd0b5822
...
...
@@ -36,8 +36,7 @@ class AppController
oncancel
=
->
$scope
.
dialog
.
visible
=
false
$scope
.
$on
'$routeChangeStart'
,
(
event
,
newRoute
,
oldRoute
)
->
return
if
newRoute
.
redirectTo
cleanupAnnotations
=
->
# Clean up any annotations that need to be unloaded.
for
id
,
container
of
$scope
.
threading
.
idTable
when
container
.
message
# Remove annotations not belonging to this user when highlighting.
...
...
@@ -76,6 +75,9 @@ class AppController
streamer
.
close
()
streamer
.
open
(
$window
.
WebSocket
,
streamerUrl
)
# Clean up annotations that should be removed
cleanupAnnotations
()
# Reload the view.
$route
.
reload
()
...
...
h/static/scripts/streamsearch.coffee
View file @
bd0b5822
...
...
@@ -19,6 +19,11 @@ class StreamSearchController
terms
=
searchfilter
.
generateFacetedFilter
$scope
.
search
.
query
queryparser
.
populateFilter
streamfilter
,
terms
# Perform the search
query
=
angular
.
extend
limit
:
10
,
$scope
.
search
.
query
store
.
SearchResource
.
get
query
,
({
rows
})
->
annotator
.
loadAnnotations
(
rows
)
$scope
.
isEmbedded
=
false
$scope
.
isStream
=
true
...
...
@@ -29,11 +34,5 @@ class StreamSearchController
$scope
.
$on
'$destroy'
,
->
$scope
.
search
.
query
=
''
$scope
.
$watch
(
->
auth
.
user
),
->
query
=
angular
.
extend
limit
:
10
,
$scope
.
search
.
query
store
.
SearchResource
.
get
query
,
({
rows
})
->
annotator
.
loadAnnotations
(
rows
)
angular
.
module
(
'h'
)
.
controller
(
'StreamSearchController'
,
StreamSearchController
)
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