Commit 8d0ead6d authored by Randall Leeds's avatar Randall Leeds

Consistency in angular module boilerplate

parent e11f4991
......@@ -35,4 +35,4 @@ annotation = ['$filter', 'annotator', ($filter, annotator) ->
]
angular.module('h.app_directives', ['ngSanitize'])
.directive('annotation', annotation)
.directive('annotation', annotation)
imports = [
'bootstrap'
'h.helpers'
'h.streamfilter'
]
class App
scope:
frame:
......@@ -1067,11 +1074,11 @@ class Notification
) ->
angular.module('h.controllers', ['bootstrap', 'h.streamfilter'])
.controller('AppController', App)
.controller('AnnotationController', Annotation)
.controller('AuthController', Auth)
.controller('EditorController', Editor)
.controller('ViewerController', Viewer)
.controller('SearchController', Search)
.controller('NotificationController', Notification)
angular.module('h.controllers', imports)
.controller('AppController', App)
.controller('AnnotationController', Annotation)
.controller('AuthController', Auth)
.controller('EditorController', Editor)
.controller('ViewerController', Viewer)
.controller('SearchController', Search)
.controller('NotificationController', Notification)
imports = ['h.helpers']
configure = ['$httpProvider', ($httpProvider) ->
# Use the Pyramid XSRF header name
$httpProvider.defaults.xsrfHeaderName = 'X-CSRF-Token'
......@@ -31,4 +34,4 @@ configure = ['$httpProvider', ($httpProvider) ->
]
angular.module('h.csrf', ['h.helpers'], configure)
angular.module('h.csrf', imports, configure)
......@@ -407,16 +407,16 @@ whenscrolled = ['$window', ($window) ->
]
angular.module('h.directives', ['ngSanitize'])
.directive('fuzzytime', fuzzytime)
.directive('markdown', markdown)
.directive('privacy', privacy)
.directive('recursive', recursive)
.directive('slowValidate', slowValidate)
.directive('tabReveal', tabReveal)
.directive('tags', tags)
.directive('thread', thread)
.directive('username', username)
.directive('userPicker', userPicker)
.directive('repeatAnim', repeatAnim)
.directive('streamviewer', streamviewer)
.directive('whenscrolled', whenscrolled)
.directive('fuzzytime', fuzzytime)
.directive('markdown', markdown)
.directive('privacy', privacy)
.directive('recursive', recursive)
.directive('slowValidate', slowValidate)
.directive('tabReveal', tabReveal)
.directive('tags', tags)
.directive('thread', thread)
.directive('username', username)
.directive('userPicker', userPicker)
.directive('repeatAnim', repeatAnim)
.directive('streamviewer', streamviewer)
.directive('whenscrolled', whenscrolled)
imports = [
'bootstrap'
'h.filters'
'h.directives'
'h.helpers'
'h.streamfilter'
]
get_quote = (annotation) ->
if not 'target' in annotation then return ''
quote = '(This is a reply annotation)'
......@@ -138,5 +147,5 @@ class Displayer
document.init_annotation = null
$scope.open()
angular.module('h.displayer',['h.streamfilter','h.filters','h.directives', 'h.helpers','bootstrap'])
.controller('DisplayerCtrl', Displayer)
angular.module('h.displayer', imports)
.controller('DisplayerCtrl', Displayer)
......@@ -52,7 +52,7 @@ elide = (text, split_length) ->
angular.module('h.filters', [])
.filter('converter', -> (new Converter()).makeHtml)
.filter('fuzzyTime', -> fuzzyTime)
.filter('persona', -> persona)
.filter('elide', -> elide)
.filter('converter', -> (new Converter()).makeHtml)
.filter('fuzzyTime', -> fuzzyTime)
.filter('persona', -> persona)
.filter('elide', -> elide)
......@@ -12,4 +12,4 @@ baseURI = [
angular.module('h.helpers', [])
.factory('baseURI', baseURI)
.factory('baseURI', baseURI)
imports = [
'h.filters'
'h.session'
]
class Hypothesis extends Annotator
events:
'annotationCreated': 'updateAncestors'
......@@ -826,7 +832,7 @@ class ViewFilter
results
angular.module('h.services', ['h.filters', 'h.session'])
.provider('drafts', DraftProvider)
.service('annotator', Hypothesis)
.service('viewFilter', ViewFilter)
angular.module('h.services', imports)
.provider('drafts', DraftProvider)
.service('annotator', Hypothesis)
.service('viewFilter', ViewFilter)
imports = [
'ngResource'
'h.helpers'
]
# bw compat
sessionPersonaInterceptor = (response) ->
data = response.data
......@@ -72,5 +78,5 @@ class SessionProvider
]
angular.module('h.session', ['ngResource'])
angular.module('h.session', imports)
.provider('session', SessionProvider)
imports = [
'bootstrap'
'h.directives'
'h.filters'
'h.helpers'
'h.streamfilter'
]
get_quote = (annotation) ->
if annotation.quote? then return annotation.quote
if not 'target' in annotation then return ''
......@@ -313,5 +322,5 @@ configure = [
]
angular.module('h.streamsearch',['h.streamfilter','h.filters','h.directives','h.helpers','bootstrap'], configure)
.controller('StreamSearchController', StreamSearch)
angular.module('h.streamsearch', imports, configure)
.controller('StreamSearchController', StreamSearch)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment