mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
added irc button
This commit is contained in:
parent
fd389046a1
commit
02ef5c056e
1 changed files with 20 additions and 1 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
// ==UserScript==
|
||||
// @name Moodle/Elearning/KMOOC test help
|
||||
// @version 2.0.0.2
|
||||
// @version 2.0.0.3
|
||||
// @description Online Moodle/Elearning/KMOOC test help
|
||||
// @author MrFry
|
||||
// @match https://elearning.uni-obuda.hu/main/*
|
||||
|
@ -59,6 +59,7 @@
|
|||
var addEventListener // add event listener function
|
||||
const serverAdress = 'https://qmining.frylabs.net/'
|
||||
// const serverAdress = 'http://localhost:8080/'
|
||||
const ircAddress = 'https://kiwiirc.com/nextclient/irc.sub.fm/#qmining'
|
||||
|
||||
// forcing pages for testing. unless you test, do not set these to true!
|
||||
// only one of these should be true for testing
|
||||
|
@ -89,6 +90,7 @@
|
|||
donate: 'Donate',
|
||||
passiveTooltip: 'Ha erre kattintasz akkor a script átálítja a neptunban a hallgatói státuszod passzívra',
|
||||
retry: 'Újrapróbálás',
|
||||
ircButton: 'IRC',
|
||||
search: 'Keresés ...',
|
||||
loading: 'Betöltés ...',
|
||||
noServer: 'Nem elérhető a szerver!',
|
||||
|
@ -705,6 +707,9 @@
|
|||
SafeGetElementById('infoMainDiv', (elem) => {
|
||||
elem.innerText = texts.noServer
|
||||
})
|
||||
SafeGetElementById('ircButton', (elem) => {
|
||||
elem.style.display = ''
|
||||
})
|
||||
SafeGetElementById('retryButton', (elem) => {
|
||||
elem.style.display = ''
|
||||
})
|
||||
|
@ -1459,6 +1464,18 @@
|
|||
margin: '5px'
|
||||
})
|
||||
|
||||
// irc button ----------------------------------------------------------------------------------------------------------------
|
||||
let ircButton = CreateNodeWithText(ibuttonCell, texts.ircButton, 'button')
|
||||
SetStyle(ircButton, buttonStyle)
|
||||
ircButton.style.display = 'none'
|
||||
ircButton.setAttribute('id', 'ircButton')
|
||||
|
||||
ircButton.addEventListener('click', function () {
|
||||
openInTab(ircAddress, {
|
||||
active: true
|
||||
})
|
||||
})
|
||||
|
||||
// retry button ----------------------------------------------------------------------------------------------------------------
|
||||
let retryButton = CreateNodeWithText(ibuttonCell, texts.retry, 'button')
|
||||
SetStyle(retryButton, buttonStyle)
|
||||
|
@ -1469,6 +1486,7 @@
|
|||
menuButtonDiv.style.background = '#262626'
|
||||
infoDiv.innerText = texts.loading
|
||||
retryButton.style.display = 'none'
|
||||
ircButton.style.display = 'none'
|
||||
ConnectToServer(AfterLoad)
|
||||
})
|
||||
|
||||
|
@ -1485,6 +1503,7 @@
|
|||
let setPassiveButtonState = (isPassive) => {
|
||||
menuButtonDiv.style.background = '#262626'
|
||||
retryButton.style.display = 'none'
|
||||
ircButton.style.display = 'none'
|
||||
if (!isPassive) {
|
||||
infoDiv.innerText = texts.loading
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue