Update dependencies and fix linting problems

This commit is contained in:
Preston 2020-10-04 14:30:54 -04:00
parent 35d022d737
commit 8077d9d999
14 changed files with 823 additions and 342 deletions

1071
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,8 +8,8 @@
"url": "https://github.com/FreeTubeApp/FreeTube/issues" "url": "https://github.com/FreeTubeApp/FreeTube/issues"
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.30", "@fortawesome/fontawesome-svg-core": "^1.2.31",
"@fortawesome/free-solid-svg-icons": "^5.14.0", "@fortawesome/free-solid-svg-icons": "^5.15.0",
"@fortawesome/vue-fontawesome": "^2.0.0", "@fortawesome/vue-fontawesome": "^2.0.0",
"@silvermine/videojs-quality-selector": "^1.2.4", "@silvermine/videojs-quality-selector": "^1.2.4",
"autolinker": "^3.14.1", "autolinker": "^3.14.1",
@ -36,7 +36,7 @@
"vue-electron": "^1.0.6", "vue-electron": "^1.0.6",
"vue-i18n": "^8.21.1", "vue-i18n": "^8.21.1",
"vue-observe-visibility": "^0.4.6", "vue-observe-visibility": "^0.4.6",
"vue-router": "^3.4.4", "vue-router": "^3.4.5",
"vuex": "^3.5.1", "vuex": "^3.5.1",
"xml2json": "^0.12.0", "xml2json": "^0.12.0",
"youtube-chat": "^1.1.0", "youtube-chat": "^1.1.0",
@ -48,7 +48,7 @@
"yt-xml2vtt": "^1.1.2", "yt-xml2vtt": "^1.1.2",
"ytdl-core": "^3.3.0", "ytdl-core": "^3.3.0",
"ytpl": "^1.0.1", "ytpl": "^1.0.1",
"ytsr": "^1.0.1" "ytsr": "^1.0.3"
}, },
"description": "A private YouTube client", "description": "A private YouTube client",
"devDependencies": { "devDependencies": {
@ -57,40 +57,40 @@
"@babel/plugin-proposal-object-rest-spread": "^7.11.0", "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
"@babel/preset-env": "^7.11.5", "@babel/preset-env": "^7.11.5",
"@babel/preset-typescript": "^7.10.4", "@babel/preset-typescript": "^7.10.4",
"@typescript-eslint/eslint-plugin": "^4.2.0", "@typescript-eslint/eslint-plugin": "^4.3.0",
"@typescript-eslint/parser": "^4.2.0", "@typescript-eslint/parser": "^4.3.0",
"acorn": "^8.0.1", "acorn": "^8.0.3",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0", "babel-loader": "^8.1.0",
"copy-webpack-plugin": "^6.1.1", "copy-webpack-plugin": "^6.2.0",
"css-loader": "^4.3.0", "css-loader": "^4.3.0",
"devtron": "^1.4.0", "devtron": "^1.4.0",
"electron": "^9.3.1", "electron": "^9.3.1",
"electron-builder": "^22.8.1", "electron-builder": "^22.8.1",
"electron-builder-squirrel-windows": "^22.9.1", "electron-builder-squirrel-windows": "^22.9.1",
"electron-debug": "^3.1.0", "electron-debug": "^3.1.0",
"electron-rebuild": "^2.0.3", "electron-rebuild": "^2.2.0",
"eslint": "^7.9.0", "eslint": "^7.10.0",
"eslint-config-prettier": "^6.12.0", "eslint-config-prettier": "^6.12.0",
"eslint-config-standard": "^14.1.1", "eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.0", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1", "eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^7.0.0",
"fast-glob": "^3.2.4", "fast-glob": "^3.2.4",
"file-loader": "^6.1.0", "file-loader": "^6.1.0",
"html-webpack-plugin": "^4.5.0", "html-webpack-plugin": "^4.5.0",
"jest": "^26.4.2", "jest": "^26.4.2",
"mini-css-extract-plugin": "^0.11.2", "mini-css-extract-plugin": "^0.11.3",
"node-abi": "^2.19.1", "node-abi": "^2.19.1",
"node-loader": "^1.0.1", "node-loader": "^1.0.1",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",
"prettier": "^2.1.2", "prettier": "^2.1.2",
"sass": "^1.26.11", "sass": "^1.26.11",
"sass-loader": "^10.0.2", "sass-loader": "^10.0.2",
"style-loader": "^1.2.1", "style-loader": "^1.3.0",
"tree-kill": "1.2.2", "tree-kill": "1.2.2",
"typescript": "^4.0.3", "typescript": "^4.0.3",
"url-loader": "^4.1.0", "url-loader": "^4.1.0",

View File

@ -62,7 +62,7 @@ export default Vue.extend({
}, },
watch: { watch: {
profile: function () { profile: function () {
this.subscriptions = [].concat(this.profile.subscriptions.sort((a, b) => { this.subscriptions = [].concat(this.profile.subscriptions).sort((a, b) => {
const nameA = a.name.toLowerCase() const nameA = a.name.toLowerCase()
const nameB = b.name.toLowerCase() const nameB = b.name.toLowerCase()
if (nameA < nameB) { if (nameA < nameB) {
@ -75,12 +75,12 @@ export default Vue.extend({
}).map((channel) => { }).map((channel) => {
channel.selected = false channel.selected = false
return channel return channel
})) })
} }
}, },
mounted: function () { mounted: function () {
if (typeof this.profile.subscriptions !== 'undefined') { if (typeof this.profile.subscriptions !== 'undefined') {
this.subscriptions = [].concat(this.profile.subscriptions.sort((a, b) => { this.subscriptions = [].concat(this.profile.subscriptions).sort((a, b) => {
const nameA = a.name.toLowerCase() const nameA = a.name.toLowerCase()
const nameB = b.name.toLowerCase() const nameB = b.name.toLowerCase()
if (nameA < nameB) { if (nameA < nameB) {
@ -93,7 +93,7 @@ export default Vue.extend({
}).map((channel) => { }).map((channel) => {
channel.selected = false channel.selected = false
return channel return channel
})) })
} }
}, },
methods: { methods: {

View File

@ -3,7 +3,7 @@ import Vue from 'vue'
export default Vue.extend({ export default Vue.extend({
name: 'FtTimestampCatcher', name: 'FtTimestampCatcher',
props: { props: {
inputHTML: { inputHtml: {
type: String, type: String,
default: '' default: ''
} }
@ -13,14 +13,14 @@ export default Vue.extend({
const match = event.detail.match(/(\d+):(\d+):?(\d+)?/) const match = event.detail.match(/(\d+):(\d+):?(\d+)?/)
if (match[3] !== undefined) { // HH:MM:SS if (match[3] !== undefined) { // HH:MM:SS
const seconds = 3600 * Number(match[1]) + 60 * Number(match[2]) + Number(match[3]) const seconds = 3600 * Number(match[1]) + 60 * Number(match[2]) + Number(match[3])
this.$emit('timestampEvent', seconds) this.$emit('timestamp-event', seconds)
} else { // MM:SS } else { // MM:SS
const seconds = 60 * Number(match[1]) + Number(match[2]) const seconds = 60 * Number(match[1]) + Number(match[2])
this.$emit('timestampEvent', seconds) this.$emit('timestamp-event', seconds)
} }
}, },
detectTimestamps: function (input) { detectTimestamps: function (input) {
return input.replace(/(\d+(:\d+)+)/g, '<a href="#" onclick="this.dispatchEvent(new CustomEvent(\'timestampClicked\',{bubbles:true, detail:\'$1\'}))">$1</a>') return input.replace(/(\d+(:\d+)+)/g, '<a href="#" onclick="this.dispatchEvent(new CustomEvent(\'timestamp-clicked\',{bubbles:true, detail:\'$1\'}))">$1</a>')
} }
} }
}) })

View File

@ -1,7 +1,7 @@
<template> <template>
<p <p
@timestampClicked="catchTimestampClick" @timestamp-clicked="catchTimestampClick"
v-html="detectTimestamps(inputHTML)" v-html="detectTimestamps(inputHtml)"
/> />
</template> </template>

View File

@ -9,10 +9,10 @@ export default Vue.extend({
} }
}, },
mounted: function () { mounted: function () {
FtToastEvents.$on('toast.open', this.open) FtToastEvents.$on('toast-open', this.open)
}, },
beforeDestroy: function () { beforeDestroy: function () {
FtToastEvents.$off('toast.open', this.open) FtToastEvents.$off('toast-open', this.open)
}, },
methods: { methods: {
performAction: function (index) { performAction: function (index) {

View File

@ -13,6 +13,15 @@ export default Vue.extend({
components: { components: {
'ft-card': FtCard 'ft-card': FtCard
}, },
beforeRouteLeave: function () {
if (this.player !== null && !this.player.isInPictureInPicture()) {
this.player.dispose()
this.player = null
clearTimeout(this.mouseTimeout)
} else if (this.player.isInPictureInPicture()) {
this.player.play()
}
},
props: { props: {
format: { format: {
type: String, type: String,
@ -599,14 +608,5 @@ export default Vue.extend({
} }
} }
} }
},
beforeRouteLeave: function () {
if (this.player !== null && !this.player.isInPictureInPicture()) {
this.player.dispose()
this.player = null
clearTimeout(this.mouseTimeout)
} else if (this.player.isInPictureInPicture()) {
this.player.play()
}
} }
}) })

View File

@ -42,7 +42,7 @@ export default Vue.extend({
}, },
methods: { methods: {
onTimestamp: function(timestamp) { onTimestamp: function(timestamp) {
this.$emit('timestampEvent', timestamp) this.$emit('timestamp-event', timestamp)
}, },
getCommentData: function () { getCommentData: function () {

View File

@ -48,8 +48,8 @@
</p> </p>
<ft-timestamp-catcher <ft-timestamp-catcher
class="commentText" class="commentText"
:inputHTML="comment.text" :input-html="comment.text"
@timestampEvent="onTimestamp" @timestamp-event="onTimestamp"
/> />
<p class="commentLikeCount"> <p class="commentLikeCount">
<font-awesome-icon <font-awesome-icon

View File

@ -37,7 +37,7 @@ export default Vue.extend({
}, },
methods: { methods: {
onTimestamp: function(timestamp) { onTimestamp: function(timestamp) {
this.$emit('timestampEvent', timestamp) this.$emit('timestamp-event', timestamp)
}, },
parseDescriptionHtml: function (descriptionText) { parseDescriptionHtml: function (descriptionText) {
descriptionText = descriptionText.replace(/target="_blank"/g, '') descriptionText = descriptionText.replace(/target="_blank"/g, '')

View File

@ -2,8 +2,8 @@
<ft-card class="videoDescription"> <ft-card class="videoDescription">
<ft-timestamp-catcher <ft-timestamp-catcher
class="description" class="description"
:inputHTML="shownDescription" :input-html="shownDescription"
@timestampEvent="onTimestamp" @timestamp-event="onTimestamp"
/> />
</ft-card> </ft-card>
</template> </template>

View File

@ -64,7 +64,7 @@
class="theatreModeButton option" class="theatreModeButton option"
icon="expand-alt" icon="expand-alt"
theme="secondary" theme="secondary"
@click="$emit('theatreMode')" @click="$emit('theatre-mode')"
/> />
<ft-icon-button <ft-icon-button
v-if="!isUpcoming" v-if="!isUpcoming"

View File

@ -16,6 +16,10 @@ export default Vue.extend({
'ft-button': FtButton, 'ft-button': FtButton,
'ft-list-video': FtListVideo 'ft-list-video': FtListVideo
}, },
beforeRouteLeave: function () {
this.liveChat.stop()
this.hasEnded = true
},
props: { props: {
videoId: { videoId: {
type: String, type: String,
@ -248,9 +252,5 @@ export default Vue.extend({
event.stopPropagation() event.stopPropagation()
event.preventDefault() event.preventDefault()
} }
},
beforeRouteLeave: function () {
this.liveChat.stop()
this.hasEnded = true
} }
}) })

View File

@ -19,7 +19,7 @@ Vue.config.productionTip = isDev
library.add(fas) library.add(fas)
Vue.component('font-awesome-icon', FontAwesomeIcon) Vue.component('FontAwesomeIcon', FontAwesomeIcon)
Vue.use(VueI18n) Vue.use(VueI18n)
// List of locales approved for use // List of locales approved for use