gist title link

This commit is contained in:
Zixaphir 2013-04-30 18:41:38 -07:00
parent ef3c862543
commit fb3d995b11
4 changed files with 50 additions and 0 deletions

View File

@ -4326,6 +4326,21 @@
return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
});
},
title: {
api: function() {
return "https://api.github.com/gists/" + this.name;
},
text: function() {
var file, response;
response = JSON.parse(this.responseText).files;
for (file in response) {
if (response.hasOwnProperty(file)) {
return file;
}
}
}
}
}
},

View File

@ -4322,6 +4322,21 @@
return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
});
},
title: {
api: function() {
return "https://api.github.com/gists/" + this.name;
},
text: function() {
var file, response;
response = JSON.parse(this.responseText).files;
for (file in response) {
if (response.hasOwnProperty(file)) {
return file;
}
}
}
}
}
},

View File

@ -4325,6 +4325,21 @@
return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
});
},
title: {
api: function() {
return "https://api.github.com/gists/" + this.name;
},
text: function() {
var file, response;
response = JSON.parse(this.responseText).files;
for (file in response) {
if (response.hasOwnProperty(file)) {
return file;
}
}
}
}
}
},

View File

@ -212,6 +212,11 @@ Linkify =
div = $.el 'iframe',
# Github doesn't allow embedding straight from the site, so we use an external site to bypass that.
src: "http://www.purplegene.com/script?url=https://gist.github.com/#{@name}.js"
title:
api: -> "https://api.github.com/gists/#{@name}"
text: ->
response = JSON.parse(@responseText).files
return file for file of response when response.hasOwnProperty file
embedder: (a) ->
return [a] unless Conf['Link Title']