diff --git a/_locales/en/messages.json b/_locales/en/messages.json index b2ff851d..91587440 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -548,5 +548,7 @@ "disable_accept_type": { "message": "Disable accept-type when uploading media. This fixes the problem of not being able to access all images on some Android versions.", "description": "This option only appears on mobile" }, "manage_searches": { "message": "Manage searches" }, "add_search": { "message": "Add search" }, - "pinned_searches": { "message": "Pinned searches" } + "pinned_searches": { "message": "Pinned searches" }, + "show_follower_counts_in_lists": { "message": "Show users follower counts on follower/following pages." }, + "not_possible_to_see_unfollowers": { "message": "Unfortunately, it's not possible to see unfollowers for accounts with more than 50,000 followers." } } \ No newline at end of file diff --git a/_locales/ru/messages.json b/_locales/ru/messages.json index 6704920c..e9a9cf71 100644 --- a/_locales/ru/messages.json +++ b/_locales/ru/messages.json @@ -539,5 +539,7 @@ "disable_accept_type": { "message": "Выключить 'accept-type' при открытии галереи для загрузки медиа. Включите если на вашем Андроиде нельзя выбрать/найти некоторые картинки в галерее.", "description": "This option only appears on mobile" }, "manage_searches": { "message": "Изменить поиски" }, "add_search": { "message": "Добавить поиск" }, - "pinned_searches": { "message": "Закреплённые поиски" } + "pinned_searches": { "message": "Закреплённые поиски" }, + "show_follower_counts_in_lists": { "message": "Показывать кол-во подписчиков пользователей в списке подписок." }, + "not_possible_to_see_unfollowers": { "message": "К сожалению, информация про отписчиков не доступна для аккаунтов с более чем 50,000 подписчиков." } } \ No newline at end of file diff --git a/_locales/uk/messages.json b/_locales/uk/messages.json index 891b3d63..d78aca59 100644 --- a/_locales/uk/messages.json +++ b/_locales/uk/messages.json @@ -539,5 +539,7 @@ "disable_accept_type": { "message": "Виключити 'accept-type' при відкритті галереї для загрузки медіа. Включить якщо на вашому Андроїді не можна вибрати/знайти деякі картинки в галереї.", "description": "This option only appears on mobile" }, "manage_searches": { "message": "Пошуки" }, "add_search": { "message": "Добавити пошук" }, - "pinned_searches": { "message": "Закріплені пошуки" } + "pinned_searches": { "message": "Закріплені пошуки" }, + "show_follower_counts_in_lists": { "message": "Показувати кількість підписників користувачів в списку підписок." }, + "not_possible_to_see_unfollowers": { "message": "На жаль, інформація про відписників не доступна для аккаунтів з більше ніж 50,000 підписників." } } \ No newline at end of file diff --git a/layouts/header/script.js b/layouts/header/script.js index 48312655..7940a9bb 100644 --- a/layouts/header/script.js +++ b/layouts/header/script.js @@ -717,7 +717,7 @@ let userDataFunction = async user => { } // unfollows - if(user.followers_count > 0 && user.followers_count < 50000) { + if(user.followers_count > 0 && user.followers_count < 50000 && user.friends_count < 50000) { chrome.storage.local.get(['unfollows'], async d => { let res = d.unfollows; if(!res) res = {}; diff --git a/layouts/settings/index.html b/layouts/settings/index.html index d6d257a0..aa53c600 100644 --- a/layouts/settings/index.html +++ b/layouts/settings/index.html @@ -311,6 +311,9 @@

__MSG_profile__


+
+ +
diff --git a/layouts/settings/script.js b/layouts/settings/script.js index 868735fc..d334ba14 100644 --- a/layouts/settings/script.js +++ b/layouts/settings/script.js @@ -200,6 +200,7 @@ setTimeout(async () => { let extensionCompatibilityMode = document.getElementById('extension-compatibility-mode'); let disableDataSaver = document.getElementById('disable-data-saver'); let disableAcceptType = document.getElementById('disable-accept-type'); + let showUserFollowerCountsInLists = document.getElementById('show-user-follower-counts-in-lists'); let root = document.querySelector(":root"); { @@ -330,6 +331,11 @@ setTimeout(async () => { vars.autotranslationMode = autotranslationMode.value; }); }); + showUserFollowerCountsInLists.addEventListener('change', () => { + chrome.storage.sync.set({ + showUserFollowerCountsInLists: showUserFollowerCountsInLists.checked + }, () => { }); + }); enableIframeNavigation.addEventListener('change', () => { chrome.storage.sync.set({ enableIframeNavigation: enableIframeNavigation.checked diff --git a/layouts/unfollows/script.js b/layouts/unfollows/script.js index dff4a141..33876237 100644 --- a/layouts/unfollows/script.js +++ b/layouts/unfollows/script.js @@ -45,6 +45,10 @@ function renderUserData() { document.getElementById('user-avatar-link').href = `https://twitter.com/${user.screen_name}`; document.getElementById('user-info').href = `https://twitter.com/${user.screen_name}`; + if(user.followers_count > 50000 || user.friends_count > 50000) { + document.getElementById('timeline').innerHTML = `${LOC.not_possible_to_see_unfollowers.message}`; + } + if(vars.enableTwemoji) twemoji.parse(document.getElementById('user-name')); document.getElementById('loading-box').hidden = true; @@ -58,6 +62,9 @@ function renderUserData() { function renderUnfollows(page = 0) { chrome.storage.local.get(['unfollows'], async d => { loading = true; + if(user.followers_count && (user.followers_count > 50000 || user.friends_count > 50000)) { + return; + } let res = d.unfollows; if(!res) res = {}; diff --git a/manifest.json b/manifest.json index 965f82bd..772ef93f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Old Twitter Layout (2023)", "description": "__MSG_ext_description__", - "version": "1.7.8.5", + "version": "1.7.8.6", "manifest_version": 3, "homepage_url": "https://github.com/dimdenGD/OldTwitter", "background": { diff --git a/scripts/config.js b/scripts/config.js index 1e3cdb8c..e82c3a32 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -30,7 +30,8 @@ async function loadVars() { 'enableAd', 'acknowledgedCssAccess', 'disableProfileCustomizations', 'openNotifsAsModal', 'enableIframeNavigation', 'acknowledgedCustomizationButton', 'modernUI', 'showExactValues', 'hideTimelineTypes', 'autotranslateLanguages', 'autotranslationMode', 'muteVideos', 'dontPauseVideos', 'showUserPreviewsOnMobile', 'systemDarkMode', 'localizeDigit', - 'disableRetweetHotkey', 'disableLikeHotkey', 'extensionCompatibilityMode', 'disableDataSaver', 'disableAcceptType' + 'disableRetweetHotkey', 'disableLikeHotkey', 'extensionCompatibilityMode', 'disableDataSaver', 'disableAcceptType', + 'showUserFollowerCountsInLists' ], data => { // default variables if(typeof(data.linkColorsInTL) !== 'boolean') { diff --git a/scripts/helpers.js b/scripts/helpers.js index f683db46..b8bbd4fc 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -1376,6 +1376,7 @@ function renderMedia(t) { return html; } +let insertedLabelStyle = false; async function appendUser(u, container, label) { let userElement = document.createElement('div'); userElement.classList.add('user-item'); @@ -1389,6 +1390,15 @@ async function appendUser(u, container, label) { delete u.verified_type; u.verified = false; } + if(!label && vars.showUserFollowerCountsInLists) { + label = `${formatLargeNumber(u.followers_count)} ${vars.modernUI ? LOC.followers.message : LOC.followers.message.toLowerCase()}`; + if(!insertedLabelStyle) { + insertedLabelStyle = true; + let style = document.createElement('style'); + style.innerHTML = `.user-item-text { bottom: -3px !important; }`; + document.head.appendChild(style); + } + } userElement.innerHTML = `