-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqrweb.html
More file actions
48 lines (43 loc) · 1.61 KB
/
qrweb.html
File metadata and controls
48 lines (43 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<html>
<head>
<title>Rocket Browser - QR2Web</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/bootstrap.bundle.min.js"></script>
<script src="lib/RocketBrowser.js"></script>
<script src="lib/Card.js"></script>
</head>
<body id="qrweb-screen" class="d-flex flex-column h-100 w-100 bg-dark">
<div id="main" class="container">
</div>
<script>
var container = document.getElementById("main");
let cardList = null;
KeyboardEventData = function(device, action, keyCode){
if(action == 'down'){
if (keyCode == 'f1')
RocketBrowser.Barcode.startScan();
if (keyCode == 'volumeDown')
cardList.clear();
}
else if(action == 'up'){
if(keyCode == 'f1')
RocketBrowser.Barcode.stopScan();
}
}
BarcodeData = function (barcode, type, typeText) {
if (barcode.includes('http') || barcode.includes('www')) {
cardList.add('QRWeb', `Redirecting to ${barcode}`, 'primary');
window.location.href = barcode;
}
else
cardList.add('QRWeb', `Invalid URL`, 'warning');
}
fusionReady = function () {
cardList = new Card(container);
cardList.add('QRWeb', `Scan QR URL` , 'info');
}
</script>
</body>
</html>