mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-12-19 20:12:52 +02:00
cheat-sheet: Allow direct url to search result
Will be used by the Wiki for example to show the glyph-sets. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
e86aed2792
commit
4fde75a4b8
@ -4,6 +4,23 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const elementGlyphCheatSheet = document.getElementById('glyphCheatSheet');
|
||||
const maxSearchResults = 250;
|
||||
|
||||
// Find the value of one query string
|
||||
function querySt(ji) {
|
||||
const hu = window.location.search.substring(1);
|
||||
const gy = hu.split('&');
|
||||
for (i = 0; i < gy.length; i++) {
|
||||
ft = gy[i].split('=');
|
||||
if (ft[0] == ji) {
|
||||
return ft[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
// Jump to search for provided query key, e.g. https://www.nerdfonts.com/cheat-sheet?q=cpu
|
||||
const fieldName = querySt('q');
|
||||
if (fieldName != null) {
|
||||
elementGlyphSearch.value = fieldName;
|
||||
}
|
||||
|
||||
// Storage for not-yet-rendered search results. More results will are rendered when scrolled to the bottom.
|
||||
let remainingSearchResults = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user