Switched to LocalStorage. Upgraded MoonCore. Improved auth flow

This commit is contained in:
Masu Baumgartner
2024-10-23 21:37:26 +02:00
parent 910f190c86
commit 6f3341e6ad
7 changed files with 76 additions and 89 deletions

View File

@@ -1,25 +1,11 @@
window.moonlight = {
window: {
open: function (url, title, w, h) {
// Fixes dual-screen position Most browsers Firefox
const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX;
const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY;
const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
const systemZoom = width / window.screen.availWidth;
const left = (width - w) / 2 / systemZoom + dualScreenLeft
const top = (height - h) / 2 / systemZoom + dualScreenTop
const newWindow = window.open(url, title,
`
scrollbars=yes,
width=${w / systemZoom},
height=${h / systemZoom},
top=${top},
left=${left}
`
)
let height = w;
let width = h;
var left = (screen.width - width) / 2;
var top = (screen.height - height) / 2;
var newWindow = window.open(url, title, 'resizable = yes, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);
if (window.focus) newWindow.focus();
},