diff --git a/stable.user.js b/stable.user.js index 98c0c0e..4a568ad 100755 --- a/stable.user.js +++ b/stable.user.js @@ -198,6 +198,7 @@ donate: 'Donate', retry: 'Újra', invalidPW: 'Hibás jelszó: ', + loggingIn: 'Belépés ...', connecting: 'Csatlakozás: ', connect: 'Csatlakozás', login: 'Belépés', @@ -1653,6 +1654,9 @@ } function Auth(pw) { + SafeGetElementById('infoMainDiv', (elem) => { + elem.innerText = texts.loggingIn + }) post('login', { pw: pw, script: true }).then((res) => { if (res.result === 'success') { infoExpireTime = -1 @@ -1844,6 +1848,9 @@ SafeGetElementById('loginDiv', (elem) => { elem.style.display = 'flex' }) + SafeGetElementById('peerSelector', (elem) => { + elem.style.display = '' + }) } function addNewHost() { @@ -2734,6 +2741,36 @@ textAlign: 'center', }, }, + loginContainer: { + id: 'loginDiv', + style: { + display: 'none', + }, + children: { + loginInput: { + customElem: () => { + const loginInput = document.createElement('input') + loginInput.setAttribute('id', 'pwInput') + loginInput.type = 'text' + loginInput.placeholder = texts.pwHere + SetStyle(loginInput, { + width: '100%', + textAlign: 'center', + }) + return loginInput + }, + }, + loginButton: { + innerText: texts.login, + style: buttonStyle, + onClick: () => { + SafeGetElementById('pwInput', (elem) => { + Auth(elem.value.trim()) + }) + }, + }, + }, + }, peerSelector: { customElem: () => { try { @@ -2782,36 +2819,6 @@ } }, }, - loginContainer: { - id: 'loginDiv', - style: { - display: 'none', - }, - children: { - loginInput: { - customElem: () => { - const loginInput = document.createElement('input') - loginInput.setAttribute('id', 'pwInput') - loginInput.type = 'text' - loginInput.placeholder = texts.pwHere - SetStyle(loginInput, { - width: '100%', - textAlign: 'center', - }) - return loginInput - }, - }, - loginButton: { - innerText: texts.login, - style: buttonStyle, - onClick: () => { - SafeGetElementById('pwInput', (elem) => { - Auth(elem.value) - }) - }, - }, - }, - }, hostInputContainer: { id: 'hostInputContainer', style: {