-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Support manual redaction #2433
base: main
Are you sure you want to change the base?
Feature: Support manual redaction #2433
Conversation
- Add redact.html which contains the nav-bar, file chooser, outer container and print container (used by PDF.JS viewer) and lastly the footer. - Add redact.css which is used specifically to style redaction operation and the redaction page (except for PDF.js viewer). - Add viewer-redact.css which is used to style PDF.js viewer that's used in the page (Changed the background to correspond with Stirling's themes). - Add redact.js which contains the redaction related logic.
- Add submit button. - Add hidden redactions input. - Rename fileSelector from pdf-upload to fileInput.
- Scale x, y, width and height to match PDF page points accurately.
- Fix formula for redaction points and dimensions as x, y, height and width should be the original width rather than the width after adjusting it to the zoom level (zoom level is mainly used for correct display positioning, while scale factor is used for correct positioning in the actual PDF).
- Slightly refactor redact.js for more readability and to reduce code duplication.
…ion-based Redaction mode buttons - Now, when one button is clicked, the other is automatically deselected, ensuring only one mode can be active at a time.
- Support page-based redactions by providing page numbers, page ranges and functions.
- Rename pageNumbers's input id to be more meaningful
Sure, but a few questions regarding this point:
This code worked like a charm for Firefox but I forgot to take into account chromium browsers and Safari, so I added the following: and added the following line early when window receives 'load' event: On second look, it should be as follows:
` This should make it work for most major browsers, be it based on webkit/gecko, or just a Chromium/Firefox browser.
Sure! I will let you know if anything comes up, thank you! |
After applying these changes, It should work now on Safari, I have tested it again on Chrome, Firefox and Edge. Opera should not be affected by these changes considering that it's working on Edge and Chrome, as for Safari, it should work now. |
I agree, we can also add some explanation somewhere in this form later on.
Oh, I see now, I will see what I can do.
Sure, we can try going for it, if it felt off then we can go back to previous one.
Thanks! |
- Shorten "Page Redaction Color" to "Redaction Color" in Page-based redaction form. - Add a palette icon next to "Redaction Color".
FAQ:
Validation errors: If you have any feedback, ideas or notes, let me know! and also, let me know what you think! |
- Handle cases when `n` is followed by one or more `n`s consecutively, examples: nn, nnn, nnnn. - Handle round brackets multiplication case, examples: (n-1)n, n(n-1), (n-1)(n-2), 2(n). - Remove spaces from N functions to prepare them for evaluation.
- Handle closing bracket pattern for N Functions examples: (n-1)n, (n-1)9, (n-1)(n-2)
- Hovering over sidebar thumbnails covers the thumbnail with the selected redaction color. - Redacted thumbnails are surrounded with a small blue border to distinguish it from other pages.
/deploypr |
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://185.252.234.121:2433 This deployment will be automatically cleaned up when the PR is closed. |
Hey mate, great updates! We have tested on Safari and your fix is working perfectly now. Is there any chance you could look in to improving the tool for creating box redactions? The click and drag mechanic as it is isn't very user friendly. |
Hey, sure! I will look into it. |
- Detect when a box is in the process of being drawn. - Detect pointer release even when present out of page. - Correctly draw the box when the pointer leaves the page.
🚀 Translation Verification Summary🔄 Reference Branch:
|
Now, you can use click and drag mechanism. |
Description
Manual Redaction:
Text Selection-based redaction:
ctrl + s
shortcut or by pressing on apply/save/disk icon in the toolbar.delete/trash
icon or by using the shortcutdelete
.color palette
icon and choosing the color they want.Draw/Area-based redaction:
ctrl + s
shortcut or by pressing on apply/save/disk icon in the toolbar.delete/trash
icon or by using the shortcutdelete
(requires temporarily turning off drawing mode).color palette
icon and choosing the color they want.Page-based redaction:
Redaction modes:
There are three modes of redaction/operation currently supported
How to use:
Text Selection-based redaction: click on this icon in the toolbar to enable
text-selection redaction mode
then select the text you want to redact then pressctrl + s
or click on the disk/save icon .Draw/Area-based redaction: click on this icon in the toolbar to enable
draw/area-based redaction
thenleft mouse click (LMB)
on the starting point of the rectangle, then once you are satisfied with the rectangle's placement/dimensions thenleft mouse click (LMB)
again to apply the redaction.Left mouse click (LMB)
then move mouse to the right then bottom thenLeft mouse click (LMB)
.Page-based redactions:: Insert the page number(s), range(s) and/or functions (separated by
,
) then select your preferred color and click onRedact
to submit.Color Customizations:
Left mouse click LMB
) then clicking on color palette (highlighted in red in the picture) then select your preferred color.Deletions:
Left mouse click LMB
) then clicking on the trash icon (highlighted in red in the picture) .Card in the home page:
Closes #465
Checklist