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
582358b6
Commit
582358b6
authored
Mar 10, 2014
by
gergely-ujvari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
H main controller uses baseurl from Helper
parent
d71d1261
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
app.coffee
h/js/app.coffee
+1
-0
controllers.coffee
h/js/controllers.coffee
+6
-17
No files found.
h/js/app.coffee
View file @
582358b6
imports
=
[
'bootstrap'
'ngRoute'
'h.helper'
'h.controllers'
'h.directives'
'h.app_directives'
...
...
h/js/controllers.coffee
View file @
582358b6
...
...
@@ -9,20 +9,15 @@ class App
this
.
$inject
=
[
'$element'
,
'$filter'
,
'$http'
,
'$location'
,
'$rootScope'
,
'$scope'
,
'$timeout'
,
'annotator'
,
'authentication'
,
'streamfilter'
'annotator'
,
'authentication'
,
'
baseurl'
,
'
streamfilter'
]
constructor
:
(
$element
,
$filter
,
$http
,
$location
,
$rootScope
,
$scope
,
$timeout
annotator
,
authentication
,
streamfilter
annotator
,
authentication
,
baseurl
,
streamfilter
)
->
# Get the base URL from the base tag or the app location
baseUrl
=
angular
.
element
(
'head base'
)[
0
]
?
.
href
baseUrl
?=
(
$location
.
absUrl
().
replace
$location
.
url
(),
''
)
# Strip an empty hash and end in exactly one slash
baseUrl
=
baseUrl
.
replace
/#$/
,
''
baseUrl
=
baseUrl
.
replace
/\/*$/
,
'/'
$scope
.
baseUrl
=
baseUrl
init_path
=
document
.
init_path
$scope
.
baseurl
=
baseurl
[..
-
(
init_path
.
toString
().
length
)]
+
'__streamer__'
delete
document
.
init_path
{
plugins
,
host
,
providers
}
=
annotator
...
...
@@ -469,12 +464,6 @@ class App
$scope
.
initUpdater
=
->
$scope
.
new_updates
=
0
# Quick hack until we unify all the routes.
# We need to eliminate the distinction between the app and the site
# because it's not useful. The site is the app, stupid!
# Then everything will be relative to the same base.
path
=
$scope
.
baseUrl
.
replace
(
/\/\w+\/$/
,
'/'
)
path
=
"
#{
path
}
__streamer__"
# Collect all uris we should watch
uris
=
(
e
for
e
of
annotator
.
plugins
.
Store
.
entities
).
join
','
...
...
@@ -486,7 +475,7 @@ class App
.
setClausesParse
(
'uri:['
+
uris
)
.
getFilter
()
$scope
.
updater
=
new
SockJS
(
path
)
$scope
.
updater
=
new
SockJS
(
$scope
.
baseurl
)
$scope
.
updater
.
onopen
=
=>
sockmsg
=
...
...
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