Commit e22e7ccd authored by d11e9's avatar d11e9

use query params instead of hash

parent a8752918
...@@ -128,21 +128,21 @@ ...@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment