mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Fix creating Gists
GitHub changed their site to use SSL. On error GitHub may return the "All Gists" page which will have several "gist: #", so check for the edit link instead.
This commit is contained in:
@@ -107,7 +107,7 @@ var gistie = function() {
|
||||
var t = new XMLHttpRequest();
|
||||
t.onreadystatechange = function() {
|
||||
if (t.readyState == 4 && t.status >= 200 && t.status < 300) {
|
||||
if (m = t.responseText.match(/gist: ([a-f0-9]+)/))
|
||||
if (m = t.responseText.match(/<a href="\/gists\/([a-f0-9]+)\/edit">/))
|
||||
notify("Code uploaded to gistie <a target='_new' href='http://gist.github.com/" + m[1] + "'>#" + m[1] + "</a>", 1);
|
||||
else {
|
||||
notify("Pasting to Gistie failed :(.", -1);
|
||||
@@ -116,7 +116,7 @@ var gistie = function() {
|
||||
}
|
||||
}
|
||||
|
||||
t.open('POST', "http://gist.github.com/gists");
|
||||
t.open('POST', "https://gist.github.com/gists");
|
||||
t.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||
t.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*');
|
||||
t.setRequestHeader('Content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
||||
|
||||
Reference in New Issue
Block a user