From bec4444388bdf2c7f19a777c37c9ebfa81e35d7d Mon Sep 17 00:00:00 2001 From: cutls Date: Fri, 4 Sep 2020 23:43:04 +0900 Subject: [PATCH] #307 #317 margin between timelines --- app/js/tl/parse.js | 7 ++++++- app/js/ui/layout.js | 12 +++++++----- app/view/make/language/en/setting.json | 1 + app/view/make/language/ja-KS/setting.json | 1 + app/view/make/language/ja/setting.json | 1 + app/view/make/setting.sample.js | 13 +++++++++++++ 6 files changed, 29 insertions(+), 6 deletions(-) diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 487a1250..19c8182a 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1591,9 +1591,14 @@ function mastodonBaseStreaming(acct_id) { filterUpdate(acct_id) } else if (~typeA.indexOf('announcement')) { announ(acct_id, tlid) - } else if (type == 'notification') { + } else if (typeA == 'notification') { + const obj = JSON.parse(JSON.parse(mess.data).payload) let template = '' localStorage.setItem('lastnotf_' + acct_id, obj.id) + let popup = localStorage.getItem('popup') + if (!popup) { + popup = 0 + } if (obj.type != 'follow' && obj.type != 'follow_request') { template = parse([obj], 'notf', acct_id, 'notf', popup) } else if (obj.type == 'follow_request') { diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js index 110656d9..eb84187a 100644 --- a/app/js/ui/layout.js +++ b/app/js/ui/layout.js @@ -162,19 +162,21 @@ function parseColumn(target, dontclose) { } else { localStorage.removeItem('hasNotfC_' + acct.domain) } + var css = '' var width = localStorage.getItem('width') if (width) { - var css = ' min-width:' + width + 'px;' + css = ' min-width:' + width + 'px;' } var maxWidth = localStorage.getItem('max-width') if (maxWidth) { css = css +'max-width:' + maxWidth + 'px;' } - if (acct.width) { - var css = ' min-width:' + acct.width + 'px;max-width:' + acct.width + 'px;' + var margin = localStorage.getItem('margin') + if (margin) { + css = css +'margin-right:' + margin + 'px;' } - if (!css) { - var css = '' + if (acct.width) { + css = css + ' min-width:' + acct.width + 'px !important;max-width:' + acct.width + 'px !important;' } if (acct.type == 'webview') { if (localStorage.getItem('fixwidth')) { diff --git a/app/view/make/language/en/setting.json b/app/view/make/language/en/setting.json index 96355d8a..ee5a7a50 100644 --- a/app/view/make/language/en/setting.json +++ b/app/view/make/language/en/setting.json @@ -28,6 +28,7 @@ "widthwarn": "Scroll bar will be shown when your window size is more than ammounts of columns.", "fixwidth": "Minimum width of TweetDeck browser", "fixwidthwarn": "", + "margin": "Margin between timelines", "above": "above", "font": "Font", "fontwarn": "Select your favorite font to 'Select'(On Linux, it may not work.)", diff --git a/app/view/make/language/ja-KS/setting.json b/app/view/make/language/ja-KS/setting.json index 9ecf6f25..f5c1c414 100644 --- a/app/view/make/language/ja-KS/setting.json +++ b/app/view/make/language/ja-KS/setting.json @@ -27,6 +27,7 @@ "widthwarn": "画面全体の横幅÷カラム数で計算してそれ超してもうたら横スクロール入るで。", "fixwidth": "TweetDeckの限定の最低横幅", "fixwidthwarn": "", + "margin": "TL間のマージン", "above": "以上", "font": "フォント", "fontwarn": "「選択」を押してフォントを選んでな。(Linuxでは動かんかもしれん。)", diff --git a/app/view/make/language/ja/setting.json b/app/view/make/language/ja/setting.json index 8c770d1b..931986d9 100644 --- a/app/view/make/language/ja/setting.json +++ b/app/view/make/language/ja/setting.json @@ -28,6 +28,7 @@ "widthwarn": "画面全体の横幅÷カラム数がこの値を超えた時、横スクロールとなります。", "fixwidth": "TweetDeckの限定の最低横幅", "fixwidthwarn": "", + "margin": "TL間のマージン", "above": "以上", "font": "フォント", "fontwarn": "「選択」を押してフォントを選んでください。(Linuxでは動かない場合があります。)", diff --git a/app/view/make/setting.sample.js b/app/view/make/setting.sample.js index 97f4ba53..dfda6d10 100644 --- a/app/view/make/setting.sample.js +++ b/app/view/make/setting.sample.js @@ -83,6 +83,19 @@ var envConstruction = [ desc: '@@widthwarn@@' } }, + { + id: 'margin', + storage: 'margin', + checkbox: false, + doubleText: false, + setValue: 0, + width: 50, + text: { + head: '@@margin@@', + desc: '', + after: 'px' + } + }, { id: 'fixwidth', storage: 'fixwidth',