Skip to content

Instantly share code, notes, and snippets.

@fczuardi
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fczuardi/72a5103b5c1f0ba87eb3 to your computer and use it in GitHub Desktop.
Save fczuardi/72a5103b5c1f0ba87eb3 to your computer and use it in GitHub Desktop.
nodebb-plugin-blog-comment monkey-patch
if (data.isAdmin) {
//var adminXHR = newXHR();
//adminXHR.open('GET', '/ghost/api/v0.1/posts/' + articleID);
//adminXHR.onload = function() {
//if (adminXHR.status >= 200 && adminXHR.status < 400) {
//var articleData = JSON.parse(adminXHR.responseText),
//markdown = articleData.markdown.split('\n\n').slice(0,2).join('\n\n') + '\n\n**Click [here]('+articlePath+') to see the fu$
var markdown = '\n\n**Click [here]('+articlePath+') to see the full blog post**';
var title = $('.post-title').text();
document.getElementById('nodebb-content-markdown').value = markdown;
document.getElementById('nodebb-content-title').value = title;
//document.getElementById('nodebb-content-title').value = articleData.title;
//} else {
//nodebbDiv.innerHTML = 'Welcome ' + data.user.username + ', <a href="/ghost">sign in to Ghost</a> to enable the publish button.</a>$
//}
//}
//adminXHR.send();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment