Переглянути джерело

Add HTML post editor

master
nano 5 дні тому
джерело
коміт
45f8e1ec7d
1 змінених файлів з 25 додано та 9 видалено
  1. +25
    -9
      app/views/Posts/new.asp

+ 25
- 9
app/views/Posts/new.asp Переглянути файл

@@ -15,10 +15,11 @@
<textarea class="form-control" id="Summary" name="Summary" rows="3"></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></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></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>
@@ -29,8 +30,23 @@
<button class="btn btn-primary" type="submit">Create Post</button>
<a class="btn btn-outline-secondary" href="<%= PostsUrl() %>">Cancel</a>
</div>
</form>
</div>
</div>
</div>
</div>
</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>

Завантаження…
Відмінити
Зберегти

Powered by TurnKey Linux.