TheDesk Airi (ver.7)
This commit is contained in:
parent
d689438b23
commit
d6acb0bebc
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
*.bat
|
*.bat
|
||||||
*.zip
|
*.zip
|
||||||
|
*.7z
|
||||||
/TheDesk*/
|
/TheDesk*/
|
16
LATEST.md
16
LATEST.md
|
@ -1,19 +1,19 @@
|
||||||
## For Astarte(kirishima.cloud), My Primary Instance
|
## For Astarte(kirishima.cloud), My Primary Instance
|
||||||
|
|
||||||
TheDesk :thedesk: Airi (ver.6)
|
TheDesk :thedesk: Airi (ver.7)
|
||||||
・Tootsearchでトゥート検索(β)
|
|
||||||
・バグフィックス
|
・バグフィックス
|
||||||
【重要】このアップデートは以下の理由で推奨されます。
|
・カスタム絵文字検索
|
||||||
・脆弱性の修正
|
・Pleroma暫定対応(投稿・表示のみ。)
|
||||||
|
・個別インスタンスの対応
|
||||||
https://thedesk.top
|
https://thedesk.top
|
||||||
:github: https://github.com/cutls/TheDesk #Desk #DeskUpdate
|
:github: https://github.com/cutls/TheDesk #Desk #DeskUpdate
|
||||||
|
|
||||||
## For Vanilla Instances
|
## For Vanilla Instances
|
||||||
|
|
||||||
Windows/LinuxクライアントTheDesk Airi (ver.66)リリース
|
Windows/LinuxクライアントTheDesk Airi (ver.7)リリース
|
||||||
・Tootsearchでトゥート検索(β)
|
|
||||||
・バグフィックス
|
・バグフィックス
|
||||||
【重要】このアップデートは以下の理由で推奨されます。
|
・カスタム絵文字検索
|
||||||
・脆弱性の修正
|
・Pleroma暫定対応(投稿・表示のみ。)
|
||||||
|
・個別インスタンスの対応
|
||||||
TheDeskはマルチカラム,マルチアカウントはもちろんのこと,なにかとマストドンライフをシンプルに効率化するクライアントです。
|
TheDeskはマルチカラム,マルチアカウントはもちろんのこと,なにかとマストドンライフをシンプルに効率化するクライアントです。
|
||||||
https://thedesk.top
|
https://thedesk.top
|
|
@ -31,7 +31,7 @@ body,html{overflow-y: scroll;}
|
||||||
<input type="text" id="url" style="width:70%" placeholder="mstdn.jp">
|
<input type="text" id="url" style="width:70%" placeholder="mstdn.jp">
|
||||||
<div id="ins-suggest"></div>
|
<div id="ins-suggest"></div>
|
||||||
<button class="btn waves-effect" onclick="instance()">Login</button><br>
|
<button class="btn waves-effect" onclick="instance()">Login</button><br>
|
||||||
Linuxでご使用の方はチェックを入れて下さい。<br>
|
Linuxでご使用の方やPleromaにログインされる方はチェックを入れて下さい。<br>
|
||||||
<input type="checkbox" class="filled-in" id="linux" />
|
<input type="checkbox" class="filled-in" id="linux" />
|
||||||
<label for="linux">コードセットアップ</label><br>
|
<label for="linux">コードセットアップ</label><br>
|
||||||
<span style="font-family:Open Sans;">Supports</span>
|
<span style="font-family:Open Sans;">Supports</span>
|
||||||
|
|
220
app/cro.html
Normal file
220
app/cro.html
Normal file
|
@ -0,0 +1,220 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html lang="ja">
|
||||||
|
<head>
|
||||||
|
<title>Croudia</title>
|
||||||
|
<meta content="width=device-width,initial-scale=1.0" name="viewport">
|
||||||
|
<link href='./css/font-awesome.css' rel='stylesheet' type='text/css'>
|
||||||
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
|
||||||
|
<style>
|
||||||
|
.nav-icon-cro{
|
||||||
|
font-size:200%;
|
||||||
|
}
|
||||||
|
.nav-series{
|
||||||
|
float:right;
|
||||||
|
font-size:70%;
|
||||||
|
margin-right:20px;
|
||||||
|
width:40px;
|
||||||
|
text-align:center;
|
||||||
|
}
|
||||||
|
#footer{
|
||||||
|
padding:5px;
|
||||||
|
position:absolute;
|
||||||
|
bottom:0;
|
||||||
|
display:flex;
|
||||||
|
width:100vw;
|
||||||
|
justify-content:space-around;
|
||||||
|
background-color:#3387A1;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
#notice{
|
||||||
|
background-color: #e8e8e8;
|
||||||
|
padding:5px;
|
||||||
|
width:100vw;
|
||||||
|
}
|
||||||
|
.cvo {
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 2px;
|
||||||
|
word-break: break-all;
|
||||||
|
width: 100%;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 43px 2fr 1fr;
|
||||||
|
grid-template-areas: 'notice notice notice' 'icon display_name acct' 'icon toot toot' 'icon additional additional' 'actions actions date_via';
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-notice {
|
||||||
|
margin:2px;
|
||||||
|
grid-area: notice;
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-icon {
|
||||||
|
width:40px;
|
||||||
|
margin:2px;
|
||||||
|
grid-area: icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-display_name {
|
||||||
|
user-select: auto;
|
||||||
|
height:1.5em;
|
||||||
|
margin:2px;
|
||||||
|
overflow:hidden;
|
||||||
|
grid-area: display_name;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-acct {
|
||||||
|
margin:2px;
|
||||||
|
grid-area: acct;
|
||||||
|
overflow:hidden;
|
||||||
|
text-align:right;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-toot {
|
||||||
|
cursor:text;
|
||||||
|
user-select: auto;
|
||||||
|
margin:2px;
|
||||||
|
grid-area: toot;
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-date_via {
|
||||||
|
text-align:right;
|
||||||
|
grid-area: date_via;
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-additional {
|
||||||
|
cursor:text;
|
||||||
|
user-select: auto;
|
||||||
|
grid-area: additional;
|
||||||
|
font-size:80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.area-actions {
|
||||||
|
margin:2px;
|
||||||
|
grid-area: actions;
|
||||||
|
height: 50px;
|
||||||
|
font-size: 150%;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
.tl{
|
||||||
|
height:calc(100vh - 140px);
|
||||||
|
overflow-y:scroll;
|
||||||
|
overflow-x:hidden;
|
||||||
|
}
|
||||||
|
p:last-child{
|
||||||
|
margin-bottom:0;
|
||||||
|
}
|
||||||
|
#side{
|
||||||
|
position:fixed;
|
||||||
|
top:70vh;
|
||||||
|
right:0;
|
||||||
|
background-color: rbga(0,0,0,0.8);
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
/*スクロールバー*/
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
background: rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
/* Handle */
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #9e9e9e;
|
||||||
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
.pointer{
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body style="height:100vh; overflow:hidden;">
|
||||||
|
<script>
|
||||||
|
var websocketOld = [];
|
||||||
|
var websocket = [];
|
||||||
|
var websocketHome = [];
|
||||||
|
var websocketLocal = [];
|
||||||
|
var websocketNotf = [];
|
||||||
|
</script>
|
||||||
|
<nav class="navbar navbar-toggleable-md navbar-light bg-faded" style="background-color:#3387A1; color:white; padding-top:10px;">
|
||||||
|
<div style="position:absolute; right:0;">
|
||||||
|
<div class="nav-series pointer"><i class="fa fa-edit nav-icon-cro" data-toggle="modal" data-target="#myModal"></i><br>ささやく</div>
|
||||||
|
<div class="nav-series pointer" onclick="alert('設計中')"><i class="fa fa-search nav-icon-cro"></i><br>検索</div>
|
||||||
|
<div class="nav-series pointer" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><i class="fa fa-bars nav-icon-cro"></i><br>メニュー</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a class="navbar-brand" href="#" style="color:white; font-size:130%;">CroDesk</a>
|
||||||
|
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent" style="color:white;">
|
||||||
|
© Cutls P and foolish people on kirishima.cloud.<br>クローディア・Croudiaはクローディア株式会社の登録商標です。
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<!-- Modal -->
|
||||||
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="exampleModalLabel">ささやく</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<!--hidden area-->
|
||||||
|
<input type="hidden" id="reply">
|
||||||
|
<input type="hidden" id="media">
|
||||||
|
<input type="hidden" value="0" id="post-acct-sel">
|
||||||
|
<textarea id="textarea" placeholder="今どうしてる?" style="width:100%;"></textarea>
|
||||||
|
<span id="vis" style="display:none">public</span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary pointer" data-dismiss="modal">閉じる</button>
|
||||||
|
<button type="button" class="btn btn-primary pointer" onclick="post()">ささやく</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="side">上へ</div>
|
||||||
|
<div id="notice_0"></div>
|
||||||
|
<div class="tl-box" tlid="0"><div id="timeline_0" class="tl" tlid="0"><div style="text-align:center">[ここにトゥートはありません。]</div></div></div>
|
||||||
|
<div id="footer">
|
||||||
|
<div class="nav-series pointer" onclick="tl('home', '', 0, 0)"><i class="fa fa-home nav-icon-cro"></i><br>ホーム</div>
|
||||||
|
<div class="nav-series pointer" onclick="tl('local', '', 0, 0)"><i class="fa fa-users nav-icon-cro"></i><br>ローカル</div>
|
||||||
|
<div class="nav-series pointer" onclick="tl('pub', '', 0, 0)"><i class="fa fa-globe nav-icon-cro"></i><br>連合</div>
|
||||||
|
<div class="nav-series pointer" onclick="alert('設計中')"><i class="fa fa-user nav-icon-cro"></i><br>プロフ</div>
|
||||||
|
<div class="nav-series pointer" onclick="alert('設計中')"><i class="fa fa-cog nav-icon-cro"></i><br>設定</div>
|
||||||
|
</div>
|
||||||
|
<!--大量のデフォルト絵文字-->
|
||||||
|
<script type="text/javascript" src="./js/emoji/emoji-map.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/activity.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/flag.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/food.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/nature.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/object.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/people.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/place.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/symbol.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/emoji/default-emoji.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="./js/common/jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/platform/first.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/common/time.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/ui/scroll.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/tl/date.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/post/status.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/post/post.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/tl/tl.js"></script>
|
||||||
|
<script type="text/javascript" src="./js/cro/parse.js"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
|
||||||
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
|
||||||
|
<script>tl('home', '', 0, 0)</script>
|
||||||
|
<script type="text/javascript" src="./js/platform/end.js"></script>
|
||||||
|
</body>
|
|
@ -48,13 +48,13 @@
|
||||||
bottom: 120px;
|
bottom: 120px;
|
||||||
right: 20px;
|
right: 20px;
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 370px;
|
height: 440px;
|
||||||
z-index: 502;
|
z-index: 502;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
#emoji-list {
|
#emoji-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 130px);
|
height: calc(100% - 190px);
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
.emoji-control {}
|
.emoji-control {}
|
||||||
|
|
10
app/error.html
Normal file
10
app/error.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<!doctype html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>503 Fools Tooter</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>503 Service Unavailable</h1>
|
||||||
|
TheDeskは2017年12月30日 23:59に終了したCroudiaというSNSのクライアントから始まりました。<br>
|
||||||
|
<a onclick="localStorage.setItem('sincere','true'); location.href='index.html';" style="cursor:pointer;">TheDeskに戻る</a>
|
||||||
|
</body>
|
|
@ -26,8 +26,8 @@
|
||||||
<script type="text/javascript" src="./js/common/modal.js"></script>
|
<script type="text/javascript" src="./js/common/modal.js"></script>
|
||||||
<script type="text/javascript" src="./js/ui/jquery-ui.min.js"></script>
|
<script type="text/javascript" src="./js/ui/jquery-ui.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
//トゥートリンク追加
|
//必ずアプデ時のremove instance消して!
|
||||||
var ver="Airi (ver.6)";
|
var ver="Airi (ver.7)";
|
||||||
//betaを入れるとバージョンチェックしない
|
//betaを入れるとバージョンチェックしない
|
||||||
//var ver="beta";
|
//var ver="beta";
|
||||||
var acct_id=0;
|
var acct_id=0;
|
||||||
|
@ -42,7 +42,7 @@ var tlid=0;
|
||||||
<div id="ins-suggest">
|
<div id="ins-suggest">
|
||||||
</div>
|
</div>
|
||||||
<button class="btn waves-effect" onclick="instance()">Login</button>
|
<button class="btn waves-effect" onclick="instance()">Login</button>
|
||||||
<br><span data-trans="linux_ck">Linuxでご使用の方はチェックを入れて下さい。</span>
|
<br><span data-trans="linux_ck">Linuxでご使用の方やPleromaにログインされる方はチェックを入れて下さい。</span>
|
||||||
<br>
|
<br>
|
||||||
<input type="checkbox" class="filled-in" id="linux" />
|
<input type="checkbox" class="filled-in" id="linux" />
|
||||||
<label for="linux" data-trans="code_setup">コードセットアップ</label>
|
<label for="linux" data-trans="code_setup">コードセットアップ</label>
|
||||||
|
@ -355,7 +355,7 @@ var tlid=0;
|
||||||
<a onclick="vis('unlisted')">未収載(Unlisted)</a>
|
<a onclick="vis('unlisted')">未収載(Unlisted)</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a onclick="vis('private')">非公開(Private)</a>
|
<a onclick="vis('private')" id="private-button">非公開(Private)</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a onclick="vis('direct')" class="disabled direct">ダイレクト(Direct)</a>
|
<a onclick="vis('direct')" class="disabled direct">ダイレクト(Direct)</a>
|
||||||
|
@ -374,6 +374,7 @@ var tlid=0;
|
||||||
</i>
|
</i>
|
||||||
<br>
|
<br>
|
||||||
</span>
|
</span>
|
||||||
|
<input type="text" id="emoji-suggest" placeholder="カスタム絵文字検索">
|
||||||
<div id="emoji-list" class="" style="">
|
<div id="emoji-list" class="" style="">
|
||||||
</div>
|
</div>
|
||||||
<div class="emoji-control center">
|
<div class="emoji-control center">
|
||||||
|
|
|
@ -6,7 +6,7 @@ $(document).ready(function(){
|
||||||
inDuration: 300,
|
inDuration: 300,
|
||||||
outDuration: 225,
|
outDuration: 225,
|
||||||
constrainWidth: false, // Does not change width of dropdown to that of the activator
|
constrainWidth: false, // Does not change width of dropdown to that of the activator
|
||||||
hover: true, // Activate on hover
|
hover: false, // Activate on hover
|
||||||
gutter: 0, // Spacing from edge
|
gutter: 0, // Spacing from edge
|
||||||
belowOrigin: false, // Displays dropdown below the button
|
belowOrigin: false, // Displays dropdown below the button
|
||||||
alignment: 'left', // Displays dropdown with edge aligned to the left of button
|
alignment: 'left', // Displays dropdown with edge aligned to the left of button
|
||||||
|
@ -14,5 +14,4 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
//バージョンチェッカー
|
//バージョンチェッカー
|
||||||
function verck(ver) {
|
function verck(ver) {
|
||||||
|
var date=new Date();
|
||||||
|
var month = date.getMonth()+1;
|
||||||
|
var day = date.getDate();
|
||||||
|
if(month=="4" && day=="1" && !localStorage.getItem("sincere")){
|
||||||
|
var electron = require("electron");
|
||||||
|
var ipc = electron.ipcRenderer;
|
||||||
|
ipc.send('fool', "true");
|
||||||
|
location.href="error.html";
|
||||||
|
}else{
|
||||||
|
localStorage.removeItem("sincere")
|
||||||
|
}
|
||||||
localStorage.setItem("ver", ver);
|
localStorage.setItem("ver", ver);
|
||||||
var l = 5;
|
var l = 5;
|
||||||
|
|
||||||
|
|
439
app/js/cro/parse.js
Normal file
439
app/js/cro/parse.js
Normal file
|
@ -0,0 +1,439 @@
|
||||||
|
//オブジェクトパーサー(トゥート)
|
||||||
|
function parse(obj, mix, acct_id, tlid, popup) {
|
||||||
|
var templete = '';
|
||||||
|
var datetype = localStorage.getItem("datetype");
|
||||||
|
var nsfwtype = localStorage.getItem("nsfw");
|
||||||
|
var sent = localStorage.getItem("sentence");
|
||||||
|
var ltr = localStorage.getItem("letters");
|
||||||
|
var gif = localStorage.getItem("gif");
|
||||||
|
var imh = localStorage.getItem("img-height");
|
||||||
|
//クライアント強調
|
||||||
|
var emp = localStorage.getItem("client_emp");
|
||||||
|
if(emp){
|
||||||
|
var emp = JSON.parse(emp);
|
||||||
|
}
|
||||||
|
//クライアントミュート
|
||||||
|
var mute = localStorage.getItem("client_mute");
|
||||||
|
if(mute){
|
||||||
|
var mute = JSON.parse(mute);
|
||||||
|
}
|
||||||
|
//ユーザー強調
|
||||||
|
var useremp = localStorage.getItem("user_emp");
|
||||||
|
if(useremp){
|
||||||
|
var useremp = JSON.parse(useremp);
|
||||||
|
}
|
||||||
|
//ワード強調
|
||||||
|
var wordemp = localStorage.getItem("word_emp");
|
||||||
|
if(wordemp){
|
||||||
|
var wordemp = JSON.parse(wordemp);
|
||||||
|
}
|
||||||
|
//ワードミュート
|
||||||
|
var wordmute = localStorage.getItem("word_mute");
|
||||||
|
if(wordmute){
|
||||||
|
var wordmute = JSON.parse(wordmute);
|
||||||
|
}
|
||||||
|
if (!sent) {
|
||||||
|
var sent = 500;
|
||||||
|
}
|
||||||
|
if (!ltr) {
|
||||||
|
var ltr = 500;
|
||||||
|
}
|
||||||
|
if (!nsfwtype || nsfwtype == "yes") {
|
||||||
|
var nsfw = "ok";
|
||||||
|
} else {
|
||||||
|
var nsfw;
|
||||||
|
}
|
||||||
|
var cwtype = localStorage.getItem("cw");
|
||||||
|
if (!cwtype || cwtype == "yes") {
|
||||||
|
var cw = "ok";
|
||||||
|
} else {
|
||||||
|
var cw;
|
||||||
|
}
|
||||||
|
if (!datetype) {
|
||||||
|
datetype = "absolute";
|
||||||
|
}
|
||||||
|
if (!gif) {
|
||||||
|
var gif = "yes";
|
||||||
|
}
|
||||||
|
if (!imh) {
|
||||||
|
var imh = "200";
|
||||||
|
}
|
||||||
|
if(!emp){
|
||||||
|
var emp=[];
|
||||||
|
}
|
||||||
|
if(!mute){
|
||||||
|
var mute=[];
|
||||||
|
}
|
||||||
|
if(!useremp){
|
||||||
|
var useremp=[];
|
||||||
|
}
|
||||||
|
if(!wordemp){
|
||||||
|
var wordemp=[];
|
||||||
|
}
|
||||||
|
if(!wordmute){
|
||||||
|
var wordmute=[];
|
||||||
|
}
|
||||||
|
|
||||||
|
var local = [];
|
||||||
|
var times=[];
|
||||||
|
Object.keys(obj).forEach(function(key) {
|
||||||
|
var toot = obj[key];
|
||||||
|
if (toot.reblog) {
|
||||||
|
var notice = toot.account.display_name + "(" + toot.account.acct +
|
||||||
|
")がブースト<br>";
|
||||||
|
var boostback = "shared";
|
||||||
|
var toot = toot.reblog;
|
||||||
|
}else{
|
||||||
|
var notice="";
|
||||||
|
}
|
||||||
|
var id = toot.id;
|
||||||
|
var divider = '<div class="divider"></div>';
|
||||||
|
if (toot.account.locked) {
|
||||||
|
var locked = ' <i class="fa fa-lock red-text"></i>';
|
||||||
|
} else {
|
||||||
|
var locked = "";
|
||||||
|
}
|
||||||
|
if (!toot.application) {
|
||||||
|
var via = 'Unknown';
|
||||||
|
} else {
|
||||||
|
var via = toot.application.name;
|
||||||
|
//ミュートチェック
|
||||||
|
Object.keys(mute).forEach(function(key7) {
|
||||||
|
var cli = mute[key7];
|
||||||
|
if(cli == via){
|
||||||
|
boostback = "hide";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (toot.spoiler_text && cw) {
|
||||||
|
var content = toot.content;
|
||||||
|
var spoil = escapeHTML(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><br>';
|
||||||
|
} else {
|
||||||
|
var ct1 = toot.content.split('</p>').length + toot.content.split('<br />').length -2;
|
||||||
|
var ct2 = toot.content.split('</p>').length + toot.content.split('<br>').length -2;
|
||||||
|
if(ct1>ct2){ var ct= ct1; }else{ var ct= ct2; }
|
||||||
|
if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(toot.content)) > 5)) {
|
||||||
|
var content = '<span class="gray">以下全文</span><br>' + toot.content
|
||||||
|
var spoil = '<span class="cw-long-' + toot.id + '">' + $.mb_substr($.strip_tags(
|
||||||
|
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><br>';
|
||||||
|
} else {
|
||||||
|
var content = toot.content;
|
||||||
|
var spoil = escapeHTML(toot.spoiler_text);
|
||||||
|
var spoiler = "";
|
||||||
|
var spoiler_show = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var urls = content.match(
|
||||||
|
/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
||||||
|
);
|
||||||
|
if (urls) {
|
||||||
|
var analyze = '<a onclick="additionalIndv(\'' + tlid + '\',' + acct_id +
|
||||||
|
',\'' + id + '\')" class="add-show pointer">URL解析</a><br>';
|
||||||
|
} else {
|
||||||
|
var analyze = '';
|
||||||
|
}
|
||||||
|
var viewer = "";
|
||||||
|
var hasmedia = "";
|
||||||
|
var youtube = "";
|
||||||
|
if(toot.emojis){
|
||||||
|
var emojick = toot.emojis[0];
|
||||||
|
}else{
|
||||||
|
var emojick=false;
|
||||||
|
}
|
||||||
|
//絵文字があれば
|
||||||
|
if (emojick) {
|
||||||
|
Object.keys(toot.emojis).forEach(function(key5) {
|
||||||
|
var emoji = toot.emojis[key5];
|
||||||
|
var shortcode = emoji.shortcode;
|
||||||
|
var emoji_url = '<img src="' + emoji.url +
|
||||||
|
'" class="emoji-img">';
|
||||||
|
var regExp = new RegExp(":" + shortcode + ":", "g");
|
||||||
|
content = content.replace(regExp, emoji_url);
|
||||||
|
spoil = spoil.replace(regExp, emoji_url);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//デフォ絵文字
|
||||||
|
var defemo=content.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g);
|
||||||
|
|
||||||
|
if(defemo && defemo[0]){
|
||||||
|
defemo = defemo.filter(function (x, i, self) {
|
||||||
|
return self.indexOf(x) === i;
|
||||||
|
});
|
||||||
|
Object.keys(defemo).forEach(function(key12) {
|
||||||
|
var demo=defemo[key12];
|
||||||
|
var regExp = new RegExp(demo, "g");
|
||||||
|
for(var i=0;i<map.length;i++){
|
||||||
|
var imap=map[i];
|
||||||
|
//console.log(regExp);
|
||||||
|
if (imap.emoji.match(regExp)) {
|
||||||
|
for(var l=0;l<defaultemojiList.length;l++){
|
||||||
|
var catlist=defaultemoji[defaultemojiList[l]];
|
||||||
|
for(var m=0;m<catlist.length;m++){
|
||||||
|
var imoji=catlist[m];
|
||||||
|
if(imoji.shortcode==imap.name){
|
||||||
|
content=content.replace(regExp,'<span style="width: 20px; height: 20px; display: inline-block; background-image: url(\'./img/sheet.png\'); background-size: 4900%; background-position: '+imoji["css"]+';"></span>');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
var mediack = toot.media_attachments[0];
|
||||||
|
//メディアがあれば
|
||||||
|
if (mediack) {
|
||||||
|
hasmedia = "hasmedia";
|
||||||
|
var cwdt = 100 / toot.media_attachments.length
|
||||||
|
Object.keys(toot.media_attachments).forEach(function(key2) {
|
||||||
|
var media = toot.media_attachments[key2];
|
||||||
|
var purl = media.preview_url;
|
||||||
|
var url = media.url;
|
||||||
|
if (toot.sensitive && nsfw) {
|
||||||
|
var sense = "sensitive"
|
||||||
|
} else {
|
||||||
|
var sense = ""
|
||||||
|
}
|
||||||
|
viewer = viewer + '<img src="' +
|
||||||
|
purl + '" class="' + sense +
|
||||||
|
' toot-img pointer" style="width:' + cwdt + '%; height:'+imh+'px;">';
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
viewer = "";
|
||||||
|
hasmedia = "nomedia";
|
||||||
|
}
|
||||||
|
var menck = toot.mentions[0];
|
||||||
|
var mentions = "";
|
||||||
|
//メンションであれば
|
||||||
|
if (menck) {
|
||||||
|
mentions = "Links: ";
|
||||||
|
Object.keys(toot.mentions).forEach(function(key3) {
|
||||||
|
var mention = toot.mentions[key3];
|
||||||
|
mentions = mentions + '<a onclick="udg(\'' + mention.id + '\',' +
|
||||||
|
acct_id + ')" class="pointer">@' + mention.acct + '</a> ';
|
||||||
|
});
|
||||||
|
mentions = '<div style="float:right">' + mentions + '</div>';
|
||||||
|
}
|
||||||
|
var tagck = toot.tags[0];
|
||||||
|
var tags = "";
|
||||||
|
//タグであれば
|
||||||
|
if (tagck) {
|
||||||
|
if (!menck) {
|
||||||
|
tags = "Links: ";
|
||||||
|
}
|
||||||
|
Object.keys(toot.tags).forEach(function(key4) {
|
||||||
|
var tag = toot.tags[key4];
|
||||||
|
tags = tags + '<a onclick="tagShow(\'' + tag.name + '\')" class="pointer">#' + tag.name + '</a><span class="hide" data-tag="' + tag.name + '"> <a onclick="tl(\'tag\',\'' + tag.name + '\',' + acct_id +
|
||||||
|
',\'add\')" class="pointer" title="#' + tag.name + 'のタイムライン">TL</a> <a onclick="brInsert(\'#' + tag.name + '\')" class="pointer" title="#' + tag.name + 'でトゥート">Toot</a> '+
|
||||||
|
'<a onclick="tagPin(\'' + tag.name + '\')" class="pointer" title="#' + tag.name + 'をよく使うタグへ">Pin</a></span> ';
|
||||||
|
});
|
||||||
|
tags = '<div style="float:right">' + tags + '</div>';
|
||||||
|
}
|
||||||
|
//公開範囲を取得
|
||||||
|
var vis = "";
|
||||||
|
var visen = toot.visibility;
|
||||||
|
if (visen == "public") {
|
||||||
|
var vis =
|
||||||
|
'<i class="text-darken-3 material-icons gray sml" title="公開">public</i>';
|
||||||
|
var can_rt = "";
|
||||||
|
} else if (visen == "unlisted") {
|
||||||
|
var vis =
|
||||||
|
'<i class="text-darken-3 material-icons blue-text" title="未収載">lock_open</i>';
|
||||||
|
var can_rt = "";
|
||||||
|
} else if (visen == "plivate") {
|
||||||
|
var vis =
|
||||||
|
'<i class="text-darken-3 material-icons orange-text" title="非公開">lock</i>';
|
||||||
|
var can_rt = "hide";
|
||||||
|
} else if (visen == "direct") {
|
||||||
|
var vis =
|
||||||
|
'<i class="text-darken-3 material-icons red-text" title="ダイレクト">mail</i>';
|
||||||
|
var can_rt = "hide";
|
||||||
|
}
|
||||||
|
if (toot.account.acct == localStorage.getItem("user_" + acct_id)) {
|
||||||
|
var if_mine = "";
|
||||||
|
} else {
|
||||||
|
var if_mine = "hide";
|
||||||
|
}
|
||||||
|
if (toot.favourited) {
|
||||||
|
var if_fav = " yellow-text";
|
||||||
|
var fav_app = "faved";
|
||||||
|
} else {
|
||||||
|
var if_fav = "";
|
||||||
|
var fav_app = "";
|
||||||
|
}
|
||||||
|
if (toot.reblogged) {
|
||||||
|
var if_rt = "teal-text";
|
||||||
|
var rt_app = "rted";
|
||||||
|
} else {
|
||||||
|
var if_rt = "";
|
||||||
|
var rt_app = "";
|
||||||
|
}
|
||||||
|
if (toot.pinned) {
|
||||||
|
var if_pin = "blue-text";
|
||||||
|
var pin_app = "pinned";
|
||||||
|
} else {
|
||||||
|
var if_pin = "";
|
||||||
|
var pin_app = "";
|
||||||
|
}
|
||||||
|
//アニメ再生
|
||||||
|
if (gif == "yes") {
|
||||||
|
var avatar = toot.account.avatar;
|
||||||
|
} else {
|
||||||
|
var avatar = toot.account.avatar_static;
|
||||||
|
}
|
||||||
|
//ワードミュート
|
||||||
|
if(wordmute){
|
||||||
|
Object.keys(wordmute).forEach(function(key8) {
|
||||||
|
var worde = wordmute[key8];
|
||||||
|
if(worde){
|
||||||
|
var word=worde.tag;
|
||||||
|
var regExp = new RegExp( word, "g" ) ;
|
||||||
|
if(content.match(regExp)){
|
||||||
|
boostback = "hide";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//ワード強調
|
||||||
|
if(wordemp){
|
||||||
|
Object.keys(wordemp).forEach(function(key9) {
|
||||||
|
var word = wordemp[key9];
|
||||||
|
if(word){
|
||||||
|
var word=word.tag;
|
||||||
|
var regExp = new RegExp( word, "g" ) ;
|
||||||
|
content=content.replace(regExp,'<span class="emp">'+word+"</span>");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
|
||||||
|
boostback + ' ' + fav_app + ' ' + rt_app + ' ' + pin_app +
|
||||||
|
' ' + hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
|
||||||
|
key].created_at, 'unix') + '">' +
|
||||||
|
'<div class="area-notice"><span class="gray sharesta">' + notice +
|
||||||
|
'</span></div>' +
|
||||||
|
'<div class="area-icon"><a onclick="udg(\'' + toot.account.id +
|
||||||
|
'\',' + acct_id + ');" user="' + toot.account.acct + '" class="udg">' +
|
||||||
|
'<img src="' + avatar +
|
||||||
|
'" width="40" class="prof-img" user="' + toot.account.acct +
|
||||||
|
'"></a></div>' +
|
||||||
|
'<div class="area-display_name"><span class="user">' +
|
||||||
|
escapeHTML(toot.account.display_name) +
|
||||||
|
'</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 waves-effect" onclick="tootUriCopy(\'' +
|
||||||
|
toot.url + '\');" title="' + date(toot.created_at, 'absolute') +
|
||||||
|
'(クリックでトゥートURLをコピー)"><i class="fa fa-clock-o"></i>' +
|
||||||
|
date(toot.created_at, datetype) + '</span></div></div>' +
|
||||||
|
'<div class="area-toot"><span class="toot ' + spoiler + '">' + content +
|
||||||
|
'</span><span class="' +
|
||||||
|
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
|
||||||
|
'</span>' +
|
||||||
|
'' + viewer + '' +
|
||||||
|
'</div><div class="area-additional"><span style="color:green;"><span class="rt_ct">' + toot.reblogs_count +
|
||||||
|
'</span>シェア</span><br><span style="color:orange;"><i class="fa fa-star"></i><span class="fav_ct">' + toot.favourites_count +
|
||||||
|
'</a></span></span><br><a onclick="details(\'' + toot.id + '\',' + acct_id +
|
||||||
|
','+tlid+')" class="waves-effect waves-dark btn-flat details" style="padding:0; color:#0275d8; font-size:80%;">詳細</a></div>' +
|
||||||
|
'<div class="area-actions" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
||||||
|
'<div class="action"><span style="padding:0">' +
|
||||||
|
vis + '</span></div><div class="action"><a onclick="re(\'' + toot.id +
|
||||||
|
'\',\'' + toot.account.acct + '\',' +
|
||||||
|
acct_id + ',\''+visen+
|
||||||
|
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートに返信"><i class="fa fa-share"></i></a></div>' +
|
||||||
|
'<div class="action '+can_rt+'"><a onclick="rt(\'' + toot.id + '\',' + acct_id +
|
||||||
|
',\'' + tlid +
|
||||||
|
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをブースト"><i class="text-darken-3 fa fa-retweet ' +
|
||||||
|
if_rt + ' rt_' + toot.id + '"></i></a></div>' +
|
||||||
|
'<div class="action"><a onclick="fav(\'' + toot.id + '\',' + acct_id +
|
||||||
|
',\'' + tlid +
|
||||||
|
'\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="このトゥートをお気に入り登録"><i class="fa text-darken-3 fa-star' +
|
||||||
|
if_fav + ' fav_' + toot.id + '"></i></div>' +
|
||||||
|
'<div class="' + if_mine + ' action"></div>' +
|
||||||
|
'<div class="action"></div>' +
|
||||||
|
'</div><div class="area-date_via">' +
|
||||||
|
'<div><span class="cbadge waves-effect" onclick="client(\''+$.strip_tags(via)+'\')" title="via ' + $.strip_tags(via) + '">via ' +
|
||||||
|
via +
|
||||||
|
'</span></div></div></div>' +
|
||||||
|
'</div>' + divider;
|
||||||
|
});
|
||||||
|
if (mix == "mix") {
|
||||||
|
return [templete, local, times]
|
||||||
|
} else {
|
||||||
|
return templete;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//オブジェクトパーサー(ユーザーデータ)
|
||||||
|
function userparse(obj, auth, acct_id, tlid, popup) {
|
||||||
|
var templete = '';
|
||||||
|
var datetype = localStorage.getItem("datetype");
|
||||||
|
Object.keys(obj).forEach(function(key) {
|
||||||
|
var toot = obj[key];
|
||||||
|
if (toot.locked) {
|
||||||
|
var locked = ' <i class="fa fa-lock red-text"></i>';
|
||||||
|
} else {
|
||||||
|
var locked = "";
|
||||||
|
}
|
||||||
|
if (auth) {
|
||||||
|
var auth = '<i class="material-icons gray pointer" onclick="request(\'' +
|
||||||
|
toot.id + '\',\'authorize\',' + acct_id + ')">person_add</i>';
|
||||||
|
} else {
|
||||||
|
var auth = "";
|
||||||
|
}
|
||||||
|
if(popup > 0){
|
||||||
|
var notftext='<span class="cbadge"title="' + date(toot.created_at,
|
||||||
|
'absolute') + '(通知された時間)"><i class="fa fa-clock-o"></i>' + date(toot.created_at,
|
||||||
|
datetype) +
|
||||||
|
'</span>フォローされました。<br>';
|
||||||
|
}else{
|
||||||
|
var notftext="";
|
||||||
|
}
|
||||||
|
var memory = localStorage.getItem("notice-mem");
|
||||||
|
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
||||||
|
Materialize.toast(escapeHTML(toot.display_name)+"にフォローされました", popup * 1000);
|
||||||
|
$(".notf-icon_" + tlid).addClass("red-text");
|
||||||
|
localStorage.setItem("notice-mem", noticetext);
|
||||||
|
noticetext = "";
|
||||||
|
}
|
||||||
|
templete = templete +
|
||||||
|
'<div class="" style="padding-top:5px;" user-id="' + toot.id + '">' +
|
||||||
|
notftext +
|
||||||
|
'<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(\'' + toot.id + '\',' +
|
||||||
|
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;user-select:auto; cursor:text;"><big>' +
|
||||||
|
escapeHTML(toot.display_name) + '</big></div>' +
|
||||||
|
'<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:' +
|
||||||
|
toot.following_count +
|
||||||
|
'</div><div class="cbadge" style="width:100px;">Followers:' + toot.followers_count +
|
||||||
|
'</div>' +
|
||||||
|
'<div class="divider"></div>' +
|
||||||
|
'</div>' +
|
||||||
|
'</div>';
|
||||||
|
|
||||||
|
});
|
||||||
|
return templete;
|
||||||
|
}
|
||||||
|
//クライアントダイアログ
|
||||||
|
function scrollevent(){}
|
||||||
|
function todo(){}
|
||||||
|
function todc(){}
|
||||||
|
function vis(){ $('#myModal').modal('hide') }
|
||||||
|
function additional(){}
|
||||||
|
function re(){ alert("設計中") }
|
|
@ -31,6 +31,7 @@ function defaultEmoji(target){
|
||||||
$(".emoji-control").addClass("hide");
|
$(".emoji-control").addClass("hide");
|
||||||
}
|
}
|
||||||
function customEmoji(){
|
function customEmoji(){
|
||||||
|
$("#emoji-suggest").val("");
|
||||||
$(".emoji-control").removeClass("hide");
|
$(".emoji-control").removeClass("hide");
|
||||||
emojiList('home')
|
emojiList('home')
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ function ck() {
|
||||||
|
|
||||||
}
|
}
|
||||||
if (at) {
|
if (at) {
|
||||||
ckdb(0);
|
|
||||||
$("#tl").show();
|
$("#tl").show();
|
||||||
parseColumn();
|
parseColumn();
|
||||||
multi();
|
multi();
|
||||||
|
@ -262,7 +261,7 @@ function ckdb(acct_id) {
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
var ver=enc(localStorage.getItem("ver"));
|
var ver=enc(localStorage.getItem("ver"));
|
||||||
var start = "https://dl.thedesk.top/mastodon_data.json?"+ver;
|
var start = "https://dl.thedesk.top/mastodon_data.json?eu=ai";
|
||||||
fetch(start, {
|
fetch(start, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -300,6 +299,19 @@ function ckdb(acct_id) {
|
||||||
}else{
|
}else{
|
||||||
localStorage.removeItem("bb_" + acct_id);
|
localStorage.removeItem("bb_" + acct_id);
|
||||||
}
|
}
|
||||||
|
if(json[domain + "_home"]){
|
||||||
|
console.log("unique name:"+json[domain + "_home"]);
|
||||||
|
localStorage.setItem("home_" + acct_id, json[domain + "_home"]);
|
||||||
|
}
|
||||||
|
if(json[domain + "_local"]){
|
||||||
|
localStorage.setItem("local_" + acct_id, json[domain + "_local"]);
|
||||||
|
}
|
||||||
|
if(json[domain + "_public"]){
|
||||||
|
localStorage.setItem("public_" + acct_id, json[domain + "_public"]);
|
||||||
|
}
|
||||||
|
if(json[domain + "_notification"]){
|
||||||
|
localStorage.setItem("notification_" + acct_id, json[domain + "_notification"]);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ function multiDel(target) {
|
||||||
|
|
||||||
//サポートインスタンス
|
//サポートインスタンス
|
||||||
function support() {
|
function support() {
|
||||||
var start = "https://dl.thedesk.top/mastodon_data.json";
|
var start = "https://dl.thedesk.top/mastodon_data.json?eu=ai";
|
||||||
fetch(start, {
|
fetch(start, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -14,6 +14,12 @@ function mdCheck(){
|
||||||
}else{
|
}else{
|
||||||
localStorage.removeItem("md");
|
localStorage.removeItem("md");
|
||||||
}
|
}
|
||||||
|
var domain = localStorage.getItem("domain_" + acct_id);
|
||||||
|
if(domain=="mstdn.y-zu.org"){
|
||||||
|
//$("#private-button").text("限定公開(Yづドン!)");
|
||||||
|
}else{
|
||||||
|
//$("#private-button").text("非公開(Private)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//BOXのトグルボタン
|
//BOXのトグルボタン
|
||||||
function mdToggle(){
|
function mdToggle(){
|
||||||
|
|
|
@ -132,4 +132,43 @@ function brInsert(code) {
|
||||||
var now = $("#textarea").val();
|
var now = $("#textarea").val();
|
||||||
$("#textarea").val(now + code);
|
$("#textarea").val(now + code);
|
||||||
$("#textarea").focus();
|
$("#textarea").focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//入力時に絵文字をサジェスト
|
||||||
|
var etimer = null;
|
||||||
|
|
||||||
|
var einput = document.getElementById("emoji-suggest");
|
||||||
|
|
||||||
|
var prev_val = einput.value;
|
||||||
|
var oldSuggest;
|
||||||
|
var suggest;
|
||||||
|
einput.addEventListener("focus", function() {
|
||||||
|
$(".emoji-control").addClass("hide");
|
||||||
|
$("#suggest").html("");
|
||||||
|
window.clearInterval(etimer);
|
||||||
|
etimer = window.setInterval(function() {
|
||||||
|
var new_val = einput.value;
|
||||||
|
var html="";
|
||||||
|
if (prev_val != new_val && new_val.length > 3) {
|
||||||
|
var obj = JSON.parse(localStorage.getItem("emoji_" + acct_id));
|
||||||
|
var num = obj.length;
|
||||||
|
for (i = 0; i < num; i++) {
|
||||||
|
var emoji = obj[i];
|
||||||
|
if ( ~emoji.shortcode.indexOf(new_val)) {
|
||||||
|
//strにhogeを含む場合の処理
|
||||||
|
if (emoji) {
|
||||||
|
html = html + '<a onclick="emojiInsert(\':' + emoji.shortcode +
|
||||||
|
': \')" class="pointer"><img src="' + emoji.url + '" width="20"></a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$("#emoji-list").html(html+'<br><a onclick="customEmoji()" class="pointer waves-effect">リセット</a>');
|
||||||
|
};
|
||||||
|
oldSuggest = suggest;
|
||||||
|
prev_value = new_val;
|
||||||
|
}, 1000);
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
einput.addEventListener("blur", function() {
|
||||||
|
window.clearInterval(etimer);
|
||||||
|
}, false);
|
|
@ -9,16 +9,30 @@ function post() {
|
||||||
var at = localStorage.getItem(domain + "_at");
|
var at = localStorage.getItem(domain + "_at");
|
||||||
var start = "https://" + domain + "/api/v1/statuses";
|
var start = "https://" + domain + "/api/v1/statuses";
|
||||||
var reply = $("#reply").val();
|
var reply = $("#reply").val();
|
||||||
|
var toot={
|
||||||
|
status: str
|
||||||
|
}
|
||||||
|
if(reply){
|
||||||
|
toot.in_reply_to_id=reply
|
||||||
|
}
|
||||||
var media = $("#media").val();
|
var media = $("#media").val();
|
||||||
|
if(media){
|
||||||
|
toot.media_ids=media;
|
||||||
|
}
|
||||||
if ($("#nsfw").hasClass("nsfw-avail")) {
|
if ($("#nsfw").hasClass("nsfw-avail")) {
|
||||||
var nsfw = "true";
|
var nsfw = "true";
|
||||||
|
toot.sensitive=nsfw;
|
||||||
} else {
|
} else {
|
||||||
var nsfw = "false";
|
var nsfw = "false";
|
||||||
}
|
}
|
||||||
var vis = $("#vis").text();
|
var vis = $("#vis").text();
|
||||||
|
if(vis!="public"){
|
||||||
|
toot.visibility=vis;
|
||||||
|
}
|
||||||
if ($("#cw").hasClass("cw-avail")) {
|
if ($("#cw").hasClass("cw-avail")) {
|
||||||
var spo = $("#cw-text").val();
|
var spo = $("#cw-text").val();
|
||||||
cw();
|
cw();
|
||||||
|
toot.spoiler_text=spo;
|
||||||
} else {
|
} else {
|
||||||
var spo = "";
|
var spo = "";
|
||||||
}
|
}
|
||||||
|
@ -28,14 +42,7 @@ function post() {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
'Authorization': 'Bearer ' + at
|
'Authorization': 'Bearer ' + at
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify(toot)
|
||||||
status: str,
|
|
||||||
in_reply_to_id: reply,
|
|
||||||
media_ids: media.split(","),
|
|
||||||
sensitive: nsfw,
|
|
||||||
spoiler_text: spo,
|
|
||||||
visibility: vis
|
|
||||||
})
|
|
||||||
}).then(function(response) {
|
}).then(function(response) {
|
||||||
return response.json();
|
return response.json();
|
||||||
}).catch(function(error) {
|
}).catch(function(error) {
|
||||||
|
|
|
@ -22,9 +22,9 @@ function notf(acct_id, tlid, sys) {
|
||||||
Object.keys(json).forEach(function(key) {
|
Object.keys(json).forEach(function(key) {
|
||||||
var obj = json[key];
|
var obj = json[key];
|
||||||
if(obj.type!="follow"){
|
if(obj.type!="follow"){
|
||||||
templete = templete+parse([obj], '', acct_id, tlid, -1);
|
templete = templete+parse([obj], 'notf', acct_id, tlid, -1);
|
||||||
}else{
|
}else{
|
||||||
templete = templete+userparse([obj.account], '', acct_id, tlid, -1);
|
templete = templete+userparse([obj.account], 'notf', acct_id, tlid, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -64,9 +64,9 @@ function notf(acct_id, tlid, sys) {
|
||||||
}
|
}
|
||||||
var templete="";
|
var templete="";
|
||||||
if(obj.type!="follow"){
|
if(obj.type!="follow"){
|
||||||
templete = templete+parse([obj], '', acct_id, tlid, popup);
|
templete = templete+parse([obj], 'notf', acct_id, tlid, popup);
|
||||||
}else{
|
}else{
|
||||||
templete = templete+userparse([obj], '', acct_id, tlid, popup);
|
templete = templete+userparse([obj], 'notf', acct_id, tlid, popup);
|
||||||
}
|
}
|
||||||
$("div[data-notf=" + acct_id +"]").prepend(templete);
|
$("div[data-notf=" + acct_id +"]").prepend(templete);
|
||||||
jQuery("time.timeago").timeago();
|
jQuery("time.timeago").timeago();
|
||||||
|
|
|
@ -78,7 +78,7 @@ function parse(obj, mix, acct_id, tlid, popup) {
|
||||||
var times=[];
|
var times=[];
|
||||||
Object.keys(obj).forEach(function(key) {
|
Object.keys(obj).forEach(function(key) {
|
||||||
var toot = obj[key];
|
var toot = obj[key];
|
||||||
if(popup){
|
if (mix == "notf") {
|
||||||
if (toot.type == "mention") {
|
if (toot.type == "mention") {
|
||||||
var what = "返信しました";
|
var what = "返信しました";
|
||||||
} else if (toot.type == "reblog") {
|
} else if (toot.type == "reblog") {
|
||||||
|
@ -97,7 +97,9 @@ function parse(obj, mix, acct_id, tlid, popup) {
|
||||||
var memory = localStorage.getItem("notice-mem");
|
var memory = localStorage.getItem("notice-mem");
|
||||||
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
if (popup >= 0 && obj.length < 5 && noticetext != memory) {
|
||||||
var domain = localStorage.getItem("domain_" + acct_id);
|
var domain = localStorage.getItem("domain_" + acct_id);
|
||||||
Materialize.toast("["+domain+"より]"+toot.account.display_name+"が"+what, popup * 1000);
|
if(popup>0){
|
||||||
|
Materialize.toast("["+domain+"より]"+toot.account.display_name+"が"+what, popup * 1000);
|
||||||
|
}
|
||||||
$(".notf-icon_" + acct_id).addClass("red-text");
|
$(".notf-icon_" + acct_id).addClass("red-text");
|
||||||
localStorage.setItem("notice-mem", noticetext);
|
localStorage.setItem("notice-mem", noticetext);
|
||||||
noticetext = "";
|
noticetext = "";
|
||||||
|
@ -169,10 +171,8 @@ function parse(obj, mix, acct_id, tlid, popup) {
|
||||||
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
var spoiler_show = '<a href="#" onclick="cw_show(\'' + toot.id +
|
||||||
'\')" class="nex parsed">見る</a><br>';
|
'\')" class="nex parsed">見る</a><br>';
|
||||||
} else {
|
} else {
|
||||||
var ct1 = toot.content.split('</p>').length + toot.content.split('<br />').length -
|
var ct1 = toot.content.split('</p>').length + toot.content.split('<br />').length -2;
|
||||||
2;
|
var ct2 = toot.content.split('</p>').length + toot.content.split('<br>').length -2;
|
||||||
var ct2 = toot.content.split('</p>').length + toot.content.split('<br>').length -
|
|
||||||
2;
|
|
||||||
if(ct1>ct2){ var ct= ct1; }else{ var ct= ct2; }
|
if(ct1>ct2){ var ct= ct1; }else{ var ct= ct2; }
|
||||||
if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(toot.content)) > 5)) {
|
if ((sent < ct && $.mb_strlen($.strip_tags(toot.content)) > 5) || ($.strip_tags(toot.content).length > ltr && $.mb_strlen($.strip_tags(toot.content)) > 5)) {
|
||||||
var content = '<span class="gray">以下全文</span><br>' + toot.content
|
var content = '<span class="gray">以下全文</span><br>' + toot.content
|
||||||
|
@ -189,7 +189,7 @@ function parse(obj, mix, acct_id, tlid, popup) {
|
||||||
var spoiler_show = "";
|
var spoiler_show = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var urls = content.match(
|
var urls = $.strip_tags(content).replace(/\n/g, " ").match(
|
||||||
/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
/https?:\/\/([-a-zA-Z0-9@.]+)\/?(?!.*((media|tags)|mentions)).*([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)?/
|
||||||
);
|
);
|
||||||
if (urls) {
|
if (urls) {
|
||||||
|
|
|
@ -40,7 +40,7 @@ function tl(type, data, acct_id, tlid) {
|
||||||
} else if (type == "notf") {
|
} else if (type == "notf") {
|
||||||
//通知なら飛ばす
|
//通知なら飛ばす
|
||||||
//notf(acct_id, tlid, 'direct');
|
//notf(acct_id, tlid, 'direct');
|
||||||
$("#notice_" + tlid).text(cap(type, data) + " TL(" + localStorage.getItem(
|
$("#notice_" + tlid).text(cap(type, data, acct_id) + "(" + localStorage.getItem(
|
||||||
"user_" + acct_id) + "@" + domain + ")");
|
"user_" + acct_id) + "@" + domain + ")");
|
||||||
$("#notice_icon_" + tlid).text("notifications");
|
$("#notice_icon_" + tlid).text("notifications");
|
||||||
return;
|
return;
|
||||||
|
@ -48,7 +48,7 @@ function tl(type, data, acct_id, tlid) {
|
||||||
localStorage.setItem("now", type);
|
localStorage.setItem("now", type);
|
||||||
todo(cap(type) + " TL Loading...");
|
todo(cap(type) + " TL Loading...");
|
||||||
var at = localStorage.getItem(domain + "_at");
|
var at = localStorage.getItem(domain + "_at");
|
||||||
$("#notice_" + tlid).text(cap(type, data) + " TL(" + localStorage.getItem(
|
$("#notice_" + tlid).text(cap(type, data, acct_id) + "(" + localStorage.getItem(
|
||||||
"user_" + acct_id) + "@" + domain + ")");
|
"user_" + acct_id) + "@" + domain + ")");
|
||||||
$("#notice_icon_" + tlid).text(icon(type));
|
$("#notice_icon_" + tlid).text(icon(type));
|
||||||
var url=com(type, data);
|
var url=com(type, data);
|
||||||
|
@ -119,7 +119,7 @@ function reload(type, cc, acct_id, tlid, data) {
|
||||||
}
|
}
|
||||||
websocket[wsid].onmessage = function(mess) {
|
websocket[wsid].onmessage = function(mess) {
|
||||||
console.log(tlid + ":Receive Streaming API:");
|
console.log(tlid + ":Receive Streaming API:");
|
||||||
console.log(websocket[wsid]);
|
console.log(mess);
|
||||||
|
|
||||||
|
|
||||||
var typeA = JSON.parse(mess.data).event;
|
var typeA = JSON.parse(mess.data).event;
|
||||||
|
@ -256,20 +256,37 @@ function tlCloser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//TLのタイトル
|
//TLのタイトル
|
||||||
function cap(type, data) {
|
function cap(type, data, acct_id) {
|
||||||
if (type == "home") {
|
if (type == "home") {
|
||||||
return "Home"
|
if(localStorage.getItem("home_" + acct_id)){
|
||||||
|
var response=localStorage.getItem("home_" + acct_id);
|
||||||
|
}else{
|
||||||
|
var response="Home TL";
|
||||||
|
}
|
||||||
} else if (type == "local") {
|
} else if (type == "local") {
|
||||||
return "Local"
|
if(localStorage.getItem("local_" + acct_id)){
|
||||||
|
var response=localStorage.getItem("local_" + acct_id);
|
||||||
|
}else{
|
||||||
|
var response="Local TL";
|
||||||
|
}
|
||||||
} else if (type == "pub") {
|
} else if (type == "pub") {
|
||||||
return "Public"
|
if(localStorage.getItem("public_" + acct_id)){
|
||||||
|
var response=localStorage.getItem("public_" + acct_id);
|
||||||
|
}else{
|
||||||
|
var response="Federated TL";
|
||||||
|
}
|
||||||
} else if (type == "tag") {
|
} else if (type == "tag") {
|
||||||
return "#" + data
|
var response= "#" + data
|
||||||
} else if (type == "list") {
|
} else if (type == "list") {
|
||||||
return "List(id:" + data + ")"
|
var response= "List(id:" + data + ")"
|
||||||
} else if (type == "notf") {
|
} else if (type == "notf") {
|
||||||
return "Notification"
|
if(localStorage.getItem("notification_" + acct_id)){
|
||||||
|
var response=localStorage.getItem("notification_" + acct_id);
|
||||||
|
}else{
|
||||||
|
var response="Notification TL";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TLのURL
|
//TLのURL
|
||||||
|
|
|
@ -74,12 +74,17 @@
|
||||||
}else{
|
}else{
|
||||||
var notf_attr='';
|
var notf_attr='';
|
||||||
}
|
}
|
||||||
|
if(localStorage.getItem("notification_" + acct.domain)){
|
||||||
|
var unique_notf=localStorage.getItem("notification_" + acct.domain);
|
||||||
|
}else{
|
||||||
|
var unique_notf="通知";
|
||||||
|
}
|
||||||
var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key +
|
var html = '<div class="box" id="timeline_box_' + key + '_box" tlid="' + key +
|
||||||
'"><div class="notice-box z-depth-2">'+
|
'"><div class="notice-box z-depth-2">'+
|
||||||
'<div class="area-notice"><i class="material-icons waves-effect red-text" id="notice_icon_' + key + '"'+notf_attr+' style="font-size:40px; padding-top:25%;" onclick="goTop(' + key + ')" title="一番上へ。アイコンが赤のときはストリーミングに接続できていません。F5等で再読込をお試し下さい。"></i></div>'+
|
'<div class="area-notice"><i class="material-icons waves-effect red-text" id="notice_icon_' + key + '"'+notf_attr+' style="font-size:40px; padding-top:25%;" onclick="goTop(' + key + ')" title="一番上へ。アイコンが赤のときはストリーミングに接続できていません。F5等で再読込をお試し下さい。"></i></div>'+
|
||||||
'<div class="area-notice_name"><span id="notice_' + key + '"" class="tl-title"></span></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 +
|
'<div class="area-a1"><a onclick="notfToggle(' + acct.domain + ',' + key +
|
||||||
')" class="setting nex" title="このアカウントの通知"><i class="material-icons waves-effect nex notf-icon_' +
|
')" class="setting nex" title="このアカウントの'+unique_notf+'"><i class="material-icons waves-effect nex notf-icon_' +
|
||||||
acct.domain + '">notifications</i></a></div>'+
|
acct.domain + '">notifications</i></a></div>'+
|
||||||
'<div class="area-a2"><a onclick="removeColumn(' + key +
|
'<div class="area-a2"><a onclick="removeColumn(' + key +
|
||||||
')" class="setting nex"><i class="material-icons waves-effect nex" title="このカラムを削除">remove_circle</i></a></div>'+
|
')" class="setting nex"><i class="material-icons waves-effect nex" title="このカラムを削除">remove_circle</i></a></div>'+
|
||||||
|
@ -129,6 +134,7 @@
|
||||||
};
|
};
|
||||||
var multi = localStorage.getItem("column");
|
var multi = localStorage.getItem("column");
|
||||||
var obj = JSON.parse(multi);
|
var obj = JSON.parse(multi);
|
||||||
|
console.log(obj.length)
|
||||||
localStorage.setItem("card_" + obj.length,"true");
|
localStorage.setItem("card_" + obj.length,"true");
|
||||||
obj.push(add);
|
obj.push(add);
|
||||||
var json = JSON.stringify(obj);
|
var json = JSON.stringify(obj);
|
||||||
|
|
15
app/main.js
15
app/main.js
|
@ -327,4 +327,19 @@ ipc.on('nano', function (e, x, y) {
|
||||||
window.setPosition(0, 0);
|
window.setPosition(0, 0);
|
||||||
return "true"
|
return "true"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ipc.on('fool', function(e, x, y) {
|
||||||
|
var window = new BrowserWindow({
|
||||||
|
width: 400,
|
||||||
|
height: 800,
|
||||||
|
"transparent": false, // ウィンドウの背景を透過
|
||||||
|
"frame": true, // 枠の無いウィンドウ
|
||||||
|
"resizable": true
|
||||||
|
});
|
||||||
|
window.loadURL('file://' + __dirname + '/cro.html');
|
||||||
|
|
||||||
|
return "true"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
app.setAsDefaultProtocolClient('thedesk')
|
app.setAsDefaultProtocolClient('thedesk')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "TheDesk",
|
"name": "TheDesk",
|
||||||
"version": "13.6.0",
|
"version": "13.7.0",
|
||||||
"description": "TheDesk on Mastodonはシンプルと多機能を両立したデスクトップ向けクライアントです",
|
"description": "TheDesk on Mastodonはシンプルと多機能を両立したデスクトップ向けクライアントです",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -23,5 +23,23 @@
|
||||||
"mstdn.y-zu.org_name":"Yづドン!(502 BadGateway)",
|
"mstdn.y-zu.org_name":"Yづドン!(502 BadGateway)",
|
||||||
"mstdn.y-zu.org_letters":"500",
|
"mstdn.y-zu.org_letters":"500",
|
||||||
"mstdn.y-zu.org_bbcode":"disabled",
|
"mstdn.y-zu.org_bbcode":"disabled",
|
||||||
"mstdn.y-zu.org_markdown":"disabled"
|
"mstdn.y-zu.org_markdown":"disabled",
|
||||||
|
"imastodon.net":"instance",
|
||||||
|
"imastodon.net_name":"im@stodon",
|
||||||
|
"imastodon.net_letters":"500",
|
||||||
|
"imastodon.net_bbcode":"disabled",
|
||||||
|
"imastodon.net_markdown":"disabled",
|
||||||
|
"imastodon.net_home":"オフィス",
|
||||||
|
"imastodon.net_local":"楽屋",
|
||||||
|
"imastodon.net_notification":"ホワイトボード",
|
||||||
|
"imastodon.net_public":"ライブステージ",
|
||||||
|
"mstdn.osaka":"instance",
|
||||||
|
"mstdn.osaka_name":"大阪丼",
|
||||||
|
"mstdn.osaka_letters":"500",
|
||||||
|
"mstdn.osaka_bbcode":"disabled",
|
||||||
|
"mstdn.osaka_markdown":"disabled",
|
||||||
|
"mstdn.osaka_home":"ウチ",
|
||||||
|
"mstdn.osaka_local":"近所",
|
||||||
|
"mstdn.osaka_notification":"あめちゃん",
|
||||||
|
"mstdn.osaka_public":"新世界"
|
||||||
}
|
}
|
2
ver.json
2
ver.json
|
@ -1 +1 @@
|
||||||
{"warn":"これはGCPにアップして下さい!!","warn2":"これはGCPにアップして下さい!!","warn3":"これはGCPにアップして下さい!!","desk":"Airi (ver.6)","date":"2018-03-17","detail":"内部V:13.6.0|Tootsearch対応他"}
|
{"warn":"これはGCPにアップして下さい!!","warn2":"これはGCPにアップして下さい!!","warn3":"これはGCPにアップして下さい!!","desk":"Airi (ver.7)","date":"2018-03-20","detail":"内部V:13.7.0|バグフィックス,Pleroma暫定対応,カスタム絵文字検索など"}
|
Loading…
Reference in New Issue
Block a user