style: auto-fix linting issues
This commit is contained in:
parent
11d7d0ecd3
commit
75ae9c23fa
7 changed files with 959 additions and 151 deletions
|
|
@ -259,15 +259,12 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
// Initialize Discord RPC
|
// Initialize Discord RPC
|
||||||
console.log('[App] Starting Discord RPC...');
|
console.log('[App] Starting Discord RPC...');
|
||||||
initializeDiscordRPC(player);
|
initializeDiscordRPC(player);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('[App] Neutralino init failed:', e);
|
console.error('[App] Neutralino init failed:', e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const api = new LosslessAPI(apiSettings);
|
const api = new LosslessAPI(apiSettings);
|
||||||
|
|
||||||
const audioPlayer = document.getElementById('audio-player');
|
const audioPlayer = document.getElementById('audio-player');
|
||||||
|
|
@ -416,8 +413,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
// Initialize tracker
|
// Initialize tracker
|
||||||
initTracker(player);
|
initTracker(player);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
initNeutralino();
|
initNeutralino();
|
||||||
|
|
||||||
const castBtn = document.getElementById('cast-btn');
|
const castBtn = document.getElementById('cast-btn');
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@ export function initializeDiscordRPC(player) {
|
||||||
smallImageKey: 'pause',
|
smallImageKey: 'pause',
|
||||||
smallImageText: 'Paused',
|
smallImageText: 'Paused',
|
||||||
};
|
};
|
||||||
Neutralino.events.broadcast('discord:update', idlingData).catch(() => { });
|
Neutralino.events.broadcast('discord:update', idlingData).catch(() => {});
|
||||||
Neutralino.extensions.dispatch(EXTENSION_ID, 'discord:update', idlingData).catch(() => { });
|
Neutralino.extensions.dispatch(EXTENSION_ID, 'discord:update', idlingData).catch(() => {});
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
|
|
@ -84,6 +84,6 @@ export function initializeDiscordRPC(player) {
|
||||||
smallImageKey: 'pause',
|
smallImageKey: 'pause',
|
||||||
smallImageText: 'Paused',
|
smallImageText: 'Paused',
|
||||||
})
|
})
|
||||||
.catch(() => { });
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ const _window = {
|
||||||
},
|
},
|
||||||
setTitle: async (title) => {
|
setTitle: async (title) => {
|
||||||
window.parent.postMessage({ type: 'NL_WINDOW_SET_TITLE', title }, '*');
|
window.parent.postMessage({ type: 'NL_WINDOW_SET_TITLE', title }, '*');
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Expose generically for other modules
|
// Expose generically for other modules
|
||||||
|
|
@ -76,5 +76,5 @@ export default {
|
||||||
events,
|
events,
|
||||||
extensions,
|
extensions,
|
||||||
app,
|
app,
|
||||||
window: _window
|
window: _window,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,5 @@
|
||||||
"commandWindows": "powershell.exe -ExecutionPolicy Bypass -File \"${NL_PATH}/extensions/js.neutralino.discordrpc/bridge.ps1\""
|
"commandWindows": "powershell.exe -ExecutionPolicy Bypass -File \"${NL_PATH}/extensions/js.neutralino.discordrpc/bridge.ps1\""
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"nativeAllowList": [
|
"nativeAllowList": ["app.exit", "window.*", "extensions.*", "events.*"]
|
||||||
"app.exit",
|
|
||||||
"window.*",
|
|
||||||
"extensions.*",
|
|
||||||
"events.*"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,7 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
<head>
|
<meta charset="UTF-8" />
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Monochrome Shell</title>
|
<title>Monochrome Shell</title>
|
||||||
<style>
|
<style>
|
||||||
body,
|
body,
|
||||||
|
|
@ -23,9 +22,9 @@
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script src="/__neutralino_globals.js"></script>
|
<script src="/__neutralino_globals.js"></script>
|
||||||
<script src="/neutralino.js"></script>
|
<script src="/neutralino.js"></script>
|
||||||
|
|
||||||
|
|
@ -47,7 +46,7 @@
|
||||||
|
|
||||||
const initFrame = async () => {
|
const initFrame = async () => {
|
||||||
// Wait a tick for globals
|
// Wait a tick for globals
|
||||||
await new Promise(r => setTimeout(r, 100));
|
await new Promise((r) => setTimeout(r, 100));
|
||||||
|
|
||||||
let port = window.NL_PORT || sessionStorage.getItem('NL_PORT');
|
let port = window.NL_PORT || sessionStorage.getItem('NL_PORT');
|
||||||
// Fallback if missing (shouldn't happen after init)
|
// Fallback if missing (shouldn't happen after init)
|
||||||
|
|
@ -71,11 +70,14 @@
|
||||||
// Forward generic Neutralino events to the Iframe
|
// Forward generic Neutralino events to the Iframe
|
||||||
const forwardEvent = (eventName, detail) => {
|
const forwardEvent = (eventName, detail) => {
|
||||||
if (iframe && iframe.contentWindow) {
|
if (iframe && iframe.contentWindow) {
|
||||||
iframe.contentWindow.postMessage({
|
iframe.contentWindow.postMessage(
|
||||||
|
{
|
||||||
type: 'NL_EVENT',
|
type: 'NL_EVENT',
|
||||||
eventName: eventName,
|
eventName: eventName,
|
||||||
detail: detail
|
detail: detail,
|
||||||
}, '*');
|
},
|
||||||
|
'*'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -130,18 +132,20 @@
|
||||||
const isMax = await Neutralino.window.isMaximized();
|
const isMax = await Neutralino.window.isMaximized();
|
||||||
if (isMax) Neutralino.window.unmaximize();
|
if (isMax) Neutralino.window.unmaximize();
|
||||||
else Neutralino.window.maximize();
|
else Neutralino.window.maximize();
|
||||||
} catch (e) { console.error('[Shell] Window toggle failed:', e); }
|
} catch (e) {
|
||||||
|
console.error('[Shell] Window toggle failed:', e);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'NL_WINDOW_SET_TITLE':
|
case 'NL_WINDOW_SET_TITLE':
|
||||||
try {
|
try {
|
||||||
await Neutralino.window.setTitle(event.data.title);
|
await Neutralino.window.setTitle(event.data.title);
|
||||||
} catch (e) { console.error('[Shell] Set title failed:', e); }
|
} catch (e) {
|
||||||
|
console.error('[Shell] Set title failed:', e);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in a new issue