mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Book information: refactored and additional features
- Factored out duplicate code from filemanager.lua and filemanagerhistory.lua to new filemanagerbookinfo.lua (and other common code to filemanagerutil.lua). - Uses sidecar files' new doc_props and doc_pages settings, or fallback to old 'stats' settings, or to opening document. - Shows filename, filetype and directory. - Shows description (Hold to see whole truncated text), keywords, and cover image (tap to extract image from document and display it if available). - Book information now available from reader menu, to display info about the currently opened book. - Convert possibly HTML description to plain text via added util.htmlToPlainTextIfHtml() (for simple HTML conversion).
This commit is contained in:
@@ -10,6 +10,7 @@ local Device = require("device")
|
||||
local DocSettings = require("docsettings")
|
||||
local DocumentRegistry = require("document/documentregistry")
|
||||
local Event = require("ui/event")
|
||||
local FileManagerBookInfo = require("apps/filemanager/filemanagerbookinfo")
|
||||
local FileManagerHistory = require("apps/filemanager/filemanagerhistory")
|
||||
local Geom = require("ui/geometry")
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
@@ -317,6 +318,12 @@ function ReaderUI:init()
|
||||
dialog = self.dialog,
|
||||
ui = self,
|
||||
})
|
||||
-- book info
|
||||
self:registerModule("bookinfo", FileManagerBookInfo:new{
|
||||
dialog = self.dialog,
|
||||
document = self.document,
|
||||
ui = self,
|
||||
})
|
||||
-- koreader plugins
|
||||
for _, plugin_module in ipairs(PluginLoader:loadPlugins()) do
|
||||
local ok, plugin_or_err = PluginLoader:createPluginInstance(
|
||||
|
||||
Reference in New Issue
Block a user