diff --git a/frontend/delta/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js b/frontend/delta/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js index 8804f74..71b6fa4 100644 --- a/frontend/delta/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js +++ b/frontend/delta/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js @@ -275,6 +275,7 @@ Clipperz.PM.DataModel.EncryptedRemoteObject.prototype = MochiKit.Base.update(nul return innerDeferredResult; }, this))); + deferredResult.addErrbackPass(MochiKit.Base.method(this, 'deleteAllCleanTextData')); deferredResult.releaseLock(deferredLock); deferredResult.callback(); diff --git a/frontend/delta/js/Clipperz/PM/DataModel/User.js b/frontend/delta/js/Clipperz/PM/DataModel/User.js index 19c2698..7bb55e1 100644 --- a/frontend/delta/js/Clipperz/PM/DataModel/User.js +++ b/frontend/delta/js/Clipperz/PM/DataModel/User.js @@ -181,7 +181,7 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, { return this._getPassphraseFunction; }, - 'setPassphraseFunction': function(aFunction) { + 'setPassphraseFunction': function (aFunction) { this._getPassphraseFunction = aFunction; }, @@ -400,6 +400,11 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, { ], {trace:false}); }, + 'unlock': function (aPassphraseDelegate) { + this.setPassphraseFunction(aPassphraseDelegate); + return this.getPreferences(); // TODO: make this more explicit. + }, + //------------------------------------------------------------------------- 'logout': function () { diff --git a/frontend/delta/js/Clipperz/PM/UI/MainController.js b/frontend/delta/js/Clipperz/PM/UI/MainController.js index c6be7e2..a0e9532 100644 --- a/frontend/delta/js/Clipperz/PM/UI/MainController.js +++ b/frontend/delta/js/Clipperz/PM/UI/MainController.js @@ -422,15 +422,11 @@ Clipperz.log("THE BROWSER IS OFFLINE"); deferredResult = new Clipperz.Async.Deferred('MainController.unlock_handler', {trace:false}); deferredResult.addMethod(unlockPage, 'setProps', {'disabled': true}); - deferredResult.addMethod(user, 'setPassphraseFunction', function() { return MochiKit.Async.succeed(aPassphrase); }); - deferredResult.addMethod(user, 'getPreferences'); // #ASK -> user.unlock -// deferredResult.addMethod(user, 'unlock', function() { return MochiKit.Async.succeed(aPassphrase); }); + deferredResult.addMethod(user, 'unlock', function() { return MochiKit.Async.succeed(aPassphrase); }); deferredResult.addErrback(function (aValue) { var innerDeferredResult; innerDeferredResult = new Clipperz.Async.Deferred('MainController.unlock_handler ', {trace:false}); - innerDeferredResult.addMethod(user, 'getHeaderIndex', 'preferences'); - innerDeferredResult.addMethodcaller('deleteAllCleanTextData'); innerDeferredResult.addMethod(unlockPage, 'setProps', {'disabled': false}); innerDeferredResult.addMethod(unlockPage, 'setInitialFocus'); innerDeferredResult.addMethod(overlay, 'failed', "", 1); @@ -1195,6 +1191,7 @@ Clipperz.log("THE BROWSER IS OFFLINE"); extraProperties = { 'messageBox': this.messageBoxContent(), 'userInfo': this.userInfo(), +// 'preferences': ... 'accountInfo': this.userAccountInfo(), 'selectionPanelStatus': this.isSelectionPanelOpen() ? 'OPEN' : 'CLOSED', 'settingsPanelStatus': this.isSettingsPanelOpen() ? 'OPEN' : 'CLOSED', @@ -1494,7 +1491,7 @@ Clipperz.log("THE BROWSER IS OFFLINE"); MochiKit.Base.bind(function(somePreferences) { return MochiKit.Base.update(this.userInfo(), {'preferences': somePreferences}) }, this), - MochiKit.Base.bind(function(someUserInfo) { + MochiKit.Base.bind(function (someUserInfo) { this.pages()['mainPage'].setProps({ 'userInfo': someUserInfo }) @@ -1507,7 +1504,6 @@ Clipperz.log("THE BROWSER IS OFFLINE"); }, setPreference_handler: function(aKeyPath, aValue) { -console.log("MainController.setPrefence", aKeyPath, aValue); return Clipperz.Async.callbacks("MainController.setPreference_handler", [ MochiKit.Base.method(this.overlay(), 'show', "", true), MochiKit.Base.method(this.user(), 'setPreference', aKeyPath, aValue),