-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
198 lines (172 loc) · 11.4 KB
/
index.html
File metadata and controls
198 lines (172 loc) · 11.4 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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/ui-darkness/jquery-ui.css">
<link href="https://fonts.googleapis.com/css2?family=Libre+Barcode+39+Text&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/main.css">
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.8.2/firebase-app.js"></script>
<!-- Firebase products -->
<script src="https://www.gstatic.com/firebasejs/7.8.2/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.8.2/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.8.2/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/ui/4.8.0/firebase-ui-auth.js"></script>
<script src="scripts/isbn.js"></script>
<script src="scripts/main.js"></script>
<title>My library</title>
</head>
<body>
<div id="mainContainer" class=container>
<nav id="menu" class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand">My Library</a>
</div>
<button id="loginButton" type="button" class="btn btn-info btn-lg navbar-btn" data-toggle="modal" data-target="#loginModal">Login</button>
<button id="addBookButton" type="button" class="btn btn-info btn-lg navbar-btn" data-toggle="modal" data-target="#addBookModal">Add Book</button>
<button id="updateBookButton" type="button" class="btn btn-info btn-lg navbar-btn" data-toggle="modal" data-target="#updateBookModal">Update Book</button>
<button id="getBackupButton" type="button" class="btn btn-info btn-lg navbar-btn" onclick="downloadDatabase()">Get Backup</button>
</div>
</nav>
<div id="topContainer" class=container>
<h1>Welcome to my library!</h1>
</div>
<div id="midContainer" class=container>
<div id="firebaseui-auth-container"></div>
<p>I have a tendency to purchase books and not read them.
I hope this app will encourage me to read those books and to organize my books.</p>
</div>
<div id="bottomContainer" class=container>
<div id="tableContainer" class="table-responsive">
<table id="booksTable" class="table table-bordered">
<thead>
<tr>
<th data-field="name">Name</th>
<th data-field="author">Author</th>
<th data-field="location">Location</th>
<th data-field="borrowed">Borrowed?</th>
<th data-field="isbn">ISBN</th>
<th data-field="needAuth">Need Authorization</th>
</tr>
</thead>
<tbody id="booksData">
</tbody>
<tfoot>
</tfoot>
</table>
</div>
<!-- Modal to login -->
<div id="loginModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Login</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<form id="loginForm" method="post">
<label for="email">Email address:</label><br>
<input type="email" id="email" name="email" required><br>
<label for="password">Password:</label><br>
<input type="password" id="password" name="password" required><br>
<input id="loginSubmit" type="submit" value="Send">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Modal to update book -->
<div id="updateBookModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Update Book</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<form id="updateBookForm" method="post">
<label for="updateIsbn">ISBN13:</label><br>
<input type="text" id="updateIsbn" name="updateIsbn" required><br>
<button id="getBookDataButton" >Get Data</button>
<pre id="bookData"></pre>
<label for="property">Property:</label><br>
<input type="text" id="property" name="property" required><br>
<label for="updateValue">Value:</label><br>
<input type="text" id="updateValue" name="updateValue" required><br>
<input id="updateSubmit" type="submit" value="Send">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- Modal to add book -->
<div id="addBookModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Add book</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<form id="addBookForm" method="post">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name" required><br>
<label for="author">Author:</label><br>
<input type="text" id="author" name="author" required><br>
<label for="location">Location:</label><br>
<input type="text" id="location" name="location" required><br>
<!-- Get borrowed info using radio buttons -->
<label for="borrowed">Is it Borrowed?</label><br>
<input type="radio" id="borrowedSetTrue" name="borrowed" value="true" required>
<label for="borrowedSetTrue">Yes</label>
<input type="radio" id="borrowedSetFalse" name="borrowed" value="false">
<label for="borrowedSetFalse">No</label> <br>
<!-- Get needAuth info using radio buttons -->
<label for="needAuth">Does this book need authorization?</label><br>
<input type="radio" id="needAuthSetTrue" name="needAuth" value="true" required>
<label for="needAuthSetTrue">Yes</label>
<input type="radio" id="needAuthSetFalse" name="needAuth" value="false">
<label for="needAuthSetFalse">No</label> <br>
<!-- Handle the case where book has ISBN13 or ISBN10 -->
<label for="query-isbn-13">Which ISBN do you have?</label>
<br>
<input type="radio" id="isbn13" name="query-isbn" value="true" required>
<label for="isbn13">ISBN13</label>
<input type="radio" id="isbn10" name="query-isbn" value="false">
<label for="isbn10">ISBN10</label> <br>
<label for="isbn">ISBN:</label><br>
<input type="text" id="isbn" name="isbn" required><br><br>
<input type="submit" value="Send">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- End of add book modal-->
</div>
</div>
</body>
</html>