From eacd72f2ba6a2a5435258bde148e9bca710a0d1c Mon Sep 17 00:00:00 2001 From: MrFry Date: Fri, 10 Apr 2020 17:01:53 +0200 Subject: [PATCH] Fixed types when comparing client id-s first character --- stable.user.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/stable.user.js b/stable.user.js index 44a2308..b5f1584 100755 --- a/stable.user.js +++ b/stable.user.js @@ -21,7 +21,7 @@ // ==UserScript== // @name Moodle/Elearning/KMOOC test help -// @version 2.0.1.4 +// @version 2.0.1.5 // @description Online Moodle/Elearning/KMOOC test help // @author MrFry // @match https://elearning.uni-obuda.hu/main/* @@ -1576,8 +1576,9 @@ loginInput.type = 'text' loginInput.style.width = '400px' loginInput.style.textAlign = 'center' - if (getVal('clientId') && getVal('clientId')[0] !== 0) { - loginInput.value = getVal('clientId') || '' + const clientId = getVal('clientId') + if (clientId && clientId.toString()[0] !== '0') { + loginInput.value = clientId || '' } loginDiv.appendChild(loginInput) loginDiv.appendChild(loginButton) @@ -1585,8 +1586,8 @@ SetStyle(loginButton, buttonStyle) loginButton.addEventListener('click', function () { - if (loginInput.value === getVal('clientId').toString()) { - openInTab(serverAdress + 'getVeteranPw?cid=' + getVal('clientId'), { + if (loginInput.value === clientId.toString()) { + openInTab(serverAdress + 'getVeteranPw?cid=' + clientId, { active: true }) } else {