|
|
|
@@ -27,19 +27,7 @@ const keybinds: Keybind[] = [ |
|
|
|
}, |
|
|
|
modifiedCallback: async () => { |
|
|
|
if (urlParams['view'] === `region.${await getStorageValue('jp')}`) { |
|
|
|
const nationsToEndorse: string[] = []; |
|
|
|
const lis: NodeList = document.querySelectorAll('li'); |
|
|
|
for (let i = 0; i < lis.length; i++) { |
|
|
|
const li: HTMLUListElement = lis[i] as HTMLUListElement; |
|
|
|
const nationName: string = canonicalize(li.querySelector('.nnameblock').innerHTML); |
|
|
|
if (li.innerHTML.indexOf('was admitted') !== -1) |
|
|
|
nationsToEndorse.push(nationName); |
|
|
|
else if (li.innerHTML.indexOf('resigned') !== -1) |
|
|
|
nationsToEndorse.splice(nationsToEndorse.indexOf(nationName), 1); |
|
|
|
} |
|
|
|
await setStorageValue('nationstoendorse', nationsToEndorse); |
|
|
|
if (nationsToEndorse.length > 0) |
|
|
|
window.location.href = `/template-overall=none/nation=${nationsToEndorse[0]}`; |
|
|
|
await crossEndoDoss(true); |
|
|
|
} |
|
|
|
else if (urlParams['nation']) { |
|
|
|
let nationsToEndorse: string[] = await getStorageValue('nationstoendorse'); |
|
|
|
@@ -75,19 +63,7 @@ const keybinds: Keybind[] = [ |
|
|
|
}, |
|
|
|
modifiedCallback: async () => { |
|
|
|
if (urlParams['view'] && (urlParams['view'] !== `region.${await getStorageValue('jp')}`)) { |
|
|
|
const nationsToDossier: string[] = []; |
|
|
|
const lis: NodeList = document.querySelectorAll('li'); |
|
|
|
for (let i = 0; i < lis.length; i++) { |
|
|
|
const li: HTMLUListElement = lis[i] as HTMLUListElement; |
|
|
|
const nationName: string = canonicalize(li.querySelector('.nnameblock').innerHTML); |
|
|
|
if (li.innerHTML.indexOf('was admitted') !== -1) |
|
|
|
nationsToDossier.push(nationName); |
|
|
|
else if (li.innerHTML.indexOf('resigned') !== -1) |
|
|
|
nationsToDossier.splice(nationsToDossier.indexOf(nationName), 1); |
|
|
|
} |
|
|
|
await setStorageValue('nationstodossier', nationsToDossier); |
|
|
|
if (nationsToDossier.length > 0) |
|
|
|
window.location.href = `/template-overall=none/nation=${nationsToDossier[0]}`; |
|
|
|
await crossEndoDoss(false); |
|
|
|
} |
|
|
|
else if (urlParams['nation']) { |
|
|
|
let nationsToDossier: string[] = await getStorageValue('nationstodossier'); |
|
|
|
|