summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
index 3d9d6d3..1448dee 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
@@ -145,204 +145,204 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, {
'toolsPanel': function () {
if (this._toolsPanel == null) {
this._toolsPanel = new Clipperz.PM.UI.Web.Components.ToolsPanel();
}
return this._toolsPanel;
},
//-----------------------------------------------------------------------------
'filterController': function () {
if (this._filterController == null) {
this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController();
}
return this._filterController;
},
'cardsController': function() {
if (this._cardsController == null) {
this._cardsController = new Clipperz.PM.UI.Web.Controllers.CardsController({'filterController':this._filterController});
}
return this._cardsController;
},
//-----------------------------------------------------------------------------
/*
'directLoginsController': function() {
//Clipperz.log(">>> AppController.directLoginsController");
if (this._directLoginsController == null) {
this._directLoginsController = new Clipperz.PM.UI.Web.Controllers.DirectLoginsController({'filterController':this._filterController});
}
//Clipperz.log("<<< AppController.directLoginsController");
return this._directLoginsController;
},
*/
//-----------------------------------------------------------------------------
'populateUserInfo': function() {
var deferredResult;
deferredResult = new Clipperz.Async.Deferred("AppController.populateUserInfo", {trace:false});
deferredResult.collectResults({
'username': MochiKit.Base.methodcaller('displayName'),
'cardsNumber': [
MochiKit.Base.methodcaller('getRecords'),
function (someResults) { return someResults.length; }
],
'directLoginsNumber': [
MochiKit.Base.methodcaller('getDirectLogins'),
function (someResults) { return someResults.length; }
]
})
deferredResult.addMethod(this.userInfoBox(), 'updateUserDetails');
deferredResult.callback(this.user());
return deferredResult;
},
//-----------------------------------------------------------------------------
'run': function(args) {
var deferredResult;
var slot;
var page;
var user;
slot = args.slot;
user = args.user;
this.setUser(user);
slot.setContent(this.appPage());
this.appPage().slotNamed('userInfoBox').setContent(this.userInfoBox());
this.appPage().slotNamed('tabSidePanel').setContent(this.tabSidePanel());
this.appPage().slotNamed('accountPanel').setContent(this.accountPanel());
this.appPage().slotNamed('dataPanel').setContent(this.dataPanel());
this.appPage().slotNamed('toolsPanel').setContent(this.toolsPanel());
this.hideAllAppPageTabSlots();
this.appPage().showSlot(this.slotNameForTab('cards'));
MochiKit.Signal.connect(this.tabSidePanel(), 'tabSelected', this, 'handleTabSelected');
MochiKit.Signal.connect(this.tabSidePanel(), 'addCard', this, 'handleAddCard');
MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'addCard', this, 'handleAddCard');
MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'downloadOfflineCopy', this, 'handleDownloadOfflineCopy');
deferredResult = new Clipperz.Async.Deferred("AppController.run", {trace:false});
deferredResult.addMethod(this.cardsController(), 'run', {slot:this.appPage().slotNamed('cardGrid'), user:user});
// deferredResult.addMethod(this.directLoginsController(), 'run', {slot:this.appPage().slotNamed('directLoginGrid'), user:user});
deferredResult.addMethod(this, 'populateUserInfo');
deferredResult.addCallback(MochiKit.Visual.ScrollTo, 'miscLinks', {duration:0});
deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN');
deferredResult.addMethod(this.tabSidePanel(), 'selectTab', 'cards');
deferredResult.callback();
},
//-----------------------------------------------------------------------------
'handleTabSelected': function (selectedTabName) {
var aTabName;
var aSlotName;
//Clipperz.log(">>> AppController.handleTabSelected", selectedTabName);
this.hideAllAppPageTabSlots();
this.appPage().showSlot(this.slotNameForTab(selectedTabName));
switch (selectedTabName) {
case 'cards':
this.cardsController().focus();
break;
// case 'directLogins':
// this.directLoginsController().focus();
// break;
case 'data':
break;
case 'account':
break;
case 'tools':
break;
}
//Clipperz.log("<-- AppController.handleTabSelected", aTabName);
},
//=============================================================================
'handleAddCard': function (aSourceElement) {
//Clipperz.log("=== AppController.addCard", aSourceElement);
this.cardsController().addCard(aSourceElement);
},
//=============================================================================
'userDataSuccessfullySavedHandler': function (anEvent) {
this.populateUserInfo();
},
//=============================================================================
'handleLogout': function(anEvent) {
var deferredResult;
deferredResult = new Clipperz.Async.Deferred("AppController.handleLogout", {trace:false});
deferredResult.addMethod(this.user(), 'logout');
deferredResult.addCallback(MochiKit.Signal.signal, this, 'logout');
deferredResult.callback();
return deferredResult;
},
//-----------------------------------------------------------------------------
'handleLock': function (anEvent) {
return Clipperz.Async.callbacks("AppController.handleLock", [
MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'),
MochiKit.Base.method(this.user(), 'lock')
], {trace:false});
},
//.............................................................................
'handleUnlock': function (anEvent) {
return Clipperz.Async.callbacks("AppController.handleUnock", [
MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'),
MochiKit.Base.method(this.user(), 'login'),
MochiKit.Base.method(this.cardsController(), 'focus'),
MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'),
MochiKit.Base.method(this.userInfoBox(), 'unlock')
], {trace:false});
},
'handleDownloadOfflineCopy': function (anEvent) {
var downloadHref;
downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl;
if (Clipperz_IEisBroken == true) {
window.open(downloadHref, "");
} else {
var deferredResult;
var newWindow;
newWindow = window.open("", "");
- deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true});
+ deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:false});
deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"});
deferredResult.addCallback(function(aWindow) {
aWindow.location.href = downloadHref;
}, newWindow);
deferredResult.callback();
}
},
//=============================================================================
__syntaxFix__: "syntax fix"
});