Add preview button in the Forum

This commit is contained in:
Skia
2017-04-12 19:19:25 +02:00
parent 830e94d73c
commit 3aa5070a38
4 changed files with 52 additions and 6 deletions

View File

@ -4,10 +4,12 @@
{{ super() }}
<script>
function make_preview() {
text = $("#id_content").val();
console.log("Rendering text: " + text);
$.ajax({
url: "{{ url('api:api_markdown') }}",
method: "GET",
data: { text: $("#id_content").val() }
method: "POST",
data: { text: text, csrfmiddlewaretoken: "{{ csrf_token }}"}
}).done(function (msg) {
$("#preview").html(msg);
});