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'}}" <div class="status-sensitive-media-container {{sensitiveShown ? 'status-sensitive-media-shown' : 'status-sensitive-media-hidden'}}"
> >
{{#if sensitiveShown}} {{#if sensitiveShown}}

View file

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

View file

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