Skip to content

Commit

Permalink
Remove jQuery dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
bembelimen committed Mar 20, 2019
1 parent 550ddf2 commit 72ba43e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/twofactorauth/totp/tmpl/form.php
Expand Up @@ -15,17 +15,17 @@
HTMLHelper::_('script', 'plg_twofactorauth_totp/qrcode.min.js', ['relative' => true, 'version' => 'auto']);

$js = "
(function($)
(function(document)
{
$(function()
document.addEventListener('DOMContentLoaded', function()
{
var qr = qrcode(0, 'H');
qr.addData('" . $url . "');
qr.make();
document.getElementById('totp-qrcode').innerHTML = qr.createImgTag(4);
});
})(jQuery);
})(document);
";

Factory::getDocument()->addScriptDeclaration($js);
Expand Down

0 comments on commit 72ba43e

Please sign in to comment.