From bf016743fc9fcf6da3df5c9ab85ecbfd028a17c3 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 9 Nov 2023 07:55:48 +0100 Subject: [PATCH] Remove the "Open file"-button from the main toolbar This button is *only* used in the GENERIC viewer, and will currently be visible either in the main or secondary toolbars (depending on the viewer width). To simplify upcoming changes, and to avoid then having to complicate the relevant CSS rules unnecessarily, let's place the "Open file"-button permanently in the secondary toolbar instead. (Note that the GENERIC viewer also, since five years, supports drag-and-drop in order to open local files.) --- web/toolbar.js | 4 ---- web/viewer.css | 15 ++------------- web/viewer.html | 10 ++-------- web/viewer.js | 4 ---- 4 files changed, 4 insertions(+), 29 deletions(-) diff --git a/web/toolbar.js b/web/toolbar.js index 516cc096b..3d33cdce7 100644 --- a/web/toolbar.js +++ b/web/toolbar.js @@ -39,7 +39,6 @@ const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading"; * @property {HTMLButtonElement} zoomIn - Button to zoom in the pages. * @property {HTMLButtonElement} zoomOut - Button to zoom out the pages. * @property {HTMLButtonElement} viewFind - Button to open find bar. - * @property {HTMLButtonElement} openFile - Button to open a new document. * @property {HTMLButtonElement} editorFreeTextButton - Button to switch to * FreeText editing. * @property {HTMLButtonElement} download - Button to download the document. @@ -97,9 +96,6 @@ class Toolbar { }, }, ]; - if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { - this.buttons.push({ element: options.openFile, eventName: "openfile" }); - } this.items = { numPages: options.numPages, pageNumber: options.pageNumber, diff --git a/web/viewer.css b/web/viewer.css index c82c58b16..835046348 100644 --- a/web/viewer.css +++ b/web/viewer.css @@ -919,13 +919,12 @@ body { mask-image: var(--toolbarButton-editorStamp-icon); } -#print::before, -#secondaryPrint::before { +:is(#print, #secondaryPrint)::before { mask-image: var(--toolbarButton-print-icon); } /*#if GENERIC*/ -:is(#openFile, #secondaryOpenFile)::before { +#secondaryOpenFile::before { mask-image: var(--toolbarButton-openFile-icon); } /*#endif*/ @@ -1435,7 +1434,6 @@ dialog :link { } } -.visibleLargeView, .visibleMediumView { display: none; } @@ -1459,15 +1457,6 @@ dialog :link { } } -@media all and (max-width: 820px) { - #outerContainer .hiddenLargeView { - display: none; - } - #outerContainer .visibleLargeView { - display: inherit; - } -} - @media all and (max-width: 750px) { #outerContainer .hiddenMediumView { display: none; diff --git a/web/viewer.html b/web/viewer.html index 714f98b04..32bf487ca 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -210,7 +210,7 @@ See https://github.com/adobe-type-tools/cmap-resources