diff --git a/app/css/master.css b/app/css/master.css index 39045d7e..66977556 100644 --- a/app/css/master.css +++ b/app/css/master.css @@ -9,6 +9,9 @@ html,body{ background-color: var(--bg); color: var(--color); } +body{ + border: thin solid gray; +} .btn { margin: 5px; text-transform: none; @@ -302,7 +305,60 @@ blockquote:before, .quote:before { display:flex; flex-wrap: wrap; } - +#menu{ + position:fixed; + z-index:9999; + background-color: var(--box); + width:520px; + top:calc(50% - 150px); + left:calc(50% - 250px); + padding: 5px; + border: thin solid gray; + border-radius:5px; +} +#menu-wrapper{ + margin-left:-5px; + display:flex; +} +#left-menu{ + width:170px; +} +#left-menu div{ + padding-left:5px; + width:100%; + height:50px; + display:flex; + align-items:center; + cursor:pointer; +} +#left-menu div:hover { + background-color: var(--beforehover); +} +#left-menu span{ + margin-left:5px; +} +#left-menu div.active{ + background-color: var(--emphasized); +} +#right-menu{ + width:350px; + max-height:325px; + overflow-y:scroll; + overflow-x:hidden; + padding:5px; +} +.drag-bar{ + cursor:move; + text-align:center; + width:calc(100% + 10px); + border-radius: 5px; + background-color: var(--bg); + margin-left:-5px; + margin-right:-5px; + margin-top:-5px; + font-size:16px; + padding:4px; +} /*スクロールバー*/ ::-webkit-scrollbar { diff --git a/app/css/post.css b/app/css/post.css index 1b4fc3c9..9190f245 100644 --- a/app/css/post.css +++ b/app/css/post.css @@ -10,18 +10,9 @@ min-width:300px; max-width:100%; padding: 5px; + border-radius:5px; } -#post-bar{ - cursor:move; - text-align:center; - width:calc(100% + 10px); - background-color: var(--bg); - margin-left:-5px; - margin-right:-5px; - margin-top:-5px; - font-size:16px; - padding:4px; -} + .cancel { font-size: 0.5rem; color: gray; @@ -64,6 +55,10 @@ } #emoji { +} +#suggest{ + max-height:300px; + overflow-y: scroll; } #emoji-list { width: 100%; diff --git a/app/css/sort.css b/app/css/sort.css index d9b8a277..deff8776 100644 --- a/app/css/sort.css +++ b/app/css/sort.css @@ -1,7 +1,5 @@ + .drag-content{ - width:300px; - max-width:100%; - height:300px; text-overflow: ellipsis; cursor:move; user-select: none; @@ -10,32 +8,25 @@ border-radius:5px; color:var(--color); padding:3px; - font-family:Open Sans; - font-size:20px; - flex-grow:1; - text-align: center; - padding:10px; + display:grid; + grid-template-columns: 43px 1fr 60px; + grid-template-areas: 'sorticon sorttitle sorttitle' 'sorticon sortacct sortaction'; } -#sort{ - display:flex; - flex-direction:row; - overflow-x:scroll; - display: flex; - width:100vw; - +.sorticon { + grid-area:sorticon; } -#sort-box{ - position:absolute; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width:100vw; - height:calc(100vh - 40px); - background-color: rgba(0, 0, 0, 0.8); - z-index:10002; +.sorticon i{ + font-size:43px; } -#sort-box button{ - background-color: var(--notfbox); - color:var(--color); +.sorttitle { + margin-left:5px; + grid-area:sorttitle; +} +.sortacct { + margin-left:5px; + grid-area:sortacct; +} +.sortaction { + margin-left:5px; + grid-area:sortaction; } \ No newline at end of file diff --git a/app/css/tl.css b/app/css/tl.css index 0dde0048..aa536ece 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -86,7 +86,7 @@ font-family:Open Sans; font-size:15px; } -@media screen and (max-width: 1344px) { +@media screen and (max-width: 890px) { .btnsgroup .grouptitle{ display: none; } #tips,#tips-menu{ display: none; } } @@ -111,6 +111,7 @@ iframe { height: 100vh; flex: 1; border: thin solid gray; + border-top:none; } .box .pin,#his-data .pin{ display:none; @@ -242,6 +243,9 @@ grid-area: toot; font-size:1.2rem; margin-right:2px; } +.action .fa-quote-right{ + margin-top: 2px; +} .actct{ color:var(--beforehover); } @@ -518,4 +522,4 @@ p:not(:last-child){ .cvo-anime { animation-duration: 0.1s; animation-name: fadeInDown; -} \ No newline at end of file +} diff --git a/app/js/common/keyshortcut.js b/app/js/common/keyshortcut.js index 2198026d..01bd2047 100644 --- a/app/js/common/keyshortcut.js +++ b/app/js/common/keyshortcut.js @@ -29,6 +29,13 @@ $(function($) { return false; } } + //Alt+Enter:セカンダリー + if (event.metaKey || event.altKey && wv) { + if (e.keyCode === 13) { + sec(); + return false; + } + } //Shift+Space:Markdownゼロ幅スペース if (event.shiftKey) { diff --git a/app/js/common/version.js b/app/js/common/version.js index a4316204..4a7dccc2 100644 --- a/app/js/common/version.js +++ b/app/js/common/version.js @@ -19,14 +19,14 @@ function verck(ver,winstore) { var electron = require("electron"); var remote=electron.remote; var dialog=remote.dialog; - const options = { - type: 'info', - title: "Select your platform", - message: lang.lang_version_platform, - buttons: [lang.lang_no,lang.lang_yesno] - } var platform=remote.process.platform; if(platform=="win32"){ + const options = { + type: 'info', + title: "Select your platform", + message: lang.lang_version_platform, + buttons: [lang.lang_no,lang.lang_yesno] + } console.log(localStorage.getItem("winstore")) if(!localStorage.getItem("winstore")){ @@ -38,7 +38,27 @@ function verck(ver,winstore) { } }); } - }else{ + }else if(platform=="linux"){ + if(localStorage.getItem("winstore")=="unix"){ + localStorage.removeItem("winstore") + } + console.log(localStorage.getItem("winstore")) + if(!localStorage.getItem("winstore")){ + const options = { + type: 'info', + title: "Select your platform", + message: lang.lang_version_platform_linux, + buttons: [lang.lang_no,lang.lang_yesno] + } + dialog.showMessageBox(options, function(arg) { + if(arg==1){ + localStorage.setItem("winstore","snapcraft") + }else{ + localStorage.setItem("winstore","localinstall") + } + }); + } + }else{ localStorage.setItem("winstore","unix") } var l = 5; diff --git a/app/js/lang/lang.en.js b/app/js/lang/lang.en.js index 54b24825..858c5c28 100644 --- a/app/js/lang/lang.en.js +++ b/app/js/lang/lang.en.js @@ -22,6 +22,7 @@ var lang={ "lang_version_usever":"No update is found({{ver}})", "lang_version_skipver":"Update was ignored.", "lang_version_platform":"Was this software installed at Microsoft Store? When select 'yes', any update was ignored.", + "lang_version_platform_linux":"Was this software installed at Snapcraft(snapd)? When select 'yes', any update was ignored.", //login //login/login.js "lang_login_noauth":"Show TL of unlogined accounts", @@ -100,7 +101,8 @@ var lang={ "lang_tags_always":"Always toots with ", "lang_tags_realtime":"Tag-stream toot", "lang_tags_tagunpin":"Unpin {{tag}}", - "lang_tags_tagwarn":"When you toot without {{tag}}, tag-streaming mode will be off.", + "lang_tags_unrealtime":"Disable TsT", + "lang_tags_tagwarn":"Auto complete {{tag}}, if toot without {{tag}}", //tl/tl.js "lang_tl_media":"Media", "lang_tl_reconnect":"Reconnect to streaming API", @@ -120,6 +122,9 @@ var lang={ "lang_layout_webviewmode":"Prefer WebView", "lang_excluded":"Excluded type of notification", "lang_layout_excludingbt":"Show BT mode(OFF/Exclude BT/Only BT)", + //ui/sort.js + "lang_sort_gothis":"Go to this column", + "lang_sort_remthis":"Delete this column", //ui/spotify.js "lang_spotify_img":"Attach an album artwork", "lang_spotify_imgno":"Not attach an album artwork", diff --git a/app/js/lang/lang.ja.js b/app/js/lang/lang.ja.js index 9d4ba290..8065833c 100644 --- a/app/js/lang/lang.ja.js +++ b/app/js/lang/lang.ja.js @@ -1,7 +1,6 @@ //commonError var lang={ "language":"ja", - //commonError "lang_toot":"トゥート", "lang_there":"あり", "lang_nothing":"なし", @@ -23,6 +22,7 @@ var lang={ "lang_version_usever":"お使いのバージョン{{ver}}は最新です。", "lang_version_skipver":"アップデートはスキップされました。", "lang_version_platform":"このソフトウェアはMicrosoft Storeからダウンロードされましたか?(「はい」を選択すると次回からアップデート通知を無視します。)", + "lang_version_platform_linux":"このソフトウェアはSnapcraft(snapd)からインストールしましたか?(「はい」を選択すると次回からアップデート通知を無視します。)", //login //login/login.js "lang_login_noauth":"認証せずに見る", @@ -101,7 +101,8 @@ var lang={ "lang_tags_always":"常に", "lang_tags_realtime":"実況", "lang_tags_tagunpin":"{{tag}}をよく使うタグから削除", - "lang_tags_tagwarn":"次に{{tag}}なしでトゥートするまで全てのトゥートに{{tag}}が付与されます。", + "lang_tags_unrealtime":"実況解除", + "lang_tags_tagwarn":"{{tag}}がない場合自動で補完されます。", //tl/tl.js "lang_tl_media":"メディア", "lang_tl_reconnect":"Streamingに再接続しました", @@ -121,6 +122,9 @@ var lang={ "lang_layout_webviewmode":"WebView優先", "lang_excluded":"除外する通知", "lang_layout_excludingbt":"BT表示(OFF/BT除外/BTのみ)", +//ui/sort.js + "lang_sort_gothis":"このカラムへ", + "lang_sort_remthis":"このカラムを削除", //ui/spotify.js "lang_spotify_img":"アルバムアートワークを添付します。", "lang_spotify_imgno":"アルバムアートワークを添付しません。", diff --git a/app/js/login/login.js b/app/js/login/login.js index 811eef26..30fbff5f 100644 --- a/app/js/login/login.js +++ b/app/js/login/login.js @@ -5,6 +5,7 @@ localStorage.removeItem("kirishima") localStorage.removeItem("imas") localStorage.removeItem("image"); +localStorage.removeItem("stable") localStorage.setItem("mode_misskey.xyz","misskey") function ck() { var main = localStorage.getItem("main"); diff --git a/app/js/post/emoji.js b/app/js/post/emoji.js index c184b157..19750457 100644 --- a/app/js/post/emoji.js +++ b/app/js/post/emoji.js @@ -15,6 +15,7 @@ function emojiToggle() { if ($("#emoji").hasClass("hide")) { $("#emoji").removeClass("hide") $("#right-side").show() + $("#suggest").html(""); if (!localStorage.getItem("emoji_" + acct_id)) { var html = ''; @@ -25,6 +26,7 @@ function emojiToggle() { } else { $("#poll").addClass("hide") $("#emoji").addClass("hide") + $("#suggest").html(""); $("#right-side").hide() } diff --git a/app/js/post/post.js b/app/js/post/post.js index 4136fc55..9cf6dae7 100644 --- a/app/js/post/post.js +++ b/app/js/post/post.js @@ -45,6 +45,7 @@ function post(mode,postvis) { }else{ var cw_ltres=localStorage.getItem("cw_letters"); } + if(domain!="kirishima.cloud"){ if(mode!="pass" && !$("#cw").hasClass("cw-avail") && (str.length>cw_sent || (str.split("\n").length - 1)>cw_ltres)){ var electron = require("electron"); var remote=electron.remote; @@ -69,6 +70,7 @@ function post(mode,postvis) { }) return false; } +} if(localStorage.getItem("mode_" + domain)=="misskey"){ misskeyPost(); return; @@ -78,6 +80,9 @@ function post(mode,postvis) { var at = localStorage.getItem("acct_"+ acct_id + "_at"); var start = "https://" + domain + "/api/v1/statuses"; var reply = $("#reply").val(); + if(str.indexOf(localStorage.getItem("stable"))==-1){ + str+" #"+localStorage.getItem("stable"); + } var toot={ status: str } @@ -106,6 +111,7 @@ function post(mode,postvis) { toot.status=str+"👁️"; } //ここに非公開・未収載タグについてwarn + if(domain!="kirishima.cloud" && domain!="imastodon.net"){ if(~str.indexOf("#")){ if(vis == "local" || vis=="unlisted" || vis=="direct" || vis=="private"){ if(!confirm(lang.lang_post_tagVis)){ @@ -113,6 +119,7 @@ function post(mode,postvis) { } } } +} if ($("#cw").hasClass("cw-avail")) { var spo = $("#cw-text").val(); cw(); @@ -166,11 +173,7 @@ function post(mode,postvis) { httpreq.send(JSON.stringify(toot)); httpreq.onreadystatechange = function() { if (httpreq.readyState === 4) { - if(str.indexOf(localStorage.getItem("stable"))==-1){ - localStorage.removeItem("stable") - } var json = httpreq.response; - console.log(json); var box = localStorage.getItem("box"); if (box == "yes" || !box) { $("#textarea").blur(); @@ -261,7 +264,7 @@ function misskeyPost(){ function clear() { $("#textarea").val(""); if(localStorage.getItem("stable")){ - $("#textarea").val(localStorage.getItem("stable")); + $("#textarea").val("#"+localStorage.getItem("stable")+" ") } $("#textarea").attr("placeholder", lang.lang_toot); $("#reply").val(""); diff --git a/app/js/post/suggest.js b/app/js/post/suggest.js index d0af6766..0e36ab3f 100644 --- a/app/js/post/suggest.js +++ b/app/js/post/suggest.js @@ -13,6 +13,13 @@ input.addEventListener("focus", function() { window.clearInterval(timer); timer = window.setInterval(function() { var new_val = input.value; + if(new_val==""){ + $("#suggest").html(""); + if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ + $("#right-side").hide() + } + return; + } if (prev_val != new_val) { var semoji = new_val.match(/:(\S{3,})/); if(semoji){ @@ -32,7 +39,15 @@ input.addEventListener("focus", function() { } } } - + if(ehtml!=""){ + $("#right-side").show() + $("#poll").addClass("hide") + $("#emoji").addClass("hide") + }else{ + if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ + $("#right-side").hide() + } + } $("#suggest").html(ehtml); } @@ -52,7 +67,10 @@ input.addEventListener("focus", function() { } else if (acct && acct[1]) { var q = acct[1]; }else { - //$("#suggest").html(""); + $("#suggest").html(""); + if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ + $("#right-side").hide() + } return; } var domain = localStorage.getItem("domain_" + acct_id); @@ -72,24 +90,38 @@ input.addEventListener("focus", function() { todo(error); console.error(error); }).then(function(json) { - if (json.hashtags[0] && tag[1]) { + if (json.hashtags[0] && tag) { + if(tag[1]){ var tags = ""; Object.keys(json.hashtags).forEach(function(key4) { var tag = json.hashtags[key4]; - tags = tags + '#' + tag + ' '; + if(tag!=q){ + tags = tags + '#' + tag + '
'; + } }); - $("#suggest").html("Tags:" + tags); + $("#right-side").show() + $("#suggest").html("Tags:
" + tags); + $("#poll").addClass("hide") + $("#emoji").addClass("hide") + } } else if (json.accounts[0] && acct[1]) { var accts = ""; Object.keys(json.accounts).forEach(function(key3) { var acct = json.accounts[key3]; - accts = accts + '@' + acct.acct + ' '; + if(acct.acct!=q){ + accts = accts + '@' + acct.acct + '
'; + } }); - $("#suggest").html("@:" + accts); + $("#right-side").show() + $("#suggest").html("@:
" + accts); + $("#poll").addClass("hide") + $("#emoji").addClass("hide") } else { - $("#suggest").html("Not Found"); + if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ + $("#right-side").hide() + } } }); } @@ -121,6 +153,9 @@ function tagInsert(code, del) { } $("#textarea").val(newt); $("#textarea").focus(); + if($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")){ + $("#right-side").hide() + } $("#suggest").html(""); } function cgNPs(q){ diff --git a/app/js/post/use-txtbox.js b/app/js/post/use-txtbox.js index e1cca3e4..d382812b 100644 --- a/app/js/post/use-txtbox.js +++ b/app/js/post/use-txtbox.js @@ -1,10 +1,15 @@ /*リプライ*/ -function re(id,at,acct_id,mode){ +function re(id,ats_cm,acct_id,mode){ + clear(); + var ats=ats_cm.split(','); localStorage.setItem("nohide",true); show(); $("#reply").val(id); - var te=$("#textarea").val(); - $("#textarea").val("@"+at+" "+te); + for(var i=0;i(for '+context+'):'+lang_edit[lang]+'/'+lang_del[lang]+'
'; + '\')" class="pointer">'+lang.lang_edit+'/'+lang.lang_del+'
'; }); if(filters==""){ - filters=lang_filter_nodata[lang]+"
"; + filters=lang.lang_filter_nodata+"
"; } $("#filtered-words").html(filters); }else{ - $("#filtered-words").html(lang_filter_nodata[lang]); + $("#filtered-words").html(lang_filter_nodata); } }); } @@ -170,7 +164,7 @@ function makeNewFilter(){ } console.log(cont); if(!cont.length){ - $("#filtered-words").html('Error:'+lang_filter_errordegree[lang]); + $("#filtered-words").html('Error:'+lang.lang_filter_errordegree); } var exc=$("#except_filter:checked").val(); var who=$("#wholeword_filter:checked").val(); @@ -215,7 +209,7 @@ function makeNewFilter(){ $("#days_filter").val("0"); $("#hours_filter").val("0"); $("#mins_filter").val("0"); - $("#add-filter-btn").text(lang_add[lang]); + $("#add-filter-btn").text(lang.lang_add); $("#filter-edit-id").val("") } } @@ -231,7 +225,7 @@ function filterEdit(id,acct_id){ $("#days_filter").val("0"); $("#hours_filter").val("0"); $("#mins_filter").val("0"); - $("#add-filter-btn").text(lang_edit[lang]); + $("#add-filter-btn").text(lang.lang_edit); $("#filter-edit-id").val(id); var domain = localStorage.getItem("domain_" + acct_id); var at = localStorage.getItem("acct_"+ acct_id + "_at"); diff --git a/app/js/tl/list.js b/app/js/tl/list.js index ae5d0747..674e2c74 100644 --- a/app/js/tl/list.js +++ b/app/js/tl/list.js @@ -1,14 +1,10 @@ -function listToggle(){ - if ($("#list-box").hasClass("hide")) { - $("#list-box").removeClass("hide"); - $("#list-box").addClass("show"); - $("#list-box").css("bottom","40px"); - $("#list-box").css("left",$('#list-tgl').offset().left-$('#list-box').width()/2+"px"); - //リストロード - } else { - $("#list-box").removeClass("show"); - $("#list-box").addClass("hide") - } +function listMenu(){ + $("#left-menu div").removeClass("active"); + $("#listMenu").addClass("active"); + $(".menu-content").addClass("hide"); + $("#list-box").removeClass("hide"); + $('ul.tabs').tabs('select_tab', 'src-sta'); + $("#src-contents").html(""); } diff --git a/app/js/tl/notification.js b/app/js/tl/notification.js index 736b3e19..0a95417e 100644 --- a/app/js/tl/notification.js +++ b/app/js/tl/notification.js @@ -44,7 +44,7 @@ function notfColumn(acct_id, tlid, sys){ httpreq.onreadystatechange = function() { if (httpreq.readyState === 4) { var json = httpreq.response; - var max_id = httpreq.getResponseHeader("link").match(/\?max_id=([0-9]+)/)[1]; + var max_id = httpreq.getResponseHeader("link").match(/[?&]{1}max_id=([0-9]+)/)[1]; if(json[0]){ var templete=""; var lastnotf=localStorage.getItem("lastnotf_" + acct_id); @@ -397,7 +397,7 @@ function notfmore(tlid) { if (httpreq.readyState === 4) { var json = httpreq.response; console.log(json); - var max_id = httpreq.getResponseHeader("link").match(/\?max_id=([0-9]+)/)[1]; + var max_id = httpreq.getResponseHeader("link").match(/[?&]{1}max_id=([0-9]+)/)[1]; if(json[0]){ var templete=""; var lastnotf=localStorage.getItem("lastnotf_" + acct_id); diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 779f7003..077e1aeb 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -8,7 +8,6 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { localStorage.setItem("lastunix_"+ tlid,date(obj[0].created_at, 'unix')); } - var actb = localStorage.getItem("action_btns"); var actb='re,rt,fav,qt,del,pin,red'; if(actb){ var actb = actb.split(','); @@ -22,6 +21,12 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { disp[actb[k]]=tp; } } + var qt = localStorage.getItem("quote"); + if(qt=="nothing"){ + var qtClass="hide"; + }else{ + var qtClass=""; + } var datetype = localStorage.getItem("datetype"); var nsfwtype = localStorage.getItem("nsfw"); var sent = localStorage.getItem("sentence"); @@ -503,12 +508,27 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { //メンションであれば if (menck) { mentions = ""; + var to_mention=[]; Object.keys(toot.mentions).forEach(function(key3) { var mention = toot.mentions[key3]; mentions = mentions + '@' + mention.acct + ' '; + //自分は除外 + //自インスタンスかどうかを確認し、IDの一致 + if(mention.acct==mention.username && mention.id==localStorage.getItem("user-id_" + acct_id)){ + //自分 + }else{ + //そのトゥの人NG + if(toot.account.acct!=mention.acct){ + to_mention.push(mention.acct); + } + } + }); + to_mention.push(toot.account.acct); mentions = '
' + mentions + '
'; + }else{ + var to_mention=[toot.account.acct]; } var tagck = toot.tags[0]; var tags = ""; @@ -726,7 +746,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { '
'+vis+'
'+ '
'+lang.lang_parse_det+'
' + '
' + replyct + '
' + @@ -735,7 +755,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter) { '\')" class="waves-effect waves-dark btn-flat actct" style="padding:0" title="'+lang.lang_parse_bt+'">' + toot.reblogs_count + '' + - '
' + '
#' + tag + ' TL Toot '+ - ''+lang.lang_tags_realtime+' '+lang.lang_del+' '; + if(nowPT!=tag){ + console.log(nowPT+"/"+tag); + var ptt=lang.lang_tags_realtime; + var nowon=""; + }else{ + var ptt=lang.lang_tags_unrealtime; + var nowon="("+lang.lang_tags_realtime+")"; + } + tags = tags + '#' + tag + ''+nowon+' TL Toot '+ + ''+ptt+' '+lang.lang_del+' '; }); if(obj.length>0){ $("#taglist").append("My Tags:" + tags); @@ -106,6 +115,14 @@ function tagTL(a,b,c,d){ tl(a,b,acct_id,d); } function autoToot(tag){ - localStorage.setItem("stable",tag); - Materialize.toast(lang.lang_tags_tagwarn +replace("{{tag}}" ,tag).replace("{{tag}}" ,tag),3000); + var nowPT=localStorage.getItem("stable") + if(nowPT==tag){ + localStorage.removeItem("stable"); + Materialize.toast(lang.lang_tags_unrealtime,3000); + }else{ + localStorage.setItem("stable",tag); + Materialize.toast(lang.lang_tags_tagwarn.replace("{{tag}}" ,tag).replace("{{tag}}" ,tag),3000); + brInsert('#' + tag+" ") + } + favTag(); } \ No newline at end of file diff --git a/app/js/tl/tl.js b/app/js/tl/tl.js index d13924b4..7b47a478 100644 --- a/app/js/tl/tl.js +++ b/app/js/tl/tl.js @@ -605,22 +605,33 @@ function misskeycom(type, data) { //TLのアイコン function icon(type) { if (type == "home") { - return "home" - } else if (type == "local" || type == "noauth" || type == "local-media") { - return "people_outline" - } else if (type == "pub" || type == "pub-media") { - return "language" + var response="home"; + } else if (type == "local") { + var response="people_outline"; + } else if (type == "local-media") { + var response="people_outline"; + } else if (type == "pub") { + var response="language"; + } else if (type == "pub-media") { + var response="language"; } else if (type == "tag") { - return "search" + var response="search"; } else if (type == "list") { - return "view_headline" - }else if (type == "list") { - return "subject" - }else if (type == "dm") { - return "mail" - }else if (type == "mix") { - return "share" + var response="view_headline"; + } else if (type == "notf") { + var response="notifications"; + } else if (type == "noauth") { + var response="people_outline"; + } else if (type == "dm") { + var response="mail_outline"; + } else if (type == "mix") { + var response="merge_type"; + } else if (type == "plus") { + var response="merge_type"; + }else if (type == "webview") { + var response="language"; } + return response; } function strAlive(){ var date = new Date() ; diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js index 96f692e2..151ffc86 100644 --- a/app/js/ui/layout.js +++ b/app/js/ui/layout.js @@ -7,12 +7,12 @@ var websocketLocal = []; var websocketNotf = []; //カラム追加ボックストグル -function addToggle() { - $("#add-box").toggleClass("hide"); +function addColumnMenu() { + $("#left-menu div").removeClass("active"); + $("#addColumnMenu").addClass("active"); + $(".menu-content").addClass("hide"); + $("#add-box").removeClass("hide"); addselCk() - $("#add-box").css("bottom","40px"); - $("#add-box").css("left",$('#add-tgl').offset().left-$('#add-box').width()/2+"px"); - $("#add-box").toggleClass("show"); } //最初、カラム変更時に発火 function parseColumn() { diff --git a/app/js/ui/menu.js b/app/js/ui/menu.js new file mode 100644 index 00000000..1fda04bf --- /dev/null +++ b/app/js/ui/menu.js @@ -0,0 +1,51 @@ +function menu(){ + if(!$("#menu").hasClass("appear")){ + $("#menu").addClass("appear") + var left=localStorage.getItem("menu-left"); + if(left>$('body').width()-$('#menu').width()){ + left=$('body').width()-$('#menu').width(); + }else if(left<0){ + left=0; + } + var top=localStorage.getItem("menu-top"); + if(top>$('body').height()-$('#menu').height()){ + top=$('body').height()-$('#menu').height(); + }else if(top<0){ + top=0; + } + $('#menu').css("left",left+"px") + $('#menu').css("top",top+"px") + $('#menu').fadeIn(); + $("#menu-bar").html("TheDesk "+localStorage.getItem("ver")); + $(".menu-content").addClass("hide"); + $("#add-box").removeClass("hide"); + }else{ + $('#menu').fadeOut() + $("#menu").removeClass("appear") + } + +} +$(function() { + $( "#menu" ).draggable({handle: "#menu-bar", + stop: function() { + var left=$('#menu').offset().left; + if(left>$('body').width()-$('#menu').width()){ + left=$('body').width()-$('#menu').width(); + }else if(left<0){ + left=0; + } + var top=$('#menu').offset().top; + if(top>$('body').height()-$('#menu').height()){ + top=$('body').height()-$('#menu').height(); + }else if(top<0){ + top=0; + } + localStorage.setItem("menu-left",left); + localStorage.setItem("menu-top",top); + } + }); + }); +function help(){ + const {shell} = require('electron'); + shell.openExternal("https://docs.thedesk.top"); +} \ No newline at end of file diff --git a/app/js/ui/post-box.js b/app/js/ui/post-box.js index 723eeea9..8101f1e3 100644 --- a/app/js/ui/post-box.js +++ b/app/js/ui/post-box.js @@ -1,6 +1,7 @@ /*ささやきボックス(Cr民並感)*/ //✕隠す function hide() { + $("#right-side").hide() $('#post-box').fadeOut() $("#post-box").removeClass("appear") $("#emoji").addClass("hide") @@ -19,17 +20,40 @@ function show() { $("#post-box").addClass("appear") $("#textarea").focus(); console.log("show"+localStorage.getItem("postbox-left")); - $('#post-box').css("left",localStorage.getItem("postbox-left")+"px") - $('#post-box').css("top",localStorage.getItem("postbox-top")+"px") + var left=localStorage.getItem("postbox-left"); + if(left>$('body').width()-$('#post-box').width()){ + left=$('body').width()-$('#post-box').width(); + }else if(left<0){ + left=0; + } + var top=localStorage.getItem("postbox-top"); + if(top>$('body').height()-$('#post-box').height()){ + top=$('body').height()-$('#post-box').height(); + }else if(top<0){ + top=0; + } + $('#post-box').css("left",left+"px") + $('#post-box').css("top",top+"px") $('#post-box').fadeIn(); } $(function() { $( "#post-box" ).draggable({handle: "#post-bar", stop: function() { - console.log("stopped"); - localStorage.setItem("postbox-left",$('#post-box').offset().left); - localStorage.setItem("postbox-top",$('#post-box').offset().top); + var left=$('#post-box').offset().left; + if(left>$('body').width()-$('#post-box').width()){ + left=$('body').width()-$('#post-box').width(); + }else if(left<0){ + left=0; + } + var top=$('#post-box').offset().top; + if(top>$('body').height()-$('#post-box').height()){ + top=$('body').height()-$('#post-box').height(); + }else if(top<0){ + top=0; + } + localStorage.setItem("postbox-left",left); + localStorage.setItem("postbox-top",top); } }); }); @@ -71,23 +95,4 @@ $('#textarea,#cw-text').focusout(function(e) { localStorage.removeItem("nohide") } //setTimeout(remove, 100); -}); - -$("#timeline-container").click(function(e) { - if(!$('#list-box').hasClass("hide")){ - $("#list-box").removeClass("show"); - $("#list-box").addClass("hide") - } - if(!$('#src-box').hasClass("hide")){ - $("#src-box").removeClass("show"); - $("#src-box").addClass("hide") - } - if(!$('#filter-box').hasClass("hide")){ - $("#filter-box").removeClass("show"); - $("#filter-box").addClass("hide") - } - if(!$('#add-box').hasClass("hide")){ - $("#add-box").removeClass("show"); - $("#add-box").addClass("hide") - } -}); +}); \ No newline at end of file diff --git a/app/js/ui/settings.js b/app/js/ui/settings.js index 026a0f7b..30a332ca 100644 --- a/app/js/ui/settings.js +++ b/app/js/ui/settings.js @@ -24,6 +24,7 @@ function settings() { themes(cd); localStorage.setItem("theme", cd); } + var nd = $("[name=nsfw]:checked").val(); var nt = $("[for=n_"+nd+"]").text(); if (nd != localStorage.getItem("nsfw")) { @@ -250,6 +251,12 @@ function load() { } $("#" + theme).prop("checked", true); + var ha = localStorage.getItem("ha"); + if (!ha) { + var ha = "false"; + } + $("#ha_" + ha).prop("checked", true); + var nsfw = localStorage.getItem("nsfw"); if (!nsfw) { var nsfw = "yes"; @@ -913,6 +920,12 @@ function customImp(){ alert("Error") } } +function hardwareAcceleration(){ + var had = $("[name=ha]:checked").val(); + localStorage.setItem("ha", had); + console.log("ha"); + ipc.send('ha', had); +} ipc.on('theme-json-create-complete', function (event, args) { $("#custom_import").val(""); diff --git a/app/js/ui/sort.js b/app/js/ui/sort.js index b06b5798..157c5e36 100644 --- a/app/js/ui/sort.js +++ b/app/js/ui/sort.js @@ -32,9 +32,9 @@ function sortload(){ var acctdata=user+"@"+domain; } - var html='
  • forward cancel
    '+acctdata+" "+cap(acct.type, acct.data,acct.domain)+'
  • '; + var html='
  • '+icon(acct.type)+'
    '+cap(acct.type, acct.data,acct.domain)+'
    '+acctdata+'
  • '; $("#sort").append(html); }); drag(); @@ -104,18 +104,14 @@ function sort(){ Materialize.toast("並べ替え完了。", 3000); sortload(); parseColumn(); - sortToggle() + sortMenu() } //ソートボタントグル -function sortToggle(){ +function sortMenu(){ + $("#left-menu div").removeClass("active"); + $("#sortMenu").addClass("active"); + $(".menu-content").addClass("hide"); + $("#sort-box").removeClass("hide"); $("#sort").html(""); - if ($("#sort-box").hasClass("hide")) { - $("#sort-box").removeClass("hide"); - $("#sort-box").addClass("show"); - //並べ替え - sortload(); - } else { - $("#sort-box").addClass("hide"); - $("#sort-box").removeClass("show"); - } + sortload(); } \ No newline at end of file diff --git a/app/js/userdata/showOnTL.js b/app/js/userdata/showOnTL.js index a464d32d..4b8728d8 100644 --- a/app/js/userdata/showOnTL.js +++ b/app/js/userdata/showOnTL.js @@ -130,7 +130,11 @@ function udg(user, acct_id) { $('#his-data').css('background-image', 'url(' + json.header + ')'); $("#his-sta").text(json.statuses_count); $("#his-follow").text(json.following_count); - $("#his-follower").text(json.followers_count); + var flerc=json.followers_count; + if(flerc<0){ + flerc="-"; + } + $("#his-follower").text(flerc); $("#his-since").text(crat(json.created_at)); $("#his-openin").attr("data-href", json.url); if(json.fields){ diff --git a/app/main.js b/app/main.js index d57b72e4..38ab0479 100644 --- a/app/main.js +++ b/app/main.js @@ -27,8 +27,15 @@ var info_path = join(app.getPath("userData"), "window-size.json"); var max_info_path = join(app.getPath("userData"), "max-window-size.json"); var lang_path=join(app.getPath("userData"), "language"); var customcss=join(app.getPath("userData"), "custom.css"); - var tmp_img = join(app.getPath("userData"), "tmp.png"); +var ha_path=join(app.getPath("userData"), "hardwareAcceleration"); +try{ + fs.readFileSync(ha_path, 'utf8'); + app.disableHardwareAcceleration() + console.log("disabled: HA"); +}catch{ + console.log("enabled: HA"); +} var window_size; try { window_size = JSON.parse(fs.readFileSync(info_path, 'utf8')); @@ -76,7 +83,9 @@ function createWindow() { var bit=process.arch; if(platform=="linux"){ var arg={width:window_size.width,height:window_size.height,x:window_size.x,y:window_size.y,icon: __dirname + '/desk.png'} - }else{ + }else if(platform=="win32"){ + var arg={width:window_size.width,height:window_size.height,x:window_size.x,y:window_size.y,simpleFullscreen:true} + }else if(platform=="darwin"){ var arg={width:window_size.width,height:window_size.height,x:window_size.x,y:window_size.y,simpleFullscreen:true} } mainWindow = new BrowserWindow(arg); @@ -136,8 +145,13 @@ app.on('ready', createWindow); var onError = function(err,response){ console.error(err,response); }; - var ipc = electron.ipcMain; +ipc.on('minimize', function(e, args) { + mainWindow.minimize(); +}); +ipc.on('maximize', function(e, args) { + mainWindow.isMaximized() ? mainWindow.unmaximize() : mainWindow.maximize(); +}); ipc.on('native-notf', function(e, args) { var platform=process.platform; var bit=process.arch; @@ -259,7 +273,16 @@ ipc.on('theme-json-list', function(e, arg) { mainWindow.webContents.send('theme-json-list-response', themes); }); }) - +//ハードウェアアクセラレーションの無効化 +ipc.on('ha', function(e, arg) { + if(arg=="true"){ + fs.writeFileSync(ha_path,arg); + }else{ + fs.unlink(ha_path, function (err) {}); + } + app.relaunch() + app.exit() +}) ipc.on('update', function(e, x, y) { var platform=process.platform; @@ -527,7 +550,7 @@ ipc.on('nano', function (e, x, y) { window_pos = [0,0]; // デフォルトバリュー } var nanowindow = new BrowserWindow({width: 350, height: 200, - "transparent": false, // ウィンドウの背景を透過 + "transparent": false, // ウィンドウの背景を透過 "frame": false, // 枠の無いウィンドウ "resizable": false }); nanowindow.loadURL('file://' + __dirname + '/nano.html'); diff --git a/app/package.json b/app/package.json index 3bdc70b9..e78889cb 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "thedesk", - "version": "17.2.0", + "version": "17.3.0", "description": "TheDesk is a Mastodon client for PC.", "main": "main.js", "scripts": { diff --git a/app/view/en/index.html b/app/view/en/index.html index 3407cb62..d82534fe 100644 --- a/app/view/en/index.html +++ b/app/view/en/index.html @@ -32,7 +32,7 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/app/view/en/setting.html b/app/view/en/setting.html index 13ade0a4..ea07bd67 100644 --- a/app/view/en/setting.html +++ b/app/view/en/setting.html @@ -79,6 +79,14 @@ TheDesk uses this value when it try to save pictures or take screenshots.

    +
    Disable hardware acceleration
    + Auto restarted +
    + + + + +
  • @@ -312,8 +320,9 @@ - + + +
    Default accounts of actions
    Main account can be set on Account Manager.
    @@ -454,6 +463,7 @@
  • X:Toggle toot box
  • Ctrl+Enter:Post
  • Ctrl+Enter+Shift:Post(secondary toot)
  • +
  • Alt+Enter:Secondary Toot Button
  • Ctrl+E:Make all notifications read
  • Esc:Hide toot box
  • F5:Super Reload
  • diff --git a/app/view/ja/index.html b/app/view/ja/index.html index e8e93a2c..4f7dc743 100644 --- a/app/view/ja/index.html +++ b/app/view/ja/index.html @@ -32,7 +32,7 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/app/view/ja/setting.html b/app/view/ja/setting.html index db01f2f7..278dfabb 100644 --- a/app/view/ja/setting.html +++ b/app/view/ja/setting.html @@ -79,6 +79,14 @@ 画像ダウンロードやスクリーンショットに影響します。

    +
    ハードウェアアクセラレーションの無効化
    + 表示(特に設定画面)が乱れる場合に「はい」を選択してください。自動で再起動します。 +
    + + + + +
  • @@ -312,8 +320,9 @@ - + + +
    投稿後や起動時のアカウント
    メインアカウントはアカウント設定で指定できます。投稿以外のアカウント選択にも影響します。
    @@ -454,6 +463,7 @@
  • X:投稿パネルを開閉
  • Ctrl+Enter:投稿
  • Ctrl+Enter+Shift:投稿(セカンダリートゥート)
  • +
  • Alt+Enter:セカンダリートゥートボタン
  • Ctrl+E:全ての通知を既読にする
  • Esc:投稿パネルを消す
  • F5:スーパーリロード
  • diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html index c64acacd..9f30f196 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -54,7 +54,7 @@ var tlid=0;
    -
    {{post-new}}
    +
    {{post-new}}
    @@ -125,7 +125,6 @@ var tlid=0; Markdownエディタを表示 -
    visibility_off @@ -202,6 +201,7 @@ var tlid=0;
    +
    {{emojiWarn}} @@ -582,17 +582,19 @@ var tlid=0; HP
    GitHub

    - - -
    -
    {{selectAcct}} -
    - - -
    -
    -
    - - -
    -
    {{showThisTL}} - -
    -
    {{webviewWarn}} -
    -
    - -
    -
    -
    - -
    -
    - -
    -search - - - -
    -
    -
    - -
    - -
    -
      -
      - - -
      -
      - -
      -
      - - +
      + + + +
      Tips: @@ -879,4 +874,5 @@ var tlid=0; - \ No newline at end of file + + \ No newline at end of file diff --git a/app/view/make/language/index.en.json b/app/view/make/language/index.en.json index e726c091..9c3a7b07 100644 --- a/app/view/make/language/index.en.json +++ b/app/view/make/language/index.en.json @@ -141,13 +141,13 @@ "mins":"minutes", "secs":"seconds", "warnOnIntegratedTL":"Integrated TL/Plus TL will hide both Home-filtering words and Local-filtering words.", - "helloTheDesk":"

      Welcome to TheDesk


      Add an account or click add to add a column.", + "helloTheDesk":"

      Welcome to TheDesk


      Add an account or click apps to add a column.", "addColumn":"Add a column", "sortColumns":"Sort", "acctMan":"Account Manager", "filter":"Filter", "setting":"Preferences", - "reverse":"Toot box reverse", + "reverse":"Toot button layout reverse", "f5":"Super Reload", "nanoDes":"The smallest Mastodon,", "verTips":"Version", diff --git a/app/view/make/language/index.ja.json b/app/view/make/language/index.ja.json index db6e8ffc..5092ea9b 100644 --- a/app/view/make/language/index.ja.json +++ b/app/view/make/language/index.ja.json @@ -141,13 +141,13 @@ "mins":"分", "secs":"秒", "warnOnIntegratedTL":"Integrated TL/Plus TLは、公開/ホームのフィルターワードが合算されて適応されます。どちらか一方の指定でも非表示になります。", - "helloTheDesk":"

      Welcome to TheDesk


      アカウントを追加するか下のaddボタンよりカラムを追加してください。", + "helloTheDesk":"

      Welcome to TheDesk


      アカウントを追加するか下のappsボタンよりカラムを追加してください。", "addColumn":"カラム追加", "sortColumns":"カラム一覧/並べ替え", "acctMan":"アカウントマネージャー", "filter":"フィルター", "setting":"設定", - "reverse":"トゥートバーの左右入れ替え", + "reverse":"トゥートボタンの左右入れ替え", "f5":"スーパーリロード", "nanoDes":"最小のマストドン。", "verTips":"バージョン", diff --git a/app/view/make/language/setting.en.json b/app/view/make/language/setting.en.json index 5d2e15cd..c6fa7b4f 100644 --- a/app/view/make/language/setting.en.json +++ b/app/view/make/language/setting.en.json @@ -10,6 +10,8 @@ "backup":"Import and export of preferences", "import":"Import", "export":"Export", + "hardwareAcceleration":"Disable hardware acceleration", + "hardwareAccelerationWarn":"Auto restarted", "theme":"Themes", "popup":"Popup notification(on Windows)", "popupwarn":"Hide to set \"0\"", @@ -102,6 +104,7 @@ "simple":"Only URL", "mention":"URL and acct(mention to the user)", "full":"URL, text and acct(mention to the user)", + "notqt":"Disabled(Hide buttons on TLs)", "main":"Default accounts of actions", "mainwarn":"Main account can be set on Account Manager.", "lastacct":"Account you used recently", diff --git a/app/view/make/language/setting.ja.json b/app/view/make/language/setting.ja.json index d279338d..f197cf22 100644 --- a/app/view/make/language/setting.ja.json +++ b/app/view/make/language/setting.ja.json @@ -10,6 +10,8 @@ "backup":"設定のインポートとエクスポート", "import":"インポート", "export":"エクスポート", + "hardwareAcceleration":"ハードウェアアクセラレーションの無効化", + "hardwareAccelerationWarn":"表示(特に設定画面)が乱れる場合に「はい」を選択してください。自動で再起動します。", "theme":"テーマの設定", "popup":"新規通知のポップアップお知らせの表示秒数", "popupwarn":"0に設定すると表示されません", @@ -102,6 +104,7 @@ "simple":"URLのみ", "mention":"URLとアカウント名(相手に通知)", "full":"本文・URL・アカウント名", + "notqt":"使わない(TL上にボタンも表示されません)", "main":"投稿後や起動時のアカウント", "mainwarn":"メインアカウントはアカウント設定で指定できます。投稿以外のアカウント選択にも影響します。", "lastacct":"最後に使用したアカウント", diff --git a/app/view/make/setting.sample.html b/app/view/make/setting.sample.html index a7c3004b..82686000 100644 --- a/app/view/make/setting.sample.html +++ b/app/view/make/setting.sample.html @@ -79,6 +79,14 @@ {{savefolderwarn}}

      +
      {{hardwareAcceleration}}
      + {{hardwareAccelerationWarn}} +
      + + + + +
    • @@ -312,8 +320,9 @@ - + + +
      {{main}}
      {{mainwarn}}
      @@ -454,6 +463,7 @@
    • X:{{keytoggle}}
    • Ctrl+Enter:{{keypost}}
    • Ctrl+Enter+Shift:{{keysecpost}}
    • +
    • Alt+Enter:{{secondary}}
    • Ctrl+E:{{keyunread}}
    • Esc:{{keyesc}}
    • F5:{{keyf5}}
    • diff --git a/app/view/ps/acct.html b/app/view/ps/acct.html index fccd94a1..7e4687bc 100644 --- a/app/view/ps/acct.html +++ b/app/view/ps/acct.html @@ -20,13 +20,13 @@ body,html{overflow-y: scroll;} .card .colorsel div.exc{width:40px;height:20px;} -{{comment-start}} + -{{comment-end}} + diff --git a/app/view/ps/index.html b/app/view/ps/index.html index ae6ad980..5ef300a2 100644 --- a/app/view/ps/index.html +++ b/app/view/ps/index.html @@ -13,13 +13,13 @@ - {{comment-start}} + - {{comment-end}} + @@ -32,7 +32,7 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/app/view/ps/setting.html b/app/view/ps/setting.html index eef5761e..c6867c67 100644 --- a/app/view/ps/setting.html +++ b/app/view/ps/setting.html @@ -2,13 +2,13 @@ Settings - TheDesk - {{comment-start}} + - {{comment-end}} + @@ -79,6 +79,14 @@ crwdns548:0crwdne548:0

      +
      {{hardwareAcceleration}}
      + {{hardwareAccelerationWarn}} +
      + + + + +
    • @@ -312,8 +320,9 @@ - + + +
      crwdns607:0crwdne607:0
      crwdns608:0crwdne608:0
      @@ -454,6 +463,7 @@
    • X:crwdns650:0crwdne650:0
    • Ctrl+Enter:crwdns651:0crwdne651:0
    • Ctrl+Enter+Shift:crwdns1924:0crwdne1924:0
    • +
    • Alt+Enter:crwdns1916:0crwdne1916:0
    • Ctrl+E:crwdns652:0crwdne652:0
    • Esc:crwdns653:0crwdne653:0
    • F5:crwdns654:0crwdne654:0
    • diff --git a/app/view/ps/update.html b/app/view/ps/update.html index bbc0993a..fb23456b 100644 --- a/app/view/ps/update.html +++ b/app/view/ps/update.html @@ -6,13 +6,13 @@ -{{comment-start}} + -{{comment-end}} +