From 7c2a3395abc9cc9d91d313ea3ae52433c97dc9e2 Mon Sep 17 00:00:00 2001 From: d11e9 Date: Fri, 9 Oct 2015 14:42:52 +0100 Subject: [PATCH] allow empty gist str --- index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index fd8e6035c1..3faf8e0918 100644 --- a/index.html +++ b/index.html @@ -108,11 +108,15 @@ THE SOFTWARE. var gistId; var key = location_hash_params[index+1]; 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 { gistId = getGistId( key ); + loadingFromGist = true; } - loadingFromGist = true; $.ajax({ url: 'https://api.github.com/gists/'+gistId, jsonp: 'callback',