author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js b/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js index 0f6858a..1312967 100644 --- a/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js +++ b/frontend/beta/js/Clipperz/PM/Components/Compact/CompactInterface.js | |||
@@ -1,118 +1,116 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } | 26 | if (typeof(Clipperz.PM.Components) == 'undefined') { Clipperz.PM.Components = {}; } |
29 | if (typeof(Clipperz.PM.Components.Compact) == 'undefined') { Clipperz.PM.Components.Compact = {}; } | 27 | if (typeof(Clipperz.PM.Components.Compact) == 'undefined') { Clipperz.PM.Components.Compact = {}; } |
30 | 28 | ||
31 | Clipperz.PM.Components.Compact.CompactInterface = function(anElement, args) { | 29 | Clipperz.PM.Components.Compact.CompactInterface = function(anElement, args) { |
32 | 30 | ||
33 | Clipperz.PM.Components.Compact.CompactInterface.superclass.constructor.call(this, anElement, args); | 31 | Clipperz.PM.Components.Compact.CompactInterface.superclass.constructor.call(this, anElement, args); |
34 | 32 | ||
35 | this._directLoginItemTemplate = null; | 33 | this._directLoginItemTemplate = null; |
36 | this._user = args.user; | 34 | this._user = args.user; |
37 | this._autoLockTimer = null; | 35 | this._autoLockTimer = null; |
38 | 36 | ||
39 | Clipperz.NotificationCenter.register(null, 'updatedProgressState', this, 'userNotificationHandler') | 37 | Clipperz.NotificationCenter.register(null, 'updatedProgressState', this, 'userNotificationHandler') |
40 | Clipperz.NotificationCenter.register(null, 'directLoginAdded', this, 'directLoginAddedHandler'); | 38 | Clipperz.NotificationCenter.register(null, 'directLoginAdded', this, 'directLoginAddedHandler'); |
41 | 39 | ||
42 | this.render(); | 40 | this.render(); |
43 | 41 | ||
44 | return this; | 42 | return this; |
45 | }; | 43 | }; |
46 | 44 | ||
47 | YAHOO.extendX(Clipperz.PM.Components.Compact.CompactInterface, Clipperz.PM.Components.BaseComponent, { | 45 | YAHOO.extendX(Clipperz.PM.Components.Compact.CompactInterface, Clipperz.PM.Components.BaseComponent, { |
48 | 46 | ||
49 | 'toString': function() { | 47 | 'toString': function() { |
50 | return "Clipperz.PM.Components.Compact.CompactInterface"; | 48 | return "Clipperz.PM.Components.Compact.CompactInterface"; |
51 | }, | 49 | }, |
52 | 50 | ||
53 | //----------------------------------------------------- | 51 | //----------------------------------------------------- |
54 | 52 | ||
55 | 'render': function() { | 53 | 'render': function() { |
56 | var result; | 54 | var result; |
57 | varlayout; | 55 | varlayout; |
58 | var registerButton; | 56 | var registerButton; |
59 | 57 | ||
60 | //MochiKit.Logging.logDebug(">>> CompactInterface.render"); | 58 | //MochiKit.Logging.logDebug(">>> CompactInterface.render"); |
61 | this.element().update(""); | 59 | this.element().update(""); |
62 | 60 | ||
63 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', children:[ | 61 | Clipperz.YUI.DomHelper.append(this.element().dom, {tag:'div', children:[ |
64 | {tag:'div', id:this.getId('cantentPanel'), children:[ | 62 | {tag:'div', id:this.getId('cantentPanel'), children:[ |
65 | {tag:'h4', id:this.getId('message')}, | 63 | {tag:'h4', id:this.getId('message')}, |
66 | {tag:'ul', id:'directLogins', children:[]} | 64 | {tag:'ul', id:'directLogins', children:[]} |
67 | ]}, | 65 | ]}, |
68 | {tag:'div', id:this.getId('lockPanel'), cls:'lockPanel', children:[ | 66 | {tag:'div', id:this.getId('lockPanel'), cls:'lockPanel', children:[ |
69 | {tag:'div', htmlString:Clipperz.PM.Strings['lockDescription']}, | 67 | {tag:'div', htmlString:Clipperz.PM.Strings['lockDescription']}, |
70 | {tag:'form', id:'lockDialogForm', children:[ | 68 | {tag:'form', id:'lockDialogForm', children:[ |
71 | {tag:'input', type:'password', id:this.getId('lockPassphrase')} | 69 | {tag:'input', type:'password', id:this.getId('lockPassphrase')} |
72 | ]}, | 70 | ]}, |
73 | {tag:'div', id:this.getId('unlock')} | 71 | {tag:'div', id:this.getId('unlock')} |
74 | ]} | 72 | ]} |
75 | ]}); | 73 | ]}); |
76 | 74 | ||
77 | this.getElement('lockPanel').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); | 75 | this.getElement('lockPanel').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); |
78 | 76 | ||
79 | YAHOO.ext.Element.get('lockBlock').show(); | 77 | YAHOO.ext.Element.get('lockBlock').show(); |
80 | MochiKit.Signal.connect(YAHOO.ext.Element.get('lock').dom, 'onclick', this, 'doLockEventHandler'); | 78 | MochiKit.Signal.connect(YAHOO.ext.Element.get('lock').dom, 'onclick', this, 'doLockEventHandler'); |
81 | new YAHOO.ext.Button(this.getId('unlock'), {text:Clipperz.PM.Strings['unlockButtonLabel'], handler:this.doUnlockEventHandler, scope:this, minWidth:0}); | 79 | new YAHOO.ext.Button(this.getId('unlock'), {text:Clipperz.PM.Strings['unlockButtonLabel'], handler:this.doUnlockEventHandler, scope:this, minWidth:0}); |
82 | this.getElement('unlock').swallowEvent('click', true); | 80 | this.getElement('unlock').swallowEvent('click', true); |
83 | new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('lockPassphrase')); | 81 | new Clipperz.PM.Components.PasswordEntropyDisplay(this.getElement('lockPassphrase')); |
84 | MochiKit.Signal.connect('lockDialogForm', 'onsubmit', this, 'doUnlockEventHandler'); | 82 | MochiKit.Signal.connect('lockDialogForm', 'onsubmit', this, 'doUnlockEventHandler'); |
85 | 83 | ||
86 | this.getElement('cantentPanel').setVisibilityMode(YAHOO.ext.Element.DISPLAY); | 84 | this.getElement('cantentPanel').setVisibilityMode(YAHOO.ext.Element.DISPLAY); |
87 | //MochiKit.Logging.logDebug("<<< CompactInterface.render"); | 85 | //MochiKit.Logging.logDebug("<<< CompactInterface.render"); |
88 | 86 | ||
89 | return result; | 87 | return result; |
90 | }, | 88 | }, |
91 | 89 | ||
92 | //----------------------------------------------------- | 90 | //----------------------------------------------------- |
93 | 91 | ||
94 | 'directLoginAddedHandler': function(anEvent) { | 92 | 'directLoginAddedHandler': function(anEvent) { |
95 | this.redrawDirectLoginItems(); | 93 | this.redrawDirectLoginItems(); |
96 | }, | 94 | }, |
97 | 95 | ||
98 | //----------------------------------------------------- | 96 | //----------------------------------------------------- |
99 | 97 | ||
100 | 'compareDirectLogins': function(a, b) { | 98 | 'compareDirectLogins': function(a, b) { |
101 | return MochiKit.Base.compare(a.label().toLowerCase(), b.label().toLowerCase()); | 99 | return MochiKit.Base.compare(a.label().toLowerCase(), b.label().toLowerCase()); |
102 | }, | 100 | }, |
103 | 101 | ||
104 | //----------------------------------------------------- | 102 | //----------------------------------------------------- |
105 | 103 | ||
106 | 'redrawDirectLoginItems': function() { | 104 | 'redrawDirectLoginItems': function() { |
107 | var template; | 105 | var template; |
108 | var allDirectLogins; | 106 | var allDirectLogins; |
109 | 107 | ||
110 | this.getElement('message').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); | 108 | this.getElement('message').setVisibilityMode(YAHOO.ext.Element.DISPLAY).hide(); |
111 | //MochiKit.Logging.logDebug(">>> CompactInterface.redrawDirectLoginItems"); | 109 | //MochiKit.Logging.logDebug(">>> CompactInterface.redrawDirectLoginItems"); |
112 | //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 0"); | 110 | //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 0"); |
113 | MochiKit.Iter.forEach(YAHOO.ext.Element.get('directLogins').getChildrenByTagName('li'), function(aDirectLoginElement) { | 111 | MochiKit.Iter.forEach(YAHOO.ext.Element.get('directLogins').getChildrenByTagName('li'), function(aDirectLoginElement) { |
114 | MochiKit.Signal.disconnectAll(aDirectLoginElement.dom); | 112 | MochiKit.Signal.disconnectAll(aDirectLoginElement.dom); |
115 | //MochiKit.Logging.logDebug("disconnecting IMG " + aDirectLoginElement.getChildrenByTagName('img')[0].dom.src); | 113 | //MochiKit.Logging.logDebug("disconnecting IMG " + aDirectLoginElement.getChildrenByTagName('img')[0].dom.src); |
116 | MochiKit.Signal.disconnectAll(aDirectLoginElement.getChildrenByTagName('img')[0].dom); | 114 | MochiKit.Signal.disconnectAll(aDirectLoginElement.getChildrenByTagName('img')[0].dom); |
117 | }) | 115 | }) |
118 | //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 1"); | 116 | //MochiKit.Logging.logDebug("--- CompactInterface.redrawDirectLoginItems - 1"); |