Script help redirect changed

This commit is contained in:
mrfry 2021-05-18 16:32:28 +02:00
parent f719bf2700
commit d06e990044

View file

@ -46,7 +46,7 @@
// : Script header {{{ // : Script header {{{
// ==UserScript== // ==UserScript==
// @name Moodle/Elearning/KMOOC test help // @name Moodle/Elearning/KMOOC test help
// @version 2.1.2.0 // @version 2.1.2.1
// @description Online Moodle/Elearning/KMOOC test help // @description Online Moodle/Elearning/KMOOC test help
// @author MrFry // @author MrFry
// @match https://elearning.uni-obuda.hu/* // @match https://elearning.uni-obuda.hu/*
@ -1640,7 +1640,7 @@
var firstRun = getVal('firstRun') // if the current run is the frst var firstRun = getVal('firstRun') // if the current run is the frst
if (firstRun === undefined || firstRun === true) { if (firstRun === undefined || firstRun === true) {
setVal('firstRun', false) setVal('firstRun', false)
ShowHelp('firstRun') // showing help ShowHelp(true) // showing help
registerScript() registerScript()
document.write(texts.freshStartWarning) document.write(texts.freshStartWarning)
@ -2559,12 +2559,14 @@
// : Help {{{ // : Help {{{
// shows some neat help // shows some neat help
function ShowHelp(query) { function ShowHelp(firstRun) {
let q = 'scriptMenu' let q = '?tab=script'
if (query) { if (firstRun) {
q = query q += '&firstRun=true'
} else {
q += '&fromScript=true'
} }
openInTab(serverAdress + `faq${q ? '?' + q : ''}`, { openInTab(serverAdress + q, {
active: true, active: true,
}) })
} }