mirror of
https://github.com/braver/programmingfonts.git
synced 2024-10-01 15:51:35 +02:00
commit
43aef578d9
20
index.html
20
index.html
@ -328,6 +328,7 @@ function updateGutters(cm) {
|
|||||||
|
|
||||||
$("#font-info p").hide();
|
$("#font-info p").hide();
|
||||||
$("." + font).show();
|
$("." + font).show();
|
||||||
|
updateHash();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSize() {
|
function setSize() {
|
||||||
@ -340,7 +341,15 @@ function updateGutters(cm) {
|
|||||||
$(".CodeMirror").addClass("no-smooth");
|
$(".CodeMirror").addClass("no-smooth");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function updateHash(){
|
||||||
|
var newHash = '#' + $("#select-font").val();
|
||||||
|
if(history.pushState) {
|
||||||
|
history.pushState(null, null, newHash);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
location.hash = newHash;
|
||||||
|
}
|
||||||
|
}
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
//randomly select a theme
|
//randomly select a theme
|
||||||
@ -376,7 +385,14 @@ function updateGutters(cm) {
|
|||||||
custom: { families: font_aliases }
|
custom: { families: font_aliases }
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#select-font").val('input'); // default to this awesome font
|
var hash = window.location.hash.substring(1);
|
||||||
|
if(hash){
|
||||||
|
$("#select-font").val(hash);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#select-font").val('input'); // default to this awesome font
|
||||||
|
}
|
||||||
|
|
||||||
selectFont();
|
selectFont();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user