Vulcan/packages/telescope-core/lib/client/main.js

37 lines
872 B
JavaScript
Raw Normal View History

2015-09-18 16:27:59 +09:00
Telescope.SEO = new FlowRouterSEO();
// Session variables
2015-09-17 14:51:14 +09:00
Session.set('appIsReady', false);
2014-07-15 07:45:37 +09:00
Meteor.startup(function () {
$('#rss-link').attr('title', i18n.t('new_posts'));
2014-11-29 11:14:44 +09:00
});
2015-09-17 14:51:14 +09:00
// Global Subscriptions
2015-09-18 16:27:59 +09:00
Telescope.subsManager = new SubsManager({
// cache recent 50 subscriptions
cacheLimit: 50,
// expire any subscription after 30 minutes
expireIn: 30
});
2015-09-17 14:51:14 +09:00
Telescope.subscriptions.preload('settings');
Telescope.subscriptions.preload('currentUser');
2015-09-17 14:51:14 +09:00
FlowRouter.subscriptions = function() {
var flow = this;
Telescope.subscriptions.forEach(function (sub) {
if (typeof sub === 'object'){
flow.register(sub.subName, Meteor.subscribe(sub.subName, sub.subArguments));
}else{
flow.register(sub, Meteor.subscribe(sub));
}
});
};
2015-04-11 17:03:07 +09:00
2015-09-18 16:27:59 +09:00
FlowRouter.notFound = {
action: function() {
BlazeLayout.render("layout", {main: "not_found"});
}
};