Add a MarkdownInput widget, and make use of it

Signed-off-by: Skia <skia@libskia.so>
This commit is contained in:
Skia
2017-06-10 19:39:40 +02:00
parent 4b9fa0cd57
commit 2925cde8ab
6 changed files with 38 additions and 14 deletions

View File

@ -248,8 +248,7 @@ function add_syntax(e, choice) {
}
$(document).ready(function() {
textarea = $('.markdown_editor textarea');
editor = textarea.parent();
editor = $('.markdown_editor');
editor.prepend('<a onclick="javascript:add_syntax(this, \'image\')">{% trans %}Image{% endtrans %}</a>');
editor.prepend('<a onclick="javascript:add_syntax(this, \'link\')">{% trans %}Link{% endtrans %}</a>');
editor.prepend('<a onclick="javascript:add_syntax(this, \'sup\')"><sup>{% trans %}sup{% endtrans %}</sup></a>');
@ -258,7 +257,6 @@ $(document).ready(function() {
editor.prepend('<a onclick="javascript:add_syntax(this, \'underline\')"><u>{% trans %}U{% endtrans %}</u></a>');
editor.prepend('<a onclick="javascript:add_syntax(this, \'italic\')"><i>{% trans %}I{% endtrans %}</i></a>');
editor.prepend('<a onclick="javascript:add_syntax(this, \'bold\')"><b>{% trans %}B{% endtrans %}</b></a>');
console.log(textarea.parent());
});
</script>
{% endblock %}