mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Popup menu cleaning, minor text refactors, donate button
This commit is contained in:
parent
7ba254ef88
commit
9923055c7e
1 changed files with 43 additions and 44 deletions
|
@ -58,7 +58,7 @@
|
|||
|
||||
var data // all data, which is in the resource txt
|
||||
var addEventListener // add event listener function
|
||||
const lastChangeLog = '- "Húzza a megfelelő helyre ..." kérdés lekezelése\n- Kód refactor\n- Ha valami elszállt: <a href="qmining.frylabs.net">feedback</a> pls'
|
||||
const lastChangeLog = '- "Húzza a megfelelő helyre ..." kérdés lekezelése\n- Kód refactor\n- Ha valami elszállt: <a href="https://qmining.frylabs.net">feedback</a> pls'
|
||||
const serverAdress = 'https://qmining.frylabs.net/'
|
||||
// const serverAdress = 'http://localhost:8080/'
|
||||
|
||||
|
@ -1193,6 +1193,7 @@
|
|||
} catch (e) {
|
||||
Log('Some weird error trying to set new verison')
|
||||
}
|
||||
newVersion = true // TODO
|
||||
var greetMsg = '' // message to show at the end
|
||||
var timeout = null // the timeout. if null, it wont be hidden
|
||||
// no new version, nothing loaded
|
||||
|
@ -1919,7 +1920,11 @@
|
|||
questionsTickBox.addEventListener('click', function () {
|
||||
setVal('skipLoad', questionsTickBox.checked)
|
||||
var msg = ''
|
||||
if (getVal('skipLoad')) { msg = 'Passzív mód bekapcsolva, mostantól kérdések nem lesznek betöltve/lekérve.' } else { msg = 'Passzív mód kikapcsolva, frissíts az érvénybe lépéshez!' }
|
||||
if (getVal('skipLoad')) {
|
||||
msg = 'Passzív mód bekapcsolva, mostantól kérdések nem lesznek szervertől letöltve.'
|
||||
} else {
|
||||
msg = 'Passzív mód kikapcsolva, frissíts az érvénybe lépéshez!'
|
||||
}
|
||||
|
||||
ShowMessage({
|
||||
m: msg,
|
||||
|
@ -2019,7 +2024,7 @@
|
|||
content.style.backgroundColor = '#222d32'
|
||||
content.style.borderColor = '#212127'
|
||||
content.style.borderStyle = 'solid'
|
||||
content.style.borderWidth = '5px'
|
||||
content.style.borderWidth = '2px'
|
||||
let ifGroupActive = subjGroup.some((x) => {
|
||||
return x.getIfActive()
|
||||
})
|
||||
|
@ -2087,7 +2092,7 @@
|
|||
)
|
||||
} else {
|
||||
textBox = CreateNodeWithText(noDataRowCell,
|
||||
'A kérdéseket nem lehetett beolvasni. Vagy nem elérhető a szerver, vagy ha offline módot használsz, akkor hibás a fájl elérési útja, vagy a fájl maga. Olvasd el a manualt!'
|
||||
'A kérdéseket nem lehetett beolvasni, ellenőrizd hogy elérhető-e a szerver'
|
||||
)
|
||||
}
|
||||
textBox.style.margin = fiveMargin // fancy margin
|
||||
|
@ -2113,54 +2118,35 @@
|
|||
|
||||
CreateNodeWithText(splashTickboxCell, 'Üdvözlő üzenet mutatása minden oldalon', 'span')
|
||||
|
||||
// show questons tickbox -----------------------------------------------------------------------------------------------------------------------------
|
||||
var questionTickboxRow = tbl.insertRow()
|
||||
var questionTickboxCell = questionTickboxRow.insertCell()
|
||||
|
||||
var questionsTickBox = document.createElement('input')
|
||||
questionsTickBox.type = 'checkbox'
|
||||
questionsTickBox.checked = getVal('showQuestions')
|
||||
questionsTickBox.style.position = ''
|
||||
// questionsTickBox.style.background = "white";
|
||||
questionsTickBox.style.left = 10 + 'px'
|
||||
questionsTickBox.style.margin = '5px 5px 5px 5px' // fancy margin
|
||||
questionsTickBox.style.top = menuDiv.offsetHeight + 'px'
|
||||
questionTickboxCell.appendChild(questionsTickBox) // adding to main div
|
||||
|
||||
questionsTickBox.addEventListener('click', function () {
|
||||
setVal('showQuestions', questionsTickBox.checked)
|
||||
if (!questionsTickBox.checked) {
|
||||
ShowMessage({
|
||||
m: 'Szinte mindég jó az talált válasz a kérdésre, de attól még könnyen előfordulhat, hogy rosz kérdésre írja ki a választ! Ez a opció nélkül ezt az ellenőrzési lehetőséget nem tudod kihasználni',
|
||||
isSimple: true
|
||||
}, 7)
|
||||
}
|
||||
}) // adding clicktextNode
|
||||
|
||||
CreateNodeWithText(questionTickboxCell, 'Kérdések mutatása válaszhoz', 'span')
|
||||
|
||||
// setting up buttons
|
||||
var buttonRow = tbl.insertRow()
|
||||
var buttonCell = buttonRow.insertCell()
|
||||
buttonCell.style.textAlign = 'center'
|
||||
// x button ------------------------------------------------------------------------------------------------------------------------------
|
||||
var xButton = CreateNodeWithText(buttonCell, 'Bezárás', 'button')
|
||||
|
||||
xButton.style.position = ''
|
||||
xButton.style.left = 10 + 'px'
|
||||
xButton.style.margin = '5px 5px 5px 5px' // fancy margin
|
||||
xButton.style.top = menuDiv.offsetHeight + 'px'
|
||||
let buttonStyle = {
|
||||
position: '',
|
||||
left: 10 + 'px',
|
||||
margin: '5px 5px 5px 5px',
|
||||
top: menuDiv.offsetHeight + 'px',
|
||||
border: 'none',
|
||||
backgroundColor: '#202020',
|
||||
color: '#ffffff',
|
||||
cursor: 'pointer'
|
||||
}
|
||||
// x button ------------------------------------------------------------------------------------------------------------------------------
|
||||
let xButton = CreateNodeWithText(buttonCell, 'Bezárás', 'button')
|
||||
Object.keys(buttonStyle).sort().forEach((key) => {
|
||||
xButton.style[key] = buttonStyle[key]
|
||||
})
|
||||
|
||||
xButton.addEventListener('click', function () {
|
||||
CloseMenu()
|
||||
}) // adding clicktextNode
|
||||
// help button ----------------------------------------------------------------------------------------------------------------
|
||||
var helpButton = CreateNodeWithText(buttonCell, 'Help', 'button')
|
||||
|
||||
helpButton.style.position = ''
|
||||
helpButton.style.left = 10 + 'px'
|
||||
helpButton.style.margin = '5px 5px 5px 5px' // fancy margin
|
||||
helpButton.style.top = menuDiv.offsetHeight + 'px'
|
||||
let helpButton = CreateNodeWithText(buttonCell, 'Help', 'button')
|
||||
Object.keys(buttonStyle).sort().forEach((key) => {
|
||||
helpButton.style[key] = buttonStyle[key]
|
||||
})
|
||||
|
||||
helpButton.addEventListener('click', function () {
|
||||
ShowHelp()
|
||||
|
@ -2168,13 +2154,26 @@
|
|||
|
||||
// site link ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
var siteLink = CreateNodeWithText(buttonCell, 'Help', 'button')
|
||||
siteLink.innerText = 'Weboldal'
|
||||
let siteLink = CreateNodeWithText(buttonCell, 'Weboldal / Bug report', 'button')
|
||||
Object.keys(buttonStyle).sort().forEach((key) => {
|
||||
siteLink.style[key] = buttonStyle[key]
|
||||
})
|
||||
|
||||
siteLink.addEventListener('click', function () {
|
||||
location.href = serverAdress + 'menuClick' // eslint-disable-line
|
||||
})
|
||||
|
||||
// donate link ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
let donateLink = CreateNodeWithText(buttonCell, 'Donate', 'button')
|
||||
Object.keys(buttonStyle).sort().forEach((key) => {
|
||||
donateLink.style[key] = buttonStyle[key]
|
||||
})
|
||||
|
||||
donateLink.addEventListener('click', function () {
|
||||
location.href = serverAdress + 'donate' // eslint-disable-line
|
||||
})
|
||||
|
||||
// addEventListener(window, 'scroll', function () {
|
||||
// menuDiv.style.top = (pageYOffset + window.innerHeight / 3) + 'px';
|
||||
// })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue