-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rolling' into FEAT/427_export-import-settings-to-and-fr…
…om-a-json-file-support-for-the-ui
- Loading branch information
Showing
21 changed files
with
139 additions
and
148 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,6 @@ | ||
/** | ||
* Selects the input element for the search box | ||
* @type {HTMLInputElement} | ||
*/ | ||
const searchBox = document.querySelector('input') | ||
|
||
/** | ||
* Redirects the user to the search results page with the query parameter | ||
*/ | ||
function searchWeb() { | ||
const query = searchBox.value.trim() | ||
try { | ||
let safeSearchLevel = document.querySelector('.search_options select').value | ||
if (query) { | ||
window.location.href = `search?q=${encodeURIComponent( | ||
query, | ||
)}&safesearch=${encodeURIComponent(safeSearchLevel)}` | ||
} | ||
} catch (error) { | ||
if (query) { | ||
window.location.href = `search?q=${encodeURIComponent(query)}` | ||
} | ||
} | ||
* A function that clears the search input text when the clear button is clicked. | ||
*/ | ||
function clearSearchText() { | ||
document.querySelector('.search_bar > input').value = '' | ||
} | ||
|
||
/** | ||
* Listens for the 'Enter' key press event on the search box and calls the searchWeb function | ||
* @param {KeyboardEvent} e - The keyboard event object | ||
*/ | ||
searchBox.addEventListener('keyup', (e) => { | ||
if (e.key === 'Enter') { | ||
searchWeb() | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.