From cba609ed90e5e4a673609231fbddb74152d0cb67 Mon Sep 17 00:00:00 2001 From: troyeguo <13820674+troyeguo@users.noreply.github.com> Date: Sun, 2 Aug 2020 00:14:11 +0800 Subject: [PATCH] fix bug Former-commit-id: d435926ebce7406bfd39372855bbda538e60bb4d --- src/assets/locales/cn/translation.json | 3 +- src/assets/locales/en/translation.json | 4 +- src/assets/locales/tw/translation.json | 128 +++++++++++++++++++ src/assets/styles/fonts/icomoon.eot | Bin 14044 -> 18320 bytes src/assets/styles/fonts/icomoon.svg | 61 +++++---- src/assets/styles/fonts/icomoon.ttf | Bin 13880 -> 18156 bytes src/assets/styles/fonts/icomoon.woff | Bin 13956 -> 18232 bytes src/assets/styles/style.css | 116 ++++++++++++----- src/components/book/component.tsx | 2 +- src/components/bookItem/component.tsx | 20 ++- src/components/contentList/component.tsx | 44 ++++--- src/components/contentList/contentList.css | 12 +- src/components/importLocal/component.tsx | 4 +- src/components/popupNote/component.tsx | 10 +- src/components/popupOption/component.tsx | 13 +- src/components/searchBox/component.tsx | 2 +- src/containers/addDialog/component.tsx | 17 +++ src/containers/backupPage/component.tsx | 2 +- src/containers/bookList/component.tsx | 2 - src/containers/deleteDialog/component.tsx | 10 +- src/containers/digestList/component.tsx | 33 +++++ src/containers/digestList/digestList.css | 12 +- src/containers/digestList/interface.tsx | 4 + src/containers/header/component.tsx | 17 ++- src/containers/header/header.css | 6 + src/containers/header/interface.tsx | 2 +- src/containers/navigationPanel/component.tsx | 2 +- src/containers/noteList/component.tsx | 6 +- src/containers/noteList/noteList.css | 3 +- src/containers/operationPanel/component.tsx | 2 +- src/containers/popupMenu/component.tsx | 2 +- src/containers/progressPanel/component.tsx | 3 +- src/containers/sidebar/sidebar.css | 7 +- src/i18n.tsx | 5 +- src/model/Digest.ts | 10 +- src/model/Note.ts | 5 +- src/pages/manager/component.tsx | 6 +- src/redux/actions/progressPanel.tsx | 4 +- src/utils/deleteUtil.tsx | 4 +- src/utils/recordRecent.tsx | 1 - 40 files changed, 420 insertions(+), 164 deletions(-) create mode 100644 src/assets/locales/tw/translation.json diff --git a/src/assets/locales/cn/translation.json b/src/assets/locales/cn/translation.json index f03038f2..3bf3354a 100644 --- a/src/assets/locales/cn/translation.json +++ b/src/assets/locales/cn/translation.json @@ -80,6 +80,7 @@ "This action won't delete the original book": "仅从此书架中删除本书,原图书不受影响", "From": "来自", "Duplicate Book": "图书重复", + "Duplicate Shelf": "书架重复", "Unknown": "未知", "Minute": "分钟", "Empty": "书签为空", @@ -114,7 +115,7 @@ "Empty Shelf": "您的书架为空", "Move your mouse on the top of any book": "将鼠标移动到任意书本上方,在弹出的菜单中点击加号添加到书架", "This is a free and open-source Epub reader": "这是一个免费开源的Epub阅读器", - "Koodo Reader works on multiple platforms with backup and restore support": "Koodo Reader同时支持桌面版和网页版,您所有的数据都可以导入导出和支持多端同步", + "Koodo Reader works on multiple platforms with backup and restore support": "Koodo Reader同时支持桌面版和网页版,您所有的数据都可以导入导出和多端同步", "For better reading experience": "只为最好的阅读体验", "Supports for theme changing, reading history, book managerment, shelf managerment and more": "主题切换,阅读历史,图书管理,书架管理,更多功能等你探索", "Fluent and easy operation": "简单流畅的操作方式", diff --git a/src/assets/locales/en/translation.json b/src/assets/locales/en/translation.json index 6d9e1490..b61d1f10 100644 --- a/src/assets/locales/en/translation.json +++ b/src/assets/locales/en/translation.json @@ -19,6 +19,7 @@ "Entertainment": "Entertainment", "Study": "Study", "Author": "Author", + "Duplicate Shelf": "Duplicate Shelf", "Reading Time": "Reading Time", "Content": "Content", "Bookmark": "Bookmark", @@ -89,7 +90,8 @@ "Minute": "Minute", "Empty": "Empty", "Less": "Less", - "More": "More", + "More Digests": "More Digests", + "More Notes": "More Notes", "Pick Up Color": "Pick Up Color", "Highlight Successfully": "Highlight Successfully", "Take Notes": "Take Notes", diff --git a/src/assets/locales/tw/translation.json b/src/assets/locales/tw/translation.json new file mode 100644 index 00000000..724477b1 --- /dev/null +++ b/src/assets/locales/tw/translation.json @@ -0,0 +1,128 @@ +{ + "Download Demo Book": "下載範例圖書", + "All Books": "全部圖書", + "Recent Books": "最近閱讀", + "My Bookmarks": "我的書籤", + "My Notes": "我的筆記", + "My Digests": "我的書摘", + "My Shelves": "我的書架", + "Sort": "排序", + "Authorizing": "授權中,請稍候", + "Downloading": "下載中,請稍候", + "Uploading": "上傳中,請稍候", + "Import from Local": "從本機導入", + "Backup and Restore": "備份和恢復", + "Search My Library": "搜索我的書庫", + "Card Mode": "卡片模式", + "List Mode": "列表模式", + "More Digests": "顯示書摘出處", + "More Notes": "顯示筆記出處", + "Work": "工作學習", + "Entertainment": "休閒娛樂", + "Study": "生活百科", + "Author": "作者", + "Reading Time": "已讀", + "Content": "目錄", + "Bookmark": "書籤", + "Single-Page Mode": "單頁模式", + "Double-Page Mode": "雙頁模式", + "Background Color": "背景顏色", + "Font Size": "字體大小", + "Font Family": "字體", + "Default": "預設", + "Small": "小", + "Medium": "中", + "Large": "大", + "Extra Large": "特大", + "Ultra Large": "超大", + "Reading Option": "閱讀選項", + "Current Progress": "當前進度", + "Exit": "結束閱讀", + "Empty Shelf Title": "書架名為空", + "Enter Fullscreen": "進入全螢幕", + "Exit Fullscreen": "退出全螢幕", + "Add Bookmark": "添加書籤", + "Add to Shelf": "添加到書架", + "New Shelf": "新建", + "New": "新建書架", + "Copy Successfully": "複製成功", + "Cancel": "取消", + "Confirm": "確認", + "Delete": "刪除", + "Delete This Book": "刪除這本書", + "Edit Book": "編輯圖書", + "Edit Successfully": "編輯成功", + "Book Name": "書名", + "Sort by Date": "按添加時間", + "Descending Order": "倒序", + "Ascending Order": "正序", + "Sort by Name": "按名稱", + "Copy Link Successfully": "鏈接複製成功", + "Add Successfully": "添加成功", + "Select": "選擇", + "Coming Soon": "敬請期待", + "Authorize Successfully": "授權成功", + "Authorize Failed": "授權失敗", + "You can turn off this tab now": "您可以關閉此標籤頁了", + "Do you want to backup or restore?": "您想要備份還是恢復?", + "Where is your data?": "您的資料保存在哪裡?", + "Where to keep your data?": "您想把資料存在哪裡?", + "I want to backup": "我要備份", + "I want to restore": "我要還原", + "Backup Successfully": "備份成功", + "Restore Successfully": "還原成功", + "Try refresh or restart": "重新整理後生效", + "Wrong bookmark": "書籤出問題了", + "Last Step": "上一步", + "Next Step": "下一步", + "Go To": "點擊前往", + "Delete from Shelf": "從書架刪除本書", + "Delete Successfully": "刪除成功", + "This action will delete all the notes, bookmarks and digests of this book": "同時刪除本書所有的書籤,筆記,書摘", + "This action won't delete the original book": "僅從此書架中刪除本書,原圖書不受影響", + "From": "來自", + "Duplicate Book": "圖書重複", + "Unknown": "未知", + "Minute": "分鐘", + "Empty": "書籤為空", + "Less": "收起", + "Pick Up Color": "選擇顏色", + "Highlight Successfully": "高亮成功", + "Take Notes": "記筆記", + "Collect": "摘錄", + "Highlight": "高亮", + "Copy": "複製", + "Bind": "綁定", + "Token": "憑證", + "Token Info": "請複製以下鏈接到瀏覽器打開,登錄授權後,您將獲得一串代碼,請將代碼填入以下輸入框即可完成綁定", + "Copy Link": "複製鏈接", + "Copy Token": "複製憑證", + "Copied": "已複製", + "Hi! Stranger": "你好啊!朋友", + "Skip": "不再提示", + "Local": "本機", + "Line Height": "行間距", + "Empty Library": "圖書庫為空", + "Click the top-right button to add books": "請點擊右上角的導入圖書按鈕添加圖書", + "Empty Reading Records": "您沒有閱讀記錄", + "Click on any book to read": "點擊任意一本書開始閱讀", + "Empty Bookmark": "您的書籤為空", + "Move your mouse on the top edge of the reader": "在閱讀器界面,將滑鼠游標移至上邊緣處,在彈出的選單欄中添加書籤", + "Empty Note": "您的筆記為空", + "Select any text and click the Add-Note button on the popup Menu": "在閱讀器界面,選中文字後,在彈出的對話框中添加筆記", + "Empty Digest": "您的書摘為空", + "Select any text and click the Collect button on the popup Menu": "在閱讀器界面,選中文字後,在彈出的對話框中點擊摘錄", + "Empty Shelf": "您的書架為空", + "Move your mouse on the top of any book": "將滑鼠游標移動到任意書本上方,在彈出的菜單中點擊加號添加到書架", + "This is a free and open-source Epub reader": "這是一個免費開源的Epub閱讀器", + "Koodo Reader works on multiple platforms with backup and restore support": "Koodo Reader同時支持桌面版和網頁版,您所有的資料都可以導入導出和支持多端同步", + "For better reading experience": "只為最好的閱讀體驗", + "Supports for theme changing, reading history, book managerment, shelf managerment and more": "主題切換,閱讀歷史,圖書管理,書架管理,更多功能等你探索", + "Fluent and easy operation": "簡單流暢的操作方式", + "Move your mouse to the edge of the reader to trigger menu,use mouse wheel and keyborad to switch pages": "鼠標移至邊緣彈出選單,使用滑鼠滾輪或鍵盤的上下左右按鍵控制翻頁", + "Go to Add your first book": "快去添加您的第一本書吧", + "That's all for the tutorial": "介紹完畢", + "Download failed,network problem or no backup": "下載失敗,網路出錯或者沒有找到備份", + "Upload failed, check your connection": "上傳失敗,請檢查網路連接", + "Duplicate Shelf": "書架重複" +} diff --git a/src/assets/styles/fonts/icomoon.eot b/src/assets/styles/fonts/icomoon.eot index b8ad62ac56b5406a5e613c42bfbb0a0ed24bd908..aa28a62a0537af9ed93bea53d1258c355be615e9 100644 GIT binary patch delta 5901 zcmbVQYmgk(b?$Tf-7`HiJ^h-U_e{@wA2YMFGqbDJ?&z^A3538xLQ-H?TA?>a21*L% zQFxR%1%*TaXPt@-4j4ir3KCL8gdf4d5{b(;g(>2)9f(~iqPQGXc8r~>1S*z#b8h#p z5Gl%eOig#+d(J)go_o)C9^F4W`sgDdJi3u#ezxHYLWeVVzV?kTthuu>oe0_t@?Dj9~v!d`gFIz5C#{*YEi;_P@k1YrlHDJr!?G3RPQGVtt$iM&S-n(vR>Nmn9 z!^{?tkp0ZwqX)ixwfrmW&!E8lx8HW`IKv``+3*JCGc5P%#r-f%F3c=G1C#4_Au)>j zu?%5=$zBLtur7>TSbJe+>C(~?6+;?xLA?;WFuF{GrGK_Lo3)9xWL-izSUlI!7gJ=W zkIO85og?fyrobF!Uc%)=AT|XN@AT&6OXcPWw8uK#CQL(X)Uumtuwk`N>iVR18cahF zn&S~SEt6>8AkcJFi%k2NQB8s=iN@ZsRWp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9rQO_U`6t;YD9QB1zWoP) zlLylE$`4%ZDUMiwN&G3WUWq zY@l@eiJxV0z1vp0mAS%7!|qSAg!QM;r2nxnE4uk?@%)CCME|{exm*r^x%=^*^0$M} z4BkKM15feq%Qwn-cBA!vYb$#%Sl$^dUnA_Ba=uhtUcw^F{8)Orp~fo+$O7qVsa`r-VG>_h2$nr%eA_ zfnl8}u}+M|X-1n{;%)dOrkd$^EK05dlDmqPjJC)BW~G;+d5!3`#Jt7WUMF^8xIIp> z<1V)1Lpa<{u*%np6vI!XLS*7S*o}Two}#peD<@+N3c~|~hhsDj4-O1h?>F~t+TBQF z_olwhRr}A4Wv1mhj%S&!-~tha5Vnq}+gxb0uL&5g)Gf{!nU*AiZWBygOA5)k#u$6` z?W58rgua3;kG^X-v?t3kKCy$EP!uUNTYj|UfJZA_tTy{diIsA3Mp`u#j7HGZ9I4k> z`>19@gcdMIf)PU+nkZ-iLoTmOy|f=edF_7a8pCgr1d4LnD)9!D}@Q# zze-yZlIj&)krr8?{XkOd_|B|xRwZtRF9NlYqVMWn6BpjsBy`zl#fOJqIg+?LYjT z(gx{~(`Ol-Bv|HGVH`Ca>OZCC6nV(+DeWyegsPi{K;an2WIz)JXR4UaapGy(h^9n6 zHAVI4WKdyDJ!A+u$k98p4pvaFu{o8&bRtq04&tf=Jsx^&6}h^-Nw;F+k+eKfUO>A zfUj@A-@CLf%oas&GUz|vzMFm+6y3fyT@Z~=7bklg>kL8#J?ScfI9^#V7SHz%6taY= zne$Iu5QavWfgj*5uE9$z$|l$~-p{8+Sgh4fX_xgEWWPLOtTo;+-?X+^)7DLU$o|lt zb9$W50+WF&Zl}A+J?35xt`5ExJYDnUvMsfb*Up5q;Ysgu-HVYU^@r - - - - - - - - - - - + + + + + + + + + + + - - - + + - - - - - - + + + + - + @@ -51,7 +48,23 @@ - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/styles/fonts/icomoon.ttf b/src/assets/styles/fonts/icomoon.ttf index 268d556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3|+S=qrP!BFTN-C0v# zUvul!InyxAU^?gFkPU@`nRM`ceN9dMd8694tBsIK;@RqTI}UFTti47ou2Pe4etENd zXlTLaeH);YV&KJ7c` zoAYP { { this.props.handleReadingBook(this.props.book); }; render() { - let date = - RecordRecent.getRecent()[this.props.book.key] !== null && - RecordRecent.getRecent()[this.props.book.key] !== undefined - ? RecordRecent.getRecent()[this.props.book.key].date - : { year: "0000", month: "00", day: "00" }; - let percentage = - RecordLocation.getCfi(this.props.book.key) !== null && - RecordLocation.getCfi(this.props.book.key) !== undefined - ? RecordLocation.getCfi(this.props.book.key).percentage - : 0; + let date = RecordRecent.getRecent()[this.props.book.key] + ? RecordRecent.getRecent()[this.props.book.key].date + : { year: "0000", month: "00", day: "00" }; + let percentage = RecordLocation.getCfi(this.props.book.key) + ? RecordLocation.getCfi(this.props.book.key).percentage + : 0; return (
{ {"" + date.year + "-" + date.month + "-" + date.day}

- {this.props.percentage !== null ? Math.round(percentage * 100) : 0}% + {this.props.percentage ? Math.round(percentage * 100) : 0}%

{ this.props.currentEpub.goto(href); } render() { - const renderContentList = () => { - return this.state.chapters.map((item: any, index: number) => { - let isSubContentList = item.subitems && item.subitems.length; - const renderSubContentList = () => { - return item.subitems.map((item: any, index: number) => { - return ( -
  • - - {item.label} - -
  • - ); - }); - }; + const renderContentList = (items: any) => { + return items.map((item: any, index: number) => { return ( -
  • +
  • { > {item.label} - {isSubContentList ?
      {renderSubContentList()}
    : null} + {item.subitems.length > 0 ? ( +
      {renderContentList(item.subitems)}
    + ) : null}
  • ); }); }; + // return ( + //
  • + // + // {item.label} + // + // {item.subitems.length > 0 ? ( + //
      {renderSubContentList(item.subitems)}
    + // ) : null} + //
  • + // ); return (
    -
      {renderContentList()}
    +
      + {renderContentList(this.state.chapters)} +
    ); } diff --git a/src/components/contentList/contentList.css b/src/components/contentList/contentList.css index c6a9cf26..c68c1bb7 100644 --- a/src/components/contentList/contentList.css +++ b/src/components/contentList/contentList.css @@ -1,16 +1,14 @@ .book-content-list { float: left; - - width: 220px; - + width: calc(100% - 20px); margin-left: 18px; } .book-content-name { display: block; - width: 282px; + padding: 10px 0px; + width: 100%; font-size: 14px; - - line-height: 48px; + line-height: 18px; color: rgba(75, 75, 75, 1); opacity: 1; float: left; @@ -22,7 +20,7 @@ width: 220px; float: left; font-size: 13px; - + line-height: 20px; color: rgba(75, 75, 75, 1); opacity: 0.64; diff --git a/src/components/importLocal/component.tsx b/src/components/importLocal/component.tsx index 20d19838..4c9b2307 100644 --- a/src/components/importLocal/component.tsx +++ b/src/components/importLocal/component.tsx @@ -7,7 +7,6 @@ import SparkMD5 from "spark-md5"; import { Trans } from "react-i18next"; import Dropzone from "react-dropzone"; import { ImportLocalProps, ImportLocalState } from "./interface"; -import OtherUtil from "../../utils/otherUtil"; import RecordRecent from "../../utils/recordRecent"; class ImportLocal extends React.Component { @@ -27,7 +26,6 @@ class ImportLocal extends React.Component { localforage.setItem("books", bookArr).then(() => { this.props.handleFetchBooks(); }); - OtherUtil.setReaderConfig("isBookImported", "yes"); this.props.handleMessage("Add Successfully"); this.props.handleMessageBox(true); }; @@ -70,7 +68,7 @@ class ImportLocal extends React.Component { }; handleBook = (file: any, md5: string) => { //md5重复不导入 - if (this.props.books !== null) { + if (this.props.books) { this.props.books.forEach((item) => { if (item.md5 === md5) { this.setState({ isRepeat: true }); diff --git a/src/components/popupNote/component.tsx b/src/components/popupNote/component.tsx index b3d75df2..b21e9430 100644 --- a/src/components/popupNote/component.tsx +++ b/src/components/popupNote/component.tsx @@ -33,6 +33,7 @@ class PopupNote extends React.Component { text = text && text.trim(); let cfiBase = epub.renderer.currentChapter.cfiBase; let cfi = new window.EPUBJS.EpubCFI().generateCfiFromRange(range, cfiBase); + let percentage = this.props.currentEpub.locations.percentageFromCfi(cfi); let bookKey = book.key; let charRange = window.rangy .getSelection(iframe) @@ -42,11 +43,10 @@ class PopupNote extends React.Component { let index = this.props.chapters.findIndex((item: any) => { return item.spinePos > epub.renderer.currentChapter.spinePos; }); - let chapter = - this.props.chapters[index] !== undefined - ? this.props.chapters[index].label.trim(" ") - : "Unknown"; - let note = new Note(bookKey, chapter, text, cfi, serial, notes); + let chapter = this.props.chapters[index] + ? this.props.chapters[index].label.trim(" ") + : "Unknown"; + let note = new Note(bookKey, chapter, text, cfi, serial, notes, percentage); let noteArr = this.props.notes ? this.props.notes : []; noteArr.push(note); localforage.setItem("notes", noteArr); diff --git a/src/components/popupOption/component.tsx b/src/components/popupOption/component.tsx index 2127d55c..19cfd88b 100644 --- a/src/components/popupOption/component.tsx +++ b/src/components/popupOption/component.tsx @@ -51,18 +51,17 @@ class PopupOption extends React.Component { cfiBase ); let bookKey = book.key; - + let percentage = this.props.currentEpub.locations.percentageFromCfi(cfi); //获取章节名 let index = this.props.chapters.findIndex((item: any) => { return item.spinePos > epub.renderer.currentChapter.spinePos; }); - let chapter = - this.props.chapters[index] !== undefined - ? this.props.chapters[index].label.trim(" ") - : "Unknown"; + let chapter = this.props.chapters[index] + ? this.props.chapters[index].label.trim(" ") + : "Unknown"; // let chapter = epub.renderer.currentChapter.spinePos; - let digest = new Digest(bookKey, chapter, text, cfi); + let digest = new Digest(bookKey, chapter, text, cfi, percentage); let digestArr = this.props.digests ? this.props.digests : []; digestArr.push(digest); localforage.setItem("digests", digestArr); @@ -122,7 +121,7 @@ class PopupOption extends React.Component { }} >
    - +

    Copy

    diff --git a/src/components/searchBox/component.tsx b/src/components/searchBox/component.tsx index c40bae02..359ae4f5 100644 --- a/src/components/searchBox/component.tsx +++ b/src/components/searchBox/component.tsx @@ -11,7 +11,7 @@ class SearchBox extends React.Component { }; handleKey = (event: any) => { let results = OtherUtil.KeySearch(event, this.props.books); - if (results !== undefined) { + if (results) { this.props.handleSearchBooks(results); this.props.handleSearch(true); } diff --git a/src/containers/addDialog/component.tsx b/src/containers/addDialog/component.tsx index fa3dc042..16a884f4 100644 --- a/src/containers/addDialog/component.tsx +++ b/src/containers/addDialog/component.tsx @@ -19,14 +19,31 @@ class AddDialog extends Component { ".add-dialog-new-shelf-box" ) as HTMLInputElement; let shelfTitle: string = this.state.shelfTitle; + let shelfList = ShelfUtil.getShelf(); + if (this.state.isNew) { shelfTitle = inputElement.value; + if (shelfList.hasOwnProperty(shelfTitle)) { + this.props.handleMessage("Duplicate Shelf"); + this.props.handleMessageBox(true); + return; + } } if (!shelfTitle) { this.props.handleMessage("Empty Shelf Title"); this.props.handleMessageBox(true); return; } + //判断书架中是否已有该图书 + if ( + shelfList[`${shelfTitle}`] && + shelfList[`${shelfTitle}`].indexOf(this.props.currentBook.key) > -1 + ) { + this.props.handleMessage("Duplicate Book"); + this.props.handleMessageBox(true); + return; + } + ShelfUtil.setShelf(shelfTitle, this.props.currentBook.key); this.props.handleAddDialog(false); this.props.handleMessage("Add Successfully"); diff --git a/src/containers/backupPage/component.tsx b/src/containers/backupPage/component.tsx index 91350b88..0fb5f484 100644 --- a/src/containers/backupPage/component.tsx +++ b/src/containers/backupPage/component.tsx @@ -230,7 +230,7 @@ class BackupPage extends React.Component { onClick={() => { this.setState({ currentStep: 1 }); }} - style={this.state.isBackup !== null ? {} : { display: "none" }} + style={this.state.isBackup ? {} : { display: "none" }} > Next Step
    diff --git a/src/containers/bookList/component.tsx b/src/containers/bookList/component.tsx index 3b152772..2908d583 100644 --- a/src/containers/bookList/component.tsx +++ b/src/containers/bookList/component.tsx @@ -57,13 +57,11 @@ class BookList extends React.Component { arr.forEach((item) => { itemArr.push(items[item]); }); - console.log(itemArr, "arr", this.props.isSort, this.props.isSearch); return itemArr; }; render() { OtherUtil.setReaderConfig("totalBooks", this.props.books.length.toString()); const renderBookList = () => { - console.log(this.props.isSort, "this.props.isSort"); //根据不同的场景获取不同的图书数据 let books = this.props.shelfIndex !== -1 diff --git a/src/containers/deleteDialog/component.tsx b/src/containers/deleteDialog/component.tsx index 5e60a0ae..f2270b79 100644 --- a/src/containers/deleteDialog/component.tsx +++ b/src/containers/deleteDialog/component.tsx @@ -12,7 +12,7 @@ class DeleteDialog extends React.Component { this.props.handleDeleteDialog(false); }; handleDeleteOther = () => { - if (this.props.bookmarks !== null) { + if (this.props.bookmarks) { let bookmarkArr = DeleteUtil.deleteBookmarks( this.props.bookmarks, this.props.currentBook.key @@ -27,7 +27,7 @@ class DeleteDialog extends React.Component { }); } } - if (this.props.notes !== null) { + if (this.props.notes) { let noteArr = DeleteUtil.deleteNotes( this.props.notes, this.props.currentBook.key @@ -42,7 +42,7 @@ class DeleteDialog extends React.Component { }); } } - if (this.props.digests !== null) { + if (this.props.digests) { let digestArr = DeleteUtil.deleteDigests( this.props.digests, this.props.currentBook.key @@ -57,7 +57,7 @@ class DeleteDialog extends React.Component { }); } } - if (this.props.highlighters !== null) { + if (this.props.highlighters) { let highlighterArr = DeleteUtil.deleteHighlighters( this.props.highlighters, this.props.currentBook.key @@ -79,7 +79,7 @@ class DeleteDialog extends React.Component { ShelfUtil.clearShelf(this.props.shelfIndex, this.props.currentBook.key); this.props.handleDeleteDialog(false); } else { - this.props.books !== null && + this.props.books && localforage .setItem( "books", diff --git a/src/containers/digestList/component.tsx b/src/containers/digestList/component.tsx index d954fde6..a635cfb2 100644 --- a/src/containers/digestList/component.tsx +++ b/src/containers/digestList/component.tsx @@ -5,6 +5,8 @@ import DigestModel from "../../model/Digest"; import { Trans } from "react-i18next"; import { DigestListProps, DigestListStates } from "./interface"; import DeleteIcon from "../../components/deleteIcon"; +import RecentBooks from "../../utils/recordRecent"; +import RecordLocation from "../../utils/recordLocation"; class DigestList extends React.Component { constructor(props: DigestListProps) { @@ -26,6 +28,24 @@ class DigestList extends React.Component { handleShowDelete = (deleteKey: string) => { this.setState({ deleteKey }); }; + handleJump = (cfi: string, bookKey: string, percentage: number) => { + let { books, epubs } = this.props; + let book = null; + let epub = null; + //根据bookKey获取指定的book和epub + for (let i = 0; i < books.length; i++) { + if (books[i].key === bookKey) { + book = books[i]; + epub = epubs[i]; + break; + } + } + this.props.handleReadingBook(book!); + this.props.handleReadingEpub(epub); + this.props.handleReadingState(true); + RecentBooks.setRecent(bookKey); + RecordLocation.recordCfi(bookKey, cfi, percentage); + }; render() { let { digests } = this.props; let digestArr = []; @@ -95,6 +115,19 @@ class DigestList extends React.Component {
    》{item.chapter}
    +
    { + this.handleJump(item.cfi, item.bookKey, item.percentage); + }} + > +
    + {"More Digests"} + +
    +
    ); diff --git a/src/containers/digestList/digestList.css b/src/containers/digestList/digestList.css index 5ba070d0..94600d94 100644 --- a/src/containers/digestList/digestList.css +++ b/src/containers/digestList/digestList.css @@ -54,7 +54,7 @@ cursor: pointer; font-size: 16px; width: calc(50vw - 140px); - height: 126px; + height: 146px; background: rgba(255, 255, 255, 1); box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.16); opacity: 1; @@ -78,18 +78,15 @@ max-width: 130px; } .digest-list-item-citation { + font-size: 16px; position: absolute; - bottom: 5px; + bottom: 30px; right: 5px; - /* text-align: right; */ margin: 5px; white-space: nowrap; white-space: normal; word-break: break-all; color: rgba(155, 155, 155, 1); - - /* width: 300px; */ - /* text-align: right; */ } .digest-list-item-text-parent { position: absolute; @@ -131,3 +128,6 @@ .digest-list-container-box { margin-top: 35px; } +.icon-digest-right { + margin: 5px; +} diff --git a/src/containers/digestList/interface.tsx b/src/containers/digestList/interface.tsx index 50fd11e6..5e983716 100644 --- a/src/containers/digestList/interface.tsx +++ b/src/containers/digestList/interface.tsx @@ -8,7 +8,11 @@ export interface DigestListProps { bookmarks: BookmarkModel[]; chapters: any; books: BookModel[]; + epubs: any; digests: DigestModel[]; + handleReadingState: (isReading: boolean) => void; + handleReadingBook: (currentBook: BookModel) => void; + handleReadingEpub: (currentEpub: any) => void; } export interface DigestListStates { deleteKey: string; diff --git a/src/containers/header/component.tsx b/src/containers/header/component.tsx index 5054b5b8..12ade0b6 100644 --- a/src/containers/header/component.tsx +++ b/src/containers/header/component.tsx @@ -14,8 +14,8 @@ class Header extends React.Component { this.state = { isOnlyLocal: false, isBookImported: - OtherUtil.getReaderConfig("isBookImported") === "yes" ? true : false, - isChinese: OtherUtil.getReaderConfig("lang") === "cn", + OtherUtil.getReaderConfig("totalBooks") !== "0" ? true : false, + language: OtherUtil.getReaderConfig("lang"), isNewVersion: false, }; } @@ -23,12 +23,12 @@ class Header extends React.Component { const lng = OtherUtil.getReaderConfig("lang"); if (lng) { i18n.changeLanguage(lng); - this.setState({ isChinese: !this.state.isChinese }); + this.setState({ language: lng }); } } changeLanguage = (lng: string) => { i18n.changeLanguage(lng); - this.setState({ isChinese: !this.state.isChinese }); + this.setState({ language: lng }); OtherUtil.setReaderConfig("lang", lng); }; handleSortBooks = () => { @@ -59,9 +59,14 @@ class Header extends React.Component {
    - {this.state.isChinese ? ( + {this.state.language === "cn" ? ( this.changeLanguage("tw")} + > + ) : this.state.language === "en" ? ( + this.changeLanguage("cn")} > ) : ( diff --git a/src/containers/header/header.css b/src/containers/header/header.css index 0193fbaf..55467223 100644 --- a/src/containers/header/header.css +++ b/src/containers/header/header.css @@ -108,3 +108,9 @@ color: rgba(75, 75, 75, 1); cursor: pointer; } +.icon-traditional, +.icon-simplified, +.icon-english { + font-size: 25px; + color: rgba(75, 75, 75, 1); +} diff --git a/src/containers/header/interface.tsx b/src/containers/header/interface.tsx index a06c7a15..1f1a38d1 100644 --- a/src/containers/header/interface.tsx +++ b/src/containers/header/interface.tsx @@ -13,6 +13,6 @@ export interface HeaderProps { export interface HeaderState { isOnlyLocal: boolean; isBookImported: boolean; - isChinese: boolean; + language:string; isNewVersion: boolean; } diff --git a/src/containers/navigationPanel/component.tsx b/src/containers/navigationPanel/component.tsx index dc23dacf..22527de1 100644 --- a/src/containers/navigationPanel/component.tsx +++ b/src/containers/navigationPanel/component.tsx @@ -103,7 +103,7 @@ class NavigationPanel extends React.Component<
    {this.state.isContentShow ? ( - ) : this.props.bookmarks !== null ? ( + ) : this.props.bookmarks ? ( ) : (
    diff --git a/src/containers/noteList/component.tsx b/src/containers/noteList/component.tsx index 94a9d6fc..40ced5cc 100644 --- a/src/containers/noteList/component.tsx +++ b/src/containers/noteList/component.tsx @@ -52,7 +52,7 @@ class NoteList extends React.Component { //获取笔记日期列表 for (let i = 1; i < noteArr.length; i++) { if ( - noteArr[i].date !== undefined && + noteArr[i].date && (noteArr[i].date.year !== temp.year || noteArr[i].date.month !== temp.month || noteArr[i].date.day !== temp.day) @@ -89,7 +89,7 @@ class NoteList extends React.Component {
  • { this.handleShowDelete(item.key); }} @@ -117,7 +117,7 @@ class NoteList extends React.Component { : {} } > - {isCurrent ? "Less" : "More"} + {isCurrent ? "Less" : "More Notes"}
  • {isCurrent ? null : ( diff --git a/src/containers/noteList/noteList.css b/src/containers/noteList/noteList.css index a01e7c4e..8ba1852a 100644 --- a/src/containers/noteList/noteList.css +++ b/src/containers/noteList/noteList.css @@ -132,12 +132,11 @@ white-space: nowrap; white-space: normal; word-break: break-all; - color: rgba(191, 191, 191, 1); + color: rgba(75, 75, 75, 1); margin-right: 20px !important; margin-top: 5px; float: right; font-size: 15px; - color: rgba(155, 155, 155, 1); } .note-list-item-text { /* text-align: right; */ diff --git a/src/containers/operationPanel/component.tsx b/src/containers/operationPanel/component.tsx index fe669bf9..803e14df 100644 --- a/src/containers/operationPanel/component.tsx +++ b/src/containers/operationPanel/component.tsx @@ -86,7 +86,7 @@ class OperationPanel extends React.Component< return item.spinePos > this.props.currentEpub.spinePos; }); let chapter = "未知章节"; - if (this.props.chapters[index] !== undefined) { + if (this.props.chapters[index]) { chapter = this.props.chapters[index].label.trim(" "); } let bookmark = new Bookmark(bookKey, cfi, label, percentage, chapter); diff --git a/src/containers/popupMenu/component.tsx b/src/containers/popupMenu/component.tsx index 70a21378..b86ebc11 100644 --- a/src/containers/popupMenu/component.tsx +++ b/src/containers/popupMenu/component.tsx @@ -110,7 +110,7 @@ class PopupMenu extends React.Component { this.highlighter && this.highlighter.removeAllHighlights(); // 为了避免下次反序列化失败,必须先清除已有的高亮 let classes = ["color-0", "color-1", "color-2", "color-3"]; - highlightersByChapter !== null && + highlightersByChapter && highlightersByChapter.forEach((item) => { this.key = item.key; //控制渲染指定图书的指定高亮 diff --git a/src/containers/progressPanel/component.tsx b/src/containers/progressPanel/component.tsx index cf012bf1..33c863ab 100644 --- a/src/containers/progressPanel/component.tsx +++ b/src/containers/progressPanel/component.tsx @@ -11,8 +11,7 @@ class ProgressPanel extends React.Component< constructor(props: ProgressPanelProps) { super(props); this.state = { - displayPercentage: - this.props.percentage !== undefined ? this.props.percentage : 0, + displayPercentage: this.props.percentage ? this.props.percentage : 0, }; } //WARNING! To be deprecated in React v17. Use componentDidMount instead. diff --git a/src/containers/sidebar/sidebar.css b/src/containers/sidebar/sidebar.css index 56829569..e564f99b 100644 --- a/src/containers/sidebar/sidebar.css +++ b/src/containers/sidebar/sidebar.css @@ -63,16 +63,13 @@ } .shelf-list-container-parent { margin-top: 20px; - height: 120px; - width: 100%; - overflow: hidden; + height: 140px; + width: 80%; } .shelf-list-container { width: 100%; height: 100%; overflow-y: scroll; - padding-right: 17px; /* Increase/decrease this value for cross-browser compatibility */ - box-sizing: content-box; list-style-type: none; cursor: pointer; text-overflow: ellipsis; diff --git a/src/i18n.tsx b/src/i18n.tsx index 718f0a58..f5833a4f 100644 --- a/src/i18n.tsx +++ b/src/i18n.tsx @@ -3,6 +3,7 @@ import { reactI18nextModule } from "react-i18next"; import detector from "i18next-browser-languagedetector"; import translationEN from "./assets/locales/en/translation.json"; import translationCN from "./assets/locales/cn/translation.json"; +import translationTW from "./assets/locales/tw/translation.json"; // the translations const resources = { @@ -12,6 +13,9 @@ const resources = { cn: { translation: translationCN, }, + tw: { + translation: translationTW, + }, }; i18n @@ -22,7 +26,6 @@ i18n lng: "cn", fallbackLng: "en", keySeparator: false, // we do not use keys in form messages.welcome - interpolation: { escapeValue: false, // react already safes from xss }, diff --git a/src/model/Digest.ts b/src/model/Digest.ts index 76e71334..69303788 100644 --- a/src/model/Digest.ts +++ b/src/model/Digest.ts @@ -5,7 +5,14 @@ class Digest { chapter: string; text: string; cfi: string; - constructor(bookKey: string, chapter: string, text: string, cfi: string) { + percentage: number; + constructor( + bookKey: string, + chapter: string, + text: string, + cfi: string, + percentage: number + ) { this.key = new Date().getTime() + ""; //书摘的键值 this.date = { year: new Date().getFullYear(), @@ -16,6 +23,7 @@ class Digest { this.chapter = chapter; //书摘的所在章节 this.text = text; //书摘的内容 this.cfi = cfi; //书摘的所在位置 + this.percentage = percentage; //书摘的所在位置 } } diff --git a/src/model/Note.ts b/src/model/Note.ts index 2fc4b7e5..a965ef0f 100644 --- a/src/model/Note.ts +++ b/src/model/Note.ts @@ -7,13 +7,15 @@ class Note { cfi: string; range: string; notes: string; + percentage: number; constructor( bookKey: string, chapter: string, text: string, cfi: string, range: string, - notes: string + notes: string, + percentage: number ) { this.key = new Date().getTime() + ""; //笔记的键值 this.bookKey = bookKey; //笔记的所在书的键值 @@ -27,6 +29,7 @@ class Note { this.cfi = cfi; //添加笔记的位置 this.range = range; // Rangy.js产生的将Range对象序列化后的字符串 this.notes = notes || ""; //笔记的内容 + this.percentage = percentage; //笔记的内容 } } diff --git a/src/pages/manager/component.tsx b/src/pages/manager/component.tsx index 6b038ae8..0b8c4868 100644 --- a/src/pages/manager/component.tsx +++ b/src/pages/manager/component.tsx @@ -147,11 +147,11 @@ class Manager extends React.Component { (mode === "recent" && recentBooks !== 0) || mode === "shelf") ? ( - ) : bookmarks !== null && mode === "bookmark" ? ( + ) : bookmarks && mode === "bookmark" ? ( - ) : notes !== null && notes !== undefined && mode === "note" ? ( + ) : notes && mode === "note" ? ( - ) : digests !== null && mode === "digest" ? ( + ) : digests && mode === "digest" ? ( ) : ( diff --git a/src/redux/actions/progressPanel.tsx b/src/redux/actions/progressPanel.tsx index 55098a39..e15c76d8 100644 --- a/src/redux/actions/progressPanel.tsx +++ b/src/redux/actions/progressPanel.tsx @@ -13,16 +13,16 @@ export function handleFetchPercentage(book: { key: string }) { } export function handleFetchLocations(epub: any) { return (dispatch: (arg0: { type: string; payload: any }) => void) => { - if (epub.locations !== undefined) { + epub.locations && epub.locations .generate() .then((result: any) => { let locations = epub.locations; + console.log(locations, "locations"); dispatch(handleLocations(locations)); }) .catch(() => { console.log("Error occurs"); }); - } }; } diff --git a/src/utils/deleteUtil.tsx b/src/utils/deleteUtil.tsx index 2aa8bbb5..e4ff654d 100644 --- a/src/utils/deleteUtil.tsx +++ b/src/utils/deleteUtil.tsx @@ -5,7 +5,7 @@ import HighligherModel from "../model/Highlighter"; import BookmarkModel from "../model/Bookmark"; class DeleteUtil { static deleteBook(books: BookModel[], bookKey: string) { - let deleteIndex=-1; + let deleteIndex = -1; for (let i = 0; i < books.length; i++) { if (books[i].key === bookKey) { deleteIndex = i; @@ -41,7 +41,7 @@ class DeleteUtil { } static deleteDigests(digests: DigestModel[], bookKey: string) { let deleteIndex = []; - if (digests !== undefined) { + if (digests) { for (let i = 0; i < digests.length; i++) { if (digests[i].bookKey === bookKey) { deleteIndex.push(i); diff --git a/src/utils/recordRecent.tsx b/src/utils/recordRecent.tsx index 34a614cc..a8ac9951 100644 --- a/src/utils/recordRecent.tsx +++ b/src/utils/recordRecent.tsx @@ -15,7 +15,6 @@ class RecordRecent { bookArr.unshift(bookKey); } - console.log(bookArr); localStorage.setItem("recentBooks", JSON.stringify(bookArr)); } static setAllRecent(books: BookModel[]) {