diff --git a/assets/index.js b/assets/index.js index 83852e250..8fe90fc4e 100755 --- a/assets/index.js +++ b/assets/index.js @@ -10,6 +10,9 @@ import annotator from 'annotator'; import ClipboardJS from 'clipboard'; import 'mathjax/es5/tex-svg'; +/* jrQrcode */ +import jrQrcode from 'jr-qrcode'; + /* Fonts */ import 'material-design-icons-iconfont/dist/material-design-icons.css'; import 'lato-font/css/lato-font.css'; @@ -372,4 +375,10 @@ $(document).ready(() => { $('form[name="form_mass_action"] button[name="tag"]').trigger('click'); } }); + + document.querySelectorAll('img.jr-qrcode').forEach((qrcode) => { + const src = jrQrcode.getQrBase64(qrcode.getAttribute('data-url')); + + qrcode.setAttribute('src', src); + }); }); diff --git a/assets/js/tools.js b/assets/js/tools.js index 2fdd1c38d..9567815f3 100644 --- a/assets/js/tools.js +++ b/assets/js/tools.js @@ -1,8 +1,5 @@ import $ from 'jquery'; -/* Allows inline call qr-code call */ -import jrQrcode from 'jr-qrcode'; // eslint-disable-line - function supportsLocalStorage() { try { return 'localStorage' in window && window.localStorage !== null; diff --git a/templates/Config/index.html.twig b/templates/Config/index.html.twig index 20e78e785..81700b21c 100644 --- a/templates/Config/index.html.twig +++ b/templates/Config/index.html.twig @@ -110,11 +110,8 @@
{{ 'config.otp.app.two_factor_code_description_2'|trans }}
-
- +