-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
110 lines (95 loc) · 3.06 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
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="css/header.css" /> />
<script type="text/javascript" charset="utf-8">
mui.init();
mui.plusReady(function() {
plus.navigator.setStatusBarStyle("light");
plus.navigator.setStatusBarBackground("#e69138");
})
</script>
</head>
<body>
<header class="mui-bar mui-bar-nav title">
<h1 class="mui-title title-color"><b>LetsChat</b></h1>
</header>
<nav class="mui-bar mui-bar-tab">
<a class="mui-tab-item mui-active" tabindex="0">
<span class="mui-icon mui-icon-chat"></span>
<span class="mui-tab-label">Messages</span>
</a>
<a class="mui-tab-item" tabindex="1">
<span class="mui-icon mui-icon-contact"></span>
<span class="mui-tab-label">Contacts</span>
</a>
<a class="mui-tab-item" tabindex="2">
<span class="mui-icon mui-icon-pengyouquan"></span>
<span class="mui-tab-label">Discover</span>
</a>
<a class="mui-tab-item" tabindex="3">
<span class="mui-icon mui-icon-person"></span>
<span class="mui-tab-label">Me</span>
</a>
</nav>
<script type="text/javascript">
var projectArray = [
{
pageId: "letschat-chatlist.html",
pageUrl: "letschat-chatlist.html",
},
{
pageId: "letschat-contact.html",
pageUrl: "letschat-contact.html",
},
{
pageId: "letschat-discover.html",
pageUrl: "letschat-discover.html",
},
{
pageId: "letschat-me.html",
pageUrl: "letschat-me.html",
}
];
var pageStyle = {
top: "44px",
bottom: "50px"
}
mui.plusReady(function() {
mui.back = function() {
return false;
}
// Get current webview object.
var indexWebview = plus.webview.currentWebview()
// Append webview objects.
for (var i = 0; i < projectArray.length; i++) {
var projectPage = plus.webview.create(projectArray[i].pageUrl,
projectArray[i].pageId,
pageStyle);
projectPage.hide();
indexWebview.append(projectPage);
}
plus.webview.show(projectArray[0].pageId);
// Bind tap events to show different views.
mui(".mui-bar-tab").on("tap", "a", function(){
var tabindex = this.getAttribute("tabindex");
// Show the page that corresponds to the tab clicked by the current user.
plus.webview.show(projectArray[tabindex].pageId, "fade-in", 200);
// Hide all other pages.
for (var i = 0; i < projectArray.length; i++) {
if (i != tabindex) {
plus.webview.hide(projectArray[i].pageId, "page-out", 200);
}
}
})
var myfaceView = plus.webview.getWebviewById("letschat-chatlist.html");
mui.fire(myfaceView, "refresh");
})
</script>
</body>
</html>