1
0
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:
Ryan L McIntyre 2018-03-12 21:08:00 -04:00
parent d2dbfdfe5f
commit c961a8726d

18
site.js
View File

@ -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();
}
});