Settings.addToSchema -> Settings.registerField

This commit is contained in:
Sacha Greif 2015-04-25 13:11:28 +09:00
parent b6e213abc4
commit 0643437c67
7 changed files with 20 additions and 16 deletions

View file

@ -12,4 +12,4 @@ var customSetting = {
}
}
}
Settings.addToSchema(customSetting);
Settings.registerField(customSetting);

View file

@ -43,7 +43,7 @@ var embedlyKeyProperty = {
}
}
}
Settings.addToSchema(embedlyKeyProperty);
Settings.registerField(embedlyKeyProperty);
var thumbnailWidthProperty = {
propertyName: 'thumbnailWidth',
@ -55,7 +55,7 @@ var thumbnailWidthProperty = {
}
}
}
Settings.addToSchema(thumbnailWidthProperty);
Settings.registerField(thumbnailWidthProperty);
var thumbnailHeightProperty = {
propertyName: 'thumbnailHeight',
@ -67,7 +67,7 @@ var thumbnailHeightProperty = {
}
}
}
Settings.addToSchema(thumbnailHeightProperty);
Settings.registerField(thumbnailHeightProperty);
// add callback that adds "has-thumbnail" or "no-thumbnail" CSS classes
Telescope.callbacks.register("postClass", function (post, postClass){

View file

@ -9,7 +9,7 @@ var kadiraAppIdProperty = {
}
}
};
Settings.addToSchema(kadiraAppIdProperty);
Settings.registerField(kadiraAppIdProperty);
var kadiraAppSecretProperty = {
propertyName: "kadiraAppSecret",
@ -24,4 +24,4 @@ var kadiraAppSecretProperty = {
}
}
};
Settings.addToSchema(kadiraAppSecretProperty);
Settings.registerField(kadiraAppSecretProperty);

View file

@ -55,7 +55,7 @@ var enableNewsletter = {
}
}
}
Settings.addToSchema(enableNewsletter);
Settings.registerField(enableNewsletter);
var showBanner = {
propertyName: 'showBanner',
@ -69,7 +69,7 @@ var showBanner = {
}
}
}
Settings.addToSchema(showBanner);
Settings.registerField(showBanner);
var mailChimpAPIKey = {
propertyName: "mailChimpAPIKey",
@ -83,7 +83,7 @@ var mailChimpAPIKey = {
}
}
}
Settings.addToSchema(mailChimpAPIKey);
Settings.registerField(mailChimpAPIKey);
var mailChimpListId = {
propertyName: 'mailChimpListId',
@ -98,7 +98,7 @@ var mailChimpListId = {
}
}
}
Settings.addToSchema(mailChimpListId);
Settings.registerField(mailChimpListId);
var postsPerNewsletter = {
propertyName: 'postsPerNewsletter',
@ -110,7 +110,7 @@ var postsPerNewsletter = {
}
}
}
Settings.addToSchema(postsPerNewsletter);
Settings.registerField(postsPerNewsletter);
var newsletterFrequency = {
propertyName: 'newsletterFrequency',
@ -141,7 +141,7 @@ var newsletterFrequency = {
}
}
}
Settings.addToSchema(newsletterFrequency);
Settings.registerField(newsletterFrequency);
var newsletterTime = {
propertyName: 'newsletterTime',
@ -156,7 +156,7 @@ var newsletterTime = {
}
}
}
Settings.addToSchema(newsletterTime);
Settings.registerField(newsletterTime);
var autoSubscribe = {
propertyName: 'autoSubscribe',
@ -169,7 +169,7 @@ var autoSubscribe = {
}
}
}
Settings.addToSchema(autoSubscribe);
Settings.registerField(autoSubscribe);
// create new "campaign" lens for all posts from the past X days that haven't been scheduled yet
viewParameters.campaign = function (terms) {

View file

@ -99,7 +99,7 @@ var emailNotifications = {
}
}
};
Settings.addToSchema(emailNotifications);
Settings.registerField(emailNotifications);
// make it possible to disable notifications on a per-comment basis
Comments.registerField(

View file

@ -15,4 +15,4 @@ var showTaglineBanner = {
}
}
};
Settings.addToSchema(showTaglineBanner);
Settings.registerField(showTaglineBanner);

View file

@ -13,6 +13,10 @@ Users.isAdmin = function (user) {
return !!user && !!user.isAdmin;
};
Users.isOwner = function (user, document) {
return user._id === document.userId;
};
Users.updateAdmin = function (userId, admin) {
this.update(userId, {$set: {isAdmin: admin}});
};