Merge commit 'c1b5c8d'
For About data, use most popular (d87029da1c) instead of self-picked (dffd43f062)
This commit is contained in:
@@ -12,6 +12,7 @@ exports.MdRenderer = MdRenderer;
|
||||
exports.renderEmoji = renderEmoji;
|
||||
exports.formatMsgs = formatMsgs;
|
||||
exports.renderThread = renderThread;
|
||||
exports.renderAbout = renderAbout;
|
||||
|
||||
function MdRenderer(opts) {
|
||||
marked.Renderer.call(this, {});
|
||||
@@ -94,6 +95,30 @@ function wrap(before, after) {
|
||||
};
|
||||
}
|
||||
|
||||
function renderAbout(opts, about) {
|
||||
return pull(
|
||||
pull.map(renderMsg.bind(this, opts)),
|
||||
wrap(
|
||||
'<span class="top-tip">You are reading content from ' +
|
||||
'<a href="https://www.scuttlebutt.nz">Scuttlebutt</a>' +
|
||||
'</span>' +
|
||||
'<main>' +
|
||||
'<article><header><figure>' +
|
||||
'<img src="' + opts.img_base + escape(about.image) + '" ' +
|
||||
'height="200" width="200"><figcaption>' +
|
||||
'Feed of ' + about.name + '<br/>' +
|
||||
(about.description != undefined ?
|
||||
marked(about.description, opts.marked) : '') +
|
||||
'</figcaption></figure></header></article>',
|
||||
|
||||
'</main>' +
|
||||
'<a class="call-to-action" href="https://www.scuttlebutt.nz">' +
|
||||
'Join Scuttlebutt now' +
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function renderThread(opts) {
|
||||
return pull(
|
||||
pull.map(renderMsg.bind(this, opts)),
|
||||
@@ -391,7 +416,6 @@ function render(opts, c) {
|
||||
return '<span class="status">' +
|
||||
"Created a git issue" + (c.repoName != undefined ? " in repo " + c.repoName : "") + renderPost(opts, c) +
|
||||
'</span>';
|
||||
//renderDefault(c);
|
||||
}
|
||||
else if (c.type == "git-update") {
|
||||
return '<span class="status">' +
|
||||
@@ -408,9 +432,8 @@ function render(opts, c) {
|
||||
}
|
||||
else if (c.type == "pub") {
|
||||
return '<span class="status">' +
|
||||
"Connected to a pub" +
|
||||
'</span>' +
|
||||
renderDefault(c);
|
||||
"Connected to the pub " + c.address.host +
|
||||
'</span>'
|
||||
}
|
||||
else if (c.type == "channel" && c.subscribed)
|
||||
return '<span class="status">' +
|
||||
|
||||
Reference in New Issue
Block a user