Skip to content

Commit

Permalink
GitHub's pages contain "GPL" in their source
Browse files Browse the repository at this point in the history
  • Loading branch information
sj26 committed Mar 11, 2013
1 parent 9377d47 commit 3697ab9
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions .js/github.com.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ if (actions = $(".repohead .pagehead-actions")).length
actions.prepend("<li><a href='http://rubygems.org/gems/#{repo}' class='minibutton'><span>Rubygems</span></a></li>")
actions.prepend("<li><a href='http://rdoc.info/github/#{username}/#{repo}/frames' class='minibutton'><span>Rubydoc</span></a></li>")

# if I'm in a repo
slashcount = window.location.href.split("/").length
if slashcount >= 5 # we are in a repo
# find a top level LICENSE* or LICENCE* file
licenseurl = $('a[href*="LICENSE"], a[href*="LICENCE"]').attr("href")
$.get licenseurl, null, (data, status, result) ->
# grep it for *GPL*
if data.match(/(gpl|GNU General Public)/i)
# paint red tape
$("<h2>Watch out, this repository contains GPL licensed code!</h2>")
.css
"background-color": "rgba(255, 0, 0, 0.7)",
"color": "#FF0",
"text-shadow": "2px 2px #000000",
"text-align": "center",
"display": "none",
"position": "fixed",
"width": "100%",
"z-index": 1000,
.prependTo($('body'))
.fadeIn("slow")
# XXX: This needs to be fixed.
## if I'm in a repo
#slashcount = window.location.href.split("/").length
#if slashcount >= 5 # we are in a repo
# # find a top level LICENSE* or LICENCE* file
# if licenseurl = $('a[href*="LICENSE"], a[href*="LICENCE"]').attr("href")
# $.get licenseurl, null, (data, status, result) ->
# # grep it for *GPL*
# if data.match(/(gpl|GNU General Public)/i)
# # paint red tape
# $("<h2>Watch out, this repository contains GPL licensed code!</h2>")
# .css
# "background-color": "rgba(255, 0, 0, 0.7)",
# "color": "#FF0",
# "text-shadow": "2px 2px #000000",
# "text-align": "center",
# "display": "none",
# "position": "fixed",
# "width": "100%",
# "z-index": 1000,
# .prependTo($('body'))
# .fadeIn("slow")

jQuery ($) ->
$('body.page-pullrequest, body.page-commit-show')
Expand Down

0 comments on commit 3697ab9

Please sign in to comment.