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 | 22 |
1 files changed, 10 insertions, 12 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 b8f3b05..5e49fb5 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js | |||
@@ -1,191 +1,189 @@ | |||
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.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { | 26 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); |
32 | this._newsIsOpen = args.newsIsOpen || false; | 30 | this._newsIsOpen = args.newsIsOpen || false; |
33 | this._animationDuration = args.animationDuration || 0.5; | 31 | this._animationDuration = args.animationDuration || 0.5; |
34 | 32 | ||
35 | this._offset = 82; | 33 | this._offset = 82; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'toString': function () { | 44 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; | 45 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'iframeURL': function () { | 50 | 'iframeURL': function () { |
53 | // return './rss_view.html'; | 51 | // return './rss_view.html'; |
54 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; | 52 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'renderSelf': function(/*aContainer, aPosition*/) { | 57 | 'renderSelf': function(/*aContainer, aPosition*/) { |
60 | this.append(this.element(), [ | 58 | this.append(this.element(), [ |
61 | {tag:'div', id:'miscLinks', children:[ | 59 | {tag:'div', id:'miscLinks', children:[ |
62 | {tag:'ul', children:[ | 60 | {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')}]}, | 61 | {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')}]}, | 62 | {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')}]}, | 63 | {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')}]}, | 64 | {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')}]} | 65 | {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 | ]} | 66 | ]} |
69 | ]}, | 67 | ]}, |
70 | {tag:'div', id:'logoFrame', children:[ | 68 | {tag:'div', id:'logoFrame', children:[ |
71 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[ | 69 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[ |
72 | // {tag:'h1', cls:'logo', html:"clipperz"}, | 70 | // {tag:'h1', cls:'logo', html:"clipperz"}, |
73 | {tag:'canvas', id:this.getId('logo'), cls:'logo'}, | 71 | {tag:'canvas', id:this.getId('logo'), cls:'logo'}, |
74 | {tag:'h5', cls:'clipperzPayoff', html:"keep it to yourself!"} | 72 | {tag:'h5', cls:'clipperzPayoff', html:"keep it to yourself!"} |
75 | ]} | 73 | ]} |
76 | ]}, | 74 | ]}, |
77 | {tag:'div', id:'news', cls:'hidden', children:[ | 75 | {tag:'div', id:'news', cls:'hidden', children:[ |
78 | // {tag:'div', cls:'close', children:[ | 76 | // {tag:'div', cls:'close', children:[ |
79 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} | 77 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} |
80 | // ]}, | 78 | // ]}, |
81 | {tag:'div', id:'newsframe', children:[ | 79 | {tag:'div', id:'newsframe', children:[ |
82 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} | 80 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} |
83 | ]}, | 81 | ]}, |
84 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[ | 82 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[ |
85 | {tag:'div', cls:'gripHandler', children:[]} | 83 | {tag:'div', cls:'gripHandler', children:[]} |
86 | ]} | 84 | ]} |
87 | ]}, | 85 | ]}, |
88 | {tag:'div', id:'featureTabs', children:[ | 86 | {tag:'div', id:'featureTabs', children:[ |
89 | {tag:'table', children:[{tag:'tr', children:[ | 87 | {tag:'table', children:[{tag:'tr', children:[ |
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"}]}]}, | 88 | {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"}]}]}, |
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"}]}]}, | 89 | {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"}]}]}, |
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"}]}]}, | 90 | {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"}]}]}, |
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"}]}]} | 91 | {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"}]}]} |
94 | ]}]} | 92 | ]}]} |
95 | ]} | 93 | ]} |
96 | ]); | 94 | ]); |
97 | 95 | ||
98 | Clipperz.PM.UI.Canvas.features.store(this.getElement('storeIcon'), "#ffffff"); | 96 | Clipperz.PM.UI.Canvas.features.store(this.getElement('storeIcon'), "#ffffff"); |
99 | Clipperz.PM.UI.Canvas.features.protect(this.getElement('protectIcon'), "#ffffff"); | 97 | Clipperz.PM.UI.Canvas.features.protect(this.getElement('protectIcon'), "#ffffff"); |
100 | Clipperz.PM.UI.Canvas.features.directLogin(this.getElement('directLoginIcon'), "#ffffff"); | 98 | Clipperz.PM.UI.Canvas.features.directLogin(this.getElement('directLoginIcon'), "#ffffff"); |
101 | Clipperz.PM.UI.Canvas.features.share(this.getElement('shareIcon'), "#ffffff", "#ffffff", "#ff0000"); | 99 | Clipperz.PM.UI.Canvas.features.share(this.getElement('shareIcon'), "#ffffff", "#ffffff", "#ff0000"); |
102 | 100 | ||
103 | MochiKit.Signal.connect(this.getElement('newsGrip'), 'onclick', this, 'toggleTips'); | 101 | MochiKit.Signal.connect(this.getElement('newsGrip'), 'onclick', this, 'toggleTips'); |
104 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); | 102 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); |
105 | this.setLogoDefaultColors(); | 103 | this.setLogoDefaultColors(); |
106 | }, | 104 | }, |
107 | 105 | ||
108 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
109 | 107 | ||
110 | 'switchToLoggedMode': function() { | 108 | 'switchToLoggedMode': function() { |
111 | // MochiKit.Style.addElementClass(this.element(), 'logged'); | 109 | // MochiKit.Style.addElementClass(this.element(), 'logged'); |
112 | MochiKit.Style.hideElement('featureTabs'); | 110 | MochiKit.Style.hideElement('featureTabs'); |
113 | }, | 111 | }, |
114 | 112 | ||
115 | //------------------------------------------------------------------------- | 113 | //------------------------------------------------------------------------- |
116 | 114 | ||
117 | 'animationDuration': function () { | 115 | 'animationDuration': function () { |
118 | return this._animationDuration; | 116 | return this._animationDuration; |
119 | }, | 117 | }, |
120 | 118 | ||
121 | 'offset': function () { | 119 | 'offset': function () { |
122 | return this._offset; | 120 | return this._offset; |
123 | }, | 121 | }, |
124 | 122 | ||
125 | //------------------------------------------------------------------------- | 123 | //------------------------------------------------------------------------- |
126 | 124 | ||
127 | 'isNewsOpen': function () { | 125 | 'isNewsOpen': function () { |
128 | return this._newsIsOpen; | 126 | return this._newsIsOpen; |
129 | }, | 127 | }, |
130 | 128 | ||
131 | 'toggleNewsIsOpen': function () { | 129 | 'toggleNewsIsOpen': function () { |
132 | this._newsIsOpen = !this._newsIsOpen; | 130 | this._newsIsOpen = !this._newsIsOpen; |
133 | }, | 131 | }, |
134 | 132 | ||
135 | 'toggleTips': function(anEvent) { | 133 | 'toggleTips': function(anEvent) { |
136 | anEvent.preventDefault(); | 134 | anEvent.preventDefault(); |
137 | 135 | ||
138 | if (this.isNewsOpen() == true) { | 136 | if (this.isNewsOpen() == true) { |
139 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { | 137 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { |
140 | x: 0, | 138 | x: 0, |
141 | y: -this.offset(), | 139 | y: -this.offset(), |
142 | mode: 'relative', | 140 | mode: 'relative', |
143 | duration: this.animationDuration(), | 141 | duration: this.animationDuration(), |
144 | beforeStart: function () { | 142 | beforeStart: function () { |
145 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hiding'); | 143 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hiding'); |
146 | }, | 144 | }, |
147 | afterFinish: function () { | 145 | afterFinish: function () { |
148 | Clipperz.DOM.get('newsframe').innerHTML = ""; | 146 | Clipperz.DOM.get('newsframe').innerHTML = ""; |
149 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hidden'); | 147 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hidden'); |
150 | } | 148 | } |
151 | }) | 149 | }) |
152 | this.toggleNewsIsOpen(); | 150 | this.toggleNewsIsOpen(); |
153 | } else { | 151 | } else { |
154 | MochiKit.DOM.addElementClass('newsframe', 'loading'); | 152 | MochiKit.DOM.addElementClass('newsframe', 'loading'); |
155 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { | 153 | MochiKit.Visual.Move(Clipperz.DOM.get('news'), { |
156 | x: 0, | 154 | x: 0, |
157 | y: this.offset(), | 155 | y: this.offset(), |
158 | mode: 'relative', | 156 | mode: 'relative', |
159 | duration: this.animationDuration(), | 157 | duration: this.animationDuration(), |
160 | beforeStart: MochiKit.Base.bind(function () { | 158 | beforeStart: MochiKit.Base.bind(function () { |
161 | this.append(Clipperz.DOM.get('newsframe'), {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()}); | 159 | this.append(Clipperz.DOM.get('newsframe'), {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()}); |
162 | 160 | ||
163 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); | 161 | MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad'); |
164 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'opening'); | 162 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'opening'); |
165 | }, this), | 163 | }, this), |
166 | afterFinish: function () { | 164 | afterFinish: function () { |
167 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'open'); | 165 | MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'open'); |
168 | } | 166 | } |
169 | }) | 167 | }) |
170 | this.toggleNewsIsOpen(); | 168 | this.toggleNewsIsOpen(); |
171 | } | 169 | } |
172 | }, | 170 | }, |
173 | 171 | ||
174 | 'setLogoDefaultColors': function () { | 172 | 'setLogoDefaultColors': function () { |
175 | Clipperz.PM.UI.Canvas.logo.normal(this.getElement('logo'), "clipperz", "28.0pt", "#ffffff"); | 173 | Clipperz.PM.UI.Canvas.logo.normal(this.getElement('logo'), "clipperz", "28.0pt", "#ffffff"); |
176 | }, | 174 | }, |
177 | 175 | ||
178 | //------------------------------------------------------------------------- | 176 | //------------------------------------------------------------------------- |
179 | 177 | ||
180 | 'handleIframeDidLoad': function (anEvent) { | 178 | 'handleIframeDidLoad': function (anEvent) { |
181 | if (this.isNewsOpen() == false) { | 179 | if (this.isNewsOpen() == false) { |
182 | this.toggleTips(anEvent); | 180 | this.toggleTips(anEvent); |
183 | } | 181 | } |
184 | 182 | ||
185 | MochiKit.DOM.removeElementClass('newsframe', 'loading'); | 183 | MochiKit.DOM.removeElementClass('newsframe', 'loading'); |
186 | MochiKit.Signal.disconnectAllTo(this.getElement('iframe')); | 184 | MochiKit.Signal.disconnectAllTo(this.getElement('iframe')); |
187 | }, | 185 | }, |
188 | 186 | ||
189 | //------------------------------------------------------------------------- | 187 | //------------------------------------------------------------------------- |
190 | __syntaxFix__: "syntax fix" | 188 | __syntaxFix__: "syntax fix" |
191 | }); | 189 | }); |