Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js index bce8395..b8f3b05 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js | |||
@@ -1,181 +1,191 @@ | |||
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 Community Edition. | 5 | This file is part of Clipperz Community Edition. |
6 | Clipperz Community Edition is an online password manager. | 6 | Clipperz Community Edition is an online password manager. |
7 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 8 | refer to http://www.clipperz.com. |
9 | 9 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
11 | 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 |
12 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
13 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
14 | 14 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
19 | 19 | ||
20 | * 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 |
21 | License along with Clipperz Community Edition. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
22 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
23 | 23 | ||
24 | */ | 24 | */ |
25 | 25 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 27 | ||
28 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { | 28 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { |
29 | args = args || {}; | 29 | args = args || {}; |
30 | 30 | ||
31 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); |
32 | this._newsIsOpen = args.newsIsOpen || false; | 32 | this._newsIsOpen = args.newsIsOpen || false; |
33 | this._animationDuration = args.animationDuration || 0.5; | 33 | this._animationDuration = args.animationDuration || 0.5; |
34 | 34 | ||
35 | this._offset = 82; | 35 | this._offset = 82; |
36 | 36 | ||
37 | return this; | 37 | return this; |
38 | } | 38 | } |
39 | 39 | ||
40 | //============================================================================= | 40 | //============================================================================= |
41 | 41 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 43 | ||
44 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
45 | 45 | ||
46 | 'toString': function () { | 46 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; | 47 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; |
48 | }, | 48 | }, |
49 | 49 | ||
50 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
51 | 51 | ||
52 | 'iframeURL': function () { | 52 | 'iframeURL': function () { |
53 | // return './rss_view.html'; | 53 | // return './rss_view.html'; |
54 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; | 54 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; |
55 | }, | 55 | }, |
56 | 56 | ||
57 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
58 | 58 | ||
59 | 'renderSelf': function(/*aContainer, aPosition*/) { | 59 | 'renderSelf': function(/*aContainer, aPosition*/) { |
60 | this.append(this.element(), [ | 60 | this.append(this.element(), [ |
61 | {tag:'div', id:'miscLinks', children:[ | 61 | {tag:'div', id:'miscLinks', children:[ |
62 | {tag:'ul', children:[ | 62 | {tag:'ul', children:[ |
63 | {tag:'li', children:[{tag:'a', id:'donateHeaderLink', stringID:'pageHeader.donation', href:'http://www.clipperz.com/donations', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.donation')}]}, | 63 | {tag:'li', children:[{tag:'a', id:'donateHeaderLink', stringID:'pageHeader.donation', href:'http://www.clipperz.com/donations', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.donation')}]}, |
64 | {tag:'li', children:[{tag:'a', id:'forumHeaderLink', stringID:'pageHeader.forum', href:'http://www.clipperz.com/forum', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.forum')}]}, | 64 | {tag:'li', children:[{tag:'a', id:'forumHeaderLink', stringID:'pageHeader.forum', href:'http://www.clipperz.com/forum', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.forum')}]}, |
65 | {tag:'li', children:[{tag:'a', id:'creditsHeaderLink', stringID:'pageHeader.credits', href:'http://www.clipperz.com/credits', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.credits')}]}, | 65 | {tag:'li', children:[{tag:'a', id:'creditsHeaderLink', stringID:'pageHeader.credits', href:'http://www.clipperz.com/credits', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.credits')}]}, |
66 | {tag:'li', children:[{tag:'a', id:'feedbackHeaderLink', stringID:'pageHeader.feedback', href:'http://www.clipperz.com/contact', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.feedback')}]}, | 66 | {tag:'li', children:[{tag:'a', id:'feedbackHeaderLink', stringID:'pageHeader.feedback', href:'http://www.clipperz.com/contact', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.feedback')}]}, |
67 | {tag:'li', children:[{tag:'a', id:'helpHeaderLink', stringID:'pageHeader.help', href:'http://www.clipperz.com/support/user_guide',target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.help')}]} | 67 | {tag:'li', children:[{tag:'a', id:'helpHeaderLink', stringID:'pageHeader.help', href:'http://www.clipperz.com/support/user_guide',target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.help')}]} |
68 | ]} | 68 | ]} |
69 | ]}, | 69 | ]}, |
70 | {tag:'div', id:'logoFrame', children:[ | 70 | {tag:'div', id:'logoFrame', children:[ |
71 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[{tag:'div', id:'logo'}]}, | 71 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[ |
72 | {tag:'h5', cls:'clipperzPayoff', html:'keep it to yourself!'} | 72 | // {tag:'h1', cls:'logo', html:"clipperz"}, |
73 | {tag:'canvas', id:this.getId('logo'), cls:'logo'}, | ||
74 | {tag:'h5', cls:'clipperzPayoff', html:"keep it to yourself!"} | ||
75 | ]} | ||
73 | ]}, | 76 | ]}, |
74 | {tag:'div', id:'news', cls:'hidden', children:[ | 77 | {tag:'div', id:'news', cls:'hidden', children:[ |
75 | // {tag:'div', cls:'close', children:[ | 78 | // {tag:'div', cls:'close', children:[ |
76 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} | 79 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} |
77 | // ]}, | 80 | // ]}, |
78 | {tag:'div', id:'newsframe', children:[ | 81 | {tag:'div', id:'newsframe', children:[ |
79 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} | 82 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} |
80 | ]}, | 83 | ]}, |
81 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[]} | 84 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[ |
85 | {tag:'div', cls:'gripHandler', children:[]} | ||
86 | ]} | ||
82 | ]}, | 87 | ]}, |
83 | {tag:'div', id:'featureTabs', children:[ | 88 | {tag:'div', id:'featureTabs', children:[ |
84 | {tag:'table', children:[{tag:'tr', children:[ | 89 | {tag:'table', children:[{tag:'tr', children:[ |
85 | {tag:'td', children:[{tag:'div', id:'feature_store', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('storeIcon')}, {tag:'span', html:"Store and manage your password and online credentials"}]}]}, | 90 | {tag:'td', children:[{tag:'div', id:'feature_store', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('storeIcon')}, {tag:'span', html:"Store and manage your password and online credentials"}]}]}, |
86 | {tag:'td', children:[{tag:'div', id:'feature_protect', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('protectIcon')}, {tag:'span', html:"Protect all your sensitive data"}]}]}, | 91 | {tag:'td', children:[{tag:'div', id:'feature_protect', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('protectIcon')}, {tag:'span', html:"Protect all your sensitive data"}]}]}, |
87 | {tag:'td', children:[{tag:'div', id:'feature_directLogin', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('directLoginIcon')},{tag:'span', html:"Login to your web services without entering any username or password"}]}]}, | 92 | {tag:'td', children:[{tag:'div', id:'feature_directLogin', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('directLoginIcon')},{tag:'span', html:"Login to your web services without entering any username or password"}]}]}, |
88 | {tag:'td', children:[{tag:'div', id:'feature_share', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('shareIcon')}, {tag:'span', html:"Share secret with family members and associates"}]}]} | 93 | {tag:'td', children:[{tag:'div', id:'feature_share', children:[{tag:'canvas', cls:'featureIcon', id:this.getId('shareIcon')}, {tag:'span', html:"Share secret with family members and associates"}]}]} |
89 | ]}]} | 94 | ]}]} |
90 | ]} | 95 | ]} |
91 | ]); | 96 | ]); |
92 | 97 | ||
93 | Clipperz.PM.UI.Canvas.features.store(this.getElement('storeIcon'), "#ffffff"); | 98 | Clipperz.PM.UI.Canvas.features.store(this.getElement('storeIcon'), "#ffffff"); |
94 | Clipperz.PM.UI.Canvas.features.protect(this.getElement('protectIcon'), "#ffffff"); | 99 | Clipperz.PM.UI.Canvas.features.protect(this.getElement('protectIcon'), "#ffffff"); |
95 | Clipperz.PM.UI.Canvas.features.directLogin(this.getElement('directLoginIcon'), "#ffffff"); | 100 | Clipperz.PM.UI.Canvas.features.directLogin(this.getElement('directLoginIcon'), "#ffffff"); |
96 | Clipperz.PM.UI.Canvas.features.share(this.getElement('shareIcon'), "#ffffff", "#ffffff", "#ff0000"); | 101 | Clipperz.PM.UI.Canvas.features.share(this.getElement('shareIcon'), "#ffffff", "#ffffff", "#ff0000"); |
97 | 102 | ||
98 | MochiKit.Signal.connect(this.getElement('newsGrip'), 'onclick', this, 'toggleTips'); | 103 | MochiKit.Signal.connect(this.getElement('newsGrip'), 'onclick', this, 'toggleTips'); |
99 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); | 104 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); |
105 | this.setLogoDefaultColors(); | ||
100 | }, | 106 | }, |
101 | 107 | ||
102 | //------------------------------------------------------------------------- | 108 | //------------------------------------------------------------------------- |
103 | 109 | ||
104 | 'switchToLoggedMode': function() { | 110 | 'switchToLoggedMode': function() { |
105 | // MochiKit.Style.addElementClass(this.element(), 'logged'); | 111 | // MochiKit.Style.addElementClass(this.element(), 'logged'); |
106 | MochiKit.Style.hideElement('featureTabs'); | 112 | MochiKit.Style.hideElement('featureTabs'); |
107 | }, | 113 | }, |
108 | 114 | ||
109 | //------------------------------------------------------------------------- | 115 | //------------------------------------------------------------------------- |
110 | 116 | ||
111 | 'animationDuration': function () { | 117 | 'animationDuration': function () { |
112 | return this._animationDuration; | 118 | return this._animationDuration; |
113 | }, | 119 | }, |
114 | 120 | ||
115 | 'offset': function () { | 121 | 'offset': function () { |
116 | return this._offset; | 122 | return this._offset; |
117 | }, | 123 | }, |
118 | 124 | ||
119 | //------------------------------------------------------------------------- | 125 | //------------------------------------------------------------------------- |
120 | 126 | ||
121 | 'isNewsOpen': function () { | 127 | 'isNewsOpen': function () { |
122 | return this._newsIsOpen; | 128 | return this._newsIsOpen; |
123 | }, | 129 | }, |
124 | 130 | ||
125 | 'toggleNewsIsOpen': function () { | 131 | 'toggleNewsIsOpen': function () { |
126 | this._newsIsOpen = !this._newsIsOpen; | 132 | this._newsIsOpen = !this._newsIsOpen; |
127 | }, | 133 | }, |
128 | 134 | ||
129 | 'toggleTips': function(anEvent) { | 135 | 'toggleTips': function(anEvent) { |
130 | anEvent.preventDefault(); | 136 | anEvent.preventDefault(); |
131 | 137 | ||
132 | if (this.isNewsOpen() == true) { | 138 | if (this.isNewsOpen() == true) { |
133 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { | 139 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { |
134 | x: 0, | 140 | x: 0, |
135 | y: -this.offset(), | 141 | y: -this.offset(), |
136 | mode: 'relative', | 142 | mode: 'relative', |
137 | duration: this.animationDuration(), | 143 | duration: this.animationDuration(), |
138 | beforeStart: function () { | 144 | beforeStart: function () { |
139 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hiding'); | 145 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hiding'); |
140 | }, | 146 | }, |
141 | afterFinish: function () { | 147 | afterFinish: function () { |
142 | Clipperz.DOM.get('newsframe').innerHTML = ""; | 148 | Clipperz.DOM.get('newsframe').innerHTML = ""; |
143 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hidden'); | 149 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hidden'); |
144 | } | 150 | } |
145 | }) | 151 | }) |
146 | this.toggleNewsIsOpen(); | 152 | this.toggleNewsIsOpen(); |
147 | } else { | 153 | } else { |
148 | MochiKit.DOM.addElementClass('newsframe', 'loading'); | 154 | MochiKit.DOM.addElementClass('newsframe', 'loading'); |
149 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { | 155 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { |
150 | x: 0, | 156 | x: 0, |
151 | y: this.offset(), | 157 | y: this.offset(), |
152 | mode: 'relative', | 158 | mode: 'relative', |
153 | duration: this.animationDuration(), | 159 | duration: this.animationDuration(), |
154 | beforeStart: MochiKit.Base.bind(function () { | 160 | beforeStart: MochiKit.Base.bind(function () { |
155 | this.append(Clipperz.DOM.get('newsframe'), {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()}); | 161 | this.append(Clipperz.DOM.get('newsframe'), {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()}); |
156 | 162 | ||
157 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); | 163 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); |
158 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'opening'); | 164 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'opening'); |
159 | }, this), | 165 | }, this), |
160 | afterFinish: function () { | 166 | afterFinish: function () { |
161 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'open'); | 167 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'open'); |
162 | } | 168 | } |
163 | }) | 169 | }) |
164 | this.toggleNewsIsOpen(); | 170 | this.toggleNewsIsOpen(); |
165 | } | 171 | } |
166 | }, | 172 | }, |
173 | |||
174 | 'setLogoDefaultColors': function () { | ||
175 | Clipperz.PM.UI.Canvas.logo.normal(this.getElement('logo'), "clipperz", "28.0pt", "#ffffff"); | ||
176 | }, | ||
167 | 177 | ||
168 | //------------------------------------------------------------------------- | 178 | //------------------------------------------------------------------------- |
169 | 179 | ||
170 | 'handleIframeDidLoad': function (anEvent) { | 180 | 'handleIframeDidLoad': function (anEvent) { |
171 | if (this.isNewsOpen() == false) { | 181 | if (this.isNewsOpen() == false) { |
172 | this.toggleTips(anEvent); | 182 | this.toggleTips(anEvent); |
173 | } | 183 | } |
174 | 184 | ||
175 | MochiKit.DOM.removeElementClass('newsframe', 'loading'); | 185 | MochiKit.DOM.removeElementClass('newsframe', 'loading'); |
176 | MochiKit.Signal.disconnectAllTo(this.getElement('iframe')); | 186 | MochiKit.Signal.disconnectAllTo(this.getElement('iframe')); |
177 | }, | 187 | }, |
178 | 188 | ||
179 | //------------------------------------------------------------------------- | 189 | //------------------------------------------------------------------------- |
180 | __syntaxFix__: "syntax fix" | 190 | __syntaxFix__: "syntax fix" |
181 | }); | 191 | }); |