(.+)<\/p>$/)[1];
html = html.replace(/
/, "\n");
html = html.replace(//, "\n");
html = html.replace(/<\/p>/, "\n");
- html=$.strip_tags(html);
- $("#textarea").val("\n"+"@"+at+" "+html+"\n"+url);
+ html = $.strip_tags(html);
+ $("#textarea").val("\n" + "@" + at + " " + html + "\n" + url);
}
$("#textarea").focus();
$("#post-acct-sel").val(acct_id);
diff --git a/app/js/tl/card.js b/app/js/tl/card.js
index 1b638c14..fcacbbbc 100644
--- a/app/js/tl/card.js
+++ b/app/js/tl/card.js
@@ -3,211 +3,208 @@
function additional(acct_id, tlid) {
//メンション系
//$(".mention").attr("href", "");
-
+
$("#timeline-container .mention").addClass("parsed");
- $("#timeline-container .hashtag").each(function(i, elem) {
+ $("#timeline-container .hashtag").each(function (i, elem) {
var tags = $(this).attr("href").match(
/https?:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
);
- $(this).attr("href","#");
- if(tags){
- if(tags[2]){
- $(this).attr("onclick",'tagShow(\'' + tags[2] + '\')');
+ $(this).attr("href", "#");
+ if (tags) {
+ if (tags[2]) {
+ $(this).attr("onclick", 'tagShow(\'' + tags[2] + '\')');
}
-
+
}
});
-
+
//トゥートサムネ
- $("#timeline_" + tlid + " .toot a:not(.parsed)").each(function(i, elem) {
+ $("#timeline_" + tlid + " .toot a:not(.parsed)").each(function (i, elem) {
var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
var card = localStorage.getItem("card_" + tlid);
var text = $(this).attr('href');
- if(text){
- if(text.indexOf("twimg.com")=== -1){
+ if (text) {
+ if (text.indexOf("twimg.com") === -1) {
var urls = text.match(
/https?:\/\/([-a-zA-Z0-9@.]+)\/media\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
);
}
- }else{
- text=""
- var urls =[]
+ } else {
+ text = ""
+ var urls = []
}
-
+
//トゥートのURLぽかったら
toot = text.match(/https:\/\/([a-zA-Z0-9.-]+)\/@([a-zA-Z0-9_]+)\/([0-9]+)/);
- if(toot){
- if(toot[1]){
- $(this).attr("data-acct",acct_id);
+ if (toot) {
+ if (toot[1]) {
+ $(this).attr("data-acct", acct_id);
}
}
if (urls) {
$(this).remove();
} else if (!card) {
var id = $(this).parents('.cvo').attr("toot-id");
- if(localStorage.getItem("mode_" + domain)=="misskey"){
- var start = "https://" + domain + "/url?url="+text;
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
+ var start = "https://" + domain + "/url?url=" + text;
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json'
},
//body: JSON.stringify({})
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
+ }).then(function (json) {
if (json.title) {
$("[toot-id=" + id + "] .additional").html(
- "URL"+lang.lang_cards_check+":
Title:" + escapeHTML(json.title) + "
" +
+ "URL" + lang.lang_cards_check + ":
Title:" + escapeHTML(json.title) + "
" +
escapeHTML(json.description) + "");
$("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
$("[toot-id=" + id + "]").addClass("parsed");
}
});
}
-
- }else{
- $(this).attr("title",text);
+
+ } else {
+ $(this).attr("title", text);
}
});
- $("i.unparsed").each(function(i, elem) {
- var dem=$(this).text();
- var dom=$(this);
+ $("i.unparsed").each(function (i, elem) {
+ var dem = $(this).text();
+ var dom = $(this);
var start = "./js/emoji/emoji-map.json";
var xmlHttpRequest = new XMLHttpRequest();
- xmlHttpRequest.onreadystatechange = function()
- {
- if( this.readyState === 4 && this.status === 200 ) {
- if( this.response){
- var json=this.response;
- var emojis=json.emojis;
- for (i = 0; i < emojis.length; i++) {
- var emojie = emojis[i];
- var regExp = new RegExp(dem, "g");
- if (emojie.emoji.match(regExp)) {
- var sc=emojie.name;
- var sc="twa-"+sc.replace(/_/g,"-");
- dom.addClass(sc);
- dom.text("");
- dom.removeClass("unparsed");
- break;
- }
- }
- }
- }
- }
- xmlHttpRequest.open( 'GET', start, true );
- xmlHttpRequest.responseType = 'json';
- xmlHttpRequest.send( null );
+ xmlHttpRequest.onreadystatechange = function () {
+ if (this.readyState === 4 && this.status === 200) {
+ if (this.response) {
+ var json = this.response;
+ var emojis = json.emojis;
+ for (i = 0; i < emojis.length; i++) {
+ var emojie = emojis[i];
+ var regExp = new RegExp(dem, "g");
+ if (emojie.emoji.match(regExp)) {
+ var sc = emojie.name;
+ var sc = "twa-" + sc.replace(/_/g, "-");
+ dom.addClass(sc);
+ dom.text("");
+ dom.removeClass("unparsed");
+ break;
+ }
+ }
+ }
+ }
+ }
+ xmlHttpRequest.open('GET', start, true);
+ xmlHttpRequest.responseType = 'json';
+ xmlHttpRequest.send(null);
});
-
- $("#timeline_" + tlid + " .toot:not(:has(a:not(.add-show,.parsed)))").each(function(i, elem) {
+
+ $("#timeline_" + tlid + " .toot:not(:has(a:not(.add-show,.parsed)))").each(function (i, elem) {
$(this).parent().find(".add-show").hide();
});
//Markdownイメージビューワー
- $("#timeline_" + tlid + " .toot a:not(.img-parsed):has(img)").each(function(i, elem) {
- var ilink=$(this).attr("href");
- var id = $(this).parents('.cvo').attr("toot-id");
- $(this).attr("href","#");
- $(this).attr("onclick","imgv('"+id+"','"+i+"')");
- $(this).attr("data-type","image");
- $(this).attr("id",id+"-image-"+i);
- $(this).attr("data-url",ilink);
- $(this).addClass("img-parsed");
+ $("#timeline_" + tlid + " .toot a:not(.img-parsed):has(img)").each(function (i, elem) {
+ var ilink = $(this).attr("href");
+ var id = $(this).parents('.cvo').attr("toot-id");
+ $(this).attr("href", "#");
+ $(this).attr("onclick", "imgv('" + id + "','" + i + "')");
+ $(this).attr("data-type", "image");
+ $(this).attr("id", id + "-image-" + i);
+ $(this).attr("data-url", ilink);
+ $(this).addClass("img-parsed");
});
}
function additionalIndv(tlid, acct_id, id) {
- var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- var text = $("[toot-id="+id+"] .toot a").attr('href');
- var urls = text.match(
- /https?:\/\/([-a-zA-Z0-9@.]+)\/media\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
- );
- if (urls) {
- $("[toot-id="+id+"] .toot a").remove();
+ var domain = localStorage.getItem("domain_" + acct_id);
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ var text = $("[toot-id=" + id + "] .toot a").attr('href');
+ var urls = text.match(
+ /https?:\/\/([-a-zA-Z0-9@.]+)\/media\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/
+ );
+ if (urls) {
+ $("[toot-id=" + id + "] .toot a").remove();
+ } else {
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
+ var start = "https://" + domain + "/url?url=" + text;
+ fetch(start, {
+ method: 'GET',
+ headers: {
+ 'content-type': 'application/json'
+ },
+ //body: JSON.stringify({})
+ }).then(function (response) {
+ return response.json();
+ }).catch(function (error) {
+ todo(error);
+ console.error(error);
+ }).then(function (json) {
+ if (json.title) {
+ $("[toot-id=" + id + "] .additional").html(
+ "URL" + lang.lang_cards_check + ":
Title:" + escapeHTML(json.title) + "
" +
+ escapeHTML(json.description) + "");
+ $("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
+ $("[toot-id=" + id + "]").addClass("parsed");
+ }
+ });
} else {
- if(localStorage.getItem("mode_" + domain)=="misskey"){
- var start = "https://" + domain + "/url?url="+text;
- fetch(start, {
- method: 'GET',
- headers: {
- 'content-type': 'application/json'
- },
- //body: JSON.stringify({})
- }).then(function(response) {
- return response.json();
- }).catch(function(error) {
- todo(error);
- console.error(error);
- }).then(function(json) {
+ var id = $("[toot-id=" + id + "] .toot a").parents('.cvo').attr("toot-id");
+ var start = "https://" + domain + "/api/v1/statuses/" + id + "/card";
+ fetch(start, {
+ method: 'GET',
+ headers: {
+ 'content-type': 'application/json',
+ 'Authorization': 'Bearer ' + at
+ },
+ //body: JSON.stringify({})
+ }).then(function (response) {
+ return response.json();
+ }).catch(function (error) {
+ todo(error);
+ console.error(error);
+ }).then(function (json) {
+ //このリンク鳥やんけ、ってとき
+ if (json.provider_name == "Twitter") {
+ if (json.image) {
+ var twiImg = '
';
+ } else {
+ var twiImg = '';
+ }
+ $("[toot-id=" + id + "] .additional").html(
+ '');
+ } else if (json.provider_name == "pixiv") {
+ if (json.image) {
+ var pxvImg = '
';
+ } else {
+ var pxvImg = '';
+ }
+ $("[toot-id=" + id + "] .additional").html(
+ '' + escapeHTML(json.author_name) + '' + escapeHTML(json.title) + pxvImg + '
');
+ } else {
if (json.title) {
$("[toot-id=" + id + "] .additional").html(
- "URL"+lang.lang_cards_check+":
Title:" + escapeHTML(json.title) + "
" +
+ "URL" + lang.lang_cards_check + ":
Title:" + escapeHTML(json.title) + "
" +
escapeHTML(json.description) + "");
- $("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
- $("[toot-id=" + id + "]").addClass("parsed");
}
- });
- }else{
- var id = $("[toot-id="+id+"] .toot a").parents('.cvo').attr("toot-id");
- var start = "https://" + domain + "/api/v1/statuses/" + id + "/card";
- fetch(start, {
- method: 'GET',
- headers: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer ' + at
- },
- //body: JSON.stringify({})
- }).then(function(response) {
- return response.json();
- }).catch(function(error) {
- todo(error);
- console.error(error);
- }).then(function(json) {
- console.log(json);
- //このリンク鳥やんけ、ってとき
- console.log(json.provider_name);
- if (json.provider_name=="Twitter"){
- if(json.image){
- var twiImg='
';
- }else{
- var twiImg='';
- }
- $("[toot-id=" + id + "] .additional").html(
- '');
- }else if (json.provider_name=="pixiv"){
- if(json.image){
- var pxvImg='
';
- }else{
- var pxvImg='';
- }
- $("[toot-id=" + id + "] .additional").html(
- ''+escapeHTML(json.author_name)+''+escapeHTML(json.title)+pxvImg+'
');
- }else{
- if (json.title) {
- $("[toot-id=" + id + "] .additional").html(
- "URL"+lang.lang_cards_check+":
Title:" + escapeHTML(json.title) + "
" +
- escapeHTML(json.description) + "");
- }
- if (json.html) {
- $("[toot-id=" + id + "] .additional").html(json.html+'picture_in_picture_alt');
-
- }
+ if (json.html) {
+ $("[toot-id=" + id + "] .additional").html(json.html + 'picture_in_picture_alt');
+
}
- if (json.title) {
- $("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
- $("[toot-id=" + id + "]").addClass("parsed");
- }
- });
- }
-
+ }
+ if (json.title) {
+ $("[toot-id=" + id + "] a:not(.parsed)").addClass("parsed");
+ $("[toot-id=" + id + "]").addClass("parsed");
+ }
+ });
}
+
+ }
}
//各TL上方のLink[On/Off]
@@ -216,11 +213,11 @@ function cardToggle(tlid) {
if (!card) {
localStorage.setItem("card_" + tlid, "true");
$("#sta-card-" + tlid).text("Off");
- $("#sta-card-" + tlid).css("color",'red');
+ $("#sta-card-" + tlid).css("color", 'red');
} else {
localStorage.removeItem("card_" + tlid);
$("#sta-card-" + tlid).text("On");
- $("#sta-card-" + tlid).css("color",'#009688');
+ $("#sta-card-" + tlid).css("color", '#009688');
}
}
//各TL上方のLink[On/Off]をチェック
@@ -228,57 +225,56 @@ function cardCheck(tlid) {
var card = localStorage.getItem("card_" + tlid);
if (!card) {
$("#sta-card-" + tlid).text("On");
- $("#sta-card-" + tlid).css("color",'#009688');
+ $("#sta-card-" + tlid).css("color", '#009688');
} else {
$("#sta-card-" + tlid).text("Off");
- $("#sta-card-" + tlid).css("color",'red');
+ $("#sta-card-" + tlid).css("color", 'red');
}
}
-function mov(id,tlid,type){
- if(tlid=="notf"){
- var tlide="[data-notf="+acct_id+"]";
- }else if(tlid=="user"){
- var tlide="#his-data";
- }else{
- var tlide="[tlid="+tlid+"]";
+function mov(id, tlid, type) {
+ if (tlid == "notf") {
+ var tlide = "[data-notf=" + acct_id + "]";
+ } else if (tlid == "user") {
+ var tlide = "#his-data";
+ } else {
+ var tlide = "[tlid=" + tlid + "]";
}
- console.log(tlid)
- var mouseover=localStorage.getItem("mouseover");
- if(!mouseover){
- mouseover="";
+ var mouseover = localStorage.getItem("mouseover");
+ if (!mouseover) {
+ mouseover = "";
}
- if(mouseover=="yes"){
- mouseover="hide";
- }else if(mouseover=="click"){
- if(type=="mv"){
- mouseover="";
- }else{
- mouseover="hide";
+ if (mouseover == "yes") {
+ mouseover = "hide";
+ } else if (mouseover == "click") {
+ if (type == "mv") {
+ mouseover = "";
+ } else {
+ mouseover = "hide";
}
- }else if(mouseover=="no"){
- mouseover="";
+ } else if (mouseover == "no") {
+ mouseover = "";
}
- if(mouseover=="hide"){
- $(tlide+" [toot-id="+id+"] .area-actions").toggleClass("hide")
- $(tlide+" [toot-id="+id+"] .area-side").toggleClass("hide")
+ if (mouseover == "hide") {
+ $(tlide + " [toot-id=" + id + "] .area-actions").toggleClass("hide")
+ $(tlide + " [toot-id=" + id + "] .area-side").toggleClass("hide")
}
}
-function resetmv(type){
- var mouseover=localStorage.getItem("mouseover");
- if(!mouseover){
- mouseover="";
- }else if(mouseover=="yes"){
- mouseover="hide";
- }else if(mouseover=="no"){
- mouseover="";
- }else if(mouseover=="click" && type!="mv"){
- mouseover="hide";
+function resetmv(type) {
+ var mouseover = localStorage.getItem("mouseover");
+ if (!mouseover) {
+ mouseover = "";
+ } else if (mouseover == "yes") {
+ mouseover = "hide";
+ } else if (mouseover == "no") {
+ mouseover = "";
+ } else if (mouseover == "click" && type != "mv") {
+ mouseover = "hide";
}
- if(mouseover=="hide"){
+ if (mouseover == "hide") {
$(".area-actions").addClass("hide");
$(".area-side").addClass("hide");
}
-
+
}
\ No newline at end of file
diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js
index 8c305119..d0bf290a 100644
--- a/app/js/tl/datails.js
+++ b/app/js/tl/datails.js
@@ -1,31 +1,31 @@
//トゥートの詳細
function details(id, acct_id, tlid, mode) {
- if(mode=="dm"){
+ if (mode == "dm") {
$(".dm-hide").hide();
- }else{
+ } else {
$(".dm-hide").show();
}
- $(".toot-reset").html(''+lang.lang_details_nodata+'');
- var html = $("#timeline_"+tlid+" [toot-id=" + id + "]").html();
+ $(".toot-reset").html('' + lang.lang_details_nodata + '');
+ var html = $("#timeline_" + tlid + " [toot-id=" + id + "]").html();
$("#toot-this").html(html);
$('#tootmodal').modal('open');
var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- if(localStorage.getItem("mode_" + domain)=="misskey"){
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/notes/show";
- var i={
+ var i = {
method: 'POST',
headers: {
'content-type': 'application/json',
},
- body:JSON.stringify({
- i:at,
- noteId:id
+ body: JSON.stringify({
+ i: at,
+ noteId: id
})
}
- }else{
+ } else {
var start = "https://" + domain + "/api/v1/statuses/" + id;
- var i={
+ var i = {
method: 'GET',
headers: {
'content-type': 'application/json',
@@ -33,61 +33,61 @@ function details(id, acct_id, tlid, mode) {
},
}
}
-
- fetch(start, i).then(function(response) {
+
+ fetch(start, i).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
- console.log(json);
- if(!$("#timeline_"+tlid+" #pub_" + id).length){
+ }).then(function (json) {
+ console.log(["Toot data:", json]);
+ if (!$("#timeline_" + tlid + " #pub_" + id).length) {
var html = parse([json], '', acct_id);
$("#toot-this").html(html);
jQuery("time.timeago").timeago();
}
- if(localStorage.getItem("mode_" + domain)=="misskey"){
- var url="https://"+domain+"/notes/"+json.id;
- var scn=json.user.username;
- if(!json.user.host){
- var local=true;
- }else{
- var local=false;
- scn=scn+"@"+host;
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
+ var url = "https://" + domain + "/notes/" + json.id;
+ var scn = json.user.username;
+ if (!json.user.host) {
+ var local = true;
+ } else {
+ var local = false;
+ scn = scn + "@" + host;
}
- var rep="";
- var uid=json.user.id;
- if(json._replyIds){
+ var rep = "";
+ var uid = json.user.id;
+ if (json._replyIds) {
replyTL(json._replyIds[0], acct_id);
}
- }else{
- var url=json.url
- if(json.account.acct==json.account.username){
- var local=true;
- }else{
- var local=false;
+ } else {
+ var url = json.url
+ if (json.account.acct == json.account.username) {
+ var local = true;
+ } else {
+ var local = false;
}
- var scn=json.account.acct;
- var uid=json.account.id;
+ var scn = json.account.acct;
+ var uid = json.account.id;
if (json["in_reply_to_id"]) {
replyTL(json["in_reply_to_id"], acct_id);
}
}
$("#toot-this .fav_ct").text(json.favourites_count);
$("#toot-this .rt_ct").text(json.reblogs_count);
- $("#tootmodal").attr("data-url",url);
- $("#tootmodal").attr("data-id",json.id);
- if(local){
- $("#tootmodal").attr("data-user",scn+"@"+domain);
- }else{
- $("#tootmodal").attr("data-user",scn);
+ $("#tootmodal").attr("data-url", url);
+ $("#tootmodal").attr("data-id", json.id);
+ if (local) {
+ $("#tootmodal").attr("data-user", scn + "@" + domain);
+ } else {
+ $("#tootmodal").attr("data-user", scn);
}
context(id, acct_id);
- var dom=null;
- if(!local){
- dom=scn.replace(/.+@/g,'');
- }else{
- dom=domain;
+ var dom = null;
+ if (!local) {
+ dom = scn.replace(/.+@/g, '');
+ } else {
+ dom = domain;
}
beforeToot(id, acct_id, dom);
userToot(id, acct_id, uid);
@@ -96,37 +96,37 @@ function details(id, acct_id, tlid, mode) {
afterFTLToot(id, acct_id, dom);
faved(id, acct_id);
rted(id, acct_id);
- if($("#toot-this div").hasClass("cvo")){
+ if ($("#toot-this div").hasClass("cvo")) {
$("#toot-this").removeClass("cvo");
- }else{
+ } else {
$("#toot-this").addClass("cvo");
}
- if(!$("#activator").hasClass("active")){
+ if (!$("#activator").hasClass("active")) {
$('#det-col').collapsible('open', 4);
}
-
+
});
}
//返信タイムライン
function replyTL(id, acct_id) {
var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- if(localStorage.getItem("mode_" + domain)=="misskey"){
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/notes/show";
- var i={
+ var i = {
method: 'POST',
headers: {
'content-type': 'application/json',
},
- body:JSON.stringify({
- i:at,
- noteId:id
+ body: JSON.stringify({
+ i: at,
+ noteId: id
})
}
- }else{
+ } else {
var start = "https://" + domain + "/api/v1/statuses/" + id;
- var i={
+ var i = {
method: 'GET',
headers: {
'content-type': 'application/json',
@@ -134,65 +134,65 @@ function replyTL(id, acct_id) {
},
}
}
- fetch(start, i).then(function(response) {
+ fetch(start, i).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
- if(localStorage.getItem("filter_"+ acct_id)!="undefined"){
- var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"thread");
- }else{
- var mute=[];
+ }).then(function (json) {
+ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
+ var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "thread");
+ } else {
+ var mute = [];
}
- if(localStorage.getItem("mode_" + domain)=="misskey"){
- var templete = misskeyParse([json], '', acct_id,"","",mute);
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
+ var templete = misskeyParse([json], '', acct_id, "", "", mute);
$("#toot-after").prepend(templete);
$("#toot-after .hide").html(lang.lang_details_filtered);
- $("#toot-after .by_filter").css("display","block");
+ $("#toot-after .by_filter").css("display", "block");
$("#toot-after .by_filter").removeClass("hide");
- var rep="_replyIds";
+ var rep = "_replyIds";
if (json[rep]) {
replyTL(json[rep][0], acct_id);
}
- }else{
- var templete = parse([json], '', acct_id,"","",mute);
- if(templete!=""){
+ } else {
+ var templete = parse([json], '', acct_id, "", "", mute);
+ if (templete != "") {
$("#toot-reply .no-data").hide();
}
$("#toot-reply").prepend(templete);
$("#toot-reply .hide").html(lang.lang_details_filtered);
- $("#toot-reply .by_filter").css("display","block");
+ $("#toot-reply .by_filter").css("display", "block");
$("#toot-reply .by_filter").removeClass("hide");
- jQuery("time.timeago").timeago();
- var rep="in_reply_to_id";
+ jQuery("time.timeago").timeago();
+ var rep = "in_reply_to_id";
if (json[rep]) {
replyTL(json[rep], acct_id);
}
}
-
+
});
}
//コンテクストってなんですか
function context(id, acct_id) {
var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- if(localStorage.getItem("mode_" + domain)=="misskey"){
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain + "/api/notes/conversation";
- var i={
+ var i = {
method: 'POST',
headers: {
'content-type': 'application/json',
},
- body:JSON.stringify({
- i:at,
- noteId:id
+ body: JSON.stringify({
+ i: at,
+ noteId: id
})
}
- }else{
+ } else {
var start = "https://" + domain + "/api/v1/statuses/" + id + "/context";
- var i={
+ var i = {
method: 'GET',
headers: {
'content-type': 'application/json',
@@ -200,83 +200,82 @@ function context(id, acct_id) {
},
}
}
- fetch(start, i).then(function(response) {
+ fetch(start, i).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
- if(localStorage.getItem("mode_" + domain)=="misskey"){
+ }).then(function (json) {
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
json.reverse();
- console.log(json);
- var templete = misskeyParse(json, '', acct_id,"","",[]);
+ var templete = misskeyParse(json, '', acct_id, "", "", []);
$("#toot-reply").html(templete);
$("#toot-reply .hide").html(lang.lang_details_filtered);
- $("#toot-reply .by_filter").css("display","block");
+ $("#toot-reply .by_filter").css("display", "block");
$("#toot-reply .by_filter").removeClass("hide");
jQuery("time.timeago").timeago();
- }else{
- if(localStorage.getItem("filter_"+ acct_id)!="undefined"){
- var mute=getFilterType(JSON.parse(localStorage.getItem("filter_"+ acct_id)),"thread");
- }else{
- var mute=[];
+ } else {
+ if (localStorage.getItem("filter_" + acct_id) != "undefined") {
+ var mute = getFilterType(JSON.parse(localStorage.getItem("filter_" + acct_id)), "thread");
+ } else {
+ var mute = [];
}
- var templete = parse(json.descendants, '', acct_id,"","",mute);
- if(templete!=""){
+ var templete = parse(json.descendants, '', acct_id, "", "", mute);
+ if (templete != "") {
$("#toot-after .no-data").hide();
}
$("#toot-after").html(templete);
$("#toot-after .hide").html(lang.lang_details_filtered);
- $("#toot-after .by_filter").css("display","block");
+ $("#toot-after .by_filter").css("display", "block");
$("#toot-after .by_filter").removeClass("hide");
jQuery("time.timeago").timeago();
}
-
+
});
}
//前のトゥート(Back TL)
function beforeToot(id, acct_id, domain) {
//var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- if(localStorage.getItem("mode_" + domain)=="misskey"){
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain +
- "/api/notes/local-timeline"
+ "/api/notes/local-timeline"
fetch(start, {
method: 'POST',
headers: {
'content-type': 'application/json',
},
- body:JSON.stringify({
- i:at,
- untilID:id
+ body: JSON.stringify({
+ i: at,
+ untilID: id
})
- }).then(function(response) {
- return response.json();
- }).catch(function(error) {
- todo(error);
- console.error(error);
- }).then(function(json) {
- var templete = misskeyParse(json, 'noauth', acct_id);
- $("#toot-before").html(templete);
- jQuery("time.timeago").timeago();
- });
- }else{
+ }).then(function (response) {
+ return response.json();
+ }).catch(function (error) {
+ todo(error);
+ console.error(error);
+ }).then(function (json) {
+ var templete = misskeyParse(json, 'noauth', acct_id);
+ $("#toot-before").html(templete);
+ jQuery("time.timeago").timeago();
+ });
+ } else {
var start = "https://" + domain +
- "/api/v1/timelines/public?local=true&max_id=" + id;
+ "/api/v1/timelines/public?local=true&max_id=" + id;
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
},
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
+ }).then(function (json) {
var templete = parse(json, 'noauth', acct_id);
- if(templete!=""){
+ if (templete != "") {
$("#toot-before .no-data").hide();
}
$("#toot-before").html(templete);
@@ -287,31 +286,31 @@ function beforeToot(id, acct_id, domain) {
//前のユーザーのトゥート
function userToot(id, acct_id, user) {
var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- if(localStorage.getItem("mode_" + domain)=="misskey"){
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ if (localStorage.getItem("mode_" + domain) == "misskey") {
var start = "https://" + domain +
- "/api/users/notes"
+ "/api/users/notes"
fetch(start, {
method: 'POST',
headers: {
'content-type': 'application/json',
},
- body:JSON.stringify({
- i:at,
- untilID:id,
- userId:user
+ body: JSON.stringify({
+ i: at,
+ untilID: id,
+ userId: user
})
- }).then(function(response) {
- return response.json();
- }).catch(function(error) {
- todo(error);
- console.error(error);
- }).then(function(json) {
- var templete = misskeyParse(json, 'noauth', acct_id);
- $("#user-before").html(templete);
- jQuery("time.timeago").timeago();
- });
- }else{
+ }).then(function (response) {
+ return response.json();
+ }).catch(function (error) {
+ todo(error);
+ console.error(error);
+ }).then(function (json) {
+ var templete = misskeyParse(json, 'noauth', acct_id);
+ $("#user-before").html(templete);
+ jQuery("time.timeago").timeago();
+ });
+ } else {
var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?max_id=" + id;
fetch(start, {
method: 'GET',
@@ -319,103 +318,103 @@ function userToot(id, acct_id, user) {
'content-type': 'application/json',
'Authorization': 'Bearer ' + at
},
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
+ }).then(function (json) {
var templete = parse(json, '', acct_id);
- if(templete!=""){
+ if (templete != "") {
$("#user-before .no-data").hide();
}
$("#user-before").html(templete);
jQuery("time.timeago").timeago();
});
}
-
+
}
//後のLTL
function afterToot(id, acct_id, domain) {
//var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- var start = "https://" + domain +
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ var start = "https://" + domain +
"/api/v1/timelines/public?local=true&min_id=" + id;
- fetch(start, {
- method: 'GET',
- headers: {
- 'content-type': 'application/json',
- },
- }).then(function(response) {
- return response.json();
- }).catch(function(error) {
- todo(error);
- console.error(error);
- }).then(function(json) {
- var templete = parse(json, 'noauth', acct_id);
- if(templete!=""){
- $("#ltl-after .no-data").hide();
- }
- $("#ltl-after").html(templete);
- jQuery("time.timeago").timeago();
- });
+ fetch(start, {
+ method: 'GET',
+ headers: {
+ 'content-type': 'application/json',
+ },
+ }).then(function (response) {
+ return response.json();
+ }).catch(function (error) {
+ todo(error);
+ console.error(error);
+ }).then(function (json) {
+ var templete = parse(json, 'noauth', acct_id);
+ if (templete != "") {
+ $("#ltl-after .no-data").hide();
+ }
+ $("#ltl-after").html(templete);
+ jQuery("time.timeago").timeago();
+ });
}
//後のUTL
function afterUserToot(id, acct_id, user) {
var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?min_id=" + id;
- fetch(start, {
- method: 'GET',
- headers: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer ' + at
- },
- }).then(function(response) {
- return response.json();
- }).catch(function(error) {
- todo(error);
- console.error(error);
- }).then(function(json) {
- var templete = parse(json, '', acct_id);
- if(templete!=""){
- $("#user-after .no-data").hide();
- }
- $("#user-after").html(templete);
- jQuery("time.timeago").timeago();
- });
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses?min_id=" + id;
+ fetch(start, {
+ method: 'GET',
+ headers: {
+ 'content-type': 'application/json',
+ 'Authorization': 'Bearer ' + at
+ },
+ }).then(function (response) {
+ return response.json();
+ }).catch(function (error) {
+ todo(error);
+ console.error(error);
+ }).then(function (json) {
+ var templete = parse(json, '', acct_id);
+ if (templete != "") {
+ $("#user-after .no-data").hide();
+ }
+ $("#user-after").html(templete);
+ jQuery("time.timeago").timeago();
+ });
}
//後のFTL
function afterFTLToot(id, acct_id, domain) {
//var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- var start = "https://" + domain +
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ var start = "https://" + domain +
"/api/v1/timelines/public?min_id=" + id;
- fetch(start, {
- method: 'GET',
- headers: {
- 'content-type': 'application/json',
- },
- }).then(function(response) {
- return response.json();
- }).catch(function(error) {
- todo(error);
- console.error(error);
- }).then(function(json) {
- var templete = parse(json, 'noauth', acct_id);
- if(templete!=""){
- $("#ftl-after .no-data").hide();
- }
- $("#ftl-after").html(templete);
- jQuery("time.timeago").timeago();
- });
+ fetch(start, {
+ method: 'GET',
+ headers: {
+ 'content-type': 'application/json',
+ },
+ }).then(function (response) {
+ return response.json();
+ }).catch(function (error) {
+ todo(error);
+ console.error(error);
+ }).then(function (json) {
+ var templete = parse(json, 'noauth', acct_id);
+ if (templete != "") {
+ $("#ftl-after .no-data").hide();
+ }
+ $("#ftl-after").html(templete);
+ jQuery("time.timeago").timeago();
+ });
}
//ふぁぼ一覧
function faved(id, acct_id) {
var domain = localStorage.getItem("domain_" + acct_id);
- if(localStorage.getItem("mode_" + domain)=="misskey"){ return false; }
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
+ if (localStorage.getItem("mode_" + domain) == "misskey") { return false; }
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/favourited_by";
fetch(start, {
method: 'GET',
@@ -423,14 +422,14 @@ function faved(id, acct_id) {
'content-type': 'application/json',
'Authorization': 'Bearer ' + at
},
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
+ }).then(function (json) {
var templete = userparse(json, '', acct_id);
- if(templete!=""){
+ if (templete != "") {
$("#toot-fav .no-data").hide();
}
$("#toot-fav").html(templete);
@@ -440,8 +439,8 @@ function faved(id, acct_id) {
//ブースト一覧
function rted(id, acct_id) {
var domain = localStorage.getItem("domain_" + acct_id);
- if(localStorage.getItem("mode_" + domain)=="misskey"){ return false; }
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
+ if (localStorage.getItem("mode_" + domain) == "misskey") { return false; }
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
var start = "https://" + domain + "/api/v1/statuses/" + id + "/reblogged_by";
fetch(start, {
method: 'GET',
@@ -449,77 +448,77 @@ function rted(id, acct_id) {
'content-type': 'application/json',
'Authorization': 'Bearer ' + at
},
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
+ }).then(function (json) {
var templete = userparse(json, '', acct_id);
$("#toot-rt").html(templete);
});
}
//URL等のコピー
-function cbCopy(mode){
- var url=$("#tootmodal").attr("data-url");
+function cbCopy(mode) {
+ var url = $("#tootmodal").attr("data-url");
var urls = url.match(/https?:\/\/([-.a-zA-Z0-9]+)/);
- var domain=urls[1];
- if(mode=="emb"){
- var emb='';
+ var domain = urls[1];
+ if (mode == "emb") {
+ var emb = '';
execCopy(emb)
Materialize.toast(lang.lang_details_embed, 1500);
- }else{
- if(execCopy(url)){
+ } else {
+ if (execCopy(url)) {
Materialize.toast(lang.lang_details_url, 1500);
}
-
+
}
}
//本文のコピー
-function staCopy(id){
- var html=$("[toot-id="+id+"] .toot").html();
- html = html.replace(/^(.+)<\/p>$/,"$1");
+function staCopy(id) {
+ var html = $("[toot-id=" + id + "] .toot").html();
+ html = html.replace(/^
(.+)<\/p>$/, "$1");
html = html.replace(/
/, "\n");
html = html.replace(/
/, "\n");
html = html.replace(/<\/p>/, "\n");
- console.log(html);
+ console.log("Copy it:\n" + html);
html = html.replace(//g, "$1");
- html=$.strip_tags(html);
- if(execCopy(html)){
+ html = $.strip_tags(html);
+ if (execCopy(html)) {
Materialize.toast(lang.lang_details_txt, 1500);
}
-
+
}
//翻訳
-function trans(tar,to){
- var html=$("#toot-this .toot").html();
- if(html.match(/^
(.+)<\/p>$/)){
+function trans(tar, to) {
+ var html = $("#toot-this .toot").html();
+ if (html.match(/^
(.+)<\/p>$/)) {
html = html.match(/^
(.+)<\/p>$/)[1];
}
html = html.replace(/
/g, "\n");
html = html.replace(/
/g, "\n");
html = html.replace(/<\/p>/g, "\n");
- html=$.strip_tags(html);
- if(~tar.indexOf("zh")){
- tar="zh";
+ html = $.strip_tags(html);
+ if (~tar.indexOf("zh")) {
+ tar = "zh";
}
$("#toot-this .additional").text("Loading...(Powered by Google Translate)");
- var exec='https://script.google.com/macros/s/AKfycbxhwW5tjjop9Irg-y1zr_WsXlCKEzwWG6KuoOt_vVRDfEbRv0c/exec?format=json&text='+encodeURIComponent(html)+'&source='+tar+'&target='+to
- console.log(exec);
+ var exec = 'https://script.google.com/macros/s/AKfycbxhwW5tjjop9Irg-y1zr_WsXlCKEzwWG6KuoOt_vVRDfEbRv0c/exec?format=json&text=' + encodeURIComponent(html) + '&source=' + tar + '&target=' + to
+ console.log("Try to translate from " + tar + " to " + to + " at " + exec);
fetch(exec, {
method: 'GET',
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(text) {
- $("#toot-this .additional").html(''+text.text+'');
+ }).then(function (text) {
+ $("#toot-this .additional").html('' + text.text + '');
});
}
//ブラウザで開く
-function brws(){
- var url=$("#tootmodal").attr("data-url");
+function brws() {
+ var url = $("#tootmodal").attr("data-url");
const {
shell
} = require('electron');
@@ -527,38 +526,38 @@ function brws(){
shell.openExternal(url);
}
//外部からトゥート開く
-function detEx(url,acct_id){
- if(acct_id=="main"){
- acct_id=localStorage.getItem("main");
+function detEx(url, acct_id) {
+ if (acct_id == "main") {
+ acct_id = localStorage.getItem("main");
}
- var domain = localStorage.getItem("domain_"+acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- var start = "https://" + domain + "/api/v1/search?resolve=true&q="+url
+ var domain = localStorage.getItem("domain_" + acct_id);
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + url
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + at
}
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
- if(!json.statuses){
+ }).then(function (json) {
+ if (!json.statuses) {
const {
shell
} = require('electron');
-
+
shell.openExternal(url);
- }else{
- var id=json.statuses[0].id;
+ } else {
+ var id = json.statuses[0].id;
$(".loadp").text($(".loadp").attr("href"));
$(".loadp").removeClass("loadp");
details(id, acct_id, 0)
}
-
+
});
return;
}
\ No newline at end of file
diff --git a/app/js/tl/date.js b/app/js/tl/date.js
index 505eb54d..cbc3a329 100644
--- a/app/js/tl/date.js
+++ b/app/js/tl/date.js
@@ -15,7 +15,7 @@ function date(str, datetype) {
} else {
var min = date.getMinutes();
}
- var sec=null;
+ var sec = null;
if (date.getSeconds() < 10) {
sec = "0" + date.getSeconds();
} else {
@@ -57,31 +57,31 @@ function date(str, datetype) {
//特殊フォーマット(インスタンス情報で利用)
function crat(str) {
var date = new Date(str);
- var mnt=null;
- if(date.getMonth()<9){
- mnt="0"+(date.getMonth()+1);
- }else{
- mnt=date.getMonth()+1;
+ var mnt = null;
+ if (date.getMonth() < 9) {
+ mnt = "0" + (date.getMonth() + 1);
+ } else {
+ mnt = date.getMonth() + 1;
}
- if(date.getDate()<10){
- var dat="0"+date.getDate();
- }else{
- var dat=date.getDate();
+ if (date.getDate() < 10) {
+ var dat = "0" + date.getDate();
+ } else {
+ var dat = date.getDate();
}
- if(date.getHours()<10){
- var hrs="0"+date.getHours();
- }else{
- var hrs=date.getHours();
+ if (date.getHours() < 10) {
+ var hrs = "0" + date.getHours();
+ } else {
+ var hrs = date.getHours();
}
- if(date.getMinutes()<10){
- var mns="0"+date.getMinutes();
- }else{
- var mns=date.getMinutes();
+ if (date.getMinutes() < 10) {
+ var mns = "0" + date.getMinutes();
+ } else {
+ var mns = date.getMinutes();
}
- if(date.getSeconds()<10){
- var sec="0"+date.getSeconds();
- }else{
- var sec=date.getSeconds();
+ if (date.getSeconds() < 10) {
+ var sec = "0" + date.getSeconds();
+ } else {
+ var sec = date.getSeconds();
}
format_str = 'YYYY-MM-DD hh:mm:ss';
format_str = format_str.replace(/YYYY/g, date.getFullYear());
diff --git a/app/js/tl/dm.js b/app/js/tl/dm.js
index 657b0d3a..079dc737 100644
--- a/app/js/tl/dm.js
+++ b/app/js/tl/dm.js
@@ -1,80 +1,79 @@
//DM(Conv) TL
-function dm(acct_id, tlid, type,delc,voice) {
+function dm(acct_id, tlid, type, delc, voice) {
- var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
- var start = "https://" + domain + "/api/v1/conversations";
+ var domain = localStorage.getItem("domain_" + acct_id);
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
+ var start = "https://" + domain + "/api/v1/conversations";
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + at
},
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
- var templete = '
'+dmListParse(json, type, acct_id, tlid, "", mute)+'
';
- localStorage.setItem("lastobj_"+ tlid,json[0].id)
- $("#timeline_" + tlid).html(templete);
- additional(acct_id, tlid);
- jQuery("time.timeago").timeago();
- todc();
- //reload(type, '', acct_id, tlid, data, mute, delc,voice);
- $(window).scrollTop(0);
- });
-
+ }).then(function (json) {
+ var templete = '' + dmListParse(json, type, acct_id, tlid, "", mute) + '
';
+ localStorage.setItem("lastobj_" + tlid, json[0].id)
+ $("#timeline_" + tlid).html(templete);
+ additional(acct_id, tlid);
+ jQuery("time.timeago").timeago();
+ todc();
+ //reload(type, '', acct_id, tlid, data, mute, delc,voice);
+ $(window).scrollTop(0);
+ });
+
}
-function dmmore(tlid){
+function dmmore(tlid) {
var multi = localStorage.getItem("column");
var obj = JSON.parse(multi);
var acct_id = obj[tlid].domain;
var domain = localStorage.getItem("domain_" + acct_id);
- var at = localStorage.getItem("acct_"+ acct_id + "_at");
+ var at = localStorage.getItem("acct_" + acct_id + "_at");
var sid = $("#timeline_" + tlid + " .cvo").last().attr("unique-id");
- var start = "https://" + domain + "/api/v1/conversations?max_id="+sid;
- var type="dm";
+ var start = "https://" + domain + "/api/v1/conversations?max_id=" + sid;
+ var type = "dm";
fetch(start, {
method: 'GET',
headers: {
'content-type': 'application/json',
'Authorization': 'Bearer ' + at
},
- }).then(function(response) {
+ }).then(function (response) {
return response.json();
- }).catch(function(error) {
+ }).catch(function (error) {
todo(error);
console.error(error);
- }).then(function(json) {
- var templete = ''+dmListParse(json, type, acct_id, tlid, "", mute)+'
';
- $("#timeline_" + tlid).append(templete);
- additional(acct_id, tlid);
- jQuery("time.timeago").timeago();
- moreloading=false;
+ }).then(function (json) {
+ var templete = '' + dmListParse(json, type, acct_id, tlid, "", mute) + '
';
+ $("#timeline_" + tlid).append(templete);
+ additional(acct_id, tlid);
+ jQuery("time.timeago").timeago();
+ moreloading = false;
})
}
//DMオブジェクトパーサー(トゥート)
function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
- console.log(obj);
var templete = '';
- if(obj[0]){
- localStorage.setItem("lastunix_"+ tlid,date(obj[0].created_at, 'unix'));
+ if (obj[0]) {
+ localStorage.setItem("lastunix_" + tlid, date(obj[0].created_at, 'unix'));
}
-
+
var actb = localStorage.getItem("action_btns");
- var actb='re,rt,fav,qt,del,pin,red';
- if(actb){
+ var actb = 're,rt,fav,qt,del,pin,red';
+ if (actb) {
var actb = actb.split(',');
- var disp={};
- for(var k=0;k';
+ '" class="emoji-img" data-emoji="' + shortcode + '" alt=" :' + shortcode + ': ">';
var regExp = new RegExp(":" + shortcode + ":", "g");
dis_name = dis_name.replace(regExp, emoji_url);
-
+
});
}
- var noticeavatar="";
- var if_notf="";
- var uniqueid=toot.id;
- var notice = "";
- var boostback = "";
- //ユーザー強調
- if(toot.account.username!=toot.account.acct){
- var fullname=toot.account.acct;
- }else{
- var domain = localStorage.getItem("domain_" + acct_id);
- var fullname=toot.account.acct+"@"+domain;
- }
- if(useremp){
- Object.keys(useremp).forEach(function(key10) {
+ var noticeavatar = "";
+ var if_notf = "";
+ var uniqueid = toot.id;
+ var notice = "";
+ var boostback = "";
+ //ユーザー強調
+ if (toot.account.username != toot.account.acct) {
+ var fullname = toot.account.acct;
+ } else {
+ var domain = localStorage.getItem("domain_" + acct_id);
+ var fullname = toot.account.acct + "@" + domain;
+ }
+ if (useremp) {
+ Object.keys(useremp).forEach(function (key10) {
var user = useremp[key10];
- if(user==fullname){
+ if (user == fullname) {
boostback = "emphasized";
}
});
}
- var id = toot.id;
- var home = "";
+ var id = toot.id;
+ var home = "";
if (toot.account.locked) {
var locked = ' ';
} else {
@@ -249,25 +248,25 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
}
if (!toot.application) {
var via = '';
- viashow="hide";
+ viashow = "hide";
} else {
var via = escapeHTML(toot.application.name);
//強調チェック
- Object.keys(emp).forEach(function(key6) {
+ Object.keys(emp).forEach(function (key6) {
var cli = emp[key6];
- if(cli == via){
+ if (cli == via) {
boostback = "emphasized";
}
});
//ミュートチェック
- Object.keys(mute).forEach(function(key7) {
+ Object.keys(mute).forEach(function (key7) {
var cli = mute[key7];
- if(cli == via){
+ if (cli == via) {
boostback = "hide";
}
});
}
- if(mix=="pinned"){
+ if (mix == "pinned") {
boostback = "emphasized";
}
if (toot.spoiler_text && cw) {
@@ -276,19 +275,19 @@ function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var spoiler = "cw cw_hide_" + toot.id;
var api_spoil = "gray";
var spoiler_show = ''+lang.lang_parse_cwshow+'
';
+ '\')" class="nex parsed">' + lang.lang_parse_cwshow + '
';
} else {
- var ct1 = toot.content.split('
').length + toot.content.split('
').length -2;
- var ct2 = toot.content.split('').length + toot.content.split('
').length -2;
- if(ct1>ct2){ var ct= ct1; }else{ var ct= ct2; }
+ var ct1 = toot.content.split('').length + toot.content.split('
').length - 2;
+ var ct2 = toot.content.split('').length + toot.content.split('
').length - 2;
+ if (ct1 > ct2) { var ct = ct1; } else { var ct = ct2; }
if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(toot.content)) > 5)) {
- var content = ''+lang.lang_parse_fulltext+'
' + toot.content
+ var content = '' + lang.lang_parse_fulltext + '
' + toot.content
var spoil = '' + $.mb_substr($.strip_tags(
- toot.content), 0, 100) +
- ''+lang.lang_parse_autofold+'';
+ toot.content), 0, 100) +
+ '