Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
SteakOverCooked authored and SteakOverCooked committed Feb 1, 2018
1 parent 5ceb7ee commit 926fc37
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
12 changes: 6 additions & 6 deletions js/utopian.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,16 @@ function updateModerators(api) {
total_paid_steem += row["total_paid_rewards_steem"];
}
const showtop = 15;
const showtop_paid = 20;
data_cnt.sort(function(a, b) {
return b['total_moderated'] - a['total_moderated'];
});
data_cnt.sort(function(a, b) {
data_total_paid.sort(function(a, b) {
return b['total_paid_rewards_steem'] - a['total_paid_rewards_steem'];
});
// keep the top list
data_cnt = data_cnt.slice(0, showtop);
data_total_paid = data_total_paid.slice(0, showtop);
data_total_paid = data_total_paid.slice(0, showtop_paid);
// sum up the total_moderated
let top = 0;
let top_paid = 0;
Expand All @@ -112,8 +113,8 @@ function updateModerators(api) {
for (let i = data_total_paid.length - 1; i --; ) {
top_paid += data_total_paid[i]['total_paid_rewards_steem'];
}
data_cnt.push({"moderator": "others", "total_moderated": total_moderated - top});
data_total_paid.push({"moderator": "others", "total_paid_rewards_steem": data_total_paid - top_paid});
data_cnt.push({"moderator": "others", "total_moderated": total_moderated - top});
data_total_paid.push({"moderator": "others", "total_paid_rewards_steem": total_paid_steem - top_paid});
let chart_mmoderators_count = AmCharts.makeChart( "chartdiv_moderators_count", {
"type": "pie",
"theme": "light",
Expand Down Expand Up @@ -142,12 +143,11 @@ function updateModerators(api) {
"enabled": false
}
});
s += "<div>";
s += "<h4>Overall</h4>";
s += "<ul>"
s += "<li>Total Moderated: <B>" + total_moderated + "</B>.</li>";
s += "<li>Total Paid: <B>" + total_paid_steem.toFixed(3) + "</B> STEEM.</li>";
s += "</ul>";
s += "</div>";
$('div#moderators').html(s);
},
error: function(request, status, error) {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Utopian Moderator & Supervisor",
"short_name": "Utopian-IO",
"default_locale": "en",
"version": "0.0.3",
"version": "0.0.4",
"browser_action": {
"default_icon": "icon.png",
"default_title": "Utopian Moderator & Supervisor",
Expand Down
9 changes: 2 additions & 7 deletions utopian-ext-main.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
<li><a href="#tabs-shortcuts">Short Cuts</a></li>
<li><a href="#tabs-moderators">Moderators</a></li>
<li><a href="#tabs-setting">Setting</a></li>
<li><a href="#tabs-log">Log</a></li>
<li><a href="#tabs-about">About</a></li>
<li><a href="#tabs-log">Log</a></li>
</ul>
<div id="tabs-general">
<img id='loading' src='images/loading.gif' />
Expand Down Expand Up @@ -81,14 +80,10 @@ <h4>Alt + S: </h4>
<p><button class='form-control' style='width:70px' id='save_id_btn'>Save</button></p>
</div>
<div id="tabs-log">
<h4>Proudly brought to you by <a target=_blank href="https://steemit.com/@justyy">@justyy</a></h4>
<textarea readonly class='form-control' rows=15 id='about'>
</textarea>
</div>
<div id="tabs-about">
<div>
Proudly brought to you by <a target=_blank href="https://steemit.com/@justyy">@justyy</a>
</div>
</div>
</div>
</body>
</html>

0 comments on commit 926fc37

Please sign in to comment.