Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js index 1f49575..d8dc941 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js | |||
@@ -1,152 +1,149 @@ | |||
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 | //############################################################################# | 28 | //############################################################################# |
32 | 29 | ||
33 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { | 30 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { |
34 | args = args || {}; | 31 | args = args || {}; |
35 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); | 32 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); |
36 | 33 | ||
37 | this._enterLeaveCounter = 0; | 34 | this._enterLeaveCounter = 0; |
38 | this._selectedRowObject = null; | 35 | this._selectedRowObject = 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.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
46 | 43 | ||
47 | 'toString': function () { | 44 | 'toString': function () { |
48 | return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; | 45 | return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; |
49 | }, | 46 | }, |
50 | 47 | ||
51 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
52 | 49 | ||
53 | 'renderHeader': function(aTRElement) { | 50 | 'renderHeader': function(aTRElement) { |
54 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.renderHeader.call(this, aTRElement); | 51 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.renderHeader.call(this, aTRElement); |
55 | 52 | ||
56 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, {tag:'div', cls:'DirectLoginListPopup', id:this.getId('DirectLoginListPopup'), children:[ | 53 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, {tag:'div', cls:'DirectLoginListPopup', id:this.getId('DirectLoginListPopup'), children:[ |
57 | {tag:'div', cls:'DirectLoginListPopup_body', children:[ | 54 | {tag:'div', cls:'DirectLoginListPopup_body', children:[ |
58 | {tag:'ul', id:this.getId('DirectLoginListPopup_list'), children:[ | 55 | {tag:'ul', id:this.getId('DirectLoginListPopup_list'), children:[ |
59 | // {tag:'li', children:[ | 56 | // {tag:'li', children:[ |
60 | // {tag:'img', cls:'favicon', src:'http://www.microsoft.com/favicon.ico'}, | 57 | // {tag:'img', cls:'favicon', src:'http://www.microsoft.com/favicon.ico'}, |
61 | // {tag:'a', href:'#', html:"Google Mail"} | 58 | // {tag:'a', href:'#', html:"Google Mail"} |
62 | // ]}, | 59 | // ]}, |
63 | // ... | 60 | // ... |
64 | ]} | 61 | ]} |
65 | ]}, | 62 | ]}, |
66 | {tag:'div', cls:'DirectLoginListPopup_footer'} | 63 | {tag:'div', cls:'DirectLoginListPopup_footer'} |
67 | ]}); | 64 | ]}); |
68 | 65 | ||
69 | MochiKit.Style.hideElement(this.getId('DirectLoginListPopup')); | 66 | MochiKit.Style.hideElement(this.getId('DirectLoginListPopup')); |
70 | 67 | ||
71 | //BEWARE: use MochiKit.Signal.connect instead of this.connectEvent, as the HEADER is NOT redrawn after each refresh | 68 | //BEWARE: use MochiKit.Signal.connect instead of this.connectEvent, as the HEADER is NOT redrawn after each refresh |
72 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseenter', this, 'handleDirectLoginListPopupEnter'); | 69 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseenter', this, 'handleDirectLoginListPopupEnter'); |
73 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseleave', this, 'handleDirectLoginListPopupLeave'); | 70 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseleave', this, 'handleDirectLoginListPopupLeave'); |
74 | }, | 71 | }, |
75 | 72 | ||
76 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
77 | 74 | ||
78 | 'renderCell': function(aRowElement, anObject) { | 75 | 'renderCell': function(aRowElement, anObject) { |
79 | var i,c; | 76 | var i,c; |
80 | var directLoginsInfo; | 77 | var directLoginsInfo; |
81 | 78 | ||
82 | directLoginsInfo = anObject[this.name()]; | 79 | directLoginsInfo = anObject[this.name()]; |
83 | 80 | ||
84 | TDElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:'card_directLogins'}); | 81 | TDElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:'card_directLogins'}); |
85 | 82 | ||
86 | c = Math.min(2, directLoginsInfo.length); | 83 | c = Math.min(2, directLoginsInfo.length); |
87 | for (i=0; i<c; i++) { | 84 | for (i=0; i<c; i++) { |
88 | var elementID; | 85 | var elementID; |
89 | 86 | ||
90 | elementID = 'directLogin_' + directLoginsInfo[i]['_reference']; | 87 | elementID = 'directLogin_' + directLoginsInfo[i]['_reference']; |
91 | 88 | ||
92 | Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin', children:[ | 89 | Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin', children:[ |
93 | {tag:'div', cls:'card_directLogin_body', children:[ | 90 | {tag:'div', cls:'card_directLogin_body', children:[ |
94 | {tag:'a', href:'#', id:elementID, html:directLoginsInfo[i]['label']} | 91 | {tag:'a', href:'#', id:elementID, html:directLoginsInfo[i]['label']} |
95 | ]} | 92 | ]} |
96 | ]}); | 93 | ]}); |
97 | // MochiKit.Signal.connect(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); | 94 | // MochiKit.Signal.connect(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); |
98 | this.connectEvent(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); | 95 | this.connectEvent(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); |
99 | } | 96 | } |
100 | 97 | ||
101 | if (directLoginsInfo.length > 2) { | 98 | if (directLoginsInfo.length > 2) { |
102 | var ellipsesElement; | 99 | var ellipsesElement; |
103 | 100 | ||
104 | ellipsesElement = Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin_ellipses', children:[ | 101 | ellipsesElement = Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin_ellipses', children:[ |
105 | {tag:'div', cls:'card_directLogin_ellipses_body', children:[ | 102 | {tag:'div', cls:'card_directLogin_ellipses_body', children:[ |
106 | {tag:'span', html:'…'} | 103 | {tag:'span', html:'…'} |
107 | ]} | 104 | ]} |
108 | ]}); | 105 | ]}); |
109 | 106 | ||
110 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseenter', MochiKit.Base.method(this, 'handleEllipsesEnter', anObject)); | 107 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseenter', MochiKit.Base.method(this, 'handleEllipsesEnter', anObject)); |
111 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseleave', MochiKit.Base.method(this, 'handleEllipsesLeave')); | 108 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseleave', MochiKit.Base.method(this, 'handleEllipsesLeave')); |
112 | // MochiKit.Signal.connect(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); | 109 | // MochiKit.Signal.connect(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); |
113 | this.connectEvent(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); | 110 | this.connectEvent(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); |
114 | } | 111 | } |
115 | // MochiKit.Signal.connect(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); | 112 | // MochiKit.Signal.connect(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); |
116 | this.connectEvent(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); | 113 | this.connectEvent(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); |
117 | 114 | ||
118 | }, | 115 | }, |
119 | 116 | ||
120 | //========================================================================= | 117 | //========================================================================= |
121 | /* | 118 | /* |
122 | 'handleEllipsesEnter': function (aRecordInfo, anEvent) { | 119 | 'handleEllipsesEnter': function (aRecordInfo, anEvent) { |
123 | this._enterLeaveCounter ++; | 120 | this._enterLeaveCounter ++; |
124 | if (this._enterLeaveCounter > 2) { | 121 | if (this._enterLeaveCounter > 2) { |
125 | this._enterLeaveCounter = 2; | 122 | this._enterLeaveCounter = 2; |
126 | } | 123 | } |
127 | 124 | ||
128 | if (this._enterLeaveCounter == 1) { | 125 | if (this._enterLeaveCounter == 1) { |
129 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); | 126 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); |
130 | } | 127 | } |
131 | }, | 128 | }, |
132 | 129 | ||
133 | 'handleEllipsesLeave': function (anEvent) { | 130 | 'handleEllipsesLeave': function (anEvent) { |
134 | this._enterLeaveCounter --; | 131 | this._enterLeaveCounter --; |
135 | 132 | ||
136 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { | 133 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { |
137 | if (this._enterLeaveCounter == 0) { | 134 | if (this._enterLeaveCounter == 0) { |
138 | this.hideDirectLoginListPopup(); | 135 | this.hideDirectLoginListPopup(); |
139 | } | 136 | } |
140 | }, this)) | 137 | }, this)) |
141 | }, | 138 | }, |
142 | */ | 139 | */ |
143 | //------------------------------------------------------------------------- | 140 | //------------------------------------------------------------------------- |
144 | 141 | ||
145 | 'handleTDEnter': function (aRecordInfo, anEvent) { | 142 | 'handleTDEnter': function (aRecordInfo, anEvent) { |
146 | if (MochiKit.Selector.findChildElements(anEvent.src(), ['div.card_directLogin_ellipses']).length > 0) { | 143 | if (MochiKit.Selector.findChildElements(anEvent.src(), ['div.card_directLogin_ellipses']).length > 0) { |
147 | this._enterLeaveCounter ++; | 144 | this._enterLeaveCounter ++; |
148 | if (this._enterLeaveCounter > 2) { | 145 | if (this._enterLeaveCounter > 2) { |
149 | this._enterLeaveCounter = 2; | 146 | this._enterLeaveCounter = 2; |
150 | } | 147 | } |
151 | 148 | ||
152 | if (this._enterLeaveCounter == 1) { | 149 | if (this._enterLeaveCounter == 1) { |