mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-06 21:49:40 +02:00
Adds basic search on page load for glyph sets
This commit is contained in:
parent
d2dbfdfe5f
commit
c961a8726d
18
site.js
18
site.js
@ -121,5 +121,23 @@ $(document).ready(function (){
|
||||
}
|
||||
}
|
||||
|
||||
// extremely basic filtering on load:
|
||||
function getParameterByName(name, url) {
|
||||
if (!url) url = window.location.href;
|
||||
name = name.replace(/[\[\]]/g, "\\$&");
|
||||
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
|
||||
results = regex.exec(url);
|
||||
if (!results) return null;
|
||||
if (!results[2]) return '';
|
||||
return decodeURIComponent(results[2].replace(/\+/g, " "));
|
||||
}
|
||||
|
||||
var set = getParameterByName('set');
|
||||
|
||||
if (set) {
|
||||
$('#glyphSearch').val(set);
|
||||
searchGlyphs();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user