Skip to content

Commit

Permalink
feat: add a toggle to control nsfw results
Browse files Browse the repository at this point in the history
  • Loading branch information
enpitsuLin committed Mar 26, 2023
1 parent d9f3ba2 commit 6e9b68c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/SettingsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
</div>
<Toggle v-model="enable" />
</li>
<li class="py-2 flex items-center justify-between space-x-4">
<div class="flex flex-col w-4/5 overflow-hidden">
<p class="text-sm font-medium">{{ t('nsfw') }}</p>
<p class="text-sm text-$ud-text-secondary text-xs">
{{ t('nsfw-desc') }}
</p>
</div>
<Toggle v-model="settings.nsfw" />
</li>
</ul>
</div>
</template>
Expand All @@ -45,6 +54,7 @@
emit('update:show', false);
});
const settings = useUserjsDiggerSettings();
const enable = useSessionStorage('ud_show', true);
const { t } = useI18n();
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"language-desc": "Switch language",
"enable": "Enable on this page",
"enable-desc": "To enable this plugin on this page or not (Session)",
"nsfw": "NSFW",
"nsfw-desc": "Show Sleazyfork's result in list",
"time-ago": {
"just-now": "just now",
"past": "{n} ago",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"language-desc": "切换用户语言设置",
"enable": "本页启用",
"enable-desc": "控制本页面是否启用功能(会话)",
"nsfw": "成人内容",
"nsfw-desc": "列表中展示Sleazyfork的搜索结果",
"time-ago": {
"just-now": "就在刚刚",
"past": "{n}前",
Expand Down

0 comments on commit 6e9b68c

Please sign in to comment.