Created
April 28, 2012 06:58
-
-
Save landongn/2516659 to your computer and use it in GitHub Desktop.
server/collab.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#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