Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default defineComponent({

externalLinkOpeningPromptNames: function () {
return [
this.$t('Yes'),
this.$t('Yes, Open Link'),
this.$t('No')
]
},
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/components/data-settings/data-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export default defineComponent({
'youtubenew',
'youtube',
'youtubeold',
'newpipe'
'newpipe',
'close'
],

shouldExportPlaylistForOlderVersions: false,
Expand Down Expand Up @@ -70,7 +71,8 @@ export default defineComponent({
`${exportYouTube} (.csv)`,
`${exportYouTube} (.json)`,
`${exportYouTube} (.opml)`,
`${exportNewPipe} (.json)`
`${exportNewPipe} (.json)`,
this.$t('Close')
]
},
primaryProfile: function () {
Expand Down
1 change: 0 additions & 1 deletion src/renderer/components/data-settings/data-settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
:label="$t('Settings.Data Settings.Select Export Type')"
:option-names="exportSubscriptionsPromptNames"
:option-values="subscriptionsPromptValues"
:show-close="true"
@click="exportSubscriptions"
/>
</ft-settings-section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default defineComponent({
handleReplaceHttpCache: function (value) {
this.showRestartPrompt = false

if (value === null || value === 'no') {
if (value === null || value === 'cancel') {
this.replaceHttpCache = !this.replaceHttpCache
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<ft-prompt
v-if="showRestartPrompt"
:label="$t('Settings[\'The app needs to restart for changes to take effect. Restart and apply change?\']')"
:option-names="[$t('Yes'), $t('No')]"
:option-values="['yes', 'no']"
:option-names="[$t('Yes, Restart'), $t('Cancel')]"
:option-values="['restart', 'cancel']"
@click="handleReplaceHttpCache"
/>
</ft-settings-section>
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/ft-button/ft-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
block-size: fit-content;
box-sizing: border-box;
cursor: pointer;
display: inline-block;
align-items: center;
justify-content: center;
text-align: center;
Expand All @@ -17,6 +16,8 @@
white-space: nowrap;
font-weight: 500;
vertical-align: middle;
display: flex;
gap: 10px;
margin: 5px;
box-shadow: 0 1px 2px rgb(0 0 0 / 50%);
}
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/components/ft-button/ft-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export default defineComponent({
id: {
type: String,
default: ''
},
icon: {
type: Array,
default: null
}
},
emits: ['click'],
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/components/ft-button/ft-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
@click="click"
>
<slot>
<font-awesome-icon
v-if="icon"
:icon="icon"
/>
{{ label }}
</slot>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
/>
<ft-button
:label="$t('User Playlists.Cancel')"
:text-color="null"
:background-color="null"
@click="hideCreatePlaylistPrompt"
/>
</ft-flex-box>
Expand Down
14 changes: 14 additions & 0 deletions src/renderer/components/ft-icon-button/ft-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@
}
}

&.destructive {
background-color: var(--destructive-color);
color: var(--destructive-text-color);

&:hover,
&:focus-visible {
background-color: var(--destructive-hover-color);
}

&:active {
background-color: var(--destructive-active-color);
}
}

&.favorite, &.favorite:hover, &.favorite:focus-visible {
color: var(--favorite-icon-color);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
/>
<ft-button
:label="$t('User Playlists.Cancel')"
:text-color="null"
:background-color="null"
@click="hide"
/>
</ft-flex-box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export default defineComponent({
subscriptions: [],
selectedLength: 0,
deletePromptValues: [
'yes',
'no'
'delete',
'cancel'
]
}
},
Expand All @@ -61,8 +61,8 @@ export default defineComponent({
},
deletePromptNames: function () {
return [
this.$t('Yes'),
this.$t('No')
this.$t('Yes, Delete'),
this.$t('Cancel')
]
},
locale: function () {
Expand Down Expand Up @@ -109,7 +109,7 @@ export default defineComponent({
},

handleDeletePromptClick: function (value) {
if (value !== 'no' && value !== null) {
if (value !== 'cancel' && value !== null) {
if (this.isMainProfile) {
const channelsToRemove = this.subscriptions.filter((channel) => channel.selected)
this.subscriptions = this.subscriptions.filter((channel) => !channel.selected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
/>
<ft-button
:label="$t('Profile.Delete Selected')"
text-color="var(--text-with-main-color)"
background-color="var(--primary-color)"
text-color="var(--destructive-text-color)"
background-color="var(--destructive-color)"
@click="displayDeletePrompt"
/>
</ft-flex-box>
Expand All @@ -41,6 +41,7 @@
:label="deletePromptMessage"
:option-names="deletePromptNames"
:option-values="deletePromptValues"
:is-first-option-destructive="true"
@click="handleDeletePromptClick"
/>
</div>
Expand Down
10 changes: 5 additions & 5 deletions src/renderer/components/ft-profile-edit/ft-profile-edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default defineComponent({
profileBgColor: '',
profileTextColor: '',
deletePromptValues: [
'yes',
'no'
'delete',
'cancel'
]
}
},
Expand All @@ -70,8 +70,8 @@ export default defineComponent({
},
deletePromptNames: function () {
return [
this.$t('Yes'),
this.$t('No')
this.$t('Yes, Delete'),
this.$t('Cancel')
]
},
editOrCreateProfileLabel: function () {
Expand Down Expand Up @@ -101,7 +101,7 @@ export default defineComponent({
},

handleDeletePrompt: function (response) {
if (response === 'yes') {
if (response === 'delete') {
this.deleteProfile()
} else {
this.showDeletePrompt = false
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/components/ft-profile-edit/ft-profile-edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@
<ft-button
v-if="!isMainProfile"
:label="$t('Profile.Delete Profile')"
text-color="var(--text-with-main-color)"
background-color="var(--primary-color)"
text-color="var(--destructive-text-color)"
background-color="var(--destructive-color)"
:icon="['fas', 'trash']"
@click="openDeletePrompt"
/>
</template>
Expand All @@ -99,6 +100,7 @@
:label="deletePromptLabel"
:option-names="deletePromptNames"
:option-values="deletePromptValues"
:is-first-option-destructive="true"
@click="handleDeletePrompt"
/>
</div>
Expand Down
24 changes: 21 additions & 3 deletions src/renderer/components/ft-prompt/ft-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export default defineComponent({
type: Array,
default: () => { return [] }
},
showClose: {
autosize: {
type: Boolean,
default: false
},
autosize: {
isFirstOptionDestructive: {
type: Boolean,
default: false
},
Expand All @@ -52,7 +52,7 @@ export default defineComponent({
computed: {
sanitizedLabel: function() {
return sanitizeForHtmlId(this.label)
}
},
},
mounted: function () {
this.lastActiveElement = document.activeElement
Expand All @@ -72,6 +72,24 @@ export default defineComponent({
nextTick(() => this.lastActiveElement?.focus())
},
methods: {
optionButtonTextColor: function(index) {
if (index === 0 && this.isFirstOptionDestructive) {
return 'var(--destructive-text-color)'
} else if (index < this.optionNames.length - 1) {
return 'var(--text-with-accent-color)'
} else {
return null
}
},
optionButtonBackgroundColor: function(index) {
if (index === 0 && this.isFirstOptionDestructive) {
return 'var(--destructive-color)'
} else if (index < this.optionNames.length - 1) {
return 'var(--accent-color)'
} else {
return null
}
},
click: function (value) {
this.$emit('click', value)
},
Expand Down
12 changes: 3 additions & 9 deletions src/renderer/components/ft-prompt/ft-prompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,11 @@
:id="'prompt-' + sanitizedLabel + '-' + index"
:key="index"
:label="option"
:text-color="optionButtonTextColor(index)"
:background-color="optionButtonBackgroundColor(index)"
:icon="index === 0 && isFirstOptionDestructive ? ['fas', 'trash'] : null"
@click="click(optionValues[index])"
/>
<ft-button
v-if="showClose"
:id="'prompt-' + sanitizedLabel + '-close'"
:label="$t('Close')"
:tabindex="0"
text-color="'var(--accent-color)'"
background-color="'var(--text-with-accent-color)'"
@click="hide"
/>
</ft-flex-box>
</slot>
</ft-card>
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/components/playlist-info/playlist-info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@
v-if="!editMode && isUserPlaylist && videoCount > 0"
:title="$t('User Playlists.Remove Watched Videos')"
:icon="['fas', 'eye-slash']"
theme="primary"
theme="destructive"
@click="showRemoveVideosOnWatchPrompt = true"
/>
<ft-icon-button
v-if="deletePlaylistButtonVisible"
:title="$t('User Playlists.Delete Playlist')"
:icon="['fas', 'trash']"
theme="primary"
theme="destructive"
@click="showDeletePlaylistPrompt = true"
/>
<ft-share-button
Expand All @@ -179,13 +179,15 @@
:label="$t('User Playlists.Are you sure you want to delete this playlist? This cannot be undone')"
:option-names="deletePlaylistPromptNames"
:option-values="deletePlaylistPromptValues"
:is-first-option-destructive="true"
@click="handleDeletePlaylistPromptAnswer"
/>
<ft-prompt
v-if="showRemoveVideosOnWatchPrompt"
:label="$t('User Playlists.Are you sure you want to remove all watched videos from this playlist? This cannot be undone')"
:option-names="deletePlaylistPromptNames"
:option-values="deletePlaylistPromptValues"
:is-first-option-destructive="true"
@click="handleRemoveVideosOnWatchPromptAnswer"
/>
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/renderer/components/privacy-settings/privacy-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export default defineComponent({
showRemoveSubscriptionsPrompt: false,
showRemovePlaylistsPrompt: false,
promptValues: [
'yes',
'no'
'delete',
'cancel'
]
}
},
Expand All @@ -48,16 +48,16 @@ export default defineComponent({
},
promptNames: function () {
return [
this.$t('Yes'),
this.$t('No')
this.$t('Yes, Delete'),
this.$t('Cancel')
]
}
},
methods: {
handleSearchCache: function (option) {
this.showSearchCachePrompt = false

if (option === 'yes') {
if (option === 'delete') {
this.clearSessionSearchHistory()
showToast(this.$t('Settings.Privacy Settings.Search cache has been cleared'))
}
Expand All @@ -74,7 +74,7 @@ export default defineComponent({
handleRemoveHistory: function (option) {
this.showRemoveHistoryPrompt = false

if (option === 'yes') {
if (option === 'delete') {
this.removeAllHistory()
showToast(this.$t('Settings.Privacy Settings.Watch history has been cleared'))
}
Expand All @@ -85,7 +85,7 @@ export default defineComponent({

this.updateActiveProfile(MAIN_PROFILE_ID)

if (option !== 'yes') { return }
if (option !== 'delete') { return }

this.profileList.forEach((profile) => {
if (profile._id === MAIN_PROFILE_ID) {
Expand Down
Loading