diff --git a/README.md b/README.md index f0aea2b..2b354ff 100644 --- a/README.md +++ b/README.md @@ -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 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 allows for quick quick access to the Youtube video slug. # Download https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/ -# Version: 1.2.2 -Added more thumbnail options and changed control positions plus added on hovwr titles. \ No newline at end of file +# Version: 1.2.5 +Added quick access to the Youtube video slug. \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 4c4fca2..22f9f6d 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Better Youtube +", - "version": "1.2.2", + "version": "1.2.5", "description": "Enhancements for Youtube to have a better experience.", "applications": { diff --git a/src/scripts/betterYoutube.js b/src/scripts/betterYoutube.js index 4cc5343..5132887 100644 --- a/src/scripts/betterYoutube.js +++ b/src/scripts/betterYoutube.js @@ -1,5 +1,5 @@ // Declare variables -var ytThumbImgMenu, ytEnhancerMenu; // Menu systems +var slugInputTag, ytThumbImgMenu, ytEnhancerMenu; // Menu systems var ytThumbnailBttn, ytMaxDefaultImg, ytHqDefaultImg, // Buttons & Images ytLoopBttn, ytFloatBttn, ytAMaxDefaultImg, ytAHqDefaultImg; @@ -10,6 +10,26 @@ var part, videoSlug, temp; // Image part var count = 0; 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"); ytThumbImgMenu = 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 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/"; // Append to nodes as required @@ -94,9 +113,6 @@ function preSetupProc() { // Functions function showThumbImageVew(e) { - vdoPlyrAtts = video.baseURI; // Used for setting up thumbnails - vdoPlyrAtts = vdoPlyrAtts.slice(32, 32+11); - videoSlug = vdoPlyrAtts; if (ytThumbImgMenu.style.display == "block") { ytThumbImgMenu.style.display = "none"; @@ -210,16 +226,19 @@ function checkPg() { if (document.getElementById("masthead-container")) { clearInterval(existCondition); preSetupProc(); + setupProc(); count = 0; } else { if (count == 12) { // ~ 6 sec through half sec loops - clearInterval(existCondition); count = 0; + clearInterval(existCondition); } else { count++; } } }, 500); // check every 500ms + } else { + preSetupProc(); } } diff --git a/src/styles/betterYoutube.css b/src/styles/betterYoutube.css index 192af24..4acec14 100644 --- a/src/styles/betterYoutube.css +++ b/src/styles/betterYoutube.css @@ -1,4 +1,4 @@ -.ytThumbMenuStyle, .ytMenuStyle { +#slugCopyZone, .ytThumbMenuStyle, .ytMenuStyle { z-index: 100; position: fixed; background: rgba(0,0,0,0.64); @@ -6,6 +6,13 @@ overflow: auto; } +#slugCopyZone { + bottom: 0%; + left: 35%; + width: 10em; + text-align: center; +} + .ytThumbMenuStyle { display: none; bottom: 20px;