diff --git a/src/main.ts b/src/main.ts index 8a0625d..485decc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -19,10 +19,16 @@ const keybinds: Keybind[] = [ functionName: 'move', displayName: null, callback: () => { - const moveButton: HTMLButtonElement = - document.querySelector('button[name=move_region]') as HTMLButtonElement; - if (moveButton) - moveButton.click(); + if (urlParams['page'] === 'reports') { + const actionButton: HTMLInputElement = document.querySelector('#action'); + if (actionButton) + actionButton.click(); + } else { + const moveButton: HTMLButtonElement = + document.querySelector('button[name=move_region]') as HTMLButtonElement; + if (moveButton) + moveButton.click(); + } }, modifiedCallback: null }, diff --git a/src/region.ts b/src/region.ts index e69de29..f15a59c 100644 --- a/src/region.ts +++ b/src/region.ts @@ -0,0 +1,13 @@ +(() => +{ + const moveButton: HTMLButtonElement = document.querySelector('button[name=move_region]'); + if (moveButton) { + const localid = (document.querySelector('input[name=localid]') as HTMLInputElement).value; + moveButton.addEventListener('click', (e) => + { + moveButton.disabled = true; + e.preventDefault(); + window.location.href = `/template-overall=none/page=change_region?localid=${localid}®ion_name=${urlParams['region']}&move_region=1`; + }); + } +})(); \ No newline at end of file