Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Commit

Permalink
Fixed player size for another update of YouTube.
Browse files Browse the repository at this point in the history
  • Loading branch information
YePpHa committed Jul 18, 2014
1 parent 2273fcc commit d8a9412
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 25 deletions.
4 changes: 2 additions & 2 deletions devbuild.number
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Fri Jul 18 01:45:21 CEST 2014
build.number=354
#Sat Jul 19 01:31:33 CEST 2014
build.number=355
Binary file modified dist/YouTubeCenter-webstore.zip
Binary file not shown.
Binary file modified dist/YouTubeCenter.crx
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/YouTubeCenter.meta.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name YouTube Center Developer Build
// @namespace http://www.facebook.com/YouTubeCenter
// @version 354
// @version 355
// @author Jeppe Rune Mortensen (YePpHa)
// @description YouTube Center contains all kind of different useful functions which makes your visit on YouTube much more entertaining.
// @icon https://raw.github.com/YePpHa/YouTubeCenter/master/assets/logo-48x48.png
Expand Down
Binary file modified dist/YouTubeCenter.mxaddon
Binary file not shown.
Binary file modified dist/YouTubeCenter.oex
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/YouTubeCenter.safariextension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>354</string>
<string>355</string>
<key>CFBundleVersion</key>
<string>116</string>
<key>Chrome</key>
Expand Down
39 changes: 32 additions & 7 deletions dist/YouTubeCenter.safariextension/YouTubeCenter.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 32 additions & 7 deletions dist/YouTubeCenter.user.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/YouTubeCenter.xpi
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/chrome-update.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gupdate xmlns="http://www.google.com/update2/response" protocol="2.0">
<app appid="bcegdpionpopahcglnfiiioapcclamdj">
<updatecheck codebase="https://raw.github.com/YePpHa/YouTubeCenter/master/dist/YouTubeCenter.crx" version="354" />
<updatecheck codebase="https://raw.github.com/YePpHa/YouTubeCenter/master/dist/YouTubeCenter.crx" version="355" />
</app>
</gupdate>
2 changes: 1 addition & 1 deletion dist/firefox-update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>354</em:version>
<em:version>355</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
Expand Down
35 changes: 30 additions & 5 deletions src/YouTubeCenter.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -20744,14 +20744,20 @@

var minSmallPlayer = 640;

var maxWatchNonStageWidth0 = 1254;
var maxWatchNonStageWidth1 = 1254;
var maxWatchNonStageWidth2 = 1360;
var maxWatchNonStageWidth3 = 1680;

var maxWatchStageWidth0 = 1680;

var maxWatchNonStagePlayerWidth0 = 854;
var maxWatchNonStagePlayerWidth1 = 854;
var maxWatchNonStagePlayerWidth2 = 960;
var maxWatchNonStagePlayerWidth3 = 1280;

var maxWatchStagePlayerWidth0 = 1280;

ytcenter.player._updateResize = function(){
if (!ytcenter.settings.enableResize) return;
ytcenter.player._resize(_width, _height, _large, _align);
Expand Down Expand Up @@ -20811,8 +20817,12 @@
var isWatchNonStage301 = ytcenter.utils.hasClass(document.body, "appbar-flexwatch") && 1720 <= innerWidth && 920 <= innerHeight;
var isWatchNonStage302 = ytcenter.utils.hasClass(document.body, "appbar-flexwatch-720-mini") && 1720 <= innerWidth && 920 <= innerHeight;

var isWatchStage = ytcenter.utils.hasClass(page, "watch-stage-mode");
var isWatchNonStage = ytcenter.utils.hasClass(page, "watch-non-stage-mode");

var isWatchStage0 = 1320 <= innerWidth && 870 <= innerHeight && isWatchStage && large;

var isWatchNonStage0 = 1294 <= innerWidth && 630 <= innerHeight && isWatchNonStage && !large;
var isWatchNonStage1 = (isWatchNonStage101 || isWatchNonStage102) && isWatchNonStage && !large;
var isWatchNonStage2 = (isWatchNonStage201 || isWatchNonStage202) && isWatchNonStage && !large;
var isWatchNonStage3 = (isWatchNonStage301 || isWatchNonStage302) && isWatchNonStage && !large;
Expand Down Expand Up @@ -20866,13 +20876,18 @@
}

// Settings the sizes for small and large. If width and height is undefined
if (isNaN(parseInt(width)) && isNaN(parseInt(height))) {
if (isWatchNonStage3) {
var stageSize = isNaN(parseInt(width)) && isNaN(parseInt(height));
if (stageSize) {
if (isWatchStage0) {
width = maxWatchStagePlayerWidth0 + "px";
} else if (isWatchNonStage3) {
width = maxWatchNonStagePlayerWidth3 + "px";
} else if (isWatchNonStage2) {
width = maxWatchNonStagePlayerWidth2 + "px";
} else if (isWatchNonStage1) {
width = maxWatchNonStagePlayerWidth1 + "px";
} else if (isWatchNonStage0) {
width = maxWatchNonStagePlayerWidth0 + "px";
} else {
width = large ? "854px" : "640px";
}
Expand Down Expand Up @@ -20978,15 +20993,19 @@
playerHeight = Math.round(calcHeight + pbh),
playlist_el = document.getElementById("playlist-legacy") || document.getElementById("playlist");

if (isWatchNonStage3 || isWatchNonStage2 || isWatchNonStage1) {
if (stageSize && (isWatchStage0 || isWatchNonStage3 || isWatchNonStage2 || isWatchNonStage1 || isWatchNonStage0)) {
var maxWidth = minSmallPlayer;
var minWidth = minSmallPlayer;
if (isWatchNonStage3) {
if (isWatchStage0) {
maxWidth = maxWatchStagePlayerWidth0;
} else if (isWatchNonStage3) {
maxWidth = maxWatchNonStagePlayerWidth3;
} else if (isWatchNonStage2) {
maxWidth = maxWatchNonStagePlayerWidth2;
} else if (isWatchNonStage1) {
maxWidth = maxWatchNonStagePlayerWidth1;
} else if (isWatchNonStage0) {
maxWidth = maxWatchNonStagePlayerWidth0;
}

if (clientWidth > maxWidth) {
Expand Down Expand Up @@ -21046,7 +21065,11 @@
playerAPI.style.cssFloat = "";
}

if (!large) {
if (large && isWatchStage0 && stageSize) {
player.style.width = "auto";
player.style.minWidth = minInsidePlayerWidth + "px";
player.style.maxWidth = maxWatchStageWidth0 + "px";
} else if (!large && stageSize) {
player.style.width = "auto";
player.style.minWidth = minInsidePlayerWidth + "px";
if (isWatchNonStage3) {
Expand All @@ -21055,6 +21078,8 @@
player.style.maxWidth = maxWatchNonStageWidth2 + "px";
} else if (isWatchNonStage1) {
player.style.maxWidth = maxWatchNonStageWidth1 + "px";
} else if (isWatchNonStage0) {
player.style.maxWidth = maxWatchNonStageWidth0 + "px";
} else {
player.style.maxWidth = maxInsidePlayerWidth + "px";
}
Expand Down

0 comments on commit d8a9412

Please sign in to comment.