-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
76 lines (70 loc) · 2.74 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
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<!-- <meta http-equiv="Cache-Control" content="no-siteapp" />-->
<meta name ="viewport" content ="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>Test Pocket</title>
<link rel="stylesheet" href="style/fonts/iconfont.css">
<link rel="stylesheet" href="style/main.css">
<script src="js/zepto.js"></script>
<script src="js/touch.js"></script>
<script src="js/datacontroller.js"></script>
<script src="js/viewcontroller.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div class="menu-bar">
<div id="main-menu" class="primary">
<div class="left-compo collapsed">
<a href="#" class="sub-toggle" data-target="#navigation"><i class="iconfont icon-list"></i></a>
</div>
<div class="page-title">
记账本
</div>
<div class="right-compo">
<a href="edit.html"><i class="iconfont icon-bianji"></i></a>
</div>
</div>
<div id="navigation" class="secondory collapsed clearfix">
<a class="active" href="#/list-view">账目列表</a>
<a href="statistics.html">账目统计</a>
<a href="#/graph-view">账目图表</a>
</div>
</div>
<div class="main-container">
</div>
<script>
$().ready(function() {
// initView
vController = new ViewController('.main-container');
var defaultContent = '<div class="jumbotron ">';
defaultContent += '<p>亲,你的账本还没有账目哦。<p></p>新建一个账目试试吧</p>';
defaultContent += '<a href="edit.html" class="btn btn-primary btn-lg" data-action="edit" data-id="new">新建账目</a>';
defaultContent += '</div>';
vController.setDefaultContent(defaultContent);
vController.updateView(vController.generateListView(pocketController.generateOutput()));
$(document).on('click', 'a', function(e) {
$anchor = $(this);
if ($anchor.hasClass("item-edit")) {
var id = $anchor.data('id');
window.location = "edit.html?id="+id;
} else if ($anchor.hasClass('item-delete')) {
var id = $anchor.data('id');
pocketController.deleteItemById(id);
vController.updateView(vController.generateListView(pocketController.generateOutput()));
}
});
// title bar
$('.sub-toggle').on('click', function(e) {
e.preventDefault();
var target = $($(this).data('target'));
target.toggleClass('collapsed');
});
});
</script>
</body>
</html>