Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a3bdf48
Fix input types in book library form and add launch configuration for…
sedazam Aug 2, 2025
ae05097
Fix input types for title and author fields in book library form
sedazam Aug 2, 2025
abfc0a3
Fix syntax error in render function loop
sedazam Aug 2, 2025
1573031
Fix read status logic in render function
sedazam Aug 2, 2025
9440f65
Fix reference to myLibrary in submit function
sedazam Aug 2, 2025
51aa207
Fix delete button functionality in render function
sedazam Aug 2, 2025
ed8d683
Fix book constructor parameters in submit function
sedazam Aug 2, 2025
2d6fdc2
Fix author parameter in book constructor in submit function
sedazam Aug 2, 2025
3b0639a
Fix validation logic in submit function to check author field
sedazam Aug 2, 2025
75eea9c
Add buttons for viewing read books and all books; fix author validati…
sedazam Aug 2, 2025
a1e10b5
Add viewReadBooks function to filter and display read books in the li…
sedazam Aug 2, 2025
5a823b1
Refactor button layout for better structure and styling in the librar…
sedazam Aug 2, 2025
e4ab05e
Refactor button layout for improved accessibility and styling in the …
sedazam Aug 2, 2025
7f237b1
Update render function to simplify cell insertion for read books and …
sedazam Aug 2, 2025
2ce428b
Fix submit function to ensure viewReadBooks is called only when the b…
sedazam Aug 2, 2025
cb72564
Clear input fields after submitting a new book
sedazam Aug 2, 2025
9dd36cb
Refactor button group for consistent styling and alignment in the lib…
sedazam Aug 2, 2025
4858f47
Refactor viewReadBooks function to utilize clearTable for improved re…
sedazam Aug 2, 2025
a4d5f61
Refactor submit and render functions for improved clarity and efficiency
sedazam Aug 2, 2025
fa3eb54
Refactor submit function to improve input validation and clarity
sedazam Aug 2, 2025
8b38508
Refactor button creation in render function for consistency and clarity
sedazam Aug 3, 2025
2747277
Fix typo in book title in populateStorage function
sedazam Aug 3, 2025
9ec60d1
Fix pages property assignment in Book constructor to ensure it is alw…
sedazam Aug 3, 2025
4996041
Enhance input validation in submit function to ensure pages value is …
sedazam Aug 3, 2025
dd0296b
Delete .vscode/launch.json
sedazam Aug 3, 2025
dee27d1
Refactor variable names for input elements in script.js for clarity a…
sedazam Aug 11, 2025
f9af2c5
Fix reference to read checkbox in Book instantiation in submit function
sedazam Aug 11, 2025
04087c0
Fix variable references for form input clearing in submit function
sedazam Aug 11, 2025
e63d74f
Fix pages argument type in Book instantiation in populateStorage func…
sedazam Aug 11, 2025
8fe3b51
Add confirmation dialog before deleting a book from the library
sedazam Aug 11, 2025
b2a3c2c
Refactor render function to use textContent for setting cell values a…
sedazam Aug 11, 2025
ee0bf36
Use const instead of let for table variable in clearTable function
sedazam Aug 11, 2025
db33ada
Refactor clearTable function to improve row deletion logic using tbody
sedazam Aug 11, 2025
8e4d345
Merge branch 'book-library' of https://github.com/sedazam/Module-Data…
sedazam Aug 11, 2025
446915c
Fix clearTable function to use lastElementChild and update delete con…
sedazam Aug 11, 2025
4687648
Refactor submit function to move clearForm definition inside and impr…
sedazam Aug 11, 2025
62b75cf
Refactor clearForm function to improve structure and readability
sedazam Aug 11, 2025
9fbf9f9
Fix indentation in clearForm function for consistency
sedazam Aug 11, 2025
a3af05a
Add title to HTML document for better context
sedazam Aug 12, 2025
f5f4992
Fix formatting of meta tags in HTML for consistency
sedazam Aug 12, 2025
0232a7c
Remove empty table row in book display for cleaner presentation
sedazam Aug 12, 2025
340a5b9
Improve checkbox label for clarity in book submission form
sedazam Aug 12, 2025
5ba4b53
Replace submit input with button for better user interaction in book …
sedazam Aug 12, 2025
10fe990
Add header for actions column in book display table
sedazam Aug 12, 2025
80d8249
Fix row insertion in render function to use tbody for correct table s…
sedazam Aug 12, 2025
9e63739
Add buttons for toggling read status and deleting books in viewReadBo…
sedazam Aug 13, 2025
f3427a1
Enhance read status button functionality and improve delete confirmat…
sedazam Aug 13, 2025
1db3d2a
Refactor book submission form for improved accessibility and user exp…
sedazam Aug 13, 2025
7fcf6fc
Refactor HTML structure and enhance JavaScript functionality for impr…
sedazam Aug 13, 2025
2c17c9a
Add title attribute to delete button for improved accessibility
sedazam Aug 13, 2025
b1bde3e
Add aria-label to delete button for improved accessibility
sedazam Aug 13, 2025
a5bb00a
Enhance accessibility of read status button by adding title and aria-…
sedazam Aug 13, 2025
02416c5
Refactor deleteBook function to accept title and author parameters, a…
sedazam Aug 13, 2025
0950066
Refactor HTML structure and JavaScript functions for improved readabi…
sedazam Aug 13, 2025
7129071
Update initial book data in populateStorage function
sedazam Aug 13, 2025
92c6565
Refactor clearForm function to use form.reset() for improved clarity …
sedazam Aug 13, 2025
676a5e2
Add event listener to book form for submission handling
sedazam Aug 13, 2025
d310f39
Refactor book form structure for improved semantics and accessibility…
sedazam Aug 13, 2025
37b98ed
Remove console log for add book button click to clean up code
sedazam Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 103 additions & 91 deletions debugging/book-library/index.html
Original file line number Diff line number Diff line change
@@ -1,96 +1,108 @@
<!DOCTYPE html>
<html>
<head>
<title> </title>
<meta
charset="utf-8"
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.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>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
/>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>
<div class="jumbotron text-center">
<h1>Library</h1>
<p>Add books to your virtual library</p>
</div>

<button data-toggle="collapse" data-target="#demo" class="btn btn-info">
Add new book
</button>

<html lang="en">
<head>
<title>My Book Library</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.0/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<header>
<div class="jumbotron text-center">
<h1>My Book Library</h1>
<p>Add books to your virtual library and track your reading progress</p>
</div>
</header>

<main>
<div id="alertContainer"></div>

<div class="text-center mb-3">
<button
class="btn btn-info"
data-toggle="collapse"
data-target="#demo">
Add New Book
</button>
<button
class="btn btn-success"
onclick="viewReadBooks()">
View Read Books
</button>
<button
class="btn btn-secondary"
onclick="render()">
View All Books
</button>
</div>

<div id="demo" class="collapse">
<div class="form-group">
<label for="title">Title:</label>
<input
type="title"
class="form-control"
id="title"
name="title"
required
/>
<label for="author">Author: </label>
<input
type="author"
class="form-control"
id="author"
name="author"
required
/>
<label for="pages">Pages:</label>
<input
type="number"
class="form-control"
id="pages"
name="pages"
required
/>
<label class="form-check-label">
<input
type="checkbox"
class="form-check-input"
id="check"
value=""
/>Read
<form id="bookForm">
<div class="form-group">
<label for="title">Title:</label>
<input
type="text"
class="form-control"
id="title"
name="title"
placeholder="Enter book title">

<label for="author">Author:</label>
<input
type="text"
class="form-control"
id="author"
name="author"
placeholder="Enter author name">

<label for="pages">Pages:</label>
<input
type="number"
class="form-control"
id="pages"
name="pages"
placeholder="Enter number of pages">

<div class="form-check">
<input
type="checkbox"
class="form-check-input"
id="check"
name="check">
<label class="form-check-label" for="check">
I have read this book
</label>
<input
type="submit"
value="Submit"
class="btn btn-primary"
onclick="submit();"
/>
</div>
<button
type="submit"
class="btn btn-primary">
Add Book
</button>
</div>

<table class="table" id="display">
<thead class="thead-dark">
<tr>
<th>Title</th>
<th>Author</th>
<th>Number of Pages</th>
<th>Read</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>

<script src="script.js"></script>
</body>
</html>
</form>
</div>

<table class="table table-striped" id="display">
<thead class="thead-dark">
<tr>
<th>Title</th>
<th>Author</th>
<th>Pages</th>
<th>Read Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody></tbody>
</table>
</main>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.0/js/bootstrap.min.js"></script>
<script src="script.js"></script>
</body>
</html>
Loading
Loading