Vulcan/client/main.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

// Session variables
2012-12-11 10:47:11 +09:00
Session.set('initialLoad', true);
2013-10-12 12:24:41 +09:00
Session.set('today', new Date());
2013-10-12 13:01:16 +09:00
Session.set('view', 'top');
2013-10-24 20:46:14 +09:00
Session.set('postsLimit', getSetting('postsPerPage', 2));
2013-10-25 10:04:34 +09:00
Session.set('settingsLoaded', false);
2012-12-11 10:47:11 +09:00
2013-10-09 22:16:47 +09:00
// Subscriptions
// note: here we only subscribe to subscriptions that we need to be available all the time.
// For subscriptions depending on specific pages, see the router.
// TODO: add session variable that tracks when all global subscriptions have loaded
2013-10-09 22:16:47 +09:00
// Settings
Meteor.subscribe('settings', function(){
2013-10-09 22:16:47 +09:00
// runs once after settings have loaded
2012-11-21 14:31:58 +09:00
Session.set('settingsLoaded',true);
2013-10-30 08:27:44 +09:00
analyticsInit();
});
// Categories
Meteor.subscribe('categories');
2013-10-09 22:16:47 +09:00
// Current User
// We need to subscribe to the currentUser subscription because by itself,
// Meteor doesn't send all the user properties that we need
2012-11-17 13:24:19 +09:00
Meteor.subscribe('currentUser');
2013-11-06 09:29:10 +09:00
// Subscribe to all users for now to make user selection autocomplete work?
// Meteor.subscribe('allUsers', {}, {});
// Notifications - only load if user is logged in
if(Meteor.user() != null)
Meteor.subscribe('notifications');
2013-10-15 12:09:19 +09:00
2013-10-24 21:07:55 +09:00
STATUS_PENDING=1;
STATUS_APPROVED=2;
2013-10-30 08:27:44 +09:00
STATUS_REJECTED=3;