Explorar el Código

Add HTML post editor

master
nano hace 5 días
padre
commit
45f8e1ec7d
Se han modificado 1 ficheros con 25 adiciones y 9 borrados
  1. +25
    -9
      app/views/Posts/new.asp

+ 25
- 9
app/views/Posts/new.asp Ver fichero

@@ -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>

Cargando…
Cancelar
Guardar

Powered by TurnKey Linux.