mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00
18 lines
706 B
JavaScript
18 lines
706 B
JavaScript
import Telescope from 'meteor/nova:lib';
|
|
|
|
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})+'">'+"go_to_post"+'</a>');
|
|
}
|
|
});
|
|
return data;
|
|
}
|
|
Telescope.callbacks.add("afterEmbedlyPrefill", checkIfPreviouslyPosted);
|