//Renpost function renote(id, acct_id, remote) { if ($("#pub_" + id).hasClass("rted")) { return } var domain = localStorage.getItem("domain_" + acct_id); var at = localStorage.getItem("acct_"+ acct_id + "_at"); var start = "https://" + domain + "/api/notes/create"; if(localStorage.getItem("mode_" + domain)!="misskey"){ return false; } var httpreq = new XMLHttpRequest(); httpreq.open('POST', start, true); httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.responseType = 'json'; httpreq.send(JSON.stringify({i:at,renoteId:id})); httpreq.onreadystatechange = function() { if (httpreq.readyState == 4) { var json = httpreq.response; console.log(json); $("[toot-id=" + id + "]").addClass("rted"); $(".rt_"+id).toggleClass("teal-text"); } } } //Renote function renoteqt(id, acct_id) { localStorage.setItem("nohide",true); show(); $("#reply").val("renote_"+id); $("#rec").text("Renote"); $("#post-acct-sel").val(acct_id); $("#post-acct-sel").prop("disabled", true); $('select').material_select(); $("#textarea").attr("placeholder",lang_misskeyparse_qt[lang]); $("#textarea").focus(); } //Reply function misskeyreply(id, acct_id) { localStorage.setItem("nohide",true); show(); $("#reply").val(id); $("#rec").text("Renote"); $("#post-acct-sel").val(acct_id); $("#post-acct-sel").prop("disabled", true); $('select').material_select(); $("#textarea").attr("placeholder",lang_misskeyparse_qt[lang]); $("#textarea").focus(); } //Reaction function reactiontoggle(id,acct_id,tlid){ var domain = localStorage.getItem("domain_" + acct_id); var at = localStorage.getItem("acct_"+ acct_id + "_at"); var start = "https://" + domain + "/api/notes/show"; if(localStorage.getItem("mode_" + domain)!="misskey"){ return false; } var httpreq = new XMLHttpRequest(); httpreq.open('POST', start, true); httpreq.setRequestHeader('Content-Type', 'application/json'); httpreq.responseType = 'json'; httpreq.send(JSON.stringify({i:at,noteId:id})); httpreq.onreadystatechange = function() { 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"]; for(var i=0;i'+choice.text+'('+choice.votes+''+myvote+')'; }); $(".vote_"+json.id).html(poll) } } } }