Skip to content

Commit

Permalink
Full cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
infinimineralex committed May 11, 2024
1 parent da1d888 commit eda4205
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
6 changes: 1 addition & 5 deletions Charcoal/Charcoal/Charcoal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,18 @@ void Charcoal::grayscaleName(const JSObject& thisobject, const JSArgs& args) {
}


JSValue Charcoal::printAllBooks(const JSObject& thisObject, const JSArgs& args) {
JSValue Charcoal::printAllBooks(const JSObject& thisObject, const JSArgs& args) { //debug function only, do not use as is currently

std::string bookList = ebooks.printall();

MessageBoxA(NULL, bookList.c_str(), "Book List", MB_OK); //this confirms there is an actual booklist.

//convert the book list string to a JavaScript string, but does not work.

JSStringRef jsBookList = JSStringCreateWithUTF8CString(bookList.c_str());

JSValue jsValue = JSValue(jsBookList);

JSStringRelease(jsBookList);

//return the JSValue object, I tried with JSString and the issue persisted.

return jsValue;

}
Expand Down
Binary file modified Charcoal/x64/Debug/Charcoal.exe
Binary file not shown.
Binary file modified Charcoal/x64/Debug/Charcoal.pdb
Binary file not shown.
31 changes: 19 additions & 12 deletions Charcoal/x64/Debug/assets/books.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,11 @@

ul {
text-align: center;
list-style-type: none; /* Remove bullets */
padding: 0; /* Remove padding */
margin: 0; /* Remove margins */
}
.list ul li:hover {
left: 10px;
list-style-type: none;
padding: 0;
margin: 0;
}

.form-control {
font-family: system-ui, sans-serif;
font-size: 2rem;
Expand Down Expand Up @@ -202,23 +200,32 @@ <h3 id="result">BOOKS: </h3>
<button class="button-28" onclick="gscalebutton()">Grayscale</button>
<script>
function gscalebutton() {
nameToGrayscale();
var array = []
var checkboxes = document.querySelectorAll('input[type=checkbox]:checked')
for (var i = 0; i < checkboxes.length; i++) {
array.push(checkboxes[i].id)
alert(checkboxes[i].id);
var toGray = parseInt(checkboxes[i].id); //sets string ID to int so it can be passed back.
grayscaleName(toGray);
}

OnButtonClick();
}
</script>

<div id="bs"></div>
<button class="button-28" onclick="rmbooksbutton()">Remove Books</button>
<script>
function rmbooksbutton() {

var array = []
var checkboxes = document.querySelectorAll('input[type=checkbox]:checked')

for (var i = 0; i < checkboxes.length; i++) {
array.push(checkboxes[i].value)
alert(checkboxes[i].value);
array.push(checkboxes[i].id)
alert(checkboxes[i].id);
var toDelete = parseInt(checkboxes[i].id); //sets string ID to int so it can be passed back.
deleteBook(toDelete);
}
deleteBook();

OnButtonClick();
}
</script>
Expand Down

0 comments on commit eda4205

Please sign in to comment.