-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
56 lines (50 loc) · 1.49 KB
/
popup.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tables Status</title>
<style>
/* Basic styling for table items */
.table-item {
margin-bottom: 10px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
.table-number {
font-weight: bold;
}
.table-status {
margin-left: 10px;
}
</style>
</head>
<body>
<div id="tables-container">
<!-- Table items will be dynamically added here -->
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const tablesContainer = document.getElementById('tables-container');
// Load saved tables
chrome.storage.local.get('tables', (data) => {
const tables = data.tables || [];
tables.forEach((table) => {
const tableItem = document.createElement('div');
tableItem.classList.add('table-item');
const tableNumber = document.createElement('span');
tableNumber.textContent = `Table ${table.number}`;
tableNumber.classList.add('table-number');
tableItem.appendChild(tableNumber);
const tableStatus = document.createElement('span');
tableStatus.textContent = table.status;
tableStatus.classList.add('table-status');
tableItem.appendChild(tableStatus);
tablesContainer.appendChild(tableItem);
});
});
});
</script>
</body>
</html>