Vulcan/packages/telescope-embedly/lib/embedly.js

73 lines
1.5 KiB
JavaScript
Raw Normal View History

var thumbnailProperty = {
propertyName: 'thumbnailUrl',
propertySchema: {
type: String,
optional: true,
editableBy: ["member", "admin"],
autoform: {
type: 'bootstrap-postthumbnail'
}
}
}
2015-04-24 09:28:50 +09:00
Posts.registerField(thumbnailProperty);
var mediaProperty = {
propertyName: 'media',
propertySchema: {
type: Object,
optional: true,
2015-04-28 09:44:43 +09:00
blackbox: true
}
}
2015-04-24 09:28:50 +09:00
Posts.registerField(mediaProperty);
2015-04-24 09:48:36 +09:00
Telescope.modules.register("postThumbnail", {
template: 'postThumbnail',
order: 15
});
var embedlyKeyProperty = {
propertyName: 'embedlyKey',
propertySchema: {
type: String,
optional: true,
private: true,
autoform: {
group: 'embedly',
class: 'private-field'
}
}
}
Settings.registerField(embedlyKeyProperty);
var thumbnailWidthProperty = {
propertyName: 'thumbnailWidth',
propertySchema: {
type: Number,
optional: true,
autoform: {
group: 'embedly'
}
}
}
Settings.registerField(thumbnailWidthProperty);
var thumbnailHeightProperty = {
propertyName: 'thumbnailHeight',
propertySchema: {
type: Number,
optional: true,
autoform: {
group: 'embedly'
}
}
}
Settings.registerField(thumbnailHeightProperty);
2015-04-27 10:12:48 +09:00
function addThumbnailClass (post, postClass){
var thumbnailClass = !!post.thumbnailUrl ? "has-thumbnail" : "no-thumbnail";
return postClass + " " + thumbnailClass;
2015-04-27 10:12:48 +09:00
}
// add callback that adds "has-thumbnail" or "no-thumbnail" CSS classes
Telescope.callbacks.register("postClass", addThumbnailClass);