-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstackoverflow-icons.user.js
63 lines (60 loc) · 2.63 KB
/
stackoverflow-icons.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// ==UserScript==
// @name StackOverflow Tag Icons
// @description Adds icons to non-sponsored tags
// @include http://stackoverflow.com/*
// @version 1.0
// ==/UserScript==
var icons = {
bugzilla : 'http://www.bugzilla.org/favicon.ico',
django : 'http://www.djangoproject.com/favicon.ico',
eclipse : 'http://eclipse.org/favicon.ico',
'internet-explorer' : 'http://ie.microsoft.com/testdrive/Graphics/CanvasPad/images/ie_small.png',
firefox : 'http://www.mozilla.com/favicon.ico',
'firefox-addon' : 'https://addons.mozilla.org/favicon.ico',
git : 'http://git-scm.com/favicon.png',
github : 'https://github.com/favicon.ico',
gwt : 'http://code.google.com/eclipse/images/gwt_compile_button.png',
haskell : 'http://www.haskell.org/favicon.ico',
ios : 'http://itunes.apple.com/favicon.ico',
iphone : 'http://itunes.apple.com/favicon.ico',
java : 'http://java.sun.com/favicon.ico',
jquery : 'http://static.jquery.com/favicon.ico',
json : 'http://www.json.org/favicon.ico',
junit : 'http://junit.org/favicon.ico',
linux : 'http://kernel.org/favicon.ico',
mercurial : 'http://mercurial.selenic.com/favicon.ico',
mysql : 'http://www.mysql.com/favicon.ico',
osx : 'http://images.apple.com/macosx/what-is-macosx/images/subnav_overview20090824.png',
perl : 'http://www.perl.org/favicon.ico',
php : 'http://www.php.net/favicon.ico',
'project-euler' : 'http://projecteuler.net/favicon.ico',
python : 'http://python.org/favicon.ico',
r : 'http://www.r-project.org/favicon.ico',
ruby : 'http://www.ruby-lang.org/favicon.ico',
scala : 'http://www.scala-lang.org/favicon.ico',
sharepoint : 'http://sharepoint.microsoft.com/_layouts/images/favicon.ico',
silverlight : 'http://www.silverlight.net/resources/images/icons/favicon.ico',
svn : 'http://subversion.tigris.org/favicon.ico',
tortoisesvn : 'http://tortoisesvn.tigris.org/favicon.ico',
twitter : 'http://twitter.com/favicon.ico',
windows : 'http://www.microsoft.com/windows/Framework/images/favicon.ico',
xul : 'http://www.mozilla.org/favicon.ico',
yesod : 'http://www.yesodweb.com/favicon.ico'
};
function GM_wait() {
if (typeof unsafeWindow.jQuery === 'undefined') { window.setTimeout(GM_wait,50); }
else { $ = unsafeWindow.jQuery; GM_letsJQuery(); }
}
GM_wait();
function GM_letsJQuery() {
$(function() {
$('.post-tag').each(function() {
var $this = $(this);
var iconURL = icons[$this.text()];
if (iconURL) {
var icon = $('<img src="' + iconURL + '" class="sponsor-tag-img" />').width(16).height(16);
$this.prepend(icon);
}
});
});
}