forked from cordjs/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.coffee
114 lines (101 loc) · 3.9 KB
/
config.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
define ->
services:
api:
deps: ['config', 'container']
factory: (get, done) ->
require ['cord!/cord/core/Api'], (Api) =>
done null, new Api(get('container'), get('config').api)
oauth2:
deps: ['config', 'container']
factory: (get, done) ->
require ['cord!/cord/core/OAuth2'], (OAuth2) =>
done null, new OAuth2(get('container'), get('config').oauth2)
userAgent:
deps: ['container']
factory: (get, done) ->
require ['cord!/cord/core/UserAgent'], (UserAgent) =>
userAgent = new UserAgent
get('container').injectServices(userAgent).done ->
userAgent.calculate()
done null, userAgent
modelProxy:
deps: ['container']
factory: (get, done) ->
require ['cord!/cord/core/ModelProxy'], (ModelProxy) =>
modelProxy = new ModelProxy
get('container').injectServices(modelProxy).done ->
done null, modelProxy
':server':
request:
deps: ['container']
factory: (get, done) ->
require ['cord!/cord/core/request/ServerRequest'], (Request) =>
done null, new Request(get('container'))
cookie:
deps: ['container']
factory: (get, done) ->
require ['cord!/cord/core/cookie/ServerCookie'], (Cookie) =>
done null, new Cookie(get('container'))
userAgentText:
deps: ['serverRequest']
factory: (get, done) ->
done null, get('serverRequest').headers['user-agent']
':browser':
request:
deps: ['container']
factory: (get, done) ->
require ['cord!/cord/core/request/BrowserRequest'], (Request) =>
done null, new Request(get('container'))
cookie:
deps: ['container']
factory: (get, done) ->
require ['cord!/cord/core/cookie/BrowserCookie'], (Cookie) =>
done null, new Cookie(get('container'))
userAgentText: (get, done) ->
done null, navigator.userAgent
localStorage: (get, done) ->
require ['cord!cache/localStorage', 'localforage'], (LocalStorage, localForage) ->
localForage.ready().then ->
done null, new LocalStorage(localForage)
.catch (err) ->
_console.error "ERROR while initializing localforage: #{err.message}! Driver: #{localForage.driver()}", err
localForage.setDriver(localForage.LOCALSTORAGE).then ->
done null, new LocalStorage(localForage)
.catch (err) ->
_console.error "FATAL: error while initializing localforage with localStorage fallback: #{err.message}!", err
routes:
'/REQUIRESTAT/optimizer':
widget: '//Optimizer'
requirejs:
paths:
'curly': 'vendor/curly/browser'
'cordjs-zone': 'vendor/zone/zone',
'dustjs-linkedin': 'vendor/dustjs/dustjs-full'
'dustjs-helpers': 'vendor/dustjs/dustjs-helpers'
'eventemitter3': 'vendor/eventemitter3/eventemitter3'
'jquery': 'vendor/jquery/jquery'
'jquery.cookie': 'vendor/jquery/plugins/jquery.cookie'
'localforage': 'vendor/localforage/localforage'
'monologue': 'vendor/postal/monologue'
'postal': 'vendor/postal/postal_lite'
'the-box': 'vendor/the-box/app'
'underscore': 'vendor/underscore/underscore'
'bcryptjs': 'vendor/bcryptjs/bcryptjs'
shim:
'curly':
deps: ['underscore']
exports: 'curly'
'dustjs-linkedin':
exports: 'dust'
'dustjs-helpers':
deps: ['dustjs-linkedin']
exports: 'dust'
'eventemitter3':
exports: 'EventEmitter'
'jquery.cookie':
deps: ['jquery']
exports: 'jQuery'
'underscore':
exports: '_'
'zone':
exports: 'zone'