diff options
Diffstat (limited to 'src/components/settings')
| -rw-r--r-- | src/components/settings/settings.js | 25 | ||||
| -rw-r--r-- | src/components/settings/settings.vue | 21 |
2 files changed, 45 insertions, 1 deletions
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 76b42bab..06011e7c 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -13,6 +13,7 @@ const settings = { hideAttachmentsLocal: user.hideAttachments, hideAttachmentsInConvLocal: user.hideAttachmentsInConv, hideNsfwLocal: user.hideNsfw, + useOneClickNsfw: user.useOneClickNsfw, hideISPLocal: user.hideISP, preloadImage: user.preloadImage, @@ -56,7 +57,17 @@ const settings = { scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy), stopGifs: user.stopGifs, - webPushNotificationsLocal: user.webPushNotifications + webPushNotificationsLocal: user.webPushNotifications, + loopVideoSilentOnlyLocal: user.loopVideosSilentOnly, + loopSilentAvailable: + // Firefox + Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') || + // Chrome-likes + Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') || + // Future spec, still not supported in Nightly 63 as of 08/2018 + Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'), + playVideosInline: user.playVideosInline, + useContainFit: user.useContainFit } }, components: { @@ -88,6 +99,9 @@ const settings = { hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, + useOneClickNsfw (value) { + this.$store.dispatch('setOption', { name: 'useOneClickNsfw', value }) + }, preloadImage (value) { this.$store.dispatch('setOption', { name: 'preloadImage', value }) }, @@ -112,6 +126,9 @@ const settings = { loopVideoLocal (value) { this.$store.dispatch('setOption', { name: 'loopVideo', value }) }, + loopVideoSilentOnlyLocal (value) { + this.$store.dispatch('setOption', { name: 'loopVideoSilentOnly', value }) + }, autoLoadLocal (value) { this.$store.dispatch('setOption', { name: 'autoLoad', value }) }, @@ -146,6 +163,12 @@ const settings = { webPushNotificationsLocal (value) { this.$store.dispatch('setOption', { name: 'webPushNotifications', value }) if (value) this.$store.dispatch('registerPushNotifications') + }, + playVideosInline (value) { + this.$store.dispatch('setOption', { name: 'playVideosInline', value }) + }, + useContainFit (value) { + this.$store.dispatch('setOption', { name: 'useContainFit', value }) } } } diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index e84bd3f6..08d659d6 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -123,6 +123,10 @@ <input :disabled="!hideNsfwLocal" type="checkbox" id="preloadImage" v-model="preloadImage"> <label for="preloadImage">{{$t('settings.preload_images')}}</label> </li> + <li> + <input type="checkbox" id="useOneClickNsfw" v-model="useOneClickNsfw"> + <label for="useOneClickNsfw">{{$t('settings.use_one_click_nsfw')}}</label> + </li> </ul> <li> <input type="checkbox" id="stopGifs" v-model="stopGifs"> @@ -131,6 +135,23 @@ <li> <input type="checkbox" id="loopVideo" v-model="loopVideoLocal"> <label for="loopVideo">{{$t('settings.loop_video')}}</label> + <ul class="setting-list suboptions" :class="[{disabled: !streamingLocal}]"> + <li> + <input :disabled="!loopVideoLocal || !loopSilentAvailable" type="checkbox" id="loopVideoSilentOnly" v-model="loopVideoSilentOnlyLocal"> + <label for="loopVideoSilentOnly">{{$t('settings.loop_video_silent_only')}}</label> + <div v-if="!loopSilentAvailable" class="unavailable"> + <i class="icon-globe"/>! {{$t('settings.limited_availability')}} + </div> + </li> + </ul> + </li> + <li> + <input type="checkbox" id="playVideosInline" v-model="playVideosInline"> + <label for="playVideosInline">{{$t('settings.play_videos_inline')}}</label> + </li> + <li> + <input type="checkbox" id="useContainFit" v-model="useContainFit"> + <label for="useContainFit">{{$t('settings.use_contain_fit')}}</label> </li> </ul> </div> |
