Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js index f26118e..d699dc6 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.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.UserInfoBox = function(args) { | 28 | Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) { |
32 | args = args || {}; | 29 | args = args || {}; |
33 | 30 | ||
34 | Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); |
35 | 32 | ||
36 | this._slots = {}; | 33 | this._slots = {}; |
37 | this._isLocked = false; | 34 | this._isLocked = false; |
38 | this._lockTooltip = null; | 35 | this._lockTooltip = null; |
39 | 36 | ||
40 | return this; | 37 | return this; |
41 | } | 38 | } |
42 | 39 | ||
43 | //============================================================================= | 40 | //============================================================================= |
44 | 41 | ||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { |
46 | 43 | ||
47 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
48 | 45 | ||
49 | 'toString': function () { | 46 | 'toString': function () { |
50 | return "Clipperz.PM.UI.Web.Components.UserInfoBox component"; | 47 | return "Clipperz.PM.UI.Web.Components.UserInfoBox component"; |
51 | }, | 48 | }, |
52 | 49 | ||
53 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
54 | 51 | ||
55 | 'handleLogout': function(anEvent) { | 52 | 'handleLogout': function(anEvent) { |
56 | //Clipperz.log(">>> UserInfoBox.handleLogout"); | 53 | //Clipperz.log(">>> UserInfoBox.handleLogout"); |
57 | anEvent.preventDefault(); | 54 | anEvent.preventDefault(); |
58 | MochiKit.Signal.signal(this, 'logout'); | 55 | MochiKit.Signal.signal(this, 'logout'); |
59 | //Clipperz.log("<<< UserInfoBox.handleLogout"); | 56 | //Clipperz.log("<<< UserInfoBox.handleLogout"); |
60 | }, | 57 | }, |
61 | 58 | ||
62 | //------------------------------------------------------------------------- | 59 | //------------------------------------------------------------------------- |
63 | 60 | ||
64 | 'lockTooltip': function () { | 61 | 'lockTooltip': function () { |
65 | return this._lockTooltip; | 62 | return this._lockTooltip; |
66 | }, | 63 | }, |
67 | 64 | ||
68 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
69 | 66 | ||
70 | 'isLocked': function () { | 67 | 'isLocked': function () { |
71 | return this._isLocked; | 68 | return this._isLocked; |
72 | }, | 69 | }, |
73 | 70 | ||
74 | 'setIsLocked': function (aValue) { | 71 | 'setIsLocked': function (aValue) { |
75 | this._isLocked = aValue; | 72 | this._isLocked = aValue; |
76 | }, | 73 | }, |
77 | 74 | ||
78 | 'toggleLock': function(anEvent) { | 75 | 'toggleLock': function(anEvent) { |
79 | var deferredResult; | 76 | var deferredResult; |
80 | var shouldLock; | 77 | var shouldLock; |
81 | 78 | ||
82 | //console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]"); | 79 | //console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]"); |
83 | anEvent.preventDefault(); | 80 | anEvent.preventDefault(); |
84 | this.lockTooltip().hide(); | 81 | this.lockTooltip().hide(); |
85 | 82 | ||
86 | shouldLock = (this.isLocked() == false); | 83 | shouldLock = (this.isLocked() == false); |
87 | 84 | ||
88 | if (shouldLock) { | 85 | if (shouldLock) { |
89 | var maskElement; | 86 | var maskElement; |
90 | 87 | ||
91 | this.setIsLocked(true); | 88 | this.setIsLocked(true); |
92 | maskElement = this.getId('modalDialogMask'); | 89 | maskElement = this.getId('modalDialogMask'); |
93 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ | 90 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ |
94 | MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), | 91 | MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), |
95 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), | 92 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), |
96 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), | 93 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), |
97 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') | 94 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') |
98 | ], {trace:false}); | 95 | ], {trace:false}); |
99 | } else { | 96 | } else { |
100 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ | 97 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ |
101 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') | 98 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') |
102 | ], {trace:false}); | 99 | ], {trace:false}); |
103 | } | 100 | } |
104 | //console.log("<<< UserInfoBox.toggleLock"); | 101 | //console.log("<<< UserInfoBox.toggleLock"); |
105 | 102 | ||
106 | return deferredResult; | 103 | return deferredResult; |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'unlock': function () { | 108 | 'unlock': function () { |
112 | var deferredResult; | 109 | var deferredResult; |
113 | var maskElement; | 110 | var maskElement; |
114 | 111 | ||
115 | this.setIsLocked(false); | 112 | this.setIsLocked(false); |
116 | maskElement = this.getId('modalDialogMask'); | 113 | maskElement = this.getId('modalDialogMask'); |
117 | 114 | ||
118 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ | 115 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ |
119 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | 116 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), |
120 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | 117 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), |