Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
7d1dc09a
Commit
7d1dc09a
authored
9 years ago
by
samhed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #498 - Add the ability to toggle fullscreen mode
parent
b098afc2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
0 deletions
+57
-0
fullscreen.png
images/fullscreen.png
+0
-0
ui.js
include/ui.js
+54
-0
vnc.html
vnc.html
+3
-0
No files found.
images/fullscreen.png
0 → 100644
View file @
7d1dc09a
851 Bytes
This diff is collapsed.
Click to expand it.
include/ui.js
View file @
7d1dc09a
...
...
@@ -131,6 +131,19 @@ var UI;
UI
.
setBarPosition
();
}
);
// Hide the button if fullscreen isn't supported
if
(
!
document
.
documentElement
.
requestFullscreen
&&
!
document
.
documentElement
.
mozRequestFullScreen
&&
!
document
.
documentElement
.
webkitRequestFullscreen
&&
!
document
.
body
.
msRequestFullscreen
)
{
$D
(
'fullscreenButton'
).
style
.
display
=
"none"
;
}
else
{
Util
.
addEvent
(
window
,
'fullscreenchange'
,
UI
.
updateFullscreenButton
);
Util
.
addEvent
(
window
,
'mozfullscreenchange'
,
UI
.
updateFullscreenButton
);
Util
.
addEvent
(
window
,
'webkitfullscreenchange'
,
UI
.
updateFullscreenButton
);
Util
.
addEvent
(
window
,
'msfullscreenchange'
,
UI
.
updateFullscreenButton
);
}
Util
.
addEvent
(
window
,
'load'
,
UI
.
keyboardinputReset
);
Util
.
addEvent
(
window
,
'beforeunload'
,
function
()
{
...
...
@@ -201,6 +214,7 @@ var UI;
$D
(
"noVNC_popup_status"
).
onclick
=
UI
.
togglePopupStatus
;
$D
(
"xvpButton"
).
onclick
=
UI
.
toggleXvpPanel
;
$D
(
"clipboardButton"
).
onclick
=
UI
.
toggleClipboardPanel
;
$D
(
"fullscreenButton"
).
onclick
=
UI
.
toggleFullscreen
;
$D
(
"settingsButton"
).
onclick
=
UI
.
toggleSettingsPanel
;
$D
(
"connectButton"
).
onclick
=
UI
.
toggleConnectPanel
;
$D
(
"disconnectButton"
).
onclick
=
UI
.
disconnect
;
...
...
@@ -437,6 +451,46 @@ var UI;
}
},
// Toggle fullscreen mode
toggleFullscreen
:
function
()
{
if
(
document
.
fullscreenElement
||
// alternative standard method
document
.
mozFullScreenElement
||
// currently working methods
document
.
webkitFullscreenElement
||
document
.
msFullscreenElement
)
{
if
(
document
.
exitFullscreen
)
{
document
.
exitFullscreen
();
}
else
if
(
document
.
mozCancelFullScreen
)
{
document
.
mozCancelFullScreen
();
}
else
if
(
document
.
webkitExitFullscreen
)
{
document
.
webkitExitFullscreen
();
}
else
if
(
document
.
msExitFullscreen
)
{
document
.
msExitFullscreen
();
}
}
else
{
if
(
document
.
documentElement
.
requestFullscreen
)
{
document
.
documentElement
.
requestFullscreen
();
}
else
if
(
document
.
documentElement
.
mozRequestFullScreen
)
{
document
.
documentElement
.
mozRequestFullScreen
();
}
else
if
(
document
.
documentElement
.
webkitRequestFullscreen
)
{
document
.
documentElement
.
webkitRequestFullscreen
(
Element
.
ALLOW_KEYBOARD_INPUT
);
}
else
if
(
document
.
body
.
msRequestFullscreen
)
{
document
.
body
.
msRequestFullscreen
();
}
}
UI
.
updateFullscreenButton
();
},
updateFullscreenButton
:
function
()
{
if
(
document
.
fullscreenElement
||
// alternative standard method
document
.
mozFullScreenElement
||
// currently working methods
document
.
webkitFullscreenElement
||
document
.
msFullscreenElement
)
{
$D
(
'fullscreenButton'
).
className
=
"noVNC_status_button_selected"
;
}
else
{
$D
(
'fullscreenButton'
).
className
=
"noVNC_status_button"
;
}
},
// Show the connection settings panel/menu
toggleConnectPanel
:
function
()
{
// Close the description panel
...
...
This diff is collapsed.
Click to expand it.
vnc.html
View file @
7d1dc09a
...
...
@@ -99,6 +99,9 @@
<input
type=
"image"
alt=
"Clipboard"
src=
"images/clipboard.png"
id=
"clipboardButton"
class=
"noVNC_status_button"
title=
"Clipboard"
/>
<input
type=
"image"
alt=
"Fullscreen"
src=
"images/fullscreen.png"
id=
"fullscreenButton"
class=
"noVNC_status_button"
title=
"Fullscreen"
/>
<input
type=
"image"
alt=
"Settings"
src=
"images/settings.png"
id=
"settingsButton"
class=
"noVNC_status_button"
title=
"Settings"
/>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment