PATH:
home
/
letacommog
/
laindinois
/
wp-content
/
themes
/
wilcity-childtheme
var gCtx = null; var gCanvas = null; var gUM = false; var video = null; var timeout = 2000; load(); function initCanvas(w, h) { gCanvas = document.getElementById("qr-canvas"); gCanvas.style.width = w + "px"; gCanvas.style.height = h + "px"; gCanvas.width = w; gCanvas.height = h; gCanvas.style.display = 'none'; gCtx = gCanvas.getContext("2d"); gCtx.clearRect(0, 0, w, h); } function captureToCanvas() { if (gUM) { try { gCtx.drawImage(video, 0, 0); try { qrcode.decode(); setTimeout(captureToCanvas, timeout); } catch (e) { setTimeout(captureToCanvas, timeout); }; } catch (e) { setTimeout(captureToCanvas, timeout); }; } } /* The main function for QR scanning. The decoded string is in the 'qr' variable */ function read(qr) { document.getElementById("result").innerHTML = qr; } function isCanvasSupported() { var elem = document.createElement('canvas'); return !!(elem.getContext && elem.getContext('2d')); } function load() { if (isCanvasSupported() && window.File && window.FileReader) { initCanvas(800, 800); qrcode.callback = read; document.getElementById("result").innerHTML = "Scanning"; setWebcam(); } else { document.getElementById("result").style.display = "inline"; document.getElementById("result").innerHTML = '<p id="mp1">QR code scanner for HTML5 capable browsers</p><br>' + '<br><p id="mp2">sorry your browser is not supported</p><br><br>' + '<p id="mp1">try <a href="http://www.mozilla.com/firefox"><img src="firefox.png"/></a> or <a href="http://chrome.google.com"><img src="chrome_logo.gif"/></a> or <a href="http://www.opera.com"><img src="Opera-logo.png"/></a></p>'; } } function setWebcam() { video = document.getElementById("camera-stream"); var facingMode = "environment"; var constraints = { audio: false, video: { facingMode: facingMode } } navigator.mediaDevices.getUserMedia(constraints).then(function(stream) { // alert("Opened stream"); video.srcObject = stream; gUM = true; setTimeout(captureToCanvas, timeout); }).catch(function(err) { alert("Could not open stream: " + err.message); }); }
[+]
..
[-] template-tdb-qrcode.php
[edit]
[-] screenshot.jpg
[edit]
[-] template-tdb-mes-pts.php
[edit]
[-] template-tdb-mes-commandes.php
[edit]
[-] functions.php
[edit]
[+]
qrcode
[+]
configs
[+]
vendor
[-] script.js
[edit]
[-] script-qrcode.js
[edit]
[-] style.css
[edit]