From 88357b9564b0482c5a6092bf398882e306857223 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Wed, 4 Sep 2013 13:01:32 +0200 Subject: [PATCH] angular routing and views work, ni csp support yet --- src/ui/css/style.scss | 2 +- src/ui/index.html | 84 +++++----------------------------- src/ui/js/app.js | 8 ++++ src/ui/js/message-list-ctrl.js | 51 +++++++++++++++++++++ src/ui/tpl/message-list.html | 24 ++++++++++ 5 files changed, 95 insertions(+), 74 deletions(-) create mode 100644 src/ui/js/app.js create mode 100644 src/ui/js/message-list-ctrl.js create mode 100644 src/ui/tpl/message-list.html diff --git a/src/ui/css/style.scss b/src/ui/css/style.scss index 0cbb68b..b041a25 100644 --- a/src/ui/css/style.scss +++ b/src/ui/css/style.scss @@ -57,7 +57,7 @@ body { /* Landscape phone to portrait tablet */ @media (max-width: 767px) { - width: 100%; + width: inherit; } @mixin marked { diff --git a/src/ui/index.html b/src/ui/index.html index 1f3fe61..ba5ef4d 100755 --- a/src/ui/index.html +++ b/src/ui/index.html @@ -1,86 +1,24 @@ - + Whiteout Mail + + + + + + + + + -
-

- - - - - - Inbox -

-
-
- -
- - - - +
diff --git a/src/ui/js/app.js b/src/ui/js/app.js new file mode 100644 index 0000000..ba7b52d --- /dev/null +++ b/src/ui/js/app.js @@ -0,0 +1,8 @@ +'use strict'; + +angular.module('mail', ['ngRoute']).config(function($routeProvider) { + $routeProvider.when('/', { + templateUrl: 'tpl/message-list.html', + controller: MessageListCtrl, + }); +}); \ No newline at end of file diff --git a/src/ui/js/message-list-ctrl.js b/src/ui/js/message-list-ctrl.js new file mode 100644 index 0000000..c0b730a --- /dev/null +++ b/src/ui/js/message-list-ctrl.js @@ -0,0 +1,51 @@ +'use strict'; + +var loremText = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy."; + +var dummyMail1 = { + from: [{ + name: 'Whiteout Support', + address: 'support@whiteout.io' + }], // sender address + to: [{ + address: 'max.musterman@gmail.com' + }], // list of receivers + unread: true, + sentDate: '7:23 PM', + subject: "Welcome Max", // Subject line + body: loremText // plaintext body +}; +var dummyMail2 = { + from: [{ + name: 'Test User', + address: 'support@whiteout.io' + }], // sender address + to: [{ + address: 'max.musterman@gmail.com' + }], // list of receivers + unread: true, + sentDate: '7:23 PM', + subject: "Welcome Max", // Subject line + body: loremText // plaintext body +}; +var dummyMail3 = { + from: [{ + name: 'Test User', + address: 'support@whiteout.io' + }], // sender address + to: [{ + address: 'max.musterman@gmail.com' + }], // list of receivers + unread: false, + sentDate: '7:23 PM', + subject: "Welcome Max", // Subject line + body: loremText // plaintext body +}; + +function MessageListCtrl($scope) { + $scope.emails = [dummyMail1, dummyMail2, dummyMail3]; + + $scope.select = function(email) { + $scope.selected = email; + }; +} \ No newline at end of file diff --git a/src/ui/tpl/message-list.html b/src/ui/tpl/message-list.html new file mode 100644 index 0000000..c77b1ea --- /dev/null +++ b/src/ui/tpl/message-list.html @@ -0,0 +1,24 @@ +
+

+ + + + + + Inbox +

+
+ +
+ +
\ No newline at end of file