From d6b35df9aa580b553cd031b7bc55c1030a0aa56f Mon Sep 17 00:00:00 2001 From: life Date: Sun, 10 May 2015 00:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=99=E4=BD=9C=E6=A8=A1=E5=BC=8F=E5=88=87?= =?UTF-8?q?=E5=88=B0=E5=8F=AF=E5=86=99=E7=8A=B6=E6=80=81,=20markdown?= =?UTF-8?q?=E5=88=87=E5=88=B0=E5=8F=AF=E5=86=99=E6=97=B6Md.onResize=20#13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/note.html | 8 +++----- src/public/js/app/note.js | 8 +++++++- src/public/js/app/page.js | 11 +++++++---- src/public/themes/basic.less | 13 +++++++++++++ src/public/themes/default.css | 13 +++++++++++++ 5 files changed, 43 insertions(+), 10 deletions(-) diff --git a/src/note.html b/src/note.html index ec31c721..322f0fd4 100755 --- a/src/note.html +++ b/src/note.html @@ -342,11 +342,9 @@ function log(o) {
- - - + + +
diff --git a/src/public/js/app/note.js b/src/public/js/app/note.js index f61e7dbb..d5c25038 100644 --- a/src/public/js/app/note.js +++ b/src/public/js/app/note.js @@ -1793,7 +1793,8 @@ Note.toggleReadOnly = function() { // console.log('((((((((((((((((((((((('); // tinymce - $('#editor').addClass('read-only'); + var $editor = $('#editor'); + $editor.addClass('read-only').removeClass('all-tool'); // 不要全部的 // 不可写 $('#editorContent').attr('contenteditable', false); @@ -1847,6 +1848,11 @@ Note.toggleWriteable = function() { LeaAce.setAceReadOnly($(this), false); }); } + else { + if(MD) { + MD.onResize(); + } + } note.readOnly = false; Note.readOnly = false; diff --git a/src/public/js/app/page.js b/src/public/js/app/page.js index 8292fdaa..dd96c30a 100644 --- a/src/public/js/app/page.js +++ b/src/public/js/app/page.js @@ -30,6 +30,9 @@ var Writting = { Resize.setMdColumnWidth(width); // $("#mceToolbar").css("height", "40px"); resizeEditor(); + + // 切换到写模式 + Note.toggleWriteable(); }, initNormal: function() { Resize.setMdColumnWidth(UserInfo.MdEditorWidth); @@ -193,7 +196,7 @@ var Resize = { UserInfo.NotebookWidth = notebookWidth; UserInfo.NoteListWidth = noteListWidth; - console.log("??????????"); + // console.log("??????????"); self.setTopDragWidth(); }, resize3Columns: function(event, isFromeIfr) { @@ -397,9 +400,9 @@ function initEditor() { // desk下有问题 // ed.on('keydown', Note.saveNote); ed.on('keydown', function(e) { - // 如果是readony, 则不能做任何操作 - if(Note.readOnly) { - console.log('readonly'); + var num = e.which ? e.which : e.keyCode; + // 如果是readony, 则不能做任何操作, 除了复制 + if(Note.readOnly && !((e.ctrlKey || e.metaKey) && num == 67)) { e.preventDefault(); return; } diff --git a/src/public/themes/basic.less b/src/public/themes/basic.less index 18f64c25..57e2e8ce 100644 --- a/src/public/themes/basic.less +++ b/src/public/themes/basic.less @@ -1819,6 +1819,13 @@ img::selection { text-align: center; } +.mce-btn-small .mce-caret { + margin-top: 8px; +} +.mce-listbox.mce-btn-small .mce-caret { + margin-top: -2px; +} + /* #starNotes li a, .ztree li a, @@ -1830,6 +1837,12 @@ img::selection { } */ +#moreBtn { + dispaly: block; position: absolute; + cursor: pointer; + right: 5px; + padding: 3px 10px; +} // readonly .info-toolbar { diff --git a/src/public/themes/default.css b/src/public/themes/default.css index b43e00f9..ca08c875 100644 --- a/src/public/themes/default.css +++ b/src/public/themes/default.css @@ -1607,6 +1607,12 @@ img::selection { line-height: 11px; text-align: center; } +.mce-btn-small .mce-caret { + margin-top: 8px; +} +.mce-listbox.mce-btn-small .mce-caret { + margin-top: -2px; +} /* #starNotes li a, .ztree li a, @@ -1617,6 +1623,13 @@ img::selection { cursor: default !important; } */ +#moreBtn { + dispaly: block; + position: absolute; + cursor: pointer; + right: 5px; + padding: 3px 10px; +} .info-toolbar { position: absolute; top: 0;