mirror of
https://github.com/vale981/Vulcan
synced 2025-03-11 13:06:41 -04:00
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
![]() |
|
||
|
|
||
|
function addThumbnailClass (postClass, post) {
|
||
|
var thumbnailClass = !!post.thumbnailUrl ? "has-thumbnail" : "no-thumbnail";
|
||
|
return postClass + " " + thumbnailClass;
|
||
|
}
|
||
|
// add callback that adds "has-thumbnail" or "no-thumbnail" CSS classes
|
||
|
Telescope.callbacks.add("postClass", addThumbnailClass);
|
||
|
|
||
|
function checkIfPreviouslyPosted (data) {
|
||
|
Meteor.call("checkForDuplicates", data.url, function (error, result) {
|
||
|
if (error) {
|
||
|
Messages.flash(error.reason + '. <a href="'+FlowRouter.path("postPage", {_id: error.details})+'">'+i18n.t("go_to_post")+'</a>');
|
||
|
}
|
||
|
});
|
||
|
return data;
|
||
|
}
|
||
|
Telescope.callbacks.add("afterEmbedlyPrefill", checkIfPreviouslyPosted);
|
||
|
|
||
|
|
||
|
// Settings.addField([
|
||
|
// {
|
||
|
// fieldName: 'embedlyKey',
|
||
|
// fieldSchema: {
|
||
|
// type: String,
|
||
|
// optional: true,
|
||
|
// private: true,
|
||
|
// autoform: {
|
||
|
// group: 'embedly',
|
||
|
// class: 'private-field'
|
||
|
// }
|
||
|
// }
|
||
|
// },
|
||
|
// {
|
||
|
// fieldName: 'thumbnailWidth',
|
||
|
// fieldSchema: {
|
||
|
// type: Number,
|
||
|
// optional: true,
|
||
|
// autoform: {
|
||
|
// group: 'embedly'
|
||
|
// }
|
||
|
// }
|
||
|
// },
|
||
|
// {
|
||
|
// fieldName: 'thumbnailHeight',
|
||
|
// fieldSchema: {
|
||
|
// type: Number,
|
||
|
// optional: true,
|
||
|
// autoform: {
|
||
|
// group: 'embedly'
|
||
|
// }
|
||
|
// }
|
||
|
// }
|
||
|
// ]);
|