|
|
@ -55,6 +55,14 @@ function ReaderBookmark:addToMainMenu(menu_items)
|
|
|
|
self:onShowBookmark()
|
|
|
|
self:onShowBookmark()
|
|
|
|
end,
|
|
|
|
end,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if not Device:isTouchDevice() then
|
|
|
|
|
|
|
|
menu_items.toggle_bookmark = {
|
|
|
|
|
|
|
|
text_func = function() return self:isCurrentPageBookmarked() and _("Remove bookmark for current page") or _("Bookmark current page") end,
|
|
|
|
|
|
|
|
callback = function()
|
|
|
|
|
|
|
|
self:onToggleBookmark()
|
|
|
|
|
|
|
|
end,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
end
|
|
|
|
if self.ui.document.info.has_pages then
|
|
|
|
if self.ui.document.info.has_pages then
|
|
|
|
menu_items.bookmark_browsing_mode = {
|
|
|
|
menu_items.bookmark_browsing_mode = {
|
|
|
|
text = self.bbm_menu_title,
|
|
|
|
text = self.bbm_menu_title,
|
|
|
@ -158,6 +166,16 @@ function ReaderBookmark:onSaveSettings()
|
|
|
|
self.ui.doc_settings:saveSetting("highlights_imported", true)
|
|
|
|
self.ui.doc_settings:saveSetting("highlights_imported", true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderBookmark:isCurrentPageBookmarked()
|
|
|
|
|
|
|
|
local pn_or_xp
|
|
|
|
|
|
|
|
if self.ui.document.info.has_pages then
|
|
|
|
|
|
|
|
pn_or_xp = self.view.state.page
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
pn_or_xp = self.ui.document:getXPointer()
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return self:getDogearBookmarkIndex(pn_or_xp) and true or false
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ReaderBookmark:onToggleBookmark()
|
|
|
|
function ReaderBookmark:onToggleBookmark()
|
|
|
|
local pn_or_xp
|
|
|
|
local pn_or_xp
|
|
|
|
if self.ui.document.info.has_pages then
|
|
|
|
if self.ui.document.info.has_pages then
|
|
|
|