Feature/new window right click (#2027)

* right click menu for open in a new window

* open video in new window when right click

* router link added to channel images for easier selection in the context of a context menu

* fix security bug user can visit other website via freetube

* simplify context menu entry condition

* createWindow in open new window adapted with the merged function

* Change the open new window selector for the origin of the page no matter the name of the website

* Keypress reintegrate into the code for accesibility

* Keypress reintegrate into the code for accesibility

* Fix style for sidenav subscription links

Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
This commit is contained in:
Bryan-Elliott Tam 2022-09-22 09:03:18 -04:00 committed by GitHub
parent e90b9f4706
commit 420a91a072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 52 additions and 23 deletions

View File

@ -27,6 +27,13 @@ function runApp() {
click: () => {
browserWindow.webContents.send('showVideoStatistics')
}
},
{
label: 'Open in a New Window',
visible: parameters.linkURL.includes((new URL(browserWindow.webContents.getURL())).origin),
click: () => {
createWindow({ replaceMainWindow: false, windowStartupUrl: parameters.linkURL, showWindowNow: true })
}
}
]
})

View File

@ -89,6 +89,11 @@
transform: translateY(-50%);
}
.channelLink {
color: inherit;
text-decoration: inherit;
}
.channelThumbnail {
border-radius: 50%;
width: 35px;

View File

@ -77,7 +77,6 @@ export default Vue.extend({
navigate: function (route) {
this.$router.push('/' + route)
},
goToChannel: function (id) {
this.$router.push({ path: `/channel/${id}` })
}

View File

@ -224,23 +224,28 @@
:title="channel.name"
role="button"
tabindex="0"
@click="goToChannel(channel.id)"
@keypress="goToChannel(channel.id)"
@click="goToChannel(channel.id)"
>
<div
class="thumbnailContainer"
<router-link
:to="`/channel/${channel.id}`"
class="channelLink"
>
<img
class="channelThumbnail"
:src="channel.thumbnail"
<div
class="thumbnailContainer"
>
</div>
<p
v-if="isOpen"
class="navLabel"
>
{{ channel.name }}
</p>
<img
class="channelThumbnail"
:src="channel.thumbnail"
>
</div>
<p
v-if="isOpen"
class="navLabel"
>
{{ channel.name }}
</p>
</router-link>
</div>
</div>
</div>

View File

@ -86,3 +86,7 @@
:deep(.iconDropdown)
left: calc(50% - 20px)
right: auto
.channelLink
color: inherit
text-decoration: inherit

View File

@ -13,19 +13,28 @@
class="profileRow"
>
<div>
<img
:src="channelThumbnail"
class="channelThumbnail"
@click="goToChannel"
<router-link
:to="`/channel/${channelId}`"
>
<img
:src="channelThumbnail"
class="channelThumbnail"
@click="goToChannel"
>
</router-link>
</div>
<div>
<div
class="channelName"
@click="goToChannel"
<router-link
:to="`/channel/${channelId}`"
class="channelLink"
>
{{ channelName }}
</div>
<div
class="channelName"
@click="goToChannel"
>
{{ channelName }}
</div>
</router-link>
<ft-button
v-if="!hideUnsubscribeButton"
:label="subscribedText"