Add ability to link to a specific hash

This commit is contained in:
Travis Burtrum 2017-02-15 21:58:20 -05:00
parent 4db2d817da
commit 5c634441ea
1 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,11 @@ function unhash() {
} }
$(document).ready(function () { $(document).ready(function () {
//alert('bob'); var anchor_hash = $(location).attr('hash').substr(1);
if(valid_sha1.test(anchor_hash)) {
$('#hash').val(anchor_hash);
unhash();
}
$('#hash').keypress(function (e) { $('#hash').keypress(function (e) {
if (e.which == 13) { // enter if (e.which == 13) { // enter
unhash(); unhash();