andyed (owner)

Revisions

gist: 53159 Download_button fork
public
Description:
Greasemonkey Tweak of Feeds.Mozilla.com
Public Clone URL: git://gist.github.com/53159.git
Embed All Files: show embed
lizardfeeder.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 feeds.mozilla.com
// @namespace feeds.mozilla.com
// @include http://feeds.mozilla.com*
// ==/UserScript==
 
 
/*
* Version 0.0.1 Jan 26, 2009
* Initial version by Andy Edmonds
* This script is licensed under the MPL.
*/
 
var feedHack = {
refresh: 800,
timeout: false,
counts: {},
ems: .8,
baseEm: .9,
inactiveEm: .8,
 
};
 
feedHack.init = function init() {
window.setInterval(this.feedHack, this.refresh);
$ = unsafeWindow.jQuery;
$("li.filter").css("opacity", .5);
$("li.filter").css("font-size", this.inactiveEm + 'em');
}
 
 
feedHack.feedHack = function () {
for(var type in feedHack.counts) {
feedHack.counts[type]=0;
$("li.filter.group-" + type).css("opacity", 1);
}
$ = unsafeWindow.jQuery;
$("li.entry:visible").each(
function( offset ){
var arClass = this.className.split(" ");
for(var classOffset = 0; classOffset < arClass.length; classOffset++) {
if(arClass[classOffset].indexOf("group-") > -1) {
var type = arClass[classOffset].split("-")[1];
if(!feedHack.counts[type]) feedHack.counts[type]=0;
feedHack.counts[type]++;
}
 
}
});
var sum = 0;
for(var type in feedHack.counts) {
sum += feedHack.counts[type];
}
 
for(var type in feedHack.counts) {
//console.log("Bouns ems " + (feedHack.counts[type]/sum)+ " " + ((1.0 * feedHack.baseEm + ((feedHack.counts[type]/sum)*feedHack.ems)) + "em") );
$("li.group-"+ type + ".filter" ).css("font-size", (1.0 * feedHack.baseEm + ((feedHack.counts[type]/sum)*feedHack.ems)) + "em") ;
}
 
}
 
feedHack.init();