Add comments for code regions in controllers

This commit is contained in:
Tankred Hase 2014-12-04 16:05:26 +01:00
parent eb4bc13e3f
commit 33b30221f7
6 changed files with 26 additions and 5 deletions

View File

@ -159,7 +159,6 @@ module.exports = function(grunt) {
'test/unit/util/dialog-test.js', 'test/unit/util/dialog-test.js',
'test/unit/util/connection-doctor-test.js', 'test/unit/util/connection-doctor-test.js',
'test/unit/util/update-handler-test.js', 'test/unit/util/update-handler-test.js',
'test/unit/util/backbutton-handler-test.js',
'test/unit/util/status-display-test.js', 'test/unit/util/status-display-test.js',
'test/unit/crypto/pgp-test.js', 'test/unit/crypto/pgp-test.js',
'test/unit/crypto/crypto-test.js', 'test/unit/crypto/crypto-test.js',

View File

@ -2,6 +2,10 @@
var AboutCtrl = function($scope, appConfig) { var AboutCtrl = function($scope, appConfig) {
//
// scope state
//
$scope.state.about = { $scope.state.about = {
toggle: function(to) { toggle: function(to) {
$scope.state.lightbox = (to) ? 'about' : undefined; $scope.state.lightbox = (to) ? 'about' : undefined;
@ -15,9 +19,6 @@ var AboutCtrl = function($scope, appConfig) {
$scope.version = appConfig.config.appVersion + ' (beta)'; $scope.version = appConfig.config.appVersion + ' (beta)';
$scope.date = new Date(); $scope.date = new Date();
//
// scope functions
//
}; };
module.exports = AboutCtrl; module.exports = AboutCtrl;

View File

@ -6,6 +6,10 @@ var AccountCtrl = function($scope, auth, keychain, pgp, appConfig, download, dia
return; return;
} }
//
// scope state
//
$scope.state.account = { $scope.state.account = {
toggle: function(to) { toggle: function(to) {
$scope.state.lightbox = (to) ? 'account' : undefined; $scope.state.lightbox = (to) ? 'account' : undefined;
@ -46,6 +50,7 @@ var AccountCtrl = function($scope, auth, keychain, pgp, appConfig, download, dia
}); });
}); });
}; };
}; };
module.exports = AccountCtrl; module.exports = AccountCtrl;

View File

@ -6,10 +6,13 @@
var ContactsCtrl = function($scope, keychain, pgp, dialog) { var ContactsCtrl = function($scope, keychain, pgp, dialog) {
//
// scope state
//
$scope.state.contacts = { $scope.state.contacts = {
toggle: function(to) { toggle: function(to) {
$scope.state.lightbox = (to) ? 'contacts' : undefined; $scope.state.lightbox = (to) ? 'contacts' : undefined;
$scope.listKeys(); $scope.listKeys();
} }
}; };
@ -93,6 +96,7 @@ var ContactsCtrl = function($scope, keychain, pgp, dialog) {
$scope.listKeys(); $scope.listKeys();
}); });
}; };
}; };
// //

View File

@ -2,6 +2,10 @@
var DialogCtrl = function($scope, dialog) { var DialogCtrl = function($scope, dialog) {
//
// scope state
//
$scope.state.dialog = { $scope.state.dialog = {
open: false open: false
}; };

View File

@ -4,6 +4,10 @@ var util = require('crypto-lib').util;
var PrivateKeyUploadCtrl = function($scope, keychain, pgp, dialog, auth) { var PrivateKeyUploadCtrl = function($scope, keychain, pgp, dialog, auth) {
//
// scope state
//
$scope.state.privateKeyUpload = { $scope.state.privateKeyUpload = {
toggle: function(to) { toggle: function(to) {
// open lightbox // open lightbox
@ -33,6 +37,10 @@ var PrivateKeyUploadCtrl = function($scope, keychain, pgp, dialog, auth) {
} }
}; };
//
// scope functions
//
$scope.checkServerForKey = function(callback) { $scope.checkServerForKey = function(callback) {
var keyParams = pgp.getKeyParams(); var keyParams = pgp.getKeyParams();
keychain.hasPrivateKey({ keychain.hasPrivateKey({