aboutsummaryrefslogtreecommitdiff
path: root/js/utils-prod.js
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2026-06-24 09:18:26 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2026-06-24 09:18:26 +0200
commitaf8585faa1aa7c39564c583963349c4a2922df9c (patch)
tree5a806a738a76e5f928e68e4def47e0b3a857d490 /js/utils-prod.js
parent13f9914757b2a72e77369859bbaec35339f31446 (diff)
downloadbycs-sol-af8585faa1aa7c39564c583963349c4a2922df9c.tar.gz
bycs-sol-af8585faa1aa7c39564c583963349c4a2922df9c.zip
cockpit: finish prototype UI
* remove process and calendar * add observation period * improve mocking
Diffstat (limited to 'js/utils-prod.js')
-rw-r--r--js/utils-prod.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/js/utils-prod.js b/js/utils-prod.js
index 1dd7e8e..119870c 100644
--- a/js/utils-prod.js
+++ b/js/utils-prod.js
@@ -1,5 +1,21 @@
export function isTeacher() {
return Boolean(document.querySelector('.editmode-switch-form'))
- || Boolean(document.querySelector('a[href*="templates.php"]'))
|| document.body.classList.contains('editing');
}
+
+export function getCurrentName() {
+ let firstname = "";
+ let lastname = "";
+
+ const autoNameDiv = document.getElementById("auto-name");
+ firstname = autoNameDiv.children[0].innerHTML;
+ lastname = autoNameDiv.children[1].innerHTML;
+ autoNameDiv.remove();
+
+ return [firstname, lastname];
+}
+
+export function getUserId() {
+ // M is exported by Moodle
+ return M.cfg.userid;
+}