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
b47b6bd0
Commit
b47b6bd0
authored
Oct 01, 2014
by
gergely-ujvari
Committed by
Randall Leeds
Oct 03, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1540 from hypothesis/frontend-module-reorg
Frontend module reorg
parents
f547c126
8f64e090
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
113 additions
and
153 deletions
+113
-153
app.coffee
h/static/scripts/app.coffee
+5
-5
account-controller.coffee
h/static/scripts/auth/account-controller.coffee
+1
-5
auth-controller.coffee
h/static/scripts/auth/auth-controller.coffee
+51
-0
auth.coffee
h/static/scripts/auth/auth.coffee
+16
-48
session-service.coffee
h/static/scripts/auth/session-service.coffee
+1
-27
controllers.coffee
h/static/scripts/controllers.coffee
+7
-18
directives.coffee
h/static/scripts/directives.coffee
+1
-9
annotation.coffee
h/static/scripts/directives/annotation.coffee
+1
-1
deep-count.coffee
h/static/scripts/directives/deep-count.coffee
+1
-1
markdown.coffee
h/static/scripts/directives/markdown.coffee
+2
-1
simple-search.coffee
h/static/scripts/directives/simple-search.coffee
+2
-1
status-button.coffee
h/static/scripts/directives/status-button.coffee
+2
-1
thread-filter.coffee
h/static/scripts/directives/thread-filter.coffee
+1
-1
thread.coffee
h/static/scripts/directives/thread.coffee
+1
-1
filters.coffee
h/static/scripts/filters.coffee
+1
-1
flash.coffee
h/static/scripts/flash.coffee
+1
-1
document-helpers.coffee
h/static/scripts/helpers/document-helpers.coffee
+1
-1
form-helpers.coffee
h/static/scripts/helpers/form-helpers.coffee
+1
-1
helpers.coffee
h/static/scripts/helpers/helpers.coffee
+1
-0
searchfilters.coffee
h/static/scripts/searchfilters.coffee
+1
-1
services.coffee
h/static/scripts/services.coffee
+1
-1
socket.coffee
h/static/scripts/socket.coffee
+1
-6
streamsearch.coffee
h/static/scripts/streamsearch.coffee
+3
-12
account-controller-test.coffee
tests/js/auth/account-controller-test.coffee
+2
-2
auth-controller-test.coffee
tests/js/auth/auth-controller-test.coffee
+0
-0
controllers-test.coffee
tests/js/controllers-test.coffee
+1
-1
directives-test.coffee
tests/js/directives-test.coffee
+2
-2
annotation-test.coffee
tests/js/directives/annotation-test.coffee
+1
-1
simple-search-test.coffee
tests/js/directives/simple-search-test.coffee
+1
-1
status-button-test.coffee
tests/js/directives/status-button-test.coffee
+1
-1
thread-test.coffee
tests/js/directives/thread-test.coffee
+1
-1
util-test.coffee
tests/js/util-test.coffee
+1
-1
No files found.
h/static/scripts/app.coffee
View file @
b47b6bd0
imports
=
[
imports
=
[
'ngAnimate'
'ngAnimate'
'ngRoute'
'ngRoute'
'ngSanitize'
'ngTagsInput'
'bootstrap'
'h.auth'
'h.auth'
'h.controllers'
'h.helpers'
'h.directives'
'h.identity'
'h.filters'
'h.streamsearch'
'h.helpers.formHelpers'
]
]
...
...
h/static/scripts/auth/account.coffee
→
h/static/scripts/auth/account
-controller
.coffee
View file @
b47b6bd0
imports
=
[
'h.session'
]
class
AccountController
class
AccountController
@
inject
=
[
'$scope'
,
'$filter'
,
'flash'
,
'session'
,
'identity'
,
'formHelpers'
]
@
inject
=
[
'$scope'
,
'$filter'
,
'flash'
,
'session'
,
'identity'
,
'formHelpers'
]
constructor
:
(
$scope
,
$filter
,
flash
,
session
,
identity
,
formHelpers
)
->
constructor
:
(
$scope
,
$filter
,
flash
,
session
,
identity
,
formHelpers
)
->
...
@@ -72,5 +68,5 @@ class AccountController
...
@@ -72,5 +68,5 @@ class AccountController
promise
.
$promise
.
then
(
successHandler
,
errorHandler
)
promise
.
$promise
.
then
(
successHandler
,
errorHandler
)
angular
.
module
(
'h.a
ccount'
,
imports
)
angular
.
module
(
'h.a
uth'
)
.
controller
(
'AccountController'
,
AccountController
)
.
controller
(
'AccountController'
,
AccountController
)
h/static/scripts/auth/auth-controller.coffee
0 → 100644
View file @
b47b6bd0
class
AuthController
this
.
$inject
=
[
'$scope'
,
'$timeout'
,
'flash'
,
'session'
,
'formHelpers'
]
constructor
:
(
$scope
,
$timeout
,
flash
,
session
,
formHelpers
)
->
timeout
=
null
success
=
(
data
)
->
if
$scope
.
tab
is
'forgot'
then
$scope
.
tab
=
'activate'
if
data
.
userid
then
$scope
.
$emit
'session'
,
data
$scope
.
model
=
null
$scope
.
form
?
.
$setPristine
()
failure
=
(
form
,
response
)
->
{
errors
,
reason
}
=
response
.
data
formHelpers
.
applyValidationErrors
(
form
,
errors
,
reason
)
this
.
submit
=
(
form
)
->
delete
form
.
responseErrorMessage
form
.
$setValidity
(
'response'
,
true
)
return
unless
form
.
$valid
$scope
.
$broadcast
'formState'
,
form
.
$name
,
'loading'
session
[
form
.
$name
]
$scope
.
model
,
success
,
angular
.
bind
(
this
,
failure
,
form
)
.
$promise
.
finally
->
$scope
.
$broadcast
'formState'
,
form
.
$name
,
''
$scope
.
model
=
null
$scope
.
tab
=
'login'
$scope
.
$on
'$destroy'
,
->
if
timeout
$timeout
.
cancel
timeout
$scope
.
$watchCollection
'model'
,
(
value
)
->
# Reset the auth forms after five minutes of inactivity
if
timeout
$timeout
.
cancel
timeout
# If the model is not empty, start the timeout
if
value
and
not
angular
.
equals
(
value
,
{})
timeout
=
$timeout
->
$scope
.
form
?
.
$setPristine
()
$scope
.
model
=
null
flash
'info'
,
'For your security, the forms have been reset due to inactivity.'
,
300000
angular
.
module
(
'h.auth'
)
.
controller
(
'AuthController'
,
AuthController
)
h/static/scripts/auth/auth.coffee
View file @
b47b6bd0
imports
=
[
imports
=
[
'ngResource'
'h.identity'
'h.identity'
'h.
session
'
'h.
helpers
'
]
]
class
AuthController
configure
=
[
'$httpProvider'
,
'identityProvider'
,
(
$httpProvider
,
identityProvider
)
->
this
.
$inject
=
[
'$scope'
,
'$timeout'
,
'flash'
,
'session'
,
'formHelpers'
]
defaults
=
$httpProvider
.
defaults
constructor
:
(
$scope
,
$timeout
,
flash
,
session
,
formHelpers
)
->
timeout
=
null
success
=
(
data
)
->
# Use the Pyramid XSRF header name
if
$scope
.
tab
is
'forgot'
then
$scope
.
tab
=
'activate'
defaults
.
xsrfHeaderName
=
'X-CSRF-Token'
if
data
.
userid
then
$scope
.
$emit
'session'
,
data
$scope
.
model
=
null
$scope
.
form
?
.
$setPristine
()
failure
=
(
form
,
response
)
->
{
errors
,
reason
}
=
response
.
data
formHelpers
.
applyValidationErrors
(
form
,
errors
,
reason
)
this
.
submit
=
(
form
)
->
delete
form
.
responseErrorMessage
form
.
$setValidity
(
'response'
,
true
)
return
unless
form
.
$valid
$scope
.
$broadcast
'formState'
,
form
.
$name
,
'loading'
session
[
form
.
$name
]
$scope
.
model
,
success
,
angular
.
bind
(
this
,
failure
,
form
)
.
$promise
.
finally
->
$scope
.
$broadcast
'formState'
,
form
.
$name
,
''
$scope
.
model
=
null
$scope
.
tab
=
'login'
$scope
.
$on
'$destroy'
,
->
if
timeout
$timeout
.
cancel
timeout
$scope
.
$watchCollection
'model'
,
(
value
)
->
# Reset the auth forms after five minutes of inactivity
if
timeout
$timeout
.
cancel
timeout
# If the model is not empty, start the timeout
if
value
and
not
angular
.
equals
(
value
,
{})
timeout
=
$timeout
->
$scope
.
form
?
.
$setPristine
()
$scope
.
model
=
null
flash
'info'
,
'For your security, the forms have been reset due to inactivity.'
,
300000
$httpProvider
.
interceptors
.
push
[
'documentHelpers'
,
(
documentHelpers
)
->
request
:
(
config
)
->
endpoint
=
documentHelpers
.
absoluteURI
(
'/app'
)
if
config
.
url
.
indexOf
(
endpoint
)
==
0
# Set the cross site request forgery token
cookieName
=
config
.
xsrfCookieName
||
defaults
.
xsrfCookieName
headerName
=
config
.
xsrfHeaderName
||
defaults
.
xsrfHeaderName
config
.
headers
[
headerName
]
?=
csrfToken
config
]
configure
=
[
'$provide'
,
'identityProvider'
,
(
$provide
,
identityProvider
)
->
identityProvider
.
checkAuthorization
=
[
identityProvider
.
checkAuthorization
=
[
'session'
,
'session'
,
(
session
)
->
(
session
)
->
...
@@ -76,4 +45,3 @@ configure = ['$provide', 'identityProvider', ($provide, identityProvider) ->
...
@@ -76,4 +45,3 @@ configure = ['$provide', 'identityProvider', ($provide, identityProvider) ->
angular
.
module
(
'h.auth'
,
imports
,
configure
)
angular
.
module
(
'h.auth'
,
imports
,
configure
)
.
controller
(
'AuthController'
,
AuthController
)
h/static/scripts/auth/session.coffee
→
h/static/scripts/auth/session
-service
.coffee
View file @
b47b6bd0
imports
=
[
'ngResource'
'h.flash'
'h.helpers.documentHelpers'
]
ACTION
=
[
ACTION
=
[
'login'
'login'
'logout'
'logout'
...
@@ -106,24 +99,5 @@ class SessionProvider
...
@@ -106,24 +99,5 @@ class SessionProvider
]
]
configure
=
[
'$httpProvider'
,
(
$httpProvider
)
->
angular
.
module
(
'h.auth'
)
defaults
=
$httpProvider
.
defaults
# Use the Pyramid XSRF header name
defaults
.
xsrfHeaderName
=
'X-CSRF-Token'
$httpProvider
.
interceptors
.
push
[
'documentHelpers'
,
(
documentHelpers
)
->
request
:
(
config
)
->
endpoint
=
documentHelpers
.
absoluteURI
(
'/app'
)
if
config
.
url
.
indexOf
(
endpoint
)
==
0
# Set the cross site request forgery token
cookieName
=
config
.
xsrfCookieName
||
defaults
.
xsrfCookieName
headerName
=
config
.
xsrfHeaderName
||
defaults
.
xsrfHeaderName
config
.
headers
[
headerName
]
?=
csrfToken
config
]
]
angular
.
module
(
'h.session'
,
imports
,
configure
)
.
provider
(
'session'
,
SessionProvider
)
.
provider
(
'session'
,
SessionProvider
)
h/static/scripts/controllers.coffee
View file @
b47b6bd0
imports
=
[
'bootstrap'
'h.flash'
'h.helpers.documentHelpers'
'h.identity'
'h.services'
'h.socket'
'h.searchfilters'
]
# User authorization function for the Permissions plugin.
# User authorization function for the Permissions plugin.
authorizeAction
=
(
action
,
annotation
,
user
)
->
authorizeAction
=
(
action
,
annotation
,
user
)
->
if
annotation
.
permissions
if
annotation
.
permissions
...
@@ -35,7 +24,7 @@ authorizeAction = (action, annotation, user) ->
...
@@ -35,7 +24,7 @@ authorizeAction = (action, annotation, user) ->
true
true
class
App
class
App
Controller
this
.
$inject
=
[
this
.
$inject
=
[
'$location'
,
'$q'
,
'$route'
,
'$scope'
,
'$timeout'
,
'$location'
,
'$q'
,
'$route'
,
'$scope'
,
'$timeout'
,
'annotator'
,
'flash'
,
'identity'
,
'socket'
,
'streamfilter'
,
'annotator'
,
'flash'
,
'identity'
,
'socket'
,
'streamfilter'
,
...
@@ -347,7 +336,7 @@ class App
...
@@ -347,7 +336,7 @@ class App
$scope
.
sort
=
name
:
'Location'
$scope
.
sort
=
name
:
'Location'
class
AnnotationViewer
class
AnnotationViewer
Controller
this
.
$inject
=
[
'$routeParams'
,
'$scope'
,
'streamfilter'
]
this
.
$inject
=
[
'$routeParams'
,
'$scope'
,
'streamfilter'
]
constructor
:
(
$routeParams
,
$scope
,
streamfilter
)
->
constructor
:
(
$routeParams
,
$scope
,
streamfilter
)
->
# Tells the view that these annotations are standalone
# Tells the view that these annotations are standalone
...
@@ -372,7 +361,7 @@ class AnnotationViewer
...
@@ -372,7 +361,7 @@ class AnnotationViewer
sock
.
send
(
JSON
.
stringify
({
filter
}))
sock
.
send
(
JSON
.
stringify
({
filter
}))
class
Viewer
class
Viewer
Controller
this
.
$inject
=
[
'$scope'
,
'annotator'
]
this
.
$inject
=
[
'$scope'
,
'annotator'
]
constructor
:
(
$scope
,
annotator
)
->
constructor
:
(
$scope
,
annotator
)
->
# Tells the view that these annotations are embedded into the owner doc
# Tells the view that these annotations are embedded into the owner doc
...
@@ -396,7 +385,7 @@ class Viewer
...
@@ -396,7 +385,7 @@ class Viewer
true
true
angular
.
module
(
'h
.controllers'
,
imports
)
angular
.
module
(
'h
'
)
.
controller
(
'AppController'
,
App
)
.
controller
(
'AppController'
,
App
Controller
)
.
controller
(
'ViewerController'
,
Viewer
)
.
controller
(
'ViewerController'
,
Viewer
Controller
)
.
controller
(
'AnnotationViewerController'
,
AnnotationViewer
)
.
controller
(
'AnnotationViewerController'
,
AnnotationViewer
Controller
)
h/static/scripts/directives.coffee
View file @
b47b6bd0
imports
=
[
'ngSanitize'
'ngTagsInput'
'h.helpers.documentHelpers'
'h.services'
]
formInput
=
->
formInput
=
->
link
:
(
scope
,
elem
,
attr
,
[
form
,
model
,
validator
])
->
link
:
(
scope
,
elem
,
attr
,
[
form
,
model
,
validator
])
->
return
unless
form
?
.
$name
and
model
?
.
$name
and
validator
return
unless
form
?
.
$name
and
model
?
.
$name
and
validator
...
@@ -220,7 +212,7 @@ match = ->
...
@@ -220,7 +212,7 @@ match = ->
require
:
'ngModel'
require
:
'ngModel'
angular
.
module
(
'h
.directives'
,
imports
)
angular
.
module
(
'h
'
)
.
directive
(
'formInput'
,
formInput
)
.
directive
(
'formInput'
,
formInput
)
.
directive
(
'formValidate'
,
formValidate
)
.
directive
(
'formValidate'
,
formValidate
)
.
directive
(
'privacy'
,
privacy
)
.
directive
(
'privacy'
,
privacy
)
...
...
h/static/scripts/directives/annotation.coffee
View file @
b47b6bd0
...
@@ -288,6 +288,6 @@ annotation = ['annotator', 'documentHelpers', (annotator, documentHelpers) ->
...
@@ -288,6 +288,6 @@ annotation = ['annotator', 'documentHelpers', (annotator, documentHelpers) ->
]
]
angular
.
module
(
'h
.directives
'
)
angular
.
module
(
'h'
)
.
controller
(
'AnnotationController'
,
AnnotationController
)
.
controller
(
'AnnotationController'
,
AnnotationController
)
.
directive
(
'annotation'
,
annotation
)
.
directive
(
'annotation'
,
annotation
)
h/static/scripts/directives/deep-count.coffee
View file @
b47b6bd0
...
@@ -73,6 +73,6 @@ deepCount = [
...
@@ -73,6 +73,6 @@ deepCount = [
]
]
angular
.
module
(
'h
.directives
'
)
angular
.
module
(
'h'
)
.
controller
(
'DeepCountController'
,
DeepCountController
)
.
controller
(
'DeepCountController'
,
DeepCountController
)
.
directive
(
'deepCount'
,
deepCount
)
.
directive
(
'deepCount'
,
deepCount
)
h/static/scripts/directives/markdown.coffee
View file @
b47b6bd0
...
@@ -324,4 +324,5 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc
...
@@ -324,4 +324,5 @@ markdown = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitize, $sc
templateUrl
:
'markdown.html'
templateUrl
:
'markdown.html'
]
]
angular
.
module
(
'h.directives'
).
directive
(
'markdown'
,
markdown
)
angular
.
module
(
'h'
)
.
directive
(
'markdown'
,
markdown
)
h/static/scripts/directives/simple-search.coffee
View file @
b47b6bd0
...
@@ -36,4 +36,5 @@ simpleSearch = ['$parse', ($parse) ->
...
@@ -36,4 +36,5 @@ simpleSearch = ['$parse', ($parse) ->
]
]
angular
.
module
(
'h.directives'
).
directive
(
'simpleSearch'
,
simpleSearch
)
angular
.
module
(
'h'
)
.
directive
(
'simpleSearch'
,
simpleSearch
)
h/static/scripts/directives/status-button.coffee
View file @
b47b6bd0
...
@@ -41,4 +41,5 @@ statusButton = ->
...
@@ -41,4 +41,5 @@ statusButton = ->
transclude
:
'element'
transclude
:
'element'
angular
.
module
(
'h.directives'
).
directive
(
'statusButton'
,
statusButton
)
angular
.
module
(
'h'
)
.
directive
(
'statusButton'
,
statusButton
)
h/static/scripts/directives/thread-filter.coffee
View file @
b47b6bd0
...
@@ -173,6 +173,6 @@ threadFilter = [
...
@@ -173,6 +173,6 @@ threadFilter = [
]
]
angular
.
module
(
'h
.directives
'
)
angular
.
module
(
'h'
)
.
controller
(
'ThreadFilterController'
,
ThreadFilterController
)
.
controller
(
'ThreadFilterController'
,
ThreadFilterController
)
.
directive
(
'threadFilter'
,
threadFilter
)
.
directive
(
'threadFilter'
,
threadFilter
)
h/static/scripts/directives/thread.coffee
View file @
b47b6bd0
...
@@ -110,6 +110,6 @@ thread = [
...
@@ -110,6 +110,6 @@ thread = [
]
]
angular
.
module
(
'h
.directives
'
)
angular
.
module
(
'h'
)
.
controller
(
'ThreadController'
,
ThreadController
)
.
controller
(
'ThreadController'
,
ThreadController
)
.
directive
(
'thread'
,
thread
)
.
directive
(
'thread'
,
thread
)
h/static/scripts/filters.coffee
View file @
b47b6bd0
...
@@ -70,7 +70,7 @@ elide = (text, split_length) ->
...
@@ -70,7 +70,7 @@ elide = (text, split_length) ->
text
text
angular
.
module
(
'h
.filters'
,
[]
)
angular
.
module
(
'h
'
)
.
filter
(
'converter'
,
->
(
new
Converter
()).
makeHtml
)
.
filter
(
'converter'
,
->
(
new
Converter
()).
makeHtml
)
.
filter
(
'fuzzyTime'
,
->
fuzzyTime
)
.
filter
(
'fuzzyTime'
,
->
fuzzyTime
)
.
filter
(
'moment'
,
momentFilter
)
.
filter
(
'moment'
,
momentFilter
)
...
...
h/static/scripts/flash.coffee
View file @
b47b6bd0
...
@@ -44,5 +44,5 @@ class FlashProvider
...
@@ -44,5 +44,5 @@ class FlashProvider
this
.
_process
()
this
.
_process
()
angular
.
module
(
'h
.flash'
,
[
'ngResource'
]
)
angular
.
module
(
'h
'
)
.
provider
(
'flash'
,
FlashProvider
)
.
provider
(
'flash'
,
FlashProvider
)
h/static/scripts/helpers/document-helpers.coffee
View file @
b47b6bd0
...
@@ -16,5 +16,5 @@ createDocumentHelpers = [
...
@@ -16,5 +16,5 @@ createDocumentHelpers = [
]
]
angular
.
module
(
'h.helpers
.documentHelpers'
,
[]
)
angular
.
module
(
'h.helpers
'
)
.
factory
(
'documentHelpers'
,
createDocumentHelpers
)
.
factory
(
'documentHelpers'
,
createDocumentHelpers
)
h/static/scripts/helpers/form-helpers.coffee
View file @
b47b6bd0
...
@@ -14,5 +14,5 @@ createFormHelpers = ->
...
@@ -14,5 +14,5 @@ createFormHelpers = ->
form
.
responseErrorMessage
=
reason
form
.
responseErrorMessage
=
reason
angular
.
module
(
'h.helpers
.formHelpers'
,
[]
)
angular
.
module
(
'h.helpers
'
)
.
factory
(
'formHelpers'
,
createFormHelpers
)
.
factory
(
'formHelpers'
,
createFormHelpers
)
h/static/scripts/helpers/helpers.coffee
0 → 100644
View file @
b47b6bd0
angular
.
module
(
'h.helpers'
,
[])
h/static/scripts/searchfilters.coffee
View file @
b47b6bd0
...
@@ -348,7 +348,7 @@ class StreamFilter
...
@@ -348,7 +348,7 @@ class StreamFilter
this
this
angular
.
module
(
'h
.searchfilters'
,
[]
)
angular
.
module
(
'h
'
)
.
service
(
'searchfilter'
,
SearchFilter
)
.
service
(
'searchfilter'
,
SearchFilter
)
.
service
(
'queryparser'
,
QueryParser
)
.
service
(
'queryparser'
,
QueryParser
)
.
service
(
'streamfilter'
,
StreamFilter
)
.
service
(
'streamfilter'
,
StreamFilter
)
h/static/scripts/services.coffee
View file @
b47b6bd0
...
@@ -516,7 +516,7 @@ class ViewFilter
...
@@ -516,7 +516,7 @@ class ViewFilter
count
++
count
++
annotation
.
id
annotation
.
id
angular
.
module
(
'h
.services'
,
[]
)
angular
.
module
(
'h
'
)
.
factory
(
'render'
,
renderFactory
)
.
factory
(
'render'
,
renderFactory
)
.
provider
(
'drafts'
,
DraftProvider
)
.
provider
(
'drafts'
,
DraftProvider
)
.
service
(
'annotator'
,
Hypothesis
)
.
service
(
'annotator'
,
Hypothesis
)
...
...
h/static/scripts/socket.coffee
View file @
b47b6bd0
imports
=
[
'h.helpers.documentHelpers'
]
clientID
=
->
clientID
=
->
# Generate client ID
# Generate client ID
buffer
=
(
new
Array
(
16
))
buffer
=
(
new
Array
(
16
))
...
@@ -40,7 +35,7 @@ class Socket extends SockJS
...
@@ -40,7 +35,7 @@ class Socket extends SockJS
this
.
send
=
send
this
.
send
=
send
angular
.
module
(
'h
.socket'
,
imports
)
angular
.
module
(
'h
'
)
.
factory
(
'clientID'
,
clientID
)
.
factory
(
'clientID'
,
clientID
)
.
factory
(
'socket'
,
socket
)
.
factory
(
'socket'
,
socket
)
.
run
(
run
)
.
run
(
run
)
h/static/scripts/streamsearch.coffee
View file @
b47b6bd0
imports
=
[
class
StreamSearchController
'bootstrap'
'h.controllers'
'h.directives'
'h.filters'
'h.flash'
'h.searchfilters'
]
class
StreamSearch
this
.
inject
=
[
this
.
inject
=
[
'$scope'
,
'$rootScope'
,
'$routeParams'
,
'$scope'
,
'$rootScope'
,
'$routeParams'
,
'annotator'
,
'queryparser'
,
'searchfilter'
,
'streamfilter'
'annotator'
,
'queryparser'
,
'searchfilter'
,
'streamfilter'
...
@@ -45,5 +36,5 @@ class StreamSearch
...
@@ -45,5 +36,5 @@ class StreamSearch
sock
.
send
(
JSON
.
stringify
({
filter
}))
sock
.
send
(
JSON
.
stringify
({
filter
}))
angular
.
module
(
'h
.streamsearch'
,
imports
,
configure
)
angular
.
module
(
'h
'
)
.
controller
(
'StreamSearchController'
,
StreamSearch
)
.
controller
(
'StreamSearchController'
,
StreamSearch
Controller
)
tests/js/auth/account-test.coffee
→
tests/js/auth/account-
controller-
test.coffee
View file @
b47b6bd0
...
@@ -2,7 +2,7 @@ assert = chai.assert
...
@@ -2,7 +2,7 @@ assert = chai.assert
sinon
.
assert
.
expose
assert
,
prefix
:
null
sinon
.
assert
.
expose
assert
,
prefix
:
null
sandbox
=
sinon
.
sandbox
.
create
()
sandbox
=
sinon
.
sandbox
.
create
()
describe
'h.a
ccount
.AccountController'
,
->
describe
'h.a
uth
.AccountController'
,
->
$scope
=
null
$scope
=
null
fakeFlash
=
null
fakeFlash
=
null
fakeSession
=
null
fakeSession
=
null
...
@@ -12,7 +12,7 @@ describe 'h.account.AccountController', ->
...
@@ -12,7 +12,7 @@ describe 'h.account.AccountController', ->
disableUserPromise
=
null
disableUserPromise
=
null
createController
=
null
createController
=
null
beforeEach
module
(
'h.a
ccount
'
)
beforeEach
module
(
'h.a
uth
'
)
beforeEach
module
(
$provide
,
$filterProvider
)
->
beforeEach
module
(
$provide
,
$filterProvider
)
->
fakeSession
=
{}
fakeSession
=
{}
...
...
tests/js/auth/auth-test.coffee
→
tests/js/auth/auth-
controller-
test.coffee
View file @
b47b6bd0
File moved
tests/js/controllers-test.coffee
View file @
b47b6bd0
...
@@ -3,7 +3,7 @@ assert = chai.assert
...
@@ -3,7 +3,7 @@ assert = chai.assert
describe
'h.controllers'
,
->
describe
'h.controllers'
,
->
fakeParams
=
null
fakeParams
=
null
beforeEach
module
(
'h
.controllers
'
)
beforeEach
module
(
'h'
)
beforeEach
module
(
$provide
)
->
beforeEach
module
(
$provide
)
->
fakeParams
=
{
id
:
'test'
}
fakeParams
=
{
id
:
'test'
}
...
...
tests/js/directives-test.coffee
View file @
b47b6bd0
...
@@ -10,6 +10,7 @@ describe 'h.directives', ->
...
@@ -10,6 +10,7 @@ describe 'h.directives', ->
fakeWindow
=
{
open
:
sinon
.
spy
()}
fakeWindow
=
{
open
:
sinon
.
spy
()}
fakeDocument
=
angular
.
element
({
fakeDocument
=
angular
.
element
({
createElement
:
(
tag
)
->
document
.
createElement
(
tag
)
createElement
:
(
tag
)
->
document
.
createElement
(
tag
)
baseURI
:
'http://example.com'
})
})
$provide
.
value
(
'$window'
,
fakeWindow
)
$provide
.
value
(
'$window'
,
fakeWindow
)
...
@@ -22,8 +23,7 @@ describe 'h.directives', ->
...
@@ -22,8 +23,7 @@ describe 'h.directives', ->
return
return
beforeEach
module
(
'h.templates'
)
beforeEach
module
(
'h'
)
beforeEach
module
(
'h.directives'
)
beforeEach
inject
(
_$compile_
,
_$rootScope_
,
_$injector_
)
->
beforeEach
inject
(
_$compile_
,
_$rootScope_
,
_$injector_
)
->
$compile
=
_$compile_
$compile
=
_$compile_
...
...
tests/js/directives/annotation-test.coffee
View file @
b47b6bd0
...
@@ -8,7 +8,7 @@ describe 'h.directives.annotation', ->
...
@@ -8,7 +8,7 @@ describe 'h.directives.annotation', ->
createController
=
null
createController
=
null
flash
=
null
flash
=
null
beforeEach
module
(
'h
.directives
'
)
beforeEach
module
(
'h'
)
beforeEach
inject
(
$controller
,
$rootScope
)
->
beforeEach
inject
(
$controller
,
$rootScope
)
->
$scope
=
$rootScope
.
$new
()
$scope
=
$rootScope
.
$new
()
...
...
tests/js/directives/simple-search-test.coffee
View file @
b47b6bd0
...
@@ -6,7 +6,7 @@ describe 'h.directives', ->
...
@@ -6,7 +6,7 @@ describe 'h.directives', ->
fakeWindow
=
null
fakeWindow
=
null
isolate
=
null
isolate
=
null
beforeEach
module
(
'h
.directives
'
)
beforeEach
module
(
'h'
)
beforeEach
inject
(
_$compile_
,
_$rootScope_
)
->
beforeEach
inject
(
_$compile_
,
_$rootScope_
)
->
$compile
=
_$compile_
$compile
=
_$compile_
...
...
tests/js/directives/status-button-test.coffee
View file @
b47b6bd0
...
@@ -5,7 +5,7 @@ describe 'h.directives.statusButton', ->
...
@@ -5,7 +5,7 @@ describe 'h.directives.statusButton', ->
$compile
=
null
$compile
=
null
$element
=
null
$element
=
null
beforeEach
module
(
'h
.directives
'
)
beforeEach
module
(
'h'
)
beforeEach
inject
(
_$compile_
,
_$rootScope_
)
->
beforeEach
inject
(
_$compile_
,
_$rootScope_
)
->
$compile
=
_$compile_
$compile
=
_$compile_
...
...
tests/js/directives/thread-test.coffee
View file @
b47b6bd0
...
@@ -8,7 +8,7 @@ describe 'h.directives.thread', ->
...
@@ -8,7 +8,7 @@ describe 'h.directives.thread', ->
createController
=
null
createController
=
null
flash
=
null
flash
=
null
beforeEach
module
(
'h
.directives
'
)
beforeEach
module
(
'h'
)
beforeEach
inject
(
$controller
,
$rootScope
)
->
beforeEach
inject
(
$controller
,
$rootScope
)
->
$scope
=
$rootScope
.
$new
()
$scope
=
$rootScope
.
$new
()
...
...
tests/js/util-test.coffee
View file @
b47b6bd0
...
@@ -4,7 +4,7 @@ sinon.assert.expose(assert, prefix: '')
...
@@ -4,7 +4,7 @@ sinon.assert.expose(assert, prefix: '')
describe
'h.helpers.formHelpers'
,
->
describe
'h.helpers.formHelpers'
,
->
formHelpers
=
null
formHelpers
=
null
beforeEach
module
(
'h.helpers
.formHelpers
'
)
beforeEach
module
(
'h.helpers'
)
beforeEach
inject
(
_formHelpers_
)
->
beforeEach
inject
(
_formHelpers_
)
->
formHelpers
=
_formHelpers_
formHelpers
=
_formHelpers_
...
...
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