TheDesk Mio (15.6.0)

This commit is contained in:
cutls
2018-06-12 00:44:28 +09:00
parent f4ec593e26
commit cc95b26cdb
75 changed files with 779 additions and 3871 deletions

View File

@@ -370,3 +370,45 @@ function showDom(more, acct_id) {
});
}
//ユーザーマッチングリスト
function showMat() {
$("#his-matching-list-contents").html("30秒から数分かかります");
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-api.cgi?"+full[1]+"+" + full[0];
console.log(start);
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) {
console.log(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>';
});
$("#his-matching-list-contents").html(templete);
});
}

View File

@@ -15,7 +15,7 @@ function profedit() {
httpreq.responseType = 'json';
httpreq.send(JSON.stringify({
display_name: name,
note: des
note: des,
}));
httpreq.onreadystatechange = function() {
if (httpreq.readyState == 4) {

View File

@@ -63,6 +63,7 @@ function udg(user, acct_id) {
todo(error);
console.error(error);
}).then(function(json) {
console.log(json);
//一つ前のユーザーデータ
if (!localStorage.getItem("history")){
$("#his-history-btn").prop("disabled",true);
@@ -134,6 +135,9 @@ function udg(user, acct_id) {
}else{
$("#his-des").html(json.note);
}
if(json.bot){
$("#his-bot").html("botアカウント");
}
$('#his-data').css('background-size', 'cover');
localStorage.setItem("history" , user);
//自分の時
@@ -144,6 +148,10 @@ function udg(user, acct_id) {
showDom('', acct_id);
showReq('', acct_id);
$("#his-name-val").val(json.display_name);
$("#his-f1-name").val(json.fields[0].name); $("#his-f1-val").val($.strip_tags(json.fields[0].value));
$("#his-f2-name").val(json.fields[1].name); $("#his-f2-val").val($.strip_tags(json.fields[1].value));
$("#his-f3-name").val(json.fields[2].name); $("#his-f3-val").val($.strip_tags(json.fields[2].value));
$("#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);
@@ -158,7 +166,6 @@ function udg(user, acct_id) {
$(".only-his-data").hide();
} else {
relations(user, acct_id);
hisList(user,acct_id);
$(".only-my-data").hide();
$(".only-his-data").show();
}
@@ -203,6 +210,7 @@ function relations(user, acct_id) {
//自分がフォローしている
$("#his-data").addClass("following");
$("#his-follow-btn").text("フォロー解除");
hisList(user,acct_id);
}else{
$("#his-follow-btn").text("フォロー");
}
@@ -248,6 +256,8 @@ function hisclose() {
function reset(){
$(".tab-content:eq(0)").show();
$(".tab-content:gt(0)").hide();
$(".active-back").removeClass("active-back");
$(".column-first").addClass("active-back");
$("#his-name").text("Loading");
$("#his-acct").text("");
$("#his-prof").attr("src", "./img/loading.svg");
@@ -263,6 +273,7 @@ function reset(){
$("#his-data").removeClass("blocking");
$("#his-data").removeClass("mutingNotf");
$("#his-data").removeClass("blockingDom");
$("#his-bot").html("");
$("#his-follow-btn").show();
$("#his-block-btn").show();
$("#his-mute-btn").show();
@@ -277,6 +288,14 @@ function reset(){
$("#his-relation").text("");
$(".cont-series").html("");
$("#domainblock").val("");
$("#his-lists-a").html('リストに追加するためにはフォローが必要です。');
$("#his-lists-b").html('');
$("#his-name-val").val("");
$("#his-des-val").val("");
$("#his-f1-name").val(""); $("#his-f1-val").val("");
$("#his-f2-name").val(""); $("#his-f2-val").val("");
$("#his-f3-name").val(""); $("#his-f3-val").val("");
$("#his-f4-name").val(""); $("#his-f4-val").val("");
}
$('#my-data-nav .custom-tab').on('click',function(){
var target=$(this).find("a").attr("go");