diff --git a/app/index.html b/app/index.html index 49b2c49d..65e7a91e 100644 --- a/app/index.html +++ b/app/index.html @@ -1,810 +1,5 @@ - TheDesk - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
Drag here to upload -
- -
-
-
-
- -
- -
- - - -
-
- -
- - cancel - - -
-
-
-format_bold -format_italic -format_underlined -strikethrough_s -format_quote -short_text -code -format_list_bulleted -format_list_numbered - - -autorenew -flare -swap_vert -swap_horiz - -Markdownエディタを隠す - -
-format_size -px -color_lens - -
-link -  - -
-image -  - -
-
-
-
-
- -Edit - -
-
- - - -
- -Preview - - -Markdownエディタを表示 - - -
-
- visibility_off - public - CW - photo_library - format_shapes - tag_faces - music_note - clear -
-
-
- -Reply: -No/Attaching files: -None/Adjust status privacy: -public - -
- -
-
- - - - - - -
-
- -
-
- -
- - Refresh emojis list - cancel -
-
- -
-
-
- - / - - -
-
- are shown.
Some emojis are not able to be inserted. -
- - add - - - people - - - local_florist - - - restaurant - - - directions_run - - - directions_car - - - attach_file - - - gesture - - - flag - - - - -
-
- - - - - - - - - - - -
- chevron_right  - expand_less  - close -
-
-
- -
-
Select an account -
- - -
-
-
- - -
-
Show this TL: - -
-
- -
-
-
- -
-
- -
-search - - - -
-
-
- -
- -
- -
- - -
-
- -
-
- - -
-
- -
-

-
-
- - -
- -
-
- - -
-
- -
-
- -
- Filter contexts
- - - - - - - -
- Options
- -
- Nice for Latin language
- -
- Filtered toots will disappear irreversibly, even if filter is later removed
- Expire afterUnset or "0" means "Never"This value may contain some error

- days - hours - minutes -
- Integrated TL/Plus TL will hide both Home-filtering words and Local-filtering words. -
-
- -
-

Welcome to TheDesk


Add an account or click add to add a column. -
-
- - -
-
-
- -
- -
-
- - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/index.sample.html b/app/index.sample.html index f660c3ed..02807337 100644 --- a/app/index.sample.html +++ b/app/index.sample.html @@ -155,6 +155,9 @@ var lang="{{lang}}";
  • 限定公開(Limited)
  • +
  • + {{localJP}}(Local) +
  • {{directJP}}(Direct)
  • @@ -238,7 +241,8 @@ var lang="{{lang}}";
    more_horiz{{thisToot}}
    -
    +
    +
  • diff --git a/app/js/lang/setting.lang.js b/app/js/lang/setting.lang.js index 39543ccd..4a469f53 100644 --- a/app/js/lang/setting.lang.js +++ b/app/js/lang/setting.lang.js @@ -22,6 +22,10 @@ var lang_setting_cws={ "ja":"標準でCW:{{set}}", "en":"Always CW on:{{set}}" } +var lang_setting_rp={ + "ja":"リプライ数表示:{{set}}", + "en":"Reply counter:{{set}}" +} var lang_setting_vis={ "ja":"デフォルトの公開設定を{{set}}に設定しました。", "en":"Default visibility:{{set}}" diff --git a/app/js/login/instance.js b/app/js/login/instance.js index 02068ac5..f768144c 100644 --- a/app/js/login/instance.js +++ b/app/js/login/instance.js @@ -5,32 +5,38 @@ var idata={ "kirishima.cloud_letters":"6229", "kirishima.cloud_bbcode":"enabled", "kirishima.cloud_markdown":"enabled", + "kirishima.cloud_glitch":"enabled", "kirishima.cloud_public":"パブリックタイムライン", "minohdon.jp":"instance", "minohdon.jp_name":"箕面丼", "minohdon.jp_letters":"500", "minohdon.jp_bbcode":"disabled", "minohdon.jp_markdown":"disabled", + "minohdon.jp_glitch":"disabled", "knzk.me":"instance", "knzk.me_name":"神崎丼", "knzk.me_letters":"5000", "knzk.me_bbcode":"disabled", "knzk.me_markdown":"disabled", + "knzk.me_glitch":"enabled", "mastodos.com":"instance", "mastodos.com_name":"マストどす", "mastodos.com_letters":"500", "mastodos.com_bbcode":"disabled", "mastodos.com_markdown":"disabled", + "mastodos.com_glitch":"disabled", "dev.kirishima.cloud":"hidden", "dev.kirishima.cloud_name":"アスタルテ(Dev)", "dev.kirishima.cloud_letters":"6229", "dev.kirishima.cloud_bbcode":"enabled", "dev.kirishima.cloud_markdown":"enabled", + "dev.kirishima.cloud_glitch":"enabled", "mstdn.y-zu.org":"instance", "mstdn.y-zu.org_name":"Yづドン!(502 BadGateway)", "mstdn.y-zu.org_letters":"500", "mstdn.y-zu.org_bbcode":"disabled", - "mstdn.y-zu.org_markdown":"disabled", + "mstdn.y-zu.org_markdown":"enabled", + "mstdn.y-zu.org_glitch":"disabled", "imastodon.net":"instance", "imastodon.net_name":"im@stodon", "imastodon.net_letters":"500", @@ -44,6 +50,7 @@ var idata={ "imastodon.net_fav":"の頭にティンときたようです", "imastodon.net_bt":":「わかるわ」", "imastodon.net_follow":"名刺をいただきました", + "imastodon.net_glitch":"disabled", "mstdn.osaka":"instance", "mstdn.osaka_name":"大阪丼", "mstdn.osaka_letters":"500", @@ -57,6 +64,7 @@ var idata={ "mstdn.osaka_fav":"がええやん言いました", "mstdn.osaka_bt":"がしばいた", "mstdn.osaka_follow":"ツルまれました", + "mstdn.osaka_glitch":"disabled", "mstdn.kemono-friends.info":"instance", "mstdn.kemono-friends.info_name":"ますとどんちほー", "mstdn.kemono-friends.info_letters":"1024", @@ -69,21 +77,25 @@ var idata={ "mstdn.kemono-friends.info_post":"がおー!", "mstdn.kemono-friends.info_fav":":「すごーい」", "mstdn.kemono-friends.info_bt":":「たーのしー」", + "mstdn.kemono-friends.info_glitch":"disabled", "itabashi.0j0.jp":"instance", "itabashi.0j0.jp_name":"板橋丼", "itabashi.0j0.jp_letters":"1024", "itabashi.0j0.jp_bbcode":"disabled", "itabashi.0j0.jp_markdown":"disabled", + "itabashi.0j0.jp_glitch":"disabled", "theboss.tech":"instance", "theboss.tech_name":"theboss.tech", "theboss.tech_letters":"1000", "theboss.tech_bbcode":"disabled", "theboss.tech_markdown":"disabled", + "theboss.tech_glitch":"disabled", "dtp-mstdn.jp":"instance", "dtp-mstdn.jp_name":"DTP鯖", "dtp-mstdn.jp_letters":"500", "dtp-mstdn.jp_bbcode":"disabled", "dtp-mstdn.jp_markdown":"disabled", + "dtp-mstdn.jp_glitch":"disabled", "misskey.xyz":"instance", "misskey.xyz_name":"Misskey", "misskey.xyz_letters":"1000", @@ -91,8 +103,8 @@ var idata={ "misskey.xyz_markdown":"enabled", "misskey.xyz_public":"Global", "misskey.xyz_post":"Post", - "imastodon.net_fav":" reacted your post.", - "imastodon.net_bt":" reposted your post.", + "misskey.xyz_fav":" reacted your post.", + "misskey.xyz_bt":" reposted your post.", }; localStorage.setItem("instance", JSON.stringify(idata)); diff --git a/app/js/login/login.js b/app/js/login/login.js index 97547826..2520e0b8 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -449,6 +449,9 @@ function multiSelector() { $("#textarea").attr("data-length", 500) } } + if(idata[domain+"_glitch"]){ + $("#local-button").removeClass("hide") + } var profimg=localStorage.getItem("prof_"+key); console.log(profimg); if(!profimg){ diff --git a/app/js/platform/end.js b/app/js/platform/end.js index 73ce0b76..ab9e5d92 100644 --- a/app/js/platform/end.js +++ b/app/js/platform/end.js @@ -14,23 +14,15 @@ //タグのURLぽかったら var tags=[]; tags = url.match( - /https:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/ + /https:\/\/([-a-zA-Z0-9@.]+)\/tags\/([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#]+)/ ); //メンションっぽかったら var ats=[]; ats = url.match( - /https:\/\/([-a-zA-Z0-9@.]+)\/@([-_.!~*\'()a-zA-Z0-9;\/?:\@&=+\$,%#]+)/ + /https:\/\/([-a-zA-Z0-9@.]+)\/@([-_.!~*\'()a-zA-Z0-9;\/?:\&=+\$,%#]+)/ ); console.log(toot); if(toot){ - ques = url.match(/https:\/\/quesdon\.rinsuki\.net\//); - console.log(ques); - if(ques){ - if(ques[1]){ - console.log("quesdon"); - toot=[]; - } - } if(toot[1]){ var acct_id=$a.parent().attr("data-acct"); if(!acct_id){ @@ -44,6 +36,7 @@ }else if(tags){ if(tags[2]){ tagShow(tags[2]); + Materialize.toast('Open in browser', 86400); } }else if(ats){ console.log(ats); diff --git a/app/js/post/bb-md.js b/app/js/post/bb-md.js index 158ceb56..6643c324 100644 --- a/app/js/post/bb-md.js +++ b/app/js/post/bb-md.js @@ -47,6 +47,11 @@ function mdCheck(){ }else{ $("#textarea").attr("data-length", 500) } + if(idata[domain+"_glitch"]){ + $("#local-button").removeClass("hide"); + }else{ + $("#local-button").removeClass("hide"); + } var multi = localStorage.getItem("multi"); if (multi) { var obj = JSON.parse(multi); diff --git a/app/js/post/img.js b/app/js/post/img.js index 422dff52..9ab6aa40 100644 --- a/app/js/post/img.js +++ b/app/js/post/img.js @@ -103,7 +103,6 @@ function media(b64, type, no) { var at = localStorage.getItem("acct_"+ acct_id + "_at"); var httpreq = new XMLHttpRequest(); if(localStorage.getItem("mode_" + domain)=="misskey"){ - var start = "https://" + domain + "/api/drive/files/create"; httpreq.open('POST', start, true); httpreq.upload.addEventListener("progress", progshow, false); @@ -183,7 +182,7 @@ function toBlob(base64, type) { //画像を貼り付けたら… var element = document.querySelector("#textarea"); element.addEventListener("paste", function(e){ - console.log("paste") + console.log(e) // 画像の場合 // e.clipboardData.types.length == 0 // かつ diff --git a/app/js/post/post.js b/app/js/post/post.js index 2aac3911..32eae3cf 100644 --- a/app/js/post/post.js +++ b/app/js/post/post.js @@ -86,8 +86,10 @@ function post(mode) { var nsfw = "false"; } var vis = $("#vis").text(); - if(vis!="inherit"){ + if(vis!="inherit" && vis!="local"){ toot.visibility=vis; + }else if(vis=="local"){ + toot.status=str+"👁️"; } if ($("#cw").hasClass("cw-avail")) { var spo = $("#cw-text").val(); diff --git a/app/js/post/secure.js b/app/js/post/secure.js index f47d3486..f36c9f65 100644 --- a/app/js/post/secure.js +++ b/app/js/post/secure.js @@ -19,21 +19,26 @@ function vis(set){ $("#vis-icon").removeClass("orange-text"); $("#vis-icon").removeClass("blue-text"); $("#vis-icon").removeClass("purple-text"); + $("#vis-icon").removeClass("light-blue-text"); + $("#vis-icon").removeClass("teal-text"); if(set=="public"){ $("#vis-icon").text("public"); $("#vis-icon").addClass("purple-text"); }else if(set=="unlisted"){ $("#vis-icon").text("lock_open"); $("#vis-icon").addClass("blue-text"); - }else if(set=="private"){ + }else if(set=="private"){ $("#vis-icon").text("lock"); $("#vis-icon").addClass("orange-text"); - }else if(set=="direct"){ + }else if(set=="direct"){ $("#vis-icon").text("mail"); $("#vis-icon").addClass("red-text"); - }else if(set=="limited"){ + }else if(set=="limited"){ $("#vis-icon").text("group"); $("#vis-icon").addClass("teal-text"); + }else if(set=="local"){ + $("#vis-icon").text("visibility"); + $("#vis-icon").addClass("light-blue-text"); } var vis=localStorage.getItem("vis"); if(vis=="memory"){ diff --git a/app/js/tl/datails.js b/app/js/tl/datails.js index 414940e4..0737dc78 100644 --- a/app/js/tl/datails.js +++ b/app/js/tl/datails.js @@ -417,12 +417,22 @@ function shot(){ ); const screenshotPath = path.join(os.tmpdir(), 'screenshot.png'); const savePath = path.join(os.tmpdir(), 'screenshot.png'); - var ipc = electron.ipcRenderer; - ipc.send('shot', ['file://' + screenshotPath,w,h,b64[1],title,off.top+50,off.left]); + var ipc = electron.ipcRenderer; + if(localStorage.getItem("savefolder")){ + var save=localStorage.getItem("savefolder"); + }else{ + var save=""; + } + ipc.send('shot', ['file://' + screenshotPath,w,h,b64[1],title,off.top+50,off.left,save]); if($("#toot-this .img-parsed").length>0){ for(i=0;i<$("#toot-this .img-parsed").length;i++){ - var url=$("#toot-this .img-parsed").eq(i).attr("data-url"); - ipc.send('shot-img-dl', [url,title+"_img"+i+".png"]); + var url=$("#toot-this .img-parsed").eq(i).attr("data-url"); + if(localStorage.getItem("savefolder")){ + var save=localStorage.getItem("savefolder"); + }else{ + var save=""; + } + ipc.send('shot-img-dl', [url,title+"_img"+i+".png",save]); } } return; diff --git a/app/js/tl/misskeyparse.js b/app/js/tl/misskeyparse.js index a894930a..ff90eadf 100644 --- a/app/js/tl/misskeyparse.js +++ b/app/js/tl/misskeyparse.js @@ -392,19 +392,25 @@ function misskeyParse(obj, mix, acct_id, tlid, popup, mutefilter) { if(notice){ notice=twemoji.parse(notice); } - if(toot.media){ - var mediack = toot.media[0]; - }else{ - var mediack=false; - } + if(toot.files){ + var mediack = toot.files[0]; + var useparam="files"; + }else{ + if(toot.media){ + var mediack = toot.media[0]; + var useparam="media"; + }else{ + var mediack=false; + } + } //メディアがあれば var media_ids=""; if (mediack) { hasmedia = "hasmedia"; - var cwdt = 100 / toot.media.length; - Object.keys(toot.media).forEach(function(key2) { - var media = toot.media[key2]; + var cwdt = 100 / toot[useparam].length; + Object.keys(toot[useparam]).forEach(function(key2) { + var media = toot[useparam][key2]; var purl = media.url; media_ids=media_ids+media.id+","; var url = media.url; diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 744d044b..437f66a3 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -135,6 +135,11 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { }else if(mouseover=="no"){ mouseover=""; } + //リプカウント + var replyct_view=localStorage.getItem("replyct"); + if(!replyct_view){ + replyct_view="hidden"; + } var local = []; var times=[]; Object.keys(obj).forEach(function(key) { @@ -492,6 +497,15 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { }); tags = '
    ' + tags + '
    '; } + //リプ数 + if(toot.replies_count || toot.replies_count===0){ + var replyct=toot.replies_count; + if(replyct_view=="hidden" && replyct>1){ + replyct="1+"; + } + }else{ + var replyct=""; + } //公開範囲を取得 var vis = ""; var visen = toot.visibility; @@ -615,7 +629,8 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { '
    ' + + '\')" class="waves-effect waves-dark btn-flat" style="padding:0" title="'+lang_parse_replyto[lang]+'">' + replyct + + '
  • ' + '
    { + localStorage.setItem("savefolder",fileNames[0]); + }); } \ No newline at end of file diff --git a/app/js/userdata/showOnTL.js b/app/js/userdata/showOnTL.js index b64f6c6c..f9395c81 100644 --- a/app/js/userdata/showOnTL.js +++ b/app/js/userdata/showOnTL.js @@ -36,8 +36,15 @@ function udgEx(user,acct_id){ todo(error); console.error(error); }).then(function(json) { - var id=json.accounts[0].id; - udg(id,acct_id); + console.log(json); + if(json.accounts){ + var id=json.accounts[0].id; + udg(id,acct_id); + }else{ + var url="https://"+user.split('@')[1]+"/@"+user.split('@')[0]; + const {shell} = require('electron'); + shell.openExternal(url); + } }); return; } diff --git a/app/language/index.en.json b/app/language/index.en.json index 4d4477c0..9b864f3c 100644 --- a/app/language/index.en.json +++ b/app/language/index.en.json @@ -22,6 +22,7 @@ "publicJP":"", "unlistedJP":"", "privateJP":"", + "localJP":"Local only", "directJP":"", "emojiWarn":"", "emojiInsertWarn":"Some emojis are not able to be inserted.", diff --git a/app/language/index.ja.json b/app/language/index.ja.json index 2590f2c1..f428d575 100644 --- a/app/language/index.ja.json +++ b/app/language/index.ja.json @@ -22,6 +22,7 @@ "publicJP":"公開", "unlistedJP":"未収載", "privateJP":"非公開", + "localJP":"ローカル限定", "directJP":"ダイレクト", "emojiWarn":"インスタンスによって実装が異なります。", "emojiInsertWarn":"一部絵文字は入力できません。", diff --git a/app/language/setting.en.json b/app/language/setting.en.json index 55c6fbed..11af8294 100644 --- a/app/language/setting.en.json +++ b/app/language/setting.en.json @@ -22,6 +22,8 @@ "font":"Font", "fontwarn":"Set local font", "fontsize":"Font size", + "savefolder":"Folder to save", + "savefolderwarn":"TheDesk uses this value when it try to save pictures or take screenshots.", "absolute":"absolute value", "timeline":"Timeline Preferences", "timemode":"Time format", @@ -37,6 +39,9 @@ "nswf":"Hide NSFW pictures", "nsfwwarn":"Strong blur effect", "cw":"Hide CW contents", + "replyct":"Reply counter style", + "replyct_hidden":"Show 1+ if the replies are more than 1.", + "replyct_full":"Show full count(1,2...)", "gif":"Animated GIF images animation", "box":"Action of posting-box", "boxyes":"Folding", diff --git a/app/language/setting.ja.json b/app/language/setting.ja.json index 44001978..00e08e4f 100644 --- a/app/language/setting.ja.json +++ b/app/language/setting.ja.json @@ -22,6 +22,8 @@ "font":"フォント", "fontwarn":"ローカルフォントを指定します。", "fontsize":"フォントサイズ", + "savefolder":"デフォルトの保存先", + "savefolderwarn":"画像ダウンロードやスクリーンショットに影響します。", "absolute":"絶対指定", "timeline":"タイムラインの設定", "timemode":"時間表記設定", @@ -37,6 +39,9 @@ "nswf":"非表示設定の画像(NSFW)を隠す", "nsfwwarn":"きつめのぼかしがかかります。", "cw":"非表示設定のテキスト(CW)を隠す", + "replyct":"リプライ数表示", + "replyct_hidden":"2以上のとき1+と表示", + "replyct_full":"完全に表示", "gif":"アイコンのアニメーションを再生する", "box":"投稿ボックスの挙動", "boxyes":"たたむ", diff --git a/app/main.js b/app/main.js index 9329c030..6f608cab 100644 --- a/app/main.js +++ b/app/main.js @@ -268,13 +268,19 @@ ipc.on('shot', function(e, args) { console.log("link:"+args[0]+" width:"+args[1]+" height:"+args[2]+" title:"+args[4]+" top:"+args[5]+" left:"+args[6]); var platform=process.platform; var bit=process.arch; - if(platform=="win32"){ - var dir=app.getPath('home')+"\\Pictures\\TheDesk\\Screenshots\\"+args[4]+"-toot.png"; - var folder=app.getPath('home')+"\\Pictures\\TheDesk\\Screenshots\\"; - }else if(platform=="linux" || platform=="darwin" ){ - var dir=app.getPath('home')+"/Pictures/TheDesk/Screenshots/"+args[4]+"-toot.png"; - var folder=app.getPath('home')+"/Pictures/TheDesk/Screenshots/"; + if(args[7]==""){ + if(platform=="win32"){ + var dir=app.getPath('home')+"\\Pictures\\TheDesk\\Screenshots\\"+args[4]+"-toot.png"; + var folder=app.getPath('home')+"\\Pictures\\TheDesk\\Screenshots\\"; + }else if(platform=="linux" || platform=="darwin" ){ + var dir=app.getPath('home')+"/Pictures/TheDesk/Screenshots/"+args[4]+"-toot.png"; + var folder=app.getPath('home')+"/Pictures/TheDesk/Screenshots/"; + } + }else{ + var folder=args[7]; + var dir=folder+args[4]+"-toot.png"; } + Jimp.read(Buffer.from( args[3],'base64'), function (err, lenna) { if (err) throw err; lenna.crop( args[6], args[5], args[1], args[2] ).write(dir); @@ -284,11 +290,16 @@ ipc.on('shot', function(e, args) { ipc.on('shot-img-dl', (e, args) => { Jimp.read(args[0], function (err, lenna) { if (err) throw err; - if(process.platform=="win32"){ - var folder=app.getPath('home')+"\\Pictures\\TheDesk\\Screenshots\\"; - }else if(process.platform=="linux" || process.platform=="darwin" ){ - var folder=app.getPath('home')+"/Pictures/TheDesk/Screenshots/"; + if(args[1]==""){ + if(process.platform=="win32"){ + var folder=app.getPath('home')+"\\Pictures\\TheDesk\\Screenshots\\"; + }else if(process.platform=="linux" || process.platform=="darwin" ){ + var folder=app.getPath('home')+"/Pictures/TheDesk/Screenshots/"; + } + }else{ + var folder=args[2]; } + lenna.write(folder+args[1]); }); }) @@ -443,12 +454,15 @@ ipc.on('general-dl', (e, args) => { var name=""; var platform=process.platform; var bit=process.arch; - if(platform=="win32"){ - var dir=app.getPath('home')+"\\Pictures\\TheDesk"; - }else if(platform=="linux" || platform=="darwin" ){ - var dir=app.getPath('home')+"/Pictures/TheDesk"; - } - + if(args[1]==""){ + if(platform=="win32"){ + var dir=app.getPath('home')+"\\Pictures\\TheDesk"; + }else if(platform=="linux" || platform=="darwin" ){ + var dir=app.getPath('home')+"/Pictures/TheDesk"; + } + }else{ + var dir=args[1]; + } mainWindow.webContents.send('general-dl-message', "ダウンロードを開始します。"); const opts = { directory: dir, diff --git a/app/setting.html b/app/setting.html index 03d4b0ab..d1c15d23 100644 --- a/app/setting.html +++ b/app/setting.html @@ -67,7 +67,11 @@ 15px(absolute value)
    px - +
    +
    Folder to save
    + TheDesk uses this value when it try to save pictures or take screenshots.
    + +
  • @@ -107,6 +111,12 @@
    +
    Reply counter style
    + + + + +
    Animated GIF images animation
    diff --git a/app/setting.sample.html b/app/setting.sample.html index c0eff7df..75562503 100644 --- a/app/setting.sample.html +++ b/app/setting.sample.html @@ -67,7 +67,11 @@ 15px({{absolute}})
    px - +
    +
    {{savefolder}}
    + {{savefolderwarn}}
    + +
  • @@ -107,6 +111,12 @@
    +
    {{replyct}}
    + + + + +
    {{gif}}