mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Redirect to get veteran client id if user has client ID
This commit is contained in:
parent
edbafe3d8a
commit
5ffcdcaf85
1 changed files with 16 additions and 3 deletions
|
@ -63,7 +63,7 @@
|
|||
const serverAdress = 'https://qmining.frylabs.net/'
|
||||
// const serverAdress = 'http://localhost:8080/'
|
||||
// const apiAdress = 'https://api.frylabs.net/'
|
||||
const apiAdress = 'http://localhost:8080/'
|
||||
const apiAdress = 'http://localhost:80/'
|
||||
const ircAddress = 'https://kiwiirc.com/nextclient/irc.sub.fm/#qmining'
|
||||
|
||||
// forcing pages for testing. unless you test, do not set these to true!
|
||||
|
@ -661,7 +661,11 @@
|
|||
// : Loading {{{
|
||||
function HandleQminingSite (url) {
|
||||
try {
|
||||
Array.from(document.getElementById('sideBarLinks').childNodes).forEach((link) => {
|
||||
const sideLinks = document.getElementById('sideBarLinks')
|
||||
if (!sideLinks) {
|
||||
return
|
||||
}
|
||||
Array.from(sideLinks.childNodes).forEach((link) => {
|
||||
link.addEventListener('mousedown', () => {
|
||||
FillFeedbackCID(url, link)
|
||||
})
|
||||
|
@ -1549,6 +1553,8 @@
|
|||
loginButton.innerText = 'Login'
|
||||
const loginInput = document.createElement('input')
|
||||
loginInput.type = 'text'
|
||||
loginInput.style.textAlign = 'center'
|
||||
loginInput.value = getVal('clientId') || ''
|
||||
|
||||
loginDiv.appendChild(loginInput)
|
||||
loginDiv.appendChild(loginButton)
|
||||
|
@ -1556,7 +1562,14 @@
|
|||
SetStyle(loginButton, buttonStyle)
|
||||
|
||||
loginButton.addEventListener('click', function () {
|
||||
if (loginInput.value === getVal('clientId').toString()) {
|
||||
console.log('opening veteran pw page ...')
|
||||
openInTab(serverAdress + 'getVeteranPw?cid=' + getVal('clientId'), {
|
||||
active: true
|
||||
})
|
||||
} else {
|
||||
Auth(loginInput.value)
|
||||
}
|
||||
})
|
||||
|
||||
ibuttonCell.appendChild(loginDiv)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue