diff --git a/public/script.js b/public/script.js index 02626d6ae..5b3ca34d0 100644 --- a/public/script.js +++ b/public/script.js @@ -6765,6 +6765,22 @@ function connectAPISlash(_, text) { toastr.info(`API set to ${text}, trying to connect..`); } +export function processDroppedFiles(files) { + const allowedMimeTypes = [ + 'application/json', + 'image/png', + 'image/webp', + ]; + + for (const file of files) { + if (allowedMimeTypes.includes(file.type)) { + importCharacter(file); + } else { + toastr.warning('Unsupported file type: ' + file.name); + } + } +} + function importCharacter(file) { const ext = file.name.match(/\.(\w+)$/); if ( @@ -8810,21 +8826,6 @@ jQuery(async function () { processDroppedFiles(files); }); - function processDroppedFiles(files) { - const allowedMimeTypes = [ - 'application/json', - 'image/png', - 'image/webp', - ]; - - for (const file of files) { - if (allowedMimeTypes.includes(file.type)) { - importCharacter(file); - } else { - toastr.warning('Unsupported file type: ' + file.name); - } - } - } $("#charListGridToggle").on('click', async () => { doCharListDisplaySwitch();