Skip to content

Commit 10efaf6

Browse files
committed
SINGLE PAGE APPLICATION LAB
1 parent d2498ba commit 10efaf6

File tree

7 files changed

+580
-0
lines changed

7 files changed

+580
-0
lines changed
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Book Library</title>
5+
<script src="jquery-3.1.1.min.js"></script>
6+
<script src="scripts/book-library.js"></script>
7+
<script src="scripts/eventListeners.js"></script>
8+
<link rel="stylesheet" type="text/css"
9+
href="styles/book-library.css"/>
10+
<script src="scripts/app.js"></script>
11+
</head>
12+
<body onload="startApp()">
13+
<header id="menu">
14+
<a href="#" id="linkHome">Home</a>
15+
<a href="#" id="linkLogin">Login</a>
16+
<a href="#" id="linkRegister">Register</a>
17+
<a href="#" id="linkListBooks">List Books</a>
18+
<a href="#" id="linkCreateBook">Create Book</a>
19+
<a href="#" id="linkLogout">Logout</a>
20+
<span id="loggedInUser"></span>
21+
</header>
22+
<main>
23+
<section id="loadingBox">Loading ...</section>
24+
<section id="infoBox">Info</section>
25+
<section id="errorBox">Error</section>
26+
27+
<section id="viewHome">
28+
<h1>Welcome</h1>
29+
<div class="content">
30+
<p>Welcome to our book library.</p>
31+
</div>
32+
<div class="homeImage">
33+
<img src="images/library.jpeg">
34+
</div>
35+
</section>
36+
37+
<section id="viewLogin">
38+
<h1>Please login</h1>
39+
<div class="content">
40+
<form id="formLogin">
41+
<div>Username:</div>
42+
<div><input type="text" name="username" required/></div>
43+
<div>Password:</div>
44+
<div><input type="password" name="passwd" required/></div>
45+
<div><input type="submit" value="Login"/></div>
46+
</form>
47+
</div>
48+
</section>
49+
50+
<section id="viewRegister">
51+
<h1>Please register here</h1>
52+
<div class="content">
53+
<form id="formRegister">
54+
<div>Username:</div>
55+
<div><input type="text" name="username" required/></div>
56+
<div>Password:</div>
57+
<div><input type="password" name="passwd" required/></div>
58+
<div><input type="submit" value="Register"/></div>
59+
</form>
60+
</div>
61+
</section>
62+
63+
<section id="viewBooks">
64+
<h1>Books</h1>
65+
<div class="content">
66+
<div id="books">
67+
<table>
68+
<tr>
69+
<th>Title</th>
70+
<th>Author</th>
71+
<th>Description</th>
72+
<th>Actions</th>
73+
</tr>
74+
<tbody id="bodywe">
75+
<tr>
76+
<td>Book title</td>
77+
<td>Book author</td>
78+
<td>Book description</td>
79+
<td>
80+
<a href="#">[Delete]</a>
81+
<a href="#">[Edit]</a>
82+
</td>
83+
</tr>
84+
<tr>
85+
<td>Book title</td>
86+
<td>Book author</td>
87+
<td>Book description</td>
88+
<td>
89+
<a href="#">[Delete]</a>
90+
<a href="#">[Edit]</a>
91+
</td>
92+
</tr>
93+
</tbody>
94+
</table>
95+
</div>
96+
</div>
97+
98+
<div class="wrapper">
99+
<div class="col-sm-12">
100+
<ul id="pagination-demo" class="pagination"></ul>
101+
</div>
102+
</div>
103+
</section>
104+
105+
<section id="viewCreateBook">
106+
<h1>Create new book</h1>
107+
<div class="content">
108+
<form id="formCreateBook">
109+
<div>Title:</div>
110+
<div><input type="text" name="title" required/></div>
111+
<div>Author:</div>
112+
<div><input type="text" name="author" required/></div>
113+
<div>Description:</div>
114+
<div><textarea name="description" rows="10" required></textarea></div>
115+
<div><input type="submit" value="Create"/></div>
116+
</form>
117+
</div>
118+
</section>
119+
120+
<section id="viewEditBook">
121+
<h1>Edit existing book</h1>
122+
<div class="content">
123+
<form id="formEditBook">
124+
<div><input type="hidden" name="id" required/></div>
125+
<div>Title:</div>
126+
<div><input type="text" name="title" required/></div>
127+
<div>Author:</div>
128+
<div><input type="text" name="author" required/></div>
129+
<div>Description:</div>
130+
<div><textarea name="description" rows="10" required></textarea></div>
131+
<div><input type="submit" value="Edit"/></div>
132+
</form>
133+
</div>
134+
</section>
135+
</main>
136+
137+
<footer>Book Library - Simple SPA Application &copy 2018</footer>
138+
</body>
139+
</html>
140+
213 KB
Loading

06.SinglePageApplication/Books/jquery-3.1.1.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function startApp() {
2+
showHideSections();
3+
atachEvents();
4+
}

0 commit comments

Comments
 (0)