extensions wip

This commit is contained in:
Mo Bitar
2017-01-04 00:14:20 -06:00
parent 18a9726f89
commit 24ed04b46f
9 changed files with 422 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
angular.module('app.frontend')
.directive("header", function(apiController){
.directive("header", function(apiController, extensionManager){
return {
restrict: 'E',
scope: {
@@ -19,7 +19,9 @@ angular.module('app.frontend')
}
}
})
.controller('HeaderCtrl', function ($state, apiController, modelManager, serverSideValidation, $timeout) {
.controller('HeaderCtrl', function ($state, apiController, modelManager, serverSideValidation, $timeout, extensionManager) {
this.extensionManager = extensionManager;
this.changePasswordPressed = function() {
this.showNewPasswordForm = !this.showNewPasswordForm;
@@ -32,6 +34,25 @@ angular.module('app.frontend')
this.showNewPasswordForm = false;
}
this.toggleExtensions = function() {
this.showExtensionsMenu = !this.showExtensionsMenu;
}
this.toggleExtensionForm = function() {
this.newExtensionData = {};
this.showNewExtensionForm = !this.showNewExtensionForm;
}
this.submitNewExtensionForm = function() {
extensionManager.addExtension(this.newExtensionData.url)
}
this.selectedAction = function(action, extension) {
extensionManager.executeAction(action, extension, function(response){
apiController.sync(null);
})
}
this.changeServer = function() {
apiController.setServer(this.serverData.url, true);
}

View File

@@ -14,8 +14,6 @@ angular.module('app.frontend')
setInterval(function () {
apiController.sync(null);
}, 30000);
// apiController.verifyEncryptionStatusOfAllItems($scope.defaultUser, function(success){});
}
apiController.getCurrentUser(function(user){