diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index e2f29ddf..8d42b599 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -417,7 +417,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var via = ''; viashow="hide"; } else { - var via = toot.application.name; + var via = escapeHTML(toot.application.name); //強調チェック Object.keys(emp).forEach(function(key6) { var cli = emp[key6]; @@ -474,6 +474,40 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var viewer = ""; var hasmedia = ""; var youtube = ""; + //Poll + var poll=""; + if(toot.poll){ + var choices=toot.poll.options; + if(toot.poll.voted){ + var myvote=lang.lang_parse_voted; + var result_hide=""; + }else{ + myvote=''+lang.lang_parse_vote+'
'; + if(choices[0].votes_count===0 || choices[0].votes_count>0){ + myvote=myvote+''+lang.lang_parse_unvoted+""; + } + var result_hide="hide"; + } + if(toot.poll.expired){ + var ended=lang.lang_parse_endedvote; + }else{ + var ended=date(toot.poll.expires_at, datetype); + } + Object.keys(choices).forEach(function(keyc) { + var choice = choices[keyc]; + if(!toot.poll.voted && !toot.poll.expired){ + var votesel='voteSelMastodon(\''+acct_id+'\',\''+toot.poll.id+'\','+keyc+','+toot.poll.multiple+')'; + var voteclass="pointer waves-effect waves-light"; + }else{ + var votesel=""; + var voteclass=""; + } + poll=poll+'
'+escapeHTML(choice.title)+'('+choice.votes_count+')
'; + }); + poll='
'+poll+myvote+'' + + ended+ '
'; + } if(toot.emojis){ var emojick = toot.emojis[0]; }else{ @@ -489,6 +523,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var regExp = new RegExp(":" + shortcode + ":", "g"); content = content.replace(regExp, emoji_url); spoil = spoil.replace(regExp, emoji_url); + poll = poll.replace(regExp, emoji_url); }); } //ニコフレ絵文字 @@ -507,6 +542,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var regExp = new RegExp(":" + shortcode + ":", "g"); content = content.replace(regExp, emoji_url); spoil = spoil.replace(regExp, emoji_url); + poll = poll.replace(regExp, emoji_url); }); } //デフォ絵文字 @@ -523,6 +559,9 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { if(notice){ notice=twemoji.parse(notice); } + if(poll){ + poll=twemoji.parse(poll); + } var mediack = toot.media_attachments[0]; //メディアがあれば var media_ids=""; @@ -726,40 +765,6 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { } } } - //Poll - var poll=""; - if(toot.poll){ - var choices=toot.poll.options; - if(toot.poll.voted){ - var myvote=lang.lang_parse_voted; - var result_hide=""; - }else{ - myvote=''+lang.lang_parse_vote+'
'; - if(choices[0].votes_count===0 || choices[0].votes_count>0){ - myvote=myvote+''+lang.lang_parse_unvoted+""; - } - var result_hide="hide"; - } - if(toot.poll.expired){ - var ended=lang.lang_parse_endedvote; - }else{ - var ended=date(toot.poll.expires_at, datetype); - } - Object.keys(choices).forEach(function(keyc) { - var choice = choices[keyc]; - if(!toot.poll.voted && !toot.poll.expired){ - var votesel='voteSelMastodon(\''+acct_id+'\',\''+toot.poll.id+'\','+keyc+','+toot.poll.multiple+')'; - var voteclass="pointer waves-effect waves-light"; - }else{ - var votesel=""; - var voteclass=""; - } - poll=poll+'
'+escapeHTML(choice.title)+'('+choice.votes_count+')
'; - }); - poll='
'+poll+myvote+'' + - ended+ '
'; - } //Quote if(toot.quote){ poll=poll+'
'+escapeHTML(toot.quote.account.display_name)+'
'+toot.quote.content+'
' diff --git a/app/view/en/index.html b/app/view/en/index.html index 19746733..a07505f2 100644 --- a/app/view/en/index.html +++ b/app/view/en/index.html @@ -580,24 +580,19 @@ var tlid=0; HP
GitHub

-