Skip to content

Commit

Permalink
add hide unfollowers page setting
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Sep 24, 2023
1 parent e5aeb2a commit bc87f7a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
3 changes: 2 additions & 1 deletion _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,5 +579,6 @@
"share_tweet_in_dms": { "message": "Share tweet in DMs" },
"share_tweet_to": { "message": "Share tweet to..." },
"disable_find_hotkey": { "message": "Disable find hotkey (F)" },
"uploaded": { "message": "Uploaded" }
"uploaded": { "message": "Uploaded" },
"hide_unfollowers_page": { "message": "Hide unfollowers page" }
}
3 changes: 2 additions & 1 deletion _locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -570,5 +570,6 @@
"share_tweet_in_dms": { "message": "Поделиться твитом в сообщениях" },
"share_tweet_to": { "message": "Поделиться твитом..." },
"disable_find_hotkey": { "message": "Выключить горячую клавишу для поиска (F)" },
"uploaded": { "message": "Загружено" }
"uploaded": { "message": "Загружено" },
"hide_unfollowers_page": { "message": "Скрыть страницу отписчиков" }
}
3 changes: 2 additions & 1 deletion _locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -570,5 +570,6 @@
"share_tweet_in_dms": { "message": "Поширити твіт повідомленням" },
"share_tweet_to": { "message": "Поширити твіт..." },
"disable_find_hotkey": { "message": "Виключити гарячу клавішу для пошуку (F)" },
"uploaded": { "message": "Завантажено" }
"uploaded": { "message": "Завантажено" },
"hide_unfollowers_page": { "message": "Сховати сторінку відписників" }
}
5 changes: 5 additions & 0 deletions layouts/header/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ function hideStuff() {
.tweet-interact-more-menu { margin-left: 250px }
`;
}
if(vars.hideUnfollowersPage) {
hideStyle.innerHTML += `
#navbar-user-menu-unfollowers { display: none !important; }
`;
}
if(hideStyle.innerHTML !== '') {
document.head.appendChild(hideStyle);
}
Expand Down
3 changes: 3 additions & 0 deletions layouts/settings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ <h2>__MSG_navbar__</h2><br>
<div class="setting">
<input type="checkbox" id="pin-lists-on-navbar"> <label for="pin-lists-on-navbar">__MSG_pin_lists_on_navbar__</label>
</div>
<div class="setting">
<input type="checkbox" id="hide-unfollowers-page"> <label for="hide-unfollowers-page">__MSG_hide_unfollowers_page__</label>
</div>

<h2>__MSG_sidebar__</h2><br>
<div class="setting" id="hide-trends-div">
Expand Down
10 changes: 10 additions & 0 deletions layouts/settings/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ setTimeout(async () => {
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 hideUnfollowersPage = document.getElementById('hide-unfollowers-page');

let root = document.querySelector(":root");
{
Expand Down Expand Up @@ -541,6 +542,14 @@ setTimeout(async () => {
useOldStyleReply: useOldStyleReply.checked
}, () => { });
});
hideUnfollowersPage.addEventListener('change', () => {
vars.hideUnfollowersPage = hideUnfollowersPage.checked;
chrome.storage.sync.set({
hideUnfollowersPage: hideUnfollowersPage.checked
}, () => {
hideStuff();
});
});
enableAd.addEventListener('change', () => {
vars.enableAd = enableAd.checked;
chrome.storage.sync.set({
Expand Down Expand Up @@ -959,6 +968,7 @@ setTimeout(async () => {
disableAcceptType.checked = !!vars.disableAcceptType;
showUserFollowerCountsInLists.checked = !!vars.showUserFollowerCountsInLists;
showQuoteCount.checked = !!vars.showQuoteCount;
hideUnfollowersPage.checked = !!vars.hideUnfollowersPage;
if(vars.customCSS) {
customCSS.value = vars.customCSS;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function loadVars() {
'acknowledgedCustomizationButton', 'modernUI', 'showExactValues', 'hideTimelineTypes', 'autotranslateLanguages',
'autotranslationMode', 'muteVideos', 'dontPauseVideos', 'showUserPreviewsOnMobile', 'systemDarkMode', 'localizeDigit',
'disableRetweetHotkey', 'disableLikeHotkey', 'disableFindHotkey', 'extensionCompatibilityMode', 'disableDataSaver', 'disableAcceptType',
'showUserFollowerCountsInLists', 'showQuoteCount'
'showUserFollowerCountsInLists', 'showQuoteCount', 'hideUnfollowersPage'
], data => {
// default variables
if(typeof(data.linkColorsInTL) !== 'boolean') {
Expand Down

0 comments on commit bc87f7a

Please sign in to comment.