diff --git a/.gitignore b/.gitignore index fd58715a10be52e996476d92986e2588d7e1bfe6..5fc64b74e0fbdc83c41aa07084e8ff6824f36419 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,10 @@ /node_modules +/oh_modules /local.properties /.idea **/build /signature /.hvigor -/package.json \ No newline at end of file +/package.json +/.clang-format +**/oh-package-lock.json5 \ No newline at end of file diff --git a/common/resources/.gitignore b/common/resources/.gitignore index a5c564ae6da6b5e2336628d9f9e2155bddfc399d..725ae7072d7e7c2ab5b266c3012221ada16e2552 100644 --- a/common/resources/.gitignore +++ b/common/resources/.gitignore @@ -1,4 +1,5 @@ /node_modules +/oh_modules /.preview /build /package.json \ No newline at end of file diff --git a/common/utils/.gitignore b/common/utils/.gitignore index a5c564ae6da6b5e2336628d9f9e2155bddfc399d..725ae7072d7e7c2ab5b266c3012221ada16e2552 100644 --- a/common/utils/.gitignore +++ b/common/utils/.gitignore @@ -1,4 +1,5 @@ /node_modules +/oh_modules /.preview /build /package.json \ No newline at end of file diff --git a/features/.gitignore b/features/.gitignore index 9924c4f298e2f709c65fd11e6020873bd6f6ae54..fd0ce92f25f87dafbd208e749d1553a9465cd461 100644 --- a/features/.gitignore +++ b/features/.gitignore @@ -1,4 +1,5 @@ /node_modules +/oh_modules /.preview /build /.cxx diff --git a/features/src/main/ets/components/NoteContentComp.ets b/features/src/main/ets/components/NoteContentComp.ets index c2be92467caaf44233e46a1def0e6993eee8cca1..6bc06a63deebbef96aa622b9b69fd9be66162e53 100644 --- a/features/src/main/ets/components/NoteContentComp.ets +++ b/features/src/main/ets/components/NoteContentComp.ets @@ -29,7 +29,7 @@ import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleCons import { EditContentDialog, DeleteDialog, EditTitleDialog } from './CusDialogComp' import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' -import prompt from '@system.prompt' +import { promptAction } from '@kit.ArkUI'; import util from '@ohos.util' import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils' @@ -256,33 +256,37 @@ export struct NoteContentComp { }) .enabled(this.sectionStatus !== 1 ? false : true) .onPageEnd((e) => { - if (this.dpi <= 240) { - this.controllerShow.runJavaScript("changeSizeToRk()") - } else if (this.dpi <= 320 && this.dpi > 240) { - this.controllerShow.runJavaScript("changeSizeToPhone()") - } else { - this.controllerShow.runJavaScript("changeSizeToTablet()") - } - if (AppStorage.Get('breakPoint') !== 'sm') { - this.controllerShow.runJavaScript("hiddenButton()") - } - LogUtil.info(TAG, "finish loadurl") - if (this.selectedNoteData) { - let self = this - this.controllerShow.runJavaScript( - "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')", - () => { - // wait for the image in the note to load - setTimeout(() => { - self.restoreScrollTop() - self.restoreFocus() - }, 100) - } - ) - } - // 初次加载为为小屏预览模式 - if (this.sectionStatus != 1) { - this.controllerShow.runJavaScript("RICH_EDITOR.setInputEnabled(false)") + try { + if (this.dpi <= 240) { + this.controllerShow.runJavaScript("changeSizeToRk()") + } else if (this.dpi <= 320 && this.dpi > 240) { + this.controllerShow.runJavaScript("changeSizeToPhone()") + } else { + this.controllerShow.runJavaScript("changeSizeToTablet()") + } + if (AppStorage.Get('breakPoint') !== 'sm') { + this.controllerShow.runJavaScript("hiddenButton()") + } + LogUtil.info(TAG, "finish loadurl") + if (this.selectedNoteData) { + let self = this + this.controllerShow.runJavaScript( + "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')", + () => { + // wait for the image in the note to load + setTimeout(() => { + self.restoreScrollTop() + self.restoreFocus() + }, 100) + } + ) + } + // 初次加载为为小屏预览模式 + if (this.sectionStatus != 1) { + this.controllerShow.runJavaScript("RICH_EDITOR.setInputEnabled(false)") + } + } catch (error) { + LogUtil.info(TAG, `runJavaScript onPageEnd error. code:${JSON.stringify(error.code)},message:${error.message}`); } }) .imageAccess(true) @@ -636,7 +640,7 @@ export struct ToolBarComp { if (error != null) { LogUtil.error(TAG, "error is " + error); } else { - prompt.showToast({ message: value, duration: 2000 }); + promptAction.showToast({ message: value, duration: 2000 }); } }); this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) diff --git a/features/src/main/ets/components/NoteContentCompPortrait.ets b/features/src/main/ets/components/NoteContentCompPortrait.ets index 1f1e874250894d7c028c08976deebfa5f74680b6..1eb3eb713cb1ff49e25bcdbb5f4d797d9f9c4d66 100644 --- a/features/src/main/ets/components/NoteContentCompPortrait.ets +++ b/features/src/main/ets/components/NoteContentCompPortrait.ets @@ -30,7 +30,7 @@ import StyleConstants from '@ohos/utils/src/main/ets/default/constants/StyleCons import { EditContentDialogPortrait, DeleteDialog, EditTitleDialog } from './CusDialogComp' import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' -import prompt from '@system.prompt' +import { promptAction } from '@kit.ArkUI'; import { LogUtil } from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil' import OperationUtils from '@ohos/utils/src/main/ets/default/baseUtil/OperationUtils' import router from '@system.router' @@ -792,7 +792,7 @@ export struct DeleteNoteComp { if (error != null) { LogUtil.error(TAG, 'error is' + error); } else { - prompt.showToast({ message: value, duration: 2000 }); + promptAction.showToast({ message: value, duration: 2000 }); } }); this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) diff --git a/features/src/main/ets/components/NoteListComp.ets b/features/src/main/ets/components/NoteListComp.ets index 1bedca4fa474d3109d2da1700ad0e62ce77e0a42..8621e93d106a50f8d1bce0a6031f9ba8a0b0f08e 100644 --- a/features/src/main/ets/components/NoteListComp.ets +++ b/features/src/main/ets/components/NoteListComp.ets @@ -28,7 +28,7 @@ import { } from '@ohos/utils/src/main/ets/default/model/databaseModel/EnumData'; import { NoteDataMoveDialog, DeleteDialog } from './CusDialogComp' import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil' -import prompt from '@system.prompt' +import { promptAction } from '@kit.ArkUI'; import NoteUtil from '@ohos/utils/src/main/ets/default/baseUtil/NoteUtil' import FolderUtil from '@ohos/utils/src/main/ets/default/baseUtil/FolderUtil' import SearchModel from '@ohos/utils/src/main/ets/default/model/searchModel/SearchModel' @@ -812,7 +812,7 @@ export struct OperateNoteComp { if (error != null) { LogUtil.error(TAG, "error is " + error); } else { - prompt.showToast({ message: value, duration: 2000 }); + promptAction.showToast({ message: value, duration: 2000 }); } }); // update note to db @@ -881,9 +881,14 @@ export struct AddNoteComp { this.selectedNoteData = noteData AppStorage.SetOrCreate('NewNote', noteData) if (this.portraitModel == false) { - this.controllerShow.runJavaScript( - "RICH_EDITOR.setHtml('" + this.selectedNoteData?.content_text + "')" - ) + try { + this.controllerShow.runJavaScript( + "RICH_EDITOR.setHtml('" + this.selectedNoteData?.content_text + "')" + ) + } catch (error) { + LogUtil.error(TAG, `runJavaScript setHtml content_text failed. + code:${JSON.stringify(error.code)},message:${JSON.stringify(error.message)}`); + } } if (this.portraitModel == true) { this.editModel = true @@ -1176,7 +1181,7 @@ export struct OperateNoteCompForPortrait { if (error != null) { LogUtil.error(TAG, "error is " + error); } else { - prompt.showToast({ message: value, duration: 2000 }); + promptAction.showToast({ message: value, duration: 2000 }); } }); // update note to db diff --git a/product/default/.gitignore b/product/default/.gitignore index a5c564ae6da6b5e2336628d9f9e2155bddfc399d..725ae7072d7e7c2ab5b266c3012221ada16e2552 100644 --- a/product/default/.gitignore +++ b/product/default/.gitignore @@ -1,4 +1,5 @@ /node_modules +/oh_modules /.preview /build /package.json \ No newline at end of file