Added contribute button

This commit is contained in:
MrFry 2020-04-10 15:58:16 +02:00
parent a25e64189e
commit 0baf5df7d4

View file

@ -21,7 +21,7 @@
// ==UserScript==
// @name Moodle/Elearning/KMOOC test help
// @version 2.0.1.3
// @version 2.0.1.4
// @description Online Moodle/Elearning/KMOOC test help
// @author MrFry
// @match https://elearning.uni-obuda.hu/main/*
@ -93,6 +93,7 @@
close: 'Bezárás',
help: 'Help',
websiteBugreport: 'Weboldal / Bug report',
contribute: 'Contribute',
donate: 'Donate',
passiveTooltip: 'Ha erre kattintasz akkor a script átálítja a neptunban a hallgatói státuszod passzívra',
retry: 'Újrapróbálás',
@ -1471,7 +1472,7 @@
var menuButtonDiv = document.createElement('div')
menuButtonDiv.setAttribute('id', 'menuButtonDiv')
SetStyle(menuButtonDiv, {
// width: buttonWidth + 'px',
width: '600px',
// height: buttonHeight + 'px',
top: (window.innerHeight - 120) + 'px',
left: '10px',
@ -1511,11 +1512,24 @@
// site link ----------------------------------------------------------------------------------------------------------------
let contributeLink = CreateNodeWithText(buttonCell, texts.contribute, 'button')
SetStyle(contributeLink, buttonStyle)
contributeLink.addEventListener('click', function () {
openInTab(serverAdress + 'contribute?scriptMenu', {
active: true
})
})
// site link ----------------------------------------------------------------------------------------------------------------
let siteLink = CreateNodeWithText(buttonCell, texts.websiteBugreport, 'button')
SetStyle(siteLink, buttonStyle)
siteLink.addEventListener('click', function () {
location.href = serverAdress + 'menuClick' // eslint-disable-line
openInTab(serverAdress + 'menuClick', {
active: true
})
})
// donate link ----------------------------------------------------------------------------------------------------------------