mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Re-add channels page
This commit is contained in:
10
src/main/resources/static/js/channels.js
Normal file
10
src/main/resources/static/js/channels.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
const channelNameInput = document.getElementById("channel-search");
|
||||||
|
|
||||||
|
function onOpenOverlayButtonClick(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const channelName = channelNameInput.value.trim().toLowerCase();
|
||||||
|
if (channelName) {
|
||||||
|
const overlayUrl = `/view/${channelName}/broadcast`;
|
||||||
|
window.location.href = overlayUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
function detectPlatform() {
|
function detectPlatform() {
|
||||||
const navigatorPlatform = (navigator.userAgentData?.platform || navigator.platform || "").toLowerCase();
|
const navigatorPlatform = (navigator.userAgentData?.platform || "").toLowerCase();
|
||||||
const userAgent = (navigator.userAgent || "").toLowerCase();
|
const userAgent = (navigator.userAgent || "").toLowerCase();
|
||||||
const platformString = `${navigatorPlatform} ${userAgent}`;
|
const platformString = `${navigatorPlatform} ${userAgent}`;
|
||||||
|
|
||||||
@@ -12,6 +12,7 @@ function detectPlatform() {
|
|||||||
if (platformString.includes("linux")) {
|
if (platformString.includes("linux")) {
|
||||||
return "linux";
|
return "linux";
|
||||||
}
|
}
|
||||||
|
console.warn(`Unable to detect platform from string: ${platformString}`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
/>
|
/>
|
||||||
<datalist id="channel-suggestions"></datalist>
|
<datalist id="channel-suggestions"></datalist>
|
||||||
<button type="submit" class="button block">Open overlay</button>
|
<button type="submit" class="button block" onclick="onOpenOverlayButtonClick(event)">Open overlay</button>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
@@ -67,5 +67,6 @@
|
|||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<script src="/js/cookie-consent.js"></script>
|
<script src="/js/cookie-consent.js"></script>
|
||||||
|
<script src="/js/channels.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user