mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
promote user to save PDF document after highlighting
This is a wordaround for #791.
This commit is contained in:
@@ -51,6 +51,9 @@ local Document = {
|
||||
|
||||
-- flag to show that the document needs to be unlocked by a password
|
||||
is_locked = false,
|
||||
|
||||
-- flag to show that the document is edited and needs to write back to disk
|
||||
is_edited = false,
|
||||
}
|
||||
|
||||
function Document:new(o)
|
||||
@@ -85,6 +88,17 @@ function Document:close()
|
||||
end
|
||||
end
|
||||
|
||||
-- check if document is edited and needs to write to disk
|
||||
function Document:isEdited()
|
||||
return self.is_edited
|
||||
end
|
||||
|
||||
-- discard change will set is_edited flag to false and implematation of Document
|
||||
-- should check the is_edited flag before writing document
|
||||
function Document:discardChange()
|
||||
self.is_edited = false
|
||||
end
|
||||
|
||||
-- this might be overridden by a document implementation
|
||||
function Document:getNativePageDimensions(pageno)
|
||||
local hash = "pgdim|"..self.file.."|"..pageno
|
||||
|
||||
Reference in New Issue
Block a user