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==
|
// ==UserScript==
|
||||||
// @name Moodle/Elearning/KMOOC test help
|
// @name Moodle/Elearning/KMOOC test help
|
||||||
// @version 2.0.0.2
|
// @version 2.0.0.3
|
||||||
// @description Online Moodle/Elearning/KMOOC test help
|
// @description Online Moodle/Elearning/KMOOC test help
|
||||||
// @author MrFry
|
// @author MrFry
|
||||||
// @match https://elearning.uni-obuda.hu/main/*
|
// @match https://elearning.uni-obuda.hu/main/*
|
||||||
|
@ -59,6 +59,7 @@
|
||||||
var addEventListener // add event listener function
|
var addEventListener // add event listener function
|
||||||
const serverAdress = 'https://qmining.frylabs.net/'
|
const serverAdress = 'https://qmining.frylabs.net/'
|
||||||
// const serverAdress = 'http://localhost:8080/'
|
// 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!
|
// forcing pages for testing. unless you test, do not set these to true!
|
||||||
// only one of these should be true for testing
|
// only one of these should be true for testing
|
||||||
|
@ -89,6 +90,7 @@
|
||||||
donate: 'Donate',
|
donate: 'Donate',
|
||||||
passiveTooltip: 'Ha erre kattintasz akkor a script átálítja a neptunban a hallgatói státuszod passzívra',
|
passiveTooltip: 'Ha erre kattintasz akkor a script átálítja a neptunban a hallgatói státuszod passzívra',
|
||||||
retry: 'Újrapróbálás',
|
retry: 'Újrapróbálás',
|
||||||
|
ircButton: 'IRC',
|
||||||
search: 'Keresés ...',
|
search: 'Keresés ...',
|
||||||
loading: 'Betöltés ...',
|
loading: 'Betöltés ...',
|
||||||
noServer: 'Nem elérhető a szerver!',
|
noServer: 'Nem elérhető a szerver!',
|
||||||
|
@ -705,6 +707,9 @@
|
||||||
SafeGetElementById('infoMainDiv', (elem) => {
|
SafeGetElementById('infoMainDiv', (elem) => {
|
||||||
elem.innerText = texts.noServer
|
elem.innerText = texts.noServer
|
||||||
})
|
})
|
||||||
|
SafeGetElementById('ircButton', (elem) => {
|
||||||
|
elem.style.display = ''
|
||||||
|
})
|
||||||
SafeGetElementById('retryButton', (elem) => {
|
SafeGetElementById('retryButton', (elem) => {
|
||||||
elem.style.display = ''
|
elem.style.display = ''
|
||||||
})
|
})
|
||||||
|
@ -1459,6 +1464,18 @@
|
||||||
margin: '5px'
|
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 ----------------------------------------------------------------------------------------------------------------
|
// retry button ----------------------------------------------------------------------------------------------------------------
|
||||||
let retryButton = CreateNodeWithText(ibuttonCell, texts.retry, 'button')
|
let retryButton = CreateNodeWithText(ibuttonCell, texts.retry, 'button')
|
||||||
SetStyle(retryButton, buttonStyle)
|
SetStyle(retryButton, buttonStyle)
|
||||||
|
@ -1469,6 +1486,7 @@
|
||||||
menuButtonDiv.style.background = '#262626'
|
menuButtonDiv.style.background = '#262626'
|
||||||
infoDiv.innerText = texts.loading
|
infoDiv.innerText = texts.loading
|
||||||
retryButton.style.display = 'none'
|
retryButton.style.display = 'none'
|
||||||
|
ircButton.style.display = 'none'
|
||||||
ConnectToServer(AfterLoad)
|
ConnectToServer(AfterLoad)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1485,6 +1503,7 @@
|
||||||
let setPassiveButtonState = (isPassive) => {
|
let setPassiveButtonState = (isPassive) => {
|
||||||
menuButtonDiv.style.background = '#262626'
|
menuButtonDiv.style.background = '#262626'
|
||||||
retryButton.style.display = 'none'
|
retryButton.style.display = 'none'
|
||||||
|
ircButton.style.display = 'none'
|
||||||
if (!isPassive) {
|
if (!isPassive) {
|
||||||
infoDiv.innerText = texts.loading
|
infoDiv.innerText = texts.loading
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue