diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-12-08 08:58:30 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2022-12-08 08:58:30 +0000 |
| commit | cb83c5f6dcc8e176ca2494f699840c27f18f9d8f (patch) | |
| tree | a19055490227143258d1a20d3bf789e458dffa5f /resources/assets/javascripts/bootstrap/qr_code.js | |
| parent | f9887c3c51253cf1a7499fed8f8189c015f5a4aa (diff) | |
resurrect qrcode display, fixes #1861
Closes #1861
Merge request studip/studip!1220
Diffstat (limited to 'resources/assets/javascripts/bootstrap/qr_code.js')
| -rw-r--r-- | resources/assets/javascripts/bootstrap/qr_code.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/resources/assets/javascripts/bootstrap/qr_code.js b/resources/assets/javascripts/bootstrap/qr_code.js index 3a627f7..9ed0b21 100644 --- a/resources/assets/javascripts/bootstrap/qr_code.js +++ b/resources/assets/javascripts/bootstrap/qr_code.js @@ -8,3 +8,19 @@ $(document).on('click', 'a[data-qr-code]', function (event) { event.preventDefault(); }); + +STUDIP.ready(event => { + $('code.qr', event.target).each(function () { + const text = $(this).text().trim(); + if ($(this).hasClass('hide-text')) { + $(this).text(''); + } + + $(this).qrcode({ + text: text, + width: 1280, + height: 1280, + correctLevel: 3 + }).addClass('has-qr-code'); + }); +}); |
