diff options
Diffstat (limited to 'app/assets/javascripts/content_editor/services/utils.js')
-rw-r--r-- | app/assets/javascripts/content_editor/services/utils.js | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/app/assets/javascripts/content_editor/services/utils.js b/app/assets/javascripts/content_editor/services/utils.js index e352fa8a9db..1c128b4aa19 100644 --- a/app/assets/javascripts/content_editor/services/utils.js +++ b/app/assets/javascripts/content_editor/services/utils.js @@ -4,26 +4,4 @@ export const hasSelection = (tiptapEditor) => { return from < to; }; -/** - * Extracts filename from a URL - * - * @example - * > extractFilename('https://gitlab.com/images/logo-full.png') - * < 'logo-full' - * - * @param {string} src The URL to extract filename from - * @returns {string} - */ -export const extractFilename = (src) => { - return src.replace(/^.*\/|\.[^.]+?$/g, ''); -}; - -export const readFileAsDataURL = (file) => { - return new Promise((resolve) => { - const reader = new FileReader(); - reader.addEventListener('load', (e) => resolve(e.target.result), { once: true }); - reader.readAsDataURL(file); - }); -}; - export const clamp = (n, min, max) => Math.max(Math.min(n, max), min); |