forked from mozilla-b2g/gaia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (89 loc) · 2.53 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
95
96
97
98
99
<!doctype html>
<html>
<head>
<style>
html, body {
overflow-y: hidden;
background-color: black;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
#chrome {
height: 800px;
width: 480px;
border-radius: 20px;
border: 1px solid grey;
background-color: #272727;
padding: 30px 15px 0;
margin: auto;
margin-top: 10px;
box-shadow: 0px 0px 8px white;
}
#chrome-controls {
margin-top: 12px;
padding: 0;
}
#chrome-controls .button {
display: inline-table;
margin: 0;
padding: 0;
width: 31%;
height: 64px;
line-height: 64px;
text-align: center;
color: white;
font-weight: 600;
border: 2px solid black;
border-radius: 5px;
background-image: -moz-linear-gradient(bottom, rgb(16,16,16) 54%, rgb(13,13,13) 84%, rgb(27,27,27));
-moz-user-select: none;
}
#chrome-controls .button:hover:active {
background-image: -moz-linear-gradient(top, rgb(16,16,16) 54%, rgb(13,13,13) 84%, rgb(27,27,27));
}
#content {
height: -moz-calc(800px - 118px);
width: 480px;
border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 5px;
}
</style>
<script>
window.addEventListener('load', function onload(e) {
if (document.location.protocol === 'file:') {
var paths = document.location.pathname.split('/');
paths.pop();
var src = 'file://' + paths.join('/') + '/apps/system/index.html';
} else {
var host = document.location.host;
var domain = host.replace(/(^[\w\d]+\.)?([\w\d]+\.[a-z]+)/, '$2');
var src = 'http://system.' + domain;
}
document.getElementById('content').src = src;
});
/* Simulate the HOME button */
window.addEventListener('load', function() {
var home = document.querySelector('#chrome-home');
home.addEventListener('click', function() {
var content = document.querySelector('#content');
content.contentWindow.WindowManager.closeForegroundWindow();
}, true);
}, true);
</script>
</head>
<body>
<div id="chrome">
<iframe id="content">
</iframe>
<div id="chrome-controls">
<center>
<span id="chrome-home" class="button">
Home
</span>
</center>
</div>
</div>
</body>
</html>