summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js
Unidiff
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.js184
1 files changed, 184 insertions, 0 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
new file mode 100644
index 0000000..3924434
--- a/dev/null
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js
@@ -0,0 +1,184 @@
1/*
2
3Copyright 2008-2011 Clipperz Srl
4
5This file is part of Clipperz's Javascript Crypto Library.
6Javascript Crypto Library provides web developers with an extensive
7and efficient set of cryptographic functions. The library aims to
8obtain maximum execution speed while preserving modularity and
9reusability.
10For further information about its features and functionalities please
11refer to http://www.clipperz.com
12
13* Javascript Crypto Library is free software: you can redistribute
14 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
16 3 of the License, or (at your option) any later version.
17
18* Javascript Crypto Library is distributed in the hope that it will
19 be useful, but WITHOUT ANY WARRANTY; without even the implied
20 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU Affero General Public License for more details.
22
23* You should have received a copy of the GNU Affero General Public
24 License along with Javascript Crypto Library. If not, see
25 <http://www.gnu.org/licenses/>.
26
27*/
28
29Clipperz.Base.module('Clipperz.PM.UI.Web.Components');
30
31Clipperz.PM.UI.Web.Components.PageHeader = function(args) {
32 args = args || {};
33
34 Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments);
35 this._newsIsOpen = args.newsIsOpen || false;
36 this._animationDuration = args.animationDuration || 0.5;
37
38 this._offset = 82;
39
40 return this;
41}
42
43//=============================================================================
44
45Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, {
46
47 //-------------------------------------------------------------------------
48
49 'toString': function () {
50 return "Clipperz.PM.UI.Web.Components.PageHeader component";
51 },
52
53 //-------------------------------------------------------------------------
54
55 'iframeURL': function () {
56 // return './rss_view.html';
57 return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html';
58 },
59
60 //-------------------------------------------------------------------------
61
62 'renderSelf': function(/*aContainer, aPosition*/) {
63 this.append(this.element(), [
64 {tag:'div', id:'miscLinks', children:[
65 {tag:'ul', children:[
66 {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')}]},
67 {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')}]},
68 {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')}]},
69 {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')}]},
70 {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')}]}
71 ]}
72 ]},
73 {tag:'div', id:'logoFrame', children:[
74 {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[{tag:'div', id:'logo'}]},
75 {tag:'h5', cls:'clipperzPayoff', html:'keep it to yourself!'}
76 ]},
77 {tag:'div', id:'news', cls:'hidden', children:[
78 // {tag:'div', cls:'close', children:[
79 // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'}
80 // ]},
81 {tag:'div', id:'newsframe', children:[
82 {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()}
83 ]},
84 {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[]}
85 ]},
86 {tag:'div', id:'featureTabs', children:[
87 {tag:'table', children:[{tag:'tr', children:[
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"}]}]},
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"}]}]},
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"}]}]},
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"}]}]}
92 ]}]}
93 ]}
94 ]);
95
96 Clipperz.PM.UI.Canvas.features.store(this.getElement('storeIcon'), "#ffffff");
97 Clipperz.PM.UI.Canvas.features.protect(this.getElement('protectIcon'), "#ffffff");
98 Clipperz.PM.UI.Canvas.features.directLogin(this.getElement('directLoginIcon'), "#ffffff");
99 Clipperz.PM.UI.Canvas.features.share(this.getElement('shareIcon'), "#ffffff", "#ffffff", "#ff0000");
100
101 MochiKit.Signal.connect(this.getElement('newsGrip'), 'onclick', this, 'toggleTips');
102 MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad');
103 },
104
105 //-------------------------------------------------------------------------
106
107 'switchToLoggedMode': function() {
108 // MochiKit.Style.addElementClass(this.element(), 'logged');
109 MochiKit.Style.hideElement('featureTabs');
110 },
111
112 //-------------------------------------------------------------------------
113
114 'animationDuration': function () {
115 return this._animationDuration;
116 },
117
118 'offset': function () {
119 return this._offset;
120 },
121
122 //-------------------------------------------------------------------------
123
124 'isNewsOpen': function () {
125 return this._newsIsOpen;
126 },
127
128 'toggleNewsIsOpen': function () {
129 this._newsIsOpen = !this._newsIsOpen;
130 },
131
132 'toggleTips': function(anEvent) {
133 anEvent.preventDefault();
134
135 if (this.isNewsOpen() == true) {
136 MochiKit.Visual.Move(Clipperz.DOM.get('news'), {
137 x: 0,
138 y: -this.offset(),
139 mode: 'relative',
140 duration: this.animationDuration(),
141 beforeStart: function () {
142 MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hiding');
143 },
144 afterFinish: function () {
145 Clipperz.DOM.get('newsframe').innerHTML = "";
146 MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'hidden');
147 }
148 })
149 this.toggleNewsIsOpen();
150 } else {
151 MochiKit.DOM.addElementClass('newsframe', 'loading');
152 MochiKit.Visual.Move(Clipperz.DOM.get('news'), {
153 x: 0,
154 y: this.offset(),
155 mode: 'relative',
156 duration: this.animationDuration(),
157 beforeStart: MochiKit.Base.bind(function () {
158 this.append(Clipperz.DOM.get('newsframe'), {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()});
159
160 MochiKit.Signal.connect(this.getElement('iframe'), 'onload', this, 'handleIframeDidLoad');
161 MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'opening');
162 }, this),
163 afterFinish: function () {
164 MochiKit.DOM.setElementClass(Clipperz.DOM.get('news'), 'open');
165 }
166 })
167 this.toggleNewsIsOpen();
168 }
169 },
170
171 //-------------------------------------------------------------------------
172
173 'handleIframeDidLoad': function (anEvent) {
174 if (this.isNewsOpen() == false) {
175 this.toggleTips(anEvent);
176 }
177
178 MochiKit.DOM.removeElementClass('newsframe', 'loading');
179 MochiKit.Signal.disconnectAllTo(this.getElement('iframe'));
180 },
181
182 //-------------------------------------------------------------------------
183 __syntaxFix__: "syntax fix"
184});