Skip to content

Commit

Permalink
TheDesk Airi (ver.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
cutls committed Mar 21, 2018
1 parent d6acb0b commit a84a1da
Show file tree
Hide file tree
Showing 20 changed files with 214 additions and 84 deletions.
16 changes: 8 additions & 8 deletions LATEST.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
## For Astarte(kirishima.cloud), My Primary Instance

TheDesk :thedesk: Airi (ver.7)
TheDesk :thedesk: Airi (ver.8)
・バグフィックス
カスタム絵文字検索
Pleroma暫定対応(投稿・表示のみ。)
個別インスタンスの対応
UI改善
キーボードショートカット追加・変更
他垢からふぁぼ・フォローなどが可能に
https://thedesk.top
:github: https://github.com/cutls/TheDesk #Desk #DeskUpdate

## For Vanilla Instances

Windows/LinuxクライアントTheDesk Airi (ver.7)リリース
Windows/LinuxクライアントTheDesk Airi (ver.8)リリース
・バグフィックス
カスタム絵文字検索
Pleroma暫定対応(投稿・表示のみ。)
個別インスタンスの対応
UI改善
キーボードショートカット追加・変更
他垢からふぁぼ・フォローなどが可能に
TheDeskはマルチカラム,マルチアカウントはもちろんのこと,なにかとマストドンライフをシンプルに効率化するクライアントです。
https://thedesk.top
3 changes: 2 additions & 1 deletion app/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</head>
<body>
<h1>503 Service Unavailable</h1>
TheDeskは2017年12月30日 23:59に終了したCroudiaというSNSのクライアントから始まりました。<br>
<u>4月1日</u>よりTheDeskはCroudiaクライアントとして生まれ変わりました。<br><br><br><br>
TheDeskは2017年12月30日 23:59に終了したCroudiaというSNSのクライアントから始まりました。(Since 2016-5 as CroudiaDeck)<br>
<a onclick="localStorage.setItem('sincere','true'); location.href='index.html';" style="cursor:pointer;">TheDeskに戻る</a>
</body>
56 changes: 40 additions & 16 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<script type="text/javascript" src="./js/ui/jquery-ui.min.js"></script>
<script>
//必ずアプデ時のremove instance消して!
var ver="Airi (ver.7)";
var ver="Airi (ver.8)";
//betaを入れるとバージョンチェックしない
//var ver="beta";
var acct_id=0;
Expand Down Expand Up @@ -166,7 +166,7 @@
</div>
<div class="small-menu">
<a href="setting.html" class="nex waves-effect">
<i class="material-icons nex" title="設定" data-trans-title="setting">settings</i>
<i class="material-icons nex" title="設定(Ctrl+Shift+S)" data-trans-title="setting">settings</i>
<span class="side-label" data-trans="setting">設定</span>
</a>
</div>
Expand All @@ -190,7 +190,7 @@
</div>
<div class="small-menu">
<a href="acct.html" class="nex waves-effect">
<i class="material-icons" title="アカウントマネージャー" data-trans-title="manager">account_circle</i>
<i class="material-icons" title="アカウントマネージャー(Ctrl+Shift+M)" data-trans-title="manager">account_circle</i>
<span class="side-label" data-trans="manager_short">管理</span>
</a>
</div>
Expand Down Expand Up @@ -224,7 +224,7 @@
</span>
<br>
<a id="clear" class="setting nex waves-effect">
<i class="material-icons nex mize" title="トゥートボックスのクリア" data-trans-title="post_box_clear">clear</i>
<i class="material-icons nex mize" title="トゥートボックスのクリア(Ctrl+Shit+C)" data-trans-title="post_box_clear">clear</i>
</a>
<a onclick="zoomBox()" class="setting nex waves-effect">
<i class="material-icons nex mize" title="ボックスの拡大・縮小(E)" data-trans-title="post_box_zoom">zoom_out_map</i>
Expand All @@ -236,7 +236,7 @@
</div>
<span id="radio-sta" class="radio"></span>
<div id="radio-view" class="hide radio mize">
<a onclick="nowplaying()" class="pointer"><i class="fa fa-spotify"></i>NowPlaying</a>
<a onclick="nowplaying()" class="pointer" title="Ctrl+Shift+N"><i class="fa fa-spotify"></i>NowPlaying</a>
<span class="cbadge pointer waves-effect" onclick="Rplay('https://listen.moe/stream','Listen.moe')" data-name="Listen.moe">Listen.moe</span>
<span class="cbadge pointer waves-effect" onclick="Rplay('http://itori.animenfo.com:443/;','AnimeNfo Radio')" data-name="AnimeNfo Radio">AnimeNfo Radio</span>
<span class="cbadge pointer waves-effect" onclick="Rplay('http://hyades.shoutca.st:8043/stream','LoFi hip hop Radio')" data-name="LoFi hip hop Radio">LoFi hip hop Radio</span>
Expand All @@ -263,7 +263,7 @@
</div>
<div class="mize" style="float:left;">
<a onclick="profShow()" style="vertical-align:-1.5rem;">
<i class="material-icons nex pointer mize waves-effect" title="選択中のプロフィール表示" data-trans-title="post_box_prof">account_circle</i>
<i class="material-icons nex pointer mize waves-effect" title="選択中のプロフィール表示(Ctrl+Shift+P)" data-trans-title="post_box_prof">account_circle</i>
</a>
</div>
<!--Markdown-->
Expand Down Expand Up @@ -320,6 +320,7 @@
<span class="sml gray pointer more-show anti-markdown hide mize">
<a onclick="mdToggle()">Markdownエディタを表示</a>
</span>

<br>
<span id="suggest"></span>
</div>
Expand Down Expand Up @@ -483,6 +484,21 @@
</div>
</li>
</ul>
他のアカウントを使用(<i class="fa fa-retweet"></i>/<i class="fa fa-star"></i>の解除はできません)<br>
<div class="row">
<div class="col s4">
<select id="status-acct-sel" class="acct-sel"></select>
</div>
<div class="col s2">
<button class="dropdown-button btn waves-effect" style="width:100%;" onclick="staEx('reply')"><i class="fa fa-share left"></i>返信</button>
</div>
<div class="col s2">
<button class="dropdown-button btn waves-effect indigo" style="width:100%;" onclick="staEx('rt')"><i class="fa fa-retweet left"></i>ブースト</button>
</div>
<div class="col s3">
<button class="dropdown-button btn waves-effect orange" style="width:100%;" onclick="staEx('fav')"><i class="fa fa-star left"></i>お気に入り登録</button>
</div>
</div>
<div id="toot-tools">
</div>
<div id="toot-after">
Expand Down Expand Up @@ -526,31 +542,34 @@
<div class="col s12" id="my-data-nav">
<ul class="custom-tabs transparent">
<li class="custom-tab col my-data-width active-back">
<a go="#his-tl">Timeline</a>
<a go="#his-tl">タイムライン</a>
</li>
<li class="custom-tab col my-data-width">
<a go="#his-follow-list">Follows</a>
<a go="#his-follow-list">フォロー</a>
</li>
<li class="custom-tab col my-data-width">
<a go="#his-follower-list">Followers</a>
<a go="#his-follower-list">フォロワー</a>
</li>
<li class="custom-tab col my-data-width only-his-data">
<a go="#his-action">他アカウントで操作</a>
</li>
<li class="custom-tab col my-data-width only-my-data">
<a go="#his-fav-list">Favorites</a>
<a go="#his-fav-list">お気に入り登録</a>
</li>
<li class="custom-tab col my-data-width only-my-data">
<a go="#his-blocking-list">Blocking</a>
<a go="#his-blocking-list">ブロック</a>
</li>
<li class="custom-tab col my-data-width only-my-data">
<a go="#his-muting-list">Muting</a>
<a go="#his-muting-list">ミュート</a>
</li>
<li class="custom-tab col my-data-width only-my-data">
<a go="#his-domain-list">Domain Blocking</a>
<a go="#his-domain-list">ドメインブロック</a>
</li>
<li class="custom-tab col my-data-width only-my-data">
<a go="#his-prof-list">Edit Profile</a>
<a go="#his-prof-list">プロフィール編集</a>
</li>
<li class="custom-tab col my-data-width only-my-data">
<a go="#his-request-list">Follow Request</a>
<a go="#his-request-list">フォローリクエスト</a>
</li>
</ul>
</div>
Expand All @@ -564,11 +583,16 @@
</div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="flw('--now','more')">もっと</button>
</div>
<div id="his-follower-list" class="col s12 tab-content">
<div id="his-follower-list" class="col s12 tab-content">
<div id="his-follower-list-contents" class="cont-series">
</div>
<button class="btn waves-effect " style="width:100%; padding:0;" onclick="fer('--now','more')">もっと</button>
</div>
<div id="his-action" class="col s12 tab-content">
他のアカウントを使用してフォロー(解除はできません)<br>
<div style="max-width:500px;"><select id="user-acct-sel" class="acct-sel"></select></div>
<a href="#!" class="waves-effect btn" onclick="follow('selector','true')">フォロー</a>
</div>
<div id="his-fav-list" class="col s12 tab-content">
<div id="his-fav-list-contents" class="cont-series">
</div>
Expand Down
36 changes: 32 additions & 4 deletions app/js/common/keyshortcut.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ $(function($) {
}
}
}
//Ctrl+Sift+C:全消し
if (event.ctrlKey && event.shiftKey) {
if (e.keyCode === 67) {
clear();
return false;
}
}
//Ctrl+Sift+N:NowPlaying
if (event.ctrlKey && event.shiftKey) {
if (e.keyCode === 78) {
nowplaying()
return false;
}
}
//input/textareaにフォーカスなし時
if (!hasFocus && !hasFocus2) {
//X:開閉
Expand Down Expand Up @@ -74,10 +88,24 @@ $(function($) {
return false;
}
}
//Sift+C:全消し
if (event.shiftKey) {
if (e.keyCode === 67) {
clear();
//Ctrl+Sift+S:設定
if (event.ctrlKey && event.shiftKey) {
if (e.keyCode === 83) {
location.href = "setting.html";
return false;
}
}
//Ctrl+Sift+M:アカマネ
if (event.ctrlKey && event.shiftKey) {
if (e.keyCode === 77) {
location.href = "acct.html";
return false;
}
}
//Ctrl+Sift+P:プロフ
if (event.ctrlKey && event.shiftKey) {
if (e.keyCode === 80) {
profShow()
return false;
}
}
Expand Down
5 changes: 3 additions & 2 deletions app/js/login/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,10 @@ function multi() {
'" class="left circle" ' + sel + '>' + acct.user + '@' + acct.domain +
'</option>';
$(".acct-sel").append(templete);
$("#src-acct-sel").append('<option value="tootsearch">Tootsearch</option>');
$('select').material_select('update');

});
$("#src-acct-sel").append('<option value="tootsearch">Tootsearch</option>');
$('select').material_select('update');
}

//バージョンエンコ
Expand Down
2 changes: 1 addition & 1 deletion app/js/platform/end.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ function nano(){
var electron = require("electron");
var ipc = electron.ipcRenderer;
ipc.send('nano', "");
}
}
4 changes: 2 additions & 2 deletions app/js/post/bb-md.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function mdCheck(){
}
var domain = localStorage.getItem("domain_" + acct_id);
if(domain=="mstdn.y-zu.org"){
//$("#private-button").text("限定公開(Yづドン!)");
$("#private-button").text("限定公開(Yづドン!)");
}else{
//$("#private-button").text("非公開(Private)");
$("#private-button").text("非公開(Private)");
}
}
//BOXのトグルボタン
Expand Down
2 changes: 1 addition & 1 deletion app/js/post/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function post() {
var nsfw = "false";
}
var vis = $("#vis").text();
if(vis!="public"){
if(vis!="inherit"){
toot.visibility=vis;
}
if ($("#cw").hasClass("cw-avail")) {
Expand Down
7 changes: 7 additions & 0 deletions app/js/post/reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@ function re(id,at,acct_id,mode){
$('select').material_select();
$("#textarea").attr("placeholder","返信モードです。クリアするときはShift+Cを押してください。");
vis(mode);
}
function reEx(id){
$('#tootmodal').modal('close');
var at=$("#tootmodal").attr("data-user");
var acct_id = $("#status-acct-sel").val();
var mode=$("#tootmodal .vis-data").attr("data-vis");
re(id,at,acct_id,mode);
}
57 changes: 50 additions & 7 deletions app/js/post/status.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//お気に入り登録やブースト等、フォローやブロック等
//お気に入り登録
function fav(id, acct_id) {
function fav(id, acct_id, remote) {
if ($("#pub_" + id).hasClass("faved")) {
var flag = "unfavourite";
} else {
Expand All @@ -23,6 +23,7 @@ function fav(id, acct_id) {
console.error(error);
}).then(function(json) {
console.log(json);
if(!remote){
//APIのふぁぼカウントがおかしい
if ($("[toot-id=" + id + "] .fav_ct").text() == json.favourites_count){
if(flag=="unfavourite"){
Expand All @@ -46,11 +47,14 @@ function fav(id, acct_id) {
$("[toot-id=" + id +"]").addClass("faved");
$(".fav_" + id).addClass("yellow-text");
}
}else{
Materialize.toast("お気に入り登録しました。インスタンスが違うときは時間がかかる場合があります。", 1000);
}
});
}

//ブースト
function rt(id, acct_id) {
function rt(id, acct_id, remote) {
if ($("#pub_" + id).hasClass("rted")) {
var flag = "unreblog";
} else {
Expand All @@ -73,6 +77,7 @@ function rt(id, acct_id) {
console.error(error);
}).then(function(json) {
console.log(json);
if(!remote){
$("[toot-id=" + id + "] .fav_ct").text(json.favourites_count);
if (!json.reblog) {
if(flag=="unreblog"){
Expand All @@ -92,21 +97,28 @@ function rt(id, acct_id) {
$("[toot-id=" + id +"]").addClass("rted");
$(".rt_" + id).addClass("teal-text");
}
}else{
Materialize.toast("ブーストしました。インスタンスが違うときは時間がかかる場合があります。", 1000);
}
});
}

//フォロー
function follow(acct_id) {
if (!acct_id) {
function follow(acct_id,remote) {
if (!acct_id && acct_id!="selector") {
var acct_id = $('#his-data').attr("use-acct");
}else if (acct_id=="selector") {
var acct_id = $("#user-acct-sel").val();
}
var id = $("#his-data").attr("user-id");
var remote = $("#his-data").attr("remote");
if ($("#his-data").hasClass("following")) {
if (!remote && $("#his-data").hasClass("following")) {
var flag = "unfollow";
} else {
var flag = "follow";
}
var id = $("#his-data").attr("user-id");
if(!remote){
var remote = $("#his-data").attr("remote");
}
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem(domain + "_at");
if(remote=="true" && flag=="follow"){
Expand Down Expand Up @@ -352,4 +364,35 @@ function empUser(){
function tootUriCopy(url){
execCopy(url);
Materialize.toast("トゥートURLをコピーしました", 1500);
}

//他のアカウントで…
function staEx(mode){
var url=$("#tootmodal").attr("data-url");
var acct_id = $("#status-acct-sel").val();
var domain = localStorage.getItem("domain_" + acct_id);
var at = localStorage.getItem(domain + "_at");
var start = "https://" + domain + "/api/v1/search?resolve=true&q="+url
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) {
var id=json.statuses[0].id;
if(mode=="rt"){
rt(id, acct_id, 'remote')
}else if(mode=="fav"){
fav(id, acct_id, 'remote')
}else if(mode=="reply"){
reEx(id)
}
});
return;
}

0 comments on commit a84a1da

Please sign in to comment.