-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Option to hide videos from certain channels (#2849)
* add logic to hide channels * Add new ft-input-tags ui element and use this for channel hiding * remove unused tooltip code * Add tooltip to the ft-input-tags and the new setting * Add spacer between toggle options and ft-flex-box * Swap to stringify from semicolon + add focus to label * Simplify the input_tags code + rename setting to channelsHidden * Fix issue shown by linter * Recentralize input button + fix tooltip for small windows * Improve accessiblity * fix hiding playlist when channel ID entered * pass tag directly to removeTag function Co-authored-by: petaded <code@zikl.co.uk> Co-authored-by: petaded <petaded@zikl.co.uk>
- Loading branch information
1 parent
dbb5473
commit f33f142
Showing
12 changed files
with
235 additions
and
17 deletions.
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.