add setting to always mark as sensitive

This commit is contained in:
Nolan Lawson 2018-02-05 08:50:08 -08:00
parent 2fdd10c1fe
commit 95e5bdb106
3 changed files with 12 additions and 4 deletions

View file

@ -1,4 +1,4 @@
{{#if status.sensitive}}
{{#if status.sensitive || $markMediaAsSensitive}}
<div class="status-sensitive-media-container {{sensitiveShown ? 'status-sensitive-media-shown' : 'status-sensitive-media-hidden'}}"
>
{{#if sensitiveShown}}

View file

@ -11,7 +11,8 @@ const KEYS_TO_STORE_IN_LOCAL_STORAGE = new Set([
"instanceThemes",
"loggedInInstances",
"loggedInInstancesInOrder",
"autoplayGifs"
"autoplayGifs",
"markMediaAsSensitive"
])
class PinaforeStore extends LocalStorageStore {
@ -29,6 +30,7 @@ const store = new PinaforeStore({
spoilersShown: {},
sensitivesShown: {},
autoplayGifs: false,
markMediaAsSensitive: false
})
mixins(PinaforeStore)

View file

@ -13,6 +13,11 @@
bind:checked="$autoplayGifs" on:change="store.save()">
<label for="choice-autoplay-gif">Autoplay GIFs</label>
</div>
<div class="setting-group">
<input type="checkbox" id="choice-mark-media-sensitive"
bind:checked="$markMediaAsSensitive" on:change="store.save()">
<label for="choice-mark-media-sensitive">Always mark media as sensitive</label>
</div>
</form>
</SettingsLayout>
@ -20,14 +25,15 @@
<style>
.ui-settings {
display: flex;
align-items: center;
background: var(--form-bg);
border: 1px solid var(--main-border);
border-radius: 4px;
padding: 20px;
line-height: 2em;
}
.setting-group {
padding: 5px 0;
}
</style>
<script>
import Layout from '../_components/Layout.html';