fixed some stuff with thumbnail loading

This commit is contained in:
Maxim Stewart 2018-06-03 22:53:28 -05:00
parent 2d4710070b
commit 47349f2246
3 changed files with 220 additions and 218 deletions

View File

@ -12,5 +12,5 @@ Better Youtube + works to improve the Youtube experience by providing quick acce
# Download
https://addons.mozilla.org/en-US/firefox/addon/better-youtube-plus/
# Version: 1.2.5
# Version: 1.2.6
Added quick access to the Youtube video slug.

View File

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

View File

@ -1,3 +1,5 @@
function betterYoutubePlus() {
// Declare variables
var slugInputTag, ytThumbImgMenu, ytEnhancerMenu; // Menu systems
var ytThumbnailBttn, ytMaxDefaultImg, ytHqDefaultImg, // Buttons & Images
@ -10,7 +12,6 @@ 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";
@ -23,10 +24,7 @@ function preSetupProc() {
}
vdoPlyrAtts = video.baseURI; // Used for setting up thumbnails
vdoPlyrAtts = vdoPlyrAtts.slice(32, 32+11);
slugInputTag.value = vdoPlyrAtts;
slugInputTag.value = vdoPlyrAtts.slice(32, 32+11);
}
function setupProc() {
@ -50,7 +48,7 @@ function setupProc() {
.getElementsByClassName("style-scope ytd-masthead")[3]; // Search bar area
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("player-container"); // Container of actual player - Used for floating window
part = "https://img.youtube.com/vi/";
// Append to nodes as required
@ -113,7 +111,8 @@ function setupProc() {
// Functions
function showThumbImageVew(e) {
videoSlug = vdoPlyrAtts;
videoSlug = video.baseURI.slice(32, 32+11); // Used for setting up thumbnails
if (ytThumbImgMenu.style.display == "block") {
ytThumbImgMenu.style.display = "none";
ytThumbnailBttn.src = browser.extension.getURL("/icons/thumbnailOff.png");
@ -156,13 +155,13 @@ function setLoop(e) {
}
function toggleFloat() {
playerWindow = document.getElementById("player-container"); // Actual player
playerWindow = document.getElementById("player-container").children[1]; // Actual player
if(poppedContainer.style.display == "none"){
poppedContainer.appendChild(playerWindow);
poppedContainer.style.display = "block";
} else {
containerOfPlyrWndow.insertBefore(playerWindow, containerOfPlyrWndow.firstChild);
containerOfPlyrWndow.append(playerWindow);
poppedContainer.style.display = "none";
}
}
@ -244,3 +243,6 @@ function checkPg() {
// Start init
checkPg();
}
betterYoutubePlus();