mirror of
https://github.com/rubickCenter/rubick
synced 2026-02-25 08:21:21 +08:00
✨ 内置npm,替代本地npm
♻️ 优化分离插件窗口交互
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
||||
@@ -86,6 +86,47 @@ Object.assign(window, {
|
||||
plugInfo.value.subInput = null;
|
||||
},
|
||||
});
|
||||
|
||||
window.enterFullScreenTrigger = () => {
|
||||
document.querySelector('.detach').classList.remove('darwin');
|
||||
};
|
||||
window.leaveFullScreenTrigger = () => {
|
||||
const titleDom = document.querySelector('.detach');
|
||||
if (!titleDom.classList.contains('darwin')) {
|
||||
titleDom.classList.add('darwin');
|
||||
}
|
||||
};
|
||||
|
||||
window.maximizeTrigger = () => {
|
||||
const btnMaximize = document.querySelector('.maximize')
|
||||
if (!btnMaximize || btnMaximize.classList.contains('unmaximize')) return;
|
||||
btnMaximize.classList.add('unmaximize');
|
||||
};
|
||||
|
||||
window.unmaximizeTrigger = () => {
|
||||
const btnMaximize = document.querySelector('.maximize');
|
||||
if (!btnMaximize) return;
|
||||
btnMaximize.classList.remove('unmaximize');
|
||||
};
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
window.onkeydown = (e) => {
|
||||
if (e.code === 'Escape') {
|
||||
ipcRenderer.send('detach:service', { type: 'endFullScreen' });
|
||||
return;
|
||||
}
|
||||
if (e.metaKey && (e.code === 'KeyW' || e.code === 'KeyQ')) {
|
||||
window.handle.close()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
window.onkeydown = (e) => {
|
||||
if (e.ctrlKey && e.code === 'KeyW') {
|
||||
window.handle.close()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user