TheDesk Riina (ver.1[fixed])

This commit is contained in:
cutls 2018-02-18 15:02:14 +09:00
parent 4588b646a9
commit 0a234d14d4
7 changed files with 106 additions and 130 deletions

View File

@ -1,14 +1,14 @@
[TheDesk](https://thedesk.top) :thedesk: Riina (ver.1) [TheDesk](https://thedesk.top) :thedesk: Riina (ver.1)
コードネーム変更です(内部verは12)。この次のコードネームはAiriです。 コードネーム変更です(内部verは12)。この次のコードネームはAiriです。
- UIを大幅刷新しています。 + UIを大幅刷新しています。
- 全体的にコンパクトになりました。もしかしたら文字サイズを下げたほうが見やすいかもしれません。 + 全体的にコンパクトになりました。もしかしたら文字サイズを下げたほうが見やすいかもしれません。
- via表示が長い場合は省略します。カーソルを合わせると全て表示します。 + via表示が長い場合は省略します。カーソルを合わせると全て表示します。
- 左下にそのトゥートの公開情報が表示されます。アイコンの説明はカーソルを合わせると確認できます。 + 左下にそのトゥートの公開情報が表示されます。アイコンの説明はカーソルを合わせると確認できます。
- トゥートの公開情報のアイコンを押すと,そのトゥートのURLがコピーされます。 + トゥートの公開情報のアイコンを押すと,そのトゥートのURLがコピーされます。
- トゥートボックスの上部の青いプロフのボタンで自分のプロフィールを確認 + トゥートボックスの上部の青いプロフのボタンで自分のプロフィールを確認
- URLスキームに対応(thedesk://) + URLスキームに対応(thedesk://)
- これによりログイン時にコードを貼り付ける必要がなくなりました。"Electronで開く"を押して下さい。 + これによりログイン時にコードを貼り付ける必要がなくなりました。"Electronで開く"を押して下さい。
- thedesk://user/?code=**ユーザーID**でユーザーデータが開きます。 + thedesk://user/?code=**ユーザーID**でユーザーデータが開きます。
- 一部バグ修正 + 一部バグ修正
:github: [cutls/TheDesk](https://github.com/cutls/TheDesk) #Desk #DeskUpdate :github: [cutls/TheDesk](https://github.com/cutls/TheDesk) #Desk #DeskUpdate

View File

@ -23,7 +23,7 @@
<script type="text/javascript" src="./js/common/keyshortcut.js"></script> <script type="text/javascript" src="./js/common/keyshortcut.js"></script>
<script type="text/javascript" src="./js/common/modal.js"></script> <script type="text/javascript" src="./js/common/modal.js"></script>
<script> <script>
var ver="Riina (ver.1)"; var ver="Riina (ver.1[fixed])";
//betaを入れるとバージョンチェックしない //betaを入れるとバージョンチェックしない
//var ver="beta"; //var ver="beta";
var acct_id=0; var acct_id=0;

View File

@ -248,7 +248,9 @@ function ckdb(acct_id) {
$("[data-activates='bbcode']").addClass("disabled", true); $("[data-activates='bbcode']").addClass("disabled", true);
} }
if (json[letters]) { if (json[letters]) {
$("#textarea").attr("data-length", json[letters]); if($("#textarea").attr("data-length")<json[letters]){
$("#textarea").attr("data-length", json[letters]);
}
} else {} } else {}
if (json[domain + "_markdown"] == "enabled") { if (json[domain + "_markdown"] == "enabled") {
localStorage.setItem("md_" + acct_id, "true"); localStorage.setItem("md_" + acct_id, "true");

View File

@ -102,10 +102,38 @@ function parseNotf(obj, popup, tlid, acct_id) {
//トゥートである //トゥートである
if (toot) { if (toot) {
if (!toot.application) { if (!toot.application) {
var via = "<i>Unknown</i>"; var via = '<span style="font-style: italic;">Unknown</span>';
} else { } else {
var via = toot.application.name; var via = toot.application.name;
} }
var sent = localStorage.getItem("sentence");
if (!sent) {
var sent = 500;
}
if (toot.spoiler_text && cw) {
var content = toot.content;
var spoil = toot.spoiler_text;
var spoiler = "cw cw_hide_" + toot.id;
var api_spoil = "gray";
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
'\')" class="nex parsed">見る</a>';
} else {
var ct = toot.content.split('</p>').length + toot.content.split('<br />').length -
2;
if (sent < ct && $.mb_strlen(toot.content) > 5) {
var content = '<span class="gray">以下全文</span><br>' + toot.content
var spoil = '<span class="cw-long-'+toot.id+'">'+$.strip_tags($.mb_substr(toot.content, 0, 100)) +
'</span><span class="gray">自動折りたたみ</span>';
var spoiler = "cw cw_hide_" + toot.id;
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
'\')" class="nex parsed">続き…</a>';
} else {
var content = toot.content;
var spoil = toot.spoiler_text;
var spoiler = "";
var spoiler_show = "";
}
}
if (toot.account.locked) { if (toot.account.locked) {
var locked = ' <i class="fa fa-lock red-text"></i>'; var locked = ' <i class="fa fa-lock red-text"></i>';
} else { } else {
@ -136,6 +164,15 @@ function parseNotf(obj, popup, tlid, acct_id) {
var spoiler = ""; var spoiler = "";
var spoiler_show = ""; var spoiler_show = "";
} }
var urls = content.match(
/https?:\/\/([-a-zA-Z0-9@.]+)\/?([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
);
if(urls){
var analyze='<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
',\''+id+'\')" class="add-show pointer">URL解析</a>';
}else{
var analyze='';
}
var viewer = ""; var viewer = "";
var youtube = ""; var youtube = "";
var emojick = toot.emojis[0]; var emojick = toot.emojis[0];
@ -169,6 +206,18 @@ function parseNotf(obj, popup, tlid, acct_id) {
}); });
} else { } else {
viewer = ""; viewer = "";
}
//公開範囲を取得
var vis="";
var visen=toot.visibility;
if(visen=="public"){
var vis = '<i class="text-darken-3 material-icons gray sml pointer" title="公開(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">public</i>';
}else if(visen=="unlisted"){
var vis = '<i class="text-darken-3 material-icons blue-text pointer" title="未収載(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">lock_open</i>';
}else if(visen=="plivate"){
var vis = '<i class="text-darken-3 material-icons orange-text pointer" title="非公開(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">lock</i>';
}else if(visen=="direct"){
var vis = '<i class="text-darken-3 material-icons red-text pointer" title="ダイレクト(クリックでトゥートURLをコピー)" onclick="tootUriCopy(\''+toot.url+'\');">mail</i>';
} }
var menck = toot.mentions[0]; var menck = toot.mentions[0];
var mentions = ""; var mentions = "";
@ -225,77 +274,53 @@ function parseNotf(obj, popup, tlid, acct_id) {
var if_rt = ""; var if_rt = "";
var rt_app = ""; var rt_app = "";
} }
templete = templete + '<div each=' + toot.datab + ' id="pub_' + toot.id + var boostback="";
'" class="cvo ' + fav_app + ' ' + rt_app + var hasmedia="";
'" style="padding-top:5px;" notf-id="' + eachobj.id + '">' + var home=""
'<span class="gray sharesta">' + noticetext + var notice = noticetext;
'<span class="cbadge right"><i class="fa fa-clock-o"></i>' + date(eachobj.created_at, templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
datetype) + '</span></span>' + boostback + ' ' + fav_app + ' ' + rt_app +
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' + ' '+ hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
'<div style="flex-basis:40px;"><a onclick="udg(\'' + toot.account.id + key].created_at, 'unix') + '">'+
'\',\'' + acct_id + '\');" user="' + toot.account.acct + '" class="udg">' + '<div class="area-notice"><span class="gray sharesta">' + noticetext + home + '</span></div>'+
'<div class="area-icon"><a onclick="udg(\'' + toot.account.id +
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
'<img src="' + toot.account.avatar + '<img src="' + toot.account.avatar +
'" width="40" class="prof-img" user="' + toot.account.acct + '" width="40" class="prof-img" user="' + toot.account.acct +
'"></a></div>' + '"></a></div>'+
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">' + '<div class="area-display_name"><span class="user">' +
toot.account.display_name + '</div>' + toot.account.display_name + '</span></div>'+
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' + '<div class="area-acct"><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
toot.account.acct + locked + '</div>' + toot.account.acct + locked + '</span><span class="cbadge right"><i class="fa fa-clock-o"></i>' + date(eachobj.created_at,
'</div>' + datetype) + '</span></div>'+
'<span class="toot ' + spoiler + '">' + content + '<div class="area-toot"><span class="toot ' + spoiler + '">' + content + '</span><span class="' +
'</span><span class="gray cw_text_' + toot.id + '">' + toot.spoiler_text + api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
spoiler_show + '</span>' + '</span>' +
'' + viewer + '' + '' + viewer + '' +
'<div class="additional"></div><span class="cbadge"><i class="fa fa-clock-o"></i>' + '<span class="additional">' + analyze + '</span></div>'+
date(toot.created_at, datetype) + '</span>' + '<div class="area-date_via">'+ mentions + tags +'</div>'+
'<span class="cbadge">via ' + via + '</span>' + mentions + tags + '<div class="area-actions" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
'<div style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; width:500px; max-width:100%; ">' + '<div class="action">'+ vis +'</div><div class="action"><a onclick="re(\'' + toot.id + '\',\'' + toot.account.acct + '\',' +
'<div><a onclick="re(\'' + toot.id + '\',\'' + toot.account.acct + '\',' +
acct_id + acct_id +
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-share"></i><help>返信</help></a></div>' + ')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-share"></i></a></div>' +
'<div><a onclick="rt(\'' + toot.id + '\',' + acct_id + '<div class="action"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 fa fa-retweet ' + ',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="text-darken-3 fa fa-retweet ' +
if_rt + '" id="rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count + if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count +
'</span><help>ブースト</help></a></div>' + '</span></a></div>' +
'<div><a onclick="fav(\'' + toot.id + '\',' + acct_id + '<div class="action"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa text-darken-3 fa-star' + ',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa text-darken-3 fa-star' +
if_fav + '" id="fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count + if_fav + ' fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count +
'<help>お気に入り</help></a></span></div>' + '</a></span></div>' +
'<div class=' + if_mine + '><a onclick="del(\'' + toot.id + '\',' + '<div class="' + if_mine + ' action"><a onclick="del(\'' + toot.id + '\',' +
acct_id + acct_id +
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-trash-o"></i><help>削除</help></a></div>' + ')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-trash-o"></i></a></div>' +
'<div><a onclick="details(\'' + toot.id + '\',' + acct_id + '<div class="action"><a onclick="details(\'' + toot.id + '\',' + acct_id +
')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i><help>詳細表示</help></a></div>' + ')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
'</div>' + '<div><span class="cbadge"><i class="fa fa-clock-o"></i>' +
'<div class="divider"></div>' + date(toot.created_at, datetype) + '</span></div>' +
'</div>' + '<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' + via +
'</div>'; '</span></div></div></div>'+
} else if (eachobj.type == "follow") { '</div><div class="divider"></div>';
//フォロー等のユーザーデータである
var tooter = eachobj.account;
if (tooter.locked) {
var locked = ' <i class="fa fa-lock red-text"></i>';
} else {
var locked = "";
}
templete = templete +
'<div class="cvo " style="padding-top:5px;" notf-id=' + eachobj.id + '>' +
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-end;">' +
'<div style="flex-basis:40px;"><a onclick="udg(\'' + tooter.id + '\',\'' +
acct_id + '\');" user="' + tooter.acct + '" class="udg">' +
'<img src="' + tooter.avatar + '" width="40" class="prof-img" user="' +
tooter.acct + '"></a></div>' +
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">' +
tooter.display_name + '<div class="gray sharesta">にフォローされました</div></div>' +
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
tooter.acct + locked + '</div>' +
'</div>' +
'<div style="justify-content:space-around"> <div class="cbadge">Follows:' +
tooter.following_count + '</div><div class="cbadge">Followers:' + tooter.followers_count +
'</div>' +
'<div class="divider"></div>' +
'</div>' +
'</div>';
var noticetext = eachobj.account.display_name + "(" + eachobj.account.acct + var noticetext = eachobj.account.display_name + "(" + eachobj.account.acct +
")がフォローしました"; ")がフォローしました";
if (popup >= 0 && obj.length < 5) { if (popup >= 0 && obj.length < 5) {

View File

@ -219,57 +219,6 @@ function parse(obj, mix, acct_id) {
'<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' + via + '<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' + via +
'</span></div></div></div>'+ '</span></div></div></div>'+
'</div><div class="divider"></div>'; '</div><div class="divider"></div>';
/*
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
boostback + ' ' + fav_app + ' ' + rt_app +
' '+ hasmedia + '" style="padding-top:5px;" toot-id="' + id + '" unixtime="' + date(obj[
key].created_at, 'unix') + '">' +
'<span class="gray sharesta">' + notice + home + '</span>' +
'<div style="padding:0; margin:0; width:400px; max-width:100%; display:flex; align-items:flex-start;">' +
'<div style="flex-basis:40px;"><a onclick="udg(\'' + toot.account.id +
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
'<img src="' + toot.account.avatar +
'" width="40" class="prof-img" user="' + toot.account.acct +
'"></a></div><div>' +
'<div style="flex-grow:3; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"><span class="user">' +
toot.account.display_name + '</span></div>' +
'<div class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
toot.account.acct + locked + '</div>' +
'' +
'<div style="display:none; justify-content:space-around" class="sml gray"> <div>Follows:' +
toot.account.following_count + '</div><div>Followers:' + toot.account.followers_count +
'</div>' +
'<div>Toots:' + toot.account.statuses_count + '</div></div>' +
'<span class="toot ' + spoiler + '">' + content + '</span><span class="' +
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
'</span>' +
'' + viewer + '' +
'<div class="additional">' + analyze + '</div><span class="cbadge"><i class="fa fa-clock-o"></i>' +
date(toot.created_at, datetype) + '</span>' +
'<span class="cbadge">via ' + via +
'</span>' + mentions + tags +
'<div style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; width:500px; max-width:100%; ">' +
'<div><a onclick="re(\'' + toot.id + '\',\'' + toot.account.acct + '\',' +
acct_id +
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-share"></i></a></div>' +
'<div><a onclick="rt(\'' + toot.id + '\',' + acct_id +
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><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><a onclick="fav(\'' + toot.id + '\',' + acct_id +
',\''+tlid+'\')" class="waves-effect waves-dark btn-flat" style="padding:0"><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 + '><a onclick="del(\'' + toot.id + '\',' +
acct_id +
')" class="waves-effect waves-dark btn-flat" style="padding:0"><i class="fa fa-trash-o"></i></a></div>' +
'<div><a onclick="details(\'' + toot.id + '\',' + acct_id +
')" class="waves-effect waves-dark btn-flat details" style="padding:0"><i class="text-darken-3 material-icons">more_vert</i></a></div>' +
'</div></div>' +
'<div class="divider"></div>' +
'</div>' +
'</div>';
*/
}); });
if (mix == "mix") { if (mix == "mix") {
return [templete, local] return [templete, local]

View File

@ -1,6 +1,6 @@
{ {
"name": "TheDesk", "name": "TheDesk",
"version": "12.1.0", "version": "12.1.1",
"description": "TheDesk on Mastodonはシンプルと多機能を両立したデスクトップ向けクライアントです", "description": "TheDesk on Mastodonはシンプルと多機能を両立したデスクトップ向けクライアントです",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {

View File

@ -1 +1 @@
{"desk":"Riina (ver.1)","date":"2018-02-18","detail":"内部V:12.0.0|14:UI大幅変更。バグ修正。URLスキーム対応。詳しくはGitHubを参照。"} {"desk":"Riina (ver.1[fixed])","date":"2018-02-18","detail":"内部V:12.1.1|[fixed]:バグ修正/UI大幅変更。バグ修正。URLスキーム対応。詳しくはGitHubを参照。"}