mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-03 04:47:21 +02:00
Compare commits
10 Commits
38cb01c629
...
8791b24742
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8791b24742 | ||
|
|
7c706b6525 | ||
|
|
dc61e36bf4 | ||
|
|
56f58bde9a | ||
|
|
d5c185b90a | ||
|
|
da105f71f6 | ||
|
|
78b310afb1 | ||
|
|
ef01ceda1b | ||
|
|
0e15f709c4 | ||
|
|
cc63ffa6bb |
2
.github/fluent_linter_config.yml
vendored
2
.github/fluent_linter_config.yml
vendored
@ -25,3 +25,5 @@ CO01:
|
|||||||
exclusions:
|
exclusions:
|
||||||
files: []
|
files: []
|
||||||
messages: []
|
messages: []
|
||||||
|
VC:
|
||||||
|
disabled: false
|
||||||
|
|||||||
@ -365,10 +365,18 @@ pdfjs-editor-stamp-add-image-button-label = Add image
|
|||||||
pdfjs-editor-free-highlight-thickness-input = Thickness
|
pdfjs-editor-free-highlight-thickness-input = Thickness
|
||||||
pdfjs-editor-free-highlight-thickness-title =
|
pdfjs-editor-free-highlight-thickness-title =
|
||||||
.title = Change thickness when highlighting items other than text
|
.title = Change thickness when highlighting items other than text
|
||||||
|
pdfjs-editor-add-signature-container =
|
||||||
|
.aria-label = Signature controls and saved signatures
|
||||||
pdfjs-editor-signature-add-signature-button =
|
pdfjs-editor-signature-add-signature-button =
|
||||||
.title = Add new signature
|
.title = Add new signature
|
||||||
pdfjs-editor-signature-add-signature-button-label = Add new signature
|
pdfjs-editor-signature-add-signature-button-label = Add new signature
|
||||||
|
|
||||||
|
# Used on the button to use an already saved signature.
|
||||||
|
# Variables:
|
||||||
|
# $description (String) - a string describing/labeling the signature.
|
||||||
|
pdfjs-editor-add-saved-signature-button =
|
||||||
|
.title = Saved signature: { $description }
|
||||||
|
|
||||||
# .default-content is used as a placeholder in an empty text editor.
|
# .default-content is used as a placeholder in an empty text editor.
|
||||||
pdfjs-free-text2 =
|
pdfjs-free-text2 =
|
||||||
.aria-label = Text Editor
|
.aria-label = Text Editor
|
||||||
@ -603,9 +611,9 @@ pdfjs-editor-add-signature-add-button = Add
|
|||||||
|
|
||||||
## Main menu for adding/removing signatures
|
## Main menu for adding/removing signatures
|
||||||
|
|
||||||
pdfjs-editor-delete-signature-button =
|
pdfjs-editor-delete-signature-button1 =
|
||||||
.title = Remove signature
|
.title = Remove saved signature
|
||||||
pdfjs-editor-delete-signature-button-label = Remove signature
|
pdfjs-editor-delete-signature-button-label1 = Remove saved signature
|
||||||
|
|
||||||
## Editor toolbar
|
## Editor toolbar
|
||||||
|
|
||||||
|
|||||||
@ -916,23 +916,15 @@ class CipherTransformFactory {
|
|||||||
cipher = new ARCFourCipher(derivedKey);
|
cipher = new ARCFourCipher(derivedKey);
|
||||||
checkData = cipher.encryptBlock(checkData);
|
checkData = cipher.encryptBlock(checkData);
|
||||||
}
|
}
|
||||||
for (j = 0, n = checkData.length; j < n; ++j) {
|
|
||||||
if (userPassword[j] !== checkData[j]) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
cipher = new ARCFourCipher(encryptionKey);
|
cipher = new ARCFourCipher(encryptionKey);
|
||||||
checkData = cipher.encryptBlock(
|
checkData = cipher.encryptBlock(
|
||||||
CipherTransformFactory._defaultPasswordBytes
|
CipherTransformFactory._defaultPasswordBytes
|
||||||
);
|
);
|
||||||
for (j = 0, n = checkData.length; j < n; ++j) {
|
|
||||||
if (userPassword[j] !== checkData[j]) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return encryptionKey;
|
return checkData.every((data, k) => userPassword[k] === data)
|
||||||
|
? encryptionKey
|
||||||
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#decodeUserPassword(password, ownerPassword, revision, keyLength) {
|
#decodeUserPassword(password, ownerPassword, revision, keyLength) {
|
||||||
@ -1133,12 +1125,13 @@ class CipherTransformFactory {
|
|||||||
perms
|
perms
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!encryptionKey && !password) {
|
if (!encryptionKey) {
|
||||||
throw new PasswordException(
|
if (!password) {
|
||||||
"No password given",
|
throw new PasswordException(
|
||||||
PasswordResponses.NEED_PASSWORD
|
"No password given",
|
||||||
);
|
PasswordResponses.NEED_PASSWORD
|
||||||
} else if (!encryptionKey && password) {
|
);
|
||||||
|
}
|
||||||
// Attempting use the password as an owner password
|
// Attempting use the password as an owner password
|
||||||
const decodedPassword = this.#decodeUserPassword(
|
const decodedPassword = this.#decodeUserPassword(
|
||||||
passwordBytes,
|
passwordBytes,
|
||||||
|
|||||||
@ -992,7 +992,7 @@
|
|||||||
"password": "ELXRTQWS",
|
"password": "ELXRTQWS",
|
||||||
"md5": "db2fedbd36d6fa27d4e52f9bd2d96b8c",
|
"md5": "db2fedbd36d6fa27d4e52f9bd2d96b8c",
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "load"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "issue5334",
|
"id": "issue5334",
|
||||||
@ -5961,7 +5961,7 @@
|
|||||||
"md5": "b58adce5dbb08936ddb0d904f0da8716",
|
"md5": "b58adce5dbb08936ddb0d904f0da8716",
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"link": false,
|
"link": false,
|
||||||
"type": "load",
|
"type": "eq",
|
||||||
"password": "abc"
|
"password": "abc"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -5970,7 +5970,7 @@
|
|||||||
"md5": "73a8091d0ab2a47af5ca45047f04da99",
|
"md5": "73a8091d0ab2a47af5ca45047f04da99",
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"link": false,
|
"link": false,
|
||||||
"type": "load",
|
"type": "eq",
|
||||||
"password": "\u00E6\u00F8\u00E5",
|
"password": "\u00E6\u00F8\u00E5",
|
||||||
"about": "The password (æøå) is UTF8 encoded."
|
"about": "The password (æøå) is UTF8 encoded."
|
||||||
},
|
},
|
||||||
|
|||||||
@ -48,7 +48,6 @@
|
|||||||
|
|
||||||
.signatureDialog {
|
.signatureDialog {
|
||||||
--primary-color: var(--text-primary-color);
|
--primary-color: var(--text-primary-color);
|
||||||
--description-input-color: var(--primary-color);
|
|
||||||
--border-color: #8f8f9d;
|
--border-color: #8f8f9d;
|
||||||
--open-link-fg: var(--link-fg-color);
|
--open-link-fg: var(--link-fg-color);
|
||||||
--open-link-hover-fg: var(--link-hover-fg-color);
|
--open-link-hover-fg: var(--link-hover-fg-color);
|
||||||
|
|||||||
@ -708,11 +708,17 @@ class SignatureManager {
|
|||||||
button.append(svg);
|
button.append(svg);
|
||||||
|
|
||||||
const span = document.createElement("span");
|
const span = document.createElement("span");
|
||||||
|
span.ariaHidden = true;
|
||||||
button.append(span);
|
button.append(span);
|
||||||
|
|
||||||
button.classList.add("toolbarAddSignatureButton");
|
button.classList.add("toolbarAddSignatureButton");
|
||||||
button.type = "button";
|
button.type = "button";
|
||||||
button.title = span.textContent = description;
|
span.textContent = description;
|
||||||
|
button.setAttribute(
|
||||||
|
"data-l10n-id",
|
||||||
|
"pdfjs-editor-add-saved-signature-button"
|
||||||
|
);
|
||||||
|
button.setAttribute("data-l10n-args", JSON.stringify({ description }));
|
||||||
button.tabIndex = 0;
|
button.tabIndex = 0;
|
||||||
|
|
||||||
const path = svgFactory.createElement("path");
|
const path = svgFactory.createElement("path");
|
||||||
@ -729,7 +735,7 @@ class SignatureManager {
|
|||||||
deleteButton.classList.add("toolbarButton", "deleteButton");
|
deleteButton.classList.add("toolbarButton", "deleteButton");
|
||||||
deleteButton.setAttribute(
|
deleteButton.setAttribute(
|
||||||
"data-l10n-id",
|
"data-l10n-id",
|
||||||
"pdfjs-editor-delete-signature-button"
|
"pdfjs-editor-delete-signature-button1"
|
||||||
);
|
);
|
||||||
deleteButton.type = "button";
|
deleteButton.type = "button";
|
||||||
deleteButton.tabIndex = 0;
|
deleteButton.tabIndex = 0;
|
||||||
@ -749,7 +755,7 @@ class SignatureManager {
|
|||||||
deleteButton.append(deleteSpan);
|
deleteButton.append(deleteSpan);
|
||||||
deleteSpan.setAttribute(
|
deleteSpan.setAttribute(
|
||||||
"data-l10n-id",
|
"data-l10n-id",
|
||||||
"pdfjs-editor-delete-signature-button-label"
|
"pdfjs-editor-delete-signature-button-label1"
|
||||||
);
|
);
|
||||||
|
|
||||||
this.#addSignatureToolbarButton.before(div);
|
this.#addSignatureToolbarButton.before(div);
|
||||||
|
|||||||
@ -249,7 +249,7 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
<span data-l10n-id="pdfjs-editor-signature-button-label">Add signature</span>
|
<span data-l10n-id="pdfjs-editor-signature-button-label">Add signature</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="editorParamsToolbar hidden doorHangerRight menu" id="editorSignatureParamsToolbar">
|
<div class="editorParamsToolbar hidden doorHangerRight menu" id="editorSignatureParamsToolbar">
|
||||||
<div id="addSignatureDoorHanger" class="menuContainer">
|
<div id="addSignatureDoorHanger" class="menuContainer" role="region" data-l10n-id="pdfjs-editor-add-signature-container">
|
||||||
<button id="editorSignatureAddSignature" class="toolbarButton labeled" type="button" title="Add new signature" tabindex="0" data-l10n-id="pdfjs-editor-signature-add-signature-button">
|
<button id="editorSignatureAddSignature" class="toolbarButton labeled" type="button" title="Add new signature" tabindex="0" data-l10n-id="pdfjs-editor-signature-add-signature-button">
|
||||||
<span data-l10n-id="pdfjs-editor-signature-add-signature-button-label" class="editorParamsLabel">Add new signature</span>
|
<span data-l10n-id="pdfjs-editor-signature-add-signature-button-label" class="editorParamsLabel">Add new signature</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user