Merge pull request #20058 from calixteman/use_creationdate_popup
Use the creation date in the popup when there is no modification date
This commit is contained in:
commit
729f2bb148
@ -3842,6 +3842,7 @@ class PopupAnnotation extends Annotation {
|
||||
return;
|
||||
}
|
||||
this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null);
|
||||
this.data.creationDate = parentItem.get("CreationDate") || "";
|
||||
|
||||
const rt = parentItem.get("RT");
|
||||
if (isName(rt, AnnotationReplyType.GROUP)) {
|
||||
|
||||
@ -2071,7 +2071,7 @@ class PopupAnnotationElement extends AnnotationElement {
|
||||
container: this.container,
|
||||
color: this.data.color,
|
||||
titleObj: this.data.titleObj,
|
||||
modificationDate: this.data.modificationDate,
|
||||
modificationDate: this.data.modificationDate || this.data.creationDate,
|
||||
contentsObj: this.data.contentsObj,
|
||||
richText: this.data.richText,
|
||||
rect: this.data.rect,
|
||||
@ -2212,14 +2212,17 @@ class PopupElement {
|
||||
|
||||
const header = document.createElement("span");
|
||||
header.className = "header";
|
||||
const title = document.createElement("h1");
|
||||
header.append(title);
|
||||
({ dir: title.dir, str: title.textContent } = this.#titleObj);
|
||||
if (this.#titleObj?.str) {
|
||||
const title = document.createElement("span");
|
||||
title.className = "title";
|
||||
header.append(title);
|
||||
({ dir: title.dir, str: title.textContent } = this.#titleObj);
|
||||
}
|
||||
popup.append(header);
|
||||
|
||||
if (this.#dateObj) {
|
||||
const modificationDate = document.createElement("time");
|
||||
modificationDate.classList.add("popupDate");
|
||||
modificationDate.className = "popupDate";
|
||||
modificationDate.setAttribute(
|
||||
"data-l10n-id",
|
||||
"pdfjs-annotation-date-time-string"
|
||||
|
||||
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -730,3 +730,4 @@
|
||||
!empty#hash.pdf
|
||||
!bug1885505.pdf
|
||||
!bug1974436.pdf
|
||||
!firefox_logo.pdf
|
||||
|
||||
BIN
test/pdfs/firefox_logo.pdf
Executable file
BIN
test/pdfs/firefox_logo.pdf
Executable file
Binary file not shown.
@ -12156,5 +12156,13 @@
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true
|
||||
},
|
||||
{
|
||||
"id": "firefox_logo",
|
||||
"file": "pdfs/firefox_logo.pdf",
|
||||
"md5": "e212e0cec3e39907950c597782a42c3a",
|
||||
"rounds": 1,
|
||||
"type": "eq",
|
||||
"annotations": true
|
||||
}
|
||||
]
|
||||
|
||||
@ -342,8 +342,9 @@
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.popup > .header h1 {
|
||||
.popup > .header > .title {
|
||||
display: inline;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.popup > .header .popupDate {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user