More prettier
This commit is contained in:
@@ -5,11 +5,11 @@ function utl(user, more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (user == "--now") {
|
||||
var user = $('#his-data').attr("user-id");
|
||||
}
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
if (localStorage.getItem("mode_" + domain) != "misskey") {
|
||||
if (more) {
|
||||
var sid = $("#his-tl .cvo").last().attr("toot-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -18,49 +18,49 @@ function utl(user, more, acct_id) {
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses" +
|
||||
plus;
|
||||
var i={
|
||||
var i = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var req={i:at}
|
||||
} else {
|
||||
var req = { i: at }
|
||||
if (more) {
|
||||
var sid = $("#his-tl .cvo").last().attr("toot-id");
|
||||
req.maxId=sid;
|
||||
req.maxId = sid;
|
||||
}
|
||||
req.userId=user;
|
||||
req.userId = user;
|
||||
var start = "https://" + domain + "/api/users/notes"
|
||||
var i={
|
||||
var i = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body:JSON.stringify(req)
|
||||
body: JSON.stringify(req)
|
||||
}
|
||||
}
|
||||
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") {
|
||||
var templete = misskeyParse(json, '', acct_id, 'user');
|
||||
}else{
|
||||
} else {
|
||||
var templete = parse(json, '', acct_id, 'user');
|
||||
}
|
||||
if(!json[0]){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
if (!json[0]) {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
if (more) {
|
||||
$("#his-tl-contents").append(templete);
|
||||
} else {
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
pinutl(templete,user, acct_id)
|
||||
}else{
|
||||
if (localStorage.getItem("mode_" + domain) != "misskey") {
|
||||
pinutl(templete, user, acct_id)
|
||||
} else {
|
||||
$("#his-tl-contents").html(templete);
|
||||
}
|
||||
}
|
||||
@@ -68,16 +68,16 @@ function utl(user, more, acct_id) {
|
||||
});
|
||||
}
|
||||
//ピン留めTL
|
||||
function pinutl(before,user, acct_id) {
|
||||
function pinutl(before, user, acct_id) {
|
||||
if (!acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (user == "--now") {
|
||||
var user = $('#his-data').attr("user-id");
|
||||
}
|
||||
var plus = "?pinned=1";
|
||||
var plus = "?pinned=1";
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + user + "/statuses" +
|
||||
plus
|
||||
fetch(start, {
|
||||
@@ -86,17 +86,17 @@ function pinutl(before,user, 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) {
|
||||
var templete = parse(json, 'pinned', acct_id,'user');
|
||||
if(!json[0]){
|
||||
templete="";
|
||||
}).then(function (json) {
|
||||
var templete = parse(json, 'pinned', acct_id, 'user');
|
||||
if (!json[0]) {
|
||||
templete = "";
|
||||
}
|
||||
$("#his-tl-contents").html(templete+before);
|
||||
$("#his-tl-contents").html(templete + before);
|
||||
jQuery("time.timeago").timeago();
|
||||
});
|
||||
}
|
||||
@@ -107,26 +107,26 @@ function flw(user, more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (user == "--now") {
|
||||
var user = $('#his-data').attr("user-id");
|
||||
}
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
var req={i:at}
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var req = { i: at }
|
||||
if (more) {
|
||||
var sid = $("#his-follow-list .cvo").last().attr("user-id");
|
||||
req.maxId=sid;
|
||||
req.maxId = sid;
|
||||
}
|
||||
req.userId=user;
|
||||
req.userId = user;
|
||||
var start = "https://" + domain + "/api/users/following"
|
||||
var i={
|
||||
var i = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body:JSON.stringify(req)
|
||||
body: JSON.stringify(req)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
if (more) {
|
||||
var sid = $("#his-follow-list .cvo").last().attr("user-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -135,7 +135,7 @@ function flw(user, more, acct_id) {
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + user + "/following" +
|
||||
plus
|
||||
var i={
|
||||
var i = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
@@ -143,19 +143,19 @@ function flw(user, more, 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"){
|
||||
var templete = misskeyUserparse(json,'',acct_id);
|
||||
}else{
|
||||
var templete = userparse(json,'',acct_id);
|
||||
}).then(function (json) {
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var templete = misskeyUserparse(json, '', acct_id);
|
||||
} else {
|
||||
var templete = userparse(json, '', acct_id);
|
||||
}
|
||||
if(templete==""){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
if (templete == "") {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
if (more) {
|
||||
$("#his-follow-list-contents").append(templete);
|
||||
@@ -173,26 +173,26 @@ function fer(user, more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (user == "--now") {
|
||||
var user = $('#his-data').attr("user-id");
|
||||
}
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
var req={i:at}
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var req = { i: at }
|
||||
if (more) {
|
||||
var sid = $("#his-follower-list .cvo").last().attr("user-id");
|
||||
req.maxId=sid;
|
||||
req.maxId = sid;
|
||||
}
|
||||
req.userId=user;
|
||||
req.userId = user;
|
||||
var start = "https://" + domain + "/api/users/followers"
|
||||
var i={
|
||||
var i = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body:JSON.stringify(req)
|
||||
body: JSON.stringify(req)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
if (more) {
|
||||
var sid = $("#his-follower-list .cvo").last().attr("user-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -201,7 +201,7 @@ function fer(user, more, acct_id) {
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + user + "/followers" +
|
||||
plus
|
||||
var i={
|
||||
var i = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
@@ -209,19 +209,19 @@ function fer(user, more, 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"){
|
||||
var templete = misskeyUserparse(json,'',acct_id);
|
||||
}else{
|
||||
var templete = userparse(json,'',acct_id);
|
||||
}).then(function (json) {
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var templete = misskeyUserparse(json, '', acct_id);
|
||||
} else {
|
||||
var templete = userparse(json, '', acct_id);
|
||||
}
|
||||
if(templete==""){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
if (templete == "") {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
if (more) {
|
||||
$("#his-follower-list-contents").append(templete);
|
||||
@@ -239,8 +239,8 @@ function showFav(more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
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") {
|
||||
if (more) {
|
||||
var sid = $("#his-fav-list .cvo").last().attr("toot-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -248,42 +248,42 @@ function showFav(more, acct_id) {
|
||||
var plus = "";
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/favourites" + plus
|
||||
var i={
|
||||
var i = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
}
|
||||
}
|
||||
}else{
|
||||
var req={i:at}
|
||||
} else {
|
||||
var req = { i: at }
|
||||
if (more) {
|
||||
var sid = $("#his-fav-list .cvo").last().attr("toot-id");
|
||||
req.maxId=sid;
|
||||
req.maxId = sid;
|
||||
}
|
||||
var start = "https://" + domain + "/api/i/favorites"
|
||||
var i={
|
||||
var i = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body:JSON.stringify(req)
|
||||
}
|
||||
body: JSON.stringify(req)
|
||||
}
|
||||
}
|
||||
|
||||
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"){
|
||||
var templete = parse(json, '', acct_id,'user');
|
||||
}else{
|
||||
var templete = misskeyParse(json, '', acct_id,'user');
|
||||
}).then(function (json) {
|
||||
if (localStorage.getItem("mode_" + domain) != "misskey") {
|
||||
var templete = parse(json, '', acct_id, 'user');
|
||||
} else {
|
||||
var templete = misskeyParse(json, '', acct_id, 'user');
|
||||
}
|
||||
if(!json[0]){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
if (!json[0]) {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
if (more) {
|
||||
$("#his-fav-list-contents").append(templete);
|
||||
@@ -300,22 +300,22 @@ function showMut(more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
var req={i:at}
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var req = { i: at }
|
||||
if (more) {
|
||||
var sid = $("#his-muting-list .cvo").last().attr("user-id");
|
||||
req.maxId=sid;
|
||||
req.maxId = sid;
|
||||
}
|
||||
var start = "https://" + domain + "/api/mute/list"
|
||||
var i={
|
||||
var i = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body:JSON.stringify(req)
|
||||
body: JSON.stringify(req)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
if (more) {
|
||||
var sid = $("#his-muting-list .cvo").last().attr("user-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -323,7 +323,7 @@ function showMut(more, acct_id) {
|
||||
var plus = "";
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/mutes" + plus
|
||||
var i={
|
||||
var i = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
@@ -331,17 +331,17 @@ function showMut(more, 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(!json[0]){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
}).then(function (json) {
|
||||
if (!json[0]) {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
var templete = userparse(json,'',acct_id);
|
||||
var templete = userparse(json, '', acct_id);
|
||||
if (more) {
|
||||
$("#his-muting-list-contents").append(templete);
|
||||
} else {
|
||||
@@ -357,11 +357,11 @@ function showBlo(more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
$("#his-blocking-list-contents").html(lang.lang_hisdata_notonmisskey+"<br>");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
$("#his-blocking-list-contents").html(lang.lang_hisdata_notonmisskey + "<br>");
|
||||
return false;
|
||||
}
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (more) {
|
||||
var sid = $("#his-blocking-list .cvo").last().attr("user-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -375,16 +375,16 @@ function showBlo(more, 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) {
|
||||
if(!json[0]){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
}).then(function (json) {
|
||||
if (!json[0]) {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
var templete = userparse(json,'',acct_id);
|
||||
var templete = userparse(json, '', acct_id);
|
||||
if (more) {
|
||||
$("#his-blocking-list-contents").append(templete);
|
||||
} else {
|
||||
@@ -396,27 +396,27 @@ function showBlo(more, acct_id) {
|
||||
|
||||
//フォロリクリスト
|
||||
function showReq(more, acct_id) {
|
||||
|
||||
|
||||
if (!acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
var req={i:at}
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
var req = { i: at }
|
||||
if (more) {
|
||||
var sid = $("#his-request-list .cvo").last().attr("user-id");
|
||||
req.maxId=sid;
|
||||
req.maxId = sid;
|
||||
}
|
||||
var start = "https://" + domain + "/following/requests/list"
|
||||
var i={
|
||||
var i = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body:JSON.stringify(req)
|
||||
body: JSON.stringify(req)
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
if (more) {
|
||||
var sid = $("#his-request-list .cvo").last().attr("user-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -424,7 +424,7 @@ function showReq(more, acct_id) {
|
||||
var plus = "";
|
||||
}
|
||||
var start = "https://" + domain + "/api/v1/follow_requests" + plus
|
||||
var i={
|
||||
var i = {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
@@ -432,21 +432,21 @@ function showReq(more, 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"){
|
||||
var templete = userparse(json, "request",acct_id);
|
||||
}else{
|
||||
var templete = misskeyUserparse(json, true,acct_id);
|
||||
}).then(function (json) {
|
||||
|
||||
if (localStorage.getItem("mode_" + domain) != "misskey") {
|
||||
var templete = userparse(json, "request", acct_id);
|
||||
} else {
|
||||
var templete = misskeyUserparse(json, true, acct_id);
|
||||
}
|
||||
|
||||
if(!json[0]){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
|
||||
if (!json[0]) {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
if (more) {
|
||||
$("#his-request-list-contents").append(templete);
|
||||
@@ -463,11 +463,11 @@ function showDom(more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
$("#his-domain-list-contents").html(lang.lang_hisdata_notonmisskey+"<br>");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
$("#his-domain-list-contents").html(lang.lang_hisdata_notonmisskey + "<br>");
|
||||
return false;
|
||||
}
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (more) {
|
||||
var sid = $("#his-domain-list .cvo").last().attr("user-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -482,17 +482,17 @@ function showDom(more, acct_id) {
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
//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) {
|
||||
var templete = "";
|
||||
if(!json[0]){
|
||||
templete=lang.lang_details_nodata+"<br>";
|
||||
if (!json[0]) {
|
||||
templete = lang.lang_details_nodata + "<br>";
|
||||
}
|
||||
Object.keys(json).forEach(function(key) {
|
||||
Object.keys(json).forEach(function (key) {
|
||||
var domain = json[key];
|
||||
templete = templete + domain +
|
||||
'<i class="material-icons gray pointer" onclick="domainblock(\'' +
|
||||
@@ -514,11 +514,11 @@ function showFrl(more, acct_id) {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
}
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
$("#his-follow-recom-contents").html(lang.lang_hisdata_notonmisskey+"<br>");
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
$("#his-follow-recom-contents").html(lang.lang_hisdata_notonmisskey + "<br>");
|
||||
return false;
|
||||
}
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
if (more) {
|
||||
var sid = $("#his-follow-recom-list .cvo").last().attr("user-id");
|
||||
var plus = "?max_id=" + sid;
|
||||
@@ -532,19 +532,19 @@ function showFrl(more, acct_id) {
|
||||
'content-type': 'application/json',
|
||||
'Authorization': 'Bearer ' + at
|
||||
},
|
||||
}).then(function(response) {
|
||||
}).then(function (response) {
|
||||
return response.json();
|
||||
}).catch(function(error) {
|
||||
$("#his-follow-recom-contents").html(lang.lang_details_nodata+"("+lang.lang_hisdata_frcreq+")<br>");
|
||||
}).catch(function (error) {
|
||||
$("#his-follow-recom-contents").html(lang.lang_details_nodata + "(" + lang.lang_hisdata_frcreq + ")<br>");
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
if(!json[0]){
|
||||
}).then(function (json) {
|
||||
if (!json[0]) {
|
||||
console.warn("No suggestions(recommend) data");
|
||||
templete=lang.lang_details_nodata+"("+lang.lang_hisdata_frcwarn+")<br>";
|
||||
}else{
|
||||
var templete = userparse(json,'',acct_id);
|
||||
templete = lang.lang_details_nodata + "(" + lang.lang_hisdata_frcwarn + ")<br>";
|
||||
} else {
|
||||
var templete = userparse(json, '', acct_id);
|
||||
}
|
||||
|
||||
|
||||
if (more) {
|
||||
$("#his-follow-recom-contents").append(templete);
|
||||
} else {
|
||||
@@ -561,37 +561,37 @@ function udAdd(start) {
|
||||
'Accept': '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) {
|
||||
var fields=json.attachment;
|
||||
for(var i=0;i<fields.length;i++){
|
||||
if(fields[i].type=="IdentityProof"){
|
||||
if(fields[i].signatureAlgorithm=="keybase"){
|
||||
var html='<a href="https://keybase.io/'+fields[i].name+'" target="_blank" class="cbadge teal waves-effect" style="max-width:200px;" title="'+lang.lang_hisdata_key.replace("{{set}}",escapeHTML(fields[i].signatureAlgorithm))+'"><i class="fas fa-key" aria-hidden="true"></i>'+escapeHTML(fields[i].signatureAlgorithm)+':'+escapeHTML(fields[i].name)+'</a>';
|
||||
}else{
|
||||
var html='<span class="cbadge teal" style="max-width:200px;" title="'+lang.lang_hisdata_key.replace("{{set}}",escapeHTML(fields[i].signatureAlgorithm))+'"><i class="fas fa-key" aria-hidden="true"></i>'+escapeHTML(fields[i].signatureAlgorithm)+':'+escapeHTML(fields[i].name)+'</span>';
|
||||
}).then(function (json) {
|
||||
var fields = json.attachment;
|
||||
for (var i = 0; i < fields.length; i++) {
|
||||
if (fields[i].type == "IdentityProof") {
|
||||
if (fields[i].signatureAlgorithm == "keybase") {
|
||||
var html = '<a href="https://keybase.io/' + fields[i].name + '" target="_blank" class="cbadge teal waves-effect" style="max-width:200px;" title="' + lang.lang_hisdata_key.replace("{{set}}", escapeHTML(fields[i].signatureAlgorithm)) + '"><i class="fas fa-key" aria-hidden="true"></i>' + escapeHTML(fields[i].signatureAlgorithm) + ':' + escapeHTML(fields[i].name) + '</a>';
|
||||
} else {
|
||||
var html = '<span class="cbadge teal" style="max-width:200px;" title="' + lang.lang_hisdata_key.replace("{{set}}", escapeHTML(fields[i].signatureAlgorithm)) + '"><i class="fas fa-key" aria-hidden="true"></i>' + escapeHTML(fields[i].signatureAlgorithm) + ':' + escapeHTML(fields[i].name) + '</span>';
|
||||
}
|
||||
$("#his-proof-prof").append(html)
|
||||
}
|
||||
}
|
||||
});
|
||||
fetch("https://notestock.osa-p.net/api/v1/isstock.json?id="+start.replace("@","users/"), {
|
||||
fetch("https://notestock.osa-p.net/api/v1/isstock.json?id=" + start.replace("@", "users/"), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': '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) {
|
||||
if(json.user.public_view){
|
||||
var html='<a href="'+json.user.url+'" target="_blank" class="cbadge purple waves-effect" style="max-width:200px;" title="Notestock">Notestock</a>';
|
||||
}).then(function (json) {
|
||||
if (json.user.public_view) {
|
||||
var html = '<a href="' + json.user.url + '" target="_blank" class="cbadge purple waves-effect" style="max-width:200px;" title="Notestock">Notestock</a>';
|
||||
$("#his-proof-prof").append(html)
|
||||
}
|
||||
});
|
||||
@@ -601,43 +601,43 @@ function udAdd(start) {
|
||||
|
||||
//ユーザーマッチングリスト
|
||||
function showMat() {
|
||||
|
||||
|
||||
$("#his-matching-list-contents").html(lang.lang_hisdata_taketime);
|
||||
var full=$("#his-acct").attr("fullname");
|
||||
var acct_id=$("#his-data").attr("use-acct");
|
||||
full=full.split("@");
|
||||
var start = "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-filtered-api.cgi?"+full[1]+"+" + full[0];
|
||||
var full = $("#his-acct").attr("fullname");
|
||||
var acct_id = $("#his-data").attr("use-acct");
|
||||
full = full.split("@");
|
||||
var start = "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-filtered-api.cgi?" + full[1] + "+" + full[0];
|
||||
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) {
|
||||
var templete="";
|
||||
Object.keys(json).forEach(function(key) {
|
||||
}).then(function (json) {
|
||||
var templete = "";
|
||||
Object.keys(json).forEach(function (key) {
|
||||
var user = json[key];
|
||||
templete = templete +
|
||||
'<div class="" style="padding-top:5px;">' +
|
||||
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' +
|
||||
'<div style="flex-basis:40px;"><a onclick="udgEx(\'' + user.user + '\',' +
|
||||
acct_id + ');" user="' + user.user + '" class="udg">' +
|
||||
'<img src="' + user.avatar + '" width="40" class="prof-img" user="' + user.user + '"></a></div>' +
|
||||
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"><big>' +
|
||||
escapeHTML(user.screen_name) + '</big></div>' +
|
||||
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
|
||||
user.user + '@'+user.host+'</div>' +
|
||||
'</div>' +
|
||||
'<div class="divider"></div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
'<div class="" style="padding-top:5px;">' +
|
||||
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' +
|
||||
'<div style="flex-basis:40px;"><a onclick="udgEx(\'' + user.user + '\',' +
|
||||
acct_id + ');" user="' + user.user + '" class="udg">' +
|
||||
'<img src="' + user.avatar + '" width="40" class="prof-img" user="' + user.user + '"></a></div>' +
|
||||
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"><big>' +
|
||||
escapeHTML(user.screen_name) + '</big></div>' +
|
||||
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
|
||||
user.user + '@' + user.host + '</div>' +
|
||||
'</div>' +
|
||||
'<div class="divider"></div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
});
|
||||
$("#his-matching-list").css("height",$("#his-float-data").height()-$("#his-basic-prof").height()-$("#his-des").height()-$("#his-plus-action").height()+"px");
|
||||
$("#his-matching-list").css("height", $("#his-float-data").height() - $("#his-basic-prof").height() - $("#his-des").height() - $("#his-plus-action").height() + "px");
|
||||
$("#his-matching-list-contents").html(templete);
|
||||
});
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ function profedit() {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
todo("Updating...");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/update_credentials";
|
||||
var name = $("#his-name-val").val();
|
||||
var des = $("#his-des-val").val();
|
||||
@@ -17,7 +17,7 @@ function profedit() {
|
||||
display_name: name,
|
||||
note: des,
|
||||
}));
|
||||
httpreq.onreadystatechange = function() {
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
$('#his-data').modal('close');
|
||||
todc();
|
||||
@@ -35,13 +35,13 @@ function imgChange(imgfile, target) {
|
||||
}
|
||||
var file = imgfile.files[0];
|
||||
var fr = new FileReader();
|
||||
fr.onload = function(evt) {
|
||||
fr.onload = function (evt) {
|
||||
var b64 = this.result;
|
||||
var blob = toBlob(b64, 'image/png');
|
||||
var fd = new FormData();
|
||||
fd.append(target, blob);
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/update_credentials";
|
||||
var httpreq = new XMLHttpRequest();
|
||||
httpreq.open('PATCH', start, true);
|
||||
@@ -49,7 +49,7 @@ function imgChange(imgfile, target) {
|
||||
httpreq.setRequestHeader('Authorization', 'Bearer ' + at);
|
||||
httpreq.responseType = "json";
|
||||
httpreq.send(fd);
|
||||
httpreq.onreadystatechange = function() {
|
||||
httpreq.onreadystatechange = function () {
|
||||
if (httpreq.readyState === 4) {
|
||||
var json = httpreq.response;
|
||||
$('#his-data').modal('close');
|
||||
|
@@ -1,47 +1,47 @@
|
||||
//ユーザーデータ表示
|
||||
localStorage.removeItem("history");
|
||||
//コード受信
|
||||
if(location.search){
|
||||
if (location.search) {
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=(.+)/);
|
||||
var mode=m[1];
|
||||
var codex=m[2];
|
||||
if(mode=="user"){
|
||||
udgEx(codex,'main');
|
||||
var mode = m[1];
|
||||
var codex = m[2];
|
||||
if (mode == "user") {
|
||||
udgEx(codex, 'main');
|
||||
}
|
||||
}
|
||||
function udgEx(user,acct_id){
|
||||
if(user=="selector"){
|
||||
function udgEx(user, acct_id) {
|
||||
if (user == "selector") {
|
||||
user = $("#his-acct").attr('fullname');
|
||||
}
|
||||
if(acct_id=="selector"){
|
||||
if (acct_id == "selector") {
|
||||
acct_id = $("#user-acct-sel").val();
|
||||
}
|
||||
if(acct_id=="main"){
|
||||
if (acct_id == "main") {
|
||||
acct_id = localStorage.getItem("main");
|
||||
}
|
||||
console.log("Get user data of "+user);
|
||||
console.log("Get user data of " + user);
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){ return false; }
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/search?resolve=true&q="+user
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") { return false; }
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/search?resolve=true&q=" + user
|
||||
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.accounts){
|
||||
var id=json.accounts[0].id;
|
||||
udg(id,acct_id);
|
||||
}else{
|
||||
var url="https://"+user.split('@')[1]+"/@"+user.split('@')[0];
|
||||
const {shell} = require('electron');
|
||||
}).then(function (json) {
|
||||
if (json.accounts) {
|
||||
var id = json.accounts[0].id;
|
||||
udg(id, acct_id);
|
||||
} else {
|
||||
var url = "https://" + user.split('@')[1] + "/@" + user.split('@')[0];
|
||||
const { shell } = require('electron');
|
||||
shell.openExternal(url);
|
||||
}
|
||||
});
|
||||
@@ -50,15 +50,15 @@ function udgEx(user,acct_id){
|
||||
function udg(user, acct_id) {
|
||||
reset();
|
||||
if (!user) {
|
||||
user = localStorage.getItem("user-id_"+acct_id);
|
||||
user = localStorage.getItem("user-id_" + acct_id);
|
||||
}
|
||||
todo("User Data Loading...");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if(localStorage.getItem("mode_" + domain)=="misskey"){
|
||||
if (localStorage.getItem("mode_" + domain) == "misskey") {
|
||||
misskeyUdg(user, acct_id)
|
||||
return;
|
||||
}
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/" + user;
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
@@ -66,141 +66,141 @@ function udg(user, 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) {
|
||||
//一つ前のユーザーデータ
|
||||
if (!localStorage.getItem("history")){
|
||||
$("#his-history-btn").prop("disabled",true);
|
||||
}else{
|
||||
$("#his-history-btn").prop("disabled",false);
|
||||
if (!localStorage.getItem("history")) {
|
||||
$("#his-history-btn").prop("disabled", true);
|
||||
} else {
|
||||
$("#his-history-btn").prop("disabled", false);
|
||||
$('#his-data').attr("history", localStorage.getItem("history"));
|
||||
}
|
||||
//moved設定時
|
||||
if (json.moved) {
|
||||
Materialize.toast(
|
||||
lang.lang_showontl_movetxt+'<button class="btn-flat toast-action" onclick="udg(\'' +
|
||||
json.moved.id + '\',\''+acct_id+'\')">'+lang.lang_showontl_movebtn+'</button>', 4000)
|
||||
lang.lang_showontl_movetxt + '<button class="btn-flat toast-action" onclick="udg(\'' +
|
||||
json.moved.id + '\',\'' + acct_id + '\')">' + lang.lang_showontl_movebtn + '</button>', 4000)
|
||||
}
|
||||
$('#his-data').modal('open');
|
||||
$('#his-data').attr("user-id", user);
|
||||
$('#his-data').attr("use-acct", acct_id);
|
||||
if(json.username!=json.acct){
|
||||
//Remote
|
||||
$('#his-data').attr("remote", "true");
|
||||
var fullname=json.acct;
|
||||
}else{
|
||||
$('#his-data').attr("remote", "false");
|
||||
var fullname=json.acct+"@"+domain;
|
||||
}
|
||||
utl(json.id, '', acct_id);
|
||||
flw(json.id, '', acct_id);
|
||||
fer(json.id, '', acct_id);
|
||||
var dis_name=escapeHTML(json.display_name);
|
||||
dis_name=twemoji.parse(dis_name);
|
||||
$('#his-data').modal('open');
|
||||
$('#his-data').attr("user-id", user);
|
||||
$('#his-data').attr("use-acct", acct_id);
|
||||
if (json.username != json.acct) {
|
||||
//Remote
|
||||
$('#his-data').attr("remote", "true");
|
||||
var fullname = json.acct;
|
||||
} else {
|
||||
$('#his-data').attr("remote", "false");
|
||||
var fullname = json.acct + "@" + domain;
|
||||
}
|
||||
utl(json.id, '', acct_id);
|
||||
flw(json.id, '', acct_id);
|
||||
fer(json.id, '', acct_id);
|
||||
var dis_name = escapeHTML(json.display_name);
|
||||
dis_name = twemoji.parse(dis_name);
|
||||
|
||||
var note=json.note;
|
||||
if(json.emojis){
|
||||
var actemojick = json.emojis[0];
|
||||
}else{
|
||||
var actemojick=false;
|
||||
}
|
||||
//絵文字があれば
|
||||
if (actemojick) {
|
||||
Object.keys(json.emojis).forEach(function(key5) {
|
||||
var emoji = json.emojis[key5];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url +
|
||||
'" class="emoji-img" data-emoji="'+shortcode+'" draggable="false">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
dis_name = dis_name.replace(regExp, emoji_url);
|
||||
note = note.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
//noteの解析
|
||||
//var tags = '<a onclick="tl(\'tag\',\'$1\',' + acct_id +',\'add\')" class="pointer parsed">#$1</a>';
|
||||
//var mens = '<a onclick="udgEx(\'$1\',' + acct_id +')" class="pointer parsed">@$1</a>';
|
||||
//note=note.replace(/#(\S+)/gi, tags)
|
||||
//note=note.replace(/\s@([a-zA-Z_0-9@.-]+)/gi, mens)
|
||||
$("#his-name").html(dis_name);
|
||||
$("#his-acct").text(json.acct);
|
||||
$("#his-acct").attr("fullname",fullname);
|
||||
$("#his-prof").attr("src", json.avatar);
|
||||
$('#his-data').css('background-image', 'url(' + json.header + ')');
|
||||
$("#his-sta").text(json.statuses_count);
|
||||
$("#his-follow").text(json.following_count);
|
||||
var flerc=json.followers_count;
|
||||
if(flerc<0){
|
||||
flerc="-";
|
||||
}
|
||||
$("#his-follower").text(flerc);
|
||||
$("#his-since").text(crat(json.created_at));
|
||||
$("#his-openin").attr("data-href", json.url);
|
||||
if(json.fields){
|
||||
if(json.fields.length>0){
|
||||
note=note+'<table id="his-field">'
|
||||
for(var i=0;i<json.fields.length;i++){
|
||||
var fname=json.fields[i].name;
|
||||
var fval=json.fields[i].value;
|
||||
if(json.fields[i].verified_at){
|
||||
var when=lang.lang_showontl_verified+":"+crat(json.fields[i].verified_at);
|
||||
var color="rgba(121,189,154,.25);"
|
||||
}else{
|
||||
var when="";
|
||||
var color="inherit"
|
||||
}
|
||||
note=note+'<tr><td class="his-field-title">'+twemoji.parse(escapeHTML(fname))+'</td><td class="his-field-content" title="'+when+'" style="background-color:'+color+'">'+twemoji.parse(fval)+'</td></tr>';
|
||||
var note = json.note;
|
||||
if (json.emojis) {
|
||||
var actemojick = json.emojis[0];
|
||||
} else {
|
||||
var actemojick = false;
|
||||
}
|
||||
//絵文字があれば
|
||||
if (actemojick) {
|
||||
Object.keys(json.emojis).forEach(function (key5) {
|
||||
var emoji = json.emojis[key5];
|
||||
var shortcode = emoji.shortcode;
|
||||
var emoji_url = '<img src="' + emoji.url +
|
||||
'" class="emoji-img" data-emoji="' + shortcode + '" draggable="false">';
|
||||
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||
dis_name = dis_name.replace(regExp, emoji_url);
|
||||
note = note.replace(regExp, emoji_url);
|
||||
});
|
||||
}
|
||||
//noteの解析
|
||||
//var tags = '<a onclick="tl(\'tag\',\'$1\',' + acct_id +',\'add\')" class="pointer parsed">#$1</a>';
|
||||
//var mens = '<a onclick="udgEx(\'$1\',' + acct_id +')" class="pointer parsed">@$1</a>';
|
||||
//note=note.replace(/#(\S+)/gi, tags)
|
||||
//note=note.replace(/\s@([a-zA-Z_0-9@.-]+)/gi, mens)
|
||||
$("#his-name").html(dis_name);
|
||||
$("#his-acct").text(json.acct);
|
||||
$("#his-acct").attr("fullname", fullname);
|
||||
$("#his-prof").attr("src", json.avatar);
|
||||
$('#his-data').css('background-image', 'url(' + json.header + ')');
|
||||
$("#his-sta").text(json.statuses_count);
|
||||
$("#his-follow").text(json.following_count);
|
||||
var flerc = json.followers_count;
|
||||
if (flerc < 0) {
|
||||
flerc = "-";
|
||||
}
|
||||
$("#his-follower").text(flerc);
|
||||
$("#his-since").text(crat(json.created_at));
|
||||
$("#his-openin").attr("data-href", json.url);
|
||||
if (json.fields) {
|
||||
if (json.fields.length > 0) {
|
||||
note = note + '<table id="his-field">'
|
||||
for (var i = 0; i < json.fields.length; i++) {
|
||||
var fname = json.fields[i].name;
|
||||
var fval = json.fields[i].value;
|
||||
if (json.fields[i].verified_at) {
|
||||
var when = lang.lang_showontl_verified + ":" + crat(json.fields[i].verified_at);
|
||||
var color = "rgba(121,189,154,.25);"
|
||||
} else {
|
||||
var when = "";
|
||||
var color = "inherit"
|
||||
}
|
||||
note=note+'</table>'
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
}else{
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
note = note + '<tr><td class="his-field-title">' + twemoji.parse(escapeHTML(fname)) + '</td><td class="his-field-content" title="' + when + '" style="background-color:' + color + '">' + twemoji.parse(fval) + '</td></tr>';
|
||||
}
|
||||
}else{
|
||||
note = note + '</table>'
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
} else {
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
}
|
||||
if(json.bot){
|
||||
$("#his-bot").html(lang.lang_showontl_botacct);
|
||||
}
|
||||
$("#his-des").attr("data-acct",acct_id);
|
||||
$('#his-data').css('background-size', 'cover');
|
||||
$("#his-data .tab-content").css("height",$("#his-float-timeline").height()-70+"px")
|
||||
localStorage.setItem("history" , user);
|
||||
//自分の時
|
||||
if (json.acct == localStorage.getItem("user_"+acct_id)) {
|
||||
showFav('', acct_id);
|
||||
showBlo('', acct_id);
|
||||
showMut('', acct_id);
|
||||
showDom('', acct_id);
|
||||
showReq('', acct_id);
|
||||
showFrl('', acct_id);
|
||||
$("#his-name-val").val(json.display_name);
|
||||
if(json.fields.length>0){
|
||||
if(json.fields[0]){$("#his-f1-name").val(json.fields[0].name); $("#his-f1-val").val($.strip_tags(json.fields[0].value));}
|
||||
if(json.fields[1]){$("#his-f2-name").val(json.fields[1].name); $("#his-f2-val").val($.strip_tags(json.fields[1].value));}
|
||||
if(json.fields[2]){$("#his-f3-name").val(json.fields[2].name); $("#his-f3-val").val($.strip_tags(json.fields[2].value));}
|
||||
if(json.fields[3]){$("#his-f4-name").val(json.fields[3].name); $("#his-f4-val").val($.strip_tags(json.fields[3].value));}
|
||||
}
|
||||
var des = json.note;
|
||||
des = des.replace(/<br \/>/g, "\n")
|
||||
des = $.strip_tags(des);
|
||||
$("#his-des-val").val(des);
|
||||
$("#his-follow-btn").hide();
|
||||
$("#his-block-btn").hide();
|
||||
$("#his-mute-btn").hide();
|
||||
$("#his-notf-btn").hide();
|
||||
$("#his-domain-btn").hide();
|
||||
$("#his-emp-btn").hide();
|
||||
$(".only-my-data").show();
|
||||
$(".only-his-data").hide();
|
||||
} else {
|
||||
relations(user, acct_id);
|
||||
$(".only-my-data").hide();
|
||||
$(".only-his-data").show();
|
||||
} else {
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
}
|
||||
if (json.bot) {
|
||||
$("#his-bot").html(lang.lang_showontl_botacct);
|
||||
}
|
||||
$("#his-des").attr("data-acct", acct_id);
|
||||
$('#his-data').css('background-size', 'cover');
|
||||
$("#his-data .tab-content").css("height", $("#his-float-timeline").height() - 70 + "px")
|
||||
localStorage.setItem("history", user);
|
||||
//自分の時
|
||||
if (json.acct == localStorage.getItem("user_" + acct_id)) {
|
||||
showFav('', acct_id);
|
||||
showBlo('', acct_id);
|
||||
showMut('', acct_id);
|
||||
showDom('', acct_id);
|
||||
showReq('', acct_id);
|
||||
showFrl('', acct_id);
|
||||
$("#his-name-val").val(json.display_name);
|
||||
if (json.fields.length > 0) {
|
||||
if (json.fields[0]) { $("#his-f1-name").val(json.fields[0].name); $("#his-f1-val").val($.strip_tags(json.fields[0].value)); }
|
||||
if (json.fields[1]) { $("#his-f2-name").val(json.fields[1].name); $("#his-f2-val").val($.strip_tags(json.fields[1].value)); }
|
||||
if (json.fields[2]) { $("#his-f3-name").val(json.fields[2].name); $("#his-f3-val").val($.strip_tags(json.fields[2].value)); }
|
||||
if (json.fields[3]) { $("#his-f4-name").val(json.fields[3].name); $("#his-f4-val").val($.strip_tags(json.fields[3].value)); }
|
||||
}
|
||||
var des = json.note;
|
||||
des = des.replace(/<br \/>/g, "\n")
|
||||
des = $.strip_tags(des);
|
||||
$("#his-des-val").val(des);
|
||||
$("#his-follow-btn").hide();
|
||||
$("#his-block-btn").hide();
|
||||
$("#his-mute-btn").hide();
|
||||
$("#his-notf-btn").hide();
|
||||
$("#his-domain-btn").hide();
|
||||
$("#his-emp-btn").hide();
|
||||
$(".only-my-data").show();
|
||||
$(".only-his-data").hide();
|
||||
} else {
|
||||
relations(user, acct_id);
|
||||
$(".only-my-data").hide();
|
||||
$(".only-his-data").show();
|
||||
}
|
||||
todc();
|
||||
//外部データ取得(死かもしれないので)
|
||||
udAdd(json.url);
|
||||
@@ -209,15 +209,15 @@ function udg(user, acct_id) {
|
||||
function misskeyUdg(user, acct_id) {
|
||||
reset();
|
||||
if (!user) {
|
||||
user = localStorage.getItem("user-id_"+acct_id);
|
||||
user = localStorage.getItem("user-id_" + acct_id);
|
||||
}
|
||||
todo("User Data Loading...");
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
if(localStorage.getItem("mode_" + domain)!="misskey"){
|
||||
if (localStorage.getItem("mode_" + domain) != "misskey") {
|
||||
udg(user, acct_id)
|
||||
return;
|
||||
}
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/users/show";
|
||||
fetch(start, {
|
||||
method: 'POST',
|
||||
@@ -225,113 +225,113 @@ function misskeyUdg(user, acct_id) {
|
||||
'content-type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
i:at,
|
||||
userId:user
|
||||
i: at,
|
||||
userId: user
|
||||
})
|
||||
}).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 (!localStorage.getItem("history")){
|
||||
$("#his-history-btn").prop("disabled",true);
|
||||
}else{
|
||||
$("#his-history-btn").prop("disabled",false);
|
||||
if (!localStorage.getItem("history")) {
|
||||
$("#his-history-btn").prop("disabled", true);
|
||||
} else {
|
||||
$("#his-history-btn").prop("disabled", false);
|
||||
$('#his-data').attr("history", localStorage.getItem("history"));
|
||||
}
|
||||
$('#his-data').modal('open');
|
||||
$('#his-data').attr("user-id", user);
|
||||
$('#his-data').attr("use-acct", acct_id);
|
||||
if(json.host){
|
||||
//Remote
|
||||
$('#his-data').attr("remote", "false");
|
||||
var fullname=json.username+"@"+json.host;
|
||||
}else{
|
||||
$('#his-data').attr("remote", "false");
|
||||
var fullname=json.acct+"@"+domain;
|
||||
}
|
||||
utl(json.id, '', acct_id);
|
||||
flw(json.id, '', acct_id);
|
||||
fer(json.id, '', acct_id);
|
||||
if(json.name){
|
||||
var dis_name=escapeHTML(json.name);
|
||||
dis_name=twemoji.parse(dis_name);
|
||||
}else{
|
||||
var dis_name=json.name
|
||||
}
|
||||
$("#his-name").html(dis_name);
|
||||
$("#his-acct").text(json.username);
|
||||
$("#his-acct").attr("fullname",fullname);
|
||||
$("#his-prof").attr("src", json.avatarUrl);
|
||||
$('#his-data').css('background-image', 'url(' + json.bannerUrl + ')');
|
||||
$("#his-sta").text(json.notesCount);
|
||||
$("#his-follow").text(json.followingCount);
|
||||
$("#his-follower").text(json.followersCount);
|
||||
$("#his-since").text(crat(json.createdAt));
|
||||
var note=escapeHTML(json.description);
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
if(json.isCat){
|
||||
$("#his-bot").html("Cat"+twemoji.parse("😺"));
|
||||
}
|
||||
$('#his-data').css('background-size', 'cover');
|
||||
localStorage.setItem("history" , user);
|
||||
//自分の時
|
||||
if (json.username == localStorage.getItem("user_"+acct_id) && !json.host) {
|
||||
//showFav('', acct_id);
|
||||
//showMut('', acct_id);
|
||||
//showReq('', acct_id);
|
||||
showFrl('', acct_id);
|
||||
$("#his-name-val").val(json.name);
|
||||
var des = json.note;
|
||||
des = nl2br(des)
|
||||
des = $.strip_tags(des);
|
||||
$("#his-des-val").val(des);
|
||||
$("#his-follow-btn").hide();
|
||||
$("#his-block-btn").hide();
|
||||
$("#his-mute-btn").hide();
|
||||
$("#his-notf-btn").hide();
|
||||
$("#his-domain-btn").hide();
|
||||
$("#his-emp-btn").hide();
|
||||
$(".only-my-data").show();
|
||||
$(".only-his-data").hide();
|
||||
$('#his-data').modal('open');
|
||||
$('#his-data').attr("user-id", user);
|
||||
$('#his-data').attr("use-acct", acct_id);
|
||||
if (json.host) {
|
||||
//Remote
|
||||
$('#his-data').attr("remote", "false");
|
||||
var fullname = json.username + "@" + json.host;
|
||||
} else {
|
||||
$('#his-data').attr("remote", "false");
|
||||
var fullname = json.acct + "@" + domain;
|
||||
}
|
||||
utl(json.id, '', acct_id);
|
||||
flw(json.id, '', acct_id);
|
||||
fer(json.id, '', acct_id);
|
||||
if (json.name) {
|
||||
var dis_name = escapeHTML(json.name);
|
||||
dis_name = twemoji.parse(dis_name);
|
||||
} else {
|
||||
var dis_name = json.name
|
||||
}
|
||||
$("#his-name").html(dis_name);
|
||||
$("#his-acct").text(json.username);
|
||||
$("#his-acct").attr("fullname", fullname);
|
||||
$("#his-prof").attr("src", json.avatarUrl);
|
||||
$('#his-data').css('background-image', 'url(' + json.bannerUrl + ')');
|
||||
$("#his-sta").text(json.notesCount);
|
||||
$("#his-follow").text(json.followingCount);
|
||||
$("#his-follower").text(json.followersCount);
|
||||
$("#his-since").text(crat(json.createdAt));
|
||||
var note = escapeHTML(json.description);
|
||||
$("#his-des").html(twemoji.parse(note));
|
||||
if (json.isCat) {
|
||||
$("#his-bot").html("Cat" + twemoji.parse("😺"));
|
||||
}
|
||||
$('#his-data').css('background-size', 'cover');
|
||||
localStorage.setItem("history", user);
|
||||
//自分の時
|
||||
if (json.username == localStorage.getItem("user_" + acct_id) && !json.host) {
|
||||
//showFav('', acct_id);
|
||||
//showMut('', acct_id);
|
||||
//showReq('', acct_id);
|
||||
showFrl('', acct_id);
|
||||
$("#his-name-val").val(json.name);
|
||||
var des = json.note;
|
||||
des = nl2br(des)
|
||||
des = $.strip_tags(des);
|
||||
$("#his-des-val").val(des);
|
||||
$("#his-follow-btn").hide();
|
||||
$("#his-block-btn").hide();
|
||||
$("#his-mute-btn").hide();
|
||||
$("#his-notf-btn").hide();
|
||||
$("#his-domain-btn").hide();
|
||||
$("#his-emp-btn").hide();
|
||||
$(".only-my-data").show();
|
||||
$(".only-his-data").hide();
|
||||
} else {
|
||||
if (json.isFollowing) {
|
||||
//自分がフォローしている
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_unfollow);
|
||||
hisList(user, acct_id);
|
||||
} else {
|
||||
if (json.isFollowing) {
|
||||
//自分がフォローしている
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_unfollow);
|
||||
hisList(user,acct_id);
|
||||
}else{
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
}
|
||||
if (json.isFollowed) {
|
||||
//フォローされてる
|
||||
$("#his-relation").text(lang.lang_showontl_followed);
|
||||
}
|
||||
$("#his-block-btn").hide();
|
||||
if (json.isMuted) {
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_unmute);
|
||||
}else{
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
}
|
||||
$(".only-my-data").hide();
|
||||
$(".only-his-data").show();
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
}
|
||||
if (json.isFollowed) {
|
||||
//フォローされてる
|
||||
$("#his-relation").text(lang.lang_showontl_followed);
|
||||
}
|
||||
$("#his-block-btn").hide();
|
||||
if (json.isMuted) {
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
}
|
||||
$(".only-my-data").hide();
|
||||
$(".only-his-data").show();
|
||||
}
|
||||
todc();
|
||||
});
|
||||
}
|
||||
//一つ前のユーザーデータ表示
|
||||
function historyShow(){
|
||||
var acct_id=$('#his-data').attr("use-acct");
|
||||
var user=$('#his-data').attr("history");
|
||||
function historyShow() {
|
||||
var acct_id = $('#his-data').attr("use-acct");
|
||||
var user = $('#his-data').attr("history");
|
||||
udg(user, acct_id, "true")
|
||||
}
|
||||
//選択アカウントのプロフ
|
||||
function profShow(){
|
||||
function profShow() {
|
||||
var acct_id = $("#post-acct-sel").val();
|
||||
var user = localStorage.getItem("user-id_"+acct_id);
|
||||
var user = localStorage.getItem("user-id_" + acct_id);
|
||||
udg(user, acct_id)
|
||||
hide();
|
||||
}
|
||||
@@ -339,7 +339,7 @@ function profShow(){
|
||||
//FF関係取得
|
||||
function relations(user, acct_id) {
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
var at = localStorage.getItem("acct_"+ acct_id + "_at");
|
||||
var at = localStorage.getItem("acct_" + acct_id + "_at");
|
||||
var start = "https://" + domain + "/api/v1/accounts/relationships?id=" + user;
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
@@ -347,20 +347,20 @@ function relations(user, 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 json = json[0];
|
||||
console.log(json);
|
||||
if (json.following) {
|
||||
//自分がフォローしている
|
||||
$("#his-data").addClass("following");
|
||||
$("#his-follow-btn").text(lang.lang_status_unfollow);
|
||||
hisList(user,acct_id);
|
||||
}else{
|
||||
hisList(user, acct_id);
|
||||
} else {
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
}
|
||||
if (json.followed_by) {
|
||||
@@ -370,37 +370,37 @@ function relations(user, acct_id) {
|
||||
if (json.blocking) {
|
||||
$("#his-data").addClass("blocking");
|
||||
$("#his-block-btn").text(lang.lang_status_unblock);
|
||||
}else{
|
||||
} else {
|
||||
$("#his-block-btn").text(lang.lang_status_block);
|
||||
}
|
||||
if (json.muting) {
|
||||
$("#his-data").addClass("muting");
|
||||
$("#his-mute-btn").text(lang.lang_status_unmute);
|
||||
}else{
|
||||
} else {
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
}
|
||||
if (json.muting_notifications) {
|
||||
$("#his-data").addClass("mutingNotf");
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf+lang.lang_status_unmute);
|
||||
}else{
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf+lang.lang_status_mute);
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_unmute);
|
||||
} else {
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_mute);
|
||||
}
|
||||
if (json.domain_blocking) {
|
||||
$("#his-data").addClass("blockingDom");
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain+lang.lang_status_unblock);
|
||||
}else{
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain+lang.lang_status_block);
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_unblock);
|
||||
} else {
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_block);
|
||||
}
|
||||
//Endorsed
|
||||
if(json.endorsed){
|
||||
if (json.endorsed) {
|
||||
$("#his-end-btn").addClass("endorsed");
|
||||
$("#his-end-btn").text(lang.lang_status_unendorse)
|
||||
}else{
|
||||
} else {
|
||||
$("#his-end-btn").removeClass("endorsed");
|
||||
$("#his-end-btn").text(lang.lang_status_endorse)
|
||||
}
|
||||
//Blocked
|
||||
if(json.blocked_by){
|
||||
if (json.blocked_by) {
|
||||
$("#his-float-timeline").hide();
|
||||
$("#his-float-blocked").show();
|
||||
$("#his-follow-btn").hide()
|
||||
@@ -408,9 +408,9 @@ function relations(user, acct_id) {
|
||||
|
||||
});
|
||||
}
|
||||
function profbrws(){
|
||||
const {shell} = require('electron');
|
||||
var url=$("#his-openin").attr("data-href")
|
||||
function profbrws() {
|
||||
const { shell } = require('electron');
|
||||
var url = $("#his-openin").attr("data-href")
|
||||
shell.openExternal(url);
|
||||
}
|
||||
//オールリセット
|
||||
@@ -420,7 +420,7 @@ function hisclose() {
|
||||
$('#his-data').attr("history", "");
|
||||
localStorage.removeItem("history");
|
||||
}
|
||||
function reset(){
|
||||
function reset() {
|
||||
$(".tab-content:eq(0)").show();
|
||||
$(".tab-content:gt(0)").hide();
|
||||
$(".active-back").removeClass("active-back");
|
||||
@@ -451,8 +451,8 @@ function reset(){
|
||||
$("#his-follow-btn").text(lang.lang_status_follow);
|
||||
$("#his-mute-btn").text(lang.lang_status_mute);
|
||||
$("#his-block-btn").text(lang.lang_status_block);
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf+lang.lang_status_mute);
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain+lang.lang_status_block);
|
||||
$("#his-notf-btn").text(lang.lang_showontl_notf + lang.lang_status_mute);
|
||||
$("#his-domain-btn").text(lang.lang_showontl_domain + lang.lang_status_block);
|
||||
$("#his-relation").text("");
|
||||
$(".cont-series").html("");
|
||||
$("#domainblock").val("");
|
||||
@@ -470,10 +470,10 @@ function reset(){
|
||||
$("#his-float-blocked").hide();
|
||||
$("#his-proof-prof").html("")
|
||||
}
|
||||
$('#my-data-nav .custom-tab').on('click',function(){
|
||||
var target=$(this).find("a").attr("go");
|
||||
$('#my-data-nav .custom-tab').on('click', function () {
|
||||
var target = $(this).find("a").attr("go");
|
||||
$("#my-data-nav .custom-tab").removeClass("active-back");
|
||||
$(this).addClass("active-back");
|
||||
$(target).show();
|
||||
$(".tab-content:not("+target+")").hide();
|
||||
$(".tab-content:not(" + target + ")").hide();
|
||||
});
|
Reference in New Issue
Block a user