From fb3d995b11bc8c24fc79b2f554c9261e8eb9ba9d Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Tue, 30 Apr 2013 18:41:38 -0700 Subject: [PATCH] gist title link --- builds/4chan-X.js | 15 +++++++++++++++ builds/4chan-X.user.js | 15 +++++++++++++++ builds/crx/script.js | 15 +++++++++++++++ src/Linkification/Linkify.coffee | 5 +++++ 4 files changed, 50 insertions(+) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 859464b2b..776cf06fa 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -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; + } + } + } } } }, diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index bddcd36e2..ad0702e7f 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -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; + } + } + } } } }, diff --git a/builds/crx/script.js b/builds/crx/script.js index 309c3fb93..b57c17c6e 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -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; + } + } + } } } }, diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 356ebad0f..2fc8ed524 100644 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -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']