Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js index 5b9d522..21ccf2a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
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 | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | 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 | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
30 | 27 | ||
31 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { | 28 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._openFromElement = args.openFromElement || null; | 33 | this._openFromElement = args.openFromElement || null; |
37 | this._onOkCloseToElement = args.onOkCloseToElement || null; | 34 | this._onOkCloseToElement = args.onOkCloseToElement || null; |
38 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; | 35 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; |
39 | 36 | ||
40 | this._progressBarComponent = null; | 37 | this._progressBarComponent = null; |
41 | 38 | ||
42 | return this; | 39 | return this; |
43 | } | 40 | } |
44 | 41 | ||
45 | //============================================================================= | 42 | //============================================================================= |
46 | 43 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { |
48 | 45 | ||
49 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
50 | 47 | ||
51 | 'toString': function () { | 48 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Web.Components.UnlockPasswordComponent component"; | 49 | return "Clipperz.PM.UI.Web.Components.UnlockPasswordComponent component"; |
53 | }, | 50 | }, |
54 | 51 | ||
55 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
56 | 53 | ||
57 | 'getPassphrase': function () { | 54 | 'getPassphrase': function () { |
58 | /* var deferredResult; | 55 | /* var deferredResult; |
59 | 56 | ||
60 | if (this.passphrase() == null) { | 57 | if (this.passphrase() == null) { |
61 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | 58 | this.deferredShowModal({'openFromElement': this.openFromElement()}); |
62 | deferredResult = this.deferred(); | 59 | deferredResult = this.deferred(); |
63 | } else { | 60 | } else { |
64 | deferredResult = MochiKit.Async.succeed(this.passphrase()); | 61 | deferredResult = MochiKit.Async.succeed(this.passphrase()); |
65 | } | 62 | } |
66 | 63 | ||
67 | return deferredResult; | 64 | return deferredResult; |
68 | */ | 65 | */ |
69 | 66 | ||
70 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | 67 | this.deferredShowModal({'openFromElement': this.openFromElement()}); |
71 | 68 | ||
72 | return this.deferred(); | 69 | return this.deferred(); |
73 | }, | 70 | }, |
74 | 71 | ||
75 | //------------------------------------------------------------------------- | 72 | //------------------------------------------------------------------------- |
76 | 73 | ||
77 | 'deferredShowModal': function (someParameters) { | 74 | 'deferredShowModal': function (someParameters) { |
78 | return Clipperz.Async.callbacks("UnlockPasswordComponent.deferredShowModal", [ | 75 | return Clipperz.Async.callbacks("UnlockPasswordComponent.deferredShowModal", [ |
79 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.deferredShowModal, this, someParameters), | 76 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.deferredShowModal, this, someParameters), |
80 | MochiKit.Base.method(this, 'getElement', 'passphrase'), | 77 | MochiKit.Base.method(this, 'getElement', 'passphrase'), |
81 | MochiKit.Base.methodcaller('focus') | 78 | MochiKit.Base.methodcaller('focus') |
82 | ], {trace:false}) | 79 | ], {trace:false}) |
83 | }, | 80 | }, |
84 | 81 | ||
85 | //------------------------------------------------------------------------- | 82 | //------------------------------------------------------------------------- |
86 | 83 | ||
87 | 'openFromElement': function () { | 84 | 'openFromElement': function () { |
88 | return this._openFromElement; | 85 | return this._openFromElement; |
89 | }, | 86 | }, |
90 | 87 | ||
91 | 'onOkCloseToElement': function () { | 88 | 'onOkCloseToElement': function () { |
92 | return this._onOkCloseToElement; | 89 | return this._onOkCloseToElement; |
93 | }, | 90 | }, |
94 | 91 | ||
95 | 'onCancelCloseToElement': function () { | 92 | 'onCancelCloseToElement': function () { |
96 | return this._onCancelCloseToElement; | 93 | return this._onCancelCloseToElement; |
97 | }, | 94 | }, |
98 | 95 | ||
99 | //------------------------------------------------------------------------- | 96 | //------------------------------------------------------------------------- |
100 | 97 | ||
101 | 'renderSelf': function() { | 98 | 'renderSelf': function() { |
102 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.renderSelf.apply(this, arguments); | 99 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.renderSelf.apply(this, arguments); |
103 | 100 | ||
104 | this.append(this.getElement('container'), {tag:'div', cls:'passphrase', children: [ | 101 | this.append(this.getElement('container'), {tag:'div', cls:'passphrase', children: [ |
105 | // {tag:'form', id:this.getId('passphraseForm'), children:[ | 102 | // {tag:'form', id:this.getId('passphraseForm'), children:[ |
106 | {tag:'input', id:this.getId('passphrase'), type:'password', name:'passphrase', value:''} | 103 | {tag:'input', id:this.getId('passphrase'), type:'password', name:'passphrase', value:''} |
107 | // ]} | 104 | // ]} |
108 | ]}); | 105 | ]}); |
109 | 106 | ||
110 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userSuccessfullyLoggedIn', this, 'userSuccessfullyLoggedInHandler'); | 107 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userSuccessfullyLoggedIn', this, 'userSuccessfullyLoggedInHandler'); |
111 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userLoginFailed', this, 'userLoginFailedHandler'); | 108 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userLoginFailed', this, 'userLoginFailedHandler'); |
112 | 109 | ||
113 | 110 | ||
114 | // MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('passphrase'), 'focus')); | 111 | // MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('passphrase'), 'focus')); |
115 | // this.getElement('passphrase').select(); | 112 | // this.getElement('passphrase').select(); |
116 | }, | 113 | }, |
117 | 114 | ||
118 | //------------------------------------------------------------------------- | 115 | //------------------------------------------------------------------------- |
119 | 116 | ||
120 | 'showProgressBar': function () { | 117 | 'showProgressBar': function () { |