|
41 | 41 | #status { |
42 | 42 | text-align: center; |
43 | 43 | } |
44 | | - #sendCtrlAltDelButton { |
45 | | - position: fixed; |
46 | | - top: 0px; |
47 | | - right: 0px; |
48 | | - border: 1px outset; |
49 | | - padding: 5px 5px 4px 5px; |
50 | | - cursor: pointer; |
| 44 | + #container { |
| 45 | + display: flex; |
| 46 | + justify-content: space-between; |
51 | 47 | } |
52 | | - #sendCtrlEscButton { |
53 | | - position: fixed; |
54 | | - top: 0px; |
55 | | - left: 0px; |
| 48 | + #sendCtrlAltDelButton, #sendCtrlEscButton, #toggleFullScreenButton { |
| 49 | + vertical-align: top; |
| 50 | + display: inline-block; |
56 | 51 | border: 1px outset; |
57 | 52 | padding: 5px 5px 4px 5px; |
58 | 53 | cursor: pointer; |
|
88 | 83 |
|
89 | 84 | let rfb; |
90 | 85 | let desktopName; |
| 86 | + let fullScreen = false; |
91 | 87 |
|
92 | 88 | // When this function is called we have |
93 | 89 | // successfully connected to a server |
|
130 | 126 | return false; |
131 | 127 | } |
132 | 128 |
|
| 129 | + function toggleFullScreen() { |
| 130 | + fullScreen = !fullScreen |
| 131 | + rfb.scaleViewport = fullScreen |
| 132 | + return false; |
| 133 | + } |
| 134 | + |
133 | 135 | // Show a status text in the top bar |
134 | 136 | function status(text) { |
135 | 137 | document.getElementById('status').textContent = text; |
|
162 | 164 | document.getElementById('sendCtrlEscButton') |
163 | 165 | .onclick = sendCtrlEsc; |
164 | 166 |
|
| 167 | + document.getElementById('toggleFullScreenButton') |
| 168 | + .onclick = toggleFullScreen; |
| 169 | + |
165 | 170 | // Read parameters specified in the URL query string |
166 | 171 | // By default, use the host and port of server that served this file |
167 | 172 | const host = readQueryVariable('host', window.location.hostname); |
|
209 | 214 | <body> |
210 | 215 | <div id="top_bar"> |
211 | 216 | <div id="status">Loading</div> |
212 | | - <div id="sendCtrlAltDelButton">Send CtrlAltDel</div> |
213 | | - <div id="sendCtrlEscButton">Send CtrlEsc</div> |
| 217 | + <br /> |
| 218 | + <div id="container" > |
| 219 | + <div id="sendCtrlAltDelButton">Send CtrlAltDel</div> |
| 220 | + <div id="toggleFullScreenButton">Toggle Fullscreen</div> |
| 221 | + <div id="sendCtrlEscButton">Send CtrlEsc</div> |
| 222 | + </div> |
214 | 223 | </div> |
215 | 224 | <div id="screen"> |
216 | 225 | <!-- This is where the remote screen will appear --> |
|
0 commit comments