Vulcan/client/app.js
2012-10-01 16:08:30 +09:00

34 lines
805 B
JavaScript

Meteor.subscribe('users');
Posts = new Meteor.Collection('posts');
Meteor.subscribe('posts');
Comments = new Meteor.Collection('comments');
Meteor.subscribe('comments', function() {
StyleNewRecords = new Date();
});
Settings = new Meteor.Collection('settings');
Meteor.subscribe('settings', function(){
// runs once on site load
if((proxinoKey=getSetting('proxinoKey'))){
Proxino.key = proxinoKey;
Proxino.track_errors();
}
});
$.fn.exists = function () {
return this.length !== 0;
}
getAuthorName = function(item){
// keep both variables for transition period
var id=item.userId || item.user_id;
// if item is linked to a user, get that user's display name. Else, return the author field.
return (id && (user=Meteor.users.findOne(id))) ? getDisplayName(user) : this.author;
}