-
Notifications
You must be signed in to change notification settings - Fork 14
/
index.html
65 lines (63 loc) · 1.94 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>文案管理-demo</title>
<style>
.btn {
width: 60px;
height: 50px;
display: inline-block;
background: rgb(135, 208, 104);
color: #fff;
text-align: center;
vertical-align: middle;
line-height: 50px;
cursor: pointer;
box-shadow: 0 0 5px #ccc;
border-radius: 5px;
}
#language {
cursor: pointer;
}
</style>
</head>
<body>
<div id="root">
<button id="language" onclick="change()">English</button>
<div style="margin: 50px">
<span data-tip-id="demo-1" class="btn">按钮</span>
</div>
<p style="margin-left: 50px; color: #666">
<span data-tip-id="demo-2">tips是一个静态文案管理系统。用于修改Web端页面的静态文案,支持文案国际化,并提供提示信息的UI展示。</span>
</p>
<p style="margin: 50px; color: red">打开右下角开关可看到红色编辑按钮,点击红色编辑按钮,即可修改文案</p>
</div>
<script>
try {
if (window.Tips && Object.prototype.toString.call(window.Tips.init) === '[object Function]') {
window.Tips.init('admin', 'zh_CN');
} else {
document.addEventListener('TipsSDKReady', function() {
window.Tips.init('admin', 'zh_CN');
}, false);
}
} catch(e) {
console.log(e);
}
function change() {
var language;
var text = document.getElementById('language');
if (text.innerHTML === '中文') {
language = 'zh_CN';
text.innerHTML = 'English';
} else {
text.innerHTML = '中文';
language = 'en_US';
}
window.Tips.changeLanguage(language);
}
</script>
<script type="text/javascript" data-service="tips" src="./tips.js"></script>
</body>
</html>