From b7443bb4559edcbab2817c102471977737e7ca35 Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Sun, 14 Apr 2024 09:18:03 +0300 Subject: [PATCH] readerbookmark: annotations info methods --- .../apps/reader/modules/readerbookmark.lua | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/frontend/apps/reader/modules/readerbookmark.lua b/frontend/apps/reader/modules/readerbookmark.lua index 544e8168a..a68cad243 100644 --- a/frontend/apps/reader/modules/readerbookmark.lua +++ b/frontend/apps/reader/modules/readerbookmark.lua @@ -211,7 +211,7 @@ function ReaderBookmark:addToMainMenu(menu_items) menu_items.bookmark_search = { text = _("Bookmark search"), enabled_func = function() - return self:hasBookmarks() + return self.ui.annotation:hasAnnotations() end, callback = function() self:onSearchBookmark() @@ -444,29 +444,6 @@ end -- bookmarks misc info, helpers -function ReaderBookmark:hasBookmarks() - return #self.ui.annotation.annotations > 0 -end - -function ReaderBookmark:getNumberOfBookmarks() - return #self.ui.annotation.annotations -end - -function ReaderBookmark:getNumberOfHighlightsAndNotes() -- for Statistics plugin - local highlights = 0 - local notes = 0 - for _, item in ipairs(self.ui.annotation.annotations) do - if item.drawer then - if item.note then - notes = notes + 1 - else - highlights = highlights + 1 - end - end - end - return highlights, notes -end - function ReaderBookmark:getCurrentPageNumber() return self.ui.paging and self.view.state.page or self.ui.document:getXPointer() end