TheDesk Riina (ver.6)

This commit is contained in:
cutls
2018-02-25 16:21:13 +09:00
parent 5624266f30
commit 6d31d2e3c4
15 changed files with 74 additions and 63 deletions

View File

@@ -59,7 +59,7 @@ function crat(str) {
format_str = 'YYYY-MM-DD hh:mm:ss';
format_str = format_str.replace(/YYYY/g, date.getFullYear());
format_str = format_str.replace(/MM/g, date.getMonth());
format_str = format_str.replace(/MM/g, date.getMonth()+1);
format_str = format_str.replace(/DD/g, date.getDate());
format_str = format_str.replace(/hh/g, date.getHours());
format_str = format_str.replace(/mm/g, date.getMinutes());

View File

@@ -145,7 +145,7 @@ function mixre(acct_id, tlid) {
}
localStorage.setItem("pool", pool);
} else {
$("#timeline_" + tlid).prepend(templete);
$("#timeline_" + tlid).before(templete);
}
additional(acct_id, tlid);
jQuery("time.timeago").timeago();
@@ -203,7 +203,7 @@ function mixmore(tlid) {
console.error(error);
}).then(function(obj) {
if (!$("[toot-id=" + obj[0].id + "]").length) {
$("#timeline_" + tlid + " .cvo").first().prepend(parse([obj[0]], 'home',
$("#timeline_" + tlid + " .cvo").first().before(parse([obj[0]], 'home',
acct_id));
}
Object.keys(obj).forEach(function(key) {
@@ -217,7 +217,7 @@ function mixmore(tlid) {
if (!$("[toot-id=" + toot.id + "]").length) {
if (key2 > tarunix) {
var local = locals[key2];
$("[toot-id=" + local + "]").append(parse([toot], 'home',
$("[toot-id=" + local + "]").after(parse([toot], 'home',
acct_id));
tarunix = 0;
}

View File

@@ -320,7 +320,7 @@ function parseNotf(obj, popup, tlid, acct_id) {
'"></a></div>' +
'<div class="area-display_name"><span class="user">' +
toot.account.display_name +
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;cursor:text;"> @' +
toot.account.acct + locked + '</span></div>' +
'<div class="area-acct"><div><span class="cbadge pointer" onclick="tootUriCopy(\'' + toot.url +
'\');" title="' + date(toot.created_at, 'absolute') +

View File

@@ -214,7 +214,7 @@ function parse(obj, mix, acct_id) {
'"></a></div>' +
'<div class="area-display_name"><span class="user">' +
toot.account.display_name +
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
'</span><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; cursor:text;"> @' +
toot.account.acct + locked + '</span></div>' +
'<div class="area-acct"><div><span class="cbadge pointer" onclick="tootUriCopy(\'' +
toot.url + '\');" title="' + date(toot.created_at, 'absolute') +
@@ -295,9 +295,9 @@ function userparse(obj, auth, acct_id, notf) {
acct_id + ');" user="' + toot.acct + '" class="udg">' +
'<img src="' + toot.avatar + '" width="40" class="prof-img" user="' + toot
.acct + '"></a></div>' +
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"><big>' +
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"><big>' +
toot.display_name + '</big></div>' +
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;user-select:auto; cursor:text;"> @' +
toot.acct + locked + '</div>' +
'</div>' + auth +
'<div style="justify-content:space-around"> <div class="cbadge" style="width:100px;">Follows:' +

View File

@@ -62,7 +62,7 @@
Object.keys(obj).forEach(function(key) {
var acct = obj[key];
var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key +
'"><div class="notice-box">'+
'"><div class="notice-box z-depth-2">'+
'<div class="area-notice"><i class="material-icons" id="notice_icon_' + key + '" style="font-size:40px; padding-top:25%;"></i></div>'+
'<div class="area-notice_name"><span id="notice_' + key + '"" class="tl-title"></span></div>'+
'<div class="area-a1"><a onclick="notfToggle(' + acct.domain + ',' + key +

View File

@@ -25,9 +25,10 @@ function scrollck() {
}
}
//続きを読むトリガー
var scrt = $(this).find(".tl").height() - 1000;
var scrt = $(this).find(".tl").height() - 1500;
var scr = $(this).scrollTop();
if (scr > scrt) {
console.log("続き")
moreload('', tlid);
}
});

View File

@@ -71,7 +71,7 @@ function flw(user, more, acct_id) {
todo(error);
console.error(error);
}).then(function(json) {
var templete = userparse(json);
var templete = userparse(json,'',acct_id);
if (more) {
$("#his-follow-list-contents").append(templete);
} else {
@@ -112,7 +112,7 @@ function fer(user, more, acct_id) {
todo(error);
console.error(error);
}).then(function(json) {
var templete = userparse(json);
var templete = userparse(json,'',acct_id);
if (more) {
$("#his-follower-list-contents").append(templete);
} else {
@@ -149,7 +149,7 @@ function showFav(more, acct_id) {
todo(error);
console.error(error);
}).then(function(json) {
var templete = parse(json);
var templete = parse(json, '', acct_id);
if (more) {
$("#his-fav-list-contents").append(templete);
} else {
@@ -185,7 +185,7 @@ function showMut(more, acct_id) {
todo(error);
console.error(error);
}).then(function(json) {
var templete = userparse(json);
var templete = userparse(json,'',acct_id);
if (more) {
$("#his-muting-list-contents").append(templete);
} else {
@@ -221,7 +221,7 @@ function showBlo(more, acct_id) {
todo(error);
console.error(error);
}).then(function(json) {
var templete = userparse(json);
var templete = userparse(json,'',acct_id);
if (more) {
$("#his-blocking-list-contents").append(templete);
} else {
@@ -257,7 +257,7 @@ function showReq(more, acct_id) {
todo(error);
console.error(error);
}).then(function(json) {
var templete = userparse(json, 'true');
var templete = userparse(json, 'true',acct_id);
if (more) {
$("#his-request-list-contents").append(templete);
} else {

View File

@@ -10,6 +10,7 @@ if(location.search){
}
}
function udg(user, acct_id) {
reset();
if (!user) {
user = localStorage.getItem("user-id_"+acct_id);
console.log(user);
@@ -18,6 +19,7 @@ function udg(user, acct_id) {
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem(domain + "_at");
var start = "https://" + domain + "/api/v1/accounts/" + user;
console.log(start);
fetch(start, {
method: 'GET',
headers: {
@@ -41,8 +43,9 @@ function udg(user, acct_id) {
if (json.moved) {
Materialize.toast(
'このアカウントは移行します<button class="btn-flat toast-action" onclick="udg(\"' +
json.moved + '\")">移行先を見る</button>', 4000)
json.moved + ','+acct_id+'\")">移行先を見る</button>', 4000)
} else {
$('#his-data').modal('open');
$('#his-data').attr("user-id", user);
$('#his-data').attr("use-acct", acct_id);
if(json.username!=json.acct){
@@ -51,6 +54,9 @@ function udg(user, acct_id) {
}else{
$('#his-data').attr("remote", "false");
}
utl(json.id, '', acct_id);
flw(json.id, '', acct_id);
fer(json.id, '', acct_id);
$("#his-name").text(json.display_name);
$("#his-acct").text(json.acct);
$("#his-prof").attr("src", json.avatar);
@@ -58,38 +64,33 @@ function udg(user, acct_id) {
$("#his-sta").text(json.statuses_count);
$("#his-follow").text(json.following_count);
$("#his-follower").text(json.followers_count);
$("#his-des").html(json.note);
$('#his-data').modal('open');
utl(json.id, '', acct_id);
flw(json.id, '', acct_id);
fer(json.id, '', acct_id);
$('ul.tabs').tabs();
$('#his-data').css('background-size', 'cover');
$("#his-since").text(crat(json.created_at));
$("#his-des").html(json.note);
$('#his-data').css('background-size', 'cover');
localStorage.setItem("history" , user);
}
//自分の時
if (json.acct == localStorage.getItem("user_"+acct_id)) {
$("#his-name-val").val(json.display_name);
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();
$("#my-data-nav").show();
$("#his-data-nav").hide();
//自分の時
if (json.acct == localStorage.getItem("user_"+acct_id)) {
showFav('', acct_id);
showBlo('', acct_id);
showMut('', acct_id);
showDom('', acct_id);
showReq('', acct_id);
$("#his-name-val").val(json.display_name);
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();
$("#my-data-nav").show();
$("#his-data-nav").hide();
} else {
relations(user, acct_id);
}
$('ul.tabs').tabs('select_tab', 'his-tl');
showFav('', acct_id);
showBlo('', acct_id);
showMut('', acct_id);
showDom('', acct_id);
showReq('', acct_id);
} else {
relations(user, acct_id);
}
todc();
});
@@ -169,6 +170,11 @@ function relations(user, acct_id) {
//オールリセット
function hisclose() {
$('#his-data').modal('close');
reset();
$('#his-data').attr("history", "");
localStorage.removeItem("history");
}
function reset(){
$("#his-name").text("Loading");
$("#his-acct").text("");
$("#his-prof").attr("src", "./img/loading.svg");
@@ -199,6 +205,4 @@ function hisclose() {
$("#his-data-nav").show();
$(".cont-series").html("");
$("#domainblock").val("");
$('#his-data').attr("history", "");
localStorage.removeItem("history");
}
}