Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Parental Controls #1456

Merged
merged 42 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
47a95d0
start to implement some parental controls
ChunkyProgrammer Jun 25, 2021
0ede1bd
Hide share + Hide Unsubscribe
ChunkyProgrammer Jun 25, 2021
9baa719
Hide live streams
ChunkyProgrammer Jun 25, 2021
c5be079
fix hide live streams
ChunkyProgrammer Jun 25, 2021
712e359
Add "parental-control-settings"
ChunkyProgrammer Jun 26, 2021
fab41a7
Implement Hide Live Streams & Hide "Age Restricted"
ChunkyProgrammer Jun 27, 2021
698da8a
Hide live streams from Subscriptions + fix hide live streams from search
ChunkyProgrammer Jun 27, 2021
f556dbe
enable safe search on showFamilyFriendlyOnly
ChunkyProgrammer Jul 2, 2021
147cb6d
Merge branch 'development' into content-filters
ChunkyProgrammer Jul 3, 2021
16d9a85
Move some settings from parental control to distraction free
ChunkyProgrammer Jul 5, 2021
0aec87c
Merge branch 'development' of git://github.com/FreeTubeApp/FreeTube i…
ChunkyProgrammer Jul 23, 2021
56f2896
Merge branch 'FreeTubeApp-development' into content-filters
ChunkyProgrammer Jul 23, 2021
5b5f176
Merge branch 'development' into content-filters
PrestonN Aug 16, 2021
1d34f15
Merge branch 'development' into content-filters
PrestonN Aug 16, 2021
345bd6b
Merge branch 'development' into content-filters
PrestonN Aug 16, 2021
bb119bb
Merge branch 'development' into content-filters
PrestonN Aug 16, 2021
b63d679
fix channel loading
ChunkyProgrammer Aug 19, 2021
b94df35
Merge branch 'development' into content-filters
ChunkyProgrammer Sep 5, 2021
a94b836
Merge branch 'FreeTubeApp:development' into content-filters
ChunkyProgrammer Sep 15, 2021
ce2d890
make parental control settings collapsible
ChunkyProgrammer Sep 15, 2021
67c3ee4
Merge branch 'development' into content-filters
ChunkyProgrammer Sep 19, 2021
f71d79e
Merge branch 'development' into content-filters
ChunkyProgrammer Oct 3, 2021
a7aada8
fix lint
ChunkyProgrammer Oct 3, 2021
79701b4
dont show age restricted on videos that are loading
ChunkyProgrammer Oct 11, 2021
c1475ec
improve hide live videos
ChunkyProgrammer Oct 12, 2021
4fea7a3
code refactor
ChunkyProgrammer Oct 12, 2021
e19675e
grammar
peepo5 Oct 12, 2021
b7a566e
nvm im dumb
peepo5 Oct 12, 2021
ad7cae8
use named placeholder for age restricted message
ChunkyProgrammer Nov 6, 2021
eb16b40
Merge branch 'FreeTubeApp:development' into content-filters
ChunkyProgrammer Nov 6, 2021
2dd22e5
Merge branch 'development' into content-filters
ChunkyProgrammer Jan 7, 2022
2264d73
Merge branch 'development' into content-filters
ChunkyProgrammer Jan 31, 2022
98357a2
improve readability
ChunkyProgrammer Jan 31, 2022
cefe6b0
Merge branch 'development' into content-filters
ChunkyProgrammer May 13, 2022
a096465
Merge branch 'development' into content-filters
ChunkyProgrammer May 29, 2022
fc03855
Merge branch 'development' into content-filters
ChunkyProgrammer Jun 3, 2022
70a7c76
Merge branch 'development' into content-filters
ChunkyProgrammer Jun 3, 2022
f1c2b4e
Merge branch 'development' into content-filters
ChunkyProgrammer Jun 6, 2022
3457a5e
change Hide Description to Hide Video Description
ChunkyProgrammer Jun 6, 2022
1176f93
Merge branch 'development' into content-filters
ChunkyProgrammer Jun 15, 2022
519fdf6
update translated strings
ChunkyProgrammer Jun 15, 2022
342995f
fix age restricted component
ChunkyProgrammer Jun 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ export default Vue.extend({
},
hideActiveSubscriptions: function () {
return this.$store.getters.getHideActiveSubscriptions
},
hideVideoDescription: function () {
return this.$store.getters.getHideVideoDescription
},
hideComments: function () {
return this.$store.getters.getHideComments
ChunkyProgrammer marked this conversation as resolved.
Show resolved Hide resolved
},
hideLiveStreams: function() {
return this.$store.getters.getHideLiveStreams
},
hideSharingActions: function() {
return this.$store.getters.getHideSharingActions
}
},
methods: {
Expand All @@ -68,7 +80,11 @@ export default Vue.extend({
'updateHideLiveChat',
'updateHideActiveSubscriptions',
'updatePlayNextVideo',
'updateDefaultTheatreMode'
'updateDefaultTheatreMode',
'updateHideVideoDescription',
'updateHideComments',
'updateHideLiveStreams',
'updateHideSharingActions'
])
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
:default-value="hideActiveSubscriptions"
@change="updateHideActiveSubscriptions"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Video Description')"
:compact="true"
:default-value="hideVideoDescription"
@change="updateHideVideoDescription"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Sharing Actions')"
:compact="true"
:default-value="hideSharingActions"
@change="updateHideSharingActions"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
Expand Down Expand Up @@ -70,6 +82,18 @@
:default-value="hideLiveChat"
@change="updateHideLiveChat"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Live Streams')"
:compact="true"
:default-value="hideLiveStreams"
@change="updateHideLiveStreams"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Hide Comments')"
:compact="true"
:default-value="hideComments"
@change="updateHideComments"
/>
</div>
</div>
<br>
Expand Down
22 changes: 22 additions & 0 deletions src/renderer/components/ft-age-restricted/ft-age-restricted.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Vue from 'vue'

export default Vue.extend({
name: 'FtAgeRestricted',
props: {
contentTypeString: {
type: String,
required: true
}
},
computed: {
emoji: function () {
const emojis = ['😵', '😦', '🙁', '☹️', '😦', '🤫', '😕']
return emojis[Math.floor(Math.random() * emojis.length)]
},

restrictedMessage: function () {
const contentType = this.$t('Age Restricted.Type.' + this.contentTypeString)
return this.$t('Age Restricted.This $contentType is age restricted').replace('$contentType', contentType)
}
}
})
14 changes: 14 additions & 0 deletions src/renderer/components/ft-age-restricted/ft-age-restricted.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.ft-age-restricted
color: var(--primary-text-color)
h2
width: 100%
text-align: center
background-color: var(--card-bg-color)
padding: 10px 0
.frown
width: 100%
text-align: center
background-color: var(--card-bg-color)
font-size: 10em
padding: 20px 0
height: 100%
15 changes: 15 additions & 0 deletions src/renderer/components/ft-age-restricted/ft-age-restricted.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<div
class="ft-age-restricted"
>
<h2>
{{ restrictedMessage }}
</h2>
<div class="frown">
{{ emoji }}
</div>
</div>
</template>

<script src="./ft-age-restricted.js" />
<style scoped lang="sass" src="./ft-age-restricted.sass" />
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export default Vue.extend({
visible: this.firstScreen
}
},
computed: {
hideLiveStreams: function() {
return this.$store.getters.getHideLiveStreams
}
},
methods: {
onVisibilityChanged: function (visible) {
this.visible = visible
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div
v-if="data.type !== undefined && (data.type === 'video' ? ((!data.liveNow && (data.lengthSeconds != null)) || (!hideLiveStreams)) : true)"
v-observe-visibility="firstScreen ? false : {
callback: onVisibilityChanged,
once: true,
Expand Down
118 changes: 65 additions & 53 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,69 +117,76 @@ export default Vue.extend({
return (this.watchProgress / this.data.lengthSeconds) * 100
},

hideSharingActions: function() {
return this.$store.getters.getHideSharingActions
},

dropdownOptions: function () {
const options = []

options.push(
{
label: this.watched
? this.$t('Video.Remove From History')
: this.$t('Video.Mark As Watched'),
value: 'history'
},
{
type: 'divider'
},
{
label: this.$t('Video.Copy YouTube Link'),
value: 'copyYoutube'
},
{
label: this.$t('Video.Copy YouTube Embedded Player Link'),
value: 'copyYoutubeEmbed'
},
{
label: this.$t('Video.Copy Invidious Link'),
value: 'copyInvidious'
},
{
type: 'divider'
},
{
label: this.$t('Video.Open in YouTube'),
value: 'openYoutube'
},
{
label: this.$t('Video.Open YouTube Embedded Player'),
value: 'openYoutubeEmbed'
},
{
label: this.$t('Video.Open in Invidious'),
value: 'openInvidious'
},
{
type: 'divider'
},
{
label: this.$t('Video.Copy YouTube Channel Link'),
value: 'copyYoutubeChannel'
},
{
label: this.$t('Video.Copy Invidious Channel Link'),
value: 'copyInvidiousChannel'
},
{
type: 'divider'
},
{
label: this.$t('Video.Open Channel in YouTube'),
value: 'openYoutubeChannel'
},
{
label: this.$t('Video.Open Channel in Invidious'),
value: 'openInvidiousChannel'
}
)
if (!this.hideSharingActions) {
options.push(
{
type: 'divider'
},
{
label: this.$t('Video.Copy YouTube Link'),
value: 'copyYoutube'
},
{
label: this.$t('Video.Copy YouTube Embedded Player Link'),
value: 'copyYoutubeEmbed'
},
{
label: this.$t('Video.Copy Invidious Link'),
value: 'copyInvidious'
},
{
type: 'divider'
},
{
label: this.$t('Video.Open in YouTube'),
value: 'openYoutube'
},
{
label: this.$t('Video.Open YouTube Embedded Player'),
value: 'openYoutubeEmbed'
},
{
label: this.$t('Video.Open in Invidious'),
value: 'openInvidious'
},
{
type: 'divider'
},
{
label: this.$t('Video.Copy YouTube Channel Link'),
value: 'copyYoutubeChannel'
},
{
label: this.$t('Video.Copy Invidious Channel Link'),
value: 'copyInvidiousChannel'
},
{
type: 'divider'
},
{
label: this.$t('Video.Open Channel in YouTube'),
value: 'openYoutubeChannel'
},
{
label: this.$t('Video.Open Channel in Invidious'),
value: 'openInvidiousChannel'
}
)
}

return options
},
Expand All @@ -203,6 +210,11 @@ export default Vue.extend({
return `${baseUrl}/vi/${this.id}/mqdefault.jpg`
}
},

hideLiveStreams: function() {
return this.$store.getters.getHideLiveStreams
},

hideVideoViews: function () {
return this.$store.getters.getHideVideoViews
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Vue from 'vue'
import { mapActions } from 'vuex'
import FtCard from '../ft-card/ft-card.vue'
import FtToggleSwitch from '../ft-toggle-switch/ft-toggle-switch.vue'
import FtButton from '../ft-button/ft-button.vue'
import FtSelect from '../ft-select/ft-select.vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'

export default Vue.extend({
name: 'ParentalControlSettings',
components: {
'ft-card': FtCard,
'ft-toggle-switch': FtToggleSwitch,
'ft-button': FtButton,
'ft-select': FtSelect,
'ft-flex-box': FtFlexBox
},
computed: {
hideSearchBar: function () {
return this.$store.getters.getHideSearchBar
},
hideUnsubscribeButton: function() {
return this.$store.getters.getHideUnsubscribeButton
},
showFamilyFriendlyOnly: function() {
return this.$store.getters.getShowFamilyFriendlyOnly
}
},
methods: {
...mapActions([
'updateHideSearchBar',
'updateHideUnsubscribeButton',
'updateShowFamilyFriendlyOnly'
])
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@use "../../sass-partials/settings"
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<details>
<summary>
<h3>
{{ $t("Settings.Parental Control Settings.Parental Control Settings") }}
</h3>
</summary>
<hr>
<div class="switchColumnGrid">
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Parental Control Settings.Hide Unsubscribe Button')"
:compact="true"
:default-value="hideUnsubscribeButton"
@change="updateHideUnsubscribeButton"
/>
<ft-toggle-switch
:label="$t('Settings.Parental Control Settings.Show Family Friendly Only')"
:compact="true"
:default-value="showFamilyFriendlyOnly"
@change="updateShowFamilyFriendlyOnly"
/>
</div>
<div class="switchColumn">
<ft-toggle-switch
:label="$t('Settings.Parental Control Settings.Hide Search Bar')"
:compact="true"
:default-value="hideSearchBar"
@change="updateHideSearchBar"
/>
</div>
</div>
</details>
</template>

<script src="./parental-control-settings.js" />
<style scoped lang="sass" src="./parental-control-settings.sass" />
4 changes: 4 additions & 0 deletions src/renderer/components/playlist-info/playlist-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export default Vue.extend({
}
},
computed: {
hideSharingActions: function() {
return this.$store.getters.getHideSharingActions
},

currentInvidiousInstance: function () {
return this.$store.getters.getCurrentInvidiousInstance
},
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/playlist-info/playlist-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<br>

<ft-list-dropdown
v-if="!hideSharingActions"
:title="$t('Playlist.Share Playlist.Share Playlist')"
:label-names="shareHeaders"
:label-values="shareValues"
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/components/top-nav/top-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export default Vue.extend({
return this.$store.getters.getUsingElectron
},

hideSearchBar: function () {
return this.$store.getters.getHideSearchBar
},

enableSearchSuggestions: function () {
return this.$store.getters.getEnableSearchSuggestions
},
Expand Down
Loading