pinafore/src/routes/_pages/settings/general.html

147 lines
4.9 KiB
HTML
Raw Normal View History

<SettingsLayout page='settings/general' label="General">
<h1>General Settings</h1>
<h2>Media</h2>
<form class="ui-settings">
<label class="setting-group">
<input type="checkbox" id="choice-never-mark-media-sensitive"
bind:checked="$neverMarkMediaAsSensitive" on:change="onChange(event)">
Show sensitive media by default
</label>
<label class="setting-group">
<input type="checkbox" id="choice-use-blurhash"
bind:checked="$ignoreBlurhash" on:change="onChange(event)">
Show a plain gray color for sensitive media
</label>
<label class="setting-group">
<input type="checkbox" id="choice-mark-media-sensitive"
bind:checked="$markMediaAsSensitive" on:change="onChange(event)">
Treat all media as sensitive
</label>
<label class="setting-group">
<input type="checkbox" id="choice-large-inline-media"
bind:checked="$largeInlineMedia" on:change="onChange(event)">
Show large inline images and videos
</label>
<label class="setting-group">
<input type="checkbox" id="choice-autoplay-gif"
bind:checked="$autoplayGifs" on:change="onChange(event)">
Autoplay GIFs
</label>
</form>
<h2>UI</h2>
<form class="ui-settings">
<label class="setting-group">
<input type="checkbox" id="choice-disable-custom-scrollbars"
bind:checked="$disableCustomScrollbars" on:change="onChange(event)">
Disable custom scrollbars
</label>
<label class="setting-group">
<input type="checkbox" id="choice-disable-infinite-scroll"
bind:checked="$disableInfiniteScroll" on:change="onChange(event)">
Disable
<Tooltip
text="infinite scroll"
tooltipText={
"When infinite scroll is disabled, new toots will not automatically appear at the bottom " +
"or top of the timeline. Instead, buttons will allow you to load more content on demand."
}
/>
</label>
<label class="setting-group">
<input type="checkbox" id="choice-hide-cards"
bind:checked="$hideCards" on:change="onChange(event)">
Hide link preview cards
</label>
<label class="setting-group">
<input type="checkbox" id="choice-underline-links"
bind:checked="$underlineLinks" on:change="onChange(event)">
Underline links in toots and profiles
</label>
</form>
<h2>Accessibility</h2>
<form class="ui-settings">
<label class="setting-group">
2018-03-22 20:23:00 -07:00
<input type="checkbox" id="choice-reduce-motion"
bind:checked="$reduceMotion" on:change="onChange(event)">
Reduce motion in UI animations
</label>
<label class="setting-group">
<input type="checkbox" id="choice-disable-tap-on-status"
bind:checked="$disableTapOnStatus" on:change="onChange(event)">
Disable tappable area on entire toot
</label>
<label class="setting-group">
<input type="checkbox" id="choice-omit-emoji-in-display-names"
bind:checked="$omitEmojiInDisplayNames" on:change="onChange(event)">
Remove emoji from user display names
</label>
<label class="setting-group">
<input type="checkbox" id="choice-disable-long-aria-labels"
bind:checked="$disableLongAriaLabels" on:change="onChange(event)">
Use short article ARIA labels
</label>
</form>
{#if $isUserLoggedIn }
<h2>{themeTitle}</h2>
<ThemeSettings instanceName={$currentInstance} />
{/if}
</SettingsLayout>
<style>
.ui-settings {
background: var(--form-bg);
border: 1px solid var(--main-border);
border-radius: 4px;
padding: 20px;
line-height: 2em;
}
.setting-group {
display: block;
padding: 5px 0;
}
@media (max-width: 240px) {
.ui-settings {
padding: 20px 10px;
}
}
</style>
<script>
import SettingsLayout from '../../_components/settings/SettingsLayout.html'
import ThemeSettings from '../../_components/settings/instance/ThemeSettings.html'
import { store } from '../../_store/store'
import Tooltip from '../../_components/Tooltip.html'
export default {
components: {
SettingsLayout,
ThemeSettings,
Tooltip
},
methods: {
onChange (event) {
// these two are mutually exclusive
2019-08-03 13:49:37 -07:00
const { markMediaAsSensitive, neverMarkMediaAsSensitive } = this.store.get()
if (markMediaAsSensitive && neverMarkMediaAsSensitive) {
if (event.target.id === 'choice-mark-media-sensitive') {
this.store.set({ neverMarkMediaAsSensitive: false })
} else {
this.store.set({ markMediaAsSensitive: false })
}
}
this.store.save()
}
},
store: () => store,
computed: {
themeTitle: ({ $loggedInInstancesInOrder, $currentInstance }) => (
$loggedInInstancesInOrder.length > 1 ? `Theme for ${$currentInstance}` : 'Theme'
)
}
2018-04-19 21:38:01 -07:00
}
</script>