allow empty gist str

pull/1/head
d11e9 9 years ago
parent f1e372e870
commit 7c2a3395ab
  1. 8
      index.html

@ -108,11 +108,15 @@ THE SOFTWARE.
var gistId; var gistId;
var key = location_hash_params[index+1]; var key = location_hash_params[index+1];
if (key === '') { if (key === '') {
gistId = getGistId( prompt("Enter the gist url or id you'd like to load.") ); var str = prompt("Enter the URL or ID of the Gist you'd like to load.")
if (str !== '') {
gistId = getGistId( str );
loadingFromGist = true;
}
} else { } else {
gistId = getGistId( key ); gistId = getGistId( key );
loadingFromGist = true;
} }
loadingFromGist = true;
$.ajax({ $.ajax({
url: 'https://api.github.com/gists/'+gistId, url: 'https://api.github.com/gists/'+gistId,
jsonp: 'callback', jsonp: 'callback',

Loading…
Cancel
Save