diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-07-01 16:23:59 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-07-01 16:23:59 +0200 |
| commit | 10b81f7b0db87bbca9f431b4e9fa3a85aaf03f7b (patch) | |
| tree | f8bb08df8a778b744dc2db7413bf67550b947047 /js/utils-prod.js | |
| parent | 2cb45f6dea0e3db8103f7f8121a93de413dcee7f (diff) | |
| download | bycs-sol-10b81f7b0db87bbca9f431b4e9fa3a85aaf03f7b.tar.gz bycs-sol-10b81f7b0db87bbca9f431b4e9fa3a85aaf03f7b.zip | |
util: add getName if the separation between first and lastname is not needed
Diffstat (limited to 'js/utils-prod.js')
| -rw-r--r-- | js/utils-prod.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/js/utils-prod.js b/js/utils-prod.js index 119870c..ab8e311 100644 --- a/js/utils-prod.js +++ b/js/utils-prod.js @@ -3,7 +3,7 @@ export function isTeacher() { || document.body.classList.contains('editing'); } -export function getCurrentName() { +export function getFirstAndLastname() { let firstname = ""; let lastname = ""; @@ -15,6 +15,10 @@ export function getCurrentName() { return [firstname, lastname]; } +export function getName() { + return document.querySelector("div.user-name").textContent; +} + export function getUserId() { // M is exported by Moodle return M.cfg.userid; |
