TheDesk Riina (ver.1)
This commit is contained in:
parent
51097abce6
commit
4588b646a9
15
README.md
15
README.md
|
@ -1,7 +1,20 @@
|
|||
# TheDesk
|
||||
Mastodon client for Windows
|
||||
オープンソースSNSマストドンのWindowsクライアント
|
||||
Download:[TheDesk](https://thedesk.top)
|
||||
Download:[TheDesk](https://thedesk.top)
|
||||
Latest Info(Markdown Toot)/最新情報(マークダウン形式のトゥート): [LATEST.md](https://github.com/cutls/TheDesk/blob/master/LATEST.md)
|
||||
|
||||
## Developer/作った人
|
||||
|
||||
### Cutls P
|
||||
<img src="https://thedesk.top/img/desk.png" width="100px">
|
||||
|
||||
I'm developing TheDesk on Mastodon in Nishinomiya and Kyoto, Japan.
|
||||
My works:[Cutls Portal](https://the.cutls.com)
|
||||
Contact me(bug report...):GitHub Issues, mention to [Cutls@kirishima.cloud](https://kirishima.cloud/@Cutls) or toot with #Desk
|
||||
|
||||
TheDeskを関西で開発しています。[Cutls Portal](https://the.cutls.com)で他のサービスをご覧いただけます。
|
||||
バグレポートなど:GitHub Issuesや[Cutls@kirishima.cloud](https://kirishima.cloud/@Cutls)へのリプ、または#Deskでトゥートして下さい。
|
||||
|
||||
## License
|
||||
|
||||
|
|
14
app/LATEST.md
Normal file
14
app/LATEST.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
[TheDesk](https://thedesk.top) :thedesk: Riina (ver.1)
|
||||
コードネーム変更です(内部verは12)。この次のコードネームはAiriです。
|
||||
- UIを大幅刷新しています。
|
||||
- 全体的にコンパクトになりました。もしかしたら文字サイズを下げたほうが見やすいかもしれません。
|
||||
- via表示が長い場合は省略します。カーソルを合わせると全て表示します。
|
||||
- 左下にそのトゥートの公開情報が表示されます。アイコンの説明はカーソルを合わせると確認できます。
|
||||
- トゥートの公開情報のアイコンを押すと,そのトゥートのURLがコピーされます。
|
||||
- トゥートボックスの上部の青いプロフのボタンで自分のプロフィールを確認
|
||||
- URLスキームに対応(thedesk://)
|
||||
- これによりログイン時にコードを貼り付ける必要がなくなりました。"Electronで開く"を押して下さい。
|
||||
- thedesk://user/?code=**ユーザーID**でユーザーデータが開きます。
|
||||
- 一部バグ修正
|
||||
|
||||
:github: [cutls/TheDesk](https://github.com/cutls/TheDesk) #Desk #DeskUpdate
|
|
@ -42,6 +42,56 @@ iframe {
|
|||
padding-left: 5px;
|
||||
padding-right: 2px;
|
||||
word-break: break-all;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: 43px 1fr 0.5fr;
|
||||
grid-template-areas: 'notice notice notice' 'icon display_name acct' 'icon toot toot' 'icon date_via date_via' 'actions actions actions';
|
||||
}
|
||||
|
||||
.area-notice {
|
||||
margin:2px;
|
||||
grid-area: notice;
|
||||
}
|
||||
|
||||
.area-icon {
|
||||
width:40px;
|
||||
margin:2px;
|
||||
grid-area: icon;
|
||||
}
|
||||
|
||||
.area-display_name {
|
||||
height:1.2em;
|
||||
margin:2px;
|
||||
grid-area: display_name;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.area-acct {
|
||||
margin:2px;
|
||||
grid-area: acct;
|
||||
text-align:right;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.area-toot {
|
||||
margin:2px;
|
||||
grid-area: toot;
|
||||
}
|
||||
|
||||
.area-date_via {
|
||||
grid-area: date_via;
|
||||
}
|
||||
|
||||
.area-actions {
|
||||
margin:2px;
|
||||
grid-area: actions;
|
||||
}
|
||||
|
||||
.action i{
|
||||
font-size:1rem;
|
||||
}
|
||||
.gray {
|
||||
color: gray;
|
||||
|
@ -74,10 +124,14 @@ iframe {
|
|||
vertical-align: middle;
|
||||
background-color: #777;
|
||||
border-radius: 10px;
|
||||
width:70px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.shared {
|
||||
background-color: #cfd8dc;
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<script type="text/javascript" src="./js/common/keyshortcut.js"></script>
|
||||
<script type="text/javascript" src="./js/common/modal.js"></script>
|
||||
<script>
|
||||
var ver="Miho (ver.14)";
|
||||
var ver="Riina (ver.1)";
|
||||
//betaを入れるとバージョンチェックしない
|
||||
//var ver="beta";
|
||||
var acct_id=0;
|
||||
|
|
|
@ -5,6 +5,18 @@ localStorage.removeItem("kirishima")
|
|||
function ck() {
|
||||
var domain = localStorage.getItem("domain_0");
|
||||
var at = localStorage.getItem(domain + "_at");
|
||||
//コード受信
|
||||
if(location.search){
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=([a-zA-Z-0-9]+)/);
|
||||
var mode=m[1];
|
||||
var codex=m[2];
|
||||
if(mode=="manager" || mode=="login"){
|
||||
code(codex,mode);
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if (at) {
|
||||
ckdb(0);
|
||||
$("#tl").show();
|
||||
|
@ -17,7 +29,6 @@ function ck() {
|
|||
}
|
||||
}
|
||||
ck();
|
||||
|
||||
//ログインポップアップ
|
||||
function login(url) {
|
||||
var start = "https://" + url + "/api/v1/apps";
|
||||
|
@ -29,7 +40,7 @@ function login(url) {
|
|||
body: JSON.stringify({
|
||||
scopes: 'read write follow',
|
||||
client_name: "TheDesk(PC)",
|
||||
redirect_uris: 'urn:ietf:wg:oauth:2.0:oob',
|
||||
redirect_uris: 'thedesk://login',
|
||||
website: "https://thedesk.top"
|
||||
})
|
||||
}).then(function(response) {
|
||||
|
@ -40,7 +51,7 @@ function login(url) {
|
|||
}).then(function(json) {
|
||||
var auth = "https://" + url + "/oauth/authorize?client_id=" + json[
|
||||
"client_id"] + "&client_secret=" + json["client_secret"] +
|
||||
"&response_type=code&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=read+write+follow";
|
||||
"&response_type=code&redirect_uri=thedesk://login&scope=read+write+follow";
|
||||
localStorage.setItem("domain_" + acct_id, url);
|
||||
localStorage.setItem("client_id", json["client_id"]);
|
||||
localStorage.setItem("client_secret", json["client_secret"]);
|
||||
|
@ -50,7 +61,10 @@ function login(url) {
|
|||
shell
|
||||
} = require('electron');
|
||||
|
||||
shell.openExternal(auth);
|
||||
shell.openExternal(auth);
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('quit', 'go');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -60,10 +74,17 @@ function instance() {
|
|||
login(url);
|
||||
}
|
||||
|
||||
|
||||
//コードを入れた後認証
|
||||
function code() {
|
||||
var code = $("#code").val();
|
||||
var url = localStorage.getItem("domain_" + acct_id);
|
||||
function code(code,mode) {
|
||||
if(!code){
|
||||
var code = $("#code").val();
|
||||
}
|
||||
if(localStorage.getItem("domain_tmp")){
|
||||
var url = localStorage.getItem("domain_tmp");
|
||||
}else{
|
||||
var url = localStorage.getItem("domain_" + acct_id);
|
||||
}
|
||||
var start = "https://" + url + "/oauth/token";
|
||||
var id = localStorage.getItem("client_id");
|
||||
var secret = localStorage.getItem("client_secret");
|
||||
|
@ -74,7 +95,7 @@ function code() {
|
|||
},
|
||||
body: JSON.stringify({
|
||||
grant_type: "authorization_code",
|
||||
redirect_uri: "urn:ietf:wg:oauth:2.0:oob",
|
||||
redirect_uri: "thedesk://"+mode,
|
||||
client_id: id,
|
||||
client_secret: secret,
|
||||
code: code
|
||||
|
@ -85,14 +106,20 @@ function code() {
|
|||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
todo(json);
|
||||
if (json["access_token"]) {
|
||||
localStorage.setItem(url + "_at", json["access_token"]);
|
||||
getdata();
|
||||
if(mode=="manager"){
|
||||
getdataAdv(url, json["access_token"]);
|
||||
}else{
|
||||
getdata();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//名前とか@とか取得
|
||||
//ユーザーデータ取得(最初)
|
||||
function getdata() {
|
||||
var acct_id = 0;
|
||||
var domain = localStorage.getItem("domain_" + acct_id);
|
||||
|
@ -131,13 +158,57 @@ function getdata() {
|
|||
localStorage.setItem("user_" + acct_id, json["acct"]);
|
||||
localStorage.setItem("user-id_" + acct_id, json["id"]);
|
||||
localStorage.setItem("prof_" + acct_id, json["avatar"]);
|
||||
$("#my-prof").attr("src", json["avatar"]);
|
||||
$("#masara").hide();
|
||||
$("#auth").hide();
|
||||
$("#tl").show();
|
||||
parseColumn()
|
||||
ckdb();
|
||||
});
|
||||
}
|
||||
//ユーザーデータ取得(追加)
|
||||
function getdataAdv(domain, at) {
|
||||
var start = "https://" + domain + "/api/v1/accounts/verify_credentials";
|
||||
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) {
|
||||
console.log(json);
|
||||
if (json.error) {
|
||||
console.error("Error:" + json.error);
|
||||
Materialize.toast("エラーが発生しました。しばらく待ってから再起動してください。Error:" + json.error,
|
||||
5000);
|
||||
return;
|
||||
}
|
||||
var add = {
|
||||
at: at,
|
||||
name: json["display_name"],
|
||||
domain: domain,
|
||||
user: json["acct"],
|
||||
prof: json["avatar"],
|
||||
id: json["id"]
|
||||
};
|
||||
var multi = localStorage.getItem("multi");
|
||||
var obj = JSON.parse(multi);
|
||||
var target = obj.lengtth;
|
||||
obj.push(add);
|
||||
localStorage.setItem("name_" + target, json["display_name"]);
|
||||
localStorage.setItem("user_" + target, json["acct"]);
|
||||
localStorage.setItem("user-id_" + target, json["id"]);
|
||||
localStorage.setItem("prof_" + target, json["avatar"]);
|
||||
console.log(obj);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("multi", json);
|
||||
location.href="index.html";
|
||||
});
|
||||
}
|
||||
|
||||
//TheDesk独自のマストドンDBでMarkdownやBBCodeの対応、文字数制限をチェック
|
||||
function ckdb(acct_id) {
|
||||
|
@ -250,13 +321,4 @@ function multi() {
|
|||
$('select').material_select('update');
|
||||
});
|
||||
}
|
||||
//現在使用停止(Uzukiより前)
|
||||
function multiLogin(target) {
|
||||
var multi = localStorage.getItem("multi");
|
||||
var obj = JSON.parse(multi);
|
||||
var acct = obj[target];
|
||||
localStorage.setItem("domain_" + target, acct.domain);
|
||||
localStorage.setItem(domain + "_at", acct.at);
|
||||
localStorage.setItem("acct", target);
|
||||
location.href = "index.html";
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ function multiDel(target) {
|
|||
|
||||
//サポートインスタンス
|
||||
function support() {
|
||||
var start = "https://desk.cutls.com/mastodon_data.json";
|
||||
var start = "https://dl.thedesk.top/mastodon_data.json";
|
||||
fetch(start, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
|
@ -154,8 +154,8 @@ function login(url) {
|
|||
body: JSON.stringify({
|
||||
scopes: 'read write follow',
|
||||
client_name: "TheDesk(PC)",
|
||||
redirect_uris: 'urn:ietf:wg:oauth:2.0:oob',
|
||||
website: "https://desk.cutls.com"
|
||||
redirect_uris: 'thedesk://manager',
|
||||
website: "https://thedesk.top"
|
||||
})
|
||||
}).then(function(response) {
|
||||
return response.json();
|
||||
|
@ -163,9 +163,10 @@ function login(url) {
|
|||
todo(error);
|
||||
console.error(error);
|
||||
}).then(function(json) {
|
||||
console.log(json);
|
||||
var auth = "https://" + url + "/oauth/authorize?client_id=" + json[
|
||||
"client_id"] + "&client_secret=" + json["client_secret"] +
|
||||
"&response_type=code&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=read+write+follow";
|
||||
"&response_type=code&scope=read+write+follow&redirect_uri="+json.redirect_uri;
|
||||
localStorage.setItem("domain_tmp", url);
|
||||
localStorage.setItem("client_id", json["client_id"]);
|
||||
localStorage.setItem("client_secret", json["client_secret"]);
|
||||
|
@ -175,7 +176,10 @@ function login(url) {
|
|||
shell
|
||||
} = require('electron');
|
||||
|
||||
shell.openExternal(auth);
|
||||
shell.openExternal(auth);
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('quit', 'go');
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -186,8 +190,10 @@ function instance() {
|
|||
}
|
||||
|
||||
//コード入れてAccessTokenゲット
|
||||
function code() {
|
||||
var code = $("#code").val();
|
||||
function code(code) {
|
||||
if(!code){
|
||||
var code = $("#code").val();
|
||||
}
|
||||
var url = localStorage.getItem("domain_tmp");
|
||||
localStorage.removeItem("domain_tmp");
|
||||
var start = "https://" + url + "/oauth/token";
|
||||
|
|
|
@ -28,12 +28,12 @@ function fav(id, acct_id) {
|
|||
} else {
|
||||
$("[toot-id=" + id + "] .rt_ct").text(json.reblog.reblogs_count);
|
||||
}
|
||||
if ($("#pub_" + id).hasClass("faved")) {
|
||||
$("#pub_" + id).removeClass("faved");
|
||||
$("#fav_" + id).removeClass("yellow-text");
|
||||
if ($("[toot-id=" + id +"]").hasClass("faved")) {
|
||||
$("[toot-id=" + id +"]").removeClass("faved");
|
||||
$(".fav_" + id).removeClass("yellow-text");
|
||||
} else {
|
||||
$("#pub_" + id).addClass("faved");
|
||||
$("#fav_" + id).addClass("yellow-text");
|
||||
$("[toot-id=" + id +"]").addClass("faved");
|
||||
$(".fav_" + id).addClass("yellow-text");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -74,12 +74,12 @@ function rt(id, acct_id) {
|
|||
$("[toot-id=" + id + "] .rt_ct").text(json.reblog.reblogs_count);
|
||||
}
|
||||
|
||||
if ($("#pub_" + id).hasClass("rted")) {
|
||||
$("#pub_" + id).removeClass("rted");
|
||||
$("#rt_" + id).removeClass("teal-text");
|
||||
if ($("[toot-id=" + id +"]").hasClass("rted")) {
|
||||
$("[toot-id=" + id +"]").removeClass("rted");
|
||||
$(".rt_" + id).removeClass("teal-text");
|
||||
} else {
|
||||
$("#pub_" + id).addClass("rted");
|
||||
$("#rt_" + id).addClass("teal-text");
|
||||
$("[toot-id=" + id +"]").addClass("rted");
|
||||
$(".rt_" + id).addClass("teal-text");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -278,3 +278,8 @@ function addDomainblock() {
|
|||
var domain = $("#domainblock").val();
|
||||
domainblock(domain, 'POST');
|
||||
}
|
||||
//URLコピー
|
||||
function tootUriCopy(url){
|
||||
execCopy(url);
|
||||
Materialize.toast("トゥートURLをコピーしました", 1500);
|
||||
}
|
|
@ -49,7 +49,7 @@ function parse(obj, mix, acct_id) {
|
|||
var locked = "";
|
||||
}
|
||||
if (!toot.application) {
|
||||
var via = "<i>Unknown</i>";
|
||||
var via = '<span style="font-style: italic;">Unknown</span>';
|
||||
} else {
|
||||
var via = toot.application.name;
|
||||
}
|
||||
|
@ -146,6 +146,18 @@ function parse(obj, mix, acct_id) {
|
|||
',\'add\')" class="pointer">#' + tag.name + '</a> ';
|
||||
});
|
||||
}
|
||||
//公開範囲を取得
|
||||
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>';
|
||||
}
|
||||
if (toot.account.acct == localStorage.getItem("user_" + acct_id)) {
|
||||
var if_mine = "";
|
||||
} else {
|
||||
|
@ -165,22 +177,65 @@ function parse(obj, mix, acct_id) {
|
|||
var if_rt = "";
|
||||
var rt_app = "";
|
||||
}
|
||||
templete = templete + '<div id="pub_' + toot.id + '" class="cvo ' +
|
||||
boostback + ' ' + fav_app + ' ' + rt_app +
|
||||
' '+ hasmedia + '" toot-id="' + id + '" unixtime="' + date(obj[
|
||||
key].created_at, 'unix') + '">'+
|
||||
'<div class="area-notice"><span class="gray sharesta">' + notice + 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 +
|
||||
'" width="40" class="prof-img" user="' + toot.account.acct +
|
||||
'"></a></div>'+
|
||||
'<div class="area-display_name"><span class="user">' +
|
||||
toot.account.display_name + '</span></div>'+
|
||||
'<div class="area-acct"><span class="sml gray" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> @' +
|
||||
toot.account.acct + locked + '</span></div>'+
|
||||
'<div class="area-toot"><span class="toot ' + spoiler + '">' + content + '</span><span class="' +
|
||||
api_spoil + ' cw_text_' + toot.id + '">' + spoil + spoiler_show +
|
||||
'</span>' +
|
||||
'' + viewer + '' +
|
||||
'<span class="additional">' + analyze + '</span></div>'+
|
||||
'<div class="area-date_via">'+ mentions + tags +'</div>'+
|
||||
'<div class="area-actions" style="padding:0; margin:0; top:-20px; display:flex; justify-content:space-around; max-width:100%; ">' +
|
||||
'<div class="action">'+ vis +'</div><div class="action"><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 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 ' +
|
||||
if_rt + ' rt_' + toot.id + '"></i><span class="rt_ct">' + toot.reblogs_count +
|
||||
'</span></a></div>' +
|
||||
'<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' +
|
||||
if_fav + ' fav_' + toot.id + '"></i><span class="fav_ct">' + toot.favourites_count +
|
||||
'</a></span></div>' +
|
||||
'<div class="' + if_mine + ' action"><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 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></a></div>' +
|
||||
'<div><span class="cbadge"><i class="fa fa-clock-o"></i>' +
|
||||
date(toot.created_at, datetype) + '</span></div>' +
|
||||
'<div><span class="cbadge" title="via ' + $.strip_tags(via) + '">via ' + via +
|
||||
'</span></div></div></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-end;">' +
|
||||
'<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>' +
|
||||
'"></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>' +
|
||||
'' +
|
||||
'<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>' +
|
||||
|
@ -199,22 +254,22 @@ function parse(obj, mix, 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 + '" 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></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 + '" 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 +
|
||||
'</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>' +
|
||||
'<div class="divider"></div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
|
||||
*/
|
||||
});
|
||||
if (mix == "mix") {
|
||||
return [templete, local]
|
||||
|
|
|
@ -259,12 +259,14 @@ element.onmousewheel = function(e) {
|
|||
zoom(0.9)
|
||||
}
|
||||
}
|
||||
//当該トゥート
|
||||
function detFromImg(){
|
||||
var id=$("#imagemodal").attr("data-id");
|
||||
var acct_id=$("#imagemodal").attr("data-acct");
|
||||
$('#imagemodal').modal('close');
|
||||
details(id,acct_id);
|
||||
}
|
||||
//画像保存
|
||||
function dlImg(){
|
||||
var url=$("#imgmodal").attr("src");
|
||||
var electron = require("electron");
|
||||
|
|
|
@ -133,11 +133,17 @@
|
|||
var multi = localStorage.getItem("column");
|
||||
var obj = JSON.parse(multi);
|
||||
//聞く
|
||||
if (confirm("このコラムを削除します")) {
|
||||
localStorage.removeItem("card_" + tlid);
|
||||
obj.splice(tlid, 1);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("column", json);
|
||||
parseColumn();
|
||||
}
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
ipc.send('column-del', "");
|
||||
ipc.on('column-del-reply', function (event, arg) {
|
||||
console.log(arg);
|
||||
if(arg==0){
|
||||
localStorage.removeItem("card_" + tlid);
|
||||
obj.splice(tlid, 1);
|
||||
var json = JSON.stringify(obj);
|
||||
localStorage.setItem("column", json);
|
||||
parseColumn();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
//ユーザーデータ表示
|
||||
localStorage.removeItem("history");
|
||||
//コード受信
|
||||
if(location.search){
|
||||
var m = location.search.match(/\?mode=([a-zA-Z-0-9]+)\&code=([a-zA-Z-0-9]+)/);
|
||||
var mode=m[1];
|
||||
var codex=m[2];
|
||||
if(mode=="user"){
|
||||
udg(codex,0);
|
||||
}
|
||||
}
|
||||
function udg(user, acct_id) {
|
||||
if (!user) {
|
||||
user = localStorage.getItem("user-id_"+acct_id);
|
||||
|
|
36
app/main.js
36
app/main.js
|
@ -38,8 +38,24 @@ function createWindow() {
|
|||
// メイン画面の表示。ウィンドウの幅、高さを指定できる
|
||||
mainWindow = new BrowserWindow(window_size);
|
||||
electron.session.defaultSession.clearCache(() => {})
|
||||
mainWindow.loadURL('file://' + __dirname + '/index.html');
|
||||
|
||||
if(process.argv){
|
||||
if(process.argv[1]){
|
||||
var m = process.argv[1].match(/([a-zA-Z0-9]+)\/\?[a-zA-Z-0-9]+=([a-zA-Z-0-9]+)/);
|
||||
if(m){
|
||||
var mode=m[1];
|
||||
var code=m[2];
|
||||
mainWindow.loadURL('file://' + __dirname + '/index.html?mode='+mode+'&code='+code);
|
||||
}else{
|
||||
//mainWindow.loadURL('file://' + __dirname + '/index.html?mode=A&code=B');
|
||||
mainWindow.loadURL('file://' + __dirname + '/index.html');
|
||||
}
|
||||
}else{
|
||||
mainWindow.loadURL('file://' + __dirname + '/index.html');
|
||||
}
|
||||
|
||||
}else{
|
||||
mainWindow.loadURL('file://' + __dirname + '/index.html');
|
||||
}
|
||||
// ウィンドウが閉じられたらアプリも終了
|
||||
mainWindow.on('closed', function() {
|
||||
mainWindow = null;
|
||||
|
@ -54,7 +70,7 @@ var ipc = electron.ipcMain;
|
|||
ipc.on('update', function(e, x, y) {
|
||||
var window = new BrowserWindow({
|
||||
width: 600,
|
||||
height: 350,
|
||||
height: 400,
|
||||
"transparent": false, // ウィンドウの背景を透過
|
||||
"frame": false, // 枠の無いウィンドウ
|
||||
"resizable": false
|
||||
|
@ -140,4 +156,16 @@ ipc.on('about', (e, args) => {
|
|||
css_path: join(__dirname, './css/about.css'),
|
||||
adjust_window_size: true
|
||||
});
|
||||
});
|
||||
});
|
||||
ipc.on('column-del', (e, args) => {
|
||||
const options = {
|
||||
type: 'info',
|
||||
title: 'カラム削除',
|
||||
message: "カラムを削除しますか?",
|
||||
buttons: ['はい', 'いいえ']
|
||||
}
|
||||
dialog.showMessageBox(options, function(index) {
|
||||
mainWindow.webContents.send('column-del-reply', index);
|
||||
})
|
||||
});
|
||||
app.setAsDefaultProtocolClient('thedesk')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "TheDesk",
|
||||
"version": "11.14.0",
|
||||
"version": "12.1.0",
|
||||
"description": "TheDesk on Mastodonはシンプルと多機能を両立したデスクトップ向けクライアントです",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -135,10 +135,12 @@
|
|||
<a href="https://thedesk.top" class="btn waves-effect deep-purple lighten-2" style="width:100%; max-width:500px;">公式HP</a><br>
|
||||
<a href="https://enty.jp/Cutls" class="btn waves-effect purple lighten-2" style="width:100%; max-width:500px;">寄付(Enty)</a><br>
|
||||
<a href="https://github.com/cutls/TheDesk" class="btn waves-effect black lighten-2" style="width:100%; max-width:500px;">GitHub</a><br>
|
||||
<a href="index.html?mode=open&code=12336" class="btn waves-effect blue lighten-2" style="width:100%; max-width:500px;">Developer: Cutls@kirishima.cloud</a>
|
||||
<br>
|
||||
|
||||
<span style="font-family:Open Sans;">
|
||||
Copyright © TheDesk on Mastodon 2018 & Cutls.com 2015 All Rights Reserved. <a href="https://github.com/cutls/TheDesk/blob/master/LICENSE.md">TheDesk LICENSE (Latest Ver.)</a><br>
|
||||
Developer: Cutls P(@Cutls@kirishima.cloud)<br>
|
||||
Developer: Cutls P(<a href="index.html?mode=open&code=12336">@Cutls@kirishima.cloud</a>)<br>
|
||||
</span>
|
||||
|
||||
<script type="text/javascript" src="./js/common/about.js"></script>
|
||||
|
|
|
@ -21,9 +21,11 @@
|
|||
<div class="determinate" style="width: 0%"></div>
|
||||
</div><br>
|
||||
アップデートはセキュアかつ高速なAmazon CloudFront CDNを通じて提供されます。<br>
|
||||
アップデート内容の詳細は<a href="https://github.com/cutls/TheDesk/blob/master/LATEST.md">GitHub</a>をご覧ください。<br><br>
|
||||
<a onclick="window.close();" class="pointer">このアップデートを飛ばす</a>(次回TL表示時まで有効)<br><a onclick="quit()" class="pointer">このソフト終了</a><br>
|
||||
<a onclick="about()" class="pointer">このソフトについて</a>
|
||||
<script type="text/javascript" src="./js/common/about.js"></script>
|
||||
<script type="text/javascript" src="./js/platform/end.js"></script>
|
||||
<script>
|
||||
var electron = require("electron");
|
||||
var ipc = electron.ipcRenderer;
|
||||
|
|
Loading…
Reference in New Issue
Block a user