Move the getPdfFilenameFromUrl helper function from web/ui_utils.js and into src/display/display_utils.js

It seems reasonable to place this alongside the *similar* `getFilenameFromUrl` helper function. This way, with the changes in the next patch, we also avoid having to expose the `isDataScheme` function in the API itself and we instead expose `getPdfFilenameFromUrl` in the API (which feels overall more appropriate).
This commit is contained in:
Jonas Jenwald 2021-03-16 11:56:31 +01:00
parent a164941351
commit bd9dee1544
8 changed files with 225 additions and 226 deletions

View file

@ -13,12 +13,12 @@
* limitations under the License.
*/
import { createPromiseCapability, PDFDateString } from "pdfjs-lib";
import {
getPageSizeInches,
getPDFFileNameFromURL,
isPortraitOrientation,
} from "./ui_utils.js";
createPromiseCapability,
getPdfFilenameFromUrl,
PDFDateString,
} from "pdfjs-lib";
import { getPageSizeInches, isPortraitOrientation } from "./ui_utils.js";
const DEFAULT_FIELD_CONTENT = "-";
@ -140,7 +140,7 @@ class PDFDocumentProperties {
pageSize,
isLinearized,
] = await Promise.all([
contentDispositionFilename || getPDFFileNameFromURL(this.url),
contentDispositionFilename || getPdfFilenameFromUrl(this.url),
this._parseFileSize(contentLength),
this._parseDate(info.CreationDate),
this._parseDate(info.ModDate),