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:
		
							parent
							
								
									e90b9f4706
								
							
						
					
					
						commit
						420a91a072
					
				| 
						 | 
					@ -27,6 +27,13 @@ function runApp() {
 | 
				
			||||||
        click: () => {
 | 
					        click: () => {
 | 
				
			||||||
          browserWindow.webContents.send('showVideoStatistics')
 | 
					          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 })
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -89,6 +89,11 @@
 | 
				
			||||||
  transform: translateY(-50%);
 | 
					  transform: translateY(-50%);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.channelLink {
 | 
				
			||||||
 | 
					  color: inherit;
 | 
				
			||||||
 | 
					  text-decoration: inherit;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.channelThumbnail {
 | 
					.channelThumbnail {
 | 
				
			||||||
  border-radius: 50%;
 | 
					  border-radius: 50%;
 | 
				
			||||||
  width: 35px;
 | 
					  width: 35px;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,6 @@ export default Vue.extend({
 | 
				
			||||||
    navigate: function (route) {
 | 
					    navigate: function (route) {
 | 
				
			||||||
      this.$router.push('/' + route)
 | 
					      this.$router.push('/' + route)
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					 | 
				
			||||||
    goToChannel: function (id) {
 | 
					    goToChannel: function (id) {
 | 
				
			||||||
      this.$router.push({ path: `/channel/${id}` })
 | 
					      this.$router.push({ path: `/channel/${id}` })
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -224,8 +224,12 @@
 | 
				
			||||||
          :title="channel.name"
 | 
					          :title="channel.name"
 | 
				
			||||||
          role="button"
 | 
					          role="button"
 | 
				
			||||||
          tabindex="0"
 | 
					          tabindex="0"
 | 
				
			||||||
          @click="goToChannel(channel.id)"
 | 
					 | 
				
			||||||
          @keypress="goToChannel(channel.id)"
 | 
					          @keypress="goToChannel(channel.id)"
 | 
				
			||||||
 | 
					          @click="goToChannel(channel.id)"
 | 
				
			||||||
 | 
					        >
 | 
				
			||||||
 | 
					          <router-link
 | 
				
			||||||
 | 
					            :to="`/channel/${channel.id}`"
 | 
				
			||||||
 | 
					            class="channelLink"
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
            <div
 | 
					            <div
 | 
				
			||||||
              class="thumbnailContainer"
 | 
					              class="thumbnailContainer"
 | 
				
			||||||
| 
						 | 
					@ -241,6 +245,7 @@
 | 
				
			||||||
            >
 | 
					            >
 | 
				
			||||||
              {{ channel.name }}
 | 
					              {{ channel.name }}
 | 
				
			||||||
            </p>
 | 
					            </p>
 | 
				
			||||||
 | 
					          </router-link>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,3 +86,7 @@
 | 
				
			||||||
    :deep(.iconDropdown)
 | 
					    :deep(.iconDropdown)
 | 
				
			||||||
      left: calc(50% - 20px)
 | 
					      left: calc(50% - 20px)
 | 
				
			||||||
      right: auto
 | 
					      right: auto
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.channelLink
 | 
				
			||||||
 | 
					  color: inherit
 | 
				
			||||||
 | 
					  text-decoration: inherit
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,19 +13,28 @@
 | 
				
			||||||
          class="profileRow"
 | 
					          class="profileRow"
 | 
				
			||||||
        >
 | 
					        >
 | 
				
			||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
 | 
					            <router-link
 | 
				
			||||||
 | 
					              :to="`/channel/${channelId}`"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
              <img
 | 
					              <img
 | 
				
			||||||
                :src="channelThumbnail"
 | 
					                :src="channelThumbnail"
 | 
				
			||||||
                class="channelThumbnail"
 | 
					                class="channelThumbnail"
 | 
				
			||||||
                @click="goToChannel"
 | 
					                @click="goToChannel"
 | 
				
			||||||
              >
 | 
					              >
 | 
				
			||||||
 | 
					            </router-link>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div>
 | 
					          <div>
 | 
				
			||||||
 | 
					            <router-link
 | 
				
			||||||
 | 
					              :to="`/channel/${channelId}`"
 | 
				
			||||||
 | 
					              class="channelLink"
 | 
				
			||||||
 | 
					            >
 | 
				
			||||||
              <div
 | 
					              <div
 | 
				
			||||||
                class="channelName"
 | 
					                class="channelName"
 | 
				
			||||||
                @click="goToChannel"
 | 
					                @click="goToChannel"
 | 
				
			||||||
              >
 | 
					              >
 | 
				
			||||||
                {{ channelName }}
 | 
					                {{ channelName }}
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
 | 
					            </router-link>
 | 
				
			||||||
            <ft-button
 | 
					            <ft-button
 | 
				
			||||||
              v-if="!hideUnsubscribeButton"
 | 
					              v-if="!hideUnsubscribeButton"
 | 
				
			||||||
              :label="subscribedText"
 | 
					              :label="subscribedText"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue