mirror of
https://github.com/haiwen/seahub.git
synced 2025-10-22 03:16:34 +00:00
[markdown edit] modification
This commit is contained in:
4
media/js/editormd.min.js
vendored
4
media/js/editormd.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -15,6 +15,12 @@
|
|||||||
{% if filetype == 'Markdown' %}
|
{% if filetype == 'Markdown' %}
|
||||||
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/editormd.min.css" />
|
<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/editormd.min.css" />
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
#main {
|
||||||
|
min-height:0;
|
||||||
|
}
|
||||||
|
.editormd {
|
||||||
|
margin:0 auto;
|
||||||
|
}
|
||||||
/* for 'link', 'image', 'table' popups */
|
/* for 'link', 'image', 'table' popups */
|
||||||
.editormd-form input[type=text],
|
.editormd-form input[type=text],
|
||||||
.editormd-form input[type=number] {
|
.editormd-form input[type=number] {
|
||||||
@@ -248,8 +254,25 @@ var editor = CodeMirror.fromTextArea($('#docu-view')[0], {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if filetype == 'Markdown' %}
|
{% if filetype == 'Markdown' %}
|
||||||
|
var $fileEdit = $('#file-edit');
|
||||||
|
var pathOpHeight = $('#path-op').outerHeight(true),
|
||||||
|
fileEncContHeight = $('#file-enc-cont').outerHeight(true);
|
||||||
|
$fileEdit.css({'min-height':0, 'padding':'30px 0'}).outerHeight($(window).height() - pathOpHeight);
|
||||||
var mdEditor = editormd('md-editor', {
|
var mdEditor = editormd('md-editor', {
|
||||||
width: 950,
|
width: 950,
|
||||||
|
height: $fileEdit.height() - fileEncContHeight - 2,
|
||||||
|
onresize: function () { // window resize
|
||||||
|
var $mdEditor = this.editor;
|
||||||
|
if (this.state.fullscreen) {
|
||||||
|
$mdEditor.height('100%');
|
||||||
|
} else {
|
||||||
|
$fileEdit.outerHeight($(window).height() - pathOpHeight);
|
||||||
|
$mdEditor.height($fileEdit.height() - fileEncContHeight - 2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onfullscreenExit: function () {
|
||||||
|
this.resize();
|
||||||
|
},
|
||||||
path: '{{MEDIA_URL}}js/editormd/lib/', // 'lib' path
|
path: '{{MEDIA_URL}}js/editormd/lib/', // 'lib' path
|
||||||
|
|
||||||
placeholder: '', // for empty file
|
placeholder: '', // for empty file
|
||||||
@@ -259,7 +282,6 @@ var mdEditor = editormd('md-editor', {
|
|||||||
pageBreak: false, // disable parse page break [========]
|
pageBreak: false, // disable parse page break [========]
|
||||||
atLink: false, // for @link
|
atLink: false, // for @link
|
||||||
previewCodeHighlight: false,
|
previewCodeHighlight: false,
|
||||||
autoHeight: true,
|
|
||||||
|
|
||||||
toolbarIcons: function () {
|
toolbarIcons: function () {
|
||||||
// custom toolbar
|
// custom toolbar
|
||||||
|
Reference in New Issue
Block a user