This commit is contained in:
Jordan Bates 2013-04-30 19:26:20 -07:00
commit 5ada68f26f
5 changed files with 58 additions and 5 deletions

View File

@ -336,7 +336,7 @@
i = this.length; i = this.length;
while (i--) { while (i--) {
if (this[i] === object) { if (this[i] === object) {
break; return i;
} }
} }
return i; return i;
@ -350,6 +350,7 @@
arg = args[_i]; arg = args[_i];
this.push.apply(this, arg); this.push.apply(this, arg);
} }
return this;
}; };
Array.prototype.remove = function(object) { Array.prototype.remove = function(object) {
@ -4325,6 +4326,21 @@
return div = $.el('iframe', { return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js" 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

@ -333,7 +333,7 @@
i = this.length; i = this.length;
while (i--) { while (i--) {
if (this[i] === object) { if (this[i] === object) {
break; return i;
} }
} }
return i; return i;
@ -347,6 +347,7 @@
arg = args[_i]; arg = args[_i];
this.push.apply(this, arg); this.push.apply(this, arg);
} }
return this;
}; };
Array.prototype.remove = function(object) { Array.prototype.remove = function(object) {
@ -4321,6 +4322,21 @@
return div = $.el('iframe', { return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js" 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

@ -315,7 +315,7 @@
i = this.length; i = this.length;
while (i--) { while (i--) {
if (this[i] === object) { if (this[i] === object) {
break; return i;
} }
} }
return i; return i;
@ -329,6 +329,7 @@
arg = args[_i]; arg = args[_i];
this.push.apply(this, arg); this.push.apply(this, arg);
} }
return this;
}; };
Array.prototype.remove = function(object) { Array.prototype.remove = function(object) {
@ -4324,6 +4325,21 @@
return div = $.el('iframe', { return div = $.el('iframe', {
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js" 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

@ -16,14 +16,14 @@ Array::contains = (object) ->
Array::indexOf = (object) -> Array::indexOf = (object) ->
i = @length i = @length
while i-- while i--
break if @[i] is object return i if @[i] is object
return i return i
Array::pushArrays = -> Array::pushArrays = ->
args = arguments args = arguments
for arg in args for arg in args
@push.apply @, arg @push.apply @, arg
return return @
Array::remove = (object) -> Array::remove = (object) ->
if (index = @indexOf object) > -1 if (index = @indexOf object) > -1

View File

@ -212,6 +212,11 @@ Linkify =
div = $.el 'iframe', div = $.el 'iframe',
# Github doesn't allow embedding straight from the site, so we use an external site to bypass that. # 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" 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) -> embedder: (a) ->
return [a] unless Conf['Link Title'] return [a] unless Conf['Link Title']