1
0
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:
llj
2015-11-11 15:42:33 +08:00
parent b2313e1456
commit a6f86b6ea9
2 changed files with 25 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

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