Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates the Javascript code in listing.html in a new file #300

Merged
merged 17 commits into from
Jul 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8dc76f2
created a new file listing.js in _assets/js/
Murdock9803 Jul 2, 2024
3ca883f
shifted the javascript code from listing.html to listing.js
Murdock9803 Jul 2, 2024
815ec6e
added documentation about the file in listing.js
Murdock9803 Jul 2, 2024
1003d4d
updated the getUrlVars function with modern javascript
Murdock9803 Jul 2, 2024
ea48a25
updated code to assign variable from getUrlVars fucntion in concise form
Murdock9803 Jul 2, 2024
8dbd15a
replaced the document.write method with javascript dom manipulation
Murdock9803 Jul 2, 2024
17ef0c1
updated the document.write method by creating dynamic style with Java…
Murdock9803 Jul 2, 2024
7f0d9fe
added documentation about the resourcenav-{known/unknown} Javascript …
Murdock9803 Jul 2, 2024
6e2a106
updated code for displaying of options in the resourcenavbar, removin…
Murdock9803 Jul 2, 2024
a9dee09
added end of file line to listing.js
Murdock9803 Jul 2, 2024
7489046
formatted the code with prettier code formatter
Murdock9803 Jul 2, 2024
808233a
added the valid input filters in listing.js
Murdock9803 Jul 3, 2024
f73abe6
checked if the user-entered filters are valid
Murdock9803 Jul 3, 2024
2fa85e4
replaced filter with validFilter at appropriate places
Murdock9803 Jul 3, 2024
0745019
removed the validTopic, validMedium, validLanguage variables and repl…
Murdock9803 Jul 3, 2024
ba0401d
updated getUrlVars to check for valid filter and valid filtervalue
Murdock9803 Jul 3, 2024
0decaac
formatted listing.js file with prettier
Murdock9803 Jul 3, 2024
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
Prev Previous commit
Next Next commit
replaced the document.write method with javascript dom manipulation
  • Loading branch information
Murdock9803 committed Jul 2, 2024
commit 8dbd15a54ebbee97150b5240d712e5a3a801ccfe
8 changes: 7 additions & 1 deletion docs/_assets/js/listing.js
Original file line number Diff line number Diff line change
@@ -19,7 +19,13 @@ function getUrlVars() {
// assigning variable to the filters selected by user (retrieved by getUrlVars)
const { topic, language, medium } = getUrlVars();

document.write("<style>.thumbnailbox { display: none; }</style>");

// Setting every thumbnailbox to display:none by creating a new element "dynamicStyle".
// This "dynamicStyle" element can be used to create all the dynamic styles.
const dynamicStyle = document.createElement('style');
dynamicStyle.type = 'text/css';
dynamicStyle.innerHTML = '.thumbnailbox { display: none; }';
document.head.appendChild(dynamicStyle);

if (
topic === undefined &&