From 057994d78128c9c851c89f79d274107cbebd99ed Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Mon, 28 May 2018 22:54:09 +0200 Subject: [PATCH] Backout of pull request #9345 --- web/app.js | 14 ++++---------- web/ui_utils.js | 9 --------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/web/app.js b/web/app.js index 3aa891928..de4f8c8ec 100644 --- a/web/app.js +++ b/web/app.js @@ -15,10 +15,10 @@ /* globals PDFBug, Stats */ import { - animationStarted, DEFAULT_SCALE_VALUE, getPDFFileNameFromURL, isFileSchema, - isValidRotation, MAX_SCALE, MIN_SCALE, noContextMenuHandler, - normalizeWheelEventDelta, parseQueryString, PresentationModeState, - ProgressBar, RendererType, TextLayerMode + animationStarted, DEFAULT_SCALE_VALUE, getPDFFileNameFromURL, isValidRotation, + MAX_SCALE, MIN_SCALE, noContextMenuHandler, normalizeWheelEventDelta, + parseQueryString, PresentationModeState, ProgressBar, RendererType, + TextLayerMode } from './ui_utils'; import { build, createBlob, getDocument, getFilenameFromUrl, GlobalWorkerOptions, @@ -745,12 +745,6 @@ let PDFViewerApplication = { } } - if (this.url && isFileSchema(this.url)) { - let appConfig = this.appConfig; - appConfig.toolbar.download.setAttribute('hidden', 'true'); - appConfig.secondaryToolbar.downloadButton.setAttribute('hidden', 'true'); - } - let loadingTask = getDocument(parameters); this.pdfLoadingTask = loadingTask; diff --git a/web/ui_utils.js b/web/ui_utils.js index 455bec351..0c506f983 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -536,14 +536,6 @@ function noContextMenuHandler(evt) { evt.preventDefault(); } -function isFileSchema(url) { - let i = 0, ii = url.length; - while (i < ii && url[i].trim() === '') { - i++; - } - return url.substr(i, 7).toLowerCase() === 'file://'; -} - function isDataSchema(url) { let i = 0, ii = url.length; while (i < ii && url[i].trim() === '') { @@ -843,7 +835,6 @@ export { VERTICAL_PADDING, isValidRotation, isPortraitOrientation, - isFileSchema, cloneObj, PresentationModeState, RendererType,