Merge pull request #14833 from Snuffleupagus/mozcentral-rm-openFile-buttons
Stop bundling the openFile-buttons in the MOZCENTRAL build
This commit is contained in:
commit
5ca9f9bf86
@ -1239,6 +1239,11 @@ gulp.task(
|
|||||||
MOZCENTRAL_DIR + "browser/locales/en-US/pdfviewer/",
|
MOZCENTRAL_DIR + "browser/locales/en-US/pdfviewer/",
|
||||||
FIREFOX_CONTENT_DIR = EXTENSION_SRC_DIR + "/firefox/content/";
|
FIREFOX_CONTENT_DIR = EXTENSION_SRC_DIR + "/firefox/content/";
|
||||||
|
|
||||||
|
const MOZCENTRAL_WEB_FILES = [
|
||||||
|
...COMMON_WEB_FILES,
|
||||||
|
"!web/images/toolbarButton-openFile.svg",
|
||||||
|
];
|
||||||
|
|
||||||
// Clear out everything in the firefox extension build directory
|
// Clear out everything in the firefox extension build directory
|
||||||
rimraf.sync(MOZCENTRAL_DIR);
|
rimraf.sync(MOZCENTRAL_DIR);
|
||||||
|
|
||||||
@ -1263,7 +1268,7 @@ gulp.task(
|
|||||||
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
|
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")
|
||||||
),
|
),
|
||||||
gulp
|
gulp
|
||||||
.src(COMMON_WEB_FILES, { base: "web/" })
|
.src(MOZCENTRAL_WEB_FILES, { base: "web/" })
|
||||||
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")),
|
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR + "web")),
|
||||||
createCMapBundle().pipe(
|
createCMapBundle().pipe(
|
||||||
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/cmaps")
|
gulp.dest(MOZCENTRAL_CONTENT_DIR + "web/cmaps")
|
||||||
|
@ -2192,7 +2192,7 @@ function webViewerInitialized() {
|
|||||||
fileInput: evt.dataTransfer,
|
fileInput: evt.dataTransfer,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else if (!PDFJSDev.test("MOZCENTRAL")) {
|
||||||
appConfig.toolbar.openFile.hidden = true;
|
appConfig.toolbar.openFile.hidden = true;
|
||||||
appConfig.secondaryToolbar.openFileButton.hidden = true;
|
appConfig.secondaryToolbar.openFileButton.hidden = true;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,6 @@ class SecondaryToolbar {
|
|||||||
eventName: "presentationmode",
|
eventName: "presentationmode",
|
||||||
close: true,
|
close: true,
|
||||||
},
|
},
|
||||||
{ element: options.openFileButton, eventName: "openfile", close: true },
|
|
||||||
{ element: options.printButton, eventName: "print", close: true },
|
{ element: options.printButton, eventName: "print", close: true },
|
||||||
{ element: options.downloadButton, eventName: "download", close: true },
|
{ element: options.downloadButton, eventName: "download", close: true },
|
||||||
{ element: options.viewBookmarkButton, eventName: null, close: true },
|
{ element: options.viewBookmarkButton, eventName: null, close: true },
|
||||||
@ -141,6 +140,13 @@ class SecondaryToolbar {
|
|||||||
close: true,
|
close: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
|
||||||
|
this.buttons.push({
|
||||||
|
element: options.openFileButton,
|
||||||
|
eventName: "openfile",
|
||||||
|
close: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
this.items = {
|
this.items = {
|
||||||
firstPage: options.firstPageButton,
|
firstPage: options.firstPageButton,
|
||||||
lastPage: options.lastPageButton,
|
lastPage: options.lastPageButton,
|
||||||
|
@ -62,7 +62,6 @@ class Toolbar {
|
|||||||
{ element: options.next, eventName: "nextpage" },
|
{ element: options.next, eventName: "nextpage" },
|
||||||
{ element: options.zoomIn, eventName: "zoomin" },
|
{ element: options.zoomIn, eventName: "zoomin" },
|
||||||
{ element: options.zoomOut, eventName: "zoomout" },
|
{ element: options.zoomOut, eventName: "zoomout" },
|
||||||
{ element: options.openFile, eventName: "openfile" },
|
|
||||||
{ element: options.print, eventName: "print" },
|
{ element: options.print, eventName: "print" },
|
||||||
{
|
{
|
||||||
element: options.presentationModeButton,
|
element: options.presentationModeButton,
|
||||||
@ -71,6 +70,9 @@ class Toolbar {
|
|||||||
{ element: options.download, eventName: "download" },
|
{ element: options.download, eventName: "download" },
|
||||||
{ element: options.viewBookmark, eventName: null },
|
{ element: options.viewBookmark, eventName: null },
|
||||||
];
|
];
|
||||||
|
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
|
||||||
|
this.buttons.push({ element: options.openFile, eventName: "openfile" });
|
||||||
|
}
|
||||||
this.items = {
|
this.items = {
|
||||||
numPages: options.numPages,
|
numPages: options.numPages,
|
||||||
pageNumber: options.pageNumber,
|
pageNumber: options.pageNumber,
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
--toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn.svg);
|
--toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn.svg);
|
||||||
--toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode.svg);
|
--toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode.svg);
|
||||||
--toolbarButton-print-icon: url(images/toolbarButton-print.svg);
|
--toolbarButton-print-icon: url(images/toolbarButton-print.svg);
|
||||||
--toolbarButton-openFile-icon: url(images/toolbarButton-openFile.svg);
|
--toolbarButton-openFile-icon: url(images/toolbarButton-openFile.svg); /* -webkit-non-mozcentral */
|
||||||
--toolbarButton-download-icon: url(images/toolbarButton-download.svg);
|
--toolbarButton-download-icon: url(images/toolbarButton-download.svg);
|
||||||
--toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark.svg);
|
--toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark.svg);
|
||||||
--toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail.svg);
|
--toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail.svg);
|
||||||
@ -821,8 +821,8 @@ select {
|
|||||||
mask-image: var(--toolbarButton-print-icon);
|
mask-image: var(--toolbarButton-print-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbarButton.openFile::before,
|
.toolbarButton.openFile::before, /* -webkit-non-mozcentral */
|
||||||
.secondaryToolbarButton.openFile::before {
|
.secondaryToolbarButton.openFile::before /* -webkit-non-mozcentral */ {
|
||||||
mask-image: var(--toolbarButton-openFile-icon);
|
mask-image: var(--toolbarButton-openFile-icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,9 +153,11 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!--#if !MOZCENTRAL-->
|
||||||
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
|
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
|
||||||
<span data-l10n-id="open_file_label">Open</span>
|
<span data-l10n-id="open_file_label">Open</span>
|
||||||
</button>
|
</button>
|
||||||
|
<!--#endif-->
|
||||||
|
|
||||||
<button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
|
<button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
|
||||||
<span data-l10n-id="print_label">Print</span>
|
<span data-l10n-id="print_label">Print</span>
|
||||||
@ -265,9 +267,11 @@ See https://github.com/adobe-type-tools/cmap-resources
|
|||||||
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
<span data-l10n-id="presentation_mode_label">Presentation Mode</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<!--#if !MOZCENTRAL-->
|
||||||
<button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
|
<button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
|
||||||
<span data-l10n-id="open_file_label">Open</span>
|
<span data-l10n-id="open_file_label">Open</span>
|
||||||
</button>
|
</button>
|
||||||
|
<!--#endif-->
|
||||||
|
|
||||||
<button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
|
<button id="print" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
|
||||||
<span data-l10n-id="print_label">Print</span>
|
<span data-l10n-id="print_label">Print</span>
|
||||||
|
@ -88,7 +88,10 @@ function getViewerConfiguration() {
|
|||||||
zoomIn: document.getElementById("zoomIn"),
|
zoomIn: document.getElementById("zoomIn"),
|
||||||
zoomOut: document.getElementById("zoomOut"),
|
zoomOut: document.getElementById("zoomOut"),
|
||||||
viewFind: document.getElementById("viewFind"),
|
viewFind: document.getElementById("viewFind"),
|
||||||
openFile: document.getElementById("openFile"),
|
openFile:
|
||||||
|
typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")
|
||||||
|
? document.getElementById("openFile")
|
||||||
|
: null,
|
||||||
print: document.getElementById("print"),
|
print: document.getElementById("print"),
|
||||||
presentationModeButton: document.getElementById("presentationMode"),
|
presentationModeButton: document.getElementById("presentationMode"),
|
||||||
download: document.getElementById("download"),
|
download: document.getElementById("download"),
|
||||||
@ -103,7 +106,10 @@ function getViewerConfiguration() {
|
|||||||
presentationModeButton: document.getElementById(
|
presentationModeButton: document.getElementById(
|
||||||
"secondaryPresentationMode"
|
"secondaryPresentationMode"
|
||||||
),
|
),
|
||||||
openFileButton: document.getElementById("secondaryOpenFile"),
|
openFileButton:
|
||||||
|
typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")
|
||||||
|
? document.getElementById("secondaryOpenFile")
|
||||||
|
: null,
|
||||||
printButton: document.getElementById("secondaryPrint"),
|
printButton: document.getElementById("secondaryPrint"),
|
||||||
downloadButton: document.getElementById("secondaryDownload"),
|
downloadButton: document.getElementById("secondaryDownload"),
|
||||||
viewBookmarkButton: document.getElementById("secondaryViewBookmark"),
|
viewBookmarkButton: document.getElementById("secondaryViewBookmark"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user