Skip to content

Commit

Permalink
Rename the toolbar buttons in order to free their current names
Browse files Browse the repository at this point in the history
which can then be used for their future parent container.
This patch aims to simplify a bit the patch in mozilla#18385.
  • Loading branch information
calixteman committed Sep 17, 2024
1 parent f68310b commit f427993
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 33 deletions.
22 changes: 11 additions & 11 deletions web/viewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -778,12 +778,12 @@ body {
background-color: var(--toolbar-icon-hover-bg-color);
}

#sidebarToggle::before {
#sidebarToggleButton::before {
mask-image: var(--toolbarButton-sidebarToggle-icon);
transform: scaleX(var(--dir-factor));
}

#secondaryToolbarToggle::before {
#secondaryToolbarToggleButton::before {
mask-image: var(--toolbarButton-secondaryToolbarToggle-icon);
transform: scaleX(var(--dir-factor));
}
Expand All @@ -796,35 +796,35 @@ body {
mask-image: var(--toolbarButton-pageDown-icon);
}

#zoomOut::before {
#zoomOutButton::before {
mask-image: var(--toolbarButton-zoomOut-icon);
}

#zoomIn::before {
#zoomInButton::before {
mask-image: var(--toolbarButton-zoomIn-icon);
}

#editorFreeText::before {
#editorFreeTextButton::before {
mask-image: var(--toolbarButton-editorFreeText-icon);
}

#editorHighlight::before {
#editorHighlightButton::before {
mask-image: var(--toolbarButton-editorHighlight-icon);
}

#editorInk::before {
#editorInkButton::before {
mask-image: var(--toolbarButton-editorInk-icon);
}

#editorStamp::before {
#editorStampButton::before {
mask-image: var(--toolbarButton-editorStamp-icon);
}

#print::before {
#printButton::before {
mask-image: var(--toolbarButton-print-icon);
}

#download::before {
#downloadButton::before {
mask-image: var(--toolbarButton-download-icon);
}

Expand All @@ -850,7 +850,7 @@ body {
transform: scaleX(var(--dir-factor));
}

#viewFind::before {
#viewFindButton::before {
mask-image: var(--toolbarButton-search-icon);
}

Expand Down
22 changes: 11 additions & 11 deletions web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@
<div id="toolbarContainer">
<div id="toolbarViewer">
<div id="toolbarViewerLeft">
<button id="sidebarToggle" class="toolbarButton" type="button" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
<button id="sidebarToggleButton" class="toolbarButton" type="button" title="Toggle Sidebar" tabindex="11" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-controls="sidebarContainer">
<span data-l10n-id="pdfjs-toggle-sidebar-button-label">Toggle Sidebar</span>
</button>
<div class="toolbarButtonSpacer"></div>
<button id="viewFind" class="toolbarButton" type="button" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
<button id="viewFindButton" class="toolbarButton" type="button" title="Find in Document" tabindex="12" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
<span data-l10n-id="pdfjs-findbar-button-label">Find</span>
</button>
<div class="splitToolbarButton hiddenSmallView">
Expand All @@ -363,43 +363,43 @@
</div>
<div id="toolbarViewerRight">
<div id="editorModeButtons" class="splitToolbarButton toggled" role="radiogroup">
<button id="editorHighlight" class="toolbarButton" type="button" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
<button id="editorHighlightButton" class="toolbarButton" type="button" disabled="disabled" title="Highlight" role="radio" aria-checked="false" aria-controls="editorHighlightParamsToolbar" tabindex="31" data-l10n-id="pdfjs-editor-highlight-button">
<span data-l10n-id="pdfjs-editor-highlight-button-label">Highlight</span>
</button>
<button id="editorFreeText" class="toolbarButton" type="button" disabled="disabled" title="Text" role="radio" aria-checked="false" aria-controls="editorFreeTextParamsToolbar" tabindex="32" data-l10n-id="pdfjs-editor-free-text-button">
<button id="editorFreeTextButton" class="toolbarButton" type="button" disabled="disabled" title="Text" role="radio" aria-checked="false" aria-controls="editorFreeTextParamsToolbar" tabindex="32" data-l10n-id="pdfjs-editor-free-text-button">
<span data-l10n-id="pdfjs-editor-free-text-button-label">Text</span>
</button>
<button id="editorInk" class="toolbarButton" type="button" disabled="disabled" title="Draw" role="radio" aria-checked="false" aria-controls="editorInkParamsToolbar" tabindex="33" data-l10n-id="pdfjs-editor-ink-button">
<button id="editorInkButton" class="toolbarButton" type="button" disabled="disabled" title="Draw" role="radio" aria-checked="false" aria-controls="editorInkParamsToolbar" tabindex="33" data-l10n-id="pdfjs-editor-ink-button">
<span data-l10n-id="pdfjs-editor-ink-button-label">Draw</span>
</button>
<button id="editorStamp" class="toolbarButton" type="button" disabled="disabled" title="Add or edit images" role="radio" aria-checked="false" aria-controls="editorStampParamsToolbar" tabindex="34" data-l10n-id="pdfjs-editor-stamp-button">
<button id="editorStampButton" class="toolbarButton" type="button" disabled="disabled" title="Add or edit images" role="radio" aria-checked="false" aria-controls="editorStampParamsToolbar" tabindex="34" data-l10n-id="pdfjs-editor-stamp-button">
<span data-l10n-id="pdfjs-editor-stamp-button-label">Add or edit images</span>
</button>
</div>

<div id="editorModeSeparator" class="verticalToolbarSeparator"></div>

<button id="print" class="toolbarButton hiddenMediumView" type="button" title="Print" tabindex="41" data-l10n-id="pdfjs-print-button">
<button id="printButton" class="toolbarButton hiddenMediumView" type="button" title="Print" tabindex="41" data-l10n-id="pdfjs-print-button">
<span data-l10n-id="pdfjs-print-button-label">Print</span>
</button>

<button id="download" class="toolbarButton hiddenMediumView" type="button" title="Save" tabindex="42" data-l10n-id="pdfjs-save-button">
<button id="downloadButton" class="toolbarButton hiddenMediumView" type="button" title="Save" tabindex="42" data-l10n-id="pdfjs-save-button">
<span data-l10n-id="pdfjs-save-button-label">Save</span>
</button>

<div class="verticalToolbarSeparator hiddenMediumView"></div>

<button id="secondaryToolbarToggle" class="toolbarButton" type="button" title="Tools" tabindex="43" data-l10n-id="pdfjs-tools-button" aria-expanded="false" aria-controls="secondaryToolbar">
<button id="secondaryToolbarToggleButton" class="toolbarButton" type="button" title="Tools" tabindex="43" data-l10n-id="pdfjs-tools-button" aria-expanded="false" aria-controls="secondaryToolbar">
<span data-l10n-id="pdfjs-tools-button-label">Tools</span>
</button>
</div>
<div id="toolbarViewerMiddle">
<div class="splitToolbarButton">
<button id="zoomOut" class="toolbarButton" type="button" title="Zoom Out" tabindex="21" data-l10n-id="pdfjs-zoom-out-button">
<button id="zoomOutButton" class="toolbarButton" type="button" title="Zoom Out" tabindex="21" data-l10n-id="pdfjs-zoom-out-button">
<span data-l10n-id="pdfjs-zoom-out-button-label">Zoom Out</span>
</button>
<div class="splitToolbarButtonSeparator"></div>
<button id="zoomIn" class="toolbarButton" type="button" title="Zoom In" tabindex="22" data-l10n-id="pdfjs-zoom-in-button">
<button id="zoomInButton" class="toolbarButton" type="button" title="Zoom In" tabindex="22" data-l10n-id="pdfjs-zoom-in-button">
<span data-l10n-id="pdfjs-zoom-in-button-label">Zoom In</span>
</button>
</div>
Expand Down
22 changes: 11 additions & 11 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,31 @@ function getViewerConfiguration() {
customScaleOption: document.getElementById("customScaleOption"),
previous: document.getElementById("previous"),
next: document.getElementById("next"),
zoomIn: document.getElementById("zoomIn"),
zoomOut: document.getElementById("zoomOut"),
print: document.getElementById("print"),
editorFreeTextButton: document.getElementById("editorFreeText"),
zoomIn: document.getElementById("zoomInButton"),
zoomOut: document.getElementById("zoomOutButton"),
print: document.getElementById("printButton"),
editorFreeTextButton: document.getElementById("editorFreeTextButton"),
editorFreeTextParamsToolbar: document.getElementById(
"editorFreeTextParamsToolbar"
),
editorHighlightButton: document.getElementById("editorHighlight"),
editorHighlightButton: document.getElementById("editorHighlightButton"),
editorHighlightParamsToolbar: document.getElementById(
"editorHighlightParamsToolbar"
),
editorHighlightColorPicker: document.getElementById(
"editorHighlightColorPicker"
),
editorInkButton: document.getElementById("editorInk"),
editorInkButton: document.getElementById("editorInkButton"),
editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"),
editorStampButton: document.getElementById("editorStamp"),
editorStampButton: document.getElementById("editorStampButton"),
editorStampParamsToolbar: document.getElementById(
"editorStampParamsToolbar"
),
download: document.getElementById("download"),
download: document.getElementById("downloadButton"),
},
secondaryToolbar: {
toolbar: document.getElementById("secondaryToolbar"),
toggleButton: document.getElementById("secondaryToolbarToggle"),
toggleButton: document.getElementById("secondaryToolbarToggleButton"),
presentationModeButton: document.getElementById("presentationMode"),
openFileButton:
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
Expand Down Expand Up @@ -105,7 +105,7 @@ function getViewerConfiguration() {
// Divs (and sidebar button)
outerContainer: document.getElementById("outerContainer"),
sidebarContainer: document.getElementById("sidebarContainer"),
toggleButton: document.getElementById("sidebarToggle"),
toggleButton: document.getElementById("sidebarToggleButton"),
resizer: document.getElementById("sidebarResizer"),
// Buttons
thumbnailButton: document.getElementById("viewThumbnail"),
Expand All @@ -122,7 +122,7 @@ function getViewerConfiguration() {
},
findBar: {
bar: document.getElementById("findbar"),
toggleButton: document.getElementById("viewFind"),
toggleButton: document.getElementById("viewFindButton"),
findField: document.getElementById("findInput"),
highlightAllCheckbox: document.getElementById("findHighlightAll"),
caseSensitiveCheckbox: document.getElementById("findMatchCase"),
Expand Down

0 comments on commit f427993

Please sign in to comment.