use query params instead of hash

pull/1/head
d11e9 9 years ago
parent a875291821
commit e22e7ccd67
  1. 12
      index.html

@ -128,21 +128,21 @@
return match; return match;
} }
var location_hash_params = window.location.hash.substr(1).split("="); var location_query_params = window.location.search.substr(1).split("=");
var loadingFromGist = false; var loadingFromGist = false;
if (location_hash_params.indexOf('gist') !== -1 && location_hash_params.length >= 2) { if (location_query_params.indexOf('gist') !== -1 && location_query_params.length >= 2) {
var index = location_hash_params.indexOf('gist'); var index = location_query_params.indexOf('gist');
var gistId; var gistId;
var key = location_hash_params[index+1]; var key = location_query_params[index+1];
if (key === '') { if (key === '') {
var str = prompt("Enter the URL or ID of the Gist you'd like to load."); var str = prompt("Enter the URL or ID of the Gist you'd like to load.");
if (str !== '') { if (str !== '') {
gistId = getGistId( str ); gistId = getGistId( str );
loadingFromGist = true; loadingFromGist = !!gistId;
} }
} else { } else {
gistId = getGistId( key ); gistId = getGistId( key );
loadingFromGist = true; loadingFromGist = !!gistId;
} }
$.ajax({ $.ajax({
url: 'https://api.github.com/gists/'+gistId, url: 'https://api.github.com/gists/'+gistId,

Loading…
Cancel
Save