Fix type errors in regex extension
| @@ -205,8 +205,8 @@ async function loadRegexScripts() { | ||
| 205 | 205 | $(container).append(scriptHtml); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | extension_settings?.regex?.forEach((script, index, array) => renderScript('#saved_regex_scripts', script, false, index, array)); |
| 209 | 209 | characters[this_chid]?.data?.extensions?.regex_scripts?.forEach((script, index, array) => renderScript('#saved_scoped_scripts', script, true, index, array)); |
| 210 | 210 | |
| 211 | 211 | const isAllowed = extension_settings?.character_allowed_regex?.includes(characters?.[this_chid]?.avatar); |
| 212 | 212 | $('#regex_scoped_toggle').prop('checked', isAllowed); |
| @@ -280,11 +280,18 @@ async function onRegexEditorOpenClick(existingId, isScoped) { | ||
| 280 | 280 | |
| 281 | 281 | const testScript = { |
| 282 | 282 | id: uuidv4(), |
| 283 | 283 | scriptName: editorHtml.find('.regex_script_name').val().toString(), |
| 284 | 284 | findRegex: editorHtml.find('.find_regex').val().toString(), |
| 285 | 285 | replaceString: editorHtml.find('.regex_replace_string').val().toString(), |
| 286 | 286 | trimStrings: String(editorHtml.find('.regex_trim_strings').val()).split('\n').filter((e) => e.length !== 0) || [], |
| 287 | 287 | substituteRegex: Number(editorHtml.find('select[name="substitute_regex"]').val()), |
| 288 | + disabled: false, | |
| 289 | + promptOnly: false, | |
| 290 | + markdownOnly: false, | |
| 291 | + runOnEdit: false, | |
| 292 | + minDepth: null, | |
| 293 | + maxDepth: null, | |
| 294 | + placement: null, | |
| 288 | 295 | }; |
| 289 | 296 | const rawTestString = String(editorHtml.find('#regex_test_input').val()); |
| 290 | 297 | const result = runRegexScript(testScript, rawTestString); |
| @@ -301,12 +308,12 @@ async function onRegexEditorOpenClick(existingId, isScoped) { | ||
| 301 | 308 | scriptName: String(editorHtml.find('.regex_script_name').val()), |
| 302 | 309 | findRegex: String(editorHtml.find('.find_regex').val()), |
| 303 | 310 | replaceString: String(editorHtml.find('.regex_replace_string').val()), |
| 304 | 311 | trimStrings: String(editorHtml.find('.regex_trim_strings').val()).split('\n').filter((e) => e.length !== 0) || [], |
| 305 | 312 | placement: |
| 306 | 313 | editorHtml |
| 307 | 314 | .find('input[name="replace_position"]') |
| 308 | 315 | .filter(':checked') |
| 309 | 316 | .map(function () { return parseInt($(this).val().toString()); }) |
| 310 | 317 | .get() |
| 311 | 318 | .filter((e) => !isNaN(e)) || [], |
| 312 | 319 | disabled: editorHtml.find('input[name="disabled"]').prop('checked'), |