Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js index 987e51e..5eb0c1f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.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 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { | 26 | Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | 33 | ||
36 | this._boxDimensions = null; | 34 | this._boxDimensions = null; |
37 | this._isVisible = false; | 35 | this._isVisible = false; |
38 | 36 | ||
39 | this.renderSelf(); | 37 | this.renderSelf(); |
40 | 38 | ||
41 | return this; | 39 | return this; |
42 | } | 40 | } |
43 | 41 | ||
44 | //============================================================================= | 42 | //============================================================================= |
45 | 43 | ||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'toString': function () { | 48 | 'toString': function () { |
51 | return "Clipperz.PM.UI.Web.Components.PasswordTooltip component"; | 49 | return "Clipperz.PM.UI.Web.Components.PasswordTooltip component"; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
55 | 53 | ||
56 | 'referenceElement': function () { | 54 | 'referenceElement': function () { |
57 | return this._referenceElement; | 55 | return this._referenceElement; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'text': function () { | 60 | 'text': function () { |
63 | return this._text; | 61 | return this._text; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | 'setText': function (aValue) { | 64 | 'setText': function (aValue) { |
67 | this._text = aValue; | 65 | this._text = aValue; |
68 | }, | 66 | }, |
69 | 67 | ||
70 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
71 | 69 | ||
72 | 'isVisible': function () { | 70 | 'isVisible': function () { |
73 | return this._isVisible; | 71 | return this._isVisible; |
74 | }, | 72 | }, |
75 | 73 | ||
76 | 'setIsVisible': function (aValue) { | 74 | 'setIsVisible': function (aValue) { |
77 | this._isVisible = aValue; | 75 | this._isVisible = aValue; |
78 | }, | 76 | }, |
79 | 77 | ||
80 | //------------------------------------------------------------------------- | 78 | //------------------------------------------------------------------------- |
81 | 79 | ||
82 | 'renderSelf': function() { | 80 | 'renderSelf': function() { |
83 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'passwordTooltip', children:[ | 81 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'passwordTooltip', children:[ |
84 | {tag:'div', id:this.getId('body'), cls:'passwordTooltip_body', children:[ | 82 | {tag:'div', id:this.getId('body'), cls:'passwordTooltip_body', children:[ |
85 | {tag:'div', cls:'passwordTooltip_text', children:[ | 83 | {tag:'div', cls:'passwordTooltip_text', children:[ |
86 | {tag:'span', html:this.text()} | 84 | {tag:'span', html:this.text()} |
87 | ]}, | 85 | ]}, |
88 | {tag:'div', id:this.getId('footer'), cls:'passwordTooltip_footer'} | 86 | {tag:'div', id:this.getId('footer'), cls:'passwordTooltip_footer'} |
89 | ]}, | 87 | ]}, |
90 | {tag:'div', id:this.getId('arrow'), cls:'passwordTooltip_arrow'} | 88 | {tag:'div', id:this.getId('arrow'), cls:'passwordTooltip_arrow'} |
91 | ]}); | 89 | ]}); |
92 | 90 | ||
93 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | 91 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); |
94 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | 92 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; |
95 | 93 | ||
96 | MochiKit.Style.hideElement(this.displayElement()); | 94 | MochiKit.Style.hideElement(this.displayElement()); |
97 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 95 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
98 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 96 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
99 | }, | 97 | }, |
100 | 98 | ||
101 | //----------------------------------------------------- | 99 | //----------------------------------------------------- |
102 | 100 | ||
103 | 'displayElement': function() { | 101 | 'displayElement': function() { |
104 | return this.getElement('tooltip'); | 102 | return this.getElement('tooltip'); |
105 | }, | 103 | }, |
106 | 104 | ||
107 | //------------------------------------------------------------------------- | 105 | //------------------------------------------------------------------------- |
108 | 106 | ||
109 | 'boxDimensions': function () { | 107 | 'boxDimensions': function () { |
110 | return this._boxDimensions; | 108 | return this._boxDimensions; |
111 | }, | 109 | }, |
112 | 110 | ||
113 | //------------------------------------------------------------------------- | 111 | //------------------------------------------------------------------------- |
114 | 112 | ||
115 | 'show': function () { | 113 | 'show': function () { |
116 | var elementSizeAndPosition; | 114 | var elementSizeAndPosition; |
117 | var arrowPosition; | 115 | var arrowPosition; |
118 | var bodyPosition; | 116 | var bodyPosition; |