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-05-17 15:38:02 +09:00
|
|
|
Posts.addField(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-05-17 15:38:02 +09:00
|
|
|
Posts.addField(mediaProperty);
|
2015-04-22 07:50:11 +09:00
|
|
|
|
2015-05-17 15:38:02 +09:00
|
|
|
Telescope.modules.add("postThumbnail", {
|
2015-05-18 10:12:48 +09:00
|
|
|
template: 'post_thumbnail',
|
2015-04-22 07:50:11 +09:00
|
|
|
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-05-17 15:38:02 +09:00
|
|
|
Settings.addField(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-05-17 15:38:02 +09:00
|
|
|
Settings.addField(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-05-17 15:38:02 +09:00
|
|
|
Settings.addField(thumbnailHeightProperty);
|
2015-04-22 07:50:11 +09:00
|
|
|
|
2015-08-03 20:02:54 +09:00
|
|
|
function addThumbnailClass (postClass, post) {
|
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
|
2015-05-17 15:38:02 +09:00
|
|
|
Telescope.callbacks.add("postClass", addThumbnailClass);
|