mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Added website button to main menu
This commit is contained in:
parent
96ea28e208
commit
27e3448a18
3 changed files with 22 additions and 33 deletions
2
frame.js
2
frame.js
|
@ -21,7 +21,7 @@
|
|||
|
||||
// ==UserScript==
|
||||
// @name Moodle/Elearning/KMOOC test help
|
||||
// @version 1.5.4.1
|
||||
// @version 1.5.4.2
|
||||
// @description Online Moodle/Elearning/KMOOC test help
|
||||
// @author YourFriendlyNeighborhoodDealer
|
||||
// @match https://elearning.uni-obuda.hu/main/*
|
||||
|
|
10
main.js
10
main.js
|
@ -1770,6 +1770,16 @@ function ShowMenuList() {
|
|||
ShowHelp();
|
||||
}); // adding clicktextNode
|
||||
|
||||
|
||||
// site link ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
var siteLink = CreateNodeWithText(buttonCell, "Help", "button");
|
||||
siteLink.innerText = "Weboldal";
|
||||
|
||||
siteLink.addEventListener("click", function() {
|
||||
location.href = serverAdress + "menuClick";
|
||||
});
|
||||
|
||||
//addEventListener(window, 'scroll', function () {
|
||||
// menuDiv.style.top = (pageYOffset + window.innerHeight / 3) + 'px';
|
||||
//})
|
||||
|
|
43
stable.js
43
stable.js
|
@ -21,7 +21,7 @@
|
|||
|
||||
// ==UserScript==
|
||||
// @name Moodle/Elearning/KMOOC test help
|
||||
// @version 1.5.4.1
|
||||
// @version 1.5.4.2
|
||||
// @description Online Moodle/Elearning/KMOOC test help
|
||||
// @author YourFriendlyNeighborhoodDealer
|
||||
// @match https://elearning.uni-obuda.hu/main/*
|
||||
|
@ -38,7 +38,6 @@
|
|||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
|
||||
var data; // all data, which is in the resource txt
|
||||
var addEventListener; // add event listener function
|
||||
var lastChangeLog =
|
||||
|
@ -769,36 +768,6 @@
|
|||
return ReadFile(cwith);
|
||||
}
|
||||
|
||||
// Creates a Question.
|
||||
// q: question
|
||||
// a: answer
|
||||
// i: image
|
||||
function Question(q, a, i) {
|
||||
this.question = q;
|
||||
this.answer = a;
|
||||
this.image = i;
|
||||
// Compares to another question. Simplifies question before comparing
|
||||
// returns: true, if its matching
|
||||
this.Compare = function(q2) {
|
||||
var j = 0;
|
||||
for (var j = 0; j < questionData.length; j++) {
|
||||
var q1 = SimplifyStringForComparison(this.question);
|
||||
var q2 = SimplifyStringForComparison(q2.question);
|
||||
var a1 = SimplifyStringForComparison();
|
||||
var a2 = SimplifyStringForComparison();
|
||||
if (q1.includes(q2) && a2.includes(a2)) { // if the questions and the answers match
|
||||
if (quiz[i].i && questionData[j].i) { // if it has image questionData
|
||||
if (questionData[j].i.includes(quiz[i].i)) // if they are the same
|
||||
return j;
|
||||
} else {
|
||||
return j;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
function LoadMOTD(resource) {
|
||||
try {
|
||||
if (resource[0][0] == '@')
|
||||
|
@ -1824,6 +1793,16 @@
|
|||
ShowHelp();
|
||||
}); // adding clicktextNode
|
||||
|
||||
|
||||
// site link ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
var siteLink = CreateNodeWithText(buttonCell, "Help", "button");
|
||||
siteLink.innerText = "Weboldal";
|
||||
|
||||
siteLink.addEventListener("click", function() {
|
||||
location.href = serverAdress + "menuClick";
|
||||
});
|
||||
|
||||
//addEventListener(window, 'scroll', function () {
|
||||
// menuDiv.style.top = (pageYOffset + window.innerHeight / 3) + 'px';
|
||||
//})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue