This commit is contained in:
MrFry 2020-01-27 11:18:28 +01:00
commit 69b7ab48b8

View file

@ -63,7 +63,7 @@
// forcing pages for testing. unless you test, do not set these to true!
// only one of these should be true for testing
const forceTestPage = false
const forceResultPage = false
const forceResultPage = false
const forceDefaultPage = false
const logElementGetting = false
const log = true
@ -746,23 +746,12 @@
} catch (e) {
Log('Some weird error trying to set new verison')
}
var greetMsg = '' // message to show at the end
var timeout = null // the timeout. if null, it wont be hidden
if (lastestVersion !== undefined && info().script.version !== lastestVersion) {
timeout = 5
greetMsg = 'Moodle/Elearning/KMOOC segéd v. ' + info().script.version + '. '
greetMsg += 'Új verzió elérhető: ' + lastestVersion
timeout = undefined
}
if (newVersion) { // --------------------------------------------------------------------------------------------------------------
greetMsg = 'Moodle/Elearning/KMOOC segéd v. ' + info().script.version + '. Verzió frissítve ' + info().script.version + '-re. Changelog:\n' + texts.lastChangeLog
setVal('lastVerson', info().script.version) // setting lastVersion
}
let showMOTD = false
if (!SUtils.EmptyOrWhiteSpace(motd)) {
var prevmotd = getVal('motd')
if (prevmotd !== motd) {
greetMsg += '\nMOTD:\n' + motd
timeout = null
showMOTD = true
setVal('motdcount', motdShowCount)
setVal('motd', motd)
} else {
@ -774,12 +763,32 @@
motdcount--
if (motdcount > 0) {
greetMsg += '\nMOTD:\n' + motd
timeout = null
showMOTD = true
setVal('motdcount', motdcount)
}
}
}
let isNewVersionAvaible = lastestVersion !== undefined && info().script.version !== lastestVersion
var greetMsg = '' // message to show at the end
var timeout = null // the timeout. if null, it wont be hidden
if (isNewVersionAvaible || newVersion || showMOTD) {
greetMsg = 'Moodle/Elearning/KMOOC segéd v. ' + info().script.version + '. '
}
if (isNewVersionAvaible) {
timeout = 5
greetMsg += 'Új verzió elérhető: ' + lastestVersion
timeout = undefined
}
if (newVersion) { // --------------------------------------------------------------------------------------------------------------
greetMsg += 'Verzió frissítve ' + info().script.version + '-re. Changelog:\n' + texts.lastChangeLog
setVal('lastVerson', info().script.version) // setting lastVersion
}
if (showMOTD) {
greetMsg += '\nMOTD:\n' + motd
timeout = null
}
ShowMessage({
m: greetMsg,
isSimple: true