From 80f3b7bbc7eeaa5ac94b8bf8b6cd6f7f11f546e9 Mon Sep 17 00:00:00 2001 From: nobbo Date: Wed, 7 Sep 2022 19:58:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=82=E6=95=B0?= =?UTF-8?q?=E5=A4=AA=E5=A4=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nobbo --- .../src/main/resources/rawfile/rich_editor.js | 147 +++++++++--------- 1 file changed, 76 insertions(+), 71 deletions(-) diff --git a/common/resources/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js index eeaa938..8ec52a1 100644 --- a/common/resources/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -69,27 +69,28 @@ RICH_EDITOR.getListStyle = function () { selection = getSelection(); } if (selection) { - var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); - try { - var child = range.commonAncestorContainer.parentNode; - for (var i = 0; i < 10; i++) { - if (child.nodeName === 'OL') { - console.info('insertOrderedList'); - document.execCommand('insertOrderedList', false, null); - return child.style['list-style']; - } - if (child.nodeName === 'UL') { - console.info('insertUnorderedList'); - document.execCommand('insertUnorderedList', false, null); - return child.style['list-style']; - } - if (child.parentNode) { - child = child.parentNode; - } + return + } + var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); + try { + var child = range.commonAncestorContainer.parentNode; + for (var i = 0; i < 10; i++) { + if (child.nodeName === 'OL') { + console.info('insertOrderedList'); + document.execCommand('insertOrderedList', false, null); + return child.style['list-style']; + } + if (child.nodeName === 'UL') { + console.info('insertUnorderedList'); + document.execCommand('insertUnorderedList', false, null); + return child.style['list-style']; + } + if (child.parentNode) { + child = child.parentNode; } - } catch (err) { - console.error(err); } + } catch (err) { + console.error(err); } }; @@ -106,21 +107,22 @@ RICH_EDITOR.setNumbers = function () { selection = getSelection(); } if (selection) { - var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); - try { - var child = range.commonAncestorContainer.parentNode; - for (var i = 0; i < 10; i++) { - if (child.nodeName === 'OL') { - child.style['list-style'] = 'decimal'; - break; - } - if (child.parentNode) { - child = child.parentNode; - } + return + } + var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); + try { + var child = range.commonAncestorContainer.parentNode; + for (var i = 0; i < 10; i++) { + if (child.nodeName === 'OL') { + child.style['list-style'] = 'decimal'; + break; + } + if (child.parentNode) { + child = child.parentNode; } - } catch (err) { - console.error(err); } + } catch (err) { + console.error(err); } }; @@ -136,21 +138,22 @@ RICH_EDITOR.setABC = function () { selection = getSelection(); } if (selection) { - var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); - try { - var child = range.commonAncestorContainer.parentNode; - for (var i = 0; i < 10; i++) { - if (child.nodeName === 'OL') { - child.style['list-style'] = 'lower-alpha'; - break; - } - if (child.parentNode) { - child = child.parentNode; - } + return + } + var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); + try { + var child = range.commonAncestorContainer.parentNode; + for (var i = 0; i < 10; i++) { + if (child.nodeName === 'OL') { + child.style['list-style'] = 'lower-alpha'; + break; + } + if (child.parentNode) { + child = child.parentNode; } - } catch (err) { - console.error(err); } + } catch (err) { + console.error(err); } }; @@ -166,21 +169,22 @@ RICH_EDITOR.setBullets = function () { selection = getSelection(); } if (selection) { - var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); - try { - var child = range.commonAncestorContainer.parentNode; - for (var i = 0; i < 10; i++) { - if (child.nodeName === 'UL') { - child.style['list-style'] = 'disc'; - break; - } - if (child.parentNode) { - child = child.parentNode; - } + return + } + var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); + try { + var child = range.commonAncestorContainer.parentNode; + for (var i = 0; i < 10; i++) { + if (child.nodeName === 'UL') { + child.style['list-style'] = 'disc'; + break; + } + if (child.parentNode) { + child = child.parentNode; } - } catch (err) { - console.error(err); } + } catch (err) { + console.error(err); } }; @@ -196,21 +200,22 @@ RICH_EDITOR.setSquare = function () { selection = getSelection(); } if (selection) { - var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); - try { - var child = range.commonAncestorContainer.parentNode; - for (var i = 0; i < 10; i++) { - if (child.nodeName === 'UL') { - child.style['list-style'] = 'square'; - break; - } - if (child.parentNode) { - child = child.parentNode; - } + return + } + var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); + try { + var child = range.commonAncestorContainer.parentNode; + for (var i = 0; i < 10; i++) { + if (child.nodeName === 'UL') { + child.style['list-style'] = 'square'; + break; + } + if (child.parentNode) { + child = child.parentNode; } - } catch (err) { - console.error(err); } + } catch (err) { + console.error(err); } }; -- Gitee From fc9be8bd257ff6562a2c7ab89a4dea37b414e695 Mon Sep 17 00:00:00 2001 From: nobbo Date: Wed, 7 Sep 2022 19:59:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nobbo --- common/component/src/main/ets/components/NoteContentComp.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/component/src/main/ets/components/NoteContentComp.ets b/common/component/src/main/ets/components/NoteContentComp.ets index 86c8c96..d0ab475 100644 --- a/common/component/src/main/ets/components/NoteContentComp.ets +++ b/common/component/src/main/ets/components/NoteContentComp.ets @@ -149,11 +149,11 @@ export struct NoteContentComp { } }) .zoomAccess(false) - .height('70%') + .height('88%') .width('100%') } .margin({ left: 24, right: 24 }) - .width(StyleConstants.PERCENTAGE_100) +// .width(StyleConstants.PERCENTAGE_100) .enabled(this.selectedNoteData && this.selectedNoteData.is_deleted == Delete.Yes ? false : true) .onClick(() => { this.issave = 0 -- Gitee From dad15774960613b7a46f5f9f77adb9dcb26c944f Mon Sep 17 00:00:00 2001 From: nobbo Date: Thu, 8 Sep 2022 14:25:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=96=B0SDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nobbo --- product/phone/src/main/module.json5 | 4 +++- product/phone/src/main/resources/base/element/color.json | 8 ++++++++ product/phone/src/main/resources/base/element/string.json | 4 ++++ product/tablet/src/main/module.json5 | 4 +++- product/tablet/src/main/resources/base/element/color.json | 8 ++++++++ .../tablet/src/main/resources/base/element/string.json | 4 ++++ 6 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 product/phone/src/main/resources/base/element/color.json create mode 100644 product/tablet/src/main/resources/base/element/color.json diff --git a/product/phone/src/main/module.json5 b/product/phone/src/main/module.json5 index 2f360f8..b2038c6 100644 --- a/product/phone/src/main/module.json5 +++ b/product/phone/src/main/module.json5 @@ -58,7 +58,9 @@ "action.system.home" ] } - ] + ], + "startWindowBackground": "$color:color_1", + "startWindowIcon": "$media:note" } ] } diff --git a/product/phone/src/main/resources/base/element/color.json b/product/phone/src/main/resources/base/element/color.json new file mode 100644 index 0000000..0c413af --- /dev/null +++ b/product/phone/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "color_1", + "value": "#fff" + } + ] +} \ No newline at end of file diff --git a/product/phone/src/main/resources/base/element/string.json b/product/phone/src/main/resources/base/element/string.json index 85dc25a..3650d72 100644 --- a/product/phone/src/main/resources/base/element/string.json +++ b/product/phone/src/main/resources/base/element/string.json @@ -1,5 +1,9 @@ { "string": [ + { + "name": "entry_MainAbility", + "value": "备忘录" + }, { "name": "read_media_permission", "value": "Used to read media file information in external storage of users" diff --git a/product/tablet/src/main/module.json5 b/product/tablet/src/main/module.json5 index 87ab8da..54c3fbb 100644 --- a/product/tablet/src/main/module.json5 +++ b/product/tablet/src/main/module.json5 @@ -62,7 +62,9 @@ "action.system.home" ] } - ] + ], + "startWindowBackground": "$color:color_1", + "startWindowIcon": "$media:note" } ] } diff --git a/product/tablet/src/main/resources/base/element/color.json b/product/tablet/src/main/resources/base/element/color.json new file mode 100644 index 0000000..0c413af --- /dev/null +++ b/product/tablet/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "color_1", + "value": "#fff" + } + ] +} \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/element/string.json b/product/tablet/src/main/resources/base/element/string.json index 2043623..5a03f94 100644 --- a/product/tablet/src/main/resources/base/element/string.json +++ b/product/tablet/src/main/resources/base/element/string.json @@ -1,5 +1,9 @@ { "string": [ + { + "name": "entry_MainAbility", + "value": "备忘录" + }, { "name": "read_media_permission", "value": "Used to read media file information in external storage of users" -- Gitee