diff --git a/src/buttons.ts b/src/buttons.ts index e69de29..e8e1896 100644 --- a/src/buttons.ts +++ b/src/buttons.ts @@ -0,0 +1,18 @@ +function addButton(label: string, callback: (e: MouseEvent) => void) +{ + const button: HTMLInputElement = document.createElement('input'); + button.type = 'button'; + button.addEventListener('click', callback); + button.id = label.toLowerCase().replace(/ /g, '-'); + button.value = label; + const belDiv: HTMLDivElement = document.createElement('div'); + button.classList.add('button'); + belDiv.classList.add('bel'); + belDiv.appendChild(button); + document.querySelector('#loginswitcher').parentNode.insertBefore(belDiv, document.querySelector('#loginswitcher')); +} + +addButton('Raspberry Settings', (e: MouseEvent): void => +{ + window.location.href = '/page=blank/raspberry=settings'; +}); \ No newline at end of file