feat: fullscreen button in nav panel for web and rdp services
This commit is contained in:
@@ -60,6 +60,7 @@ cat > /opt/portal/index.html <<'HTML'
|
||||
<div class="nav-panel">
|
||||
<button class="nav-btn" id="btn-back" type="button" title="Назад">←</button>
|
||||
<button class="nav-btn" id="btn-home" type="button" title="Главная">⌂</button>
|
||||
<button class="nav-btn" id="btn-fs" type="button" title="На весь экран">⛶</button>
|
||||
</div>
|
||||
<script type="module">
|
||||
import RFB from './core/rfb.js';
|
||||
@@ -253,6 +254,14 @@ cat > /opt/portal/index.html <<'HTML'
|
||||
|
||||
document.getElementById('btn-back').addEventListener('click', () => chord(XK_ALT_L, XK_LEFT, 'AltLeft', 'ArrowLeft'));
|
||||
document.getElementById('btn-home').addEventListener('click', goHome);
|
||||
document.getElementById('btn-fs').addEventListener('click', () => {
|
||||
if (!document.fullscreenElement) document.documentElement.requestFullscreen();
|
||||
else document.exitFullscreen();
|
||||
});
|
||||
document.addEventListener('fullscreenchange', () => {
|
||||
document.getElementById('btn-fs').textContent = document.fullscreenElement ? '✕' : '⛶';
|
||||
document.getElementById('btn-fs').title = document.fullscreenElement ? 'Выйти из полного экрана' : 'На весь экран';
|
||||
});
|
||||
document.addEventListener('contextmenu', (e) => e.preventDefault());
|
||||
|
||||
(function(){
|
||||
|
||||
Reference in New Issue
Block a user