From 1b144ce59b3cda47cd9af18c42652459500c922e Mon Sep 17 00:00:00 2001 From: wintiger0222 <0xodbs02@naver.com> Date: Wed, 13 Sep 2023 08:58:44 +0900 Subject: [PATCH 1/7] Update I'll PR later --- _locales/ko/messages.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/_locales/ko/messages.json b/_locales/ko/messages.json index 755cfd2d..cf1d26a7 100644 --- a/_locales/ko/messages.json +++ b/_locales/ko/messages.json @@ -517,7 +517,7 @@ "mute_videos": { "message": "비디오를 기본적으로 음소거합니다" }, "dont_pause_videos": { "message": "스크롤 할 때 비디오를 일시정지 하지 않습니다" }, "delete_for_you":{ "message": "나에게서 삭제", "description":"DM Message Delete menu"}, - "show_user_previews_on_mobile": { "message": "계속 누를 시 유저 프로필을 보여줍니다 (이용에 방해될 수 있습니다)" }, + "show_user_previews_on_mobile": { "message": "계속 누를 시 유저 프로필을 표시합니다 (이용에 방해될 수 있습니다)" }, "separate_text": { "message": "텍스트를 분리하기", "description": "This option appears in three-dot menu of tweets only on mobile and makes text bigger and adds padding on top and bottom on tap" }, "leave_conversation": {"message":"대화를 삭제하시거나 나가실건가요?"}, "autotranslation_help1": {"message": "이 기능은 버튼을 직접 누를 필요 없이 자동으로 트윗을 찾아 번역을 하는 기능입니다."}, @@ -549,7 +549,7 @@ "manage_searches": { "message": "검색 관리하기" }, "add_search": { "message": "검색 추가하기" }, "pinned_searches": { "message": "고정된 검색" }, - "show_follower_counts_in_lists": { "message": "팔로우/팔로잉 페이지에서 팔로워의 수를 보여줍니다" }, + "show_follower_counts_in_lists": { "message": "팔로우/팔로잉 페이지에서 팔로워의 수를 표시합니다" }, "not_possible_to_see_unfollowers": { "message": "아쉽게도, 50,000 명 이상의 팔로워를 가진 계정에 대해 언팔로우를 볼 수 없습니다." }, "sort_by_follow_date": { "message": "팔로우 한 날짜 순 정렬 (부정확)" }, "sort_by_followers": { "message": "팔로워 수 순 정렬" }, @@ -566,12 +566,12 @@ "descending": { "message": "내림차순" }, "search_by_name": { "message": "이름으로 검색" }, "search_by_description": { "message": "자기소개로 검색" }, - "only_show_people_you_follow": { "message": "나를 팔로우 하는 사람만 보여줍니다" }, - "only_show_people_with_followers": { "message": "최소 $NUMBER$ 팔로워를 가진 사람만 보여줍니다", "placeholders": { "number": { "content": "-1" } } }, - "only_show_people_with_age": { "message": "$NUMBER$ 일 된 계정을 가진 사람만 보여줍니다", "placeholders": { "number": { "content": "-1" } } }, + "only_show_people_you_follow": { "message": "나를 팔로우 하는 사람만 표시합니다" }, + "only_show_people_with_followers": { "message": "최소 $NUMBER$ 팔로워를 가진 사람만 표시합니다", "placeholders": { "number": { "content": "-1" } } }, + "only_show_people_with_age": { "message": "$NUMBER$ 일 된 계정을 가진 사람만 표시합니다", "placeholders": { "number": { "content": "-1" } } }, "page": { "message": "페이지" }, "update": {"message": "업데이트" }, - "show_quote_count": { "message": "트윗의 인용 수를 보여줍니다" }, + "show_quote_count": { "message": "트윗의 인용 수를 표시합니다" }, "uploading": { "message": "업로드 중" }, "finalization": { "message": "마무리 하는 중" }, "processing": { "message": "처리 중" } From 3463af0bfea0d3ef04003e00df35d72a57af2257 Mon Sep 17 00:00:00 2001 From: wintiger0222 <0xodbs02@naver.com> Date: Wed, 13 Sep 2023 10:10:45 +0900 Subject: [PATCH 2/7] Move quote count to footer --- _locales/en/messages.json | 3 ++- _locales/ko/messages.json | 3 ++- layouts/header/style.css | 7 ------- scripts/helpers.js | 13 ++++++------- scripts/tweetviewer.js | 13 ++++++------- 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index d4959e84..dcdb1da9 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -574,5 +574,6 @@ "show_quote_count": { "message": "Show quote count on tweets" }, "uploading": { "message": "Uploading" }, "finalization": { "message": "Finalization" }, - "processing": { "message": "Processing" } + "processing": { "message": "Processing" }, + "quotes": { "message": "Quotes" } } \ No newline at end of file diff --git a/_locales/ko/messages.json b/_locales/ko/messages.json index cf1d26a7..0283b74a 100644 --- a/_locales/ko/messages.json +++ b/_locales/ko/messages.json @@ -574,5 +574,6 @@ "show_quote_count": { "message": "트윗의 인용 수를 표시합니다" }, "uploading": { "message": "업로드 중" }, "finalization": { "message": "마무리 하는 중" }, - "processing": { "message": "처리 중" } + "processing": { "message": "처리 중" }, + "quotes": { "message": "인용" } } \ No newline at end of file diff --git a/layouts/header/style.css b/layouts/header/style.css index 5bf28e72..4075fda2 100644 --- a/layouts/header/style.css +++ b/layouts/header/style.css @@ -1972,9 +1972,6 @@ emoji-picker { .tweet-interact-bookmark:before { content: "\f093"; } -.tweet-interact-quote:before { - content: "\f029"; -} .user-verified::after { content: "\f099"; color: #ee55a1; @@ -2170,10 +2167,6 @@ emoji-picker { .tweet-interact-bookmark:hover { color: #3b918a !important } -.tweet-interact-quote:hover:before, -.tweet-interact-quote:hover { - color: #913b8d !important -} .tweet-birdwatch { margin-top: 10px; diff --git a/scripts/helpers.js b/scripts/helpers.js index cd4d0ef1..8448d7f7 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -1894,6 +1894,12 @@ async function appendTweet(t, timelineContainer, options = {}) { ${LOC.retweets.message} ${formatLargeNumber(t.retweet_count).replace(/\s/g, ',')} + ${vars.showQuoteCount && typeof t.quote_count !== 'undefined' && t.quote_count > 0 ? + /*html*/` + ${LOC.quotes.message} + ${formatLargeNumber(t.quote_count).replace(/\s/g, ',')} + ` : + ''} ${vars.heartsNotStars ? LOC.likes.message : LOC.favorites.message} ${formatLargeNumber(t.favorite_count).replace(/\s/g, ',')} @@ -1915,9 +1921,6 @@ async function appendTweet(t, timelineContainer, options = {}) { ` : ''} ${options.mainTweet ? '' : formatLargeNumber(t.favorite_count).replace(/\s/g, ',')} - ${vars.showQuoteCount && options.mainTweet && typeof t.quote_count !== 'undefined' && t.quote_count > 0 ? - /*html*/`${formatLargeNumber(t.quote_count).replace(/\s/g, ',')}` : - ''} ${(vars.showBookmarkCount || options.mainTweet) && typeof t.bookmark_count !== 'undefined' ? /*html*/`${formatLargeNumber(t.bookmark_count).replace(/\s/g, ',')}` : ''} @@ -2257,7 +2260,6 @@ async function appendTweet(t, timelineContainer, options = {}) { const tweetInteractReply = tweet.getElementsByClassName('tweet-interact-reply')[0]; const tweetInteractRetweet = tweet.getElementsByClassName('tweet-interact-retweet')[0]; const tweetInteractFavorite = tweet.getElementsByClassName('tweet-interact-favorite')[0]; - const tweetInteractQuote = tweet.getElementsByClassName('tweet-interact-quote')[0]; const tweetInteractBookmark = tweet.getElementsByClassName('tweet-interact-bookmark')[0]; const tweetInteractMore = tweet.getElementsByClassName('tweet-interact-more')[0]; @@ -2619,9 +2621,6 @@ async function appendTweet(t, timelineContainer, options = {}) { }); } }; - if(tweetInteractQuote) tweetInteractQuote.addEventListener('click', () => { - tweetInteractRetweetMenuQuotes.click(); - }); if(tweetInteractBookmark) tweetInteractBookmark.addEventListener('click', switchBookmark); if(tweetInteractMoreMenuBookmark) tweetInteractMoreMenuBookmark.addEventListener('click', switchBookmark); if(tweetDeleteBookmark) tweetDeleteBookmark.addEventListener('click', async () => { diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index 8231cf72..45c9810f 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -1028,6 +1028,12 @@ class TweetViewer { ${LOC.retweets.message} ${formatLargeNumber(t.retweet_count).replace(/\s/g, ',')} + ${vars.showQuoteCount && typeof t.quote_count !== 'undefined' && t.quote_count > 0 ? /*html*/ + ` + ${LOC.quotes.message} + ${formatLargeNumber(t.quote_count).replace(/\s/g, ',')} + ` : + ''} ${vars.heartsNotStars ? LOC.likes.message : LOC.favorites.message} ${formatLargeNumber(t.favorite_count).replace(/\s/g, ',')} @@ -1049,9 +1055,6 @@ class TweetViewer { ` : ''} ${options.mainTweet ? '' : formatLargeNumber(t.favorite_count).replace(/\s/g, ',')} - ${vars.showQuoteCount && options.mainTweet && typeof t.quote_count !== 'undefined' && t.quote_count > 0 ? - /*html*/`${formatLargeNumber(t.quote_count).replace(/\s/g, ',')}` : - ''} ${(vars.showBookmarkCount || options.mainTweet) && typeof t.bookmark_count !== 'undefined' ? /*html*/`${formatLargeNumber(t.bookmark_count).replace(/\s/g, ',')}` : ''} @@ -1345,7 +1348,6 @@ class TweetViewer { const tweetInteractReply = tweet.getElementsByClassName('tweet-interact-reply')[0]; const tweetInteractRetweet = tweet.getElementsByClassName('tweet-interact-retweet')[0]; const tweetInteractFavorite = tweet.getElementsByClassName('tweet-interact-favorite')[0]; - const tweetInteractQuote = tweet.getElementsByClassName('tweet-interact-quote')[0]; const tweetInteractBookmark = tweet.getElementsByClassName('tweet-interact-bookmark')[0]; const tweetInteractMore = tweet.getElementsByClassName('tweet-interact-more')[0]; @@ -1661,9 +1663,6 @@ class TweetViewer { }); } }; - if(tweetInteractQuote) tweetInteractQuote.addEventListener('click', () => { - tweetInteractRetweetMenuQuotes.click(); - }); if(tweetInteractBookmark) tweetInteractBookmark.addEventListener('click', switchBookmark); if(tweetInteractMoreMenuBookmark) tweetInteractMoreMenuBookmark.addEventListener('click', switchBookmark); From e53d68da7d66a557da2b362ee620c2ca90e514ff Mon Sep 17 00:00:00 2001 From: wintiger0222 <0xodbs02@naver.com> Date: Wed, 13 Sep 2023 10:17:23 +0900 Subject: [PATCH 3/7] Show less user when quote count enabled --- scripts/helpers.js | 2 +- scripts/tweetviewer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/helpers.js b/scripts/helpers.js index 8448d7f7..6ff3dcbd 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -2138,7 +2138,7 @@ async function appendTweet(t, timelineContainer, options = {}) { tweet.querySelector('.tweet-top').append(icon, span); } if(options.mainTweet) { - let likers = mainTweetLikers.slice(0, 8); + let likers = (vars.showQuoteCount) ? mainTweetLikers.slice(0, 6) : mainTweetLikers.slice(0, 8); for(let i in likers) { let liker = likers[i]; let a = document.createElement('a'); diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index 45c9810f..06e4bcfc 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -1247,7 +1247,7 @@ class TweetViewer { tweet.querySelector('.tweet-top').append(icon, span); } if(options.mainTweet) { - let likers = this.mainTweetLikers.slice(0, 8); + let likers = (vars.showQuoteCount) ? mainTweetLikers.slice(0, 6) : mainTweetLikers.slice(0, 8); for(let i in likers) { let liker = likers[i]; let a = document.createElement('a'); From 38679795db0ab04cf1c550cde54df296a3d10f34 Mon Sep 17 00:00:00 2001 From: wintiger0222 <0xodbs02@naver.com> Date: Wed, 13 Sep 2023 10:19:50 +0900 Subject: [PATCH 4/7] Fix typo --- scripts/tweetviewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index 06e4bcfc..6f6ac6b6 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -1247,7 +1247,7 @@ class TweetViewer { tweet.querySelector('.tweet-top').append(icon, span); } if(options.mainTweet) { - let likers = (vars.showQuoteCount) ? mainTweetLikers.slice(0, 6) : mainTweetLikers.slice(0, 8); + let likers = (vars.showQuoteCount) ? this.mainTweetLikers.slice(0, 6) : this.mainTweetLikers.slice(0, 8); for(let i in likers) { let liker = likers[i]; let a = document.createElement('a'); From 12e7ba84dd02578b42c44aed72694640762bdab8 Mon Sep 17 00:00:00 2001 From: wintiger0222 <0xodbs02@naver.com> Date: Wed, 13 Sep 2023 10:24:36 +0900 Subject: [PATCH 5/7] Fix --- scripts/helpers.js | 2 +- scripts/tweetviewer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/helpers.js b/scripts/helpers.js index 6ff3dcbd..2e99a4a1 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -2138,7 +2138,7 @@ async function appendTweet(t, timelineContainer, options = {}) { tweet.querySelector('.tweet-top').append(icon, span); } if(options.mainTweet) { - let likers = (vars.showQuoteCount) ? mainTweetLikers.slice(0, 6) : mainTweetLikers.slice(0, 8); + let likers = (vars.showQuoteCount && typeof t.quote_count !== 'undefined' && t.quote_count > 0 ) ? mainTweetLikers.slice(0, 6) : mainTweetLikers.slice(0, 8); for(let i in likers) { let liker = likers[i]; let a = document.createElement('a'); diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index 6f6ac6b6..5fe9c346 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -1247,7 +1247,7 @@ class TweetViewer { tweet.querySelector('.tweet-top').append(icon, span); } if(options.mainTweet) { - let likers = (vars.showQuoteCount) ? this.mainTweetLikers.slice(0, 6) : this.mainTweetLikers.slice(0, 8); + let likers = (vars.showQuoteCount && typeof t.quote_count !== 'undefined' && t.quote_count > 0 ) ? this.mainTweetLikers.slice(0, 6) : this.mainTweetLikers.slice(0, 8); for(let i in likers) { let liker = likers[i]; let a = document.createElement('a'); From 8ffb2d65f8ef7efe3bf02ce1925316df704058e2 Mon Sep 17 00:00:00 2001 From: wintiger0222 <0xodbs02@naver.com> Date: Wed, 13 Sep 2023 10:37:00 +0900 Subject: [PATCH 6/7] Fix modal --- scripts/helpers.js | 19 +++++++++++++++++++ scripts/tweetviewer.js | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/scripts/helpers.js b/scripts/helpers.js index 2e99a4a1..b30b10eb 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -2187,6 +2187,25 @@ async function appendTweet(t, timelineContainer, options = {}) { renderTrends(); currentLocation = location.pathname; }); + if(vars.showQuoteCount && typeof t.quote_count !== 'undefined' && t.quote_count > 0){ + let quotesLink = tweet.getElementsByClassName('tweet-footer-stat-q')[0]; + quotesLink.addEventListener('click', e => { + e.preventDefault(); + document.getElementById('loading-box').hidden = false; + history.pushState({}, null, `https://twitter.com/${t.user.screen_name}/status/${t.id_str}/retweets/with_comments`); + updateSubpage(); + mediaToUpload = []; + linkColors = {}; + cursor = undefined; + seenReplies = []; + mainTweetLikers = []; + let id = location.pathname.match(/status\/(\d{1,32})/)[1]; + updateRetweetsWithComments(id); + renderDiscovery(); + renderTrends(); + currentLocation = location.pathname; + }); + } let repliesLink = tweet.getElementsByClassName('tweet-footer-stat-o')[0]; repliesLink.addEventListener('click', e => { e.preventDefault(); diff --git a/scripts/tweetviewer.js b/scripts/tweetviewer.js index 5fe9c346..05d53938 100644 --- a/scripts/tweetviewer.js +++ b/scripts/tweetviewer.js @@ -1292,6 +1292,23 @@ class TweetViewer { this.updateRetweets(id); this.currentLocation = location.pathname; }); + if(vars.showQuoteCount && typeof t.quote_count !== 'undefined' && t.quote_count > 0){ + let quotesLink = tweet.getElementsByClassName('tweet-footer-stat-q')[0]; + quotesLink.addEventListener('click', e => { + e.preventDefault(); + history.pushState({}, null, `https://twitter.com/${t.user.screen_name}/status/${t.id_str}/retweets/with_comments`); + this.updateSubpage(); + this.mediaToUpload = []; + this.excludeUserMentions = []; + this.linkColors = {}; + this.cursor = undefined; + this.seenReplies = []; + this.mainTweetLikers = []; + let id = location.pathname.match(/status\/(\d{1,32})/)[1]; + this.updateRetweetsWithComments(id); + this.currentLocation = location.pathname; + }); + } let repliesLink = tweet.getElementsByClassName('tweet-footer-stat-o')[0]; repliesLink.addEventListener('click', e => { e.preventDefault(); From 5fc9fea7d2b531e854eb750e29092ee2ee38feb1 Mon Sep 17 00:00:00 2001 From: wintiger0222 <0xodbs02@naver.com> Date: Wed, 13 Sep 2023 11:40:54 +0900 Subject: [PATCH 7/7] Add My account Anniversary icon --- layouts/header/style.css | 4 ++++ layouts/lists/style.css | 4 ++++ layouts/search/style.css | 4 ++++ scripts/helpers.js | 3 ++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/layouts/header/style.css b/layouts/header/style.css index 4075fda2..977c79e5 100644 --- a/layouts/header/style.css +++ b/layouts/header/style.css @@ -2344,6 +2344,10 @@ rt.furigana { color: #00aced; content: "\f012" } +.ni-milestone:before { + color: #00aced; + content: "\f007" +} .wtf-user-name { max-width: 180px; } diff --git a/layouts/lists/style.css b/layouts/lists/style.css index d4d2f8ef..0e947b9d 100644 --- a/layouts/lists/style.css +++ b/layouts/lists/style.css @@ -652,6 +652,10 @@ a:hover, color: #5c913b; content: "\f006" } +.ni-milestone:before { + color: #00aced; + content: "\f007" +} .center-text { background-color: var(--background-color); diff --git a/layouts/search/style.css b/layouts/search/style.css index f8d52245..0fec4a04 100644 --- a/layouts/search/style.css +++ b/layouts/search/style.css @@ -644,6 +644,10 @@ a:hover, color: #5c913b; content: "\f006" } +.ni-milestone:before { + color: #00aced; + content: "\f007" +} .center-text { background-color: var(--background-color); diff --git a/scripts/helpers.js b/scripts/helpers.js index b30b10eb..1fc36f0b 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -3590,7 +3590,8 @@ const iconClasses = { 'bird_icon': 'ni-twitter', 'security_alert_icon': 'ni-alert', 'bell_icon': 'ni-bell', - 'list_icon': 'ni-list' + 'list_icon': 'ni-list', + 'milestone_icon': 'ni-milestone' }; let aRegex = /]*>([\s\S]*?)<\/a>/g; let replacerLocs;