Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web') (more/less context) (ignore whitespace changes)
5 files changed, 65 insertions, 23 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js index ee6d7a3..d6b0574 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js @@ -43,2 +43,6 @@ Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { }, + 'OTP': { + tab: 'OTPTab', + panel: 'OTPPanel' + }, 'PREFERENCES': { @@ -76,2 +80,3 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI. {tag:'li', id:this.getId('passphraseTab'), children:[{tag:'a', href:'#', html:'Passphrase'}], cls:'first'}, + {tag:'li', id:this.getId('OTPTab'), children:[{tag:'a', href:'#', html:'One Time Passwords'}]}, {tag:'li', id:this.getId('preferencesTab'), children:[{tag:'a', href:'#', html:'Preferences'}]}, @@ -119,12 +124,12 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI. {tag:'span', html:"change passphrase"} - ]}, - - {tag:'h3', cls:'manageOTP', html:"Manage One-Time Passphrases"}, - {} + ]} + ]}, + {tag:'li', id:this.getId('OTPPanel'), children:[ +// {tag:'h3', html:"Manage One-Time Passphrases"} ]}, {tag:'li', id:this.getId('preferencesPanel'), children:[ - {tag:'h3', html:"-- Preferences --"} +// {tag:'h3', html:"-- Preferences --"} ]}, {tag:'li', id:this.getId('loginHistoryPanel'), children:[ - {tag:'h3', html:"-- Login History --"} +// {tag:'h3', html:"-- Login History --"} ]} diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js index d2f1045..462d864 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js @@ -84,12 +84,14 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DataPanel, Clipperz.PM.UI.Com {tag:'li', id:this.getId('offlineCopyPanel'), children:[ - {tag:'h3', html:"Offline copy"} +// {tag:'h3', html:"Offline copy"}, + {tag:'p', html:"With just one click you can dump all your encrypted data from Clipperz servers to your hard disk and create a read-only offline version of Clipperz to be used when you are not connected to the Internet."}, + {tag:'a', id:this.getId('offlineCopyDownloadLink'), href:'#', html:"Download", cls:'downloadOfflineCopy'} ]}, {tag:'li', id:this.getId('sharingPanel'), children:[ - {tag:'h3', html:"Sharing"} +// {tag:'h3', html:"Sharing"} ]}, {tag:'li', id:this.getId('importPanel'), children:[ - {tag:'h3', html:"Import"} +// {tag:'h3', html:"Import"} ]}, {tag:'li', id:this.getId('exportPanel'), children:[ - {tag:'h3', html:"Export"} +// {tag:'h3', html:"Export"} ]} @@ -103,4 +105,10 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DataPanel, Clipperz.PM.UI.Com this.tabPanelController().setup({selected:this.initiallySelectedTab()}); + MochiKit.Signal.connect(this.getId('offlineCopyDownloadLink'), 'onclick', this, 'downloadOfflineCopy'); }, - + + 'downloadOfflineCopy': function (anEvent) { + anEvent.preventDefault(); + MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'downloadOfflineCopy', anEvent.src()); + }, + //------------------------------------------------------------------------- diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js index 5d082b5..26506e7 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js @@ -84,5 +84,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[ - {tag:'div', cls:'button', id:this.getId('button'), children:[ - {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} - ]} +// {tag:'div', cls:'button', id:this.getId('button'), children:[ +// {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} +// ]} + {tag:'a', cls:'button', id:this.getId('button'), html:"cancel"} ]} @@ -97,3 +98,4 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI - MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler'); +// MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler'); + MochiKit.Signal.connect(this.getId('button'), 'onclick', this, 'cancelEventHandler'); }, @@ -123,3 +125,5 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI 'showErrorMessage': function() { - this.getElement('buttonLink').innerHTML = "close"; +// this.getElement('buttonLink').innerHTML = "close"; + this.getElement('button').innerHTML = "close"; + MochiKit.DOM.addElementClass(this.getElement('button'), 'default'); diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js index 3ee6189..0fa369f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js @@ -84,12 +84,12 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ToolsPanel, Clipperz.PM.UI.Co {tag:'li', id:this.getId('passwordGeneratorPanel'), children:[ - {tag:'h3', html:"Password generator"} +// {tag:'h3', html:"Password generator"} ]}, {tag:'li', id:this.getId('bookmarkletPanel'), children:[ - {tag:'h3', html:"Bookmarklet"} +// {tag:'h3', html:"Bookmarklet"} ]}, {tag:'li', id:this.getId('compactEditionPanel'), children:[ - {tag:'h3', html:"Compact edition"} +// {tag:'h3', html:"Compact edition"} ]}, {tag:'li', id:this.getId('httpAuthPanel'), children:[ - {tag:'h3', html:"HTTP Auth"} +// {tag:'h3', html:"HTTP Auth"} ]} 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 9a0e744..1ab2e69 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js @@ -233,5 +233,7 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { - 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(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'); @@ -323,2 +325,25 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { + 'handleDownloadOfflineCopy': function (anEvent) { +console.log("AppController.handleDownloadOfflineCopy"); + 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.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); + deferredResult.addCallback(function(aWindow) { + aWindow.location.href = downloadHref; + }, newWindow); + deferredResult.callback(); + } + }, + //============================================================================= |