Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude hidden posts from page search #1544

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/features/mutual_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ const styleElement = buildStyle(`
margin-right: 0.5ch;
}

${followingTimelineSelector} [${hiddenAttribute}] article {
display: none;
${followingTimelineSelector} [${hiddenAttribute}] {
content: linear-gradient(transparent, transparent);
height: 0;
}

${keyToCss('blogCardBlogLink')} {
Expand Down
5 changes: 3 additions & 2 deletions src/features/no_recommended/hide_recommended_posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const timeline = followingTimelineFilter;
const includeFiltered = true;

export const styleElement = buildStyle(`
[${hiddenAttribute}]:not([${unHiddenAttribute}]) article {
display: none;
[${hiddenAttribute}]:not([${unHiddenAttribute}]) {
content: linear-gradient(transparent, transparent);
height: 0;
}

:not([${unHiddenAttribute}]) + [${unHiddenAttribute}]::before {
Expand Down
5 changes: 3 additions & 2 deletions src/features/postblock.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[data-postblock-hidden] article {
display: none;
[data-postblock-hidden] {
content: linear-gradient(transparent, transparent);
height: 0;
}
5 changes: 3 additions & 2 deletions src/features/seen_posts.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ body.xkit-seen-posts-only-dim-avatar [data-seen-posts-seen]:not(:hover) article
opacity: 0.5;
}

body.xkit-seen-posts-hide [data-seen-posts-seen] article {
display: none;
body.xkit-seen-posts-hide [data-seen-posts-seen] {
content: linear-gradient(transparent, transparent);
height: 0;
}

body.xkit-seen-posts-hide .xkit-seen-posts-lengthened {
Expand Down
5 changes: 3 additions & 2 deletions src/features/show_originals.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[data-show-originals="on"] ~ div > [data-show-originals-hidden] article {
display: none;
[data-show-originals="on"] ~ div > [data-show-originals-hidden] {
content: linear-gradient(transparent, transparent);
height: 0;
}

.xkit-show-originals-lengthened {
Expand Down
7 changes: 5 additions & 2 deletions src/features/tweaks/hide_filtered_posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { keyToCss } from '../../utils/css_map.js';
import { buildStyle, getTimelineItemWrapper } from '../../utils/interface.js';

const hiddenAttribute = 'data-tweaks-hide-filtered-posts-hidden';

export const styleElement = buildStyle(`[${hiddenAttribute}] article { display: none; }`);
export const styleElement = buildStyle(`
[${hiddenAttribute}] {
content: linear-gradient(transparent, transparent);
height: 0;
}`);

const hideFilteredPosts = filteredScreens => filteredScreens
.map(getTimelineItemWrapper)
Expand Down
7 changes: 5 additions & 2 deletions src/features/tweaks/hide_liked_posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import { followingTimelineFilter } from '../../utils/timeline_id.js';
const timeline = followingTimelineFilter;

const hiddenAttribute = 'data-tweaks-hide-liked-posts-hidden';

export const styleElement = buildStyle(`[${hiddenAttribute}] article { display: none; }`);
export const styleElement = buildStyle(`
[${hiddenAttribute}] {
content: linear-gradient(transparent, transparent);
height: 0;
}`);

const processPosts = async function (postElements) {
filterPostElements(postElements, { timeline }).forEach(async postElement => {
Expand Down
7 changes: 5 additions & 2 deletions src/features/tweaks/hide_my_posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ const excludeClass = 'xkit-tweaks-hide-my-posts-done';
const timeline = followingTimelineFilter;

const hiddenAttribute = 'data-tweaks-hide-my-posts-hidden';

export const styleElement = buildStyle(`[${hiddenAttribute}] article { display: none; }`);
export const styleElement = buildStyle(`
[${hiddenAttribute}] {
content: linear-gradient(transparent, transparent);
height: 0;
}`);

const processPosts = async function (postElements) {
filterPostElements(postElements, { excludeClass, timeline }).forEach(async postElement => {
Expand Down