Allow multiple import of regex

This commit is contained in:
Cohee
2024-05-17 01:06:00 +03:00
parent 71a3e2c91b
commit 59d00cca74
2 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,7 @@
<i class="fa-solid fa-file-import"></i> <i class="fa-solid fa-file-import"></i>
<span data-i18n="ext_regex_import_script">Import Script</span> <span data-i18n="ext_regex_import_script">Import Script</span>
</div> </div>
<input type="file" id="import_regex_file" hidden accept="*.json" /> <input type="file" id="import_regex_file" hidden accept="*.json" multiple />
</div> </div>
<hr /> <hr />
<label data-i18n="ext_regex_saved_scripts">Saved Scripts</label> <label data-i18n="ext_regex_saved_scripts">Saved Scripts</label>

View File

@ -325,7 +325,9 @@ jQuery(async () => {
}); });
$('#import_regex_file').on('change', async function () { $('#import_regex_file').on('change', async function () {
const inputElement = this instanceof HTMLInputElement && this; const inputElement = this instanceof HTMLInputElement && this;
await onRegexImportFileChange(inputElement.files[0]); for (const file of inputElement.files) {
await onRegexImportFileChange(file);
}
inputElement.value = ''; inputElement.value = '';
}); });
$('#import_regex').on('click', function () { $('#import_regex').on('click', function () {