mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
New version notifications refactoreed
This commit is contained in:
parent
3f09f08f41
commit
ad378d5729
1 changed files with 31 additions and 1 deletions
32
main.js
32
main.js
|
@ -664,12 +664,24 @@ function Init(cwith) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function VersionActions() {
|
function VersionActions() {
|
||||||
|
FreshStart();
|
||||||
|
Version15();
|
||||||
|
Version16();
|
||||||
|
Version161();
|
||||||
|
}
|
||||||
|
|
||||||
|
//: Version action functions {{{
|
||||||
|
|
||||||
|
function FreshStart() {
|
||||||
var firstRun = GM_getValue("firstRun"); // if the current run is the frst
|
var firstRun = GM_getValue("firstRun"); // if the current run is the frst
|
||||||
if (firstRun == undefined || firstRun == true) // if its undefined, or true
|
if (firstRun == undefined || firstRun == true) // if its undefined, or true
|
||||||
{
|
{
|
||||||
GM_setValue("firstRun", false); // setting it to false
|
GM_setValue("firstRun", false); // setting it to false
|
||||||
ShowHelp(); // showing help
|
ShowHelp(); // showing help
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Version15 () {
|
||||||
var version15 = GM_getValue("version15"); // if the current run is the frst
|
var version15 = GM_getValue("version15"); // if the current run is the frst
|
||||||
if (version15 == undefined || version15 == true) // if its undefined, or true
|
if (version15 == undefined || version15 == true) // if its undefined, or true
|
||||||
{
|
{
|
||||||
|
@ -682,7 +694,9 @@ function VersionActions() {
|
||||||
document.close();
|
document.close();
|
||||||
throw "something, so this stuff stops";
|
throw "something, so this stuff stops";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Version16 () {
|
||||||
var version16 = GM_getValue("version16"); // if the current run is the frst
|
var version16 = GM_getValue("version16"); // if the current run is the frst
|
||||||
if (version16 == undefined || version16 == true) // if its undefined, or true
|
if (version16 == undefined || version16 == true) // if its undefined, or true
|
||||||
{
|
{
|
||||||
|
@ -693,9 +707,25 @@ function VersionActions() {
|
||||||
}
|
}
|
||||||
GM_setValue("version16", false); // setting it to false
|
GM_setValue("version16", false); // setting it to false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Version161 () {
|
||||||
|
var version161 = GM_getValue("version161"); // if the current run is the frst
|
||||||
|
if (version161 == undefined || version161 == true) // if its undefined, or true
|
||||||
|
{
|
||||||
|
GM_setValue("useNetDB", "0");
|
||||||
|
GM_setValue("version161", false); // setting it to false
|
||||||
|
GM_setValue("firstRun", true);
|
||||||
|
document.write(
|
||||||
|
'<h1>Moodle teszt userscript:<h1><h3>1.6.1.0 verzió: Új domain név: qmining.tk. Ha frissíted az oldalt, akkor tampremonkey rá fog kérdezni, hpgy engedélyezed-e a kérdések külését erre az új domain-re. A rendes működés érdekében kattints a "Allow always"-gombra</h3>'
|
||||||
|
);
|
||||||
|
document.close();
|
||||||
|
throw "something, so this stuff stops";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//: }}}
|
||||||
|
|
||||||
function ReadFile(cwith) {
|
function ReadFile(cwith) {
|
||||||
var resource = "";
|
var resource = "";
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue