Added quick access to the Youtube video slug.

This commit is contained in:
Maxim Stewart 2018-05-28 14:32:13 -05:00
parent 186b3cf5b1
commit 2d4710070b
4 changed files with 37 additions and 10 deletions

View File

@ -7,9 +7,10 @@ Better Youtube + works to improve the Youtube experience by providing quick acce
* It allows the video to be toggled to fixed or floating with drag functionality. * It allows the video to be toggled to fixed or floating with drag functionality.
* It allows volume control through the mouse-wheel when hovering over the player. * It allows volume control through the mouse-wheel when hovering over the player.
* It changes the background color to light grey for easier viewing of the pages. * It changes the background color to light grey for easier viewing of the pages.
* It allows for quick quick access to the Youtube video slug.
# Download # Download
https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/ https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/
# Version: 1.2.2 # Version: 1.2.5
Added more thumbnail options and changed control positions plus added on hovwr titles. Added quick access to the Youtube video slug.

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Better Youtube +", "name": "Better Youtube +",
"version": "1.2.2", "version": "1.2.5",
"description": "Enhancements for Youtube to have a better experience.", "description": "Enhancements for Youtube to have a better experience.",
"applications": { "applications": {

View File

@ -1,5 +1,5 @@
// Declare variables // Declare variables
var ytThumbImgMenu, ytEnhancerMenu; // Menu systems var slugInputTag, ytThumbImgMenu, ytEnhancerMenu; // Menu systems
var ytThumbnailBttn, ytMaxDefaultImg, ytHqDefaultImg, // Buttons & Images var ytThumbnailBttn, ytMaxDefaultImg, ytHqDefaultImg, // Buttons & Images
ytLoopBttn, ytFloatBttn, ytAMaxDefaultImg, ytAHqDefaultImg; ytLoopBttn, ytFloatBttn, ytAMaxDefaultImg, ytAHqDefaultImg;
@ -10,6 +10,26 @@ var part, videoSlug, temp; // Image part
var count = 0; var count = 0;
function preSetupProc() { function preSetupProc() {
console.log("Weee");
video = document.getElementsByTagName("video")[0]; // Video Controler
slugInputTag = document.createElement("INPUT");
slugInputTag.id = "slugCopyZone";
slugInputTag.type = "text";
if (!document.getElementById("slugCopyZone")) {
document.body.appendChild(slugInputTag);
} else {
slugInputTag = document.getElementById("slugCopyZone");
}
vdoPlyrAtts = video.baseURI; // Used for setting up thumbnails
vdoPlyrAtts = vdoPlyrAtts.slice(32, 32+11);
slugInputTag.value = vdoPlyrAtts;
}
function setupProc() {
poppedContainer = document.createElement("DIV"); poppedContainer = document.createElement("DIV");
ytThumbImgMenu = document.createElement("DIV"); ytThumbImgMenu = document.createElement("DIV");
ytEnhancerMenu = document.createElement("DIV"); ytEnhancerMenu = document.createElement("DIV");
@ -31,7 +51,6 @@ function preSetupProc() {
mainContentArea = document.getElementsByTagName("ytd-watch")[0]; // BT control insert area and bg color setup mainContentArea = document.getElementsByTagName("ytd-watch")[0]; // BT control insert area and bg color setup
containerOfPlyrWndow = document.getElementById("top").children[0]; // Container of actual player - Used for floating window containerOfPlyrWndow = document.getElementById("top").children[0]; // Container of actual player - Used for floating window
video = document.getElementsByTagName("video")[0]; // Video Controler
part = "https://img.youtube.com/vi/"; part = "https://img.youtube.com/vi/";
// Append to nodes as required // Append to nodes as required
@ -94,9 +113,6 @@ function preSetupProc() {
// Functions // Functions
function showThumbImageVew(e) { function showThumbImageVew(e) {
vdoPlyrAtts = video.baseURI; // Used for setting up thumbnails
vdoPlyrAtts = vdoPlyrAtts.slice(32, 32+11);
videoSlug = vdoPlyrAtts; videoSlug = vdoPlyrAtts;
if (ytThumbImgMenu.style.display == "block") { if (ytThumbImgMenu.style.display == "block") {
ytThumbImgMenu.style.display = "none"; ytThumbImgMenu.style.display = "none";
@ -210,16 +226,19 @@ function checkPg() {
if (document.getElementById("masthead-container")) { if (document.getElementById("masthead-container")) {
clearInterval(existCondition); clearInterval(existCondition);
preSetupProc(); preSetupProc();
setupProc();
count = 0; count = 0;
} else { } else {
if (count == 12) { // ~ 6 sec through half sec loops if (count == 12) { // ~ 6 sec through half sec loops
clearInterval(existCondition);
count = 0; count = 0;
clearInterval(existCondition);
} else { } else {
count++; count++;
} }
} }
}, 500); // check every 500ms }, 500); // check every 500ms
} else {
preSetupProc();
} }
} }

View File

@ -1,4 +1,4 @@
.ytThumbMenuStyle, .ytMenuStyle { #slugCopyZone, .ytThumbMenuStyle, .ytMenuStyle {
z-index: 100; z-index: 100;
position: fixed; position: fixed;
background: rgba(0,0,0,0.64); background: rgba(0,0,0,0.64);
@ -6,6 +6,13 @@
overflow: auto; overflow: auto;
} }
#slugCopyZone {
bottom: 0%;
left: 35%;
width: 10em;
text-align: center;
}
.ytThumbMenuStyle { .ytThumbMenuStyle {
display: none; display: none;
bottom: 20px; bottom: 20px;