Guest User

Untitled

a guest
Oct 16th, 2017
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <!doctype html>
  2. <head>
  3. <style>
  4. body, input {font-size:14pt}
  5. input, label {}
  6. .qrcode-text {}
  7. .qrcode-text-btn {cursor:pointer}
  8. .qrcode-text-btn > input[type=file] {cursor:pointer}
  9. </style>
  10. <script src="qr_packed.js" type="text/javascript"></script>
  11. <script>
  12. function openQRCamera(node) {
  13. var reader = new FileReader();
  14. reader.onload = function() {
  15. node.value = "";
  16. qrcode.callback = function(res) {
  17. if(res instanceof Error) {
  18. alert("No QR code found. Please make sure the QR code is within the camera's frame and try again.");
  19. } else {
  20. node.parentNode.previousElementSibling.value = res;
  21. alert('QR-Code decoded to:' + res);
  22. }
  23. };
  24. qrcode.decode(reader.result);
  25. };
  26. reader.readAsDataURL(node.files[0]);
  27. }
  28. </script>
  29. </head>
  30. <body>
  31. <input type=text size=16 placeholder="Tracking Code" class=qrcode-text>
  32. <label class=qrcode-text-btn>
  33. <input type=file accept="image/*" onchange="openQRCamera(this);" tabindex=-1>
  34. </label>
  35. <input type=button value="Go" disabled>
  36. </body>
Add Comment
Please, Sign In to add comment