TheDesk Mio (ver.3)
This commit is contained in:
@@ -37,7 +37,12 @@ function details(id, acct_id, tlid) {
|
||||
replyTL(json.in_reply_to_id, acct_id);
|
||||
}
|
||||
context(id, acct_id);
|
||||
beforeToot(id, acct_id);
|
||||
if(json.account.acct!=json.account.username){
|
||||
var dom=json.account.acct.replace(/.+@/g,'');
|
||||
}else{
|
||||
var dom=domain;
|
||||
}
|
||||
beforeToot(id, acct_id, dom);
|
||||
userToot(id, acct_id, json.account.id);
|
||||
faved(id, acct_id);
|
||||
rted(id, acct_id);
|
||||
@@ -99,8 +104,8 @@ function context(id, acct_id) {
|
||||
}
|
||||
|
||||
//前のトゥート(Back TL)
|
||||
function beforeToot(id, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
function beforeToot(id, acct_id, domain) {
|
||||
//var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem(domain + "_at");
|
||||
var start = "https://" + domain +
|
||||
"/api/v1/timelines/public?local=true&max_id=" + id;
|
||||
@@ -108,7 +113,6 @@ function beforeToot(id, acct_id) {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
@@ -116,7 +120,7 @@ function beforeToot(id, acct_id) {
|
||||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
var templete = parse(json, '', acct_id);
|
||||
var templete = parse(json, 'noauth', acct_id);
|
||||
$("#toot-before").html(templete);
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
@@ -262,6 +266,9 @@ function brws(){
|
||||
}
|
||||
//外部からトゥート開く
|
||||
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(domain + "_at");
|
||||
var start = "https://" + domain + "/api/v1/search?resolve=true&q="+url
|
||||
|
@@ -105,8 +105,10 @@ function parse(obj, mix, acct_id, tlid, popup) {
|
||||
//認証なしTL
|
||||
if(mix=="noauth"){
|
||||
var noauth="hide";
|
||||
var antinoauth="";
|
||||
}else{
|
||||
var noauth="";
|
||||
var antinoauth="hide";
|
||||
}
|
||||
//マウスオーバーのみ
|
||||
var mouseover=localStorage.getItem("mouseover");
|
||||
@@ -512,32 +514,33 @@ function parse(obj, mix, acct_id, tlid, popup) {
|
||||
'</span>' +
|
||||
'' + mentions + tags + '</div>' +
|
||||
'<div class="area-vis"></div>'+
|
||||
'<div class="area-actions '+noauth+' '+mouseover+'" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
||||
'<div class="action '+disp["re"]+'"><a onclick="re(\'' + toot.id +
|
||||
'<div class="area-actions '+mouseover+'" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
||||
'<div class="action '+antinoauth+'"><a onclick="detEx(\''+toot.url+'\',\'main\')" class="waves-effect waves-dark details" style="padding:0">詳細(メインアカウント経由)</a></div>' +
|
||||
'<div class="action '+disp["re"]+' '+noauth+'"><a onclick="re(\'' + toot.id +
|
||||
'\',\'' + toot.account.acct + '\',' +
|
||||
acct_id + ',\''+visen+
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートに返信"><i class="fa fa-share"></i></a></div>' +
|
||||
'<div class="action '+can_rt+' '+disp["rt"]+'"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
|
||||
'<div class="action '+can_rt+' '+disp["rt"]+' '+noauth+'"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
|
||||
',\'' + tlid +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをブースト"><i class="text-darken-3 fa fa-retweet ' +
|
||||
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count +
|
||||
'</span></a></div>' +
|
||||
'<div class="action '+can_rt+' '+disp["qt"]+'"><a onclick="qt(\'' + toot.id + '\',' + acct_id +
|
||||
'<div class="action '+can_rt+' '+disp["qt"]+' '+noauth+'"><a onclick="qt(\'' + toot.id + '\',' + acct_id +
|
||||
',\'' + toot.account.acct +'\',\''+toot.url+
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートを引用"><i class="text-darken-3 fa fa-quote-right"></i></a></div>' +
|
||||
'<div class="action '+disp["fav"]+'"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
|
||||
'<div class="action '+disp["fav"]+' '+noauth+'"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
|
||||
',\'' + tlid +
|
||||
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをお気に入り登録"><i class="fa text-darken-3 fa-star' +
|
||||
if_fav + ' fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count +
|
||||
'</a></span></div>' +
|
||||
'<div class="' + if_mine + ' action '+disp["del"]+'"><a onclick="del(\'' + toot.id + '\',' +
|
||||
'<div class="' + if_mine + ' action '+disp["del"]+' '+noauth+'"><a onclick="del(\'' + toot.id + '\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートを削除"><i class="fa fa-trash-o"></i></a></div>' +
|
||||
'<div class="' + if_mine + ' action pin '+disp["pin"]+'"><a onclick="pin(\'' + toot.id + '\',' +
|
||||
'<div class="' + if_mine + ' action pin '+disp["pin"]+' '+noauth+'"><a onclick="pin(\'' + toot.id + '\',' +
|
||||
acct_id +
|
||||
')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをピン留め"><i class="fa fa-map-pin pin_' + toot.id + ' '+if_pin+'"></i></a></div>' +trans+
|
||||
'<div class="action ' + if_mine + '"><a onclick="toggleAction(\'' + toot.id + '\',\''+tlid+'\',\''+acct_id+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 material-icons act-icon">expand_more</i></a></div>' +
|
||||
'<div class="action"><a onclick="details(\'' + toot.id + '\',' + acct_id +
|
||||
'<div class="action ' + if_mine + ' '+noauth+'"><a onclick="toggleAction(\'' + toot.id + '\',\''+tlid+'\',\''+acct_id+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 material-icons act-icon">expand_more</i></a></div>' +
|
||||
'<div class="action '+noauth+'"><a onclick="details(\'' + toot.id + '\',' + acct_id +
|
||||
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
|
||||
'<span class="cbadge waves-effect '+viashow+' '+mine_via+'" onclick="client(\''+$.strip_tags(via)+'\')" title="via ' + $.strip_tags(via) + '">via ' +
|
||||
via +
|
||||
|
@@ -4,7 +4,8 @@ if(location.search){
|
||||
var mode=m[1];
|
||||
var codex=m[2];
|
||||
if(mode=="tag"){
|
||||
tl('tag',decodeURI(codex),0,'add');
|
||||
var acct_id=localStorage.getItem("main");
|
||||
tl('tag',decodeURI(codex),acct_id,'add');
|
||||
}
|
||||
}
|
||||
//よく使うタグ
|
||||
@@ -45,6 +46,7 @@ function tagRemove(key) {
|
||||
favTag();
|
||||
}
|
||||
function favTag(){
|
||||
$("#taglist").html("");
|
||||
var tagarr = localStorage.getItem("tag");
|
||||
if(!tagarr){
|
||||
var obj=[];
|
||||
@@ -58,10 +60,48 @@ function favTag(){
|
||||
'<a onclick="tagRemove(\'' + key + '\')" class="pointer" title="#' + tag + 'をよく使うタグから削除">Unpin</a></span> ';
|
||||
});
|
||||
if(obj.length>0){
|
||||
$("#suggest").append("My Tags:" + tags);
|
||||
$("#taglist").append("My Tags:" + tags);
|
||||
}else{
|
||||
$("#suggest").append("");
|
||||
$("#taglist").append("");
|
||||
}
|
||||
}
|
||||
function trendTag(){
|
||||
$("#trendtag").html("");
|
||||
var domain="imastodon.net"
|
||||
var at = localStorage.getItem(domain + "_at");
|
||||
var start = "https://" + domain + "/api/v1/trend_tags"
|
||||
console.log(start)
|
||||
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) {
|
||||
if (json) {
|
||||
var tags="";
|
||||
json=json.score;
|
||||
Object.keys(json).forEach(function(tag) {
|
||||
tags = tags + '<a onclick="tagShow(\'' + tag + '\')" class="pointer">#' + tag + '</a><span class="hide" data-tag="' + tag + '"> <a onclick="tagTL(\'tag\',\'' + tag + '\',false,\'add\')" class="pointer" title="#' + tag + 'のタイムライン">TL</a> <a onclick="brInsert(\'#' + tag + '\')" class="pointer" title="#' + tag + 'でトゥート">Toot</a></span> ';
|
||||
});
|
||||
$("#taglist").append('<span id="trendtag">トレンドタグ<i class="material-icons pointer" onclick="trendTag()" style="font-size:12px">refresh</i>:' + tags+'</span>');
|
||||
trendintervalset()
|
||||
}else{
|
||||
$("#taglist").html("");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function trendintervalset(){
|
||||
setTimeout(trendTag, 6000000);
|
||||
|
||||
|
||||
}
|
||||
function tagTL(a,b,c,d){
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
|
Reference in New Issue
Block a user