forked from michaelwasserman/window-placement-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (93 loc) · 6.29 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html><html lang="en">
<head>
<title>Multi-Screen Window Placement 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"/>
<!-- https://developer.chrome.com/origintrials/#/view_trial/-8087339030850568191 Multi-Screen Window Placement token for http://localhost:8000 -->
<meta http-equiv="origin-trial" content="AoRpcETf+l7boUzcNxv6NTZOBDX93NurmsoHO7MvKhXKn1HXzmAOoBIaRjHSeNiqHF8UXeYY8o/OXb8xwDNbLggAAABVeyJvcmlnaW4iOiJodHRwOi8vbG9jYWxob3N0OjgwMDAiLCJmZWF0dXJlIjoiV2luZG93UGxhY2VtZW50T1QyIiwiZXhwaXJ5IjoxNjM5NTI2Mzk5fQ==">
<!-- https://developer.chrome.com/origintrials/#/view_trial/-8087339030850568191 Multi-Screen Window Placement token for https://michaelwasserman.github.io -->
<meta http-equiv="origin-trial" content="AsHgze5gMTODb06oK5IUt1n14dM6STuL7EP7mnz4T3c5jrFjLKuISsQuhXrUdQ8jocPs9j35w7QhfafNBgab7wQAAABmeyJvcmlnaW4iOiJodHRwczovL21pY2hhZWx3YXNzZXJtYW4uZ2l0aHViLmlvOjQ0MyIsImZlYXR1cmUiOiJXaW5kb3dQbGFjZW1lbnRPVDIiLCJleHBpcnkiOjE2Mzk1MjYzOTl9">
</head>
<body>
<h3>Multi-Screen Window Placement Demo (<a href="https://github.com/michaelwasserman/window-placement-demo">GitHub</a>, <a href="https://www.chromestatus.com/feature/5252960583942144">ChromeStatus</a>)</h3>
<h4 id="warning" hidden=true style="color: red;"></h4>
<div class="controls">
<div style="display:flex; align-items:center;">
<button id="open-window">Open window</button>
URL: <input id="open-window-url" style="flex-grow:1;" value="./popup.html"></input>
left: <input id="open-window-left" style="width:50px;" size=5 value="100" type="number"></input>
top: <input id="open-window-top" style="width:50px;" size=5 value="50" type="number"></input>
width: <input id="open-window-width" style="width:50px;" size=5 value="830" type="number"></input>
height: <input id="open-window-height" style="width:50px;" size=5 value="750" type="number"></input>
<!-- Options: <input id="open-window-options" style="flex-grow:10;" value='{"x":"100", "y":"50", "width":"400", "height":"200", "type":"window"}'></input> -->
</div>
<button id="update-screens">Update screens</button>
<!-- <button id="open-windows">Open <input id="open-windows-count" style="width:20px;padding:0px;margin:0px" size=2 value="5" type="number" min=1 max=9></input> windows</button> -->
<!-- <button id="show-notification">Show notification</button> -->
<div class="dropdown">
<button id="toggle-fullscreen">Toggle fullscreen</button>
<div class="dropdown-content" hidden=true id="toggle-fullscreen-dropdown">
<button id="toggle-fullscreen-on-current-screen">Current screen</button>
<button id="toggle-fullscreen-get-screens">Get screens</button>
</div>
</div>
<div class="dropdown">
<button id="open-slide-and-notes-windows">Open slide & notes</button>
<div class="dropdown-content" hidden=true id="open-slide-and-notes-windows-dropdown">
<button id="open-slide-window">Slide window</button>
<button id="open-notes-window">Notes window</button>
</div>
</div>
<div class="dropdown">
<button id="fullscreen-slide">Fullscreen slide
<iframe id="slide" class="slide" src="./slide.html"></iframe>
</button>
<div class="dropdown-content" hidden=true id="fullscreen-slide-dropdown">
<button id="fullscreen-slide-on-current-screen">Current screen</button>
<button id="fullscreen-slide-get-screens">Get screens</button>
</div>
</div>
<div class="dropdown">
<button id="fullscreen-slide-and-open-notes-window">Fullscreen slide and open notes</button>
<div class="dropdown-content" hidden=true id="fullscreen-slide-and-open-notes-window-dropdown">
<button id="fullscreen-slide-and-open-notes-window-on-current-screen">Current screen</button>
<button id="fullscreen-slide-and-open-notes-window-get-screens">Get screens</button>
</div>
</div>
</div>
<p></p>
<canvas id="screens-canvas" 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-placement"></iframe>
<iframe src="https://permission.site" style="width:800; height:600;" allow="fullscreen;geolocation;window-placement"></iframe>
<iframe src="about:blank" style="width:800; height:600;" allow="window-placement none"></iframe>
-->
</body>
<script src="main.js"></script>
<script>
'use strict';
window.addEventListener('load', () => {
if ('serviceWorker' in navigator)
navigator.serviceWorker.register('./sw.js');
// Handle control button clicks and input events.
document.getElementById("open-window").addEventListener('click', openWindow);
// document.getElementById("open-windows").addEventListener('click', openWindows);
document.getElementById("update-screens").addEventListener('click', updateScreens);
// document.getElementById("show-notification").addEventListener('click', showNotification);
document.getElementById("toggle-fullscreen").addEventListener('click', toggleFullscreen);
document.getElementById("toggle-fullscreen-on-current-screen").addEventListener('click', toggleFullscreen);
document.getElementById("toggle-fullscreen-get-screens").addEventListener('click', updateScreens);
document.getElementById("open-slide-window").addEventListener('click', openSlideWindow);
document.getElementById("open-notes-window").addEventListener('click', openNotesWindow);
document.getElementById("open-slide-and-notes-windows").addEventListener('click', openSlideAndNotesWindows);
document.getElementById("fullscreen-slide").addEventListener('click', fullscreenSlide);
document.getElementById("fullscreen-slide-on-current-screen").addEventListener('click', fullscreenSlide);
document.getElementById("fullscreen-slide-get-screens").addEventListener('click', updateScreens);
document.getElementById("fullscreen-slide-and-open-notes-window").addEventListener('click', fullscreenSlideAndOpenNotesWindow);
document.getElementById("fullscreen-slide-and-open-notes-window-on-current-screen").addEventListener('click', fullscreenSlideAndOpenNotesWindow);
document.getElementById("fullscreen-slide-and-open-notes-window-get-screens").addEventListener('click', updateScreens);
});
</script>
</html>