Ghost/ghost/admin/initializers/ghost-config.js
Hannah Wolfe 8ae5e65462 Expose blog URL to client app
fixes #3724

 - provide config.url to the ember client app via a data attribute
 - create server and client side helpers to output the URL
 - wire up the client side helper
 - add a class for testing, and add tests for both the server and client side
2014-08-10 18:49:37 +01:00

20 lines
640 B
JavaScript

var ConfigInitializer = {
name: 'config',
initialize: function (container, application) {
var apps = $('body').data('apps'),
fileStorage = $('body').data('filestorage'),
blogUrl = $('body').data('blogurl');
application.register(
'ghost:config', {apps: apps, fileStorage: fileStorage, blogUrl: blogUrl}, {instantiate: false}
);
application.inject('route', 'config', 'ghost:config');
application.inject('controller', 'config', 'ghost:config');
application.inject('component', 'config', 'ghost:config');
}
};
export default ConfigInitializer;