Fix: some Misskey bugs about reaction

This commit is contained in:
Cutls 2019-05-09 00:31:05 +09:00
parent edbe3c164f
commit e9024312a7
8 changed files with 82 additions and 84 deletions

View File

@ -64,11 +64,11 @@ function reactiontoggle(id,acct_id,tlid){
if (httpreq.readyState === 4) {
var json = httpreq.response;
console.log(json);
if(json.reactionCounts){
var reactions=["like","love","laugh","hmm","surprise","congrats","angry","confused","pudding","star"];
if(json.reactions){
var reactions=["like","love","laugh","hmm","surprise","congrats","angry","confused","pudding","rip"];
for(var i=0;i<reactions.length;i++){
if(json.reactionCounts[reactions[i]]){
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(json.reactionCounts[reactions[i]])
if(json.reactions[reactions[i]]){
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(json.reactions[reactions[i]])
$("#pub_" + id +" .re-"+reactions[i]).removeClass("hide")
}else{
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(0)
@ -77,7 +77,7 @@ function reactiontoggle(id,acct_id,tlid){
}else{
$("#pub_" + id +" .re-"+reactions[i]).removeClass("hide")
}
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(json.reactionCounts[reactions[i]])
$("#pub_" + id +" .re-"+reactions[i]+"ct").text(json.reactions[reactions[i]])
}
}
$("#pub_" + id +" .reactions").removeClass("hide");
@ -143,21 +143,21 @@ function reactRefresh(acct_id,id){
}
function reactRefreshCore(json){
var id=json.id;
if(json.reactionCounts){
if(json.reactions){
$("#pub_" + id +" .reactions").removeClass("hide")
var regExp = new RegExp( ":", "g" ) ;
Object.keys(json.reactionCounts).forEach(function(keye) {
Object.keys(json.reactions).forEach(function(keye) {
keyeClass=keye.replace(regExp,'');
if(json.reactionCounts[keye]){
console.log(json.reactionCounts[keye])
$("#pub_" + id +" .re-"+keyeClass+"ct").text(json.reactionCounts[keye])
if(json.reactions[keye]){
console.log(json.reactions[keye])
$("#pub_" + id +" .re-"+keyeClass+"ct").text(json.reactions[keye])
$("#pub_" + id +" .re-"+keyeClass).removeClass("hide")
}else{
$("#pub_" + id +" .re-"+keyeClass+"ct").text(0)
if($("#pub_" + id +" .reactions").hasClass("fullreact")){
$("#pub_" + id +" .re-"+keyeClass).addClass("hide")
}
$("#pub_" + id +" .re-"+keyeClass+"ct").text(json.reactionCounts[keye])
$("#pub_" + id +" .re-"+keyeClass+"ct").text(json.reactions[keye])
}
});
}

View File

@ -203,8 +203,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
"congrats": "🎉",
"amgry": "💢",
"confused": "😥",
"pudding": "🍮",
"star": "⭐"
"rip": "😇"
}
var icon = reactions[toot.reaction];
var emojisData = JSON.parse(localStorage.getItem("emoji_" + acct_id));
@ -653,10 +652,10 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var freeReact = "";
}
//Reactions
if (toot.reactionCounts) {
var addReact = "";
Object.keys(toot.reactionCounts).forEach(function (keye) {
var thisReact = toot.reactionCounts[keye];
if (toot.reactions) {
Object.keys(toot.reactions).forEach(function (keye) {
var thisReact = toot.reactions[keye];
if (keye == "like") { var defaultEmoji = true; }
else if (keye == "love") { var defaultEmoji = true; }
else if (keye == "laugh") { var defaultEmoji = true; }
@ -665,7 +664,7 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
else if (keye == "congrats") { var defaultEmoji = true; }
else if (keye == "angry") { var defaultEmoji = true; }
else if (keye == "confused") { var defaultEmoji = true; }
else if (keye == "pudding") { var defaultEmoji = true; }
else if (keye == "star") { var defaultEmoji = true; }
else {
var obj = JSON.parse(localStorage.getItem("emoji_" + acct_id));
if (obj) {
@ -684,76 +683,76 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
}
}
});
if (toot.reactionCounts.like) {
var like = toot.reactionCounts.like;
if (toot.reactions.like) {
var like = toot.reactions.like;
var likehide = "";
} else {
var like = 0;
var likehide = "hide";
}
if (toot.reactionCounts.love) {
var love = toot.reactionCounts.love;
if (toot.reactions.love) {
var love = toot.reactions.love;
var lovehide = "";
} else {
var love = 0;
var lovehide = "hide";
}
if (toot.reactionCounts.laugh) {
var laugh = toot.reactionCounts.laugh;
if (toot.reactions.laugh) {
var laugh = toot.reactions.laugh;
var laughhide = "";
} else {
var laugh = 0;
var laughhide = "hide";
}
if (toot.reactionCounts.hmm) {
var hmm = toot.reactionCounts.hmm;
if (toot.reactions.hmm) {
var hmm = toot.reactions.hmm;
var hmmhide = "";
} else {
var hmm = 0;
var hmmhide = "hide";
}
if (toot.reactionCounts.surprise) {
var surprise = toot.reactionCounts.surprise;
if (toot.reactions.surprise) {
var surprise = toot.reactions.surprise;
var suphide = "";
} else {
var suphide = "hide";
var surprise = 0;
}
if (toot.reactionCounts.congrats) {
var congrats = toot.reactionCounts.congrats;
if (toot.reactions.congrats) {
var congrats = toot.reactions.congrats;
var conghide = "";
} else {
var congrats = 0;
var conghide = "hide";
}
if (toot.reactionCounts.angry) {
var angry = toot.reactionCounts.angry;
if (toot.reactions.angry) {
var angry = toot.reactions.angry;
var anghide = "";
} else {
var angry = 0;
var anghide = "hide";
}
if (toot.reactionCounts.confused) {
if (toot.reactions.confused) {
var confhide = "";
var confused = toot.reactionCounts.confused;
var confused = toot.reactions.confused;
} else {
var confused = 0;
var confhide = "hide";
}
if (toot.reactionCounts.pudding) {
var pudding = toot.reactionCounts.pudding;
var pudhide = "";
if (toot.reactions.rip) {
var riphide = "";
var rip = toot.reactions.rip;
} else {
var pudding = 0;
var pudhide = "hide";
var rip = 0;
var riphide = "hide";
}
var fullhide = "";
} else {
var like = 0; var love = 0; var laugh = 0; var hmm = 0; var surprise = 0; var congrats = 0; var angry = 0; var confused = 0; var pudding = 0;
var likehide = "hide"; var lovehide = "hide"; var laughhide = "hide"; var hmmhide = "hide"; var suphide = "hide"; var conghide = "hide"; var anghide = "hide"; var confhide = "hide"; var pudhide = "hide";
var likehide = "hide"; var lovehide = "hide"; var laughhide = "hide"; var hmmhide = "hide"; var suphide = "hide"; var conghide = "hide"; var anghide = "hide"; var confhide = "hide"; var riphide="hide"
var fullhide = "hide";
}
if (!addReact && likehide == "hide" && lovehide == "hide" && laughhide == "hide" && hmmhide == "hide" && suphide == "hide" && conghide == "hide" && anghide == "hide" && confhide == "hide" && pudhide == "hide") {
if (!addReact && likehide == "hide" && lovehide == "hide" && laughhide == "hide" && hmmhide == "hide" && suphide == "hide" && conghide == "hide" && anghide == "hide" && confhide == "hide" && riphide=="hide") {
var fullhide = "hide";
}
if (toot.myReaction) {
@ -812,8 +811,8 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) {
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("💢") + '</a><span class="re-angryct">' + angry +
'</span></span><span class="' + confhide + ' reaction re-confused"><a onclick="reaction(\'confused\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("😥") + '</a><span class="re-confusedct">' + confused +
'</span></span><span class="' + pudhide + ' reaction re-pudding"><a onclick="reaction(\'pudding\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("🍮") + '</a><span class="re-puddingct">' + pudding +
'</span></span><span class="' + riphide + ' reaction re-confused"><a onclick="reaction(\'confused\',\'' + toot.id + '\',' + acct_id +
',\'' + tlid + '\')" class="waves-effect waves-dark btn-flat pointer" style="padding:0;margin-left:3px;">' + twemoji.parse("😇") + '</a><span class="re-confusedct">' + rip +
'</span></span>' + addReact +
'<i class="material-icons pointer hide freeReact ' + freeReact + '" style="font-size:1.0rem; padding-left:5px;position: relative;top: 3px;" onclick="reactioncustom(\'' + acct_id + '\',\'' + id + '\')">add_box</i></div>'
+ poll + mentions + tags + '</div>' +
@ -870,6 +869,11 @@ function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
var datetype = localStorage.getItem("datetype");
Object.keys(obj).forEach(function (key) {
var toot = obj[key];
if(toot.followee){
toot=toot.followee
}else if(toot.follower){
toot=toot.follower
}
var locked = "";
if (auth) {
var auth = '<i class="material-icons gray pointer" onclick="misskeyRequest(\'' +
@ -926,6 +930,16 @@ function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
} else {
var dis_name = toot.username;
}
if(toot.followersCount){
var ferct=toot.followersCount
}else{
var ferct="unknown"
}
if(toot.followingCount){
var fingct=toot.followingCount
}else{
var fingct="unknown"
}
templete = templete +
'<div class="cvo" style="padding-top:5px;" user-id="' + toot.id + '"><div class="area-notice">' +
notftext +
@ -940,8 +954,8 @@ function misskeyUserparse(obj, auth, acct_id, tlid, popup) {
'</div>' +
'</div>' +
'<div style="justify-content:space-around" class="area-toot"> <div class="cbadge" style="width:100px;">Follows:' +
toot.followingCount +
'</div><div class="cbadge" style="width:100px;">Followers:' + toot.followersCount +
fingct +
'</div><div class="cbadge" style="width:100px;">Followers:' + ferct +
'</div>' +
'</div>' +
'</div>' +

View File

@ -99,12 +99,12 @@
]
},
"electronDownload": {
"version": "4.1.4"
"version": "4.2.0"
},
"electronVersion": "4.1.4"
"electronVersion": "4.2.0"
},
"devDependencies": {
"electron": "^4.1.4",
"electron": "^4.2.0",
"electron-builder": "^20.39.0"
}
}

View File

@ -36,7 +36,7 @@
<script type="text/javascript" src="../../js/common/modal.js"></script>
<script type="text/javascript" src="../../js/ui/jquery-ui.min.js"></script>
<script>
var ver = "Usamin (18.3.3)";
var ver = "Usamin (18.3.4)";
//betaを入れるとバージョンチェックしない
//GitHubに上げるときはindex.htmlをちゃんとする。(index.start.html)
//var ver="beta";
@ -658,15 +658,9 @@
Entyでは支援者様限定で様々なTheDeskに関する記事をご覧いただけます。<br>
困ったときは、<a href="https://docs.thedesk.top">TheDesk Docs</a>をご覧ください。
<h5>Release Note Usamin (18.3.3)</h5>
・不具合修正<br>
・blurhashに対応(2.8.1~)<br>
18.3.2<br>
・絵文字の描画修正<br>
・旗系絵文字の入力修正<br>
・このトゥートより後ローカルタイムライン<br>
・このトゥートより後ユーザータイムライン<br>
・このトゥートより後連合タイムライン<br>
・Notestock公開時にリンクを表示<br>
・Misskey v11のストリーミングに対応(ただし、投稿のリアクションの自動反映が利用できません)<br>
・その他Misskeyのさまざまな挙動を修正、追加しました。<br>
・NSFWメディアが複数あったときに「NSFW Media」の文字が邪魔で複数段になる不具合を修正
<br>
</div>
<div id="release-en">
@ -685,7 +679,7 @@
Amazon Wish List
</a>
<br>
Give me Amazon Gift Card:<a href="mailto:mstdn@thedesk.top" target="_blank">mstdn@thedesk.top</a><br>
Give me Amazon Gift Card:<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a><br>
Kyash<br>
<img src="../../img/kyash.png" width="100"><br>
</div>

View File

@ -36,7 +36,7 @@
<script type="text/javascript" src="../../js/common/modal.js"></script>
<script type="text/javascript" src="../../js/ui/jquery-ui.min.js"></script>
<script>
var ver = "Usamin (18.3.3)";
var ver = "Usamin (18.3.4)";
//betaを入れるとバージョンチェックしない
//GitHubに上げるときはindex.htmlをちゃんとする。(index.start.html)
//var ver="beta";
@ -658,15 +658,9 @@
Entyでは支援者様限定で様々なTheDeskに関する記事をご覧いただけます。<br>
困ったときは、<a href="https://docs.thedesk.top">TheDesk Docs</a>をご覧ください。
<h5>Release Note Usamin (18.3.3)</h5>
・不具合修正<br>
・blurhashに対応(2.8.1~)<br>
18.3.2<br>
・絵文字の描画修正<br>
・旗系絵文字の入力修正<br>
・このトゥートより後ローカルタイムライン<br>
・このトゥートより後ユーザータイムライン<br>
・このトゥートより後連合タイムライン<br>
・Notestock公開時にリンクを表示<br>
・Misskey v11のストリーミングに対応(ただし、投稿のリアクションの自動反映が利用できません)<br>
・その他Misskeyのさまざまな挙動を修正、追加しました。<br>
・NSFWメディアが複数あったときに「NSFW Media」の文字が邪魔で複数段になる不具合を修正
<br>
</div>
<div id="release-en">
@ -685,7 +679,7 @@
Amazonほしいものリスト
</a>
<br>
<a href="mailto:mstdn@thedesk.top" target="_blank">mstdn@thedesk.top</a>にAmazonギフトカードを送る<br>
<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a>にAmazonギフトカードを送る<br>
Kyash<br>
<img src="../../img/kyash.png" width="100"><br>
</div>

View File

@ -658,7 +658,9 @@
Entyでは支援者様限定で様々なTheDeskに関する記事をご覧いただけます。<br>
困ったときは、<a href="https://docs.thedesk.top">TheDesk Docs</a>をご覧ください。
<h5>Release Note Usamin (18.3.3)</h5>
・caution:読み上げナシMisskey<br>
・Misskey v11のストリーミングに対応(ただし、投稿のリアクションの自動反映が利用できません)<br>
・その他Misskeyのさまざまな挙動を修正、追加しました。<br>
・NSFWメディアが複数あったときに「NSFW Media」の文字が邪魔で複数段になる不具合を修正
<br>
</div>
<div id="release-en">
@ -677,7 +679,7 @@
@@AWLSupport@@
</a>
<br>
@@SendAmazonGift1@@<a href="mailto:mstdn@thedesk.top" target="_blank">mstdn@thedesk.top</a>@@SendAmazonGift2@@<br>
@@SendAmazonGift1@@<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a>@@SendAmazonGift2@@<br>
Kyash<br>
<img src="../../img/kyash.png" width="100"><br>
</div>

View File

@ -1,5 +1,5 @@
const fs = require("fs")
const ver="Usamin (18.3.3)"
const ver="Usamin (18.3.4)"
const langs=["ja","en","ps"]
const langsh=["日本語","English","Crowdin translate system(beta)"]
const simples=["acct","index","setting","update","setting"]

View File

@ -36,7 +36,7 @@
<script type="text/javascript" src="../../js/common/modal.js"></script>
<script type="text/javascript" src="../../js/ui/jquery-ui.min.js"></script>
<script>
var ver = "Usamin (18.3.3)";
var ver = "Usamin (18.3.4)";
//betaを入れるとバージョンチェックしない
//GitHubに上げるときはindex.htmlをちゃんとする。(index.start.html)
//var ver="beta";
@ -658,15 +658,9 @@
Entyでは支援者様限定で様々なTheDeskに関する記事をご覧いただけます。<br>
困ったときは、<a href="https://docs.thedesk.top">TheDesk Docs</a>をご覧ください。
<h5>Release Note Usamin (18.3.3)</h5>
・不具合修正<br>
・blurhashに対応(2.8.1~)<br>
18.3.2<br>
・絵文字の描画修正<br>
・旗系絵文字の入力修正<br>
・このトゥートより後ローカルタイムライン<br>
・このトゥートより後ユーザータイムライン<br>
・このトゥートより後連合タイムライン<br>
・Notestock公開時にリンクを表示<br>
・Misskey v11のストリーミングに対応(ただし、投稿のリアクションの自動反映が利用できません)<br>
・その他Misskeyのさまざまな挙動を修正、追加しました。<br>
・NSFWメディアが複数あったときに「NSFW Media」の文字が邪魔で複数段になる不具合を修正
<br>
</div>
<div id="release-en">
@ -685,7 +679,7 @@
crwdns476:0crwdne476:0
</a>
<br>
crwdns477:0crwdne477:0<a href="mailto:mstdn@thedesk.top" target="_blank">mstdn@thedesk.top</a>crwdns478:0crwdne478:0<br>
crwdns477:0crwdne477:0<a href="mailto:web-pro@cutls.com" target="_blank">web-pro@cutls.com</a>crwdns478:0crwdne478:0<br>
Kyash<br>
<img src="../../img/kyash.png" width="100"><br>
</div>