Skip to content

Commit

Permalink
feat: add option to enable legacy clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
kurozenzen committed Feb 18, 2024
1 parent dc01efe commit 75c19a9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/lib/components/kurosearch/post/SingleColumnPost.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts">
import Sources from './Sources.svelte';
import Comments from './Comments.svelte';
import Image from '../media-image/Image.svelte';
import Video from '../media-video/Video.svelte';
import Gif from '../media-gif/Gif.svelte';
Expand All @@ -14,6 +12,7 @@
import PostDetailsTagList from '../tag-list/PostDetailsTagList.svelte';
import FullscreenButton from './FullscreenButton.svelte';
import { isValidUrl } from '$lib/logic/url-utils';
import openTagsOnPostClick from '$lib/store/tags-shortcut-store';
const dispatch = createEventDispatcher();
Expand Down Expand Up @@ -48,6 +47,11 @@
dispatch('fullscreen');
}
}}
on:click={() => {
if ($openTagsOnPostClick) {
selectTab('tags');
}
}}
>
<div>
{#if post.type === 'image'}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/store/store-keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export enum StoreKey {
WideLayoutEnabled = 'kurosearch:wide-layout-enabled',
FullscreenHintDone = 'kurosearch:fullscreen-hint-done',
AutoplayFullscreenEnabled = 'kurosearch:autoplay-fullscreen-enabled-done',
AutoplayFullscreenDelay = 'kurosearch:autoplay-fullscreen-delay'
AutoplayFullscreenDelay = 'kurosearch:autoplay-fullscreen-delay',
TagsShortcut = 'kurosearch:tags-shortcut'
}
4 changes: 4 additions & 0 deletions src/lib/store/tags-shortcut-store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createBoolStore } from './generic/bool-store';
import { StoreKey } from './store-keys';

export default createBoolStore(StoreKey.TagsShortcut, false);
12 changes: 12 additions & 0 deletions src/routes/preferences/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import wideLayoutEnabled from '$lib/store/wide-layout-enabled-store';
import { addHistory } from '$lib/logic/use/onpopstate';
import NumberInput from '$lib/components/kurosearch/dialog-sort-filter/NumberInput.svelte';
import openTagsOnPostClick from '$lib/store/tags-shortcut-store';
let resetDialog: HTMLDialogElement;
Expand Down Expand Up @@ -139,6 +140,17 @@
</Checkbox>
</Preference>

<Preference
title="Open tags on click"
description="When enabled, clicking a post will immediately display the tags."
>
<div class="flex">
<Checkbox id="checkbox-tags-shortcut" bind:checked={$openTagsOnPostClick}>
{$openTagsOnPostClick ? 'Enabled' : 'Disabled'}
</Checkbox>
</div>
</Preference>

<Preference
title="Reset preferences"
description="Undo all customizations and return to default settings."
Expand Down

0 comments on commit 75c19a9

Please sign in to comment.