From d133db4ce7c1aa234473f6121b4418cd635ca1b5 Mon Sep 17 00:00:00 2001 From: guozejun Date: Tue, 24 May 2022 11:31:33 +0800 Subject: [PATCH 1/2] fix permission request problem on release branch Signed-off-by: guozejun --- .../src/main/ets/components/CusDialogComp.ets | 7 +- .../main/ets/components/FolderListComp.ets | 2 +- .../components/NoteContentCompPortrait.ets | 46 ++++- .../src/main/ets/components/NoteListComp.ets | 4 +- .../main/resources/base/element/string.json | 2 +- .../main/resources/rawfile/editor_style.css | 2 +- .../main/resources/zh_CN/element/string.json | 12 -- .../ets/default/baseUtil/RdbStoreUtil.ets | 51 +++-- .../main/resources/base/element/color.json | 184 ------------------ .../main/resources/base/element/string.json | 164 ---------------- .../main/resources/en_US/element/string.json | 164 ---------------- .../main/resources/zh_CN/element/string.json | 164 ---------------- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../src/main/ets/MainAbility/MainAbility.ts | 2 +- .../tablet/src/main/ets/pages/NoteHome.ets | 7 - product/tablet/src/main/module.json5 | 14 ++ 16 files changed, 87 insertions(+), 740 deletions(-) delete mode 100644 product/pc/src/main/resources/base/element/color.json delete mode 100644 product/pc/src/main/resources/base/element/string.json delete mode 100644 product/pc/src/main/resources/en_US/element/string.json delete mode 100644 product/pc/src/main/resources/zh_CN/element/string.json diff --git a/common/component/src/main/ets/components/CusDialogComp.ets b/common/component/src/main/ets/components/CusDialogComp.ets index 82e011f..03bcf2d 100644 --- a/common/component/src/main/ets/components/CusDialogComp.ets +++ b/common/component/src/main/ets/components/CusDialogComp.ets @@ -22,7 +22,6 @@ import { circleColorArray, fontColorArray, SysDefFolderUuid, DeleteFileType, Fol const TAG = "CusDialogComp" -const TAG = "CusDialogComp" @CustomDialog export struct NewOrEditFolderDialog { newOrEditFolderDialogCtl: CustomDialogController @@ -193,14 +192,14 @@ export struct DeleteDialog { .textAlign(TextAlign.Center) .maxLines(1) .visibility(this.multiSelect == false || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible) - } else if (this.CheckedNoteArray.length == 1) { - Text($r("app.string.deleteNote")) + } else if (this.CheckedNoteArray.length > 1){ + Text($r("app.string.deletePartNote", this.CheckedNoteArray.length)) .fontSize(14) .textAlign(TextAlign.Center) .maxLines(1) .visibility(this.multiSelect == false || this.selectedFolderData.uuid == SysDefFolderUuid.RecentDeletes ? Visibility.None : Visibility.Visible) } else { - Text($r("app.string.deletePartNote", this.CheckedNoteArray.length)) + Text($r("app.string.deleteNote")) .fontSize(14) .textAlign(TextAlign.Center) .maxLines(1) diff --git a/common/component/src/main/ets/components/FolderListComp.ets b/common/component/src/main/ets/components/FolderListComp.ets index 52062cf..df97271 100644 --- a/common/component/src/main/ets/components/FolderListComp.ets +++ b/common/component/src/main/ets/components/FolderListComp.ets @@ -55,7 +55,7 @@ export struct FolderListComp { .margin({ top: 28 }) .padding({ left: 24 }) - NoteAndCreateComp() + NoteAndCreateComp() // center List() { ForEach(this.AllFolderArray, (folderItem: FolderData) => { diff --git a/common/component/src/main/ets/components/NoteContentCompPortrait.ets b/common/component/src/main/ets/components/NoteContentCompPortrait.ets index 0666b23..c0cce27 100644 --- a/common/component/src/main/ets/components/NoteContentCompPortrait.ets +++ b/common/component/src/main/ets/components/NoteContentCompPortrait.ets @@ -34,6 +34,14 @@ var time_id: number const TAG = "NoteContentCompPortrait" +async function routePage() { + try { + await router.back() + } catch (err) { + LogUtil.info(TAG, "fail callback") + } +} + // Note content component @Component export struct NoteContentCompPortrait { @@ -75,7 +83,6 @@ export struct NoteContentCompPortrait { AppStorage.SetOrCreate('ContinueNote', continueNote) LogUtil.info(TAG, 'callbackScheduledSave, set continue note success') } - } build() { @@ -118,11 +125,6 @@ export struct NoteContentCompPortrait { }, 3000) LogUtil.info(TAG, "setInterval time_id : " + time_id) this.editModel = true - // 添加定时器:3s自动保存 - timeId = setInterval(() => { - this.controllerShow.runJavaScript({ script: "scheduled_save_content()" }) - }, 3000) - LogUtil.info(TAG, "NoteContentCompPortrait, setInterval timeId : " + timeId) }) .margin({ top: 16 }) .width(StyleConstants.PERCENTAGE_100) @@ -256,6 +258,32 @@ export struct ToolBarComp { @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') controllerShow: WebController + onDeleteConfirm() { + if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) { + this.selectedNoteData.is_deleted = Delete.Yes + this.selectedNoteData.deleted_time = new Date().getTime() + // update note to db + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) + routePage() + } else { + NoteUtil.removeNoteData(this.AllNoteArray, this.selectedNoteData.uuid) + // delete note from db + let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) + predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) + RdbStoreUtil.delete(predicates_note, null) + routePage() + } + } + + noteDataDeleteDialogCtl: CustomDialogController = new CustomDialogController({ + builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this), multiSelect: true }), + alignment: DialogAlignment.Bottom, + autoCancel: false, + customStyle: true, + }) + build() { Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { @@ -292,7 +320,11 @@ export struct ToolBarComp { AppStorage.SetOrCreate('ContinueNote', continueNote) LogUtil.info(TAG, 'ToolBarComp, set continue note success') }) - }.width(36) + Image($r('app.media.delete')).height(24).width(24) + .onClick(()=>{ + this.noteDataDeleteDialogCtl.open() + }) + }.width(72) .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) } else { Row({ space: StyleConstants.SPACE_6 }) { diff --git a/common/component/src/main/ets/components/NoteListComp.ets b/common/component/src/main/ets/components/NoteListComp.ets index 15478a1..7729992 100644 --- a/common/component/src/main/ets/components/NoteListComp.ets +++ b/common/component/src/main/ets/components/NoteListComp.ets @@ -292,7 +292,6 @@ export struct NoteItemComp { } else { this.selectedNoteData = this.noteItem this.chooseNote = true - AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) // save continue data let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) @@ -652,7 +651,6 @@ export struct AddNoteComp { this.editModel = true } this.chooseNote = true - AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) // save continue data let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) AppStorage.SetOrCreate('ContinueNote', continueNote) @@ -892,7 +890,7 @@ export struct OperateNoteCompForPortrait { this.CheckedNoteArray.forEach((noteItem) => { noteItem.is_deleted = Delete.No noteItem.deleted_time = 0 - prompt.showToast({ message: $r('app.string.restore').toString(), duration: 2000 }) + prompt.showToast({ message: $r('app.string.restore'), duration: 2000 }) // update note to db let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) predicates_note.equalTo(NoteTableColumn.Uuid, noteItem.uuid) diff --git a/common/resources/src/main/resources/base/element/string.json b/common/resources/src/main/resources/base/element/string.json index 8ac0103..5220352 100644 --- a/common/resources/src/main/resources/base/element/string.json +++ b/common/resources/src/main/resources/base/element/string.json @@ -98,7 +98,7 @@ }, { "name": "searchNote", - "value": "搜索笔记..." + "value": "搜索笔记" }, { "name": "chooseFolder", diff --git a/common/resources/src/main/resources/rawfile/editor_style.css b/common/resources/src/main/resources/rawfile/editor_style.css index 234d8f2..06b9eb8 100644 --- a/common/resources/src/main/resources/rawfile/editor_style.css +++ b/common/resources/src/main/resources/rawfile/editor_style.css @@ -14,7 +14,7 @@ */ html { - height: 15%; + height: 100%; font-family: sans-serif; -webkit-text-size-adjust: 100%; } diff --git a/common/resources/src/main/resources/zh_CN/element/string.json b/common/resources/src/main/resources/zh_CN/element/string.json index 5220352..d8cc164 100644 --- a/common/resources/src/main/resources/zh_CN/element/string.json +++ b/common/resources/src/main/resources/zh_CN/element/string.json @@ -159,18 +159,6 @@ { "name": "restore", "value": "已恢复" - }, - { - "name": "per_read_media", - "value": "是否允许备忘录访问媒体资源" - }, - { - "name": "per_get_bundleInfo", - "value": "是否允许备忘录打开图库资源" - }, - { - "name": "per_dis_dataSync", - "value": "是否允许备忘录流转到其它设备" } ] } \ No newline at end of file diff --git a/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets b/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets index 8b2f934..8d78324 100644 --- a/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets +++ b/common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets @@ -30,7 +30,6 @@ const FileMaxSize: number = 20 * 1024 * 1024 /** * db instance */ -var rdbStore = undefined export default { /** @@ -40,27 +39,27 @@ export default { ohosDataRdb.getRdbStore(context, SysDefData.dbInfo.db_name, SysDefData.dbInfo.db_verison) .then(async (store) => { LogUtil.info(TAG, "createRdbStore, store is " + store) - rdbStore = store + globalThis.rdbStore = store // create table - await rdbStore.executeSql(TableSql.FolderTableSQL, null) - await rdbStore.executeSql(TableSql.NoteTableSQL, null) - await rdbStore.executeSql(TableSql.AttachmentTableSQL, null) - await rdbStore.executeSql(TableSql.FormTableSQL, null) + await globalThis.rdbStore.executeSql(TableSql.FolderTableSQL, null) + await globalThis.rdbStore.executeSql(TableSql.NoteTableSQL, null) + await globalThis.rdbStore.executeSql(TableSql.AttachmentTableSQL, null) + await globalThis.rdbStore.executeSql(TableSql.FormTableSQL, null) LogUtil.info(TAG, "create table success") // insert system defined folder - await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_allNotes) - await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_unClassified) - await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_myFavorites) - await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_recentDeletes) - await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_personal) - await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_life) - await rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_work) + await globalThis.rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_allNotes) + await globalThis.rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_unClassified) + await globalThis.rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_myFavorites) + await globalThis.rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_recentDeletes) + await globalThis.rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_personal) + await globalThis.rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_life) + await globalThis.rdbStore.insert(TableName.FolderTable, SysDefData.sys_def_work) LogUtil.info(TAG, "insert system defined folder success") // insert system defined note and attachment - await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note1) - await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note2) - await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note3) - await rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note4) + await globalThis.rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note1) + await globalThis.rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note2) + await globalThis.rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note3) + await globalThis.rdbStore.insert(TableName.NoteTable, SysDefData.sys_def_note4) LogUtil.info(TAG, "insert system defined note and attachment success") // add sys-def folder and note to AppStorage @@ -172,11 +171,11 @@ export default { ohosDataRdb.getRdbStore(context, SysDefData.dbInfo.db_name, SysDefData.dbInfo.db_verison) .then(async (store) => { LogUtil.info(TAG, "initAppStorage, store is " + store) - rdbStore = store + globalThis.rdbStore = store // query folder let columns_folder = [] let predicates_folder = new ohosDataRdb.RdbPredicates(TableName.FolderTable) - let resultSet_folder = await rdbStore.query(predicates_folder, columns_folder) + let resultSet_folder = await globalThis.rdbStore.query(predicates_folder, columns_folder) while (resultSet_folder.goToNextRow()) { let id = resultSet_folder.getLong(resultSet_folder.getColumnIndex(FolderTableColumn.Id)) let name = resultSet_folder.getString(resultSet_folder.getColumnIndex(FolderTableColumn.Name)) @@ -193,7 +192,7 @@ export default { // query note let columns_note = [] let predicates_note = new ohosDataRdb.RdbPredicates(TableName.NoteTable) - let resultSet_note = await rdbStore.query(predicates_note, columns_note) + let resultSet_note = await globalThis.rdbStore.query(predicates_note, columns_note) while (resultSet_note.goToNextRow()) { let id = resultSet_note.getLong(resultSet_note.getColumnIndex(NoteTableColumn.Id)) let title = resultSet_note.getString(resultSet_note.getColumnIndex(NoteTableColumn.Title)) @@ -286,7 +285,7 @@ export default { LogUtil.info(TAG, "initAppStorage, set DBQueryFinished 1") }) .catch((err) => { - LogUtil.warn(TAG, "initAppStorage, error : " + err) + LogUtil.error(TAG, "initAppStorage, error : " + err) }) }, @@ -381,7 +380,7 @@ export default { * @param callback */ insert(tableName, valueBucket, callback) { - rdbStore.insert(tableName, valueBucket).then((rowId) => { + globalThis.rdbStore.insert(tableName, valueBucket).then((rowId) => { LogUtil.info(TAG, "insert success, rowId is " + rowId) if (callback != null) { callback(rowId) @@ -397,7 +396,7 @@ export default { * @param callback */ delete(predicates, callback) { - rdbStore.delete(predicates).then((affectedRowCount) => { + globalThis.rdbStore.delete(predicates).then((affectedRowCount) => { LogUtil.info(TAG, "delete success, affectedRowCount is " + affectedRowCount) if (callback != null) { callback(affectedRowCount) @@ -414,10 +413,10 @@ export default { * @param callback */ update(valueBucket, predicates, callback) { - if (!rdbStore) { + if (!globalThis.rdbStore) { return; } - rdbStore.update(valueBucket, predicates).then((affectedRowCount) => { + globalThis.rdbStore.update(valueBucket, predicates).then((affectedRowCount) => { LogUtil.info(TAG, "update success, affectedRowCount is " + affectedRowCount) if (callback != null) { callback(affectedRowCount) @@ -434,7 +433,7 @@ export default { * @param callback */ query(columns, predicates, callback) { - rdbStore.query(predicates, columns).then((resultSet) => { + globalThis.rdbStore.query(predicates, columns).then((resultSet) => { LogUtil.info(TAG, "query success, row count : " + resultSet.rowCount) if (callback != null) { callback(resultSet) diff --git a/product/pc/src/main/resources/base/element/color.json b/product/pc/src/main/resources/base/element/color.json deleted file mode 100644 index 02771c3..0000000 --- a/product/pc/src/main/resources/base/element/color.json +++ /dev/null @@ -1,184 +0,0 @@ -{ - "color": [ - { - "name": "color_ffffff", - "value": "#ffffff" - }, - { - "name": "delete_color_fa2a2d", - "value": "#fa2a2d" - }, - { - "name": "cancel_color_4fb4e3", - "value": "#4fb4e3" - }, - { - "name": "divider_color_e4e4e4", - "value": "#cce4e4e4" - }, - { - "name": "divider_color_182431", - "value": "#182431" - }, - { - "name": "button_color_419fff", - "value": "#419fff" - }, - { - "name": "button_color_fb4447", - "value": "#fb4447" - }, - { - "name": "text_color_3f97e9", - "value": "#3f97e9" - }, - { - "name": "text_color_f86d05", - "value": "#f86d05" - }, - { - "name": "folder_color_182431", - "value": "#182431" - }, - { - "name": "folder_color_f86d05", - "value": "#f86d05" - }, - { - "name": "folder_color_ffffff", - "value": "#ffffff" - }, - { - "name": "folder_color_19ffffff", - "value": "#19ffffff" - }, - { - "name": "folder_color_19182431", - "value": "#19182431" - }, - { - "name": "notecontent_color_ffffff", - "value": "#ffffff" - }, - { - "name": "notecontent_color_000000", - "value": "#000000" - }, - { - "name": "folderlist_bgcolor_f1f3f5", - "value": "#f1f3f5" - }, - { - "name": "notelist_bgcolor_f1f3f5", - "value": "#f1f3f5" - }, - { - "name": "notelist_bgcolor_000000", - "value": "#000000" - }, - { - "name": "New_folder_input_box_color", - "value": "#ffffff" - }, - { - "name": "category_already_exist_font_color", - "value": "#FA2A2D" - }, - { - "name": "create_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "delete_note_bg_color", - "value": "#FFFFFF" - }, - { - "name": "choose_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "title_input_bg_color", - "value": "#FFFFFF" - }, - { - "name": "Edit_title_bg_color", - "value": "#FFFFFF" - }, - { - "name": "press_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "modified_time_font_color", - "value": "#A3A7AD" - }, - { - "name": "delete_font_color", - "value": "#182431" - }, - { - "name": "recover_font_color", - "value": "#182431" - }, - { - "name": "list_font_color", - "value": "#182431" - }, - { - "name": "style_font_color", - "value": "#182431" - }, - { - "name": "photo_font_color", - "value": "#182431" - }, - { - "name": "all_notes_font_color", - "value": "#182431" - }, - { - "name": "num_of_notes_font_color", - "value": "#A3A7AD" - }, - { - "name": "note_selected_font_color", - "value": "#182431" - }, - { - "name": "note_title_font_color", - "value": "#182431" - }, - { - "name": "note_title_font_color_blue", - "value": "#0000ff" - }, - { - "name": "list_modified_time_font_color", - "value": "#99182431" - }, - { - "name": "Recently_delete_prompt_font_color", - "value": "#18181A" - }, - { - "name": "Empty_page_font_color", - "value": "#A3A7AD" - }, - { - "name": "search_note_caret_color", - "value": "#F86D05" - }, - { - "name": "set_top_font_color", - "value": "#182431" - }, - { - "name": "move_font_color", - "value": "#182431" - }, - { - "name": "check_all_font_color", - "value": "#182431" - } - ] -} \ No newline at end of file diff --git a/product/pc/src/main/resources/base/element/string.json b/product/pc/src/main/resources/base/element/string.json deleted file mode 100644 index 8ed957f..0000000 --- a/product/pc/src/main/resources/base/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "备忘录" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "note", - "value": "笔记" - }, - { - "name": "allNotes", - "value": "全部笔记" - }, - { - "name": "unClassified", - "value": "未分类" - }, - { - "name": "recentDeletes", - "value": "最近删除" - }, - { - "name": "myFavorites", - "value": "我的收藏" - }, - { - "name": "create", - "value": "新建" - }, - { - "name": "createFolder", - "value": "新建文件夹" - }, - { - "name": "editFolder", - "value": "编辑文件夹" - }, - { - "name": "deleteFolder", - "value": "删除文件夹" - }, - { - "name": "createNote", - "value": "新建笔记" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "save", - "value": "保存" - }, - { - "name": "delete", - "value": "删除" - }, - { - "name": "delete_tips", - "value": "是否删除此文件夹及其中的内容?" - }, - { - "name": "deleteNote", - "value": "是否删除此笔记?" - }, - { - "name": "deleteNoteComplete", - "value": "此笔记将被永久删除,无法恢复。是否删除?" - }, - { - "name": "deleteAllNote", - "value": "是否删除全部笔记?" - }, - { - "name": "deletePartNote", - "value": "是否删除%d条笔记?" - }, - { - "name": "selected", - "value": "已选择%d项" - }, - { - "name": "none_selected", - "value": "未选择" - }, - { - "name": "noteslist", - "value": "条笔记" - }, - { - "name": "Empty_page", - "value": "没有笔记" - }, - { - "name": "searchNote", - "value": "搜索笔记..." - }, - { - "name": "chooseFolder", - "value": "请选择文件夹" - }, - { - "name": "category_already_exist", - "value": "文件夹名称已存在" - }, - { - "name": "input_placeholder", - "value": "名称" - }, - { - "name": "permanently_delete_tips", - "value": "笔记删除前会显示剩余天数(最长30天),之后将永久删除" - }, - { - "name": "set_top", - "value": "置顶" - }, - { - "name": "move", - "value": "移到" - }, - { - "name": "recover", - "value": "恢复" - }, - { - "name": "check_all", - "value": "多选" - }, - { - "name": "editNoteTitle", - "value": "修改标题" - }, - { - "name": "list", - "value": "清单" - }, - { - "name": "style", - "value": "样式" - }, - { - "name": "photo", - "value": "相册" - }, - { - "name": "title", - "value": "标题" - }, - { - "name": "empty_note", - "value": "笔记内容为空" - }, - { - "name": "restore", - "value": "已恢复" - } - ] -} \ No newline at end of file diff --git a/product/pc/src/main/resources/en_US/element/string.json b/product/pc/src/main/resources/en_US/element/string.json deleted file mode 100644 index 8529f1b..0000000 --- a/product/pc/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "Notepad" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "note", - "value": "Notes" - }, - { - "name": "allNotes", - "value": "All notes" - }, - { - "name": "unClassified", - "value": "No category" - }, - { - "name": "recentDeletes", - "value": "Recently deleted" - }, - { - "name": "myFavorites", - "value": "My favourites" - }, - { - "name": "create", - "value": "NEW" - }, - { - "name": "createFolder", - "value": "New Folder" - }, - { - "name": "editFolder", - "value": "Edit Folder" - }, - { - "name": "deleteFolder", - "value": "Delete Folder" - }, - { - "name": "createNote", - "value": "New note" - }, - { - "name": "cancel", - "value": "CANCEL" - }, - { - "name": "save", - "value": "SAVE" - }, - { - "name": "delete", - "value": "DELETE" - }, - { - "name": "delete_tips", - "value": "Do you want to delete this folder and its contents?" - }, - { - "name": "deleteNote", - "value": "Delete this note?" - }, - { - "name": "deleteNoteComplete", - "value": "Permanently delete this note?" - }, - { - "name": "deleteAllNote", - "value": "Delete all note?" - }, - { - "name": "deletePartNote", - "value": "Delete %d notes?" - }, - { - "name": "selected", - "value": "%d item selected" - }, - { - "name": "none_selected", - "value": "None selected" - }, - { - "name": "noteslist", - "value": "notes" - }, - { - "name": "Empty_page", - "value": "No notes" - }, - { - "name": "searchNote", - "value": "Search notes" - }, - { - "name": "chooseFolder", - "value": "Select folder" - }, - { - "name": "category_already_exist", - "value": "The folder name already exists." - }, - { - "name": "input_placeholder", - "value": "Name" - }, - { - "name": "permanently_delete_tips", - "value": "notes will be permanently deleted after the number of days shown (up to 30 days)." - }, - { - "name": "set_top", - "value": "Top" - }, - { - "name": "move", - "value": "Move" - }, - { - "name": "recover", - "value": "Restore" - }, - { - "name": "check_all", - "value": "Select all" - }, - { - "name": "editNoteTitle", - "value": "Modify the title" - }, - { - "name": "list", - "value": "Checklist" - }, - { - "name": "style", - "value": "Style" - }, - { - "name": "photo", - "value": "Gallery" - }, - { - "name": "title", - "value": "Title" - }, - { - "name": "empty_note", - "value": "The note content is empty." - }, - { - "name": "restore", - "value": "Note Restored" - } - ] -} \ No newline at end of file diff --git a/product/pc/src/main/resources/zh_CN/element/string.json b/product/pc/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 8ed957f..0000000 --- a/product/pc/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "备忘录" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "note", - "value": "笔记" - }, - { - "name": "allNotes", - "value": "全部笔记" - }, - { - "name": "unClassified", - "value": "未分类" - }, - { - "name": "recentDeletes", - "value": "最近删除" - }, - { - "name": "myFavorites", - "value": "我的收藏" - }, - { - "name": "create", - "value": "新建" - }, - { - "name": "createFolder", - "value": "新建文件夹" - }, - { - "name": "editFolder", - "value": "编辑文件夹" - }, - { - "name": "deleteFolder", - "value": "删除文件夹" - }, - { - "name": "createNote", - "value": "新建笔记" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "save", - "value": "保存" - }, - { - "name": "delete", - "value": "删除" - }, - { - "name": "delete_tips", - "value": "是否删除此文件夹及其中的内容?" - }, - { - "name": "deleteNote", - "value": "是否删除此笔记?" - }, - { - "name": "deleteNoteComplete", - "value": "此笔记将被永久删除,无法恢复。是否删除?" - }, - { - "name": "deleteAllNote", - "value": "是否删除全部笔记?" - }, - { - "name": "deletePartNote", - "value": "是否删除%d条笔记?" - }, - { - "name": "selected", - "value": "已选择%d项" - }, - { - "name": "none_selected", - "value": "未选择" - }, - { - "name": "noteslist", - "value": "条笔记" - }, - { - "name": "Empty_page", - "value": "没有笔记" - }, - { - "name": "searchNote", - "value": "搜索笔记..." - }, - { - "name": "chooseFolder", - "value": "请选择文件夹" - }, - { - "name": "category_already_exist", - "value": "文件夹名称已存在" - }, - { - "name": "input_placeholder", - "value": "名称" - }, - { - "name": "permanently_delete_tips", - "value": "笔记删除前会显示剩余天数(最长30天),之后将永久删除" - }, - { - "name": "set_top", - "value": "置顶" - }, - { - "name": "move", - "value": "移到" - }, - { - "name": "recover", - "value": "恢复" - }, - { - "name": "check_all", - "value": "多选" - }, - { - "name": "editNoteTitle", - "value": "修改标题" - }, - { - "name": "list", - "value": "清单" - }, - { - "name": "style", - "value": "样式" - }, - { - "name": "photo", - "value": "相册" - }, - { - "name": "title", - "value": "标题" - }, - { - "name": "empty_note", - "value": "笔记内容为空" - }, - { - "name": "restore", - "value": "已恢复" - } - ] -} \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/MainAbility.ts b/product/phone/src/main/ets/MainAbility/MainAbility.ts index a950d37..ada4b82 100644 --- a/product/phone/src/main/ets/MainAbility/MainAbility.ts +++ b/product/phone/src/main/ets/MainAbility/MainAbility.ts @@ -17,7 +17,7 @@ import Ability from '@ohos.application.Ability' import AbilityConstant from '@ohos.application.AbilityConstant' import fileio from '@ohos.fileio' import inputMethod from '@ohos.inputmethod' - +globalThis.rdbStore = undefined export default class MainAbility extends Ability { private Tag = "MainAbility_Phone" diff --git a/product/tablet/src/main/ets/MainAbility/MainAbility.ts b/product/tablet/src/main/ets/MainAbility/MainAbility.ts index 746b8cf..c60c19e 100644 --- a/product/tablet/src/main/ets/MainAbility/MainAbility.ts +++ b/product/tablet/src/main/ets/MainAbility/MainAbility.ts @@ -17,7 +17,7 @@ import Ability from '@ohos.application.Ability' import AbilityConstant from '@ohos.application.AbilityConstant' import fileio from '@ohos.fileio' import inputMethod from '@ohos.inputmethod'; - +globalThis.rdbStore = undefined export default class MainAbility extends Ability { private Tag = "MainAbility_Tablet" diff --git a/product/tablet/src/main/ets/pages/NoteHome.ets b/product/tablet/src/main/ets/pages/NoteHome.ets index 1e086b5..b800fa2 100644 --- a/product/tablet/src/main/ets/pages/NoteHome.ets +++ b/product/tablet/src/main/ets/pages/NoteHome.ets @@ -62,13 +62,6 @@ export struct NoteHomeComp { } } - narrowWinListener = mediaquery.matchMediaSync('(width < 2000)') - onWinSizeChange(mediaQueryResult) { - if (this.sectionStatus != 1) { - this.sectionStatus = (mediaQueryResult.matches) ? 2 : 3 - } - } - build() { Flex({ justifyContent: FlexAlign.Start }) { // Folder list display area diff --git a/product/tablet/src/main/module.json5 b/product/tablet/src/main/module.json5 index 4199e51..3bba09c 100644 --- a/product/tablet/src/main/module.json5 +++ b/product/tablet/src/main/module.json5 @@ -23,6 +23,20 @@ "deviceTypes": [ "tablet" ], + "requestPermissions": [ + { + "name": "ohos.permission.READ_MEDIA" + }, + { + "name": "ohos.permission.WRITE_MEDIA" + }, + { + "name": "ohos.permission.MEDIA_LOCATION" + }, + { + "name": "ohos.permission.DISTRIBUTED_DATASYNC" + }, + ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", -- Gitee From 2c63197e9553fa6465728c566bd9ff2534d8bfe8 Mon Sep 17 00:00:00 2001 From: guozejun Date: Tue, 24 May 2022 15:09:16 +0800 Subject: [PATCH 2/2] remove old files Signed-off-by: guozejun --- .../src/main/ets/default/NoteContentComp.ets | 577 ------------------ product/phone/src/main/config.json | 86 --- .../src/main/ets/MainAbility/WebViewUtil.ets | 35 -- .../phone/src/main/ets/MainAbility/app.ets | 32 - .../main/ets/MainAbility/pages/MyNoteHome.ets | 101 --- .../main/resources/base/element/color.json | 200 ------ .../main/resources/en_US/element/string.json | 164 ----- .../src/main/resources/rawfile/rich_editor.js | 283 --------- .../main/resources/zh_CN/element/string.json | 164 ----- product/tablet/src/main/config.json | 86 --- .../src/main/ets/MainAbility/WebViewUtil.ets | 35 -- .../tablet/src/main/ets/MainAbility/app.ets | 32 - .../main/ets/MainAbility/pages/MyNoteHome.ets | 102 ---- .../main/resources/base/element/color.json | 200 ------ .../src/main/resources/base/media/search.svg | 13 - .../main/resources/en_US/element/string.json | 164 ----- .../main/resources/rawfile/editor_style.css | 89 --- .../main/resources/zh_CN/element/string.json | 164 ----- 18 files changed, 2527 deletions(-) delete mode 100644 common/component/src/main/ets/default/NoteContentComp.ets delete mode 100644 product/phone/src/main/config.json delete mode 100644 product/phone/src/main/ets/MainAbility/WebViewUtil.ets delete mode 100644 product/phone/src/main/ets/MainAbility/app.ets delete mode 100644 product/phone/src/main/ets/MainAbility/pages/MyNoteHome.ets delete mode 100644 product/phone/src/main/resources/base/element/color.json delete mode 100644 product/phone/src/main/resources/en_US/element/string.json delete mode 100644 product/phone/src/main/resources/rawfile/rich_editor.js delete mode 100644 product/phone/src/main/resources/zh_CN/element/string.json delete mode 100644 product/tablet/src/main/config.json delete mode 100644 product/tablet/src/main/ets/MainAbility/WebViewUtil.ets delete mode 100644 product/tablet/src/main/ets/MainAbility/app.ets delete mode 100644 product/tablet/src/main/ets/MainAbility/pages/MyNoteHome.ets delete mode 100644 product/tablet/src/main/resources/base/element/color.json delete mode 100644 product/tablet/src/main/resources/base/media/search.svg delete mode 100644 product/tablet/src/main/resources/en_US/element/string.json delete mode 100644 product/tablet/src/main/resources/rawfile/editor_style.css delete mode 100644 product/tablet/src/main/resources/zh_CN/element/string.json diff --git a/common/component/src/main/ets/default/NoteContentComp.ets b/common/component/src/main/ets/default/NoteContentComp.ets deleted file mode 100644 index 99bb279..0000000 --- a/common/component/src/main/ets/default/NoteContentComp.ets +++ /dev/null @@ -1,577 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import DateUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/DateUtil.ets' -import RdbStoreUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets' -import FolderData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/FolderData.ets' -import NoteData from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/NoteData.ets' -import {TableName, NoteTableColumn, SysDefFolderUuid, Favorite, Delete} from '../../../../../../common/utils/src/main/ets/default/model/databaseModel/EnumData.ets' -import StyleConstants from '../../../../../../common/utils/src/main/ets/default/constants/StyleConstants.ets' -import {EditContentDialog, DeleteDialog, EditTitleDialog} from './CusDialogComp.ets' -import FolderUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/FolderUtil.ets' -import NoteUtil from '../../../../../../common/utils/src/main/ets/default/baseUtil/NoteUtil.ets' -import prompt from '@system.prompt' -import featureAbility from '@ohos.ability.featureAbility' -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' -import OperationUtils from '../../../../../../common/utils/src/main/ets/default/baseUtil/OperationUtils.ets' -import mediaquery from '@ohos.mediaquery' - -const TAG = "NoteContentComp" - -var timeId : number - -// Note content component -@Component -export struct NoteContentComp { - @Consume('SelectedNoteData') selectedNoteData: NoteData - @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') - @Consume('SelectedFolderData') selectedFolderData: FolderData - @Consume('RefreshFlag') refreshFlag: number - @Consume('EditModel') editModel: boolean - @Consume('SectionStatus') sectionStatus: number - @Consume('LastSectionStatus') lastSectionStatus: number - controllerShow: WebController - private editContentFlag = false - @State uri1: string = "" - private context = getContext(this) - noteContent = { - callbackhtml: (html) => { - LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) - this.selectedNoteData.content_text = html - this.selectedNoteData.modified_time = new Date().getTime() - // updata note image - this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData.content_text) - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - LogUtil.info(TAG, 'update note success:' + this.selectedNoteData.uuid) - // save continue data - let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) - AppStorage.SetOrCreate('ContinueNote', continueNote) - LogUtil.info(TAG, "callbackhtml, set continue note success") - return "AceString" - }, - - callbackhtmlSave: (html) => { - LogUtil.info(TAG, 'note uuid is:' + this.selectedNoteData.uuid) - this.selectedNoteData.content_text = html - this.selectedNoteData.modified_time = new Date().getTime() - // updata note image - this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData.content_text) - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - LogUtil.info(TAG, 'update note success:' + this.selectedNoteData.uuid) - // save continue data - let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) - AppStorage.SetOrCreate('ContinueNote', continueNote) - LogUtil.info(TAG, "callbackhtml, set continue note success") - // 删除空白笔记 - if(NoteUtil.deleteEmptyNote(this.selectedNoteData,this.AllNoteArray,this.controllerShow)) { - this.selectedNoteData = this.AllNoteArray[0] - LogUtil.info(TAG, "selectedNoteData note:" + this.selectedNoteData.uuid) - this.controllerShow.runJavaScript({script:"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"}) - } - this.sectionStatus = this.lastSectionStatus - this.sectionStatus = mediaquery.matchMediaSync('(width < 2000)').matches ? 2 : 3 - // save continue data - LogUtil.info(TAG, "callbackhtmlSave, set continue section") - AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) - LogUtil.info(TAG, "callbackhtmlSave, set continue section success") - return "AceString" - }, - - callbackScheduledSave: (html) => { - LogUtil.info(TAG, 'callbackScheduledSave') - this.selectedNoteData.content_text = html - this.selectedNoteData.modified_time = new Date().getTime() - // updata note image - this.selectedNoteData.content_img = RdbStoreUtil.updataNoteImage(this.selectedNoteData.content_text) - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - LogUtil.info(TAG, 'callbackScheduledSave, update note success:' + this.selectedNoteData.uuid) - // save continue data - let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) - AppStorage.SetOrCreate('ContinueNote', continueNote) - LogUtil.info(TAG, 'callbackScheduledSave, set continue note success') - } - - } - - build() { - Stack({ alignContent: Alignment.Bottom }) { - Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, - alignItems: ItemAlign.Start, alignContent: FlexAlign.SpaceAround }) { - Column() { - ToolBarComp({ controllerShow: this.controllerShow }) - } - - Column() { - NoteContentOverViewComp() - Text(this.refreshFlag.toString()).visibility(Visibility.None) - Text(this.AllNoteArray.length.toString()).visibility(Visibility.None) // 用于强制刷新使用 - - Web({ src: $rawfile('editor.html'), controller: this.controllerShow }) - .javaScriptAccess(true) - .onPageEnd((e) => { - if (this.editContentFlag == false) { - this.controllerShow.registerJavaScriptProxy({ - object: this.noteContent, - name: "callBackToApp", // html--> name.method - methodList: ["callbackhtml", "callbackhtmlSave", "callbackScheduledSave"], - }) - LogUtil.info(TAG, "finish register") - this.controllerShow.refresh() - this.editContentFlag = true - } - LogUtil.info(TAG, "finish loadurl") - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) - // 初次加载为为小屏预览模式 - if (this.sectionStatus != 1) { - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) - } - }) - .zoomAccess(false) - .height(450) - .width('100%') - } - .margin({ top: 16 }) - .width(StyleConstants.PERCENTAGE_100) - .enabled(this.selectedNoteData.is_deleted == Delete.Yes ? false : true) - .onClick(() => { - // 点击第三屏进入全屏编辑模式 - if (this.sectionStatus != 1) { - this.lastSectionStatus = this.sectionStatus - this.sectionStatus = 1 - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(true)" }) - this.editModel = !this.editModel - // 添加定时器:3s自动保存 - timeId = setInterval(() => { - this.controllerShow.runJavaScript({ script: "scheduled_save_content()" }) - }, 3000) - LogUtil.info(TAG, "setInterval timeId : " + timeId) - // save continue data - AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) - LogUtil.info(TAG, "set continue section success") - } - }) - } - .height(StyleConstants.PERCENTAGE_100) - .margin({ left: 24, right: 24 }) - .visibility(FolderUtil.getNoteCount(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) == 0 ? Visibility.Hidden : Visibility.Visible) - } - .height(StyleConstants.PERCENTAGE_100) - .width(StyleConstants.PERCENTAGE_100) - } - - aboutToAppear(): void{ - LogUtil.info(TAG, "aboutToAppear") - } - - aboutToDisappear(): void{ - LogUtil.info(TAG, "aboutToDisappear") - } - -} - -@Component -export struct NoteContentOverViewComp { - @Consume('SelectedNoteData') selectedNoteData: NoteData - @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] - @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] - @Consume('EditModel') editModel: boolean - @Consume('SectionStatus') sectionStatus: number - @Consume('RefreshFlag') refreshFlag: number - editTitleDialogCtl: CustomDialogController = new CustomDialogController({ - builder: EditTitleDialog({ confirm: this.confirm.bind(this), dialogType: 0 }), - alignment: DialogAlignment.Center, - autoCancel: false, - customStyle: true, - }) - - confirm(newTitle: string) { - this.selectedNoteData.title = newTitle - this.selectedNoteData.modified_time = new Date().getTime() - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - } - - @Builder MenuBuilder() { - Flex({ direction: FlexDirection.Column, justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) { - List() { - ForEach(this.AllFolderArray, (item) => { - ListItem() { - NoteDataMoveItemComp({ folderItem: item }) - } - .onClick(() => { - this.selectedNoteData.folder_uuid = item.uuid - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) - }) - }, noteItem => noteItem.uuid) - }.listDirection(Axis.Vertical) - .edgeEffect(EdgeEffect.Spring) - .height(this.AllFolderArray.length > 12 ? 504 : (this.AllFolderArray.length - 3) * 56) - } - .width(148) - .backgroundColor($r("app.color.color_fffffB")) - .padding({ left: 24, right: 24 }) - } - - build() { - Flex({ direction: FlexDirection.Column, wrap: FlexWrap.NoWrap, - justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Row() { - Text(this.selectedNoteData.title).fontSize(30) - .onClick(() => { - this.editModel = true - this.sectionStatus = 1 - this.editTitleDialogCtl.open() - // save continue data - AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) - LogUtil.info(TAG, "NoteContentComp, set continue section success") - }) - }.height(40) - .width(StyleConstants.PERCENTAGE_100) - - Row() { - Text(DateUtil.formateDateForNoteContent(new Date(this.selectedNoteData.modified_time))) - .fontSize(12) - .padding({ top: 4, bottom: 4 }) - .fontColor($r("app.color.modified_time_font_color")) - Row() { - Text(FolderUtil.getFolderText(FolderUtil.getFolderData(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid))) - .fontSize(12) - Image($r('app.media.triangle')) - .width(6) - .height(12) - .margin({ left: 4 }) - } - .padding({ left: 8, right: 8, top: 4, bottom: 4 }) - .margin({ left: 8 }) - .borderRadius(16) - .backgroundColor(NoteUtil.getNoteBgColor(AppStorage.Get('AllFolderArray'), this.selectedNoteData.folder_uuid, SysDefFolderUuid.AllNotes, false)) - .bindMenu(this.MenuBuilder) - }.alignItems(VerticalAlign.Top).height(40).width(StyleConstants.PERCENTAGE_100) - } - .opacity(this.selectedNoteData.is_deleted == Delete.Yes ? 0.4 : 1) - .width(StyleConstants.PERCENTAGE_100) - .height(80) - } -} - -@Component -export struct ToolBarComp { - @Consume('SelectedNoteData') selectedNoteData: NoteData - @Consume('RefreshFlag') refreshFlag: number - @Consume('SectionStatus') sectionStatus: number - @Consume('LastSectionStatus') lastSectionStatus: number - @Consume('SelectedFolderData') selectedFolderData: FolderData - @Consume('ChooseNote') chooseNote: boolean - @Consume('PortraitModel') portraitModel: boolean - @StorageLink('AllNoteArray') AllNoteArray: NoteData[] = AppStorage.Link('AllNoteArray') - @Consume('EditModel') editModel: boolean - controllerShow: WebController - private context = getContext(this) - - noteDataDeleteDialogCtl: CustomDialogController = new CustomDialogController({ - builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this) }), - alignment: DialogAlignment.Center, - autoCancel: false, - customStyle: true, - }) - - onDeleteConfirm() { - if (this.selectedFolderData.uuid != SysDefFolderUuid.RecentDeletes) { - this.selectedNoteData.is_deleted = Delete.Yes - this.selectedNoteData.deleted_time = new Date().getTime() - // update note to db - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - } else { - NoteUtil.removeNoteData(this.AllNoteArray, this.selectedNoteData.uuid) - // delete note from db - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.delete(predicates_note, null) - } - this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) - this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) - this.chooseNote = false - AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) - // save continue data - let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) - AppStorage.SetOrCreate('ContinueNote', continueNote) - LogUtil.info(TAG, "NoteContentOverViewComp, set continue section success") - } - - editContentDialogCtl: CustomDialogController = new CustomDialogController({ - builder: EditContentDialog({ confirm: this.confirm.bind(this), dialogType: 0 }), - alignment: DialogAlignment.Bottom, - autoCancel: true, - customStyle: true, - }) - - confirm(excuteJs: string) { - this.controllerShow.runJavaScript({ script: excuteJs }) - } - - build() { - Flex({ direction: FlexDirection.Row, wrap: FlexWrap.NoWrap, - justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { - Image($r('app.media.zoom')) - .height(24) - .width(24) - .onClick(() => { - if (this.sectionStatus != 1) { - this.lastSectionStatus = this.sectionStatus - this.sectionStatus = 1 - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(true)" }) - } else { - if (this.lastSectionStatus != undefined) { - // 切换为小屏预览模式 - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" }) - // 退出全屏时存库 - LogUtil.info(TAG, "close note" + this.selectedNoteData.uuid) - this.controllerShow.runJavaScript({ script: "save_html_content()" }) - // 清除定时器 - if (timeId != undefined) { - LogUtil.info(TAG, "zoom, clearInterval timeId : " + timeId) - clearInterval(timeId) - } - } else { - this.sectionStatus = 3 - } - } - this.editModel = !this.editModel - // 迁移 - LogUtil.info(TAG, "ToolBarComp, set continue section") - AppStorage.SetOrCreate('ContinueSection', this.sectionStatus) - LogUtil.info(TAG, "ToolBarComp, set continue section success") - }) - .visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible) - - if (this.selectedNoteData.is_deleted == Delete.Yes) { - Row({ space: StyleConstants.SPACE_24 }) { - Image($r('app.media.delete')) - .height(24) - .width(24) - .onClick(() => { - this.noteDataDeleteDialogCtl.open() - }) - Image($r('app.media.recover')) - .height(24) - .width(24) - .onClick(() => { - this.selectedNoteData.is_deleted = Delete.No - this.selectedNoteData.deleted_time = 0 - prompt.showToast({ message: "已恢复", duration: 2000 }) - this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) - this.chooseNote = false - AppStorage.SetOrCreate('ContinueChoose', this.chooseNote) - // update note to db - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - - this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), this.selectedFolderData.uuid) - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) - // save continue data - let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) - AppStorage.SetOrCreate('ContinueNote', continueNote) - LogUtil.info(TAG, "recover, set continue note success") - }) - }.width(72) - } else if (this.editModel == true) { - Row({ space: StyleConstants.SPACE_6 }) { - Button({ type: ButtonType.Normal, stateEffect: true }) { - Image($r('app.media.circle_tick1')) - .height(24) - .width(24) - .onClick(() => { - // 清单 - this.controllerShow.runJavaScript({ script: "javascript:RICH_EDITOR.setTodo()" }) - }) - }.width(42) - .height(42) - .borderRadius(8) - .backgroundColor($r('app.color.color_ffffff')) - - Button({ type: ButtonType.Normal, stateEffect: true }) { - Image($r('app.media.styles')) - .height(24) - .width(24) - .onClick(() => { - if (this.portraitModel) { - this.editContentDialogCtl.open() - } else { - this.editContentDialogCtl.open() - } - }) - }.width(42) - .height(42) - .borderRadius(8) - .backgroundColor($r('app.color.color_ffffff')) - - Button({ type: ButtonType.Normal, stateEffect: true }) { - Image($r('app.media.picture_white')).height(24).width(24) - .onClick(async () => { - LogUtil.info(TAG, 'startAbility start') - AppStorage.SetOrCreate('openPhoto', 1) - await globalThis.noteContext.startAbilityForResult({ - parameters: { uri: "singleselect" }, - bundleName: "com.ohos.photos", - abilityName: "com.ohos.photos.MainAbility", - }) - .then(v => { - AppStorage.SetOrCreate('openPhoto', 0) - let want = v['want']; - if (want != null && want != undefined) { - let param = want['parameters']; - let imageUri = "" - if (param != null && param != undefined) { - let uri = param['select-item-list']; - imageUri = uri; - } - // 拷贝 - OperationUtils.copy(imageUri).then((uriPath) => { - var path = "file://" + uriPath - LogUtil.info(TAG, 'image uri is:' + path) - this.controllerShow.runJavaScript({script:"javascript:RICH_EDITOR.insertImage('" + path + "')"}) - }) - } - }); - }) - }.width(42) - .height(42) - .borderRadius(8) - .backgroundColor($r('app.color.color_ffffff')) - - Button({ type: ButtonType.Normal, stateEffect: true }) { - Image($r('app.media.tick_thick')) - .height(24) - .width(24) - }.width(42) - .height(42) - .borderRadius(8) - .backgroundColor($r('app.color.color_ffffff')) - - Button({ type: ButtonType.Normal, stateEffect: true }) { - Image($r('app.media.undo')) - .height(24) - .width(24) - .onClick(() => { - - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.undo()" }) - }) - }.width(42) - .height(42) - .borderRadius(8) - .backgroundColor($r('app.color.color_ffffff')) - - Button({ type: ButtonType.Normal, stateEffect: true }) { - Image($r('app.media.todo')) - .height(24) - .width(24) - .onClick(() => { - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.redo()" }) - }) - }.width(42) - .height(42) - .borderRadius(8) - .backgroundColor($r('app.color.color_ffffff')) - }.width(274) - } else { - Row({ space: StyleConstants.SPACE_24 }) { - Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel')) - .height(24) - .width(24) - .onClick(() => { - this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes) - this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0) - // update note to db - let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable) - predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid) - RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null) - if (this.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) { - this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites) - this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')" }) - // save continue data - let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject()) - AppStorage.SetOrCreate('ContinueNote', continueNote) - LogUtil.info(TAG, "ToolBarComp, set continue note success") - } - }) - Image($r('app.media.delete')) - .height(24) - .width(24) - .onClick(() => { - this.noteDataDeleteDialogCtl.open() - }) - }.width(72) - } - } - .width(StyleConstants.PERCENTAGE_100) - .height(80) - } -} - -@Component -struct NoteDataMoveItemComp { - @StorageLink('CheckedNoteArray') CheckedNoteArray: NoteData[] = [] - @StorageLink('AllFolderArray') AllFolderArray: FolderData[] = [] - private folderItem: FolderData - - build() { - Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.Center }) { - Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap }) { - Image(FolderUtil.getFolderIcon(this.folderItem.uuid)) - .objectFit(ImageFit.ScaleDown) - .width(24) - .height(24) - .fillColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) - } - .width(24) - - Column() { - Flex({ alignItems: ItemAlign.Center, wrap: FlexWrap.NoWrap, justifyContent: FlexAlign.SpaceBetween }) { - Text(FolderUtil.getFolderText(this.folderItem)) - .fontSize(16) - .fontColor(FolderUtil.getFolderIconColor(this.AllFolderArray, this.folderItem.uuid, false)) - .textAlign(TextAlign.Center) - .maxLines(1) - .textOverflow({ overflow: TextOverflow.Ellipsis }) - .flexShrink(1) - } - .width('100%') - .height(55) - - Divider() - .color($r("app.color.divider_color_e4e4e4")) - .strokeWidth(1) - } - .padding({ left: 16 }) - } - .width('100%') - .height(56) - .visibility(FolderUtil.isFolderMoveIn(this.folderItem) ? Visibility.Visible : Visibility.None) - } -} diff --git a/product/phone/src/main/config.json b/product/phone/src/main/config.json deleted file mode 100644 index 0f113fa..0000000 --- a/product/phone/src/main/config.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.note", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.note", - "name": ".MyApplication", - "mainAbility": "com.ohos.note.MainAbility", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "phone", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.ohos.note.MainAbility", - "icon": "$media:note", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard", - "srcPath": "MainAbility", - "srcLanguage": "ets", - "metaData": { - "customizeData": [ - { - "name": "hwc-theme" - } - ] - } - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/MyNoteHome", - "pages/NoteHomePortrait" - ], - "name": "MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.READ_MEDIA", - "reason": "$string:per_read_media" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "$string:per_get_bundleInfo" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "reason": "$string:per_dis_dataSync" - } - ] - } -} \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/WebViewUtil.ets b/product/phone/src/main/ets/MainAbility/WebViewUtil.ets deleted file mode 100644 index f1fa1c7..0000000 --- a/product/phone/src/main/ets/MainAbility/WebViewUtil.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * WebView Util - */ -export class WebViewUtil { - private static controllerShow: WebController - - private constructor() { - - } - - public static getWebController(): WebController{ - console.info('WebViewUtil, getWebController') - if (!this.controllerShow && AppStorage.Get('openPhoto') == 0 && AppStorage.Get('openPerm') == 0) { - console.info('WebViewUtil, controllerShow is null') - this.controllerShow = new WebController() - } - return this.controllerShow - } - -} \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/app.ets b/product/phone/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 00231a4..0000000 --- a/product/phone/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' - -const TAG = "NoteApp" - -export default { - onCreate() { - LogUtil.info(TAG, "Application onCreate") - AppStorage.SetOrCreate('AllFolderArray', []) - AppStorage.SetOrCreate('AllNoteArray', []) - AppStorage.SetOrCreate('DBQueryFinished', 0) - LogUtil.info(TAG, "AppStorage SetOrCreate : AllFolderArray, AllNoteArray, DBQueryFinished") - }, - - onDestroy() { - LogUtil.info(TAG, 'Application onDestroy') - }, -} \ No newline at end of file diff --git a/product/phone/src/main/ets/MainAbility/pages/MyNoteHome.ets b/product/phone/src/main/ets/MainAbility/pages/MyNoteHome.ets deleted file mode 100644 index ceaaee4..0000000 --- a/product/phone/src/main/ets/MainAbility/pages/MyNoteHome.ets +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import fileio from '@ohos.fileio' -import bundle from '@ohos.bundle' -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import {NoteHomePortraitComp} from './NoteHomePortrait.ets' -import {LogUtil} from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' -import RdbStoreUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets' - -@Entry -@Component -export struct MyNoteHomeComp { - @StorageLink('DBQueryFinished') dBQueryFinished: number = 0 - @Provide('PortraitModel') portraitModel: boolean = true - private context = getContext(this) - TAG = "MyNoteHomeComp" - - build() { - Flex() { - if (this.dBQueryFinished == 1) { - NoteHomePortraitComp() - } - } - .width('100%').height('100%') - } - - aboutToAppear(): void{ - LogUtil.info(this.TAG, "aboutToAppear") - - if (this.context == undefined || this.context == null) { - LogUtil.warn(this.TAG, "context is error") - return - } - - let permissionList: Array = [ - "ohos.permission.READ_MEDIA", - "ohos.permission.DISTRIBUTED_DATASYNC" - ] - bundle.getApplicationInfo('com.ohos.note', 0, 100).then((appInfo) => { - let tokenId = appInfo.accessTokenId - let statusPromise: Array> = [] - let requestList: Array = [] - let atManager = abilityAccessCtrl.createAtManager() - for (let i = 0; i < permissionList.length; i++) { - statusPromise.push(atManager.verifyAccessToken(tokenId, permissionList[i])) - } - Promise.all(statusPromise).then((status) => { - for (let i = 0; i < status.length; i++) { - if (status[i] == abilityAccessCtrl.GrantStatus.PERMISSION_DENIED) { - requestList.push(permissionList[i]) - } - } - if (requestList.length != 0) { - AppStorage.SetOrCreate('openPerm', 1) - LogUtil.info(this.TAG, 'permissions need to require from user: ' + requestList) - this.context.requestPermissionsFromUser(requestList).then((data) => { - LogUtil.info(this.TAG, 'data permissions : ' + data.permissions) - LogUtil.info(this.TAG, 'data result: ' + data.authResults) - let sum = 0 - for (let i = 0; i < data.authResults.length; i++) { - sum += data.authResults[i] - } - LogUtil.info(this.TAG, 'request permissions sum: ' + sum) - AppStorage.SetOrCreate('openPerm', 0) - }, (err) => { - LogUtil.warn(this.TAG, 'failed to requestPermissionsFromUser : ' + err.code); - }); - } else { - LogUtil.info(this.TAG, 'check all permissions are granted.') - } - }) - }) - - let dbPath = this.context.databaseDir + "/db/note.db" - try { - fileio.accessSync(dbPath) - LogUtil.info(this.TAG, "db has created") - RdbStoreUtil.initAppStorage(this.context) - } catch (err) { - LogUtil.info(this.TAG, "db has not created, start to create db") - RdbStoreUtil.createRdbStore(this.context) - } - } - - aboutToDisappear(): void{ - LogUtil.info(this.TAG, "aboutToDisappear") - } -} \ No newline at end of file diff --git a/product/phone/src/main/resources/base/element/color.json b/product/phone/src/main/resources/base/element/color.json deleted file mode 100644 index 23674b8..0000000 --- a/product/phone/src/main/resources/base/element/color.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "color": [ - { - "name": "color_ffffff", - "value": "#ffffff" - }, - { - "name": "color_fffffB", - "value": "#FFFBFBFB" - }, - { - "name": "delete_color_fa2a2d", - "value": "#fa2a2d" - }, - { - "name": "cancel_color_4fb4e3", - "value": "#4fb4e3" - }, - { - "name": "divider_color_e4e4e4", - "value": "#cce4e4e4" - }, - { - "name": "divider_color_182431", - "value": "#182431" - }, - { - "name": "button_color_419fff", - "value": "#419fff" - }, - { - "name": "button_color_fb4447", - "value": "#fb4447" - }, - { - "name": "text_color_3f97e9", - "value": "#3f97e9" - }, - { - "name": "text_color_f86d05", - "value": "#f86d05" - }, - { - "name": "folder_color_182431", - "value": "#182431" - }, - { - "name": "folder_color_f86d05", - "value": "#f86d05" - }, - { - "name": "folder_color_ffffff", - "value": "#ffffff" - }, - { - "name": "folder_color_19ffffff", - "value": "#19ffffff" - }, - { - "name": "folder_color_19182431", - "value": "#19182431" - }, - { - "name": "notecontent_color_ffffff", - "value": "#ffffff" - }, - { - "name": "notecontent_color_000000", - "value": "#000000" - }, - { - "name": "folderlist_bgcolor_f1f3f5", - "value": "#f1f3f5" - }, - { - "name": "notelist_bgcolor_f1f3f5", - "value": "#f1f3f5" - }, - { - "name": "notelist_bgcolor_000000", - "value": "#000000" - }, - { - "name": "image_bordercolor_19182431", - "value": "#19182431" - }, - { - "name": "button_color_f86d05", - "value": "#f86d05" - }, - { - "name": "font_stylecolor_AD182431", - "value": "#AD182431" - }, - { - "name": "New_folder_input_box_color", - "value": "#FFFFFF" - }, - { - "name": "category_already_exist_font_color", - "value": "#FA2A2D" - }, - { - "name": "create_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "delete_note_bg_color", - "value": "#FFFFFF" - }, - { - "name": "choose_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "title_input_bg_color", - "value": "#FFFFFF" - }, - { - "name": "Edit_title_bg_color", - "value": "#FFFFFF" - }, - { - "name": "press_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "modified_time_font_color", - "value": "#A3A7AD" - }, - { - "name": "delete_font_color", - "value": "#182431" - }, - { - "name": "recover_font_color", - "value": "#182431" - }, - { - "name": "list_font_color", - "value": "#182431" - }, - { - "name": "style_font_color", - "value": "#182431" - }, - { - "name": "photo_font_color", - "value": "#182431" - }, - { - "name": "all_notes_font_color", - "value": "#182431" - }, - { - "name": "num_of_notes_font_color", - "value": "#A3A7AD" - }, - { - "name": "note_selected_font_color", - "value": "#182431" - }, - { - "name": "note_title_font_color", - "value": "#182431" - }, - { - "name": "note_title_font_color_blue", - "value": "#0000ff" - }, - { - "name": "list_modified_time_font_color", - "value": "#99182431" - }, - { - "name": "Recently_delete_prompt_font_color", - "value": "#18181A" - }, - { - "name": "Empty_page_font_color", - "value": "#A3A7AD" - }, - { - "name": "search_note_caret_color", - "value": "#F86D05" - }, - { - "name": "set_top_font_color", - "value": "#182431" - }, - { - "name": "move_font_color", - "value": "#182431" - }, - { - "name": "check_all_font_color", - "value": "#182431" - } - ] -} \ No newline at end of file diff --git a/product/phone/src/main/resources/en_US/element/string.json b/product/phone/src/main/resources/en_US/element/string.json deleted file mode 100644 index 8529f1b..0000000 --- a/product/phone/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "Notepad" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "note", - "value": "Notes" - }, - { - "name": "allNotes", - "value": "All notes" - }, - { - "name": "unClassified", - "value": "No category" - }, - { - "name": "recentDeletes", - "value": "Recently deleted" - }, - { - "name": "myFavorites", - "value": "My favourites" - }, - { - "name": "create", - "value": "NEW" - }, - { - "name": "createFolder", - "value": "New Folder" - }, - { - "name": "editFolder", - "value": "Edit Folder" - }, - { - "name": "deleteFolder", - "value": "Delete Folder" - }, - { - "name": "createNote", - "value": "New note" - }, - { - "name": "cancel", - "value": "CANCEL" - }, - { - "name": "save", - "value": "SAVE" - }, - { - "name": "delete", - "value": "DELETE" - }, - { - "name": "delete_tips", - "value": "Do you want to delete this folder and its contents?" - }, - { - "name": "deleteNote", - "value": "Delete this note?" - }, - { - "name": "deleteNoteComplete", - "value": "Permanently delete this note?" - }, - { - "name": "deleteAllNote", - "value": "Delete all note?" - }, - { - "name": "deletePartNote", - "value": "Delete %d notes?" - }, - { - "name": "selected", - "value": "%d item selected" - }, - { - "name": "none_selected", - "value": "None selected" - }, - { - "name": "noteslist", - "value": "notes" - }, - { - "name": "Empty_page", - "value": "No notes" - }, - { - "name": "searchNote", - "value": "Search notes" - }, - { - "name": "chooseFolder", - "value": "Select folder" - }, - { - "name": "category_already_exist", - "value": "The folder name already exists." - }, - { - "name": "input_placeholder", - "value": "Name" - }, - { - "name": "permanently_delete_tips", - "value": "notes will be permanently deleted after the number of days shown (up to 30 days)." - }, - { - "name": "set_top", - "value": "Top" - }, - { - "name": "move", - "value": "Move" - }, - { - "name": "recover", - "value": "Restore" - }, - { - "name": "check_all", - "value": "Select all" - }, - { - "name": "editNoteTitle", - "value": "Modify the title" - }, - { - "name": "list", - "value": "Checklist" - }, - { - "name": "style", - "value": "Style" - }, - { - "name": "photo", - "value": "Gallery" - }, - { - "name": "title", - "value": "Title" - }, - { - "name": "empty_note", - "value": "The note content is empty." - }, - { - "name": "restore", - "value": "Note Restored" - } - ] -} \ No newline at end of file diff --git a/product/phone/src/main/resources/rawfile/rich_editor.js b/product/phone/src/main/resources/rawfile/rich_editor.js deleted file mode 100644 index c30a8dd..0000000 --- a/product/phone/src/main/resources/rawfile/rich_editor.js +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var RICH_EDITOR = {}; - -RICH_EDITOR.editor = document.getElementById('editorjs'); - -RICH_EDITOR.setHtml = function(contents) { - RICH_EDITOR.editor.innerHTML = decodeURIComponent(contents.replace(/\+/g, '%20')); -} - -RICH_EDITOR.getHtml = function() { - return RICH_EDITOR.editor.innerHTML; -} - -RICH_EDITOR.undo = function() { - document.execCommand('undo', false, null); -} - -RICH_EDITOR.redo = function() { - document.execCommand('redo', false, null); -} - -RICH_EDITOR.setBold = function() { - document.execCommand('bold'); -} - -RICH_EDITOR.setItalic = function() { - document.execCommand('italic', false, null); -} - -RICH_EDITOR.setSubscript = function() { - document.execCommand('subscript', false, null); -} - -RICH_EDITOR.setSuperscript = function() { - document.execCommand('superscript', false, null); -} - -RICH_EDITOR.setStrikeThrough = function() { - document.execCommand('strikeThrough', false, null); -} - -RICH_EDITOR.setUnderline = function() { - document.execCommand('underline', false, null); -} - -RICH_EDITOR.setNumbers = function () { - document.execCommand('insertOrderedList', false, null); - var selection, type; - if (window.getSelection) { - 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 - } - } - } catch (err) { - - } - } -} - -RICH_EDITOR.setABC = function () { - document.execCommand('insertOrderedList', false, null); - var selection, type; - if (window.getSelection) { - 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 - } - } - } catch (err) { - - } - } -} - -RICH_EDITOR.setBullets = function () { - document.execCommand('insertUnorderedList', false, null); - var selection, type; - if (window.getSelection) { - 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 - } - } - } catch (err) { - - } - } -} - -RICH_EDITOR.setSquare = function () { - document.execCommand('insertUnorderedList', false, null); - var selection, type; - if (window.getSelection) { - 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 - } - } - } catch (err) { - - } - } -} - -RICH_EDITOR.setTextColor = function (color) { - document.execCommand('foreColor', false, color); -} - -RICH_EDITOR.setFontSize = function(fontSize){ - document.execCommand("fontSize", false, fontSize); -} - -RICH_EDITOR.execFontSize = function (size, unit) { - document.execCommand("fontSize", false, "7"); - var fontElements = window.getSelection().anchorNode.parentNode - fontElements.removeAttribute("size"); - fontElements.style.fontSize = size + 'px' -}; - -RICH_EDITOR.setIndent = function() { - document.execCommand('indent', false, null); -} - -RICH_EDITOR.setOutdent = function() { - document.execCommand('outdent', false, null); -} - -RICH_EDITOR.setJustifyLeft = function() { - document.execCommand('justifyLeft', false, null); -} - -RICH_EDITOR.setJustifyCenter = function() { - document.execCommand('justifyCenter', false, null); -} - -RICH_EDITOR.setJustifyRight = function() { - document.execCommand('justifyRight', false, null); -} - -RICH_EDITOR.insertImage = function(url) { - var html = '

picvision

'; - RICH_EDITOR.insertHTML(html); - RICH_EDITOR.editor.scrollIntoView(false) -} - -RICH_EDITOR.insertHTML = function(html) { - document.execCommand('insertHTML', false, html); -} - -RICH_EDITOR.setDone = function() { - var html = '  '; - document.execCommand('insertHTML', false, html); -} - -RICH_EDITOR.addTodo=function(e){ - KEY_ENTER=13; - if(e.which == KEY_ENTER){ - var node=RICH_EDITOR.getSelectedAnchorNode(); - if(node&&node.nodeName=="#text"){ - node=node.parentElement; - } - if(node&&node.nodeName=="SPAN"&&node.previousElementSibling&&node.previousElementSibling.className=='note-checkbox'){ - RICH_EDITOR.setTodo(); - e.preventDefault(); - } - } -} - -RICH_EDITOR.setTodo = function () { - var parent = document.getElementById('editorjs') - var isContentEmpty = parent.innerHTML.trim().length == 0 || parent.innerHTML == '
'; - var html = (isContentEmpty ? '' : '
') + ' '; - document.execCommand('insertHTML', false, html); -} - -function onCheckChange(checkbox) { - if (checkbox.checked == true) { - checkbox.setAttribute("checked", "checked"); - } else { - checkbox.removeAttribute("checked"); - } -} - -RICH_EDITOR.restorerange = function(){ - var selection = window.getSelection(); - selection.removeAllRanges(); - var range = document.createRange(); - range.setStart(RICH_EDITOR.currentSelection.startContainer, RICH_EDITOR.currentSelection.startOffset); - range.setEnd(RICH_EDITOR.currentSelection.endContainer, RICH_EDITOR.currentSelection.endOffset); - selection.addRange(range); -} - -//获取光标开始位置归属节点 -RICH_EDITOR.getSelectedAnchorNode=function(){ - var node,selection; - if (window.getSelection) { - selection = getSelection(); - node = selection.anchorNode; - } - if (!node && document.selection) { - selection = document.selection - var range = selection.getRangeAt ? selection.getRangeAt(0) : selection.createRange(); - node = range.commonAncestorContainer ? range.commonAncestorContainer : - range.parentElement ? range.parentElement() : range.item(0); - } - return node; -} - -function get_html_content() { - console.log('get_html_content'); - var htmlString = encodeURI(RICH_EDITOR.getHtml()) - var str = callBackToApp.callbackhtml(htmlString) - console.log('get_html_content end'); -} - -function save_html_content() { - console.log('save_html_content'); - var htmlString = encodeURI(RICH_EDITOR.getHtml()) - var str = callBackToApp.callbackhtmlSave(htmlString) - console.log('save_html_content end'); -} - -function scheduled_save_content() { - console.info('scheduled_save_content') - var htmlString = encodeURI(RICH_EDITOR.getHtml()) - var str = callBackToApp.callbackScheduledSave(htmlString) - console.info('scheduled_save_content end') -} \ No newline at end of file diff --git a/product/phone/src/main/resources/zh_CN/element/string.json b/product/phone/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index d8cc164..0000000 --- a/product/phone/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "备忘录" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "note", - "value": "笔记" - }, - { - "name": "allNotes", - "value": "全部笔记" - }, - { - "name": "unClassified", - "value": "未分类" - }, - { - "name": "recentDeletes", - "value": "最近删除" - }, - { - "name": "myFavorites", - "value": "我的收藏" - }, - { - "name": "create", - "value": "新建" - }, - { - "name": "createFolder", - "value": "新建文件夹" - }, - { - "name": "editFolder", - "value": "编辑文件夹" - }, - { - "name": "deleteFolder", - "value": "删除文件夹" - }, - { - "name": "createNote", - "value": "新建笔记" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "save", - "value": "保存" - }, - { - "name": "delete", - "value": "删除" - }, - { - "name": "delete_tips", - "value": "是否删除此文件夹及其中的内容?" - }, - { - "name": "deleteNote", - "value": "是否删除此笔记?" - }, - { - "name": "deleteNoteComplete", - "value": "此笔记将被永久删除,无法恢复。是否删除?" - }, - { - "name": "deleteAllNote", - "value": "是否删除全部笔记?" - }, - { - "name": "deletePartNote", - "value": "是否删除%d条笔记?" - }, - { - "name": "selected", - "value": "已选择%d项" - }, - { - "name": "none_selected", - "value": "未选择" - }, - { - "name": "noteslist", - "value": "条笔记" - }, - { - "name": "Empty_page", - "value": "没有笔记" - }, - { - "name": "searchNote", - "value": "搜索笔记" - }, - { - "name": "chooseFolder", - "value": "请选择文件夹" - }, - { - "name": "category_already_exist", - "value": "文件夹名称已存在" - }, - { - "name": "input_placeholder", - "value": "名称" - }, - { - "name": "permanently_delete_tips", - "value": "笔记删除前会显示剩余天数(最长30天),之后将永久删除" - }, - { - "name": "set_top", - "value": "置顶" - }, - { - "name": "move", - "value": "移到" - }, - { - "name": "recover", - "value": "恢复" - }, - { - "name": "check_all", - "value": "多选" - }, - { - "name": "editNoteTitle", - "value": "修改标题" - }, - { - "name": "list", - "value": "清单" - }, - { - "name": "style", - "value": "样式" - }, - { - "name": "photo", - "value": "相册" - }, - { - "name": "title", - "value": "标题" - }, - { - "name": "empty_note", - "value": "笔记内容为空" - }, - { - "name": "restore", - "value": "已恢复" - } - ] -} \ No newline at end of file diff --git a/product/tablet/src/main/config.json b/product/tablet/src/main/config.json deleted file mode 100644 index bc6af9f..0000000 --- a/product/tablet/src/main/config.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.note", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.note", - "name": ".MyApplication", - "mainAbility": "com.ohos.note.MainAbility", - "deviceType": [ - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "tablet", - "moduleType": "entry", - "installationFree": true - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "visible": true, - "name": "com.ohos.note.MainAbility", - "icon": "$media:note", - "description": "$string:description_mainability", - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard", - "srcPath": "MainAbility", - "srcLanguage": "ets", - "metaData": { - "customizeData": [ - { - "name": "hwc-theme" - } - ] - } - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/MyNoteHome", - "pages/NoteHome" - ], - "name": "MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.READ_MEDIA", - "reason": "$string:per_read_media" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "$string:per_get_bundleInfo" - }, - { - "name": "ohos.permission.DISTRIBUTED_DATASYNC", - "reason": "$string:per_dis_dataSync" - } - ] - } -} \ No newline at end of file diff --git a/product/tablet/src/main/ets/MainAbility/WebViewUtil.ets b/product/tablet/src/main/ets/MainAbility/WebViewUtil.ets deleted file mode 100644 index f1fa1c7..0000000 --- a/product/tablet/src/main/ets/MainAbility/WebViewUtil.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * WebView Util - */ -export class WebViewUtil { - private static controllerShow: WebController - - private constructor() { - - } - - public static getWebController(): WebController{ - console.info('WebViewUtil, getWebController') - if (!this.controllerShow && AppStorage.Get('openPhoto') == 0 && AppStorage.Get('openPerm') == 0) { - console.info('WebViewUtil, controllerShow is null') - this.controllerShow = new WebController() - } - return this.controllerShow - } - -} \ No newline at end of file diff --git a/product/tablet/src/main/ets/MainAbility/app.ets b/product/tablet/src/main/ets/MainAbility/app.ets deleted file mode 100644 index 00231a4..0000000 --- a/product/tablet/src/main/ets/MainAbility/app.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {LogUtil} from '../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' - -const TAG = "NoteApp" - -export default { - onCreate() { - LogUtil.info(TAG, "Application onCreate") - AppStorage.SetOrCreate('AllFolderArray', []) - AppStorage.SetOrCreate('AllNoteArray', []) - AppStorage.SetOrCreate('DBQueryFinished', 0) - LogUtil.info(TAG, "AppStorage SetOrCreate : AllFolderArray, AllNoteArray, DBQueryFinished") - }, - - onDestroy() { - LogUtil.info(TAG, 'Application onDestroy') - }, -} \ No newline at end of file diff --git a/product/tablet/src/main/ets/MainAbility/pages/MyNoteHome.ets b/product/tablet/src/main/ets/MainAbility/pages/MyNoteHome.ets deleted file mode 100644 index 6814328..0000000 --- a/product/tablet/src/main/ets/MainAbility/pages/MyNoteHome.ets +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import fileio from '@ohos.fileio' -import bundle from '@ohos.bundle' -import abilityAccessCtrl from '@ohos.abilityAccessCtrl' -import {NoteHomeComp} from './NoteHome.ets' -import {LogUtil} from '../../../../../../../common/utils/src/main/ets/default/baseUtil/LogUtil.ets' -import RdbStoreUtil from '../../../../../../../common/utils/src/main/ets/default/baseUtil/RdbStoreUtil.ets' - -@Entry -@Component -export struct MyNoteHomeComp { - @StorageLink('DBQueryFinished') dBQueryFinished: number = 0 - @Provide('PortraitModel') portraitModel: boolean = false - private context = getContext(this) - TAG = "MyNoteHomeComp" - - build() { - Row() { - if (this.dBQueryFinished == 1) { - NoteHomeComp() - } - } - .width('100%') - .height('100%') - } - - aboutToAppear(): void{ - LogUtil.info(this.TAG, "aboutToAppear") - - if (this.context == undefined || this.context == null) { - LogUtil.warn(this.TAG, "context is error") - return - } - - let permissionList: Array = [ - "ohos.permission.READ_MEDIA", - "ohos.permission.DISTRIBUTED_DATASYNC" - ] - bundle.getApplicationInfo('com.ohos.note', 0, 100).then((appInfo) => { - let tokenId = appInfo.accessTokenId - let statusPromise: Array> = [] - let requestList: Array = [] - let atManager = abilityAccessCtrl.createAtManager() - for (let i = 0; i < permissionList.length; i++) { - statusPromise.push(atManager.verifyAccessToken(tokenId, permissionList[i])) - } - Promise.all(statusPromise).then((status) => { - for (let i = 0; i < status.length; i++) { - if (status[i] == abilityAccessCtrl.GrantStatus.PERMISSION_DENIED) { - requestList.push(permissionList[i]) - } - } - if (requestList.length != 0) { - AppStorage.SetOrCreate('openPerm', 1) - LogUtil.info(this.TAG, 'permissions need to require from user: ' + requestList) - this.context.requestPermissionsFromUser(requestList).then((data) => { - LogUtil.info(this.TAG, 'data permissions : ' + data.permissions) - LogUtil.info(this.TAG, 'data result: ' + data.authResults) - let sum = 0 - for (let i = 0; i < data.authResults.length; i++) { - sum += data.authResults[i] - } - LogUtil.info(this.TAG, 'request permissions sum: ' + sum) - AppStorage.SetOrCreate('openPerm', 0) - }, (err) => { - LogUtil.warn(this.TAG, 'failed to requestPermissionsFromUser : ' + err.code); - }); - } else { - LogUtil.info(this.TAG, 'check all permissions are granted.') - } - }) - }) - - let dbPath = this.context.databaseDir + "/db/note.db" - try { - fileio.accessSync(dbPath) - LogUtil.info(this.TAG, "db has created") - RdbStoreUtil.initAppStorage(this.context) - } catch (err) { - LogUtil.info(this.TAG, "db has not created, start to create db") - RdbStoreUtil.createRdbStore(this.context) - } - } - - aboutToDisappear(): void{ - LogUtil.info(this.TAG, "aboutToDisappear") - } -} \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/element/color.json b/product/tablet/src/main/resources/base/element/color.json deleted file mode 100644 index 23674b8..0000000 --- a/product/tablet/src/main/resources/base/element/color.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "color": [ - { - "name": "color_ffffff", - "value": "#ffffff" - }, - { - "name": "color_fffffB", - "value": "#FFFBFBFB" - }, - { - "name": "delete_color_fa2a2d", - "value": "#fa2a2d" - }, - { - "name": "cancel_color_4fb4e3", - "value": "#4fb4e3" - }, - { - "name": "divider_color_e4e4e4", - "value": "#cce4e4e4" - }, - { - "name": "divider_color_182431", - "value": "#182431" - }, - { - "name": "button_color_419fff", - "value": "#419fff" - }, - { - "name": "button_color_fb4447", - "value": "#fb4447" - }, - { - "name": "text_color_3f97e9", - "value": "#3f97e9" - }, - { - "name": "text_color_f86d05", - "value": "#f86d05" - }, - { - "name": "folder_color_182431", - "value": "#182431" - }, - { - "name": "folder_color_f86d05", - "value": "#f86d05" - }, - { - "name": "folder_color_ffffff", - "value": "#ffffff" - }, - { - "name": "folder_color_19ffffff", - "value": "#19ffffff" - }, - { - "name": "folder_color_19182431", - "value": "#19182431" - }, - { - "name": "notecontent_color_ffffff", - "value": "#ffffff" - }, - { - "name": "notecontent_color_000000", - "value": "#000000" - }, - { - "name": "folderlist_bgcolor_f1f3f5", - "value": "#f1f3f5" - }, - { - "name": "notelist_bgcolor_f1f3f5", - "value": "#f1f3f5" - }, - { - "name": "notelist_bgcolor_000000", - "value": "#000000" - }, - { - "name": "image_bordercolor_19182431", - "value": "#19182431" - }, - { - "name": "button_color_f86d05", - "value": "#f86d05" - }, - { - "name": "font_stylecolor_AD182431", - "value": "#AD182431" - }, - { - "name": "New_folder_input_box_color", - "value": "#FFFFFF" - }, - { - "name": "category_already_exist_font_color", - "value": "#FA2A2D" - }, - { - "name": "create_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "delete_note_bg_color", - "value": "#FFFFFF" - }, - { - "name": "choose_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "title_input_bg_color", - "value": "#FFFFFF" - }, - { - "name": "Edit_title_bg_color", - "value": "#FFFFFF" - }, - { - "name": "press_folder_bg_color", - "value": "#FFFFFF" - }, - { - "name": "modified_time_font_color", - "value": "#A3A7AD" - }, - { - "name": "delete_font_color", - "value": "#182431" - }, - { - "name": "recover_font_color", - "value": "#182431" - }, - { - "name": "list_font_color", - "value": "#182431" - }, - { - "name": "style_font_color", - "value": "#182431" - }, - { - "name": "photo_font_color", - "value": "#182431" - }, - { - "name": "all_notes_font_color", - "value": "#182431" - }, - { - "name": "num_of_notes_font_color", - "value": "#A3A7AD" - }, - { - "name": "note_selected_font_color", - "value": "#182431" - }, - { - "name": "note_title_font_color", - "value": "#182431" - }, - { - "name": "note_title_font_color_blue", - "value": "#0000ff" - }, - { - "name": "list_modified_time_font_color", - "value": "#99182431" - }, - { - "name": "Recently_delete_prompt_font_color", - "value": "#18181A" - }, - { - "name": "Empty_page_font_color", - "value": "#A3A7AD" - }, - { - "name": "search_note_caret_color", - "value": "#F86D05" - }, - { - "name": "set_top_font_color", - "value": "#182431" - }, - { - "name": "move_font_color", - "value": "#182431" - }, - { - "name": "check_all_font_color", - "value": "#182431" - } - ] -} \ No newline at end of file diff --git a/product/tablet/src/main/resources/base/media/search.svg b/product/tablet/src/main/resources/base/media/search.svg deleted file mode 100644 index 948fa20..0000000 --- a/product/tablet/src/main/resources/base/media/search.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - -搜索 - - diff --git a/product/tablet/src/main/resources/en_US/element/string.json b/product/tablet/src/main/resources/en_US/element/string.json deleted file mode 100644 index 8529f1b..0000000 --- a/product/tablet/src/main/resources/en_US/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "Notepad" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "note", - "value": "Notes" - }, - { - "name": "allNotes", - "value": "All notes" - }, - { - "name": "unClassified", - "value": "No category" - }, - { - "name": "recentDeletes", - "value": "Recently deleted" - }, - { - "name": "myFavorites", - "value": "My favourites" - }, - { - "name": "create", - "value": "NEW" - }, - { - "name": "createFolder", - "value": "New Folder" - }, - { - "name": "editFolder", - "value": "Edit Folder" - }, - { - "name": "deleteFolder", - "value": "Delete Folder" - }, - { - "name": "createNote", - "value": "New note" - }, - { - "name": "cancel", - "value": "CANCEL" - }, - { - "name": "save", - "value": "SAVE" - }, - { - "name": "delete", - "value": "DELETE" - }, - { - "name": "delete_tips", - "value": "Do you want to delete this folder and its contents?" - }, - { - "name": "deleteNote", - "value": "Delete this note?" - }, - { - "name": "deleteNoteComplete", - "value": "Permanently delete this note?" - }, - { - "name": "deleteAllNote", - "value": "Delete all note?" - }, - { - "name": "deletePartNote", - "value": "Delete %d notes?" - }, - { - "name": "selected", - "value": "%d item selected" - }, - { - "name": "none_selected", - "value": "None selected" - }, - { - "name": "noteslist", - "value": "notes" - }, - { - "name": "Empty_page", - "value": "No notes" - }, - { - "name": "searchNote", - "value": "Search notes" - }, - { - "name": "chooseFolder", - "value": "Select folder" - }, - { - "name": "category_already_exist", - "value": "The folder name already exists." - }, - { - "name": "input_placeholder", - "value": "Name" - }, - { - "name": "permanently_delete_tips", - "value": "notes will be permanently deleted after the number of days shown (up to 30 days)." - }, - { - "name": "set_top", - "value": "Top" - }, - { - "name": "move", - "value": "Move" - }, - { - "name": "recover", - "value": "Restore" - }, - { - "name": "check_all", - "value": "Select all" - }, - { - "name": "editNoteTitle", - "value": "Modify the title" - }, - { - "name": "list", - "value": "Checklist" - }, - { - "name": "style", - "value": "Style" - }, - { - "name": "photo", - "value": "Gallery" - }, - { - "name": "title", - "value": "Title" - }, - { - "name": "empty_note", - "value": "The note content is empty." - }, - { - "name": "restore", - "value": "Note Restored" - } - ] -} \ No newline at end of file diff --git a/product/tablet/src/main/resources/rawfile/editor_style.css b/product/tablet/src/main/resources/rawfile/editor_style.css deleted file mode 100644 index abf650a..0000000 --- a/product/tablet/src/main/resources/rawfile/editor_style.css +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -html { - height: 15%; - font-family: sans-serif; - -webkit-text-size-adjust: 100%; -} - -body { - overflow: scroll; - display: table; - table-layout: fixed; - width: 100%; - min-height:100%; - color: #333333; - margin: 0; -} - -#editorjs { - padding-left: 24px; - padding-right: 24px; - width:100%; - display: table-cell; - outline: 0px solid transparent; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - color: #333333; - font-size:40px; -} - -#editorjs[placeholder]:empty:not(:focus):before { - content: attr(placeholder); - font-size:40px; - color: #9b9b9b; -} - -.note-checkbox:checked { - background: #F88805; - border: 2px solid #F88805; - outline: none; - margin-left:0px; - margin-right:0px; - opacity: 1; -} - -.note-checkbox { - width: 23px; - height: 23px; - background-color: #ffffff; - border: 2px solid #555555; --webkit-border-radius: 50%; --webkit-appearance: none; --webkit-user-select: none; - border-radius: 50%; - font-size: 0.8rem; - margin-left:0px; - margin-top:10px; - margin-right:0px; - margin-bottom:0px; - outline: none; - padding: 0; - position: relative; - display: inline-block; --webkit-transition: background-color ease 0.1s; - transition: background-color ease 0.1s; - vertical-align: top; - cursor: default; - user-select: none; -} - -.note-checkbox:checked+span{ - text-decoration: line-through; - color:#F88805; - opacity: 0.4; -} diff --git a/product/tablet/src/main/resources/zh_CN/element/string.json b/product/tablet/src/main/resources/zh_CN/element/string.json deleted file mode 100644 index 8ed957f..0000000 --- a/product/tablet/src/main/resources/zh_CN/element/string.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "备忘录" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "note", - "value": "笔记" - }, - { - "name": "allNotes", - "value": "全部笔记" - }, - { - "name": "unClassified", - "value": "未分类" - }, - { - "name": "recentDeletes", - "value": "最近删除" - }, - { - "name": "myFavorites", - "value": "我的收藏" - }, - { - "name": "create", - "value": "新建" - }, - { - "name": "createFolder", - "value": "新建文件夹" - }, - { - "name": "editFolder", - "value": "编辑文件夹" - }, - { - "name": "deleteFolder", - "value": "删除文件夹" - }, - { - "name": "createNote", - "value": "新建笔记" - }, - { - "name": "cancel", - "value": "取消" - }, - { - "name": "save", - "value": "保存" - }, - { - "name": "delete", - "value": "删除" - }, - { - "name": "delete_tips", - "value": "是否删除此文件夹及其中的内容?" - }, - { - "name": "deleteNote", - "value": "是否删除此笔记?" - }, - { - "name": "deleteNoteComplete", - "value": "此笔记将被永久删除,无法恢复。是否删除?" - }, - { - "name": "deleteAllNote", - "value": "是否删除全部笔记?" - }, - { - "name": "deletePartNote", - "value": "是否删除%d条笔记?" - }, - { - "name": "selected", - "value": "已选择%d项" - }, - { - "name": "none_selected", - "value": "未选择" - }, - { - "name": "noteslist", - "value": "条笔记" - }, - { - "name": "Empty_page", - "value": "没有笔记" - }, - { - "name": "searchNote", - "value": "搜索笔记..." - }, - { - "name": "chooseFolder", - "value": "请选择文件夹" - }, - { - "name": "category_already_exist", - "value": "文件夹名称已存在" - }, - { - "name": "input_placeholder", - "value": "名称" - }, - { - "name": "permanently_delete_tips", - "value": "笔记删除前会显示剩余天数(最长30天),之后将永久删除" - }, - { - "name": "set_top", - "value": "置顶" - }, - { - "name": "move", - "value": "移到" - }, - { - "name": "recover", - "value": "恢复" - }, - { - "name": "check_all", - "value": "多选" - }, - { - "name": "editNoteTitle", - "value": "修改标题" - }, - { - "name": "list", - "value": "清单" - }, - { - "name": "style", - "value": "样式" - }, - { - "name": "photo", - "value": "相册" - }, - { - "name": "title", - "value": "标题" - }, - { - "name": "empty_note", - "value": "笔记内容为空" - }, - { - "name": "restore", - "value": "已恢复" - } - ] -} \ No newline at end of file -- Gitee