Repository navigation
Expand file tree
/
Copy pathsettings.html
More file actions
41 lines (40 loc) · 1.57 KB
/
Copy pathsettings.html
File metadata and controls
41 lines (40 loc) · 1.57 KB
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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
<link rel="shortcut icon" href="favicon.svg">
<link rel="icon" type="image/svg" href="favicon.svg" />
<link rel="apple-touch-icon" href="favicon.svg">
<link rel="stylesheet" type="text/css" media="screen" href="css/global.css" />
<title>Settings</title>
<script src="js/articles-storage.js"></script>
<script src="js/articles-backend.js"></script>
<script src="js/page.js"></script>
</head>
<body>
<header><div id="header"><a href="/">Tivizi 在线瞎掰</a></div></header>
<div id="container">
命名空间切换: <select id="namespace"></select>
</div>
<script type="text/javascript">
pages.loadtips()
articlesStorage.context().then(ctx => ctx.queryAllNamespaces().then( namespaces => {
namespaces.forEach( ns => {
let opt = document.createElement('option')
opt.value = ns
opt.text = ns
if (ns == ctx.namespace) {
opt.selected = true
}
document.querySelector('#namespace').add(opt)
})
})).finally( () => pages.closetips())
document.querySelector('#namespace').onchange = function() {
pages.loadtips()
articlesStorage.setNamespace(this.value).finally( () => pages.closetips())
}
</script>
</body>
</html>