Sfoglia il codice sorgente

Add HTML post editor

master
nano 5 giorni fa
parent
commit
36c0b80583
1 ha cambiato i file con 26 aggiunte e 10 eliminazioni
  1. +26
    -10
      app/views/Posts/edit.asp

+ 26
- 10
app/views/Posts/edit.asp Vedi File

@@ -15,10 +15,11 @@
<textarea class="form-control" id="Summary" name="Summary" rows="3"><%= H(post.Summary) %></textarea>
</div>
<div class="mb-3">
<label class="form-label" for="Body">Body</label>
<textarea class="form-control" id="Body" name="Body" rows="10" required><%= H(post.Body) %></textarea>
</div>
<div class="mb-3">
<label class="form-label" for="Body">Body</label>
<textarea class="form-control html-editor" id="Body" name="Body" rows="14" required><%= H(post.Body) %></textarea>
<div class="form-text">HTML is supported. Use the editor toolbar to format the post.</div>
</div>
<div class="mb-4">
<label class="form-label" for="CategoryID">Category ID</label>
@@ -33,9 +34,24 @@
</form>
<form method="post" action="<%= PostDeleteUrl(post.PostID) %>" class="mt-3">
<button class="btn btn-outline-danger" type="submit">Delete Post</button>
</form>
</div>
</div>
</div>
</div>
<button class="btn btn-outline-danger" type="submit">Delete Post</button>
</form>
</div>
</div>
</div>
</div>

<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
<script>
if (window.tinymce) {
tinymce.init({
selector: 'textarea.html-editor',
menubar: false,
branding: false,
height: 420,
plugins: 'lists link code autoresize',
toolbar: 'undo redo | blocks | bold italic underline | bullist numlist | link blockquote | removeformat | code',
content_style: 'body { font-family: Inter, Arial, sans-serif; font-size: 16px; line-height: 1.6; }'
});
}
</script>

Loading…
Annulla
Salva

Powered by TurnKey Linux.