Markdown editor improvements (#87)

This commit is contained in:
Bao Le 2023-10-06 02:08:24 +08:00 committed by GitHub
parent 458b9e425e
commit 49d1bc2e1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,20 +2,19 @@
{% block media %} {% block media %}
<style> <style>
main { main{
overflow: hidden; overflow: hidden;
} }
#content { #content{
width: 100%; width: 100%;
} }
#content.wrapper { #content.wrapper{
padding: 0; padding: 0;
} }
.form-area { .form-area{
float: left; float: left;
width: 47%; width: 47%;
height: 100% height: 100%
} }
.wmd-preview{ .wmd-preview{
float: right; float: right;
@ -24,13 +23,16 @@
.width-controller{ .width-controller{
width: 51%; width: 51%;
} }
.wmd-input { .wmd-input{
height: calc(100vh - 114px); height: calc(100vh - 72px);
} }
.right-markdown{ .right-markdown{
height: calc(100vh - 69px); height: calc(100vh - 72px);
overflow-y: scroll; overflow-y: scroll;
} }
.wrap{
display: flex;
}
</style> </style>
{% endblock %} {% endblock %}
@ -49,13 +51,15 @@
preview: $(this).val() preview: $(this).val()
}, },
success: function(data) { success: function(data) {
$('#display').html(data) $('#display').html(data);
MathJax.typeset();
}, },
error: function(error) { error: function(error) {
alert(error); alert(error);
console.log(error.message) console.log(error.message)
} }
}) })
}); });
}); });
</script> </script>
@ -90,8 +94,12 @@
{% block title_row %} {% block title_row %}
{% endblock %} {% endblock %}
{% block title_ruler %}
{% endblock %}
{% block body %} {% block body %}
<div id="new-comment" class="form-area" style=""> <div class="wrap">
<div id="new-comment" class="form-area">
<input type="hidden" name="parent" id="id_parent"> <input type="hidden" name="parent" id="id_parent">
<div class="comment-post-wrapper"> <div class="comment-post-wrapper">
<div id="comment-form-body"><div class="wmd-wrapper image-upload-enabled"> <div id="comment-form-body"><div class="wmd-wrapper image-upload-enabled">
@ -130,5 +138,6 @@
<div id="id_body-preview" data-preview-url="{{url('comment_preview')}}" data-textarea-id="wmd-input-id_body" data-timeout="1000" class="width-controller wmd-panel wmd-preview dmmd-preview dmmd-no-button dmmd-preview-has-content"> <div id="id_body-preview" data-preview-url="{{url('comment_preview')}}" data-textarea-id="wmd-input-id_body" data-timeout="1000" class="width-controller wmd-panel wmd-preview dmmd-preview dmmd-no-button dmmd-preview-has-content">
<div class="right-markdown dmmd-preview-content content-description" id="display"></div> <div class="right-markdown dmmd-preview-content content-description" id="display"></div>
</div> </div>
</div>
{% endblock %} {% endblock %}