Skip to content
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

[api-minor][editor] Indicate, in the title, if the document has been edited (bug 1785854) #15351

Merged
merged 1 commit into from
Aug 27, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

Note that this patch prepends the document title with "* ", rather than only "*" as suggested in the bug, since there's nothing that says that a PDF document cannot specify a title[1] beginning with an asterisk. To reduce possible confusion, having a space between the "editing marker" and the actual document title thus cannot hurt as far as I'm concerned.

In order to notify the viewer when all AnnotationEditors have been removed, we utilize the existing onAnnotationEditor-callback to allow the document title to be updated as necessary.

Finally, this patch makes the following (slightly unrelated) changes:

  • Rename the AnnotationStorage.removeKey method to just AnnotationStorage.remove instead. This is consistent with e.g. the has-method and should suffice to explain what it does.
  • Remove the AnnotationStorage.hasAnnotationEditors getter, since the viewer now tracks the necessary state internally. This avoids unnecessarily having to iterate through the AnnotationStorage-instance when saving/printing the document.

[1] Using either an /Info dictionary or a /Metadata stream.

…edited (bug 1785854)

Note that this patch prepends the document title with "* ", rather than only "*" as suggested in the bug, since there's nothing that says that a PDF document cannot specify a title[1] beginning with an asterisk. To reduce possible confusion, having a space between the "editing marker" and the actual document title thus cannot hurt as far as I'm concerned.

In order to notify the viewer when all `AnnotationEditor`s have been removed, we utilize the existing `onAnnotationEditor`-callback to allow the document title to be updated as necessary.

Finally, this patch makes the following (slightly unrelated) changes:
 - Rename the `AnnotationStorage.removeKey` method to just `AnnotationStorage.remove` instead. This is consistent with e.g. the `has`-method and should suffice to explain what it does.
 - Remove the `AnnotationStorage.hasAnnotationEditors` getter, since the viewer now tracks the necessary state internally. This avoids unnecessarily having to iterate through the `AnnotationStorage`-instance when saving/printing the document.

---
[1] Using either an /Info dictionary or a /Metadata stream.
@Snuffleupagus
Copy link
Collaborator Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/1adf3ddf90313a1/output.txt

@Snuffleupagus
Copy link
Collaborator Author

/botio integrationtest

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/e2e664d23217b49/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 1

Live output at: http://54.241.84.105:8877/af3a293675599f9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/1adf3ddf90313a1/output.txt

Total script time: 2.12 mins

Published

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/af3a293675599f9/output.txt

Total script time: 4.99 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/e2e664d23217b49/output.txt

Total script time: 10.20 mins

  • Integration Tests: FAILED

@timvandermeij timvandermeij merged commit c5b9e9a into mozilla:master Aug 27, 2022
@timvandermeij
Copy link
Contributor

Works well; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants