-
Notifications
You must be signed in to change notification settings - Fork 886
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
Option to hide videos from certain channels #2849
Merged
FreeTubeBot
merged 13 commits into
FreeTubeApp:development
from
petaded:dev/petaded/add_option_to_hide_channels
Dec 17, 2022
+235
−17
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6ed0f19
add logic to hide channels
9ac3b07
Add new ft-input-tags ui element and use this for channel hiding
d8d537a
remove unused tooltip code
f128063
Add tooltip to the ft-input-tags and the new setting
7fe0681
Add spacer between toggle options and ft-flex-box
36fe014
Swap to stringify from semicolon + add focus to label
10300a9
Simplify the input_tags code + rename setting to channelsHidden
faad842
Fix issue shown by linter
65eeae8
Recentralize input button + fix tooltip for small windows
c29a224
Improve accessiblity
0cecc9e
fix hiding playlist when channel ID entered
09553c5
pass tag directly to removeTag function
b01798d
Merge branch 'development' into dev/petaded/add_option_to_hide_channels
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.ft-input-tags-component { | ||
position: relative; | ||
background-color: var(--bg-color); | ||
padding: 20px; | ||
border-radius: 5px; | ||
display: block; | ||
width: 60%; | ||
} | ||
|
||
.ft-tag-box ul { | ||
overflow: auto; | ||
display: block; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
.ft-tag-box li { | ||
list-style: none; | ||
background-color: var(--card-bg-color); | ||
margin: 5px; | ||
border-radius: 5px; | ||
display:flex; | ||
float: left; | ||
} | ||
|
||
.ft-tag-box li>label { | ||
padding-top: 10px; | ||
padding-bottom: 10px; | ||
padding-left: 10px; | ||
overflow-wrap: break-word; | ||
word-wrap: break-word; | ||
word-break: break-all; | ||
hyphens: auto; | ||
} | ||
|
||
|
||
.removeTagButton { | ||
color: var(--primary-text-color); | ||
opacity: 0.5; | ||
padding: 10px; | ||
} | ||
|
||
.removeTagButton:hover { | ||
cursor: pointer; | ||
} | ||
|
||
:deep(.ft-input-component .ft-input) { | ||
margin-top: 10px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import Vue from 'vue' | ||
import FtInput from '../ft-input/ft-input.vue' | ||
import FtTooltip from '../ft-tooltip/ft-tooltip.vue' | ||
|
||
export default Vue.extend({ | ||
name: 'FtInputTags', | ||
components: { | ||
'ft-input': FtInput, | ||
'ft-tooltip': FtTooltip | ||
}, | ||
props: { | ||
placeholder: { | ||
type: String, | ||
required: true | ||
}, | ||
label: { | ||
type: String, | ||
required: true | ||
}, | ||
showActionButton: { | ||
type: Boolean, | ||
default: true | ||
}, | ||
tagList: { | ||
type: Array, | ||
default: () => { return [] } | ||
}, | ||
tooltip: { | ||
type: String, | ||
default: '' | ||
} | ||
}, | ||
methods: { | ||
updateTags: function (text, e) { | ||
// text entered add tag and update tag list | ||
if (!this.tagList.includes(text.trim())) { | ||
const newList = this.tagList.slice(0) | ||
newList.push(text.trim()) | ||
this.$emit('change', newList) | ||
} | ||
// clear input box | ||
this.$refs.childinput.handleClearTextClick() | ||
}, | ||
removeTag: function (tag) { | ||
// Remove tag from list | ||
const tagName = tag.trim() | ||
if (this.tagList.includes(tagName)) { | ||
const newList = this.tagList.slice(0) | ||
const index = newList.indexOf(tagName) | ||
newList.splice(index, 1) | ||
this.$emit('change', newList) | ||
} | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<template> | ||
<div | ||
class="ft-input-tags-component" | ||
> | ||
<ft-input | ||
ref="childinput" | ||
:placeholder="placeholder" | ||
:label="label" | ||
:show-label="true" | ||
:tooltip="tooltip" | ||
:show-action-button="showActionButton" | ||
:select-on-focus="true" | ||
:force-action-button-icon-name="['fas', 'arrow-right']" | ||
@click="updateTags" | ||
/> | ||
|
||
<div class="ft-tag-box"> | ||
<ul> | ||
<li | ||
v-for="tag in tagList" | ||
:key="tag.id" | ||
> | ||
<label>{{ tag }}</label> | ||
<font-awesome-icon | ||
:icon="['fas', 'fa-times']" | ||
class="removeTagButton" | ||
tabindex="0" | ||
role="button" | ||
@click="removeTag(tag)" | ||
@keydown.enter.prevent="removeTag(tag)" | ||
/> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script src="./ft-input-tags.js" /> | ||
<style scoped src="./ft-input-tags.css" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the previous check hid the item when
data
is undefined, this implementation doesn'tThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the conflict resolutions in the rebase below will resolve this as well. See 4d618e3, L59.Looks fixed after petaded's merge commit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is fixed with the merge with latest development