mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
showing peer selector on login, minor login improvements
This commit is contained in:
parent
9220466561
commit
2ee9731fdf
1 changed files with 37 additions and 30 deletions
|
@ -198,6 +198,7 @@
|
||||||
donate: 'Donate',
|
donate: 'Donate',
|
||||||
retry: 'Újra',
|
retry: 'Újra',
|
||||||
invalidPW: 'Hibás jelszó: ',
|
invalidPW: 'Hibás jelszó: ',
|
||||||
|
loggingIn: 'Belépés ...',
|
||||||
connecting: 'Csatlakozás: ',
|
connecting: 'Csatlakozás: ',
|
||||||
connect: 'Csatlakozás',
|
connect: 'Csatlakozás',
|
||||||
login: 'Belépés',
|
login: 'Belépés',
|
||||||
|
@ -1653,6 +1654,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function Auth(pw) {
|
function Auth(pw) {
|
||||||
|
SafeGetElementById('infoMainDiv', (elem) => {
|
||||||
|
elem.innerText = texts.loggingIn
|
||||||
|
})
|
||||||
post('login', { pw: pw, script: true }).then((res) => {
|
post('login', { pw: pw, script: true }).then((res) => {
|
||||||
if (res.result === 'success') {
|
if (res.result === 'success') {
|
||||||
infoExpireTime = -1
|
infoExpireTime = -1
|
||||||
|
@ -1844,6 +1848,9 @@
|
||||||
SafeGetElementById('loginDiv', (elem) => {
|
SafeGetElementById('loginDiv', (elem) => {
|
||||||
elem.style.display = 'flex'
|
elem.style.display = 'flex'
|
||||||
})
|
})
|
||||||
|
SafeGetElementById('peerSelector', (elem) => {
|
||||||
|
elem.style.display = ''
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function addNewHost() {
|
function addNewHost() {
|
||||||
|
@ -2734,6 +2741,36 @@
|
||||||
textAlign: 'center',
|
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: {
|
peerSelector: {
|
||||||
customElem: () => {
|
customElem: () => {
|
||||||
try {
|
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: {
|
hostInputContainer: {
|
||||||
id: 'hostInputContainer',
|
id: 'hostInputContainer',
|
||||||
style: {
|
style: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue