Skip to content

Commit 6d62896

Browse files
committed
ページの属性も合わせて更新
1 parent b5bd3f0 commit 6d62896

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function calc(monthlyAnswersNewJson, monthlyAnswersOldJson) {
77
for (let [nowRank, nowValue] of monthlyRanking_new.entries()) {
88
monthlyRanking_new[nowRank].change = `↑`; // 過去にはいないということは上昇!
99
for (let [oldRank, oldValue] of monthlyRanking_old.entries()) {
10-
if (nowValue.userId === oldValue.userId) { // 発見!
10+
if (nowValue.icon_url === oldValue.icon_url) { // 発見!
1111
if (nowRank > oldRank) {
1212
monthlyRanking_new[nowRank].change = `↓`;
1313
} else if (nowRank === oldRank) { // 不変;
@@ -37,7 +37,7 @@ function displayMonthly(monthlyRanking) {
3737
class: 'list-group-item'
3838
});
3939
const imgDom = $('<img>', {
40-
src: userObj.icon,
40+
src: userObj.icon_url,
4141
width: "48px",
4242
css: { float: "left", marginRight: "10px" }
4343
});
@@ -52,10 +52,10 @@ function displayMonthly(monthlyRanking) {
5252
css: { marginRight: "10px" }
5353
});
5454
const div1Dom = $('<span>', {
55-
text: userObj.userName + ` さん`
55+
text: userObj.nickname + ` さん`
5656
});
5757
const div2Dom = $('<div>', {
58-
text: `貢献フォーラム数 ${userObj.answeredQuestionMany}、回答数 ${userObj.total}`,
58+
text: `貢献フォーラム数 ${userObj.reply_count}、回答数 ${userObj.reply_count + userObj.replied_thread_count}`,
5959
style: 'font-size: 98%;'
6060
});
6161
liDom.append(imgDom);
@@ -75,15 +75,15 @@ function displayAllSpan(allSpanUser) {
7575
class: 'list-group-item'
7676
});
7777
const imgDom = $('<img>', {
78-
src: userObj.icon,
78+
src: userObj.icon_url,
7979
width: "48px",
8080
css: { float: "left", marginRight: "10px" }
8181
});
8282
const div1Dom = $('<div>', {
83-
text: '' + (index + 1) + '位 ' + userObj.userName + ' さん'
83+
text: '' + (index + 1) + '位 ' + userObj.nickname + ' さん'
8484
});
8585
const div2Dom = $('<div>', {
86-
html: `貢献フォーラム数 ${userObj.answeredQuestionMany}、回答数 ${userObj.total}`,
86+
html: `貢献フォーラム数 ${userObj.reply_count}、回答数 ${userObj.reply_count + userObj.replied_thread_count}`,
8787
style: 'font-size: 95%;'
8888
});
8989
liDom.append(imgDom);

0 commit comments

Comments
 (0)