Skip to content

Instantly share code, notes, and snippets.

@landongn
Created April 28, 2012 06:58
Show Gist options
  • Save landongn/2516659 to your computer and use it in GitHub Desktop.
Save landongn/2516659 to your computer and use it in GitHub Desktop.
server/collab.js
//#data
Content = new Meteor.Collection('content');
Topics = new Meteor.Collection('topics');
Session.set('is_editing', false);
Session.set('username', null);
Session.set('active_id', 0);
console.log(Meteor);
Meteor.autosubscribe(function() {
var active_id = Session.get('active_id');
if (active_id) {
Meteor.subscribe('content', active_id); //sets the listener to any actively connected client
Meteor.subscribe('roster', active_id);
Session.set('presence_id', function(){
var record = Content.find({'_id':active_id}, {'t':1});
return title.t;
});
}
});
Meteor.subscribe('content', function(){
if (Session.get('active_id' === null)) {
var content = Content.find({});
}
});
//## Templates
Template.content_list.recSet = function(){
return Content.find().limit(10);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment