-
Notifications
You must be signed in to change notification settings - Fork 0
/
c-base-pos-ext.html
82 lines (79 loc) · 3.19 KB
/
c-base-pos-ext.html
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE HTML>
<html>
<head>
<title>c-base e.V. PoS externals</title>
<meta name="description" content="c-base e.V. PoS externals">
<meta name="author" content="Andreas Kotes">
<meta name="robots" content="noindex">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="c-base-pos.css">
<script src="node_modules/jquery/dist/jquery.min.js"></script>
<script src="node_modules/sprintf-js/dist/sprintf.min.js"></script>
<script src="node_modules/undefine/dist/undefine-min.js"></script>
<script>
var clockInterval;
function debugwin_window_handlemessage(data) {
if (typeof clockInterval != 'undefined') {
window.clearInterval(clockInterval);
clockInterval = undefined;
}
if (typeof data.debugWindow !== 'undefined') {
console.log("debugwin_window_handlemessage: setting debugWindow");
$('#debugWindow').html(data.debugWindow);
} else if (typeof data.clearDisplay !== 'undefined') {
console.log("debugwin_window_handlemessage: clearing display");
$('#debugDisplay').val('');
} else if (typeof data.displayClock !== 'undefined') {
console.log("debugwin_window_handlemessage: starting displayClock");
console.log(data.displayClock);
$('#debugDisplay').val(sprintf("%-19s\n", data.displayClock.versionString));
window.setTimeout(function debugwin_window_clockInit() {
$('#debugDisplay').val(sprintf(
"%-19s\n%12s%02d:%02d:00",
data.displayClock.versionString,
'',
data.displayClock.nextMinute.getHours(),
data.displayClock.nextMinute.getMinutes()
));
clockInterval = window.setInterval(function debugwin_window_clockInterval() {
var now = new Date((new Date()).getTime());
$('#debugDisplay').val(sprintf(
"%-19s\n%12s%02d:%02d:%02d",
data.displayClock.versionString,
'',
now.getHours(),
now.getMinutes(),
now.getSeconds()
));
}, 1000);
}, data.displayClock.timeout);
}
}
window.addEventListener('message', function debugwin_window_listener(event) {
// only trust the event if we know where it came from
if (event.origin == "null" || ~event.origin.indexOf('chrome-extension://')) {
console.log('received a message:', event);
debugwin_window_handlemessage(event.data);
} else {
console.log('received a bogus message:', event);
}
});
</script>
</head>
<body>
<div id="debugWindow" class="debugWindow">
<form>
<textarea class='debugDisplay' cols=20 rows=2 readonly wrap=off>
Loading ...
... not done yet
</textarea></br>
<textarea class='debugPrinter' cols=42 readonly wrap=off>
Loading ...
</textarea></br>
<div class='debugCashDrawer'>Loading ...</div>
</form>
</div>
</body>
</html>