-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
125 lines (100 loc) · 4.04 KB
/
index.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>PouchDB CRUD App</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🖲</text></svg>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="manifest.webmanifest">
<script>
if (navigator.serviceWorker) {
navigator.serviceWorker.register ('service-worker.js',{scope: '/pouch/'})
}
</script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<div id="filter-records-form">
<form id="form-filter-records">
<!--label for="name-filter">Name:</label-->
<input type="text" id="name-filter" name="name-filter">
<!-- need to do more work to get multiple filters working at once...-->
<!--label for="weight-filter">Weight:</label-->
<input type="hidden" id="weight-filter" name="weight-filter">
<!--label for="height-filter">Height:</label-->
<input type="hidden" id="height-filter" name="height-filter">
<button type="submit">Search</button>
<!--button id="reset-filter-btn" type="button">Reset Filter</button-->
</form>
</div>
<div id="create-record-form">
<h2>Create A Record</h2>
<form id="form-create-record">
<p>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
</p>
<p>
<label for="weight">Weight:</label>
<input type="number" id="weight" name="weight" size="4" required>
<label for="height">Height:</label>
<input type="number" id="height" name="height" size="4" required >
</p>
<p>
<label for="image">Image:</label>
<input type="file" id="image" name="image" accept="image/*">
</p>
<p>
<button type="submit" class="btn btn-primary">Create Record</button>
</p>
</form>
</div>
<div id="update-record-form">
<h2>Update Record</h2>
<form id="form-update-record">
<input type="hidden" id="_id" name="_id-update">
<input type="hidden" id="_rev" name="_rev-update">
<label for="name-update">Name:</label>
<input type="text" id="name-update" name="name-update">
<label for="weight-update">Weight:</label>
<input type="number" id="weight-update" name="weight-update">
<label for="height-update">Height:</label>
<input type="number" id="height-update" name="height-update">
<br>
<label for="age-update">Age:</label>
<input type="number" id="age-update" name="age-update">
<br>
<label for="image-update">Image:</label>
<img src="" class="current-image">
<input type="file" id="image-update" name="image-update" accept="image/*">
<br>
<button type="submit">Update Record</button>
<button id="delete-record-btn" type="button">Delete Record</button>
</form>
</div>
<div id="record-list">
<h2>Record List</h2>
<ul id="list"></ul>
</div>
<div id="import-export">
<h2>Import/Export</h2>
<input type="file" id="import-file" \><button onclick="importJSON()">Load Data</button>
<button id="export-data-btn" type="button">Export Database</button> |
<button onclick="if(confirm('Delete all data? This is irreversible.')) deleteData()">Delete All Data Forever</button>
</div>
<!--
jquery-3.6.0.min.js
pouchdb.min.js
pouchdb.find.js
https://code.jquery.com/jquery-3.6.0.min.js
https://cdn.jsdelivr.net/npm/[email protected]/dist/pouchdb.min.js
https://cdn.jsdelivr.net/npm/[email protected]/dist/pouchdb.find.min.js
-->
<script src="js/pouchdb.min.js"></script>
<script src="js/pouchdb.find.js"></script>
<script src="js/jquery-3.6.0.min.js"></script>
<script src="backend.js"></script>
<script src="app.js"></script>
</body>
</html>