From 52a4d874eada5be121e15d73d1d10e9a8d84bdb8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 14 Mar 2021 18:04:19 -0400 Subject: Make MediaUtil a static class (#1525) --- ext/js/comm/clipboard-reader.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ext/js/comm') diff --git a/ext/js/comm/clipboard-reader.js b/ext/js/comm/clipboard-reader.js index 6d4f5abc..9336efe5 100644 --- a/ext/js/comm/clipboard-reader.js +++ b/ext/js/comm/clipboard-reader.js @@ -15,6 +15,10 @@ * along with this program. If not, see . */ +/* global + * MediaUtil + */ + /** * Class which can read text and images from the clipboard. */ @@ -25,14 +29,13 @@ class ClipboardReader { * @param pasteTargetSelector The selector for the paste target element. * @param imagePasteTargetSelector The selector for the image paste target element. */ - constructor({document=null, pasteTargetSelector=null, imagePasteTargetSelector=null, mediaUtil=null}) { + constructor({document=null, pasteTargetSelector=null, imagePasteTargetSelector=null}) { this._document = document; this._browser = null; this._pasteTarget = null; this._pasteTargetSelector = pasteTargetSelector; this._imagePasteTarget = null; this._imagePasteTargetSelector = imagePasteTargetSelector; - this._mediaUtil = mediaUtil; } /** @@ -107,7 +110,6 @@ class ClipboardReader { // See browser-specific notes in getText if ( this._isFirefox() && - this._mediaUtil !== null && typeof navigator.clipboard !== 'undefined' && typeof navigator.clipboard.read === 'function' ) { @@ -120,7 +122,7 @@ class ClipboardReader { } for (const file of files) { - if (this._mediaUtil.getFileExtensionFromImageMediaType(file.type) !== null) { + if (MediaUtil.getFileExtensionFromImageMediaType(file.type) !== null) { return await this._readFileAsDataURL(file); } } -- cgit v1.2.3