-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfucker.js
55 lines (45 loc) · 1.39 KB
/
fucker.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
$(document).ready(function(){
console.log("Ready to work !");
var precentBig = 0.00001;
var bidsTotal = 0;
var asksTotal = 0;
var momentBids = 0;
var momentSell = 0;
$("#bidsTotal").bind("DOMSubtreeModified", function(){
bidsTotalPRE = parseFloat($(this).html());
if(bidsTotalPRE) {
bidsTotal = bidsTotalPRE;
}
});
$("#asksTotal").bind("DOMSubtreeModified", function(){
asksTotalPRE = parseFloat($(this).html());
if(asksTotalPRE) {
asksTotal = bidsTotalPRE;
}
});
function updateColor() {
momentBids = 0;
momentSell = 0;
$("#bidsTableBody tr").each(function(key, val){
orderTotal = parseFloat($(val).find(".orderTotal").html());
if(orderTotal > bidsTotal * precentBig) {
momentBids += orderTotal;
$(this).find("td").css("color", "#11AA11");
} else {
$(this).find("td").css("color", "#6f9397");
}
});
$("#sellOrderBookTable tr").each(function(key, val){
orderTotal = parseFloat($(val).find(".orderTotal").html());
if(orderTotal > asksTotal * precentBig) {
momentSell += orderTotal;
$(this).find("td").css("color", "#AA1111");
} else {
$(this).find("td").css("color", "#6f9397");
}
});
$(".sellOrders .head .name").html("SELL " + momentSell.toFixed(0));
$(".buyOrders .head .name").html("BUY " + momentBids.toFixed(0));
};
setInterval(updateColor, 1000);
});