2015-04-22 07:50:11 +09:00
|
|
|
var thumbnailProperty = {
|
2015-05-10 14:36:47 +09:00
|
|
|
fieldName: 'thumbnailUrl',
|
|
|
|
fieldSchema: {
|
2015-04-22 07:50:11 +09:00
|
|
|
type: String,
|
|
|
|
optional: true,
|
2015-04-28 17:15:53 +09:00
|
|
|
editableBy: ["member", "admin"],
|
2015-04-22 07:50:11 +09:00
|
|
|
autoform: {
|
|
|
|
type: 'bootstrap-postthumbnail'
|
|
|
|
}
|
|
|
|
}
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-04-24 09:28:50 +09:00
|
|
|
Posts.registerField(thumbnailProperty);
|
2015-04-22 07:50:11 +09:00
|
|
|
|
|
|
|
var mediaProperty = {
|
2015-05-10 14:36:47 +09:00
|
|
|
fieldName: 'media',
|
|
|
|
fieldSchema: {
|
2015-04-22 07:50:11 +09:00
|
|
|
type: Object,
|
|
|
|
optional: true,
|
2015-04-28 09:44:43 +09:00
|
|
|
blackbox: true
|
2015-04-22 07:50:11 +09:00
|
|
|
}
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-04-24 09:28:50 +09:00
|
|
|
Posts.registerField(mediaProperty);
|
2015-04-22 07:50:11 +09:00
|
|
|
|
2015-04-24 09:48:36 +09:00
|
|
|
Telescope.modules.register("postThumbnail", {
|
2015-04-22 07:50:11 +09:00
|
|
|
template: 'postThumbnail',
|
|
|
|
order: 15
|
|
|
|
});
|
|
|
|
|
|
|
|
var embedlyKeyProperty = {
|
2015-05-10 14:36:47 +09:00
|
|
|
fieldName: 'embedlyKey',
|
|
|
|
fieldSchema: {
|
2015-04-22 07:50:11 +09:00
|
|
|
type: String,
|
|
|
|
optional: true,
|
2015-04-25 12:39:07 +09:00
|
|
|
private: true,
|
2015-04-22 07:50:11 +09:00
|
|
|
autoform: {
|
|
|
|
group: 'embedly',
|
2015-04-25 12:39:07 +09:00
|
|
|
class: 'private-field'
|
2015-04-22 07:50:11 +09:00
|
|
|
}
|
|
|
|
}
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-04-25 13:11:28 +09:00
|
|
|
Settings.registerField(embedlyKeyProperty);
|
2015-04-22 07:50:11 +09:00
|
|
|
|
|
|
|
var thumbnailWidthProperty = {
|
2015-05-10 14:36:47 +09:00
|
|
|
fieldName: 'thumbnailWidth',
|
|
|
|
fieldSchema: {
|
2015-04-22 07:50:11 +09:00
|
|
|
type: Number,
|
|
|
|
optional: true,
|
|
|
|
autoform: {
|
|
|
|
group: 'embedly'
|
|
|
|
}
|
|
|
|
}
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-04-25 13:11:28 +09:00
|
|
|
Settings.registerField(thumbnailWidthProperty);
|
2015-04-22 07:50:11 +09:00
|
|
|
|
|
|
|
var thumbnailHeightProperty = {
|
2015-05-10 14:36:47 +09:00
|
|
|
fieldName: 'thumbnailHeight',
|
|
|
|
fieldSchema: {
|
2015-04-22 07:50:11 +09:00
|
|
|
type: Number,
|
|
|
|
optional: true,
|
|
|
|
autoform: {
|
|
|
|
group: 'embedly'
|
|
|
|
}
|
|
|
|
}
|
2015-05-01 18:22:00 +02:00
|
|
|
};
|
2015-04-25 13:11:28 +09:00
|
|
|
Settings.registerField(thumbnailHeightProperty);
|
2015-04-22 07:50:11 +09:00
|
|
|
|
2015-05-02 09:52:39 +09:00
|
|
|
function addThumbnailClass (post, postClass) {
|
2015-04-22 07:50:11 +09:00
|
|
|
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);
|