Skip to content

Commit ce113d2

Browse files
authored
Merge pull request #28 from SharinPix/remove-additional-unused-features-2
Remove unecessary features
2 parents cd2b58d + 73d27ec commit ce113d2

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

web/app.js

+4
Original file line numberDiff line numberDiff line change
@@ -2856,6 +2856,7 @@ function onKeyDown(evt) {
28562856
}
28572857
}
28582858

2859+
/*
28592860
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC || CHROME")) {
28602861
// CTRL or META without shift
28612862
if (cmd === 1 || cmd === 8) {
@@ -2895,6 +2896,7 @@ function onKeyDown(evt) {
28952896
break;
28962897
}
28972898
}
2899+
*/
28982900

28992901
if (handled) {
29002902
if (ensureViewerFocused && !isViewerInPresentationMode) {
@@ -3073,9 +3075,11 @@ function onKeyDown(evt) {
30733075
this.moveCaret(/* isUp = */ false, /* select = */ true);
30743076
handled = true;
30753077
break;
3078+
/*
30763079
case 82: // 'r'
30773080
this.rotatePages(-90);
30783081
break;
3082+
*/
30793083
}
30803084
}
30813085

web/viewer.html

+20-20
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,20 @@
9696
<body tabindex="0">
9797
<div id="outerContainer">
9898

99-
<div id="sidebarContainer">
99+
<div id="sidebarContainer" class="hidden">
100100
<div id="toolbarSidebar" class="toolbarHorizontalGroup">
101101
<div id="toolbarSidebarLeft">
102-
<div id="sidebarViewButtons" class="toolbarHorizontalGroup toggled" role="radiogroup">
103-
<button id="viewThumbnail" class="toolbarButton toggled" type="button" title="Show Thumbnails" tabindex="0" data-l10n-id="pdfjs-thumbs-button" role="radio" aria-checked="true" aria-controls="thumbnailView">
102+
<div id="sidebarViewButtons" class="toolbarHorizontalGroup toggled hidden" role="radiogroup">
103+
<button id="viewThumbnail" class="toolbarButton toggled hidden" type="button" title="Show Thumbnails" tabindex="0" data-l10n-id="pdfjs-thumbs-button" role="radio" aria-checked="true" aria-controls="thumbnailView">
104104
<span data-l10n-id="pdfjs-thumbs-button-label">Thumbnails</span>
105105
</button>
106-
<button id="viewOutline" class="toolbarButton" type="button" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="0" data-l10n-id="pdfjs-document-outline-button" role="radio" aria-checked="false" aria-controls="outlineView">
106+
<button id="viewOutline" class="toolbarButton hidden" type="button" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="0" data-l10n-id="pdfjs-document-outline-button" role="radio" aria-checked="false" aria-controls="outlineView">
107107
<span data-l10n-id="pdfjs-document-outline-button-label">Document Outline</span>
108108
</button>
109-
<button id="viewAttachments" class="toolbarButton" type="button" title="Show Attachments" tabindex="0" data-l10n-id="pdfjs-attachments-button" role="radio" aria-checked="false" aria-controls="attachmentsView">
109+
<button id="viewAttachments" class="toolbarButton hidden" type="button" title="Show Attachments" tabindex="0" data-l10n-id="pdfjs-attachments-button" role="radio" aria-checked="false" aria-controls="attachmentsView">
110110
<span data-l10n-id="pdfjs-attachments-button-label">Attachments</span>
111111
</button>
112-
<button id="viewLayers" class="toolbarButton" type="button" title="Show Layers (double-click to reset all layers to the default state)" tabindex="0" data-l10n-id="pdfjs-layers-button" role="radio" aria-checked="false" aria-controls="layersView">
112+
<button id="viewLayers" class="toolbarButton hidden" type="button" title="Show Layers (double-click to reset all layers to the default state)" tabindex="0" data-l10n-id="pdfjs-layers-button" role="radio" aria-checked="false" aria-controls="layersView">
113113
<span data-l10n-id="pdfjs-layers-button-label">Layers</span>
114114
</button>
115115
</div>
@@ -143,10 +143,10 @@
143143
<div id="toolbarContainer">
144144
<div id="toolbarViewer" class="toolbarHorizontalGroup">
145145
<div id="toolbarViewerLeft" class="toolbarHorizontalGroup">
146-
<button id="sidebarToggleButton" class="toolbarButton" type="button" title="Toggle Sidebar" tabindex="0" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-haspopup="true" aria-controls="sidebarContainer">
146+
<button id="sidebarToggleButton" class="toolbarButton hidden" type="button" title="Toggle Sidebar" tabindex="0" data-l10n-id="pdfjs-toggle-sidebar-button" aria-expanded="false" aria-haspopup="true" aria-controls="sidebarContainer">
147147
<span data-l10n-id="pdfjs-toggle-sidebar-button-label">Toggle Sidebar</span>
148148
</button>
149-
<div class="toolbarButtonSpacer"></div>
149+
<!-- <div class="toolbarButtonSpacer"></div> -->
150150
<div class="toolbarButtonWithContainer">
151151
<button id="viewFindButton" class="toolbarButton" type="button" title="Find in Document" tabindex="0" data-l10n-id="pdfjs-findbar-button" aria-expanded="false" aria-controls="findbar">
152152
<span data-l10n-id="pdfjs-findbar-button-label">Find</span>
@@ -329,7 +329,7 @@
329329
</button>
330330
</div>
331331

332-
<div class="verticalToolbarSeparator hiddenMediumView hidden"></div>
332+
<div class="verticalToolbarSeparator hiddenMediumView"></div>
333333

334334
<div id="secondaryToolbarToggle" class="toolbarButtonWithContainer">
335335
<button id="secondaryToolbarToggleButton" class="toolbarButton" type="button" title="Tools" tabindex="0" data-l10n-id="pdfjs-tools-button" aria-expanded="false" aria-haspopup="true" aria-controls="secondaryToolbar">
@@ -344,11 +344,11 @@
344344
<!--#endif-->
345345

346346
<div class="visibleMediumView">
347-
<button id="secondaryPrint" class="toolbarButton labeled" type="button" title="Print" tabindex="0" data-l10n-id="pdfjs-print-button">
347+
<button id="secondaryPrint" class="toolbarButton labeled hidden" type="button" title="Print" tabindex="0" data-l10n-id="pdfjs-print-button">
348348
<span data-l10n-id="pdfjs-print-button-label">Print</span>
349349
</button>
350350

351-
<button id="secondaryDownload" class="toolbarButton labeled" type="button" title="Save" tabindex="0" data-l10n-id="pdfjs-save-button">
351+
<button id="secondaryDownload" class="toolbarButton labeled hidden" type="button" title="Save" tabindex="0" data-l10n-id="pdfjs-save-button">
352352
<span data-l10n-id="pdfjs-save-button-label">Save</span>
353353
</button>
354354

@@ -361,15 +361,15 @@
361361
<div class="horizontalToolbarSeparator hidden"></div>
362362
<!--#endif-->
363363

364-
<button id="presentationMode" class="toolbarButton labeled" type="button" title="Switch to Presentation Mode" tabindex="0" data-l10n-id="pdfjs-presentation-mode-button">
364+
<button id="presentationMode" class="toolbarButton labeled hidden" type="button" title="Switch to Presentation Mode" tabindex="0" data-l10n-id="pdfjs-presentation-mode-button">
365365
<span data-l10n-id="pdfjs-presentation-mode-button-label">Presentation Mode</span>
366366
</button>
367367

368-
<a href="#" id="viewBookmark" class="toolbarButton labeled" title="Current Page (View URL from Current Page)" tabindex="0" data-l10n-id="pdfjs-bookmark-button">
368+
<a href="#" id="viewBookmark" class="toolbarButton labeled hidden" title="Current Page (View URL from Current Page)" tabindex="0" data-l10n-id="pdfjs-bookmark-button">
369369
<span data-l10n-id="pdfjs-bookmark-button-label">Current Page</span>
370370
</a>
371371

372-
<div id="viewBookmarkSeparator" class="horizontalToolbarSeparator"></div>
372+
<div id="viewBookmarkSeparator" class="horizontalToolbarSeparator hidden"></div>
373373

374374
<button id="firstPage" class="toolbarButton labeled" type="button" title="Go to First Page" tabindex="0" data-l10n-id="pdfjs-first-page-button">
375375
<span data-l10n-id="pdfjs-first-page-button-label">Go to First Page</span>
@@ -380,17 +380,17 @@
380380

381381
<div class="horizontalToolbarSeparator"></div>
382382

383-
<button id="pageRotateCw" class="toolbarButton labeled" type="button" title="Rotate Clockwise" tabindex="0" data-l10n-id="pdfjs-page-rotate-cw-button">
383+
<button id="pageRotateCw" class="toolbarButton labeled hidden" type="button" title="Rotate Clockwise" tabindex="0" data-l10n-id="pdfjs-page-rotate-cw-button">
384384
<span data-l10n-id="pdfjs-page-rotate-cw-button-label">Rotate Clockwise</span>
385385
</button>
386-
<button id="pageRotateCcw" class="toolbarButton labeled" type="button" title="Rotate Counterclockwise" tabindex="0" data-l10n-id="pdfjs-page-rotate-ccw-button">
386+
<button id="pageRotateCcw" class="toolbarButton labeled hidden" type="button" title="Rotate Counterclockwise" tabindex="0" data-l10n-id="pdfjs-page-rotate-ccw-button">
387387
<span data-l10n-id="pdfjs-page-rotate-ccw-button-label">Rotate Counterclockwise</span>
388388
</button>
389389

390-
<div class="horizontalToolbarSeparator"></div>
390+
<div class="horizontalToolbarSeparator hidden"></div>
391391

392392
<div id="cursorToolButtons" role="radiogroup">
393-
<button id="cursorSelectTool" class="toolbarButton labeled toggled" type="button" title="Enable Text Selection Tool" tabindex="0" data-l10n-id="pdfjs-cursor-text-select-tool-button" role="radio" aria-checked="true">
393+
<button id="cursorSelectTool" class="toolbarButton labeled toggled hidden" type="button" title="Enable Text Selection Tool" tabindex="0" data-l10n-id="pdfjs-cursor-text-select-tool-button" role="radio" aria-checked="true">
394394
<span data-l10n-id="pdfjs-cursor-text-select-tool-button-label">Text Selection Tool</span>
395395
</button>
396396
<button id="cursorHandTool" class="toolbarButton labeled" type="button" title="Enable Hand Tool" tabindex="0" data-l10n-id="pdfjs-cursor-hand-tool-button" role="radio" aria-checked="false">
@@ -401,7 +401,7 @@
401401
<div class="horizontalToolbarSeparator"></div>
402402

403403
<div id="scrollModeButtons" role="radiogroup">
404-
<button id="scrollPage" class="toolbarButton labeled" type="button" title="Use Page Scrolling" tabindex="0" data-l10n-id="pdfjs-scroll-page-button" role="radio" aria-checked="false">
404+
<button id="scrollPage" class="toolbarButton labeled hidden" type="button" title="Use Page Scrolling" tabindex="0" data-l10n-id="pdfjs-scroll-page-button" role="radio" aria-checked="false">
405405
<span data-l10n-id="pdfjs-scroll-page-button-label">Page Scrolling</span>
406406
</button>
407407
<button id="scrollVertical" class="toolbarButton labeled toggled" type="button" title="Use Vertical Scrolling" tabindex="0" data-l10n-id="pdfjs-scroll-vertical-button" role="radio" aria-checked="true">
@@ -410,7 +410,7 @@
410410
<button id="scrollHorizontal" class="toolbarButton labeled" type="button" title="Use Horizontal Scrolling" tabindex="0" data-l10n-id="pdfjs-scroll-horizontal-button" role="radio" aria-checked="false">
411411
<span data-l10n-id="pdfjs-scroll-horizontal-button-label">Horizontal Scrolling</span>
412412
</button>
413-
<button id="scrollWrapped" class="toolbarButton labeled" type="button" title="Use Wrapped Scrolling" tabindex="0" data-l10n-id="pdfjs-scroll-wrapped-button" role="radio" aria-checked="false">
413+
<button id="scrollWrapped" class="toolbarButton labeled hidden" type="button" title="Use Wrapped Scrolling" tabindex="0" data-l10n-id="pdfjs-scroll-wrapped-button" role="radio" aria-checked="false">
414414
<span data-l10n-id="pdfjs-scroll-wrapped-button-label">Wrapped Scrolling</span>
415415
</button>
416416
</div>

web/viewer.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,10 @@ function webViewerLoad() {
245245
// in order to support cases where the viewer is embedded in
246246
// a *dynamically* created <iframe> element.
247247
parent.document.dispatchEvent(event);
248-
} catch (ex) {
248+
} catch {
249249
// The viewer could be in e.g. a cross-origin <iframe> element,
250250
// fallback to dispatching the event at the current `document`.
251251
// console.error(`webviewerloaded: ${ex}`);
252-
console.log(
253-
"Dispatching event on current document due to cross-origin restriction: ",
254-
ex
255-
);
256252
document.dispatchEvent(event);
257253
}
258254
}

0 commit comments

Comments
 (0)