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

PDF annotation support #787

Merged
merged 7 commits into from
Oct 25, 2023

Commits on Oct 23, 2023

  1. Import DAV helper functions from Viewer

    The Viewer provides several useful helper functions for DAV, but they
    can not be used (or at least I did not find out how) from the PDF
    viewer. Therefore, for now they were just copied over.
    
    The original file is written in TypeScript, but as it was not
    extensively typed and TypeScript is not currently supported in the PDF
    viewer for simplicity it was adjusted and converted to JavaScript.
    
    The file was copied from "src/utils/davUtils.ts" of repository
    "https://github.com/nextcloud/viewer" at commit
    "854e63d33a8fd304a6c4ea6704f0f68c6308f4b8".
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    468a68b View commit details
    Browse the repository at this point in the history
  2. Add reference to PDFViewerApplication in PDFView component

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    b5709f7 View commit details
    Browse the repository at this point in the history
  3. Added file annotation support

    Signed-off-by: Mishel Shaji <itconsultant@gpsrenewables.com>
    gpsrenewablesit authored and danxuliu committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    f4417bb View commit details
    Browse the repository at this point in the history
  4. Do not highlight disabled toolbar buttons

    In Nextcloud the background of disabled buttons does not change when
    hovered.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    8a82a80 View commit details
    Browse the repository at this point in the history
  5. Show a loading spinner while the file is being uploaded

    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    17a3550 View commit details
    Browse the repository at this point in the history
  6. Enable "Save" button when there is an unsaved annotation

    The "Save" button was always enabled, but saving and uploading the file
    would be needed only if there is an unsaved annotation. Therefore now
    the button is initially disabled, and it is enabled only when an
    annotation is added; once the file is saved the button is disabled and
    it will be enabled again once a new annotation is added.
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    ef2f09c View commit details
    Browse the repository at this point in the history
  7. Replace default "Download" icon with "Save" icon

    The "Download / Save" button uses a "Download" icon by default. For
    clarity, and to differentiate from the default PDF.js behaviour that
    downloads the file with the added annotations rather than saving it in
    place, the button now uses a "Save" icon instead.
    
    Like other icons used in Nextcloud, the "Save" icon was copied from
    Material Icons, which are licensed under the Apache License Version 2.0:
    https://fonts.google.com/icons?selected=Material+Icons:save:
    
    Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
    danxuliu committed Oct 23, 2023
    Configuration menu
    Copy the full SHA
    78b6fbe View commit details
    Browse the repository at this point in the history