diff --git a/README.md b/README.md
index 216bdd21..5f5bc8ee 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,11 @@ Contact me(bug report...):GitHub Issues, mention to [Cutls@kirishima.cloud](http
バグレポートなど:GitHub Issuesや[Cutls@kirishima.cloud](https://kirishima.cloud/@Cutls)へのリプ,または#Deskでトゥートして下さい.
+### Contribute/コントリビュート
+
+Please make a pull request to ***WIP(before CI)*** brunch
+***WIP(before CI)*** ブランチにプルリクエストをお願いします。
+
## License/ライセンス
[GNU General Public License v3.0](https://github.com/cutls/TheDesk/blob/master/LICENSE)
diff --git a/app/css/tl.css b/app/css/tl.css
index 891fe985..23298bad 100644
--- a/app/css/tl.css
+++ b/app/css/tl.css
@@ -419,10 +419,6 @@ p:not(:last-child){
max-height: 190px;
overflow-y: scroll;
}
-.u-url {
- color: var(--color);
- cursor: text;
-}
.type-b{
display:none;
}
diff --git a/app/js/lang/lang.en.js b/app/js/lang/lang.en.js
index 858c5c28..3565c150 100644
--- a/app/js/lang/lang.en.js
+++ b/app/js/lang/lang.en.js
@@ -184,6 +184,7 @@ var lang={
"lang_parse_vote":"Voted",
"lang_parse_unvoted":"Show the result without voting",
"lang_parse_endedvote":"Expired",
+ "lang_parse_thread":"Show thread",
//misskey
"lang_misskeyparse_renote":"Repost",
"lang_misskeyparse_renoteqt":"Renote",
diff --git a/app/js/lang/lang.ja.js b/app/js/lang/lang.ja.js
index 8065833c..222928c2 100644
--- a/app/js/lang/lang.ja.js
+++ b/app/js/lang/lang.ja.js
@@ -184,6 +184,7 @@ var lang={
"lang_parse_vote":"投票",
"lang_parse_unvoted":"結果だけ見る",
"lang_parse_endedvote":"終了済み",
+ "lang_parse_thread":"会話を表示",
//misskey
"lang_misskeyparse_renote":"再投稿",
"lang_misskeyparse_renoteqt":"引用",
diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js
index 1252348c..623e41d5 100644
--- a/app/js/tl/datails.js
+++ b/app/js/tl/datails.js
@@ -1,6 +1,11 @@
//トゥートの詳細
-function details(id, acct_id, tlid) {
- $(".toot-reset").html(lang.lang_details_nodata);
+function details(id, acct_id, tlid, mode) {
+ if(mode=="dm"){
+ $(".dm-hide").hide();
+ }else{
+ $(".dm-hide").show();
+ }
+ $(".toot-reset").html(''+lang.lang_details_nodata+'');
var html = $("#timeline_"+tlid+" [toot-id=" + id + "]").html();
$("#toot-this").html(html);
$('#tootmodal').modal('open');
@@ -149,6 +154,9 @@ function replyTL(id, acct_id) {
}
}else{
var templete = parse([json], '', acct_id,"","",mute);
+ if(templete!=""){
+ $("#toot-reply .no-data").hide();
+ }
$("#toot-reply").prepend(templete);
$("#toot-reply .hide").html(lang.lang_details_filtered);
$("#toot-reply .by_filter").css("display","block");
@@ -211,6 +219,9 @@ function context(id, acct_id) {
var mute=[];
}
var templete = parse(json.descendants, '', acct_id,"","",mute);
+ if(templete!=""){
+ $("#toot-after .no-data").hide();
+ }
$("#toot-after").html(templete);
$("#toot-after .hide").html(lang.lang_details_filtered);
$("#toot-after .by_filter").css("display","block");
@@ -262,6 +273,9 @@ function beforeToot(id, acct_id, domain) {
console.error(error);
}).then(function(json) {
var templete = parse(json, 'noauth', acct_id);
+ if(templete!=""){
+ $("#toot-before .no-data").hide();
+ }
$("#toot-before").html(templete);
jQuery("time.timeago").timeago();
});
@@ -309,6 +323,9 @@ function userToot(id, acct_id, user) {
console.error(error);
}).then(function(json) {
var templete = parse(json, '', acct_id);
+ if(templete!=""){
+ $("#user-before .no-data").hide();
+ }
$("#user-before").html(templete);
jQuery("time.timeago").timeago();
});
@@ -335,6 +352,9 @@ function faved(id, acct_id) {
console.error(error);
}).then(function(json) {
var templete = userparse(json, '', acct_id);
+ if(templete!=""){
+ $("#toot-fav .no-data").hide();
+ }
$("#toot-fav").html(templete);
});
}
diff --git a/app/js/tl/dm.js b/app/js/tl/dm.js
index 8167bddd..6732860a 100644
--- a/app/js/tl/dm.js
+++ b/app/js/tl/dm.js
@@ -16,7 +16,7 @@ function dm(acct_id, tlid, type,delc,voice) {
todo(error);
console.error(error);
}).then(function(json) {
- var templete = dmParse(json, type, acct_id, tlid, "", mute);
+ var templete = '
'+dmListParse(json, type, acct_id, tlid, "", mute)+'
';
localStorage.setItem("lastobj_"+ tlid,json[0].id)
$("#timeline_" + tlid).html(templete);
additional(acct_id, tlid);
@@ -27,9 +27,37 @@ function dm(acct_id, tlid, type,delc,voice) {
});
}
+function dmmore(tlid){
+ var multi = localStorage.getItem("column");
+ var obj = JSON.parse(multi);
+ var acct_id = obj[tlid].domain;
+ var domain = localStorage.getItem("domain_" + acct_id);
+ var at = localStorage.getItem("acct_"+ acct_id + "_at");
+ var sid = $("#timeline_" + tlid + " .cvo").last().attr("unique-id");
+ var start = "https://" + domain + "/api/v1/conversations?max_id="+sid;
+ var type="dm";
+ 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 templete = ''+dmListParse(json, type, acct_id, tlid, "", mute)+'
';
+ $("#timeline_" + tlid).append(templete);
+ additional(acct_id, tlid);
+ jQuery("time.timeago").timeago();
+ moreloading=false;
+ })
+}
//DMオブジェクトパーサー(トゥート)
-function dmParse(obj, mix, acct_id, tlid, popup, mutefilter) {
- console.log(obj);
+function dmListParse(obj, mix, acct_id, tlid, popup, mutefilter) {
+ console.log(obj);
var templete = '';
if(obj[0]){
localStorage.setItem("lastunix_"+ tlid,date(obj[0].created_at, 'unix'));
@@ -172,6 +200,7 @@ function dmParse(obj, mix, acct_id, tlid, popup, mutefilter) {
var local = [];
var times=[];
Object.keys(obj).forEach(function(key) {
+ var conv_id=obj[key].id;
var toot = obj[key].last_status;
var dis_name=escapeHTML(toot.account.display_name);
if(toot.account.emojis){
@@ -373,60 +402,6 @@ function dmParse(obj, mix, acct_id, tlid, popup, mutefilter) {
});
tags = '' + tags + '
';
}
- //リプ数
- if(toot.replies_count || toot.replies_count===0){
- var replyct=toot.replies_count;
- }else{
- var replyct="";
- }
- //公開範囲を取得
- var vis = "";
- var visen = toot.visibility;
- if (visen == "public") {
- var vis =
- 'public';
- var can_rt = "";
- } else if (visen == "unlisted") {
- var vis =
- 'lock_open';
- var can_rt = "";
- } else if (visen == "private") {
- var vis =
- 'lock';
- var can_rt = "hide";
- } else if (visen == "direct") {
- var vis =
- 'mail';
- var can_rt = "hide";
- }
- if (toot.account.acct == localStorage.getItem("user_" + acct_id)) {
- var if_mine = "";
- var mine_via="type-b";
- } else {
- var if_mine = "hide";
- var mine_via="";
- }
- 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;
@@ -467,6 +442,13 @@ function dmParse(obj, mix, acct_id, tlid, popup, mutefilter) {
}else{
var trans="";
}
+ if (toot.favourited) {
+ var if_fav = " yellow-text";
+ var fav_app = "faved";
+ } else {
+ var if_fav = "";
+ var fav_app = "";
+ }
//Cards
if (!card && toot.card) {
var cards=toot.card;
@@ -508,7 +490,7 @@ function dmParse(obj, mix, acct_id, tlid, popup, mutefilter) {
}
}
templete = templete + ''+
''+
'';
});
return templete;
-}
\ No newline at end of file
+}
diff --git a/app/js/tl/mix.js b/app/js/tl/mix.js
index 4fa11a27..b58167dd 100644
--- a/app/js/tl/mix.js
+++ b/app/js/tl/mix.js
@@ -54,13 +54,12 @@ function mixtl(acct_id, tlid, type,delc,voice) {
var mute=[];
}
if(type=="integrated"){
- templete = templete+parse([timeline[key]], '', acct_id, tlid, "", mute);
+ templete = templete+parse([timeline[key]], '', acct_id, tlid, "", mute, "mix");
}else if(type=="plus"){
if(timeline[key].account.acct==timeline[key].account.username){
- templete = templete+parse([timeline[key]], '', acct_id, tlid, "", mute);
+ templete = templete+parse([timeline[key]], '', acct_id, tlid, "", mute, "plus");
}
}
-
}
}
@@ -124,7 +123,7 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
if(voice){
say(obj.content)
}
- var templete = parse([obj], type, acct_id, tlid,"",mute);
+ var templete = parse([obj], type, acct_id, tlid,"",mute, "mix");
var pool = localStorage.getItem("pool_" + tlid);
if (pool) {
pool = templete + pool;
@@ -168,7 +167,7 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
var templete = parse([obj], '', acct_id, tlid);
}else if(TLtype=="plus"){
if(obj.account.acct==obj.account.username){
- var templete = parse([obj], '', acct_id, tlid,"",mute);
+ var templete = parse([obj], '', acct_id, tlid,"",mute, "mix");
}else{
var templete="";
}
@@ -177,7 +176,7 @@ function mixre(acct_id, tlid, TLtype, mute,delc,voice,mode) {
if(voice){
say(obj.content)
}
- var templete = parse([obj], type, acct_id, tlid,"",mute);
+ var templete = parse([obj], type, acct_id, tlid,"",mute,"mix");
var pool = localStorage.getItem("pool_" + tlid);
if (pool) {
pool = templete + pool;
@@ -291,10 +290,10 @@ function mixmore(tlid,type) {
var mute=[];
}
if(type=="integrated"){
- templete = templete+parse([timeline[key]], '', acct_id, tlid,"",mute);
+ templete = templete+parse([timeline[key]], '', acct_id, tlid,"",mute,"mix");
}else if(type=="plus"){
if(timeline[key].account.acct==timeline[key].account.username){
- templete = templete+parse([timeline[key]], '', acct_id, tlid,"",mute);
+ templete = templete+parse([timeline[key]], '', acct_id, tlid,"",mute,"mix");
}
}
}
diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js
index baab4ed7..0aff8314 100644
--- a/app/js/tl/parse.js
+++ b/app/js/tl/parse.js
@@ -1,5 +1,5 @@
//オブジェクトパーサー(トゥート)
-function parse(obj, mix, acct_id, tlid, popup, mutefilter) {
+function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) {
var templete = '';
if(obj[0]){
if(tlid===1){
@@ -145,6 +145,16 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) {
var noauth="";
var antinoauth="hide";
}
+ //DMTL
+ if(type=="dm"){
+ var dmHide="hide";
+ var antidmHide="";
+ }else{
+ var dmHide="";
+ var antidmHide="hide";
+ }
+
+
//マウスオーバーのみ
var mouseover=localStorage.getItem("mouseover");
if(!mouseover){
@@ -163,6 +173,10 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) {
var times=[];
Object.keys(obj).forEach(function(key) {
var toot = obj[key];
+ if(type=="dm"){
+ var dmid=toot.id;
+ toot=toot.last_status;
+ }
var dis_name=escapeHTML(toot.account.display_name);
if(toot.account.emojis){
var actemojick = toot.account.emojis[0];
@@ -745,6 +759,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) {
'' +
'
'+vis+'
'+
'
' +
+ '
' +
'
' +
'
' +
'';
});
diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js
index 7b47a478..b73709af 100644
--- a/app/js/tl/tl.js
+++ b/app/js/tl/tl.js
@@ -58,7 +58,7 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
dm(acct_id, tlid, "plus",delc,voice);
$("#notice_" + tlid).text(cap(type, data, acct_id) + "(" + localStorage.getItem(
"user_" + acct_id) + "@" + domain + ")");
- $("#notice_icon_" + tlid).text("notifications");
+ $("#notice_icon_" + tlid).text("mail_outline");
return;
}*/
localStorage.setItem("now", type);
@@ -113,7 +113,11 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
url=url+"local=true";
}
}
- var start = "https://" + domain + "/api/v1/timelines/" + url;
+ if(type=="dm"){
+ var start = "https://" + domain + "/api/v1/conversations";
+ }else{
+ var start = "https://" + domain + "/api/v1/timelines/" + url;
+ }
var method="GET";
var i={
method: method,
@@ -138,7 +142,7 @@ function tl(type, data, acct_id, tlid, delc, voice, mode) {
if(misskey){
var templete = misskeyParse(json, type, acct_id, tlid, "", mute);
}else{
- var templete = parse(json, type, acct_id, tlid, "", mute);
+ var templete = parse(json, type, acct_id, tlid, "", mute, type);
localStorage.setItem("lastobj_"+ tlid,json[0].id)
}
$("#timeline_" + tlid).html(templete);
@@ -288,7 +292,7 @@ function reload(type, cc, acct_id, tlid, data, mute, delc, voice, mode) {
if(voice){
say(obj.content)
}
- var templete = parse([obj], type, acct_id, tlid,"",mute);
+ var templete = parse([obj], type, acct_id, tlid,"",mute, type);
if ($("timeline_box_"+tlid+"_box .tl-box").scrollTop() === 0) {
$("#timeline_" + tlid).prepend(templete);
}else{
@@ -427,6 +431,10 @@ function moreload(type, tlid) {
var misskey=false;
var start = "https://" + domain + "/api/v1/timelines/" + com(type,data) +
"max_id=" + sid;
+ if(type=="dm"){
+ var start = "https://" + domain + "/api/v1/conversations?" +
+ "max_id=" + sid;
+ }
var method="GET";
var i={
method: method,
@@ -441,10 +449,11 @@ function moreload(type, tlid) {
todo(error);
console.error(error);
}).then(function(json) {
+ console.log(json);
if(misskey){
var templete = misskeyParse(json, '', acct_id, tlid,"",mute);
}else{
- var templete = parse(json, '', acct_id, tlid,"",mute);
+ var templete = parse(json, '', acct_id, tlid,"",mute, type);
}
$("#timeline_" + tlid).append(templete);
additional(acct_id, tlid);
diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js
index 408fc5ba..3843d0a3 100644
--- a/app/js/ui/layout.js
+++ b/app/js/ui/layout.js
@@ -54,10 +54,11 @@ function parseColumn() {
}
var acctlist=obj;
console.log(obj);
- var xed=localStorage.getItem("xed");
+ /*
+var xed=localStorage.getItem("xed");
if(xed){
xpand();
- }
+ }*/
var col = localStorage.getItem("column");
if (!col) {
var obj = [{
diff --git a/app/package.json b/app/package.json
index 7dc28694..206f712c 100644
--- a/app/package.json
+++ b/app/package.json
@@ -1,6 +1,6 @@
{
"name": "thedesk",
- "version": "18.0.2",
+ "version": "18.0.3",
"description": "TheDesk is a Mastodon client for PC.",
"main": "main.js",
"scripts": {
@@ -53,13 +53,20 @@
"output": "../build"
},
"win": {
- "icon": "thedesk.ico",
+ "icon": "build/thedesk.ico",
"target": [
"nsis",
"portable",
"appx"
]
},
+ "appx": {
+ "identityName":"53491Cutls.TheDesk",
+ "applicationId":"Cutls.TheDesk",
+ "publisherDisplayName":"Cutls",
+ "publisher":"CN=629757F5-A5EE-474F-9562-B304A89A9FD1",
+ "languages":["JA-JP","EN-US"]
+ },
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,
diff --git a/app/thedesk.ico b/app/thedesk.ico
deleted file mode 100644
index 40dedc0f..00000000
Binary files a/app/thedesk.ico and /dev/null differ
diff --git a/app/view/en/index.html b/app/view/en/index.html
index bf30c904..b5a163c8 100644
--- a/app/view/en/index.html
+++ b/app/view/en/index.html
@@ -32,7 +32,7 @@