Move show all html stuff to render

This commit is contained in:
Anders Rune Jensen
2017-06-08 20:34:36 +02:00
parent c5cabd1c13
commit e042fb7933
2 changed files with 17 additions and 6 deletions
+8
View File
@@ -14,6 +14,7 @@ exports.renderEmoji = renderEmoji;
exports.formatMsgs = formatMsgs;
exports.renderThread = renderThread;
exports.renderAbout = renderAbout;
exports.renderShowAll = renderShowAll;
function MdRenderer(opts) {
marked.Renderer.call(this, {});
@@ -445,3 +446,10 @@ function renderPost(opts, c) {
function renderDefault(c) {
return h('pre', JSON.stringify(c, 0, 2));
}
function renderShowAll(showAll, url) {
if (showAll)
return '';
else
return '<br>' + h('a', { href : url + '?showAll' }, 'Show whole feed').outerHTML;
}