2014-11-19 10:17:05 +09:00
|
|
|
Router.setTemplateNameConverter(function (str) { return str; });
|
2014-11-17 14:45:23 +09:00
|
|
|
|
2015-04-24 10:28:11 +09:00
|
|
|
Telescope.subscriptions.preload('settings');
|
|
|
|
Telescope.subscriptions.preload('currentUser');
|
2014-11-17 14:45:23 +09:00
|
|
|
|
|
|
|
Router.configure({
|
2015-04-13 16:29:33 +09:00
|
|
|
layoutTemplate: 'layout',
|
|
|
|
loadingTemplate: 'loading',
|
2015-08-01 16:19:15 +09:00
|
|
|
notFoundTemplate: 'not_found',
|
2014-11-17 14:45:23 +09:00
|
|
|
waitOn: function () {
|
2015-04-24 10:28:11 +09:00
|
|
|
return _.map(Telescope.subscriptions, function(sub){
|
2014-11-17 14:45:23 +09:00
|
|
|
// can either pass strings or objects with subName and subArguments properties
|
|
|
|
if (typeof sub === 'object'){
|
|
|
|
Meteor.subscribe(sub.subName, sub.subArguments);
|
|
|
|
}else{
|
|
|
|
Meteor.subscribe(sub);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-07-07 12:54:23 +09:00
|
|
|
Telescope.controllers = {};
|
|
|
|
|
|
|
|
Telescope.subsManager = new SubsManager({
|
|
|
|
// cache recent 50 subscriptions
|
|
|
|
cacheLimit: 50,
|
|
|
|
// expire any subscription after 30 minutes
|
|
|
|
expireIn: 30
|
|
|
|
});
|