Skip to content

Commit

Permalink
last one for the night
Browse files Browse the repository at this point in the history
  • Loading branch information
ktg5 committed Jul 11, 2024
1 parent c774c4c commit c83491c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
Binary file modified assets/channels/electron/video-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/channels/electron/video.webp
Binary file not shown.
Binary file modified channelart/electron/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
<meta name="apple-mobile-web-app-status-bar" content="#222222" />

<script>
startDateTime();

var currentMenuPage = 1;
var info,
mainchannelsset;
Expand Down Expand Up @@ -120,7 +122,8 @@ <h2><div class="warn-icon">&#9888;&nbsp;</div>WARNING-HEALTH AND SAFETY</h3>
assets: "assets/channels/",
channelart: "channelart/",
id: "electron",
title: "Download the Desktop App"
title: "Onliine Desktop",
target: "https://github.com/ktg5/onliine-electron/releases/latest"
});

document.querySelector('[data-id="electron"]').setAttribute('data-special', true)
Expand Down
33 changes: 21 additions & 12 deletions js/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,33 @@ function addChannel(id, title, assets, channelart, target, videoformat) {
function def_cmd() {
console.log(`Defaults: addChannel('id', 'Title', 'path-to-assets[/]', 'path-to-channelart[/]', [optional: 'target-to-html', 'video-format (recommend webp!)'] )`);
}
function logErr(msg, defcmd) {
if (defcmd == true) def_cmd();
console.error(`addChannel: ${msg}`);
return { err: true, msg: msg };
}
if (!id) {
console.error(`addChannel: You must supply a id!`)
def_cmd();
let msg = `You must supply a id!`;
return logErr(msg, true);
// Also check for each channel that the users has, make sure the "id" isn't taken.
} else if (userChannels.find((element) => element.id === id)) {
let msg = `You already have a channel with that id!`;
return logErr(msg);
} else if (!title) {
console.error(`addChannel: You must supply a title!`)
def_cmd();
let msg = `You must supply a title!`;
return logErr(msg, true);
} else if (!assets) {
console.error(`addChannel: You must supply the assets directory! (Don't include the id with this var)`)
def_cmd();
let msg = `You must supply the assets directory! (Don't include the id with this var)`;
return logErr(msg, true);
} else if (!assets.endsWith('/')) {
console.error(`addChannel: Your assets folder doesn't end with a "/"! Please fix that!`)
def_cmd();
let msg = `Your assets folder doesn't end with a "/"! Please fix that!`;
return logErr(msg, true);
} else if (!channelart) {
console.error(`addChannel: You must supply the channelart directory! (Don't include the id with this var)`)
def_cmd();
let msg = `You must supply the channelart directory! (Don't include the id with this var)`;
return logErr(msg, true);
} else if (!channelart.endsWith('/')) {
console.error(`addChannel: Your channelart folder doesn't end with a "/"! Please fix that!`)
def_cmd();
let msg = `Your channelart folder doesn't end with a "/"! Please fix that!`;
return logErr(msg, true);

// Pass!!!!!!
} else {
Expand Down
4 changes: 3 additions & 1 deletion js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ function showDateTime() {
dateDiv.innerText = `${today}`;
dateDiary.innerText = `${today}`;
}
setInterval(showDateTime, 1000);
function startDateTime() {
setInterval(showDateTime, 1000);
}

// Disable splash
function disableSplash() {
Expand Down

0 comments on commit c83491c

Please sign in to comment.