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

75 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-08-29 10:37:35 +09:00
var thumbnailProperty = {
propertyName: 'thumbnailUrl',
propertySchema: {
type: String,
2014-12-06 11:56:57 +09:00
optional: true,
2014-10-06 10:40:45 +09:00
autoform: {
2014-12-06 11:56:57 +09:00
editable: true,
type: 'bootstrap-postthumbnail'
2014-10-06 10:40:45 +09:00
}
2014-08-29 10:37:35 +09:00
}
}
addToPostSchema.push(thumbnailProperty);
var mediaProperty = {
propertyName: 'media',
propertySchema: {
type: Object,
optional: true,
2014-10-05 17:20:15 +09:00
blackbox: true,
hidden: true,
autoform: {
2014-10-06 10:40:45 +09:00
omit: true
2014-10-05 17:20:15 +09:00
}
2014-08-29 10:37:35 +09:00
}
}
addToPostSchema.push(mediaProperty);
2014-12-13 17:43:52 +09:00
postThumbnail.push({
2015-03-28 18:30:26 +09:00
template: 'postThumbnail',
2014-12-13 17:43:52 +09:00
order: 15
2014-08-29 10:37:35 +09:00
});
var embedlyKeyProperty = {
propertyName: 'embedlyKey',
propertySchema: {
type: String,
optional: true,
autoform: {
group: 'embedly',
private: true
}
2014-08-29 10:37:35 +09:00
}
}
2015-03-28 18:30:26 +09:00
Settings.addToSchema(embedlyKeyProperty);
var thumbnailWidthProperty = {
propertyName: 'thumbnailWidth',
propertySchema: {
type: Number,
optional: true,
autoform: {
group: 'embedly'
}
}
}
2015-03-28 18:30:26 +09:00
Settings.addToSchema(thumbnailWidthProperty);
var thumbnailHeightProperty = {
propertyName: 'thumbnailHeight',
propertySchema: {
type: Number,
optional: true,
autoform: {
group: 'embedly'
}
}
}
2015-03-28 18:30:26 +09:00
Settings.addToSchema(thumbnailHeightProperty);
// add callback that adds "has-thumbnail" or "no-thumbnail" CSS classes
postClassCallbacks.push(function (post, postClass){
var thumbnailClass = !!post.thumbnailUrl ? "has-thumbnail" : "no-thumbnail";
return postClass + " " + thumbnailClass;
2015-03-28 18:30:26 +09:00
});