diff --git a/src/js/app.js b/src/js/app.js index 137e6d2..f353bea 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -5,11 +5,12 @@ require([ 'angular', 'js/controller/login', 'js/controller/mail-list', + 'js/controller/read', 'js/controller/write', 'js/controller/navigation', 'angularRoute', 'angularTouch' -], function(angular, LoginCtrl, MailListCtrl, WriteCtrl, NavigationCtrl) { +], function(angular, LoginCtrl, MailListCtrl, ReadCtrl, WriteCtrl, NavigationCtrl) { 'use strict'; var app = angular.module('mail', ['ngRoute', 'ngTouch', 'write', 'read']); @@ -34,6 +35,7 @@ require([ }); // inject controllers from ng-included view templates + app.controller('ReadCtrl', ReadCtrl); app.controller('MailListCtrl', MailListCtrl); // manually bootstrap angular due to require.js diff --git a/src/js/controller/navigation.js b/src/js/controller/navigation.js index b43e87e..a5a4882 100644 --- a/src/js/controller/navigation.js +++ b/src/js/controller/navigation.js @@ -1,8 +1,7 @@ define(function(require) { 'use strict'; - var angular = require('angular'), - folders = require('js/app-config').config.gmail.folders; + var folders = require('js/app-config').config.gmail.folders; var NavigationCtrl = function($scope) { $scope.navOpen = false; @@ -41,20 +40,5 @@ define(function(require) { }; }; - // - // Directives - // - - var ngModule = angular.module('read', []); - ngModule.directive('frameLoad', function() { - return function(scope, elm) { - var frame; - elm.bind('load', function() { - frame = elm[0]; - frame.height = frame.contentWindow.document.body.scrollHeight + 'px'; - }); - }; - }); - return NavigationCtrl; }); \ No newline at end of file diff --git a/src/js/controller/read.js b/src/js/controller/read.js new file mode 100644 index 0000000..3cf74eb --- /dev/null +++ b/src/js/controller/read.js @@ -0,0 +1,27 @@ +define(function(require) { + 'use strict'; + + var angular = require('angular'); + + // + // Controller + // + + var ReadCtrl = function() {}; + + // + // Directives + // + + var ngModule = angular.module('read', []); + ngModule.directive('frameLoad', function() { + return function(scope, elm) { + elm.bind('load', function() { + var frame = elm[0]; + frame.height = frame.contentWindow.document.body.scrollHeight + 'px'; + }); + }; + }); + + return ReadCtrl; +}); \ No newline at end of file diff --git a/src/js/controller/write.js b/src/js/controller/write.js index ce1b5ba..599ea70 100644 --- a/src/js/controller/write.js +++ b/src/js/controller/write.js @@ -36,9 +36,9 @@ define(function(require) { // remove generated html from body body = parseBody(body); - // Although this does encrypt live using AES, this is just for show. The plaintext is encrypted seperately using before sending the email. + // Although this does encrypt live using AES, this is just for show. The plaintext is encrypted seperately before sending the email. var plaintext = ($scope.subject) ? $scope.subject + body : body; - $scope.ciphertextPreview = aes.encrypt(plaintext, key, iv); + $scope.ciphertextPreview = (plaintext) ? aes.encrypt(plaintext, key, iv) : ''; }; $scope.sendEmail = function() { diff --git a/src/tpl/desktop.html b/src/tpl/desktop.html index 1234758..bee38e6 100644 --- a/src/tpl/desktop.html +++ b/src/tpl/desktop.html @@ -11,7 +11,7 @@
-
+