mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
• Minor aesthetic changes
• If no YouTube streams are found, a shortcut to your YouTube dashboard will now appear
This commit is contained in:
@@ -101,14 +101,12 @@ button:disabled {
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
margin-left: auto;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 1.5em;
|
||||
font-weight: 100;
|
||||
font-size: 1.1em;
|
||||
padding: 1em;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -13,11 +13,26 @@
|
||||
<img src="https://api.iconify.design/material-symbols:edit-square-outline.svg?color=%23ffffff"> Update All
|
||||
</button>
|
||||
|
||||
<!-- List of all broadcasts -->
|
||||
<div id="broadcast-list">
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; gap: 0.5em;">
|
||||
<!-- List of all broadcasts -->
|
||||
<div id="broadcast-list">
|
||||
</div>
|
||||
|
||||
<label id="youtube-warning" class="setting-attribute"><i>YouTube stream info can only be updated while live</i></label>
|
||||
<!-- YouTube warning -->
|
||||
<div id="youtube-warning" class="broadcast">
|
||||
<img class="platform-icon" id="platform-icon" src="icons/platforms/youtube.png"/>
|
||||
|
||||
<div class="broadcast-info">
|
||||
<label class="setting-attribute">
|
||||
<i>YouTube stream info can only be updated while live</i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div id="broadcast-buttons">
|
||||
<button id="broadcast-dashboard-button" class="icon-button" title="Dashboard"><img class="button-icon" src="https://api.iconify.design/gridicons:popout.svg?color=%23ffffff"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Blur Layer -->
|
||||
<div id="blur-layer" class="blur"></div>
|
||||
@@ -137,12 +152,12 @@
|
||||
<!-- Broadcast Template -->
|
||||
<template id="broadcast-template">
|
||||
<div class="broadcast">
|
||||
<img class="platform-icon" id="platform-icon" src="icons/platforms/twitch.png"/>
|
||||
<img class="platform-icon" id="platform-icon" src=""/>
|
||||
|
||||
<div class="broadcast-info">
|
||||
<label id="broadcast-title"></label>
|
||||
<label id="broadcast-category" class="setting-description"></label>
|
||||
<label id="kick-warning" class="setting-attribute"><br><i>Current stream info only available when live — Showing last known stream title</i></label>
|
||||
<label id="kick-warning" class="setting-attribute"><br><i>Stream info only available when live — Showing last known stream title</i></label>
|
||||
</div>
|
||||
|
||||
<div id="broadcast-buttons">
|
||||
|
||||
@@ -7,6 +7,7 @@ const sbActionUpdateStreamInfo = '1c58eff0-e98a-4fab-86f0-6f5cee1d3ab3';
|
||||
const sbActionOpenUrl = '14da1d44-6e29-4582-92c3-2c59388be57e';
|
||||
|
||||
let currentBroadcastId = '';
|
||||
let runningActionId = '';
|
||||
|
||||
|
||||
///////////////////
|
||||
@@ -32,6 +33,7 @@ window.addEventListener("message", (event) => {
|
||||
});
|
||||
|
||||
window.parent.sbClient.on('General.Custom', (response) => {
|
||||
console.debug(response.data);
|
||||
GeneralCustom(response.data);
|
||||
})
|
||||
|
||||
@@ -42,6 +44,10 @@ window.parent.sbClient.on('General.Custom', (response) => {
|
||||
///////////////////////////////
|
||||
|
||||
async function GeneralCustom(data) {
|
||||
// Only run if response matches the ID of the corresponding FetchBroadcasts() call
|
||||
if (runningActionId != data.runningActionId)
|
||||
return;
|
||||
|
||||
switch(data.actionId) {
|
||||
case sbActionFetchBroadcasts:
|
||||
{
|
||||
@@ -55,11 +61,19 @@ async function GeneralCustom(data) {
|
||||
const broadcasterInfo = await window.parent.sbClient.getBroadcaster();
|
||||
if (broadcasterInfo.platforms.youtube)
|
||||
{
|
||||
// Only show the warning if there are 0 monitored broadcasts
|
||||
const ytBroadcastCount = data.broadcastList.filter(b => b.platform === "youtube").length;
|
||||
if (ytBroadcastCount <= 0)
|
||||
youtubeWarning.style.display = 'inline';
|
||||
youtubeWarning.style.display = 'flex';
|
||||
else
|
||||
youtubeWarning.style.display = 'none';
|
||||
|
||||
// Set the URL to the livestreaming dashboard
|
||||
const broadcastButton = youtubeWarning.querySelector('#broadcast-dashboard-button');
|
||||
broadcastButton.onclick = function() {
|
||||
//window.open(data.streamUrl, '_blank');
|
||||
OpenURL(`https://studio.youtube.com/channel/${broadcasterInfo.platforms.youtube.broadcastUserId}/livestreaming`);
|
||||
};
|
||||
}
|
||||
else
|
||||
youtubeWarning.style.display = 'none';
|
||||
@@ -81,7 +95,8 @@ async function GeneralCustom(data) {
|
||||
|
||||
async function FetchBroadcasts() {
|
||||
// Fetch from Streamer.bot
|
||||
await window.parent.sbClient.doAction({ id: sbActionFetchBroadcasts});
|
||||
const response = await window.parent.sbClient.doAction({ id: sbActionFetchBroadcasts});
|
||||
runningActionId = response.args.runningActionId;
|
||||
}
|
||||
|
||||
async function AddBroadcast(data) {
|
||||
|
||||
@@ -5,16 +5,16 @@ body {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
button {
|
||||
gap: 0.5em;
|
||||
}
|
||||
|
||||
#broadcast-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5em;
|
||||
}
|
||||
|
||||
button {
|
||||
gap: 0.5em;
|
||||
}
|
||||
|
||||
.broadcast {
|
||||
background-color: var(--dialog-background);
|
||||
border: 1px solid #40404080;
|
||||
@@ -36,7 +36,6 @@ button {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
/* gap: 1em; */
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@@ -74,5 +73,4 @@ button {
|
||||
|
||||
#youtube-warning {
|
||||
display: none;
|
||||
text-align: center;
|
||||
}
|
||||
Reference in New Issue
Block a user