Add Pusher and fix Pusher's config
This commit is contained in:
parent
0dab5c7e9e
commit
579388e08d
|
@ -4,6 +4,7 @@ var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||||
|
|
||||||
var app = new EmberApp();
|
var app = new EmberApp();
|
||||||
|
|
||||||
|
app.import('bower_components/pusher/dist/pusher.js');
|
||||||
app.import('bower_components/jquery-timeago/jquery.timeago.js');
|
app.import('bower_components/jquery-timeago/jquery.timeago.js');
|
||||||
app.import('bower_components/visibilityjs/lib/visibility.core.js');
|
app.import('bower_components/visibilityjs/lib/visibility.core.js');
|
||||||
app.import('bower_components/visibilityjs/lib/visibility.timers.js');
|
app.import('bower_components/visibilityjs/lib/visibility.timers.js');
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
`import config from 'travis/config/environment'`
|
`import config from 'travis/config/environment'`
|
||||||
|
`import TravisPusher from 'travis/utils/pusher'`
|
||||||
|
|
||||||
initialize = (container, application) ->
|
initialize = (container, application) ->
|
||||||
if config.pusher.key
|
if config.pusher.key
|
||||||
application.pusher = new Pusher(config.pusher)
|
application.pusher = new TravisPusher(config.pusher)
|
||||||
|
|
||||||
application.register 'pusher:main', application.pusher, { instantiate: false }
|
application.register 'pusher:main', application.pusher, { instantiate: false }
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ initialize = (container, application) ->
|
||||||
|
|
||||||
PusherInitializer =
|
PusherInitializer =
|
||||||
name: 'pusher'
|
name: 'pusher'
|
||||||
|
after: 'ember-data'
|
||||||
initialize: initialize
|
initialize: initialize
|
||||||
|
|
||||||
`export {initialize}`
|
`export {initialize}`
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
"visibilityjs": "~1.2.1",
|
"visibilityjs": "~1.2.1",
|
||||||
"JavaScript-MD5": "~1.1.0",
|
"JavaScript-MD5": "~1.1.0",
|
||||||
"moment": "~2.9.0",
|
"moment": "~2.9.0",
|
||||||
"jquery-timeago": "~1.4.1"
|
"jquery-timeago": "~1.4.1",
|
||||||
|
"pusher": "~2.2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,19 @@ module.exports = function(environment) {
|
||||||
APP: {
|
APP: {
|
||||||
// Here you can pass flags/options to your application instance
|
// Here you can pass flags/options to your application instance
|
||||||
// when it is created
|
// when it is created
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// defaults for running travis-web
|
||||||
|
api_endpoint: 'https://api.travis-ci.org',
|
||||||
|
source_endpoint: 'https://github.com',
|
||||||
|
pusher: {
|
||||||
|
key: '5df8ac576dcccf4fd076',
|
||||||
|
host: 'ws.pusherapp.com'
|
||||||
|
},
|
||||||
|
pro: false,
|
||||||
|
enterprise: false,
|
||||||
|
endpoints: {},
|
||||||
|
intervals: { updateTimes: 1000 }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (environment === 'development') {
|
if (environment === 'development') {
|
||||||
|
@ -56,9 +68,9 @@ module.exports = function(environment) {
|
||||||
'default-src': "'none'",
|
'default-src': "'none'",
|
||||||
// TODO: for some reason unsafe-eval is needed when I use collection helper,
|
// TODO: for some reason unsafe-eval is needed when I use collection helper,
|
||||||
// we should probably remove it at some point
|
// we should probably remove it at some point
|
||||||
'script-src': "'self' 'unsafe-eval'",
|
'script-src': "'self' 'unsafe-eval' 'unsafe-inline'",
|
||||||
'font-src': "'self'",
|
'font-src': "'self'",
|
||||||
'connect-src': "'self' https://api.travis-ci.org",
|
'connect-src': "'self' https://api.travis-ci.org ws://ws.pusherapp.com wss://ws.pusherapp.com http://sockjs.pusher.com",
|
||||||
'img-src': "'self' data: https://www.gravatar.com http://www.gravatar.com",
|
'img-src': "'self' data: https://www.gravatar.com http://www.gravatar.com",
|
||||||
'style-src': "'self'",
|
'style-src': "'self'",
|
||||||
'media-src': "'self'",
|
'media-src': "'self'",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user