readerannotation: datetime_updated (#12963)
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run

This commit is contained in:
hius07
2024-12-31 08:54:29 +02:00
committed by GitHub
parent b1940eb4d6
commit 04c0ee5f04

View File

@@ -60,20 +60,21 @@ function ReaderAnnotation:buildAnnotation(bm, highlights, init)
end
end
return { -- annotation
datetime = bm.datetime, -- creation time, not changeable
drawer = hl.drawer, -- highlight drawer
color = hl.color, -- highlight color
text = bm.notes, -- highlighted text, editable
text_edited = hl.edited, -- true if highlighted text has been edited
note = note, -- user's note, editable
chapter = chapter, -- book chapter title
pageno = pageno, -- book page number (continuous numbering, used by KOHighlights)
pageref = pageref, -- book page number (iff: reference pages or hidden flows)
page = bm.page, -- highlight location, xPointer or number (pdf)
pos0 = bm.pos0, -- highlight start position, xPointer (== page) or table (pdf)
pos1 = bm.pos1, -- highlight end position, xPointer or table (pdf)
pboxes = hl.pboxes, -- pdf pboxes, used only and changeable by addMarkupAnnotation
ext = hl.ext, -- pdf multi-page highlight
datetime = bm.datetime, -- creation time, not changeable
datetime_updated = nil, -- last modification time
drawer = hl.drawer, -- highlight drawer
color = hl.color, -- highlight color
text = bm.notes, -- highlighted text, editable
text_edited = hl.edited, -- true if highlighted text has been edited
note = note, -- user's note, editable
chapter = chapter, -- book chapter title
pageno = pageno, -- book page number (continuous numbering, used by KOHighlights)
pageref = pageref, -- book page number (iff: reference pages or hidden flows)
page = bm.page, -- highlight location, xPointer or number (pdf)
pos0 = bm.pos0, -- highlight start position, xPointer (== page) or table (pdf)
pos1 = bm.pos1, -- highlight end position, xPointer or table (pdf)
pboxes = hl.pboxes, -- pdf pboxes, used only and changeable by addMarkupAnnotation
ext = hl.ext, -- pdf multi-page highlight
}
end
@@ -420,6 +421,10 @@ function ReaderAnnotation:addItem(item)
return index
end
function ReaderAnnotation:onAnnotationsModified(items)
items[1].datetime_updated = os.date("%Y-%m-%d %H:%M:%S")
end
-- info
function ReaderAnnotation:getPageRef(pn_or_xp, pn)