Files
reddit/r2/r2/public/static/button/button5.html

120 lines
4.8 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" >
<head>
<title>reddit buttons</title>
<meta name="keywords" content=" reddit, reddit.com, vote, comment, submit " />
<meta name="title" content=" reddit buttons " />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">var reddit = { };</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
<script src="../button.js" type="text/javascript"></script>
<script type="text/javascript">
function finalize_thing(data) {
var ups = data.ups - (data.likes?1:0);
var downs = data.downs - (data.likes==false?1:0);
var other = 1.0 * (ups + downs);
ups = [ups, ups, ups + 1];
downs = [downs+1, downs, downs];
other = [other + 1, other, other + 1];
var up_pct = [], down_pct = [];
for(var i = 0; i < 3; i++) {
$("#up" + i + " .num").html(ups[i]);
$("#down" + i + " .num").html(downs[i]);
var up_pct = null;
if(other[i]) {
up_pct = Math.round( 100 * ups[i] / other[i]);
$("#up" + i + " .percent").html(up_pct + "%");
$("#down" + i + " .percent").html(
Math.round( 100 * downs[i] / other[i]) + "%");
} else {
$("#up" + i + " .percent").html("--%");
$("#down" + i + " .percent").html("--%");
}
if(up_pct != null) {
up_pct = Math.abs(50 - up_pct);
if (up_pct <= 5) {
$("#controversy"+i).html("quite controversial");
} else if (up_pct <= 15) {
$("#controversy"+i).html("controversial");
} else if (up_pct <= 25) {
$("#controversy"+i).html("uncontroversial");
} else {
$("#controversy"+i).html("quite uncontroversial");
}
}
}
}
function set_score(id, dir) {
id = $(id).filter(":first").thing_id();
for(var i = 0; i< 3; i++) {
var fn = (i == dir + 1) ? 'show': 'hide';
$("#down" + i)[fn]();
$("#up" + i)[fn]();
$("#controversy" + i)[fn]();
}
}
</script>
<link rel="stylesheet" href="../reddit.css" type="text/css" />
<link rel='shortcut icon' href="../favicon.ico" type="image/x-icon" />
<!--[if lt IE 7]>
<link rel="stylesheet" href="../reddit-ie6-hax.css" type="text/css" />
<![endif]-->
<!--[if lt IE 8]>
<link rel="stylesheet" href="../reddit-ie7-hax.css" type="text/css" />
<![endif]-->
</head>
<body class="button-body">
<div class="button thing">
<div class="blog blog5 entry" style="width: 795px;" >
<a class="bling" href="/" class="left" >
<img src="../blog_snoo.gif" alt="submit"/>
</a>
<div class="container">
<ul>
<li class="selected">Vote on this article</li>
<li class="bling">
<a href="/" target="_new">
Discuss at the reddit.com reddit
</a>
</li>
</ul>
<div class="votes ">
<div class="right" id="controversy0" style="display:none">
</div>
<div class="right" id="controversy1" style="display:none">
</div>
<div class="right" id="controversy2" style="display:none">
</div>
<span class="arrow up" >
<span id="up0" style="display:none" >
<b class="percent">--%</b>
liked it (<span class="num">&bull;</span>)</span>
<span id="up1" style="display:none" >
<b class="percent">--%</b>
liked it (<span class="num">&bull;</span>)</span>
<span id="up2" >
<b class="percent">--%</b>
liked it (<span class="num">&bull;</span>)</span>
</span>
<span class="arrow down" id="down" href="#">
<span id="down0" style='display:none' >
<b class="percent">--%</b>
disliked it (<span class="num">&bull;</span>)</span>
<span id="down1" style='display:none' >
<b class="percent">--%</b>
disliked it (<span class="num">&bull;</span>)</span>
<span id="down2" >
<b class="percent">--%</b>
disliked it (<span class="num">&bull;</span>)</span>
</span>
</div>
<div class="clearleft">
<!--IEsux-->
</div>
</div>
</div>
</div>
</body>
</html>