Skip to content
Snippets Groups Projects
Commit 78255f64 authored by Arkerthan's avatar Arkerthan
Browse files

add system for encyclopedia article sources

parent 66707e71
No related branches found
No related tags found
No related merge requests found
......@@ -12,3 +12,11 @@
white-space: nowrap;
font-size: smaller;
}
.encyclopedia-source::before {
content: "— ";
}
.encyclopedia-source .article {
font-style: italic;
}
......@@ -91,3 +91,20 @@ App.Encyclopedia.renderCategory = function(article) {
App.Encyclopedia.topic = function(topic) {
return App.UI.DOM.makeElement("span", topic, ["encyclopedia", "topic"]);
};
/**
* @param {Node} parent
* @param {string} source
* @param {string} [author]
*/
App.Encyclopedia.addArticleSource = function(parent, source, author) {
const r = [];
if (author) {
r.push(`<span class='author'>${author},</span>`);
}
r.push(`<span class='article'>${source}</span>`);
App.Events.addNode(parent, r, "p", "encyclopedia-source");
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment