-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.html
70 lines (68 loc) · 3.87 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html><html lang="en">
<head>
<title>Window Management Demo</title>
<link rel="manifest" href="manifest.json">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<meta name="theme-color" content="#757575"/>
</head>
<body>
<h3>Window Management Demo (<a href="https://github.com/michaelwasserman/window-placement-demo">GitHub</a>, <a href="https://w3c.github.io/window-management/">Spec</a>)</h3>
<h4 id="warning" hidden=true style="color: red;"></h4>
<div class="controls">
<div id="openWindowControls" style="display:flex; align-items:center;">
<button id="openWindowButton" style="flex-shrink: 0;">Open window</button>
<label for="openWindowUrlInput">URL: </label><input id="openWindowUrlInput" style="flex-grow: 1;min-width: 81px;max-width: 125px;" value="./popup.html"></input>
<label for="openWindowLeftInput">left: </label><input id="openWindowLeftInput" style="width:50px;" size=5 value="100" type="number"></input>
<label for="openWindowTopInput">top: </label><input id="openWindowTopInput" style="width:50px;" size=5 value="50" type="number"></input>
<label for="openWindowWidthInput">width: </label><input id="openWindowWidthInput" style="width:50px;" size=5 value="830" type="number"></input>
<label for="openWindowHeightInput">height: </label><input id="openWindowHeightInput" style="width:50px;" size=5 value="750" type="number"></input>
</div>
<button id="updateScreensButton">Update screens</button>
<div class="dropdown">
<button id="openPopupButton">Open popup</button>
<div class="dropdownContent" hidden=true id="openPopupDropdown"></div>
</div>
<!-- <button id="openWindowsButton">Open <input id="openWindowsCountInput" style="width:25px;padding:0px;margin:0px" size=2 value="2" type="number" min=1 max=9></input> windows</button> -->
<div class="dropdown">
<button id="toggleFullscreenButton">Toggle fullscreen</button>
<div class="dropdownContent" hidden=true id="toggleFullscreenDropdown"></div>
</div>
<div class="dropdown">
<button id="fullscreenSlideButton">Fullscreen slide
<iframe id="slideIframe" class="slide" src="./slide.html"></iframe>
</button>
<div class="dropdownContent" hidden=true id="fullscreenSlideDropdown"></div>
</div>
<div class="dropdown">
<button id="fullscreenSlideAndOpenNotesWindowButton">Fullscreen slide and open notes</button>
<div class="dropdownContent" hidden=true id="fullscreenSlideAndOpenNotesWindowDropdown"></div>
</div>
</div>
<p></p>
<canvas id="screensCanvas" width="800" height="600" style="border-style: solid"></canvas>
<!-- Testing of iframe functionality and permissions:
<iframe src="https://michaelwasserman.github.io/window-placement-demo/" style="width:800; height:600;" allow="fullscreen;window-management"></iframe>
<iframe src="https://permission.site" style="width:800; height:600;" allow="fullscreen;geolocation;window-management"></iframe>
<iframe src="about:blank" style="width:800; height:600;" allow="window-management none"></iframe>
-->
</body>
<script src="main.js"></script>
<script>
'use strict';
window.addEventListener('load', () => {
if ('serviceWorker' in navigator)
navigator.serviceWorker.register('./sw.js');
// Handle messages (e.g. fullscreen capability delegation from popup.html).
window.addEventListener('message', handleWindowMessage);
// Handle control button clicks and input events.
openWindowButton.addEventListener('click', openWindow);
updateScreensButton.addEventListener('click', updateScreens);
openPopupButton.addEventListener('click', openPopup);
// openWindowsButton.addEventListener('click', openWindows);
toggleFullscreenButton.addEventListener('click', toggleFullscreen);
fullscreenSlideButton.addEventListener('click', fullscreenSlide);
fullscreenSlideAndOpenNotesWindowButton.addEventListener('click', fullscreenSlideAndOpenNotesWindow);
});
</script>
</html>