Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <head>
- <style>
- body, input {font-size:14pt}
- input, label {}
- .qrcode-text {}
- .qrcode-text-btn {cursor:pointer}
- .qrcode-text-btn > input[type=file] {cursor:pointer}
- </style>
- <script src="qr_packed.js" type="text/javascript"></script>
- <script>
- function openQRCamera(node) {
- var reader = new FileReader();
- reader.onload = function() {
- node.value = "";
- qrcode.callback = function(res) {
- if(res instanceof Error) {
- alert("No QR code found. Please make sure the QR code is within the camera's frame and try again.");
- } else {
- node.parentNode.previousElementSibling.value = res;
- alert('QR-Code decoded to:' + res);
- }
- };
- qrcode.decode(reader.result);
- };
- reader.readAsDataURL(node.files[0]);
- }
- </script>
- </head>
- <body>
- <input type=text size=16 placeholder="Tracking Code" class=qrcode-text>
- <label class=qrcode-text-btn>
- <input type=file accept="image/*" onchange="openQRCamera(this);" tabindex=-1>
- </label>
- <input type=button value="Go" disabled>
- </body>
Add Comment
Please, Sign In to add comment