Преглед на файлове

jp can now be set from settings

master
Haku преди 4 години
родител
ревизия
1554797a08
променени са 1 файла, в които са добавени 20 реда и са изтрити 0 реда
  1. +20
    -0
      src/settings.ts

+ 20
- 0
src/settings.ts Целия файл

@@ -4,6 +4,18 @@ document.querySelector('#content').innerHTML = `<h1>Raspberry Settings</h1>
<table>
<tbody id="keys">

</tbody>
</table>
</fieldset>
<fieldset>
<legend>Miscellaneous</legend>
<table>
<tbody>
<tr>
<td><label for="jump-point">Jump Point</label></td>
<td><input type="text" id="jump-point"></td>
<td><input type="button" class="button" id="set-jump-point" value="Set"></td>
</tr>
</tbody>
</table>
</fieldset>`;
@@ -48,4 +60,12 @@ async function addKeySetter(functionName: string, displayName?: string)
else
await addKeySetter(keybinds[i].functionName);
}

// Other settings
(document.querySelector('#jump-point') as HTMLInputElement).value = await getStorageValue('jp');
document.querySelector('#set-jump-point').addEventListener('click', async (e: MouseEvent): Promise<void> =>
{
const jumpPoint: string = canonicalize((document.querySelector('#jump-point') as HTMLInputElement).value);
await setStorageValue('jp', jumpPoint);
});
})();

Зареждане…
Отказ
Запис