Skip to content
Snippets Groups Projects
Commit 22c571d3 authored by Václav Končický's avatar Václav Končický
Browse files

Topic: Reply link that adds the post as citation

parent ac7afc99
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,8 @@ md.use(mhl, { ...@@ -23,6 +23,8 @@ md.use(mhl, {
hljs: hljs, hljs: hljs,
}); });
const cmt = document.getElementById("comment");
exports.render_md = function () { exports.render_md = function () {
console.log('Owl: Rendering Markdown'); console.log('Owl: Rendering Markdown');
...@@ -34,6 +36,10 @@ exports.render_md = function () { ...@@ -34,6 +36,10 @@ exports.render_md = function () {
var src = b.innerText; var src = b.innerText;
var result = md.render(src); var result = md.render(src);
b.innerHTML = result; b.innerHTML = result;
var reply = b.parentElement.getElementsByClassName("preply")[0];
reply.onclick = function() {
cmt.value = n.replaceAll(/^/gm, "> ");
}
} }
} }
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
{% if g.is_teacher or p.author_uid == g.uid %} {% if g.is_teacher or p.author_uid == g.uid %}
<a href='{{ url_for('edit_post', cident=g.course.ident, pid=p.pid) }}'>edit</a> <a href='{{ url_for('edit_post', cident=g.course.ident, pid=p.pid) }}'>edit</a>
{% endif %} {% endif %}
<a href="#comment" class="preply">reply</a>
{% if p.comment != None %} {% if p.comment != None %}
<div class=pbody> <div class=pbody>
<pre>{{ p.comment }}</pre> <pre>{{ p.comment }}</pre>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment