From f6fb49f60e556197ac5ead314cfa4badc578afdb Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 18 Sep 2016 00:06:03 +0200 Subject: [PATCH] Renders md to app@validate --- .../BookAStar.Droid/MarkdownEditor.cshtml | 70 ++++++++++++++----- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/BookAStar/BookAStar.Droid/MarkdownEditor.cshtml b/BookAStar/BookAStar.Droid/MarkdownEditor.cshtml index 2d28ab19..95c8e56e 100644 --- a/BookAStar/BookAStar.Droid/MarkdownEditor.cshtml +++ b/BookAStar/BookAStar.Droid/MarkdownEditor.cshtml @@ -2,47 +2,81 @@ + - - - - - + .hidden { + display: none; + } +
-
@Html.Write(Model)
+
@Html.Write(Model)
- - - - - +
+
+ + + + + function getMD() { + return markdownize($('#bubble-container div.ql-editor').html()) + } + quill.on('text-change', function (delta, oldDelta, source) + { + if (source === "user") { + $('#md').val(getMD()); + $('#btnSubmit').removeClass('hidden'); + } + }); + $(document).ready(function () { + $('#btnSubmit').on('click', function () { + $.get("file:validate?md=" + encodeURIComponent(getMD()), + function (data, stat, jqXHR) { $('#result').html("Okay") }) + }) + }); +