Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
#445 hidable some tools and show badge if it has a thread on detail o…
Browse files Browse the repository at this point in the history
…f toot
  • Loading branch information
cutls committed Apr 1, 2021
1 parent 7f79f17 commit f80b8d0
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 5 deletions.
13 changes: 13 additions & 0 deletions app/js/tl/datails.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ function details(id, acct_id, tlid, mode) {
} else {
$('.dm-hide').show()
}
const context = localStorage.getItem('moreContext')
if(context != 'yes') {
$('.contextTool').hide()
} else {
$('.contextTool').show()
}
$('.toot-reset').html('<span class="no-data">' + lang.lang_details_nodata + '</span>')
var html = $('#timeline_' + tlid + ' [toot-id=' + id + ']').html()
$('#toot-this').html(html)
Expand Down Expand Up @@ -222,6 +228,10 @@ function getContext(id, acct_id) {
var templete = parse(json.descendants, '', acct_id, '', '', mute)
if (templete != '') {
$('#toot-after .no-data').hide()
$('#toot-after-new').removeClass('hide')
} else {
$('#toot-after-new').addClass('hide')
$('#toot-after').html('<span class="no-data">' + lang.lang_details_nodata + '</span>')
}
$('#toot-after').html(templete)
$('#toot-after .hide').html(lang.lang_details_filtered)
Expand All @@ -230,6 +240,9 @@ function getContext(id, acct_id) {
var templete = parse(json.ancestors, '', acct_id, '', '', mute)
if (templete != '') {
$('#toot-reply .no-data').hide()
$('#toot-reply-new').removeClass('hide')
} else {
$('#toot-reply-new').addClass('hide')
}
$('#toot-reply').prepend(templete)
$('#toot-reply .hide').html(lang.lang_details_filtered)
Expand Down
12 changes: 7 additions & 5 deletions app/view/make/index.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,25 +390,26 @@ <h3 class="center">@@demoBottomBtns@@</h3>
<div id="tootmodal" class="modal modal-fixed-footer">
<div class="modal-content">
<ul class="collapsible" id="det-col">
<li class="dm-hide">
<li class="dm-hide contextTool">
<div class="collapsible-header">
<i class="material-icons">people_outline</i>@@afterLTL@@
</div>
<div class="collapsible-body toot-reset" id="ltl-after"></div>
</li>
<li class="dm-hide">
<li class="dm-hide contextTool">
<div class="collapsible-header">
<i class="material-icons">person_outline</i>@@afterUTL@@
</div>
<div class="collapsible-body toot-reset" id="user-after"></div>
</li>
<li class="dm-hide">
<li class="dm-hide contextTool">
<div class="collapsible-header"><i class="material-icons">language</i>@@afterFTL@@</div>
<div class="collapsible-body toot-reset" id="ftl-after"></div>
</li>
<li>
<div class="collapsible-header">
<i class="material-icons">arrow_upward</i>@@contextBefore@@
<i class="material-icons red-text hide" id="toot-reply-new">new_releases</i>
</div>
<div class="collapsible-body toot-reset" id="toot-reply"></div>
</li>
Expand All @@ -423,16 +424,17 @@ <h3 class="center">@@demoBottomBtns@@</h3>
<li>
<div class="collapsible-header">
<i class="material-icons">arrow_downward</i>@@contextAfter@@
<i class="material-icons red-text hide" id="toot-after-new">new_releases</i>
</div>
<div class="collapsible-body toot-reset" id="toot-after"></div>
</li>
<li class="dm-hide">
<li class="dm-hide contextTool">
<div class="collapsible-header">
<i class="material-icons">people_outline</i>@@beforeLTL@@
</div>
<div class="collapsible-body toot-reset" id="toot-before"></div>
</li>
<li class="dm-hide">
<li class="dm-hide contextTool">
<div class="collapsible-header">
<i class="material-icons">person_outline</i>@@beforeUTL@@
</div>
Expand Down
2 changes: 2 additions & 0 deletions app/view/make/language/en/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
"markerswarn": "Mastodon 3.0~. Shared on WebUI and third-party supported clients.",
"remote_img": "Get images from the remote server",
"remote_imgWarn": "All previews are got from your loginned cache server.",
"moreContextMode": "Context Tool",
"moreContextModeWarn": "On detail of the toot modal, show toots before / after the toot on LTL, FTL, UTL",
"replySound": "Sound(Reply)",
"favSound": "Sound(Fav)",
"btSound": "Sound(Boost)",
Expand Down
2 changes: 2 additions & 0 deletions app/view/make/language/ja-KS/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@
"markerswarn": "Mastodon 3.0相当以上。WebUIと対応クライアントで共有するやつや。",
"remote_img": "画像をリモートから取得",
"remote_imgWarn": "プレビューはログインサーバーのキャッシュからどちらにしろ取得する。ビューワーのみに適用されるで。",
"moreContextMode": "コンテキストツール",
"moreContextModeWarn": "トゥート詳細の、トゥート前後のトゥートを表示する機能",
"replySound": "リプライの通知音",
"favSound": "お気に入り登録の通知音",
"btSound": "ブーストの通知音",
Expand Down
2 changes: 2 additions & 0 deletions app/view/make/language/ja/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@
"thin": "細い",
"normal": "普通",
"thick": "太い",
"moreContextMode": "コンテキストツール",
"moreContextModeWarn": "トゥート詳細の、トゥート前後のトゥートを表示する機能",
"main": "投稿後や起動時のアカウント",
"mainwarn": "メインアカウントはアカウント設定で指定できます。投稿以外のアカウント選択にも影響します。",
"lastacct": "最後に使用したアカウント",
Expand Down
11 changes: 11 additions & 0 deletions app/view/make/setting.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,17 @@ var tlConstruction = [
]
}
},
{
id: 'mcm',
storage: 'moreContext',
checkbox: true,
setValue: 'no',
text: {
head: '@@moreContextMode@@',
desc: '@@moreContextModeWarn@@',
checkbox: yesno
}
},
{
id: 'replySound',
storage: 'replySound',
Expand Down

0 comments on commit f80b8d0

Please sign in to comment.