Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js | 148 |
1 files changed, 148 insertions, 0 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 new file mode 100644 index 0000000..4378b19 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | ||
11 | refer to http://www.clipperz.com | ||
12 | |||
13 | * Javascript Crypto Library is free software: you can redistribute | ||
14 | it and/or modify it under the terms of the GNU Affero General Public | ||
15 | License as published by the Free Software Foundation, either version | ||
16 | 3 of the License, or (at your option) any later version. | ||
17 | |||
18 | * Javascript Crypto Library is distributed in the hope that it will | ||
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
21 | See the GNU Affero General Public License for more details. | ||
22 | |||
23 | * You should have received a copy of the GNU Affero General Public | ||
24 | License along with Javascript Crypto Library. If not, see | ||
25 | <http://www.gnu.org/licenses/>. | ||
26 | |||
27 | */ | ||
28 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | //this._initiallySelectedTab = args.selected || 'ACCOUNT'; | ||
37 | this._initiallySelectedTab = args.selected || 'PASSPHRASE'; | ||
38 | this._tabPanelControllerConfiguration = { | ||
39 | // 'ACCOUNT': { | ||
40 | // tab:'accountTab', | ||
41 | // panel:'accountPanel' | ||
42 | // }, | ||
43 | 'PASSPHRASE': { | ||
44 | tab:'passphraseTab', | ||
45 | panel:'passphrasePanel' | ||
46 | }, | ||
47 | 'PREFERENCES': { | ||
48 | tab:'preferencesTab', | ||
49 | panel:'preferencesPanel' | ||
50 | }, | ||
51 | 'LOGIN_HISTORY': { | ||
52 | tab:'loginHistoryTab', | ||
53 | panel:'loginHistoryPanel' | ||
54 | } | ||
55 | }; | ||
56 | |||
57 | return this; | ||
58 | } | ||
59 | |||
60 | //============================================================================= | ||
61 | |||
62 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | ||
63 | |||
64 | //------------------------------------------------------------------------- | ||
65 | |||
66 | 'toString': function () { | ||
67 | return "Clipperz.PM.UI.Web.Components.AccountPanel component"; | ||
68 | }, | ||
69 | |||
70 | //------------------------------------------------------------------------- | ||
71 | |||
72 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
73 | //Clipperz.log("AccountPanel.renderSelf element", this.element()); | ||
74 | this.append(this.element(), [ | ||
75 | {tag:'div', cls:'header', children:[ | ||
76 | {tag:'div', cls:'subPanelTabs', children:[ | ||
77 | {tag:'ul', children:[ | ||
78 | // {tag:'li', id:this.getId('accountTab'), children:[{tag:'a', href:'#', html:'Account'}], cls:'first'}, | ||
79 | {tag:'li', id:this.getId('passphraseTab'), children:[{tag:'a', href:'#', html:'Passphrase'}], cls:'first'}, | ||
80 | {tag:'li', id:this.getId('preferencesTab'), children:[{tag:'a', href:'#', html:'Preferences'}]}, | ||
81 | {tag:'li', id:this.getId('loginHistoryTab'),children:[{tag:'a', href:'#', html:'Login history'}]} | ||
82 | ]} | ||
83 | ]} | ||
84 | ]}, | ||
85 | {tag:'div', cls:'body', children:[ | ||
86 | {tag:'div', cls:'accountPanel', children:[ | ||
87 | {tag:'div', cls:'subPanelContent', children:[ | ||
88 | {tag:'ul', children:[ | ||
89 | // {tag:'li', id:this.getId('accountPanel'),children:[ | ||
90 | // {tag:'h3', html:"-- Account --"} | ||
91 | // ]}, | ||
92 | {tag:'li', id:this.getId('passphrasePanel'),children:[ | ||
93 | {tag:'h3', cls:'changePassphrase', html:"Change passphrase"}, | ||
94 | {tag:'form', id:this.getId('changePassphrase'), cls:'changePassphrase', children:[ | ||
95 | {tag:'div', cls:'currentCredentials', children:[ | ||
96 | {tag:'div', cls:'field username', children:[ | ||
97 | {tag:'label', html:"username", 'for':this.getId('currentUsername')}, | ||
98 | {tag:'input', id:this.getId('currentUsername')} | ||
99 | ]}, | ||
100 | {tag:'div', cls:'field passphrase', children:[ | ||
101 | {tag:'label', html:"passphrase", 'for':this.getId('currentPassphrase')}, | ||
102 | {tag:'input', id:this.getId('currentPassphrase')} | ||
103 | ]} | ||
104 | ]}, | ||
105 | {tag:'div', cls:'newPassphrase', children:[ | ||
106 | {tag:'div', cls:'field', children:[ | ||
107 | {tag:'label', html:"new passphrase", 'for':this.getId('newPassphrase')}, | ||
108 | {tag:'input', id:this.getId('newPassphrase')} | ||
109 | ]}, | ||
110 | {tag:'div', cls:'field', children:[ | ||
111 | {tag:'label', html:"re-new passphrase", 'for':this.getId('reNewPassphrase')}, | ||
112 | {tag:'input', id:this.getId('reNewPassphrase')} | ||
113 | ]} | ||
114 | ]}, | ||
115 | {tag:'div', cls:'confirm', children:[ | ||
116 | {tag:'input', type:'checkbox', id:this.getId('confirm')}, | ||
117 | {tag:'label', html:"I understand that Clipperz will not be able to recover a lost passphrase", 'for':this.getId('confirm')} | ||
118 | ]} | ||
119 | ]}, | ||
120 | {tag:'div', cls:'clear'}, | ||
121 | {tag:'div', cls:'confirmButton', id:this.getId('confirmationButton'), children:[ | ||
122 | {tag:'span', html:"change passphrase"} | ||
123 | ]}, | ||
124 | |||
125 | {tag:'h3', cls:'manageOTP', html:"Manage One-Time Passphrases"}, | ||
126 | {} | ||
127 | ]}, | ||
128 | {tag:'li', id:this.getId('preferencesPanel'), children:[ | ||
129 | {tag:'h3', html:"-- Preferences --"} | ||
130 | ]}, | ||
131 | {tag:'li', id:this.getId('loginHistoryPanel'), children:[ | ||
132 | {tag:'h3', html:"-- Login History --"} | ||
133 | ]} | ||
134 | ]} | ||
135 | ]} | ||
136 | ]} | ||
137 | ]}, | ||
138 | {tag:'div', cls:'footer'} | ||
139 | ]); | ||
140 | |||
141 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); | ||
142 | }, | ||
143 | |||
144 | //------------------------------------------------------------------------- | ||
145 | |||
146 | |||
147 | __syntaxFix__: "syntax fix" | ||
148 | }); | ||