This commit is contained in:
cutls 2019-11-26 23:20:03 +09:00
parent b948608ce3
commit c2cfbd5583
3 changed files with 13 additions and 7 deletions

View File

@ -1361,10 +1361,14 @@ function pollParse(poll, acct_id) {
var refresh = `<a onclick="voteMastodonrefresh('${acct_id}','${poll.id}')" class="pointer">
${lang.lang_manager_refresh}
</a>`
if (poll.voted) {
if (poll.voted && poll.own_votes.length) {
var myvote = lang.lang_parse_voted
if (poll.expired) myvote = myvote + '/' + lang.lang_parse_endedvote
var result_hide = ''
} else if (poll.voted && !poll.own_votes.length) {
var myvote = lang.lang_parse_myvote
if (poll.expired) myvote = myvote + '/' + lang.lang_parse_endedvote
var result_hide = ''
} else if (poll.expired) {
var myvote = lang.lang_parse_endedvote
var result_hide = ''
@ -1381,7 +1385,7 @@ function pollParse(poll, acct_id) {
}
var ended = date(poll.expires_at, datetype)
var pollHtml = ''
if (choices[0].votes_count) {
if (choices[0].votes_count === 0 || choices[0].votes_count >0) {
var max = _.maxBy(choices, 'votes_count').votes_count
} else {
var max = 0
@ -1393,14 +1397,14 @@ function pollParse(poll, acct_id) {
for (var i = 0; i < minechoice.length; i++) {
var me = minechoice[i]
if (me == keyc) {
var voteit = '<span class="ownMark"></span>'
var voteit = '<span class="ownMark"><img class="emoji" draggable="false" src="https://twemoji.maxcdn.com/v/12.1.4/72x72/2705.png"></span>'
break
}
}
if (!poll.voted && !poll.expired) {
var votesel =
"voteSelMastodon('" + acct_id + "','" + poll.id + "'," + keyc + ',' + poll.multiple + ')'
var voteclass = 'pointer waves-effect waves-light'
var voteclass = 'pointer'
} else {
var votesel = ''
var voteclass = ''
@ -1421,7 +1425,7 @@ function pollParse(poll, acct_id) {
pollHtml =
pollHtml +
`<div class="${voteclass} vote vote_${acct_id}_${poll.id}_${keyc}" onclick="${votesel}">
<span class="leadPoll ${addPoll} ${lpAnime}" style="width: ${per}%"></span>
<span class="vote_${acct_id}_${poll.id}_result leadPoll ${result_hide} ${addPoll} ${lpAnime}" style="width: ${per}%"></span>
<span class="onPoll">${escapeHTML(choice.title)}${voteit}</span>
<span class="vote_${acct_id}_${poll.id}_result ${result_hide} onPoll">
${openData}

View File

@ -199,7 +199,8 @@
"lang_parse_clientemp": "emphasized(/not emphasized)",
"lang_parse_clientmute": "muted",
"lang_parse_mute": " will be muted. You can remove on preferences.",
"lang_parse_voted": "(Voted or mine poll)",
"lang_parse_voted": "(Voted)",
"lang_parse_myvote": "(My own poll)",
"lang_parse_vote": "Vote",
"lang_parse_unvoted": "Show the result without voting",
"lang_parse_endedvote": "Expired",

View File

@ -199,7 +199,8 @@
"lang_parse_clientemp": "強調表示/解除",
"lang_parse_clientmute": "ミュート",
"lang_parse_mute": "ミュートします。設定から解除できます。",
"lang_parse_voted": "(投票済みもしくは自分)",
"lang_parse_voted": "(投票済み)",
"lang_parse_myvote": "(自分)",
"lang_parse_vote": "投票",
"lang_parse_unvoted": "結果だけ見る",
"lang_parse_endedvote": "終了済み",