Vulcan/packages/nova-embedly/lib/custom_fields.js

53 lines
1 KiB
JavaScript
Raw Normal View History

2016-04-07 12:43:41 +09:00
import EmbedlyURL from './components/EmbedlyURL.jsx';
2016-04-07 22:21:01 +09:00
import ThumbnailURL from './components/ThumbnailURL.jsx';
2016-06-23 11:40:35 +09:00
import Posts from "meteor/nova:posts";
2016-03-27 18:17:20 +09:00
Posts.addField([
2016-04-07 12:43:41 +09:00
{
fieldName: 'url',
fieldSchema: {
control: EmbedlyURL, // we are just extending the field url, not replacing it
2016-04-07 12:43:41 +09:00
}
},
2016-03-27 18:17:20 +09:00
{
fieldName: 'thumbnailUrl',
fieldSchema: {
type: String,
optional: true,
insertableBy: ['members'],
editableBy: ['members'],
viewableBy: ['guests'],
2016-03-27 18:17:20 +09:00
publish: true,
2016-04-07 22:21:01 +09:00
control: ThumbnailURL
2016-03-27 18:17:20 +09:00
}
},
{
fieldName: 'media',
fieldSchema: {
type: Object,
publish: true,
optional: true,
blackbox: true,
viewableBy: ['guests'],
2016-03-27 18:17:20 +09:00
}
},
{
fieldName: 'sourceName',
fieldSchema: {
type: String,
optional: true,
publish: true,
viewableBy: ['guests'],
2016-03-27 18:17:20 +09:00
}
},
{
fieldName: 'sourceUrl',
fieldSchema: {
type: String,
optional: true,
publish: true,
viewableBy: ['guests'],
2016-03-27 18:17:20 +09:00
}
}
]);