From 561cbbb36bd222961c0e8f042201d8dcd073d78f Mon Sep 17 00:00:00 2001 From: wangzhiyusss Date: Fri, 7 Apr 2023 10:20:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=87=E5=BF=98=E5=BD=95?= =?UTF-8?q?=E5=B7=A6=E7=A7=BB=E5=8F=B3=E7=A7=BB=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangzhiyusss --- .../src/main/resources/rawfile/editor.html | 2 -- .../main/resources/rawfile/editor_style.css | 11 ----------- .../src/main/resources/rawfile/rich_editor.js | 18 +++++++++--------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/common/resources/src/main/resources/rawfile/editor.html b/common/resources/src/main/resources/rawfile/editor.html index ceef7e4..fe612a7 100644 --- a/common/resources/src/main/resources/rawfile/editor.html +++ b/common/resources/src/main/resources/rawfile/editor.html @@ -16,8 +16,6 @@
-
-
diff --git a/common/resources/src/main/resources/rawfile/editor_style.css b/common/resources/src/main/resources/rawfile/editor_style.css index a1cc740..d1b0ec6 100644 --- a/common/resources/src/main/resources/rawfile/editor_style.css +++ b/common/resources/src/main/resources/rawfile/editor_style.css @@ -26,15 +26,6 @@ body { margin: 0; } -#editorjs { - outline: 0px solid transparent; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - color: #182431; - opacity: 0.9; - user-select: none; -} #editorjs_box { width: 100%; @@ -59,8 +50,6 @@ body { background: #F88805; border: 1px solid #F88805; outline: none; - margin-left: 0px; - margin-right: 0px; opacity: 1; } diff --git a/common/resources/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js index 2141a1b..affaa66 100644 --- a/common/resources/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -15,7 +15,7 @@ var RICH_EDITOR = {}; -RICH_EDITOR.editor = document.getElementById('editorjs'); +RICH_EDITOR.editor = document.getElementById('editorjs_box'); RICH_EDITOR.setHtml = function (contents) { var base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; @@ -243,7 +243,7 @@ RICH_EDITOR.execFontSize = function (size, unit) { var pad = 24; RICH_EDITOR.setIndent = function () { - var parents = document.getElementById('editorjs'); + var parents = document.getElementById('editorjs_box'); parents.removeAttribute('padding-left'); if (pad >= 408) { return @@ -253,7 +253,7 @@ RICH_EDITOR.setIndent = function () { }; RICH_EDITOR.setOutdent = function () { - var parents = document.getElementById('editorjs'); + var parents = document.getElementById('editorjs_box'); parents.removeAttribute('padding-left'); if (pad === 24) { parents.style.paddingLeft = 24 + 'px'; @@ -279,8 +279,8 @@ RICH_EDITOR.insertImage = function (url) { var html = '

picvision

'; - document.getElementById('editorjs_img').innerHTML += html - document.getElementById('editorjs_img').scrollIntoView(false); + document.getElementById('editorjs_box').innerHTML += html + document.getElementById('editorjs_box').scrollIntoView(false); }; RICH_EDITOR.insertHTML = function (html) { @@ -309,7 +309,7 @@ RICH_EDITOR.addTodo = function (e) { }; RICH_EDITOR.setTodo = function () { - var parent = document.getElementById('editorjs'); + var parent = document.getElementById('editorjs_box'); var isContentEmpty = parent.innerHTML.trim().length === 0 || parent.innerHTML === '
'; var html = (isContentEmpty ? '' : '
') + '' @@ -440,8 +440,8 @@ RICH_EDITOR.insertImageHtml = function (contents) { document.addEventListener('click', (e) => { console.info(`lsq: e is ${JSON.stringify(e)}`) - var parent = document.getElementById('editorjs'); - if (parent.id !== 'editorjs') { + var parent = document.getElementById('editorjs_box'); + if (parent.id !== 'editorjs_box') { e.preventDefault() } }) @@ -499,7 +499,7 @@ function hiddenButton() { } RICH_EDITOR.getFocus = function () { - return document.getElementById('editorjs').focus(); + return document.getElementById('editorjs_box').focus(); } document.getElementById('editorjs_box').addEventListener('click', () => { -- Gitee