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

[Editor] Cheat the stamp editor icon to make a linter in m-c happy #16672

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

calixteman
Copy link
Contributor

At some point we won't use this icon anymore in the build-in pdf viewer but we'll the one already in the m-c tree.

At some point we won't use this icon anymore in the build-in pdf viewer
but we'll the one already in the m-c tree.
@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Jul 11, 2023

At some point we won't use this icon anymore in the build-in pdf viewer but we'll the one already in the m-c tree.

Note that this ought to be fairly simple to implement actually, since you'd only need to do something along these lines:

  • Replace the existing CSS variable with
    /*#if MOZCENTRAL*/
    --toolbarButton-editorStamp-icon: url(appropriate mozilla-central path here...);
    /*#else*/
    --toolbarButton-editorStamp-icon: url(images/toolbarButton-editorStamp.svg);
    /*#endif*/
  • Update the list of resources to include in the build
    const MOZCENTRAL_WEB_FILES = [
      ...COMMON_WEB_FILES,
      "!web/images/toolbarButton-editorStamp.svg",
      "!web/images/toolbarButton-openFile.svg",
    ];

@calixteman
Copy link
Contributor Author

At some point we won't use this icon anymore in the build-in pdf viewer but we'll the one already in the m-c tree.

Note that this ought to be fairly simple to implement actually, since you'd only need to do something along these lines:

* Replace [the existing CSS variable](https://github.com/mozilla/pdf.js/blob/35202ec0f390e63035aba6906f454fd395650e58/web/viewer.css#L83) with
  ```css
  /*#if MOZCENTRAL*/
  --toolbarButton-editorStamp-icon: url(appropriate mozilla-central path here...);
  /*#else*/
  --toolbarButton-editorStamp-icon: url(images/toolbarButton-editorStamp.svg);
  /*#endif*/
  ```

* Update [the list of resources](https://github.com/mozilla/pdf.js/blob/35202ec0f390e63035aba6906f454fd395650e58/gulpfile.js#L1318-L1321) to include in the build
  ```js
  const MOZCENTRAL_WEB_FILES = [
    ...COMMON_WEB_FILES,
    "!web/images/toolbarButton-editorStamp.svg",
    "!web/images/toolbarButton-openFile.svg",
  ];
  ```

Yeah, I tried --toolbarButton-editorStamp-icon: url(chrome://browser/skin/canvas.svg); but it wasn't working.
That said there are few other icons to de-dup, I filed this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1842746

@calixteman calixteman merged commit 09d1be7 into mozilla:master Jul 11, 2023
@calixteman calixteman deleted the cheat_editorStamp_svg branch July 11, 2023 07:59
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