From c47fb1787ca2add7df2e9443c710980cfef8d8e2 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 4 Jul 2022 18:48:48 +0200 Subject: [PATCH] Aggiunta helper js x qrcode --- MP.Land/Pages/_Host.cshtml | 7 ++++--- MP.Land/wwwroot/lib/qrHelper.js | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 MP.Land/wwwroot/lib/qrHelper.js diff --git a/MP.Land/Pages/_Host.cshtml b/MP.Land/Pages/_Host.cshtml index f259d5d7..f058a721 100644 --- a/MP.Land/Pages/_Host.cshtml +++ b/MP.Land/Pages/_Host.cshtml @@ -50,9 +50,10 @@ - + - + @* + *@ \ No newline at end of file diff --git a/MP.Land/wwwroot/lib/qrHelper.js b/MP.Land/wwwroot/lib/qrHelper.js new file mode 100644 index 00000000..1fcff906 --- /dev/null +++ b/MP.Land/wwwroot/lib/qrHelper.js @@ -0,0 +1,24 @@ +function clearContent(elementID) { + console.log(elementID); + document.getElementById(elementID).innerHTML = ""; +} +// gestione qrcode... da https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity-enable-qrcodes?view=aspnetcore-5.0 +//var qrcode = new QRCode("qrCodeImg"); +function displayQr(elementName, rawData) { + console.log(elementName); + try { + if (elementName != "" && rawData != "") { + qrcode = new QRCode(document.getElementById(elementName), + { + text: rawData, + width: 200, + height: 200 + }); + //qrcode = new QRCode(document.getElementById(elementName)); + //qrcode.clear(); + //qrcode.makeCode(rawData); + } + } + catch + { } +} \ No newline at end of file