-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.html
175 lines (175 loc) · 5.34 KB
/
default.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<html>
<head>
<style id="default">
iframe {
width: 100%;
height: 100%;
}
.sidebar {
margin: 0;
padding: 0;
width: 200px;
position: fixed;
height: 100%;
overflow: auto;
} /* Sidebar links */
.sidebar a {
display: block;
padding: 16px;
text-decoration: none;
-webkit-transition: color 0.2s ease-in-out;
-moz-transition: color 0.2s ease-in-out;
-ms-transition: color 0.2s ease-in-out;
-o-transition: color 0.2s ease-in-out;
transition: color 0.2s ease-in-out;
-webkit-transition: background-color 0.2s ease-in-out;
-moz-transition: background-color 0.2s ease-in-out;
-ms-transition: background-color 0.2s ease-in-out;
-o-transition: background-color 0.2s ease-in-out;
transition: background-color 0.2s ease-in-out;
} /* Page content. The value of the margin-left property should match the value of the sidebar's width property */
div.content {
margin-left: 200px;
padding: 1px 16px;
height: 1000px;
} /* On screens that are less than 700px wide, make the sidebar into a topbar */
@media all and (orientation: portrait) {
.sidebar {
width: 100%;
height: auto;
position: relative;
}
.sidebar a {
float: left;
}
div.content {
margin-left: 0;
}
} /* On screens that are less than 400px, display the bar vertically, instead of horizontally */
@media screen and (max-width: 400px) {
.sidebar a {
text-align: center;
float: none;
}
}
.ql-align-center {
text-align: center;
}
.ql-align-justify {
text-align: justify;
}
.ql-align-right {
text-align: right;
}
div {
-webkit-transition: opacity 0.5s ease-in-out;
-moz-transition: opacity 0.5s ease-in-out;
-ms-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
</style>
<style id="colors">
.sidebar {
background-color: #f1f1f1;
}
.sidebar a {
color: #000000;
}
.sidebar a.active {
background-color: #4caf50;
color: #ffffff;
}
.sidebar a:hover:not(.active) {
background-color: #555;
color: #ffffff;
}
body {
background-color: #faebd7;
}
</style>
<script>
window.onhashchange = function() {
getPage(window.location.hash.replace("#/", ""));
};
fetch("http://localhost:80/navigation").then(async (result) => {
document.getElementById("menu").innerHTML = await result.text();
if (window.location.hash != "") {
getPage(window.location.hash.replace("#/", ""));
}
});
fetch("http://localhost:80/logo").then(async (result) => {
document.getElementById("menu").innerHTML =
(await result.text()) + document.getElementById("menu").innerHTML;
});
fetch("http://localhost:80/siteName").then(
async (result) => (document.title = await result.text())
);
function getPage(name) {
document.getElementById("main").style.opacity = 0;
attrs = name.split("_");
document.title =
document.title.substring(
0,
document.title.indexOf(":") > -1
? document.title.indexOf(":")
: document.title.length
) +
": " +
attrs[2];
let otherEls = document.getElementById("menu").childNodes;
for (const e of otherEls) {
e.classList.remove("active");
}
let element = document.getElementById(name);
element.classList.add("active");
fetch(
"http://localhost:80/getPage/" +
attrs[0] +
"/" +
attrs[1] +
"/" +
attrs[2]
).then(async (result) => {
setTimeout(async function() {
document.getElementById("main").innerHTML = await result.text();
document.getElementById("main").style.opacity = 1;
}, 500);
});
}
function getVue(name) {
document.getElementById("main").style.opacity = 0;
document.title =
document.title.substring(
0,
document.title.indexOf(":") > -1
? document.title.indexOf(":")
: document.title.length
) +
": " +
name;
let otherEls = document.getElementById("menu").childNodes;
for (const e of otherEls) {
e.classList.remove("active");
}
let element = document.getElementById(name);
element.classList.add("active");
//window.location = "http://localhost:80/vue/#/" + name;
setTimeout(async function() {
document.getElementById("main").innerHTML =
'<iframe src="' +
"http://localhost:80/vue/#/" +
name +
'" frameBorder="0"></iframe>';
document.getElementById("main").style.opacity = 1;
}, 500);
}
</script>
</head>
<body>
<div>
<div id="menu" class="sidebar"></div>
<div id="main" class="content"></div>
</div>
</body>
</html>