From 27e3448a18ca3851b23ae491dcf54f0f468ddbb0 Mon Sep 17 00:00:00 2001 From: YourFriendlyNeighborhoodDealer <3167982-YourFriendlyNeighborhoodDealer@users.noreply.gitlab.com> Date: Wed, 5 Dec 2018 15:45:57 +0100 Subject: [PATCH] Added website button to main menu --- frame.js | 2 +- main.js | 10 ++++++++++ stable.js | 43 +++++++++++-------------------------------- 3 files changed, 22 insertions(+), 33 deletions(-) diff --git a/frame.js b/frame.js index 2c407cd..770eaf5 100644 --- a/frame.js +++ b/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/* diff --git a/main.js b/main.js index 486f86c..a270b7e 100644 --- a/main.js +++ b/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'; //}) diff --git a/stable.js b/stable.js index 543040d..09668fd 100644 --- a/stable.js +++ b/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'; //})