angularjs mobile v0.1

This commit is contained in:
life committed 2014-05-14 22:23:35 +08:00
1 parent 88ad35e9be
commit ab5e5c7b76
103 files changed
+12466 -9

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ func (c Mobile) Index() revel.Result {
c.RenderArgs["sharedUserInfos"] = c.Json(sharedUserInfos)
c.RenderArgs["tagsJson"] = c.Json(tagService.GetTags(c.GetUserId()))
return c.RenderTemplate("mobile/index.html");
return c.RenderTemplate("mobile/angular.html");
}
func (c Mobile) Logout() revel.Result {
+5
View File
@@ -85,6 +85,11 @@ func (c Note) ListTrashNotes() revel.Result {
return c.RenderJson(notes)
}
// 得到note和内容
func (c Note) GetNoteAndContent(noteId string) revel.Result {
return c.RenderJson(noteService.GetNoteAndContent(noteId, c.GetUserId()))
}
// 得到内容
func (c Note) GetNoteContent(noteId string) revel.Result {
noteContent := noteService.GetNoteContent(noteId, c.GetUserId())
+1 -6
View File
@@ -13,17 +13,12 @@ type Notebook struct {
BaseController
}
// 得到笔记本
// 该用户下的
func (c Notebook) GetNotebooks() {
}
func (c Notebook) Index(notebook info.Notebook, i int, name string) revel.Result {
return c.RenderJson(notebook)
}
// 得到用户的所有笔记本
func (c Notebook) getNotebooks() revel.Result {
func (c Notebook) GetNotebooks() revel.Result {
re := notebookService.GetNotebooks(c.GetUserId())
return c.RenderJson(re)
}
+7
View File
@@ -31,6 +31,13 @@ func (this *NoteService) GetNoteContent(noteContentId, userId string) (noteConte
return
}
// 得到笔记和内容
func (this *NoteService) GetNoteAndContent(noteId, userId string) (noteAndContent info.NoteAndContent) {
note := this.GetNote(noteId, userId)
noteContent := this.GetNoteContent(noteId, userId)
return info.NoteAndContent{note, noteContent}
}
// 列出note, 排序规则, 还有分页
// CreatedTime, UpdatedTime, title 来排序
func (this *NoteService) ListNotes(userId, notebookId string,
+50
View File
@@ -0,0 +1,50 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="/public/mobile2/topcoat/css/topcoat-mobile-light.min.css" rel="stylesheet">
<link href="/public/mobile2/css/styles.css" rel="stylesheet">
<link href="/public/css/font-awesome-4.0.3/css/font-awesome.css" rel="stylesheet">
</head>
<body ng-controller="MainCtrl">
<div id="sidebar" class="page-sidebar">
<h1>leanote</h1>
<ul id="nav">
<li ng-click="go('/notes/all')"><a>[[msg.all]]</a></li>
<li ng-click="go('/notebooks')"><a>[[msg.notebook]]</a></li>
<li><a href="#">[[msg.tag]]</a></li>
</ul>
<footer>
<a href="/mobile/logout">[[msg.logout]]</a>
</footer>
</div>
<div id="content" class="page-content">
<div ng-view ng-class="slide" >
</div>
</div>
<script src="/js/jquery-1.9.0.min.js"></script>
<script src="/js/i18n/msg.{{.locale}}.js"></script>
<script src="/js/common.js"></script>
<script src="/public/mobile2/lib/angular.js"></script>
<script src="/public/mobile2/lib/angular-touch.js"></script>
<script src="/public/mobile2/lib/angular-resource.js"></script>
<script src="/public/mobile2/lib/angular-animate.js"></script>
<script src="/public/mobile2/lib/angular-route.js"></script>
<script src="/public/mobile2/js/app.js"></script>
<script src="/public/mobile2/js/controllers.js"></script>
<script src="/public/mobile2/js/memory-services.js"></script>
<script src="/public/mobile2/js/snap.js"></script>
<script src="/public/mobile2/js/page.js"></script>
<script>
angular.element(document).ready(function() {
angular.bootstrap(document, ['myApp']);
});
</script>
</body>
</html>
+1 -1
View File
@@ -61,7 +61,7 @@ function log(o) {
</div>
</div>
<div id="content" class="page-content" style="position: absolute;background-color: #fff;width: 100%;">
<div id="content" class="page-content" style="position: absolute; background-color: #fff;width: 100%;">
<!-- notebooks -->
<div id="notebooks">
<!-- 头部 -->