mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-10 00:55:48 +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:
|
||||
files: []
|
||||
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-title =
|
||||
.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 =
|
||||
.title = 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.
|
||||
pdfjs-free-text2 =
|
||||
.aria-label = Text Editor
|
||||
@ -603,9 +611,9 @@ pdfjs-editor-add-signature-add-button = Add
|
||||
|
||||
## Main menu for adding/removing signatures
|
||||
|
||||
pdfjs-editor-delete-signature-button =
|
||||
.title = Remove signature
|
||||
pdfjs-editor-delete-signature-button-label = Remove signature
|
||||
pdfjs-editor-delete-signature-button1 =
|
||||
.title = Remove saved signature
|
||||
pdfjs-editor-delete-signature-button-label1 = Remove saved signature
|
||||
|
||||
## Editor toolbar
|
||||
|
||||
|
||||
@ -916,23 +916,15 @@ class CipherTransformFactory {
|
||||
cipher = new ARCFourCipher(derivedKey);
|
||||
checkData = cipher.encryptBlock(checkData);
|
||||
}
|
||||
for (j = 0, n = checkData.length; j < n; ++j) {
|
||||
if (userPassword[j] !== checkData[j]) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cipher = new ARCFourCipher(encryptionKey);
|
||||
checkData = cipher.encryptBlock(
|
||||
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) {
|
||||
@ -1133,12 +1125,13 @@ class CipherTransformFactory {
|
||||
perms
|
||||
);
|
||||
}
|
||||
if (!encryptionKey && !password) {
|
||||
throw new PasswordException(
|
||||
"No password given",
|
||||
PasswordResponses.NEED_PASSWORD
|
||||
);
|
||||
} else if (!encryptionKey && password) {
|
||||
if (!encryptionKey) {
|
||||
if (!password) {
|
||||
throw new PasswordException(
|
||||
"No password given",
|
||||
PasswordResponses.NEED_PASSWORD
|
||||
);
|
||||
}
|
||||
// Attempting use the password as an owner password
|
||||
const decodedPassword = this.#decodeUserPassword(
|
||||
passwordBytes,
|
||||
|
||||
@ -992,7 +992,7 @@
|
||||
"password": "ELXRTQWS",
|
||||
"md5": "db2fedbd36d6fa27d4e52f9bd2d96b8c",
|
||||
"rounds": 1,
|
||||
"type": "load"
|
||||
"type": "eq"
|
||||
},
|
||||
{
|
||||
"id": "issue5334",
|
||||
@ -5961,7 +5961,7 @@
|
||||
"md5": "b58adce5dbb08936ddb0d904f0da8716",
|
||||
"rounds": 1,
|
||||
"link": false,
|
||||
"type": "load",
|
||||
"type": "eq",
|
||||
"password": "abc"
|
||||
},
|
||||
{
|
||||
@ -5970,7 +5970,7 @@
|
||||
"md5": "73a8091d0ab2a47af5ca45047f04da99",
|
||||
"rounds": 1,
|
||||
"link": false,
|
||||
"type": "load",
|
||||
"type": "eq",
|
||||
"password": "\u00E6\u00F8\u00E5",
|
||||
"about": "The password (æøå) is UTF8 encoded."
|
||||
},
|
||||
|
||||
@ -48,7 +48,6 @@
|
||||
|
||||
.signatureDialog {
|
||||
--primary-color: var(--text-primary-color);
|
||||
--description-input-color: var(--primary-color);
|
||||
--border-color: #8f8f9d;
|
||||
--open-link-fg: var(--link-fg-color);
|
||||
--open-link-hover-fg: var(--link-hover-fg-color);
|
||||
|
||||
@ -708,11 +708,17 @@ class SignatureManager {
|
||||
button.append(svg);
|
||||
|
||||
const span = document.createElement("span");
|
||||
span.ariaHidden = true;
|
||||
button.append(span);
|
||||
|
||||
button.classList.add("toolbarAddSignatureButton");
|
||||
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;
|
||||
|
||||
const path = svgFactory.createElement("path");
|
||||
@ -729,7 +735,7 @@ class SignatureManager {
|
||||
deleteButton.classList.add("toolbarButton", "deleteButton");
|
||||
deleteButton.setAttribute(
|
||||
"data-l10n-id",
|
||||
"pdfjs-editor-delete-signature-button"
|
||||
"pdfjs-editor-delete-signature-button1"
|
||||
);
|
||||
deleteButton.type = "button";
|
||||
deleteButton.tabIndex = 0;
|
||||
@ -749,7 +755,7 @@ class SignatureManager {
|
||||
deleteButton.append(deleteSpan);
|
||||
deleteSpan.setAttribute(
|
||||
"data-l10n-id",
|
||||
"pdfjs-editor-delete-signature-button-label"
|
||||
"pdfjs-editor-delete-signature-button-label1"
|
||||
);
|
||||
|
||||
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>
|
||||
</button>
|
||||
<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">
|
||||
<span data-l10n-id="pdfjs-editor-signature-add-signature-button-label" class="editorParamsLabel">Add new signature</span>
|
||||
</button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user