Skip to content

Commit 7743950

Browse files
tweak (#406)
1 parent e4a7061 commit 7743950

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

css/index.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ a.return {color: var(--link); text-decoration: none; font-size: 14px; line-heig
110110
cursor: pointer;
111111
}
112112
.btn0, .s0 {border-color: var(--test0); color: var(--test0);}
113-
.btn1, .s1 {border-color: var(--test1); color: var(--test1);}
113+
.btn1, .s1 {border-color: var(--test1); color: var(--test1); cursor: pointer;}
114114
.btn2, .s2 {border-color: var(--test2); color: var(--test2);}
115115
.btn3, .s3 {border-color: var(--test3); color: var(--test3);}
116116
.btn4, .s4 {border-color: var(--test4); color: var(--test4);}
@@ -269,7 +269,7 @@ tr td.border-top {
269269
#tbperf th {background-color: var(--bg99);}
270270
#tbblock th {background-color: var(--bg99);}
271271

272-
.togA, .togP, /* android, perf */
272+
.togA, .togP, #btnFS, /* android, perf, fullscreen element */
273273
.togCS, .togFS, .togL, .togS, .togTP, .togTA, .togTL, .togTT, .togTO, .togUAI, .togUAW {display: none;}
274274

275275

js/generic.js

+1
Original file line numberDiff line numberDiff line change
@@ -1712,6 +1712,7 @@ function outputUser(fn) {
17121712
// user initiated
17131713
if (isBlock) {return}
17141714
if ('goFS' == fn) { goFS()
1715+
} else if ("exitFS" == fn) { exitFS()
17151716
} else if ("goNW" == fn) { goNW()
17161717
} else if ('goNW_UA' == fn) { goNW_UA()
17171718
} else if ('outputAudioUser' == fn) {outputAudioUser()

js/screen.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,12 @@ const get_scr_measure = () => new Promise(resolve => {
379379

380380
// desktop: if in fullscreenElement mode, use the svh element to measure
381381
// we don't have a resize event in android
382-
let isElementFS = document.fullscreen || document.webkitIsFullscreen || false
383-
if (isElementFS && 'android' !== isOS) {
384-
addDisplay(1, 'fsElement', oData.inner.width.svw +' x '+ oData.inner.height.svh)
382+
if ('android' !== isOS) {
383+
let isElementFS = document.fullscreen || document.webkitIsFullscreen || false
384+
if (isElementFS) {
385+
addDisplay(1, 'fsElement', oData.inner.width.svw +' x '+ oData.inner.height.svh)
386+
}
387+
try {dom.btnFS.style.display = (isElementFS ? 'block' : 'none')} catch {}
385388
}
386389

387390
// RFP/match
@@ -1205,6 +1208,13 @@ function get_ua_workers() {
12051208

12061209
/* USER TESTS */
12071210

1211+
function exitFS() {
1212+
let isElementFS = document.fullscreen || document.webkitIsFullscreen || false
1213+
if (isElementFS) {
1214+
try {document.exitFullscreen()} catch {}
1215+
}
1216+
}
1217+
12081218
function goFS() {
12091219
gFS = false
12101220
try {

tzp.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,11 @@
323323
&nbsp; display-mode | fullscreen</td>
324324
<td class="mono border-top"><span id="cssDM"></span> | <span class="c" id="display-mode"></span>
325325
| <span class="c" id="windowfullScreen"></span> | <span class="c" id="mozFullScreenEnabled"></span></td></tr>
326-
<tr><td><span class="btn btn0" onClick="outputUser('goFS')">[ click ]</span>
327-
fullscreenElement <sup>4</sup></td><td class="c mono" id="fsElement"></td></tr>
326+
<tr><td><span class="btn btn0" onClick="outputUser('goFS')">[ click ]</span> fullscreenElement <sup>4</sup></td>
327+
<td class="mono">
328+
<span class="c" id="fsElement"></span>
329+
<div id="btnFS" class="btn-right btn1" onClick="outputUser('exitFS')">[ exit ]</div>
330+
</td></tr>
328331
<tr><td><span class="mono no_color">[F11]</span> fullscreen</td><td class="c mono" id="fsSize"></td></tr>
329332
<tr><td><span class="btn btn0" onClick="outputUser('goNW')">[ click ]</span>
330333
<div class="ttip"><span class="icon">[ i ]</span>

0 commit comments

Comments
 (0)