From 0f9565fd469a5e5d5bc777fda33766cf67b84e5b Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 18 Sep 2016 00:09:14 +0200 Subject: [PATCH] fixes a recent commit --- BookAStar/BookAStar.Droid/MarkdownEditor.cs | 129 +++++++++++++++----- 1 file changed, 101 insertions(+), 28 deletions(-) diff --git a/BookAStar/BookAStar.Droid/MarkdownEditor.cs b/BookAStar/BookAStar.Droid/MarkdownEditor.cs index eb68059e..24f34298 100644 --- a/BookAStar/BookAStar.Droid/MarkdownEditor.cs +++ b/BookAStar/BookAStar.Droid/MarkdownEditor.cs @@ -32,77 +32,150 @@ public string Model { get; set; } public override void Execute() { -WriteLiteral("\r\n\r\n\r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n \r\n\r\n -WriteLiteral(" rel=\"stylesheet\""); + -WriteLiteral(" href=\"quill.snow.css\""); + + -WriteLiteral(" />\r\n\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n "); -#line 30 "MarkdownEditor.cshtml" - Write(Html.Write(Model)); +#line 33 "MarkdownEditor.cshtml" + Write(Html.Write(Model)); #line default #line hidden -WriteLiteral("\r\n \r\n\r\n \r\n \r\n
\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n var quill = new Quill(\'#snow-container\', {\r\n placeholder: \'Compose an epi" + -"c...\',\r\n theme: \'snow\'\r\n });\r\n \r\n\r\n\r\n\r\n\r\n"); +WriteLiteral(@"> + var toolbarOptions = [ + ['bold', 'italic', 'underline', 'strike'], // toggled buttons + ['blockquote', 'code-block'], + + [{ 'header': 1 }, { 'header': 2 }], // custom button values + [{ 'list': 'ordered' }, { 'list': 'bullet' }], + [{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent + + ['clean'] // remove formatting button + ]; + + var quill = new Quill('#bubble-container', { + modules: { + toolbar: toolbarOptions + }, + placeholder: 'Composez votre texte ...', + theme: 'snow' + }); + + 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"") }) + }) + }); + + + + +"); } }