Add 'get count of comment' method

Draft JavaScript side
This commit is contained in:
Yax
2015-05-09 20:25:35 +02:00
parent 8893cf83ed
commit 71383eff9a
4 changed files with 124 additions and 51 deletions
+33
View File
@@ -0,0 +1,33 @@
function show_hide(panel_id, button_id){
if (document.getElementById(panel_id).style.display == 'none'){
document.getElementById(panel_id).style.display = '';
document.getElementById(button_id).style.display = 'none';
} else {
document.getElementById(panel_id).style.display = 'none';
}
}
function show_comments() {
stacosys_load();
show_hide('stacosys-comments', 'show-comments-button');
}
function preview_markdown() {
if (document.getElementById('preview-container').style.display == 'none'){
document.getElementById('preview-container').style.display = '';
}
var $ = function (id) { return document.getElementById(id); };
new Editor($("message"), $("preview"));
}
function Editor(input, preview) {
this.update = function () {
preview.innerHTML = markdown.toHTML(input.value);
};
input.editor = this;
this.update();
}
function get_action() {
return '/post_a_new_comment';
}