Compare commits

..

No commits in common. "master" and "v0.10.27" have entirely different histories.

4 changed files with 544 additions and 775 deletions

File diff suppressed because it is too large Load Diff

View File

@ -65,12 +65,3 @@ document.addEventListener("keydown", function(ev) {
ev.preventDefault(); ev.preventDefault();
} }
}); });
document.addEventListener("fullscreenchange", function() {
if(!document.fullscreenElement && CineraProps.V == views.SUPERTHEATRE)
{
CineraProps.V = views.THEATRE;
localStorage.setItem(player.cineraViewStorageItem, views.THEATRE);
player.updateSize();
}
});

View File

@ -1554,11 +1554,10 @@ Player.prototype.updateLink = function()
} break; } break;
case vod_platform.VIMEO: case vod_platform.VIMEO:
{ {
var Parent = this;
this.platformPlayer.getCurrentTime() this.platformPlayer.getCurrentTime()
.then(function(Response) .then(function(Response)
{ {
Parent.link.value = baseURL + "#" + Math.round(Response); this.link.value = baseURL + "#" + Math.round(Response);
}); });
} break; } break;
case vod_platform.YOUTUBE: case vod_platform.YOUTUBE:
@ -1631,7 +1630,6 @@ Player.prototype.toggleMenuVisibility = function(MenuID, Trigger) {
if(element.classList.contains("visible")) if(element.classList.contains("visible"))
{ {
HideMenu(element); HideMenu(element);
this.MenusFocused.MenuID = menu_id.UNSET;
if(Trigger == trigger_id.KEYBOARD && this.Menus[menu_id.MARKERS].Item.LastFocused) if(Trigger == trigger_id.KEYBOARD && this.Menus[menu_id.MARKERS].Item.LastFocused)
{ {

View File

@ -551,6 +551,35 @@ BindHelp(Button, DocumentationContainer)
}) })
} }
function RGBtoHSL(colour)
{
var rgb = colour.slice(4, -1).split(", ");
var red = rgb[0];
var green = rgb[1];
var blue = rgb[2];
var min = Math.min(red, green, blue);
var max = Math.max(red, green, blue);
var chroma = max - min;
var hue = 0;
if(max == red)
{
hue = ((green - blue) / chroma) % 6;
}
else if(max == green)
{
hue = ((blue - red) / chroma) + 2;
}
else if(max == blue)
{
hue = ((red - green) / chroma) + 4;
}
var saturation = chroma / 255 * 100;
hue = (hue * 60) < 0 ? 360 + (hue * 60) : (hue * 60);
return [hue, saturation]
}
function getBackgroundColourRGB(element) { function getBackgroundColourRGB(element) {
var Colour = getComputedStyle(element).getPropertyValue("background-color"); var Colour = getComputedStyle(element).getPropertyValue("background-color");
var depth = 0; var depth = 0;
@ -581,8 +610,6 @@ function setTextLightness(textElement)
{ {
var textHue = textElement.getAttribute("data-hue"); var textHue = textElement.getAttribute("data-hue");
var textSaturation = textElement.getAttribute("data-saturation"); var textSaturation = textElement.getAttribute("data-saturation");
if(textHue && textSaturation)
{
if(getBackgroundBrightness(textElement.parentNode) < 127) if(getBackgroundBrightness(textElement.parentNode) < 127)
{ {
textElement.style.color = ("hsl(" + textHue + ", " + textSaturation + ", 76%)"); textElement.style.color = ("hsl(" + textHue + ", " + textSaturation + ", 76%)");
@ -592,23 +619,19 @@ function setTextLightness(textElement)
textElement.style.color = ("hsl(" + textHue + ", " + textSaturation + ", 24%)"); textElement.style.color = ("hsl(" + textHue + ", " + textSaturation + ", 24%)");
} }
} }
}
function setDotLightness(topicDot) function setDotLightness(topicDot)
{ {
var dotHue = topicDot.getAttribute("data-hue"); var Hue = RGBtoHSL(getComputedStyle(topicDot).getPropertyValue("background-color"))[0];
var dotSaturation = topicDot.getAttribute("data-saturation"); var Saturation = RGBtoHSL(getComputedStyle(topicDot).getPropertyValue("background-color"))[1];
if(dotHue && dotSaturation)
{
if(getBackgroundBrightness(topicDot.parentNode) < 127) if(getBackgroundBrightness(topicDot.parentNode) < 127)
{ {
topicDot.style.backgroundColor = ("hsl(" + dotHue + ", " + dotSaturation + ", 76%)"); topicDot.style.backgroundColor = ("hsl(" + Hue + ", " + Saturation + "%, 76%)");
topicDot.style.borderColor = ("hsl(" + dotHue + ", " + dotSaturation + ", 76%)"); topicDot.style.borderColor = ("hsl(" + Hue + ", " + Saturation + "%, 76%)");
} }
else else
{ {
topicDot.style.backgroundColor = ("hsl(" + dotHue + ", " + dotSaturation + ", 47%)"); topicDot.style.backgroundColor = ("hsl(" + Hue + ", " + Saturation + "%, 47%)");
topicDot.style.borderColor = ("hsl(" + dotHue + ", " + dotSaturation + ", 47%)"); topicDot.style.borderColor = ("hsl(" + Hue + ", " + Saturation + "%, 47%)");
}
} }
} }