Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI') (more/less context) (ignore whitespace changes)
79 files changed, 18453 insertions, 0 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js new file mode 100644 index 0000000..169946a --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js | |||
@@ -0,0 +1,120 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //download.js | ||
31 | //Download | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/15/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; | ||
39 | var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var stroke; | ||
47 | var path; | ||
48 | var pointX; | ||
49 | var pointY; | ||
50 | if (window.devicePixelRatio) | ||
51 | resolution = window.devicePixelRatio; | ||
52 | else | ||
53 | resolution = 1.0; | ||
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | ||
55 | |||
56 | context.save(); | ||
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | ||
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | ||
59 | |||
60 | // arrow | ||
61 | |||
62 | stroke = aThickness; | ||
63 | stroke *= resolution; | ||
64 | if (stroke < 1.0) | ||
65 | stroke = Math.ceil(stroke); | ||
66 | else | ||
67 | stroke = Math.round(stroke); | ||
68 | stroke /= resolution; | ||
69 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
70 | context.beginPath(); | ||
71 | pointX = 16.5; | ||
72 | pointY = 22.5; | ||
73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
75 | context.moveTo(pointX, pointY); | ||
76 | pointX = 19.5; | ||
77 | pointY = 8.5; | ||
78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
80 | context.lineTo(pointX, pointY); | ||
81 | pointX = 30.038; | ||
82 | pointY = 10.605; | ||
83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
85 | context.lineTo(pointX, pointY); | ||
86 | pointX = 27.354; | ||
87 | pointY = 24.354; | ||
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
90 | context.lineTo(pointX, pointY); | ||
91 | pointX = 33.28; | ||
92 | pointY = 25.293; | ||
93 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
94 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
95 | context.lineTo(pointX, pointY); | ||
96 | pointX = 19.81; | ||
97 | pointY = 36.828; | ||
98 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
99 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
100 | context.lineTo(pointX, pointY); | ||
101 | pointX = 10.07; | ||
102 | pointY = 21.617; | ||
103 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
104 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
105 | context.lineTo(pointX, pointY); | ||
106 | pointX = 16.5; | ||
107 | pointY = 22.5; | ||
108 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
109 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
110 | context.lineTo(pointX, pointY); | ||
111 | context.closePath(); | ||
112 | context.fillStyle = aFillColor; | ||
113 | context.fill(); | ||
114 | context.strokeStyle = aColor; | ||
115 | context.lineWidth = stroke; | ||
116 | context.lineCap = "square"; | ||
117 | context.stroke(); | ||
118 | |||
119 | context.restore(); | ||
120 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js new file mode 100644 index 0000000..b8e535b --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js | |||
@@ -0,0 +1,208 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //look.js | ||
31 | //Look | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/15/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; | ||
39 | var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var stroke; | ||
47 | var path; | ||
48 | var pointX; | ||
49 | var pointY; | ||
50 | if (window.devicePixelRatio) | ||
51 | resolution = window.devicePixelRatio; | ||
52 | else | ||
53 | resolution = 1.0; | ||
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | ||
55 | |||
56 | context.save(); | ||
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | ||
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | ||
59 | |||
60 | // Layer 6 | ||
61 | |||
62 | stroke = aThickness; | ||
63 | stroke *= resolution; | ||
64 | if (stroke < 1.0) | ||
65 | stroke = Math.ceil(stroke); | ||
66 | else | ||
67 | stroke = Math.round(stroke); | ||
68 | stroke /= resolution; | ||
69 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
70 | context.save(); | ||
71 | context.translate(17.5, 23.0); | ||
72 | context.rotate(-0.503); | ||
73 | context.translate(-17.5, -23.0); | ||
74 | context.beginPath(); | ||
75 | pointX = 28.5; | ||
76 | pointY = 31.5; | ||
77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
79 | context.moveTo(pointX, pointY); | ||
80 | pointX = 28.5; | ||
81 | pointY = 14.5; | ||
82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
84 | context.lineTo(pointX, pointY); | ||
85 | pointX = 6.5; | ||
86 | pointY = 14.5; | ||
87 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
88 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
89 | context.lineTo(pointX, pointY); | ||
90 | pointX = 6.5; | ||
91 | pointY = 31.5; | ||
92 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
93 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
94 | context.lineTo(pointX, pointY); | ||
95 | pointX = 28.5; | ||
96 | pointY = 31.5; | ||
97 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
98 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
99 | context.lineTo(pointX, pointY); | ||
100 | context.closePath(); | ||
101 | context.fillStyle = aFillColor; | ||
102 | context.fill(); | ||
103 | context.strokeStyle = aColor; | ||
104 | context.lineWidth = stroke; | ||
105 | context.lineCap = "square"; | ||
106 | context.stroke(); | ||
107 | context.restore(); | ||
108 | |||
109 | // Layer 3 | ||
110 | |||
111 | stroke = aThickness; | ||
112 | stroke *= resolution; | ||
113 | if (stroke < 1.0) | ||
114 | stroke = Math.ceil(stroke); | ||
115 | else | ||
116 | stroke = Math.round(stroke); | ||
117 | stroke /= resolution; | ||
118 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
119 | context.save(); | ||
120 | context.translate(22.5, 20.0); | ||
121 | context.rotate(-0.071); | ||
122 | context.translate(-22.5, -20.0); | ||
123 | context.beginPath(); | ||
124 | pointX = 33.5; | ||
125 | pointY = 28.5; | ||
126 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
127 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
128 | context.moveTo(pointX, pointY); | ||
129 | pointX = 33.5; | ||
130 | pointY = 11.5; | ||
131 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
132 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
133 | context.lineTo(pointX, pointY); | ||
134 | pointX = 11.5; | ||
135 | pointY = 11.5; | ||
136 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
137 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
138 | context.lineTo(pointX, pointY); | ||
139 | pointX = 11.5; | ||
140 | pointY = 28.5; | ||
141 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
142 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
143 | context.lineTo(pointX, pointY); | ||
144 | pointX = 33.5; | ||
145 | pointY = 28.5; | ||
146 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
147 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
148 | context.lineTo(pointX, pointY); | ||
149 | context.closePath(); | ||
150 | context.fillStyle = aFillColor; | ||
151 | context.fill(); | ||
152 | context.strokeStyle = aColor; | ||
153 | context.lineWidth = stroke; | ||
154 | context.lineCap = "square"; | ||
155 | context.stroke(); | ||
156 | context.restore(); | ||
157 | |||
158 | // Layer 4 | ||
159 | |||
160 | stroke = aThickness; | ||
161 | stroke *= resolution; | ||
162 | if (stroke < 1.0) | ||
163 | stroke = Math.ceil(stroke); | ||
164 | else | ||
165 | stroke = Math.round(stroke); | ||
166 | stroke /= resolution; | ||
167 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
168 | context.save(); | ||
169 | context.translate(27.5, 18.0); | ||
170 | context.rotate(0.232); | ||
171 | context.translate(-27.5, -18.0); | ||
172 | context.beginPath(); | ||
173 | pointX = 38.5; | ||
174 | pointY = 26.5; | ||
175 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
176 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
177 | context.moveTo(pointX, pointY); | ||
178 | pointX = 38.5; | ||
179 | pointY = 9.5; | ||
180 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
181 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
182 | context.lineTo(pointX, pointY); | ||
183 | pointX = 16.5; | ||
184 | pointY = 9.5; | ||
185 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
186 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
187 | context.lineTo(pointX, pointY); | ||
188 | pointX = 16.5; | ||
189 | pointY = 26.5; | ||
190 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
191 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
192 | context.lineTo(pointX, pointY); | ||
193 | pointX = 38.5; | ||
194 | pointY = 26.5; | ||
195 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
196 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
197 | context.lineTo(pointX, pointY); | ||
198 | context.closePath(); | ||
199 | context.fillStyle = aFillColor; | ||
200 | context.fill(); | ||
201 | context.strokeStyle = aColor; | ||
202 | context.lineWidth = stroke; | ||
203 | context.lineCap = "square"; | ||
204 | context.stroke(); | ||
205 | context.restore(); | ||
206 | |||
207 | context.restore(); | ||
208 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js new file mode 100644 index 0000000..9c4e5ba --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js | |||
@@ -0,0 +1,209 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //directLogin.js | ||
31 | //directLogin | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Features_directLoginWidth = 76.0; | ||
39 | var kClipperz_PM_UI_Canvas_Features_directLoginHeight = 76.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Features_directLogin(canvas, aColor, aBannerColor, aBannerBackgroundColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var stroke; | ||
47 | var path; | ||
48 | var pointX; | ||
49 | var pointY; | ||
50 | if (window.devicePixelRatio) | ||
51 | resolution = window.devicePixelRatio; | ||
52 | else | ||
53 | resolution = 1.0; | ||
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); | ||
55 | |||
56 | context.save(); | ||
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); | ||
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_directLoginWidth, kClipperz_PM_UI_Canvas_Features_directLoginHeight); | ||
59 | |||
60 | // Layer 2 | ||
61 | |||
62 | stroke = 6.0; | ||
63 | stroke *= resolution; | ||
64 | if (stroke < 1.0) | ||
65 | stroke = Math.ceil(stroke); | ||
66 | else | ||
67 | stroke = Math.round(stroke); | ||
68 | stroke /= resolution; | ||
69 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
70 | context.beginPath(); | ||
71 | pointX = 30.0; | ||
72 | pointY = 41.0; | ||
73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
75 | context.moveTo(pointX, pointY); | ||
76 | pointX = 45.579; | ||
77 | pointY = 25.451; | ||
78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
80 | context.lineTo(pointX, pointY); | ||
81 | context.strokeStyle = aColor; | ||
82 | context.lineWidth = stroke; | ||
83 | context.lineCap = "square"; | ||
84 | context.stroke(); | ||
85 | |||
86 | alignStroke = 0.0; | ||
87 | context.beginPath(); | ||
88 | pointX = 34.207; | ||
89 | pointY = 45.697; | ||
90 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
91 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
92 | context.moveTo(pointX, pointY); | ||
93 | pointX = 24.101; | ||
94 | pointY = 37.52; | ||
95 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
96 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
97 | context.lineTo(pointX, pointY); | ||
98 | pointX = 24.122; | ||
99 | pointY = 47.828; | ||
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
102 | context.lineTo(pointX, pointY); | ||
103 | pointX = 34.207; | ||
104 | pointY = 45.697; | ||
105 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
106 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
107 | context.lineTo(pointX, pointY); | ||
108 | context.closePath(); | ||
109 | context.fillStyle = aColor; | ||
110 | context.fill(); | ||
111 | |||
112 | stroke = 6.0; | ||
113 | stroke *= resolution; | ||
114 | if (stroke < 1.0) | ||
115 | stroke = Math.ceil(stroke); | ||
116 | else | ||
117 | stroke = Math.round(stroke); | ||
118 | stroke /= resolution; | ||
119 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
120 | context.beginPath(); | ||
121 | pointX = 24.631; | ||
122 | pointY = 28.971; | ||
123 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
124 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
125 | context.moveTo(pointX, pointY); | ||
126 | pointX = 46.497; | ||
127 | pointY = 26.451; | ||
128 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
129 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
130 | context.lineTo(pointX, pointY); | ||
131 | context.strokeStyle = aColor; | ||
132 | context.stroke(); | ||
133 | |||
134 | alignStroke = 0.0; | ||
135 | context.beginPath(); | ||
136 | pointX = 25.014; | ||
137 | pointY = 35.265; | ||
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
140 | context.moveTo(pointX, pointY); | ||
141 | pointX = 22.166; | ||
142 | pointY = 22.58; | ||
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
145 | context.lineTo(pointX, pointY); | ||
146 | pointX = 15.784; | ||
147 | pointY = 30.675; | ||
148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
150 | context.lineTo(pointX, pointY); | ||
151 | pointX = 25.014; | ||
152 | pointY = 35.265; | ||
153 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
154 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
155 | context.lineTo(pointX, pointY); | ||
156 | context.closePath(); | ||
157 | context.fillStyle = aColor; | ||
158 | context.fill(); | ||
159 | |||
160 | stroke = 6.0; | ||
161 | stroke *= resolution; | ||
162 | if (stroke < 1.0) | ||
163 | stroke = Math.ceil(stroke); | ||
164 | else | ||
165 | stroke = Math.round(stroke); | ||
166 | stroke /= resolution; | ||
167 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
168 | context.beginPath(); | ||
169 | pointX = 42.282; | ||
170 | pointY = 47.03; | ||
171 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
172 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
173 | context.moveTo(pointX, pointY); | ||
174 | pointX = 47.771; | ||
175 | pointY = 25.714; | ||
176 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
177 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
178 | context.lineTo(pointX, pointY); | ||
179 | context.strokeStyle = aColor; | ||
180 | context.stroke(); | ||
181 | |||
182 | alignStroke = 0.0; | ||
183 | context.beginPath(); | ||
184 | pointX = 48.294; | ||
185 | pointY = 48.929; | ||
186 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
187 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
188 | context.moveTo(pointX, pointY); | ||
189 | pointX = 35.432; | ||
190 | pointY = 47.039; | ||
191 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
192 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
193 | context.lineTo(pointX, pointY); | ||
194 | pointX = 40.7; | ||
195 | pointY = 55.899; | ||
196 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
197 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
198 | context.lineTo(pointX, pointY); | ||
199 | pointX = 48.294; | ||
200 | pointY = 48.929; | ||
201 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
202 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
203 | context.lineTo(pointX, pointY); | ||
204 | context.closePath(); | ||
205 | context.fillStyle = aColor; | ||
206 | context.fill(); | ||
207 | |||
208 | context.restore(); | ||
209 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js new file mode 100644 index 0000000..501b69b --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js | |||
@@ -0,0 +1,237 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //protect.js | ||
31 | //protect | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Features_protectWidth = 76.0; | ||
39 | var kClipperz_PM_UI_Canvas_Features_protectHeight = 76.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Features_protect(canvas, aColor, aBannerColor, aBannerBackgroundColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | var controlPoint1X; | ||
50 | var controlPoint1Y; | ||
51 | var controlPoint2X; | ||
52 | var controlPoint2Y; | ||
53 | var stroke; | ||
54 | if (window.devicePixelRatio) | ||
55 | resolution = window.devicePixelRatio; | ||
56 | else | ||
57 | resolution = 1.0; | ||
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); | ||
59 | |||
60 | context.save(); | ||
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); | ||
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_protectWidth, kClipperz_PM_UI_Canvas_Features_protectHeight); | ||
63 | |||
64 | // Layer 1 | ||
65 | |||
66 | alignStroke = 0.0; | ||
67 | context.beginPath(); | ||
68 | pointX = 38.5; | ||
69 | pointY = 36.0; | ||
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
72 | context.moveTo(pointX, pointY); | ||
73 | pointX = 37.068; | ||
74 | pointY = 38.816; | ||
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
77 | controlPoint1X = 37.41; | ||
78 | controlPoint1Y = 36.234; | ||
79 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
80 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
81 | controlPoint2X = 37.175; | ||
82 | controlPoint2Y = 37.907; | ||
83 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
84 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
85 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
86 | pointX = 37.031; | ||
87 | pointY = 40.802; | ||
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
90 | controlPoint1X = 36.991; | ||
91 | controlPoint1Y = 39.474; | ||
92 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
93 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
94 | controlPoint2X = 36.98; | ||
95 | controlPoint2Y = 40.141; | ||
96 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
97 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
98 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
99 | pointX = 37.258; | ||
100 | pointY = 42.23; | ||
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
103 | controlPoint1X = 37.068; | ||
104 | controlPoint1Y = 41.283; | ||
105 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
106 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
107 | controlPoint2X = 37.139; | ||
108 | controlPoint2Y = 41.762; | ||
109 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
110 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
111 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
112 | pointX = 38.348; | ||
113 | pointY = 43.979; | ||
114 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
115 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
116 | controlPoint1X = 37.402; | ||
117 | controlPoint1Y = 42.799; | ||
118 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
119 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
120 | controlPoint2X = 37.682; | ||
121 | controlPoint2Y = 43.798; | ||
122 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
123 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
124 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
125 | pointX = 38.5; | ||
126 | pointY = 36.0; | ||
127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
129 | controlPoint1X = 40.249; | ||
130 | controlPoint1Y = 44.497; | ||
131 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
132 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
133 | controlPoint2X = 40.723; | ||
134 | controlPoint2Y = 36.303; | ||
135 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
136 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
137 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
138 | pointX = 38.5; | ||
139 | pointY = 36.0; | ||
140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
142 | context.lineTo(pointX, pointY); | ||
143 | context.closePath(); | ||
144 | pointX = 50.0; | ||
145 | pointY = 52.0; | ||
146 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
147 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
148 | context.moveTo(pointX, pointY); | ||
149 | pointX = 26.0; | ||
150 | pointY = 52.0; | ||
151 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
152 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
153 | context.lineTo(pointX, pointY); | ||
154 | pointX = 26.0; | ||
155 | pointY = 33.0; | ||
156 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
157 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
158 | context.lineTo(pointX, pointY); | ||
159 | pointX = 50.0; | ||
160 | pointY = 33.0; | ||
161 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
162 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
163 | context.lineTo(pointX, pointY); | ||
164 | pointX = 50.0; | ||
165 | pointY = 52.0; | ||
166 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
167 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
168 | context.lineTo(pointX, pointY); | ||
169 | context.closePath(); | ||
170 | context.fillStyle = aColor; | ||
171 | context.fill(); | ||
172 | |||
173 | alignStroke = 0.0; | ||
174 | context.beginPath(); | ||
175 | pointX = 47.0; | ||
176 | pointY = 32.463; | ||
177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
179 | context.moveTo(pointX, pointY); | ||
180 | pointX = 38.0; | ||
181 | pointY = 52.0; | ||
182 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
183 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
184 | controlPoint1X = 47.0; | ||
185 | controlPoint1Y = 52.925; | ||
186 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
187 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
188 | controlPoint2X = 38.0; | ||
189 | controlPoint2Y = 52.0; | ||
190 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
191 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
192 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
193 | pointX = 29.0; | ||
194 | pointY = 32.463; | ||
195 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
196 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
197 | controlPoint1X = 38.0; | ||
198 | controlPoint1Y = 52.0; | ||
199 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
200 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
201 | controlPoint2X = 29.0; | ||
202 | controlPoint2Y = 52.925; | ||
203 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
204 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
205 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
206 | pointX = 47.0; | ||
207 | pointY = 32.463; | ||
208 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
209 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
210 | controlPoint1X = 29.0; | ||
211 | controlPoint1Y = 12.0; | ||
212 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
213 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
214 | controlPoint2X = 47.0; | ||
215 | controlPoint2Y = 12.0; | ||
216 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
217 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
218 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
219 | context.closePath(); | ||
220 | context.strokeStyle = aColor; | ||
221 | stroke = 4.0; | ||
222 | stroke *= resolution; | ||
223 | if (stroke < 1.0) | ||
224 | stroke = Math.ceil(stroke); | ||
225 | else | ||
226 | stroke = Math.round(stroke); | ||
227 | stroke /= resolution; | ||
228 | stroke *= 2.0; | ||
229 | context.lineWidth = stroke; | ||
230 | context.lineCap = "square"; | ||
231 | context.save(); | ||
232 | context.clip(); | ||
233 | context.stroke(); | ||
234 | context.restore(); | ||
235 | |||
236 | context.restore(); | ||
237 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js new file mode 100644 index 0000000..825a17e --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js | |||
@@ -0,0 +1,1719 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //share.js | ||
31 | //share | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Features_shareWidth = 76.0; | ||
39 | var kClipperz_PM_UI_Canvas_Features_shareHeight = 76.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Features_share(canvas, aColor, aBannerColor, aBannerBackgroundColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | var controlPoint1X; | ||
50 | var controlPoint1Y; | ||
51 | var controlPoint2X; | ||
52 | var controlPoint2Y; | ||
53 | var stroke; | ||
54 | if (window.devicePixelRatio) | ||
55 | resolution = window.devicePixelRatio; | ||
56 | else | ||
57 | resolution = 1.0; | ||
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); | ||
59 | |||
60 | context.save(); | ||
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); | ||
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_shareWidth, kClipperz_PM_UI_Canvas_Features_shareHeight); | ||
63 | |||
64 | // Layer 1 | ||
65 | |||
66 | alignStroke = 0.0; | ||
67 | context.beginPath(); | ||
68 | pointX = 43.179; | ||
69 | pointY = 18.621; | ||
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
72 | context.moveTo(pointX, pointY); | ||
73 | pointX = 37.163; | ||
74 | pointY = 12.605; | ||
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
77 | controlPoint1X = 43.179; | ||
78 | controlPoint1Y = 15.32; | ||
79 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
80 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
81 | controlPoint2X = 40.463; | ||
82 | controlPoint2Y = 12.605; | ||
83 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
84 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
85 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
86 | pointX = 31.147; | ||
87 | pointY = 18.621; | ||
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
90 | controlPoint1X = 33.863; | ||
91 | controlPoint1Y = 12.605; | ||
92 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
93 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
94 | controlPoint2X = 31.147; | ||
95 | controlPoint2Y = 15.32; | ||
96 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
97 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
98 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
99 | pointX = 37.163; | ||
100 | pointY = 24.637; | ||
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
103 | controlPoint1X = 31.147; | ||
104 | controlPoint1Y = 21.921; | ||
105 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
106 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
107 | controlPoint2X = 33.863; | ||
108 | controlPoint2Y = 24.637; | ||
109 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
110 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
111 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
112 | pointX = 43.179; | ||
113 | pointY = 18.621; | ||
114 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
115 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
116 | controlPoint1X = 40.463; | ||
117 | controlPoint1Y = 24.637; | ||
118 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
119 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
120 | controlPoint2X = 43.179; | ||
121 | controlPoint2Y = 21.921; | ||
122 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
123 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
124 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
125 | context.closePath(); | ||
126 | context.fillStyle = aColor; | ||
127 | context.fill(); | ||
128 | |||
129 | alignStroke = 0.0; | ||
130 | context.beginPath(); | ||
131 | pointX = 56.548; | ||
132 | pointY = 53.379; | ||
133 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
134 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
135 | context.moveTo(pointX, pointY); | ||
136 | pointX = 51.2; | ||
137 | pointY = 48.032; | ||
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
140 | controlPoint1X = 56.548; | ||
141 | controlPoint1Y = 50.446; | ||
142 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
143 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
144 | controlPoint2X = 54.134; | ||
145 | controlPoint2Y = 48.032; | ||
146 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
147 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
148 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
149 | pointX = 45.853; | ||
150 | pointY = 53.379; | ||
151 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
152 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
153 | controlPoint1X = 48.267; | ||
154 | controlPoint1Y = 48.032; | ||
155 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
156 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
157 | controlPoint2X = 45.853; | ||
158 | controlPoint2Y = 50.446; | ||
159 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
160 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
161 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
162 | pointX = 51.2; | ||
163 | pointY = 58.727; | ||
164 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
165 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
166 | controlPoint1X = 45.853; | ||
167 | controlPoint1Y = 56.313; | ||
168 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
169 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
170 | controlPoint2X = 48.267; | ||
171 | controlPoint2Y = 58.727; | ||
172 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
173 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
174 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
175 | pointX = 56.548; | ||
176 | pointY = 53.379; | ||
177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
179 | controlPoint1X = 54.134; | ||
180 | controlPoint1Y = 58.727; | ||
181 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
182 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
183 | controlPoint2X = 56.548; | ||
184 | controlPoint2Y = 56.313; | ||
185 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
186 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
187 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
188 | context.closePath(); | ||
189 | context.fillStyle = aColor; | ||
190 | context.fill(); | ||
191 | |||
192 | alignStroke = 0.0; | ||
193 | context.beginPath(); | ||
194 | pointX = 31.147; | ||
195 | pointY = 38.674; | ||
196 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
197 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
198 | context.moveTo(pointX, pointY); | ||
199 | pointX = 25.8; | ||
200 | pointY = 33.326; | ||
201 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
202 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
203 | controlPoint1X = 31.147; | ||
204 | controlPoint1Y = 35.74; | ||
205 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
206 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
207 | controlPoint2X = 28.733; | ||
208 | controlPoint2Y = 33.326; | ||
209 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
210 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
211 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
212 | pointX = 20.452; | ||
213 | pointY = 38.674; | ||
214 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
215 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
216 | controlPoint1X = 22.866; | ||
217 | controlPoint1Y = 33.326; | ||
218 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
219 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
220 | controlPoint2X = 20.452; | ||
221 | controlPoint2Y = 35.74; | ||
222 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
223 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
224 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
225 | pointX = 25.8; | ||
226 | pointY = 44.021; | ||
227 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
228 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
229 | controlPoint1X = 20.452; | ||
230 | controlPoint1Y = 41.607; | ||
231 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
232 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
233 | controlPoint2X = 22.866; | ||
234 | controlPoint2Y = 44.021; | ||
235 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
236 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
237 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
238 | pointX = 31.147; | ||
239 | pointY = 38.674; | ||
240 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
241 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
242 | controlPoint1X = 28.733; | ||
243 | controlPoint1Y = 44.021; | ||
244 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
245 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
246 | controlPoint2X = 31.147; | ||
247 | controlPoint2Y = 41.607; | ||
248 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
249 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
250 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
251 | context.closePath(); | ||
252 | context.fillStyle = aColor; | ||
253 | context.fill(); | ||
254 | |||
255 | alignStroke = 0.0; | ||
256 | context.beginPath(); | ||
257 | pointX = 39.168; | ||
258 | pointY = 48.032; | ||
259 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
260 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
261 | context.moveTo(pointX, pointY); | ||
262 | pointX = 33.821; | ||
263 | pointY = 42.684; | ||
264 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
265 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
266 | controlPoint1X = 39.168; | ||
267 | controlPoint1Y = 45.098; | ||
268 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
269 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
270 | controlPoint2X = 36.754; | ||
271 | controlPoint2Y = 42.684; | ||
272 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
273 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
274 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
275 | pointX = 28.473; | ||
276 | pointY = 48.032; | ||
277 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
278 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
279 | controlPoint1X = 30.887; | ||
280 | controlPoint1Y = 42.684; | ||
281 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
282 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
283 | controlPoint2X = 28.473; | ||
284 | controlPoint2Y = 45.098; | ||
285 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
286 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
287 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
288 | pointX = 33.821; | ||
289 | pointY = 53.379; | ||
290 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
291 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
292 | controlPoint1X = 28.473; | ||
293 | controlPoint1Y = 50.965; | ||
294 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
295 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
296 | controlPoint2X = 30.887; | ||
297 | controlPoint2Y = 53.379; | ||
298 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
299 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
300 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
301 | pointX = 39.168; | ||
302 | pointY = 48.032; | ||
303 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
304 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
305 | controlPoint1X = 36.754; | ||
306 | controlPoint1Y = 53.379; | ||
307 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
308 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
309 | controlPoint2X = 39.168; | ||
310 | controlPoint2Y = 50.965; | ||
311 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
312 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
313 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
314 | context.closePath(); | ||
315 | context.fillStyle = aColor; | ||
316 | context.fill(); | ||
317 | |||
318 | alignStroke = 0.0; | ||
319 | context.beginPath(); | ||
320 | pointX = 56.548; | ||
321 | pointY = 29.984; | ||
322 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
323 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
324 | context.moveTo(pointX, pointY); | ||
325 | pointX = 53.206; | ||
326 | pointY = 26.642; | ||
327 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
328 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
329 | controlPoint1X = 56.548; | ||
330 | controlPoint1Y = 28.151; | ||
331 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
332 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
333 | controlPoint2X = 55.039; | ||
334 | controlPoint2Y = 26.642; | ||
335 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
336 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
337 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
338 | pointX = 49.863; | ||
339 | pointY = 29.984; | ||
340 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
341 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
342 | controlPoint1X = 51.372; | ||
343 | controlPoint1Y = 26.642; | ||
344 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
345 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
346 | controlPoint2X = 49.863; | ||
347 | controlPoint2Y = 28.151; | ||
348 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
349 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
350 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
351 | pointX = 53.206; | ||
352 | pointY = 33.326; | ||
353 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
354 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
355 | controlPoint1X = 49.863; | ||
356 | controlPoint1Y = 31.817; | ||
357 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
358 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
359 | controlPoint2X = 51.372; | ||
360 | controlPoint2Y = 33.326; | ||
361 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
362 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
363 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
364 | pointX = 56.548; | ||
365 | pointY = 29.984; | ||
366 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
367 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
368 | controlPoint1X = 55.039; | ||
369 | controlPoint1Y = 33.326; | ||
370 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
371 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
372 | controlPoint2X = 56.548; | ||
373 | controlPoint2Y = 31.817; | ||
374 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
375 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
376 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
377 | context.closePath(); | ||
378 | context.fillStyle = aColor; | ||
379 | context.fill(); | ||
380 | |||
381 | alignStroke = 0.0; | ||
382 | context.beginPath(); | ||
383 | pointX = 49.863; | ||
384 | pointY = 39.342; | ||
385 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
386 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
387 | context.moveTo(pointX, pointY); | ||
388 | pointX = 46.521; | ||
389 | pointY = 36.0; | ||
390 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
391 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
392 | controlPoint1X = 49.863; | ||
393 | controlPoint1Y = 37.509; | ||
394 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
395 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
396 | controlPoint2X = 48.355; | ||
397 | controlPoint2Y = 36.0; | ||
398 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
399 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
400 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
401 | pointX = 43.179; | ||
402 | pointY = 39.342; | ||
403 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
404 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
405 | controlPoint1X = 44.688; | ||
406 | controlPoint1Y = 36.0; | ||
407 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
408 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
409 | controlPoint2X = 43.179; | ||
410 | controlPoint2Y = 37.509; | ||
411 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
412 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
413 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
414 | pointX = 46.521; | ||
415 | pointY = 42.684; | ||
416 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
417 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
418 | controlPoint1X = 43.179; | ||
419 | controlPoint1Y = 41.176; | ||
420 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
421 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
422 | controlPoint2X = 44.688; | ||
423 | controlPoint2Y = 42.684; | ||
424 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
425 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
426 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
427 | pointX = 49.863; | ||
428 | pointY = 39.342; | ||
429 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
430 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
431 | controlPoint1X = 48.355; | ||
432 | controlPoint1Y = 42.684; | ||
433 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
434 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
435 | controlPoint2X = 49.863; | ||
436 | controlPoint2Y = 41.176; | ||
437 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
438 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
439 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
440 | context.closePath(); | ||
441 | context.fillStyle = aColor; | ||
442 | context.fill(); | ||
443 | |||
444 | stroke = 1.0; | ||
445 | stroke *= resolution; | ||
446 | if (stroke < 1.0) | ||
447 | stroke = Math.ceil(stroke); | ||
448 | else | ||
449 | stroke = Math.round(stroke); | ||
450 | stroke /= resolution; | ||
451 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
452 | context.beginPath(); | ||
453 | pointX = 37.163; | ||
454 | pointY = 19.289; | ||
455 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
456 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
457 | context.moveTo(pointX, pointY); | ||
458 | pointX = 53.206; | ||
459 | pointY = 29.984; | ||
460 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
461 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
462 | context.lineTo(pointX, pointY); | ||
463 | context.strokeStyle = aColor; | ||
464 | context.lineWidth = stroke; | ||
465 | context.lineCap = "square"; | ||
466 | context.stroke(); | ||
467 | |||
468 | stroke = 1.0; | ||
469 | stroke *= resolution; | ||
470 | if (stroke < 1.0) | ||
471 | stroke = Math.ceil(stroke); | ||
472 | else | ||
473 | stroke = Math.round(stroke); | ||
474 | stroke /= resolution; | ||
475 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
476 | context.beginPath(); | ||
477 | pointX = 50.532; | ||
478 | pointY = 54.048; | ||
479 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
480 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
481 | context.moveTo(pointX, pointY); | ||
482 | pointX = 37.163; | ||
483 | pointY = 48.7; | ||
484 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
485 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
486 | context.lineTo(pointX, pointY); | ||
487 | context.strokeStyle = aColor; | ||
488 | context.stroke(); | ||
489 | |||
490 | stroke = 1.0; | ||
491 | stroke *= resolution; | ||
492 | if (stroke < 1.0) | ||
493 | stroke = Math.ceil(stroke); | ||
494 | else | ||
495 | stroke = Math.round(stroke); | ||
496 | stroke /= resolution; | ||
497 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
498 | context.beginPath(); | ||
499 | pointX = 27.805; | ||
500 | pointY = 33.995; | ||
501 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
502 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
503 | context.moveTo(pointX, pointY); | ||
504 | pointX = 33.153; | ||
505 | pointY = 24.637; | ||
506 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
507 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
508 | context.lineTo(pointX, pointY); | ||
509 | context.strokeStyle = aColor; | ||
510 | context.stroke(); | ||
511 | |||
512 | stroke = 1.0; | ||
513 | stroke *= resolution; | ||
514 | if (stroke < 1.0) | ||
515 | stroke = Math.ceil(stroke); | ||
516 | else | ||
517 | stroke = Math.round(stroke); | ||
518 | stroke /= resolution; | ||
519 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
520 | context.beginPath(); | ||
521 | pointX = 38.5; | ||
522 | pointY = 24.637; | ||
523 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
524 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
525 | context.moveTo(pointX, pointY); | ||
526 | pointX = 45.184; | ||
527 | pointY = 36.668; | ||
528 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
529 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
530 | context.lineTo(pointX, pointY); | ||
531 | context.strokeStyle = aColor; | ||
532 | context.stroke(); | ||
533 | |||
534 | stroke = 1.0; | ||
535 | stroke *= resolution; | ||
536 | if (stroke < 1.0) | ||
537 | stroke = Math.ceil(stroke); | ||
538 | else | ||
539 | stroke = Math.round(stroke); | ||
540 | stroke /= resolution; | ||
541 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
542 | context.beginPath(); | ||
543 | pointX = 37.163; | ||
544 | pointY = 19.289; | ||
545 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
546 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
547 | context.moveTo(pointX, pointY); | ||
548 | pointX = 34.155; | ||
549 | pointY = 44.857; | ||
550 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
551 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
552 | context.lineTo(pointX, pointY); | ||
553 | context.strokeStyle = aColor; | ||
554 | context.stroke(); | ||
555 | |||
556 | stroke = 1.0; | ||
557 | stroke *= resolution; | ||
558 | if (stroke < 1.0) | ||
559 | stroke = Math.ceil(stroke); | ||
560 | else | ||
561 | stroke = Math.round(stroke); | ||
562 | stroke /= resolution; | ||
563 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
564 | context.beginPath(); | ||
565 | pointX = 26.468; | ||
566 | pointY = 36.668; | ||
567 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
568 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
569 | context.moveTo(pointX, pointY); | ||
570 | pointX = 52.871; | ||
571 | pointY = 30.151; | ||
572 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
573 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
574 | context.lineTo(pointX, pointY); | ||
575 | context.strokeStyle = aColor; | ||
576 | context.stroke(); | ||
577 | |||
578 | stroke = 1.0; | ||
579 | stroke *= resolution; | ||
580 | if (stroke < 1.0) | ||
581 | stroke = Math.ceil(stroke); | ||
582 | else | ||
583 | stroke = Math.round(stroke); | ||
584 | stroke /= resolution; | ||
585 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
586 | context.beginPath(); | ||
587 | pointX = 53.206; | ||
588 | pointY = 31.321; | ||
589 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
590 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
591 | context.moveTo(pointX, pointY); | ||
592 | pointX = 51.535; | ||
593 | pointY = 52.878; | ||
594 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
595 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
596 | context.lineTo(pointX, pointY); | ||
597 | context.strokeStyle = aColor; | ||
598 | context.stroke(); | ||
599 | |||
600 | stroke = 1.0; | ||
601 | stroke *= resolution; | ||
602 | if (stroke < 1.0) | ||
603 | stroke = Math.ceil(stroke); | ||
604 | else | ||
605 | stroke = Math.round(stroke); | ||
606 | stroke /= resolution; | ||
607 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
608 | context.beginPath(); | ||
609 | pointX = 26.468; | ||
610 | pointY = 38.005; | ||
611 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
612 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
613 | context.moveTo(pointX, pointY); | ||
614 | pointX = 46.856; | ||
615 | pointY = 39.175; | ||
616 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
617 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
618 | context.lineTo(pointX, pointY); | ||
619 | context.strokeStyle = aColor; | ||
620 | context.stroke(); | ||
621 | |||
622 | stroke = 1.0; | ||
623 | stroke *= resolution; | ||
624 | if (stroke < 1.0) | ||
625 | stroke = Math.ceil(stroke); | ||
626 | else | ||
627 | stroke = Math.round(stroke); | ||
628 | stroke /= resolution; | ||
629 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
630 | context.beginPath(); | ||
631 | pointX = 26.468; | ||
632 | pointY = 38.005; | ||
633 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
634 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
635 | context.moveTo(pointX, pointY); | ||
636 | pointX = 34.489; | ||
637 | pointY = 48.7; | ||
638 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
639 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
640 | context.lineTo(pointX, pointY); | ||
641 | context.strokeStyle = aColor; | ||
642 | context.stroke(); | ||
643 | |||
644 | stroke = 1.0; | ||
645 | stroke *= resolution; | ||
646 | if (stroke < 1.0) | ||
647 | stroke = Math.ceil(stroke); | ||
648 | else | ||
649 | stroke = Math.round(stroke); | ||
650 | stroke /= resolution; | ||
651 | alignStroke = (0.5 * stroke * resolution) % 1.0; | ||
652 | context.beginPath(); | ||
653 | pointX = 34.489; | ||
654 | pointY = 48.7; | ||
655 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
656 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
657 | context.moveTo(pointX, pointY); | ||
658 | pointX = 46.521; | ||
659 | pointY = 39.342; | ||
660 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
661 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
662 | context.lineTo(pointX, pointY); | ||
663 | context.strokeStyle = aColor; | ||
664 | context.stroke(); | ||
665 | |||
666 | // Layer 2 | ||
667 | |||
668 | alignStroke = 0.0; | ||
669 | context.beginPath(); | ||
670 | pointX = 38.974; | ||
671 | pointY = 0.013; | ||
672 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
673 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
674 | context.moveTo(pointX, pointY); | ||
675 | pointX = 53.593; | ||
676 | pointY = 3.386; | ||
677 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
678 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
679 | controlPoint1X = 44.035; | ||
680 | controlPoint1Y = 0.11; | ||
681 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
682 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
683 | controlPoint2X = 48.977; | ||
684 | controlPoint2Y = 1.35; | ||
685 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
686 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
687 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
688 | pointX = 3.386; | ||
689 | pointY = 53.593; | ||
690 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
691 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
692 | context.lineTo(pointX, pointY); | ||
693 | pointX = 0.011; | ||
694 | pointY = 37.17; | ||
695 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
696 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
697 | controlPoint1X = 1.013; | ||
698 | controlPoint1Y = 48.448; | ||
699 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
700 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
701 | controlPoint2X = -0.062; | ||
702 | controlPoint2Y = 42.82; | ||
703 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
704 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
705 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
706 | pointX = 37.17; | ||
707 | pointY = 0.011; | ||
708 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
709 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
710 | context.lineTo(pointX, pointY); | ||
711 | pointX = 38.974; | ||
712 | pointY = 0.013; | ||
713 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
714 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
715 | controlPoint1X = 38.325; | ||
716 | controlPoint1Y = -0.004; | ||
717 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
718 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
719 | controlPoint2X = 37.723; | ||
720 | controlPoint2Y = -0.004; | ||
721 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
722 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
723 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
724 | pointX = 38.974; | ||
725 | pointY = 0.013; | ||
726 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
727 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
728 | context.lineTo(pointX, pointY); | ||
729 | context.closePath(); | ||
730 | context.fillStyle = aBannerBackgroundColor; | ||
731 | context.fill(); | ||
732 | |||
733 | alignStroke = 0.0; | ||
734 | context.beginPath(); | ||
735 | pointX = 6.58; | ||
736 | pointY = 36.628; | ||
737 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
738 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
739 | context.moveTo(pointX, pointY); | ||
740 | pointX = 7.533; | ||
741 | pointY = 34.418; | ||
742 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
743 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
744 | controlPoint1X = 6.575; | ||
745 | controlPoint1Y = 35.794; | ||
746 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
747 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
748 | controlPoint2X = 6.893; | ||
749 | controlPoint2Y = 35.058; | ||
750 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
751 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
752 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
753 | pointX = 10.253; | ||
754 | pointY = 33.382; | ||
755 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
756 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
757 | controlPoint1X = 8.389; | ||
758 | controlPoint1Y = 33.562; | ||
759 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
760 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
761 | controlPoint2X = 9.296; | ||
762 | controlPoint2Y = 33.216; | ||
763 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
764 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
765 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
766 | pointX = 11.555; | ||
767 | pointY = 33.979; | ||
768 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
769 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
770 | controlPoint1X = 10.787; | ||
771 | controlPoint1Y = 33.479; | ||
772 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
773 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
774 | controlPoint2X = 11.221; | ||
775 | controlPoint2Y = 33.678; | ||
776 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
777 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
778 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
779 | pointX = 10.492; | ||
780 | pointY = 35.043; | ||
781 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
782 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
783 | context.lineTo(pointX, pointY); | ||
784 | pointX = 9.673; | ||
785 | pointY = 34.756; | ||
786 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
787 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
788 | controlPoint1X = 10.179; | ||
789 | controlPoint1Y = 34.868; | ||
790 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
791 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
792 | controlPoint2X = 9.906; | ||
793 | controlPoint2Y = 34.772; | ||
794 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
795 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
796 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
797 | pointX = 8.482; | ||
798 | pointY = 35.285; | ||
799 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
800 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
801 | controlPoint1X = 9.259; | ||
802 | controlPoint1Y = 34.729; | ||
803 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
804 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
805 | controlPoint2X = 8.862; | ||
806 | controlPoint2Y = 34.905; | ||
807 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
808 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
809 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
810 | pointX = 8.035; | ||
811 | pointY = 36.667; | ||
812 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
813 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
814 | controlPoint1X = 8.095; | ||
815 | controlPoint1Y = 35.671; | ||
816 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
817 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
818 | controlPoint2X = 7.946; | ||
819 | controlPoint2Y = 36.132; | ||
820 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
821 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
822 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
823 | pointX = 9.024; | ||
824 | pointY = 38.326; | ||
825 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
826 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
827 | controlPoint1X = 8.124; | ||
828 | controlPoint1Y = 37.203; | ||
829 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
830 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
831 | controlPoint2X = 8.453; | ||
832 | controlPoint2Y = 37.756; | ||
833 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
834 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
835 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
836 | pointX = 10.661; | ||
837 | pointY = 39.255; | ||
838 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
839 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
840 | controlPoint1X = 9.595; | ||
841 | controlPoint1Y = 38.897; | ||
842 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
843 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
844 | controlPoint2X = 10.141; | ||
845 | controlPoint2Y = 39.207; | ||
846 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
847 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
848 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
849 | pointX = 11.987; | ||
850 | pointY = 38.782; | ||
851 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
852 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
853 | controlPoint1X = 11.181; | ||
854 | controlPoint1Y = 39.304; | ||
855 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
856 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
857 | controlPoint2X = 11.623; | ||
858 | controlPoint2Y = 39.146; | ||
859 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
860 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
861 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
862 | pointX = 12.473; | ||
863 | pointY = 37.563; | ||
864 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
865 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
866 | controlPoint1X = 12.359; | ||
867 | controlPoint1Y = 38.409; | ||
868 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
869 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
870 | controlPoint2X = 12.522; | ||
871 | controlPoint2Y = 38.003; | ||
872 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
873 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
874 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
875 | pointX = 12.152; | ||
876 | pointY = 36.704; | ||
877 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
878 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
879 | controlPoint1X = 12.45; | ||
880 | controlPoint1Y = 37.324; | ||
881 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
882 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
883 | controlPoint2X = 12.343; | ||
884 | controlPoint2Y = 37.037; | ||
885 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
886 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
887 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
888 | pointX = 13.205; | ||
889 | pointY = 35.651; | ||
890 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
891 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
892 | context.lineTo(pointX, pointY); | ||
893 | pointX = 13.853; | ||
894 | pointY = 37.71; | ||
895 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
896 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
897 | controlPoint1X = 13.668; | ||
898 | controlPoint1Y = 36.297; | ||
899 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
900 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
901 | controlPoint2X = 13.884; | ||
902 | controlPoint2Y = 36.984; | ||
903 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
904 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
905 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
906 | pointX = 12.919; | ||
907 | pointY = 39.687; | ||
908 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
909 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
910 | controlPoint1X = 13.822; | ||
911 | controlPoint1Y = 38.436; | ||
912 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
913 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
914 | controlPoint2X = 13.51; | ||
915 | controlPoint2Y = 39.095; | ||
916 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
917 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
918 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
919 | pointX = 10.488; | ||
920 | pointY = 40.709; | ||
921 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
922 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
923 | controlPoint1X = 12.187; | ||
924 | controlPoint1Y = 40.419; | ||
925 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
926 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
927 | controlPoint2X = 11.377; | ||
928 | controlPoint2Y = 40.759; | ||
929 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
930 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
931 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
932 | pointX = 7.919; | ||
933 | pointY = 39.397; | ||
934 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
935 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
936 | controlPoint1X = 9.597; | ||
937 | controlPoint1Y = 40.656; | ||
938 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
939 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
940 | controlPoint2X = 8.741; | ||
941 | controlPoint2Y = 40.218; | ||
942 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
943 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
944 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
945 | pointX = 6.58; | ||
946 | pointY = 36.628; | ||
947 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
948 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
949 | controlPoint1X = 7.031; | ||
950 | controlPoint1Y = 38.508; | ||
951 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
952 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
953 | controlPoint2X = 6.584; | ||
954 | controlPoint2Y = 37.585; | ||
955 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
956 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
957 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
958 | pointX = 6.58; | ||
959 | pointY = 36.628; | ||
960 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
961 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
962 | context.lineTo(pointX, pointY); | ||
963 | context.closePath(); | ||
964 | pointX = 17.778; | ||
965 | pointY = 32.093; | ||
966 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
967 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
968 | context.moveTo(pointX, pointY); | ||
969 | pointX = 16.824; | ||
970 | pointY = 30.396; | ||
971 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
972 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
973 | controlPoint1X = 17.715; | ||
974 | controlPoint1Y = 31.534; | ||
975 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
976 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
977 | controlPoint2X = 17.397; | ||
978 | controlPoint2Y = 30.969; | ||
979 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
980 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
981 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
982 | pointX = 15.129; | ||
983 | pointY = 29.443; | ||
984 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
985 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
986 | controlPoint1X = 16.253; | ||
987 | controlPoint1Y = 29.825; | ||
988 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
989 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
990 | controlPoint2X = 15.688; | ||
991 | controlPoint2Y = 29.507; | ||
992 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
993 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
994 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
995 | pointX = 13.658; | ||
996 | pointY = 29.978; | ||
997 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
998 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
999 | controlPoint1X = 14.569; | ||
1000 | controlPoint1Y = 29.378; | ||
1001 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1002 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1003 | controlPoint2X = 14.079; | ||
1004 | controlPoint2Y = 29.557; | ||
1005 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1006 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1007 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1008 | pointX = 13.116; | ||
1009 | pointY = 31.452; | ||
1010 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1011 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1012 | controlPoint1X = 13.236; | ||
1013 | controlPoint1Y = 30.399; | ||
1014 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1015 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1016 | controlPoint2X = 13.056; | ||
1017 | controlPoint2Y = 30.891; | ||
1018 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1019 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1020 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1021 | pointX = 14.065; | ||
1022 | pointY = 33.154; | ||
1023 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1024 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1025 | controlPoint1X = 13.175; | ||
1026 | controlPoint1Y = 32.014; | ||
1027 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1028 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1029 | controlPoint2X = 13.492; | ||
1030 | controlPoint2Y = 32.581; | ||
1031 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1032 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1033 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1034 | pointX = 15.767; | ||
1035 | pointY = 34.104; | ||
1036 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1037 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1038 | controlPoint1X = 14.638; | ||
1039 | controlPoint1Y = 33.727; | ||
1040 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1041 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1042 | controlPoint2X = 15.206; | ||
1043 | controlPoint2Y = 34.044; | ||
1044 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1045 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1046 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1047 | pointX = 17.242; | ||
1048 | pointY = 33.562; | ||
1049 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1050 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1051 | controlPoint1X = 16.329; | ||
1052 | controlPoint1Y = 34.164; | ||
1053 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1054 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1055 | controlPoint2X = 16.82; | ||
1056 | controlPoint2Y = 33.983; | ||
1057 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1058 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1059 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1060 | pointX = 17.778; | ||
1061 | pointY = 32.093; | ||
1062 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1063 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1064 | controlPoint1X = 17.663; | ||
1065 | controlPoint1Y = 33.14; | ||
1066 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1067 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1068 | controlPoint2X = 17.842; | ||
1069 | controlPoint2Y = 32.651; | ||
1070 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1071 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1072 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1073 | pointX = 17.778; | ||
1074 | pointY = 32.093; | ||
1075 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1076 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1077 | context.lineTo(pointX, pointY); | ||
1078 | context.closePath(); | ||
1079 | pointX = 19.216; | ||
1080 | pointY = 32.201; | ||
1081 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1082 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1083 | context.moveTo(pointX, pointY); | ||
1084 | pointX = 18.143; | ||
1085 | pointY = 34.463; | ||
1086 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1087 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1088 | controlPoint1X = 19.228; | ||
1089 | controlPoint1Y = 32.982; | ||
1090 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1091 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1092 | controlPoint2X = 18.87; | ||
1093 | controlPoint2Y = 33.736; | ||
1094 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1095 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1096 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1097 | pointX = 15.881; | ||
1098 | pointY = 35.537; | ||
1099 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1100 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1101 | controlPoint1X = 17.415; | ||
1102 | controlPoint1Y = 35.19; | ||
1103 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1104 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1105 | controlPoint2X = 16.661; | ||
1106 | controlPoint2Y = 35.548; | ||
1107 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1108 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1109 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1110 | pointX = 13.009; | ||
1111 | pointY = 34.211; | ||
1112 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1113 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1114 | controlPoint1X = 14.88; | ||
1115 | controlPoint1Y = 35.567; | ||
1116 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1117 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1118 | controlPoint2X = 13.922; | ||
1119 | controlPoint2Y = 35.125; | ||
1120 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1121 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1122 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1123 | pointX = 11.683; | ||
1124 | pointY = 31.338; | ||
1125 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1126 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1127 | controlPoint1X = 12.076; | ||
1128 | controlPoint1Y = 33.279; | ||
1129 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1130 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1131 | controlPoint2X = 11.634; | ||
1132 | controlPoint2Y = 32.321; | ||
1133 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1134 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1135 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1136 | pointX = 12.757; | ||
1137 | pointY = 29.077; | ||
1138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1140 | controlPoint1X = 11.671; | ||
1141 | controlPoint1Y = 30.558; | ||
1142 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1143 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1144 | controlPoint2X = 12.029; | ||
1145 | controlPoint2Y = 29.804; | ||
1146 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1147 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1148 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1149 | pointX = 15.018; | ||
1150 | pointY = 28.003; | ||
1151 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1152 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1153 | controlPoint1X = 13.484; | ||
1154 | controlPoint1Y = 28.349; | ||
1155 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1156 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1157 | controlPoint2X = 14.238; | ||
1158 | controlPoint2Y = 27.991; | ||
1159 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1160 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1161 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1162 | pointX = 17.887; | ||
1163 | pointY = 29.332; | ||
1164 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1165 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1166 | controlPoint1X = 15.999; | ||
1167 | controlPoint1Y = 27.957; | ||
1168 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1169 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1170 | controlPoint2X = 16.955; | ||
1171 | controlPoint2Y = 28.4; | ||
1172 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1173 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1174 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1175 | pointX = 19.216; | ||
1176 | pointY = 32.201; | ||
1177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1179 | controlPoint1X = 18.801; | ||
1180 | controlPoint1Y = 30.246; | ||
1181 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1182 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1183 | controlPoint2X = 19.244; | ||
1184 | controlPoint2Y = 31.202; | ||
1185 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1186 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1187 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1188 | pointX = 19.216; | ||
1189 | pointY = 32.201; | ||
1190 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1191 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1192 | context.lineTo(pointX, pointY); | ||
1193 | context.closePath(); | ||
1194 | pointX = 19.534; | ||
1195 | pointY = 22.61; | ||
1196 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1197 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1198 | context.moveTo(pointX, pointY); | ||
1199 | pointX = 21.064; | ||
1200 | pointY = 21.08; | ||
1201 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1202 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1203 | context.lineTo(pointX, pointY); | ||
1204 | pointX = 26.153; | ||
1205 | pointY = 26.17; | ||
1206 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1207 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1208 | context.lineTo(pointX, pointY); | ||
1209 | pointX = 25.162; | ||
1210 | pointY = 27.16; | ||
1211 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1212 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1213 | context.lineTo(pointX, pointY); | ||
1214 | pointX = 21.72; | ||
1215 | pointY = 23.718; | ||
1216 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1217 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1218 | context.lineTo(pointX, pointY); | ||
1219 | pointX = 21.307; | ||
1220 | pointY = 23.299; | ||
1221 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1222 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1223 | controlPoint1X = 21.621; | ||
1224 | controlPoint1Y = 23.619; | ||
1225 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1226 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1227 | controlPoint2X = 21.483; | ||
1228 | controlPoint2Y = 23.479; | ||
1229 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1230 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1231 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1232 | pointX = 20.898; | ||
1233 | pointY = 22.883; | ||
1234 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1235 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1236 | controlPoint1X = 21.131; | ||
1237 | controlPoint1Y = 23.118; | ||
1238 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1239 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1240 | controlPoint2X = 20.995; | ||
1241 | controlPoint2Y = 22.979; | ||
1242 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1243 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1244 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1245 | pointX = 24.206; | ||
1246 | pointY = 28.117; | ||
1247 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1248 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1249 | context.lineTo(pointX, pointY); | ||
1250 | pointX = 23.173; | ||
1251 | pointY = 29.149; | ||
1252 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1253 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1254 | context.lineTo(pointX, pointY); | ||
1255 | pointX = 17.946; | ||
1256 | pointY = 25.835; | ||
1257 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1258 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1259 | context.lineTo(pointX, pointY); | ||
1260 | pointX = 18.362; | ||
1261 | pointY = 26.244; | ||
1262 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1263 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1264 | controlPoint1X = 18.043; | ||
1265 | controlPoint1Y = 25.931; | ||
1266 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1267 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1268 | controlPoint2X = 18.181; | ||
1269 | controlPoint2Y = 26.068; | ||
1270 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1271 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1272 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1273 | pointX = 18.781; | ||
1274 | pointY = 26.656; | ||
1275 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1276 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1277 | controlPoint1X = 18.543; | ||
1278 | controlPoint1Y = 26.42; | ||
1279 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1280 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1281 | controlPoint2X = 18.682; | ||
1282 | controlPoint2Y = 26.557; | ||
1283 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1284 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1285 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1286 | pointX = 22.224; | ||
1287 | pointY = 30.099; | ||
1288 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1289 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1290 | context.lineTo(pointX, pointY); | ||
1291 | pointX = 21.233; | ||
1292 | pointY = 31.09; | ||
1293 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1294 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1295 | context.lineTo(pointX, pointY); | ||
1296 | pointX = 16.144; | ||
1297 | pointY = 26; | ||
1298 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1299 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1300 | context.lineTo(pointX, pointY); | ||
1301 | pointX = 17.69; | ||
1302 | pointY = 24.454; | ||
1303 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1304 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1305 | context.lineTo(pointX, pointY); | ||
1306 | pointX = 22.617; | ||
1307 | pointY = 27.53; | ||
1308 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1309 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1310 | context.lineTo(pointX, pointY); | ||
1311 | pointX = 19.534; | ||
1312 | pointY = 22.61; | ||
1313 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1314 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1315 | context.lineTo(pointX, pointY); | ||
1316 | context.closePath(); | ||
1317 | pointX = 28.114; | ||
1318 | pointY = 24.208; | ||
1319 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1320 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1321 | context.moveTo(pointX, pointY); | ||
1322 | pointX = 27.057; | ||
1323 | pointY = 25.265; | ||
1324 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1325 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1326 | context.lineTo(pointX, pointY); | ||
1327 | pointX = 21.968; | ||
1328 | pointY = 20.176; | ||
1329 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1330 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1331 | context.lineTo(pointX, pointY); | ||
1332 | pointX = 23.025; | ||
1333 | pointY = 19.119; | ||
1334 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1335 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1336 | context.lineTo(pointX, pointY); | ||
1337 | pointX = 28.114; | ||
1338 | pointY = 24.208; | ||
1339 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1340 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1341 | context.lineTo(pointX, pointY); | ||
1342 | context.closePath(); | ||
1343 | pointX = 23.998; | ||
1344 | pointY = 18.146; | ||
1345 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1346 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1347 | context.moveTo(pointX, pointY); | ||
1348 | pointX = 25.114; | ||
1349 | pointY = 17.03; | ||
1350 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1351 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1352 | context.lineTo(pointX, pointY); | ||
1353 | pointX = 30.693; | ||
1354 | pointY = 18.556; | ||
1355 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1356 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1357 | context.lineTo(pointX, pointY); | ||
1358 | pointX = 27.14; | ||
1359 | pointY = 15.004; | ||
1360 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1361 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1362 | context.lineTo(pointX, pointY); | ||
1363 | pointX = 28.131; | ||
1364 | pointY = 14.013; | ||
1365 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1366 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1367 | context.lineTo(pointX, pointY); | ||
1368 | pointX = 33.22; | ||
1369 | pointY = 19.102; | ||
1370 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1371 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1372 | context.lineTo(pointX, pointY); | ||
1373 | pointX = 32.157; | ||
1374 | pointY = 20.165; | ||
1375 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1376 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1377 | context.lineTo(pointX, pointY); | ||
1378 | pointX = 26.464; | ||
1379 | pointY = 18.629; | ||
1380 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1381 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1382 | context.lineTo(pointX, pointY); | ||
1383 | pointX = 30.079; | ||
1384 | pointY = 22.244; | ||
1385 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1386 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1387 | context.lineTo(pointX, pointY); | ||
1388 | pointX = 29.088; | ||
1389 | pointY = 23.235; | ||
1390 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1391 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1392 | context.lineTo(pointX, pointY); | ||
1393 | pointX = 23.998; | ||
1394 | pointY = 18.146; | ||
1395 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1396 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1397 | context.lineTo(pointX, pointY); | ||
1398 | context.closePath(); | ||
1399 | pointX = 34.132; | ||
1400 | pointY = 11.188; | ||
1401 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1402 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1403 | context.moveTo(pointX, pointY); | ||
1404 | pointX = 32.813; | ||
1405 | pointY = 11.05; | ||
1406 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1407 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1408 | controlPoint1X = 33.704; | ||
1409 | controlPoint1Y = 10.921; | ||
1410 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1411 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1412 | controlPoint2X = 33.264; | ||
1413 | controlPoint2Y = 10.875; | ||
1414 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1415 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1416 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1417 | pointX = 32.116; | ||
1418 | pointY = 11.52; | ||
1419 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1420 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1421 | controlPoint1X = 32.562; | ||
1422 | controlPoint1Y = 11.149; | ||
1423 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1424 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1425 | controlPoint2X = 32.33; | ||
1426 | controlPoint2Y = 11.306; | ||
1427 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1428 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1429 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1430 | pointX = 31.57; | ||
1431 | pointY = 12.994; | ||
1432 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1433 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1434 | controlPoint1X = 31.706; | ||
1435 | controlPoint1Y = 11.93; | ||
1436 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1437 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1438 | controlPoint2X = 31.524; | ||
1439 | controlPoint2Y = 12.421; | ||
1440 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1441 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1442 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1443 | pointX = 32.571; | ||
1444 | pointY = 14.786; | ||
1445 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1446 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1447 | controlPoint1X = 31.616; | ||
1448 | controlPoint1Y = 13.567; | ||
1449 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1450 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1451 | controlPoint2X = 31.95; | ||
1452 | controlPoint2Y = 14.165; | ||
1453 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1454 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1455 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1456 | pointX = 34.329; | ||
1457 | pointY = 15.687; | ||
1458 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1459 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1460 | controlPoint1X = 33.197; | ||
1461 | controlPoint1Y = 15.412; | ||
1462 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1463 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1464 | controlPoint2X = 33.783; | ||
1465 | controlPoint2Y = 15.713; | ||
1466 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1467 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1468 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1469 | pointX = 35.693; | ||
1470 | pointY = 15.104; | ||
1471 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1472 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1473 | controlPoint1X = 34.874; | ||
1474 | controlPoint1Y = 15.662; | ||
1475 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1476 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1477 | controlPoint2X = 35.329; | ||
1478 | controlPoint2Y = 15.467; | ||
1479 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1480 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1481 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1482 | pointX = 36.261; | ||
1483 | pointY = 13.918; | ||
1484 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1485 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1486 | controlPoint1X = 36.049; | ||
1487 | controlPoint1Y = 14.747; | ||
1488 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1489 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1490 | controlPoint2X = 36.239; | ||
1491 | controlPoint2Y = 14.352; | ||
1492 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1493 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1494 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1495 | pointX = 35.872; | ||
1496 | pointY = 12.687; | ||
1497 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1498 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1499 | controlPoint1X = 36.282; | ||
1500 | controlPoint1Y = 13.484; | ||
1501 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1502 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1503 | controlPoint2X = 36.153; | ||
1504 | controlPoint2Y = 13.074; | ||
1505 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1506 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1507 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1508 | pointX = 34.695; | ||
1509 | pointY = 13.864; | ||
1510 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1511 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1512 | context.lineTo(pointX, pointY); | ||
1513 | pointX = 33.845; | ||
1514 | pointY = 13.015; | ||
1515 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1516 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1517 | context.lineTo(pointX, pointY); | ||
1518 | pointX = 35.965; | ||
1519 | pointY = 10.895; | ||
1520 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1521 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1522 | context.lineTo(pointX, pointY); | ||
1523 | pointX = 38.696; | ||
1524 | pointY = 13.626; | ||
1525 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1526 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1527 | context.lineTo(pointX, pointY); | ||
1528 | pointX = 37.992; | ||
1529 | pointY = 14.33; | ||
1530 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1531 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1532 | context.lineTo(pointX, pointY); | ||
1533 | pointX = 37.25; | ||
1534 | pointY = 13.802; | ||
1535 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1536 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1537 | context.lineTo(pointX, pointY); | ||
1538 | pointX = 37.208; | ||
1539 | pointY = 14.866; | ||
1540 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1541 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1542 | controlPoint1X = 37.287; | ||
1543 | controlPoint1Y = 14.249; | ||
1544 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1545 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1546 | controlPoint2X = 37.273; | ||
1547 | controlPoint2Y = 14.603; | ||
1548 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1549 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1550 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1551 | pointX = 36.431; | ||
1552 | pointY = 16.16; | ||
1553 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1554 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1555 | controlPoint1X = 37.1; | ||
1556 | controlPoint1Y = 15.319; | ||
1557 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1558 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1559 | controlPoint2X = 36.841; | ||
1560 | controlPoint2Y = 15.751; | ||
1561 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1562 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1563 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1564 | pointX = 34.073; | ||
1565 | pointY = 17.117; | ||
1566 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1567 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1568 | controlPoint1X = 35.757; | ||
1569 | controlPoint1Y = 16.835; | ||
1570 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1571 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1572 | controlPoint2X = 34.971; | ||
1573 | controlPoint2Y = 17.153; | ||
1574 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1575 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1576 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1577 | pointX = 31.473; | ||
1578 | pointY = 15.863; | ||
1579 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1580 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1581 | controlPoint1X = 33.155; | ||
1582 | controlPoint1Y = 17.096; | ||
1583 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1584 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1585 | controlPoint2X = 32.288; | ||
1586 | controlPoint2Y = 16.678; | ||
1587 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1588 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1589 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1590 | pointX = 30.172; | ||
1591 | pointY = 13.201; | ||
1592 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1593 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1594 | controlPoint1X = 30.649; | ||
1595 | controlPoint1Y = 15.039; | ||
1596 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1597 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1598 | controlPoint2X = 30.216; | ||
1599 | controlPoint2Y = 14.152; | ||
1600 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1601 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1602 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1603 | pointX = 31.225; | ||
1604 | pointY = 10.657; | ||
1605 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1606 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1607 | controlPoint1X = 30.128; | ||
1608 | controlPoint1Y = 12.251; | ||
1609 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1610 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1611 | controlPoint2X = 30.479; | ||
1612 | controlPoint2Y = 11.402; | ||
1613 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1614 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1615 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1616 | pointX = 33.276; | ||
1617 | pointY = 9.59; | ||
1618 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1619 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1620 | controlPoint1X = 31.872; | ||
1621 | controlPoint1Y = 10.01; | ||
1622 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1623 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1624 | controlPoint2X = 32.555; | ||
1625 | controlPoint2Y = 9.654; | ||
1626 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1627 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1628 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1629 | pointX = 35.178; | ||
1630 | pointY = 10.142; | ||
1631 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1632 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1633 | controlPoint1X = 33.996; | ||
1634 | controlPoint1Y = 9.525; | ||
1635 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
1636 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
1637 | controlPoint2X = 34.63; | ||
1638 | controlPoint2Y = 9.71; | ||
1639 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
1640 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
1641 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
1642 | pointX = 34.132; | ||
1643 | pointY = 11.188; | ||
1644 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1645 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1646 | context.lineTo(pointX, pointY); | ||
1647 | context.closePath(); | ||
1648 | pointX = 34.878; | ||
1649 | pointY = 7.301; | ||
1650 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1651 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1652 | context.moveTo(pointX, pointY); | ||
1653 | pointX = 35.958; | ||
1654 | pointY = 6.22; | ||
1655 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1656 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1657 | context.lineTo(pointX, pointY); | ||
1658 | pointX = 37.25; | ||
1659 | pointY = 7.511; | ||
1660 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1661 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1662 | context.lineTo(pointX, pointY); | ||
1663 | pointX = 39.346; | ||
1664 | pointY = 10.166; | ||
1665 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1666 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1667 | context.lineTo(pointX, pointY); | ||
1668 | pointX = 38.831; | ||
1669 | pointY = 10.681; | ||
1670 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1671 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1672 | context.lineTo(pointX, pointY); | ||
1673 | pointX = 36.169; | ||
1674 | pointY = 8.592; | ||
1675 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1676 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1677 | context.lineTo(pointX, pointY); | ||
1678 | pointX = 34.878; | ||
1679 | pointY = 7.301; | ||
1680 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1681 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1682 | context.lineTo(pointX, pointY); | ||
1683 | context.closePath(); | ||
1684 | pointX = 38.976; | ||
1685 | pointY = 11.351; | ||
1686 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1687 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1688 | context.moveTo(pointX, pointY); | ||
1689 | pointX = 40.005; | ||
1690 | pointY = 10.322; | ||
1691 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1692 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1693 | context.lineTo(pointX, pointY); | ||
1694 | pointX = 41.003; | ||
1695 | pointY = 11.32; | ||
1696 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1697 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1698 | context.lineTo(pointX, pointY); | ||
1699 | pointX = 39.974; | ||
1700 | pointY = 12.349; | ||
1701 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1702 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1703 | context.lineTo(pointX, pointY); | ||
1704 | pointX = 38.976; | ||
1705 | pointY = 11.351; | ||
1706 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1707 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1708 | context.lineTo(pointX, pointY); | ||
1709 | context.closePath(); | ||
1710 | pointX = 41.528; | ||
1711 | pointY = 10.795; | ||
1712 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
1713 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
1714 | context.moveTo(pointX, pointY); | ||
1715 | context.fillStyle = aBannerColor; | ||
1716 | context.fill(); | ||
1717 | |||
1718 | context.restore(); | ||
1719 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js new file mode 100644 index 0000000..eaeb7f1 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js | |||
@@ -0,0 +1,310 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //store.js | ||
31 | //store | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Features_storeWidth = 76.0; | ||
39 | var kClipperz_PM_UI_Canvas_Features_storeHeight = 76.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Features_store(canvas, aColor, aBannerColor, aBannerBackgroundColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | if (window.devicePixelRatio) | ||
50 | resolution = window.devicePixelRatio; | ||
51 | else | ||
52 | resolution = 1.0; | ||
53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); | ||
54 | |||
55 | context.save(); | ||
56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); | ||
57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_storeWidth, kClipperz_PM_UI_Canvas_Features_storeHeight); | ||
58 | |||
59 | // Layer 1 | ||
60 | |||
61 | alignStroke = 0.0; | ||
62 | context.beginPath(); | ||
63 | pointX = 27.0; | ||
64 | pointY = 29.5; | ||
65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
67 | context.moveTo(pointX, pointY); | ||
68 | pointX = 27.0; | ||
69 | pointY = 24.5; | ||
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
72 | context.lineTo(pointX, pointY); | ||
73 | pointX = 22.0; | ||
74 | pointY = 24.5; | ||
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
77 | context.lineTo(pointX, pointY); | ||
78 | pointX = 22.0; | ||
79 | pointY = 29.5; | ||
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
82 | context.lineTo(pointX, pointY); | ||
83 | pointX = 27.0; | ||
84 | pointY = 29.5; | ||
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
87 | context.lineTo(pointX, pointY); | ||
88 | context.closePath(); | ||
89 | context.fillStyle = aColor; | ||
90 | context.fill(); | ||
91 | |||
92 | alignStroke = 0.0; | ||
93 | context.beginPath(); | ||
94 | pointX = 54.0; | ||
95 | pointY = 29.5; | ||
96 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
97 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
98 | context.moveTo(pointX, pointY); | ||
99 | pointX = 54.0; | ||
100 | pointY = 24.5; | ||
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
103 | context.lineTo(pointX, pointY); | ||
104 | pointX = 29.0; | ||
105 | pointY = 24.5; | ||
106 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
107 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
108 | context.lineTo(pointX, pointY); | ||
109 | pointX = 29.0; | ||
110 | pointY = 29.5; | ||
111 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
112 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
113 | context.lineTo(pointX, pointY); | ||
114 | pointX = 54.0; | ||
115 | pointY = 29.5; | ||
116 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
117 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
118 | context.lineTo(pointX, pointY); | ||
119 | context.closePath(); | ||
120 | context.fillStyle = aColor; | ||
121 | context.fill(); | ||
122 | |||
123 | alignStroke = 0.0; | ||
124 | context.beginPath(); | ||
125 | pointX = 43.0; | ||
126 | pointY = 37.0; | ||
127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
129 | context.moveTo(pointX, pointY); | ||
130 | pointX = 43.0; | ||
131 | pointY = 32.0; | ||
132 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
133 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
134 | context.lineTo(pointX, pointY); | ||
135 | pointX = 29.0; | ||
136 | pointY = 32.0; | ||
137 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
138 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
139 | context.lineTo(pointX, pointY); | ||
140 | pointX = 29.0; | ||
141 | pointY = 37.0; | ||
142 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
143 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
144 | context.lineTo(pointX, pointY); | ||
145 | pointX = 43.0; | ||
146 | pointY = 37.0; | ||
147 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
148 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
149 | context.lineTo(pointX, pointY); | ||
150 | context.closePath(); | ||
151 | context.fillStyle = aColor; | ||
152 | context.fill(); | ||
153 | |||
154 | alignStroke = 0.0; | ||
155 | context.beginPath(); | ||
156 | pointX = 27.0; | ||
157 | pointY = 37.0; | ||
158 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
159 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
160 | context.moveTo(pointX, pointY); | ||
161 | pointX = 27.0; | ||
162 | pointY = 32.0; | ||
163 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
164 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
165 | context.lineTo(pointX, pointY); | ||
166 | pointX = 22.0; | ||
167 | pointY = 32.0; | ||
168 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
169 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
170 | context.lineTo(pointX, pointY); | ||
171 | pointX = 22.0; | ||
172 | pointY = 37.0; | ||
173 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
174 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
175 | context.lineTo(pointX, pointY); | ||
176 | pointX = 27.0; | ||
177 | pointY = 37.0; | ||
178 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
179 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
180 | context.lineTo(pointX, pointY); | ||
181 | context.closePath(); | ||
182 | context.fillStyle = aColor; | ||
183 | context.fill(); | ||
184 | |||
185 | alignStroke = 0.0; | ||
186 | context.beginPath(); | ||
187 | pointX = 27.0; | ||
188 | pointY = 44.0; | ||
189 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
190 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
191 | context.moveTo(pointX, pointY); | ||
192 | pointX = 27.0; | ||
193 | pointY = 39.0; | ||
194 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
195 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
196 | context.lineTo(pointX, pointY); | ||
197 | pointX = 22.0; | ||
198 | pointY = 39.0; | ||
199 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
200 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
201 | context.lineTo(pointX, pointY); | ||
202 | pointX = 22.0; | ||
203 | pointY = 44.0; | ||
204 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
205 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
206 | context.lineTo(pointX, pointY); | ||
207 | pointX = 27.0; | ||
208 | pointY = 44.0; | ||
209 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
210 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
211 | context.lineTo(pointX, pointY); | ||
212 | context.closePath(); | ||
213 | context.fillStyle = aColor; | ||
214 | context.fill(); | ||
215 | |||
216 | alignStroke = 0.0; | ||
217 | context.beginPath(); | ||
218 | pointX = 46.0; | ||
219 | pointY = 44.0; | ||
220 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
221 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
222 | context.moveTo(pointX, pointY); | ||
223 | pointX = 46.0; | ||
224 | pointY = 39.0; | ||
225 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
226 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
227 | context.lineTo(pointX, pointY); | ||
228 | pointX = 29.0; | ||
229 | pointY = 39.0; | ||
230 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
231 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
232 | context.lineTo(pointX, pointY); | ||
233 | pointX = 29.0; | ||
234 | pointY = 44.0; | ||
235 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
236 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
237 | context.lineTo(pointX, pointY); | ||
238 | pointX = 46.0; | ||
239 | pointY = 44.0; | ||
240 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
241 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
242 | context.lineTo(pointX, pointY); | ||
243 | context.closePath(); | ||
244 | context.fillStyle = aColor; | ||
245 | context.fill(); | ||
246 | |||
247 | alignStroke = 0.0; | ||
248 | context.beginPath(); | ||
249 | pointX = 40.0; | ||
250 | pointY = 51.0; | ||
251 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
252 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
253 | context.moveTo(pointX, pointY); | ||
254 | pointX = 40.0; | ||
255 | pointY = 46.0; | ||
256 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
257 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
258 | context.lineTo(pointX, pointY); | ||
259 | pointX = 29.0; | ||
260 | pointY = 46.0; | ||
261 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
262 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
263 | context.lineTo(pointX, pointY); | ||
264 | pointX = 29.0; | ||
265 | pointY = 51.0; | ||
266 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
267 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
268 | context.lineTo(pointX, pointY); | ||
269 | pointX = 40.0; | ||
270 | pointY = 51.0; | ||
271 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
272 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
273 | context.lineTo(pointX, pointY); | ||
274 | context.closePath(); | ||
275 | context.fillStyle = aColor; | ||
276 | context.fill(); | ||
277 | |||
278 | alignStroke = 0.0; | ||
279 | context.beginPath(); | ||
280 | pointX = 27.0; | ||
281 | pointY = 51.0; | ||
282 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
283 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
284 | context.moveTo(pointX, pointY); | ||
285 | pointX = 27.0; | ||
286 | pointY = 46.0; | ||
287 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
288 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
289 | context.lineTo(pointX, pointY); | ||
290 | pointX = 22.0; | ||
291 | pointY = 46.0; | ||
292 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
293 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
294 | context.lineTo(pointX, pointY); | ||
295 | pointX = 22.0; | ||
296 | pointY = 51.0; | ||
297 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
298 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
299 | context.lineTo(pointX, pointY); | ||
300 | pointX = 27.0; | ||
301 | pointY = 51.0; | ||
302 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
303 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
304 | context.lineTo(pointX, pointY); | ||
305 | context.closePath(); | ||
306 | context.fillStyle = aColor; | ||
307 | context.fill(); | ||
308 | |||
309 | context.restore(); | ||
310 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js new file mode 100644 index 0000000..5de2e96 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Canvas'); | ||
30 | |||
31 | MochiKit.Base.update(Clipperz.PM.UI.Canvas , { | ||
32 | 'marks': { | ||
33 | '!':Clipperz_PM_UI_Canvas_Marks_exclamationMark, | ||
34 | '?':Clipperz_PM_UI_Canvas_Marks_questionMark, | ||
35 | 'i':Clipperz_PM_UI_Canvas_Marks_info | ||
36 | }, | ||
37 | |||
38 | 'features': { | ||
39 | 'store': Clipperz_PM_UI_Canvas_Features_store, | ||
40 | 'protect': Clipperz_PM_UI_Canvas_Features_protect, | ||
41 | 'directLogin':Clipperz_PM_UI_Canvas_Features_directLogin, | ||
42 | 'share': Clipperz_PM_UI_Canvas_Features_share | ||
43 | }, | ||
44 | |||
45 | 'tips': { | ||
46 | 'open': Clipperz_PM_UI_Canvas_Tips_open, | ||
47 | 'close': Clipperz_PM_UI_Canvas_Tips_close | ||
48 | }, | ||
49 | |||
50 | 'star': { | ||
51 | 'normal': Clipperz_PM_UI_Canvas_Star_normal | ||
52 | }, | ||
53 | |||
54 | 'coverActions': { | ||
55 | 'look': Clipperz_PM_UI_Canvas_CoverActions_look, | ||
56 | 'download': Clipperz_PM_UI_Canvas_CoverActions_download | ||
57 | }, | ||
58 | |||
59 | 'registerButton': { | ||
60 | 'normal': Clipperz_PM_UI_Canvas_RegisterButton_normal | ||
61 | }, | ||
62 | |||
63 | 'logo': { | ||
64 | 'normal': Clipperz_PM_UI_Canvas_Logo_normal | ||
65 | }, | ||
66 | |||
67 | __syntaxFix__: "syntax fix" | ||
68 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js new file mode 100644 index 0000000..e0bea36 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //normal.js | ||
31 | //normal | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/25/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Logo_normalWidth = 150.0; | ||
39 | var kClipperz_PM_UI_Canvas_Logo_normalHeight = 39.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Logo_normal(canvas, aMainColor, aSecondaryColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var string; | ||
45 | |||
46 | context.save(); | ||
47 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Logo_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Logo_normalHeight); | ||
48 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Logo_normalWidth, kClipperz_PM_UI_Canvas_Logo_normalHeight); | ||
49 | |||
50 | // clipper… | ||
51 | |||
52 | string = "clipper"; | ||
53 | context.font = "38.0pt Helvetica-Bold"; | ||
54 | context.fillStyle = aMainColor; | ||
55 | context.fillText(string, -9.0, -9.0); | ||
56 | |||
57 | // …z | ||
58 | |||
59 | string = "z"; | ||
60 | context.font = "38.0pt Helvetica-Bold"; | ||
61 | context.fillStyle = aSecondaryColor; | ||
62 | context.fillText(string, 125.0, -9.0); | ||
63 | |||
64 | context.restore(); | ||
65 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js new file mode 100644 index 0000000..f3ae04d --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js | |||
@@ -0,0 +1,280 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //exclamationMark.js | ||
31 | //! | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth = 50.0; | ||
39 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight = 50.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Marks_exclamationMark(canvas, aColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | var controlPoint1X; | ||
50 | var controlPoint1Y; | ||
51 | var controlPoint2X; | ||
52 | var controlPoint2Y; | ||
53 | if (window.devicePixelRatio) | ||
54 | resolution = window.devicePixelRatio; | ||
55 | else | ||
56 | resolution = 1.0; | ||
57 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | ||
58 | |||
59 | context.save(); | ||
60 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | ||
61 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | ||
62 | |||
63 | // Layer 1 | ||
64 | |||
65 | alignStroke = 0.0; | ||
66 | context.beginPath(); | ||
67 | pointX = 26.499; | ||
68 | pointY = 10.848; | ||
69 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
70 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
71 | context.moveTo(pointX, pointY); | ||
72 | pointX = 20.887; | ||
73 | pointY = 11.584; | ||
74 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
75 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
76 | controlPoint1X = 25.395; | ||
77 | controlPoint1Y = 10.802; | ||
78 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
79 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
80 | controlPoint2X = 22.175; | ||
81 | controlPoint2Y = 11.078; | ||
82 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
83 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
84 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
85 | pointX = 20.013; | ||
86 | pointY = 13.194; | ||
87 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
88 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
89 | controlPoint1X = 20.335; | ||
90 | controlPoint1Y = 11.814; | ||
91 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
92 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
93 | controlPoint2X = 19.921; | ||
94 | controlPoint2Y = 12.826; | ||
95 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
96 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
97 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
98 | pointX = 23.049; | ||
99 | pointY = 28.788; | ||
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
102 | controlPoint1X = 20.243; | ||
103 | controlPoint1Y = 15.448; | ||
104 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
105 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
106 | controlPoint2X = 22.589; | ||
107 | controlPoint2Y = 26.35; | ||
108 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
109 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
110 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
111 | pointX = 25.027; | ||
112 | pointY = 29.156; | ||
113 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
114 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
115 | controlPoint1X = 23.279; | ||
116 | controlPoint1Y = 29.018; | ||
117 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
118 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
119 | controlPoint2X = 24.705; | ||
120 | controlPoint2Y = 29.202; | ||
121 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
122 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
123 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
124 | pointX = 27.971; | ||
125 | pointY = 11.354; | ||
126 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
127 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
128 | controlPoint1X = 25.809; | ||
129 | controlPoint1Y = 25.384; | ||
130 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
131 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
132 | controlPoint2X = 27.971; | ||
133 | controlPoint2Y = 12.826; | ||
134 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
135 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
136 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
137 | pointX = 26.499; | ||
138 | pointY = 10.848; | ||
139 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
140 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
141 | controlPoint1X = 27.557; | ||
142 | controlPoint1Y = 11.032; | ||
143 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
144 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
145 | controlPoint2X = 26.913; | ||
146 | controlPoint2Y = 10.848; | ||
147 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
148 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
149 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
150 | pointX = 26.499; | ||
151 | pointY = 10.848; | ||
152 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
153 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
154 | context.lineTo(pointX, pointY); | ||
155 | context.closePath(); | ||
156 | pointX = 24.337; | ||
157 | pointY = 31.962; | ||
158 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
159 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
160 | context.moveTo(pointX, pointY); | ||
161 | pointX = 21.899; | ||
162 | pointY = 32.882; | ||
163 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
164 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
165 | controlPoint1X = 23.463; | ||
166 | controlPoint1Y = 31.962; | ||
167 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
168 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
169 | controlPoint2X = 22.589; | ||
170 | controlPoint2Y = 32.284; | ||
171 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
172 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
173 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
174 | pointX = 20.703; | ||
175 | pointY = 35.458; | ||
176 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
177 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
178 | controlPoint1X = 21.163; | ||
179 | controlPoint1Y = 33.572; | ||
180 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
181 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
182 | controlPoint2X = 20.703; | ||
183 | controlPoint2Y = 34.538; | ||
184 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
185 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
186 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
187 | pointX = 21.669; | ||
188 | pointY = 38.08; | ||
189 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
190 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
191 | controlPoint1X = 20.703; | ||
192 | controlPoint1Y = 36.47; | ||
193 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
194 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
195 | controlPoint2X = 20.979; | ||
196 | controlPoint2Y = 37.344; | ||
197 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
198 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
199 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
200 | pointX = 24.015; | ||
201 | pointY = 39.0; | ||
202 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
203 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
204 | controlPoint1X = 22.405; | ||
205 | controlPoint1Y = 38.77; | ||
206 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
207 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
208 | controlPoint2X = 23.325; | ||
209 | controlPoint2Y = 39.0; | ||
210 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
211 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
212 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
213 | pointX = 26.821; | ||
214 | pointY = 38.034; | ||
215 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
216 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
217 | controlPoint1X = 25.073; | ||
218 | controlPoint1Y = 39.0; | ||
219 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
220 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
221 | controlPoint2X = 26.131; | ||
222 | controlPoint2Y = 38.724; | ||
223 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
224 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
225 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
226 | pointX = 27.833; | ||
227 | pointY = 35.55; | ||
228 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
229 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
230 | controlPoint1X = 27.465; | ||
231 | controlPoint1Y = 37.344; | ||
232 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
233 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
234 | controlPoint2X = 27.833; | ||
235 | controlPoint2Y = 36.194; | ||
236 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
237 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
238 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
239 | pointX = 26.683; | ||
240 | pointY = 32.744; | ||
241 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
242 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
243 | controlPoint1X = 27.833; | ||
244 | controlPoint1Y = 34.676; | ||
245 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
246 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
247 | controlPoint2X = 27.557; | ||
248 | controlPoint2Y = 33.572; | ||
249 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
250 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
251 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
252 | pointX = 24.337; | ||
253 | pointY = 31.962; | ||
254 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
255 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
256 | controlPoint1X = 26.085; | ||
257 | controlPoint1Y = 32.238; | ||
258 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
259 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
260 | controlPoint2X = 25.211; | ||
261 | controlPoint2Y = 31.962; | ||
262 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
263 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
264 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
265 | pointX = 24.337; | ||
266 | pointY = 31.962; | ||
267 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
268 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
269 | context.lineTo(pointX, pointY); | ||
270 | context.closePath(); | ||
271 | pointX = 30.639; | ||
272 | pointY = 38.402; | ||
273 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
274 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
275 | context.moveTo(pointX, pointY); | ||
276 | context.fillStyle = aColor; | ||
277 | context.fill(); | ||
278 | |||
279 | context.restore(); | ||
280 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js new file mode 100644 index 0000000..adab74f --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js | |||
@@ -0,0 +1,391 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //info.js | ||
31 | //i | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Marks_infoWidth = 50.0; | ||
39 | var kClipperz_PM_UI_Canvas_Marks_infoHeight = 50.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Marks_info(canvas, aColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | var controlPoint1X; | ||
50 | var controlPoint1Y; | ||
51 | var controlPoint2X; | ||
52 | var controlPoint2Y; | ||
53 | var color; | ||
54 | if (window.devicePixelRatio) | ||
55 | resolution = window.devicePixelRatio; | ||
56 | else | ||
57 | resolution = 1.0; | ||
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); | ||
59 | |||
60 | context.save(); | ||
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); | ||
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_infoWidth, kClipperz_PM_UI_Canvas_Marks_infoHeight); | ||
63 | |||
64 | // Layer 1 | ||
65 | |||
66 | alignStroke = 0.0; | ||
67 | context.beginPath(); | ||
68 | pointX = 30.253; | ||
69 | pointY = 37.436; | ||
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
72 | context.moveTo(pointX, pointY); | ||
73 | pointX = 28.505; | ||
74 | pointY = 37.022; | ||
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
77 | context.lineTo(pointX, pointY); | ||
78 | pointX = 27.677; | ||
79 | pointY = 35.09; | ||
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
82 | controlPoint1X = 27.953; | ||
83 | controlPoint1Y = 36.792; | ||
84 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
85 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
86 | controlPoint2X = 27.677; | ||
87 | controlPoint2Y = 36.47; | ||
88 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
89 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
90 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
91 | pointX = 27.631; | ||
92 | pointY = 27.546; | ||
93 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
94 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
95 | controlPoint1X = 27.631; | ||
96 | controlPoint1Y = 32.974; | ||
97 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
98 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
99 | controlPoint2X = 27.631; | ||
100 | controlPoint2Y = 29.892; | ||
101 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
102 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
103 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
104 | pointX = 27.677; | ||
105 | pointY = 19.726; | ||
106 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
107 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
108 | controlPoint1X = 27.631; | ||
109 | controlPoint1Y = 24.97; | ||
110 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
111 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
112 | controlPoint2X = 27.677; | ||
113 | controlPoint2Y = 21.612; | ||
114 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
115 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
116 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
117 | pointX = 19.535; | ||
118 | pointY = 21.336; | ||
119 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
120 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
121 | controlPoint1X = 25.331; | ||
122 | controlPoint1Y = 20.692; | ||
123 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
124 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
125 | controlPoint2X = 20.593; | ||
126 | controlPoint2Y = 21.336; | ||
127 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
128 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
129 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
130 | pointX = 19.443; | ||
131 | pointY = 22.762; | ||
132 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
133 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
134 | controlPoint1X = 19.397; | ||
135 | controlPoint1Y = 21.52; | ||
136 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
137 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
138 | controlPoint2X = 19.305; | ||
139 | controlPoint2Y = 22.532; | ||
140 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
141 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
142 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
143 | pointX = 21.283; | ||
144 | pointY = 23.82; | ||
145 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
146 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
147 | controlPoint1X = 20.639; | ||
148 | controlPoint1Y = 23.222; | ||
149 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
150 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
151 | controlPoint2X = 20.961; | ||
152 | controlPoint2Y = 23.452; | ||
153 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
154 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
155 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
156 | pointX = 21.605; | ||
157 | pointY = 24.97; | ||
158 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
159 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
160 | controlPoint1X = 21.513; | ||
161 | controlPoint1Y = 24.05; | ||
162 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
163 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
164 | controlPoint2X = 21.605; | ||
165 | controlPoint2Y = 24.602; | ||
166 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
167 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
168 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
169 | pointX = 21.651; | ||
170 | pointY = 29.156; | ||
171 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
172 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
173 | controlPoint1X = 21.651; | ||
174 | controlPoint1Y = 25.752; | ||
175 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
176 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
177 | controlPoint2X = 21.651; | ||
178 | controlPoint2Y = 27.592; | ||
179 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
180 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
181 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
182 | pointX = 21.605; | ||
183 | pointY = 35.228; | ||
184 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
185 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
186 | controlPoint1X = 21.651; | ||
187 | controlPoint1Y = 31.364; | ||
188 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
189 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
190 | controlPoint2X = 21.651; | ||
191 | controlPoint2Y = 34.216; | ||
192 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
193 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
194 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
195 | pointX = 20.823; | ||
196 | pointY = 37.022; | ||
197 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
198 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
199 | controlPoint1X = 21.559; | ||
200 | controlPoint1Y = 36.332; | ||
201 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
202 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
203 | controlPoint2X = 21.467; | ||
204 | controlPoint2Y = 36.838; | ||
205 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
206 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
207 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
208 | pointX = 19.121; | ||
209 | pointY = 37.436; | ||
210 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
211 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
212 | controlPoint1X = 20.363; | ||
213 | controlPoint1Y = 37.206; | ||
214 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
215 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
216 | controlPoint2X = 19.857; | ||
217 | controlPoint2Y = 37.298; | ||
218 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
219 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
220 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
221 | pointX = 19.121; | ||
222 | pointY = 39.0; | ||
223 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
224 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
225 | controlPoint1X = 18.937; | ||
226 | controlPoint1Y = 37.62; | ||
227 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
228 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
229 | controlPoint2X = 18.983; | ||
230 | controlPoint2Y = 38.77; | ||
231 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
232 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
233 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
234 | pointX = 24.503; | ||
235 | pointY = 38.862; | ||
236 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
237 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
238 | controlPoint1X = 20.271; | ||
239 | controlPoint1Y = 39.0; | ||
240 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
241 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
242 | controlPoint2X = 21.927; | ||
243 | controlPoint2Y = 38.862; | ||
244 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
245 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
246 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
247 | pointX = 30.023; | ||
248 | pointY = 39.0; | ||
249 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
250 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
251 | controlPoint1X = 27.401; | ||
252 | controlPoint1Y = 38.862; | ||
253 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
254 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
255 | controlPoint2X = 29.149; | ||
256 | controlPoint2Y = 39.0; | ||
257 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
258 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
259 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
260 | pointX = 30.253; | ||
261 | pointY = 37.436; | ||
262 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
263 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
264 | controlPoint1X = 30.299; | ||
265 | controlPoint1Y = 38.77; | ||
266 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
267 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
268 | controlPoint2X = 30.391; | ||
269 | controlPoint2Y = 37.62; | ||
270 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
271 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
272 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
273 | pointX = 30.253; | ||
274 | pointY = 37.436; | ||
275 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
276 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
277 | context.lineTo(pointX, pointY); | ||
278 | context.closePath(); | ||
279 | pointX = 27.493; | ||
280 | pointY = 13.976; | ||
281 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
282 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
283 | context.moveTo(pointX, pointY); | ||
284 | pointX = 27.125; | ||
285 | pointY = 12.228; | ||
286 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
287 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
288 | controlPoint1X = 27.493; | ||
289 | controlPoint1Y = 13.608; | ||
290 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
291 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
292 | controlPoint2X = 27.401; | ||
293 | controlPoint2Y = 12.688; | ||
294 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
295 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
296 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
297 | pointX = 24.963; | ||
298 | pointY = 11.63; | ||
299 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
300 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
301 | controlPoint1X = 26.849; | ||
302 | controlPoint1Y = 11.998; | ||
303 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
304 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
305 | controlPoint2X = 26.113; | ||
306 | controlPoint2Y = 11.63; | ||
307 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
308 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
309 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
310 | pointX = 21.513; | ||
311 | pointY = 12.688; | ||
312 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
313 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
314 | controlPoint1X = 23.767; | ||
315 | controlPoint1Y = 11.63; | ||
316 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
317 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
318 | controlPoint2X = 22.203; | ||
319 | controlPoint2Y = 12.09; | ||
320 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
321 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
322 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
323 | pointX = 21.283; | ||
324 | pointY = 14.942; | ||
325 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
326 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
327 | controlPoint1X = 21.145; | ||
328 | controlPoint1Y = 13.148; | ||
329 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
330 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
331 | controlPoint2X = 21.145; | ||
332 | controlPoint2Y = 14.436; | ||
333 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
334 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
335 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
336 | pointX = 22.801; | ||
337 | pointY = 17.012; | ||
338 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
339 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
340 | controlPoint1X = 21.513; | ||
341 | controlPoint1Y = 15.908; | ||
342 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
343 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
344 | controlPoint2X = 21.973; | ||
345 | controlPoint2Y = 16.69; | ||
346 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
347 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
348 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
349 | pointX = 26.205; | ||
350 | pointY = 16.69; | ||
351 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
352 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
353 | controlPoint1X = 23.399; | ||
354 | controlPoint1Y = 17.288; | ||
355 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
356 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
357 | controlPoint2X = 25.791; | ||
358 | controlPoint2Y = 17.058; | ||
359 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
360 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
361 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
362 | pointX = 27.493; | ||
363 | pointY = 13.976; | ||
364 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
365 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
366 | controlPoint1X = 26.941; | ||
367 | controlPoint1Y = 16.046; | ||
368 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
369 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
370 | controlPoint2X = 27.493; | ||
371 | controlPoint2Y = 14.896; | ||
372 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
373 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
374 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
375 | pointX = 27.493; | ||
376 | pointY = 13.976; | ||
377 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
378 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
379 | context.lineTo(pointX, pointY); | ||
380 | context.closePath(); | ||
381 | pointX = 30.851; | ||
382 | pointY = 38.862; | ||
383 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
384 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
385 | context.moveTo(pointX, pointY); | ||
386 | color = "#FFFFFF"; | ||
387 | context.fillStyle = color; | ||
388 | context.fill(); | ||
389 | |||
390 | context.restore(); | ||
391 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js new file mode 100644 index 0000000..003c4c2 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js | |||
@@ -0,0 +1,438 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //questionMark.js | ||
31 | //? | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/7/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Marks_questionMarkWidth = 50.0; | ||
39 | var kClipperz_PM_UI_Canvas_Marks_questionMarkHeight = 50.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Marks_questionMark(canvas, aColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | var controlPoint1X; | ||
50 | var controlPoint1Y; | ||
51 | var controlPoint2X; | ||
52 | var controlPoint2Y; | ||
53 | var color; | ||
54 | if (window.devicePixelRatio) | ||
55 | resolution = window.devicePixelRatio; | ||
56 | else | ||
57 | resolution = 1.0; | ||
58 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | ||
59 | |||
60 | context.save(); | ||
61 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | ||
62 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | ||
63 | |||
64 | // Layer 1 | ||
65 | |||
66 | alignStroke = 0.0; | ||
67 | context.beginPath(); | ||
68 | pointX = 24.118; | ||
69 | pointY = 24.464; | ||
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
72 | context.moveTo(pointX, pointY); | ||
73 | pointX = 24.854; | ||
74 | pointY = 23.406; | ||
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
77 | controlPoint1X = 24.118; | ||
78 | controlPoint1Y = 24.05; | ||
79 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
80 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
81 | controlPoint2X = 24.44; | ||
82 | controlPoint2Y = 23.636; | ||
83 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
84 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
85 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
86 | pointX = 29.454; | ||
87 | pointY = 20.6; | ||
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
89 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
90 | controlPoint1X = 26.418; | ||
91 | controlPoint1Y = 22.532; | ||
92 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
93 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
94 | controlPoint2X = 28.534; | ||
95 | controlPoint2Y = 21.566; | ||
96 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
97 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
98 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
99 | pointX = 30.282; | ||
100 | pointY = 17.794; | ||
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
103 | controlPoint1X = 29.868; | ||
104 | controlPoint1Y = 20.232; | ||
105 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
106 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
107 | controlPoint2X = 30.282; | ||
108 | controlPoint2Y = 19.082; | ||
109 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
110 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
111 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
112 | pointX = 27.2; | ||
113 | pointY = 12.688; | ||
114 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
115 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
116 | controlPoint1X = 30.282; | ||
117 | controlPoint1Y = 16.322; | ||
118 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
119 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
120 | controlPoint2X = 29.454; | ||
121 | controlPoint2Y = 14.344; | ||
122 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
123 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
124 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
125 | pointX = 21.312; | ||
126 | pointY = 10.664; | ||
127 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
128 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
129 | controlPoint1X = 25.636; | ||
130 | controlPoint1Y = 11.492; | ||
131 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
132 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
133 | controlPoint2X = 23.382; | ||
134 | controlPoint2Y = 10.664; | ||
135 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
136 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
137 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
138 | pointX = 19.886; | ||
139 | pointY = 11.124; | ||
140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
142 | controlPoint1X = 20.898; | ||
143 | controlPoint1Y = 10.664; | ||
144 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
145 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
146 | controlPoint2X = 20.162; | ||
147 | controlPoint2Y = 10.894; | ||
148 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
149 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
150 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
151 | pointX = 18.0; | ||
152 | pointY = 14.666; | ||
153 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
154 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
155 | controlPoint1X = 19.104; | ||
156 | controlPoint1Y = 11.676; | ||
157 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
158 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
159 | controlPoint2X = 18.0; | ||
160 | controlPoint2Y = 14.068; | ||
161 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
162 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
163 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
164 | pointX = 18.598; | ||
165 | pointY = 15.586; | ||
166 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
167 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
168 | controlPoint1X = 18.0; | ||
169 | controlPoint1Y = 14.896; | ||
170 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
171 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
172 | controlPoint2X = 18.138; | ||
173 | controlPoint2Y = 15.494; | ||
174 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
175 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
176 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
177 | pointX = 19.794; | ||
178 | pointY = 15.908; | ||
179 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
180 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
181 | controlPoint1X = 19.012; | ||
182 | controlPoint1Y = 15.678; | ||
183 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
184 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
185 | controlPoint2X = 19.426; | ||
186 | controlPoint2Y = 15.77; | ||
187 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
188 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
189 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
190 | pointX = 25.36; | ||
191 | pointY = 20.002; | ||
192 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
193 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
194 | controlPoint1X = 22.508; | ||
195 | controlPoint1Y = 16.644; | ||
196 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
197 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
198 | controlPoint2X = 25.36; | ||
199 | controlPoint2Y = 17.886; | ||
200 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
201 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
202 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
203 | pointX = 24.21; | ||
204 | pointY = 21.704; | ||
205 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
206 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
207 | controlPoint1X = 25.36; | ||
208 | controlPoint1Y = 20.738; | ||
209 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
210 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
211 | controlPoint2X = 25.084; | ||
212 | controlPoint2Y = 21.198; | ||
213 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
214 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
215 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
216 | pointX = 19.058; | ||
217 | pointY = 24.326; | ||
218 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
219 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
220 | controlPoint1X = 23.106; | ||
221 | controlPoint1Y = 22.348; | ||
222 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
223 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
224 | controlPoint2X = 19.886; | ||
225 | controlPoint2Y = 23.774; | ||
226 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
227 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
228 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
229 | pointX = 18.506; | ||
230 | pointY = 25.936; | ||
231 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
232 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
233 | controlPoint1X = 18.736; | ||
234 | controlPoint1Y = 24.556; | ||
235 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
236 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
237 | controlPoint2X = 18.506; | ||
238 | controlPoint2Y = 25.338; | ||
239 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
240 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
241 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
242 | pointX = 20.898; | ||
243 | pointY = 29.064; | ||
244 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
245 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
246 | controlPoint1X = 18.506; | ||
247 | controlPoint1Y = 26.948; | ||
248 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
249 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
250 | controlPoint2X = 19.334; | ||
251 | controlPoint2Y = 28.42; | ||
252 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
253 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
254 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
255 | pointX = 22.048; | ||
256 | pointY = 29.156; | ||
257 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
258 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
259 | controlPoint1X = 21.22; | ||
260 | controlPoint1Y = 29.156; | ||
261 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
262 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
263 | controlPoint2X = 21.726; | ||
264 | controlPoint2Y = 29.202; | ||
265 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
266 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
267 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
268 | pointX = 25.268; | ||
269 | pointY = 27.592; | ||
270 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
271 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
272 | controlPoint1X = 22.508; | ||
273 | controlPoint1Y = 29.064; | ||
274 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
275 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
276 | controlPoint2X = 24.9; | ||
277 | controlPoint2Y = 27.96; | ||
278 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
279 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
280 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
281 | pointX = 25.406; | ||
282 | pointY = 26.856; | ||
283 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
284 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
285 | controlPoint1X = 25.406; | ||
286 | controlPoint1Y = 27.454; | ||
287 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
288 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
289 | controlPoint2X = 25.544; | ||
290 | controlPoint2Y = 26.994; | ||
291 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
292 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
293 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
294 | pointX = 24.118; | ||
295 | pointY = 24.464; | ||
296 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
297 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
298 | controlPoint1X = 24.578; | ||
299 | controlPoint1Y = 25.936; | ||
300 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
301 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
302 | controlPoint2X = 24.118; | ||
303 | controlPoint2Y = 24.786; | ||
304 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
305 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
306 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
307 | pointX = 24.118; | ||
308 | pointY = 24.464; | ||
309 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
310 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
311 | context.lineTo(pointX, pointY); | ||
312 | context.closePath(); | ||
313 | pointX = 23.06; | ||
314 | pointY = 31.962; | ||
315 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
316 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
317 | context.moveTo(pointX, pointY); | ||
318 | pointX = 20.53; | ||
319 | pointY = 32.928; | ||
320 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
321 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
322 | controlPoint1X = 22.186; | ||
323 | controlPoint1Y = 31.962; | ||
324 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
325 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
326 | controlPoint2X = 21.22; | ||
327 | controlPoint2Y = 32.33; | ||
328 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
329 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
330 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
331 | pointX = 19.426; | ||
332 | pointY = 35.458; | ||
333 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
334 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
335 | controlPoint1X = 19.794; | ||
336 | controlPoint1Y = 33.618; | ||
337 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
338 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
339 | controlPoint2X = 19.426; | ||
340 | controlPoint2Y = 34.538; | ||
341 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
342 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
343 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
344 | pointX = 20.392; | ||
345 | pointY = 38.08; | ||
346 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
347 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
348 | controlPoint1X = 19.426; | ||
349 | controlPoint1Y = 36.47; | ||
350 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
351 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
352 | controlPoint2X = 19.702; | ||
353 | controlPoint2Y = 37.344; | ||
354 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
355 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
356 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
357 | pointX = 22.738; | ||
358 | pointY = 39.0; | ||
359 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
360 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
361 | controlPoint1X = 21.128; | ||
362 | controlPoint1Y = 38.77; | ||
363 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
364 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
365 | controlPoint2X = 22.048; | ||
366 | controlPoint2Y = 39.0; | ||
367 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
368 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
369 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
370 | pointX = 25.544; | ||
371 | pointY = 38.034; | ||
372 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
373 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
374 | controlPoint1X = 23.796; | ||
375 | controlPoint1Y = 39.0; | ||
376 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
377 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
378 | controlPoint2X = 24.854; | ||
379 | controlPoint2Y = 38.724; | ||
380 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
381 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
382 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
383 | pointX = 26.556; | ||
384 | pointY = 35.55; | ||
385 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
386 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
387 | controlPoint1X = 26.188; | ||
388 | controlPoint1Y = 37.344; | ||
389 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
390 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
391 | controlPoint2X = 26.556; | ||
392 | controlPoint2Y = 36.194; | ||
393 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
394 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
395 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
396 | pointX = 25.452; | ||
397 | pointY = 32.744; | ||
398 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
399 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
400 | controlPoint1X = 26.556; | ||
401 | controlPoint1Y = 34.676; | ||
402 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
403 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
404 | controlPoint2X = 26.326; | ||
405 | controlPoint2Y = 33.618; | ||
406 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
407 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
408 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
409 | pointX = 23.06; | ||
410 | pointY = 31.962; | ||
411 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
412 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
413 | controlPoint1X = 24.854; | ||
414 | controlPoint1Y = 32.284; | ||
415 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
416 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
417 | controlPoint2X = 23.934; | ||
418 | controlPoint2Y = 31.962; | ||
419 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
420 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
421 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
422 | pointX = 23.06; | ||
423 | pointY = 31.962; | ||
424 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
425 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
426 | context.lineTo(pointX, pointY); | ||
427 | context.closePath(); | ||
428 | pointX = 32.214; | ||
429 | pointY = 38.402; | ||
430 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
431 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
432 | context.moveTo(pointX, pointY); | ||
433 | color = "#FFFFFF"; | ||
434 | context.fillStyle = color; | ||
435 | context.fill(); | ||
436 | |||
437 | context.restore(); | ||
438 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js new file mode 100644 index 0000000..288e0be --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js | |||
@@ -0,0 +1,403 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //normal.js | ||
31 | //normal | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/24/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_RegisterButton_normalWidth = 282.0; | ||
39 | var kClipperz_PM_UI_Canvas_RegisterButton_normalHeight = 93.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_RegisterButton_normal(canvas, aBackgroundColor, aDarkBackgroundColor, aLightColor, aDarkColor, aStarColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | var controlPoint1X; | ||
50 | var controlPoint1Y; | ||
51 | var controlPoint2X; | ||
52 | var controlPoint2Y; | ||
53 | var gradient; | ||
54 | var color; | ||
55 | if (window.devicePixelRatio) | ||
56 | resolution = window.devicePixelRatio; | ||
57 | else | ||
58 | resolution = 1.0; | ||
59 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | ||
60 | |||
61 | context.save(); | ||
62 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | ||
63 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | ||
64 | |||
65 | // background | ||
66 | |||
67 | alignStroke = 0.0; | ||
68 | context.beginPath(); | ||
69 | pointX = 241.0; | ||
70 | pointY = 80.0; | ||
71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
73 | context.moveTo(pointX, pointY); | ||
74 | pointX = 274.0; | ||
75 | pointY = 47.0; | ||
76 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
77 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
78 | controlPoint1X = 259.103; | ||
79 | controlPoint1Y = 80.0; | ||
80 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
81 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
82 | controlPoint2X = 274.0; | ||
83 | controlPoint2Y = 65.103; | ||
84 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
85 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
86 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
87 | pointX = 274.0; | ||
88 | pointY = 45.0; | ||
89 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
90 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
91 | context.lineTo(pointX, pointY); | ||
92 | pointX = 241.0; | ||
93 | pointY = 12.0; | ||
94 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
95 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
96 | controlPoint1X = 274.0; | ||
97 | controlPoint1Y = 26.897; | ||
98 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
99 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
100 | controlPoint2X = 259.103; | ||
101 | controlPoint2Y = 12.0; | ||
102 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
103 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
104 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
105 | pointX = 60.0; | ||
106 | pointY = 12.0; | ||
107 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
108 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
109 | context.lineTo(pointX, pointY); | ||
110 | pointX = 27.0; | ||
111 | pointY = 45.0; | ||
112 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
113 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
114 | controlPoint1X = 41.897; | ||
115 | controlPoint1Y = 12.0; | ||
116 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
117 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
118 | controlPoint2X = 27.0; | ||
119 | controlPoint2Y = 26.897; | ||
120 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
121 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
122 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
123 | pointX = 27.0; | ||
124 | pointY = 47.0; | ||
125 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
126 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
127 | context.lineTo(pointX, pointY); | ||
128 | pointX = 60.0; | ||
129 | pointY = 80.0; | ||
130 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
131 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
132 | controlPoint1X = 27.0; | ||
133 | controlPoint1Y = 65.103; | ||
134 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
135 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
136 | controlPoint2X = 41.897; | ||
137 | controlPoint2Y = 80.0; | ||
138 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
139 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
140 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
141 | pointX = 241.0; | ||
142 | pointY = 80.0; | ||
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
145 | context.lineTo(pointX, pointY); | ||
146 | context.closePath(); | ||
147 | gradient = context.createLinearGradient(150.5, 12.0, 150.5, 80.0); | ||
148 | gradient.addColorStop(0.0, aBackgroundColor); | ||
149 | gradient.addColorStop(1.0, aDarkBackgroundColor); | ||
150 | context.fillStyle = gradient; | ||
151 | context.fill(); | ||
152 | |||
153 | // round | ||
154 | |||
155 | alignStroke = 0.0; | ||
156 | context.beginPath(); | ||
157 | pointX = 44.103; | ||
158 | pointY = 4.014; | ||
159 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
160 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
161 | context.moveTo(pointX, pointY); | ||
162 | pointX = 65.629; | ||
163 | pointY = 10.515; | ||
164 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
165 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
166 | controlPoint1X = 51.706; | ||
167 | controlPoint1Y = 4.217; | ||
168 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
169 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
170 | controlPoint2X = 59.185; | ||
171 | controlPoint2Y = 6.475; | ||
172 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
173 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
174 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
175 | pointX = 78.65; | ||
176 | pointY = 70.918; | ||
177 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
178 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
179 | context.lineTo(pointX, pointY); | ||
180 | pointX = 43.0; | ||
181 | pointY = 90.0; | ||
182 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
183 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
184 | controlPoint1X = 70.676; | ||
185 | controlPoint1Y = 82.788; | ||
186 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
187 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
188 | controlPoint2X = 57.23; | ||
189 | controlPoint2Y = 89.817; | ||
190 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
191 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
192 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
193 | pointX = 0.056; | ||
194 | pointY = 44.801; | ||
195 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
196 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
197 | controlPoint1X = 18.834; | ||
198 | controlPoint1Y = 90.07; | ||
199 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
200 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
201 | controlPoint2X = -1.18; | ||
202 | controlPoint2Y = 68.879; | ||
203 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
204 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
205 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
206 | pointX = 44.103; | ||
207 | pointY = 4.014; | ||
208 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
209 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
210 | controlPoint1X = 1.242; | ||
211 | controlPoint1Y = 21.708; | ||
212 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
213 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
214 | controlPoint2X = 21.202; | ||
215 | controlPoint2Y = 3.72; | ||
216 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
217 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
218 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
219 | pointX = 44.103; | ||
220 | pointY = 4.014; | ||
221 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
222 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
223 | context.lineTo(pointX, pointY); | ||
224 | context.closePath(); | ||
225 | gradient = context.createLinearGradient(39.326, 90, 39.326, 4.011); | ||
226 | gradient.addColorStop(0.0, aDarkColor); | ||
227 | gradient.addColorStop(1.0, aLightColor); | ||
228 | context.fillStyle = gradient; | ||
229 | context.fill(); | ||
230 | |||
231 | // * | ||
232 | |||
233 | alignStroke = 0.0; | ||
234 | context.beginPath(); | ||
235 | pointX = 23.983; | ||
236 | pointY = 35.944; | ||
237 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
238 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
239 | context.moveTo(pointX, pointY); | ||
240 | pointX = 37.25; | ||
241 | pointY = 40.261; | ||
242 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
243 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
244 | context.lineTo(pointX, pointY); | ||
245 | pointX = 37.25; | ||
246 | pointY = 24.963; | ||
247 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
248 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
249 | context.lineTo(pointX, pointY); | ||
250 | pointX = 48.231; | ||
251 | pointY = 24.963; | ||
252 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
253 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
254 | context.lineTo(pointX, pointY); | ||
255 | pointX = 48.231; | ||
256 | pointY = 40.261; | ||
257 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
258 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
259 | context.lineTo(pointX, pointY); | ||
260 | pointX = 61.498; | ||
261 | pointY = 35.944; | ||
262 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
263 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
264 | context.lineTo(pointX, pointY); | ||
265 | pointX = 64.481; | ||
266 | pointY = 45.402; | ||
267 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
268 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
269 | context.lineTo(pointX, pointY); | ||
270 | pointX = 50.961; | ||
271 | pointY = 49.592; | ||
272 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
273 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
274 | context.lineTo(pointX, pointY); | ||
275 | pointX = 59.784; | ||
276 | pointY = 62.224; | ||
277 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
278 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
279 | context.lineTo(pointX, pointY); | ||
280 | pointX = 51.659; | ||
281 | pointY = 68.0; | ||
282 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
283 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
284 | context.lineTo(pointX, pointY); | ||
285 | pointX = 42.836; | ||
286 | pointY = 56.066; | ||
287 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
288 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
289 | context.lineTo(pointX, pointY); | ||
290 | pointX = 33.759; | ||
291 | pointY = 68.0; | ||
292 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
293 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
294 | context.lineTo(pointX, pointY); | ||
295 | pointX = 25.634; | ||
296 | pointY = 62.224; | ||
297 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
298 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
299 | context.lineTo(pointX, pointY); | ||
300 | pointX = 34.521; | ||
301 | pointY = 49.592; | ||
302 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
303 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
304 | context.lineTo(pointX, pointY); | ||
305 | pointX = 21.0; | ||
306 | pointY = 45.402; | ||
307 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
308 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
309 | context.lineTo(pointX, pointY); | ||
310 | pointX = 23.983; | ||
311 | pointY = 35.944; | ||
312 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
313 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
314 | context.lineTo(pointX, pointY); | ||
315 | context.closePath(); | ||
316 | pointX = 68.607; | ||
317 | pointY = 119.099; | ||
318 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
319 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
320 | context.moveTo(pointX, pointY); | ||
321 | context.fillStyle = aStarColor; | ||
322 | context.fill(); | ||
323 | |||
324 | alignStroke = 0.0; | ||
325 | context.beginPath(); | ||
326 | pointX = 212.0; | ||
327 | pointY = 125.0; | ||
328 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
329 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
330 | context.moveTo(pointX, pointY); | ||
331 | pointX = 213.0; | ||
332 | pointY = 125.0; | ||
333 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
334 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
335 | context.lineTo(pointX, pointY); | ||
336 | pointX = 212.5; | ||
337 | pointY = 124.0; | ||
338 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
339 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
340 | context.lineTo(pointX, pointY); | ||
341 | pointX = 212.0; | ||
342 | pointY = 125.0; | ||
343 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
344 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
345 | context.lineTo(pointX, pointY); | ||
346 | context.closePath(); | ||
347 | gradient = context.createLinearGradient(212.5, 125.0, 212.5, 124.0); | ||
348 | color = "#FFFFFF"; | ||
349 | gradient.addColorStop(0.0, color); | ||
350 | color = "#A9A9A9"; | ||
351 | gradient.addColorStop(1.0, color); | ||
352 | context.fillStyle = gradient; | ||
353 | context.fill(); | ||
354 | |||
355 | // flip | ||
356 | |||
357 | // Setup for Shadow Effect | ||
358 | color = "rgba(0.0%, 0.0%, 0.0%, 0.5)"; | ||
359 | context.save(); | ||
360 | context.shadowColor = color; | ||
361 | context.shadowBlur = 0.0; | ||
362 | context.shadowOffsetX = 2.0 * Math.cos(8.377) * resolution; | ||
363 | context.shadowOffsetY = 2.0 * Math.sin(8.377) * resolution; | ||
364 | |||
365 | // round | ||
366 | |||
367 | alignStroke = 0.0; | ||
368 | context.beginPath(); | ||
369 | pointX = 78.506; | ||
370 | pointY = 70.251; | ||
371 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
372 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
373 | context.moveTo(pointX, pointY); | ||
374 | pointX = 66.155; | ||
375 | pointY = 12.954; | ||
376 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
377 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
378 | controlPoint1X = 59.899; | ||
379 | controlPoint1Y = 57.427; | ||
380 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
381 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
382 | controlPoint2X = 54.678; | ||
383 | controlPoint2Y = 32.277; | ||
384 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
385 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
386 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
387 | pointX = 78.506; | ||
388 | pointY = 70.251; | ||
389 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
390 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
391 | context.lineTo(pointX, pointY); | ||
392 | context.closePath(); | ||
393 | gradient = context.createLinearGradient(69.301, 70.251, 69.301, 12.954); | ||
394 | gradient.addColorStop(0.0, aDarkColor); | ||
395 | gradient.addColorStop(1.0, aLightColor); | ||
396 | context.fillStyle = gradient; | ||
397 | context.fill(); | ||
398 | |||
399 | // Shadow Effect | ||
400 | context.restore(); | ||
401 | |||
402 | context.restore(); | ||
403 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js new file mode 100644 index 0000000..e70e3b5 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //normal.js | ||
31 | //normal | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/15/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Star_normalWidth = 46.0; | ||
39 | var kClipperz_PM_UI_Canvas_Star_normalHeight = 46.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Star_normal(canvas, aColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | if (window.devicePixelRatio) | ||
50 | resolution = window.devicePixelRatio; | ||
51 | else | ||
52 | resolution = 1.0; | ||
53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); | ||
54 | |||
55 | context.save(); | ||
56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); | ||
57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Star_normalWidth, kClipperz_PM_UI_Canvas_Star_normalHeight); | ||
58 | |||
59 | // * | ||
60 | |||
61 | alignStroke = 0.0; | ||
62 | context.beginPath(); | ||
63 | pointX = 8.613; | ||
64 | pointY = 15.583; | ||
65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
67 | context.moveTo(pointX, pointY); | ||
68 | pointX = 18.563; | ||
69 | pointY = 18.821; | ||
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
72 | context.lineTo(pointX, pointY); | ||
73 | pointX = 18.563; | ||
74 | pointY = 7.347; | ||
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
77 | context.lineTo(pointX, pointY); | ||
78 | pointX = 26.799; | ||
79 | pointY = 7.347; | ||
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
82 | context.lineTo(pointX, pointY); | ||
83 | pointX = 26.799; | ||
84 | pointY = 18.821; | ||
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
87 | context.lineTo(pointX, pointY); | ||
88 | pointX = 36.749; | ||
89 | pointY = 15.583; | ||
90 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
91 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
92 | context.lineTo(pointX, pointY); | ||
93 | pointX = 38.986; | ||
94 | pointY = 22.677; | ||
95 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
96 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
97 | context.lineTo(pointX, pointY); | ||
98 | pointX = 28.846; | ||
99 | pointY = 25.819; | ||
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
102 | context.lineTo(pointX, pointY); | ||
103 | pointX = 35.463; | ||
104 | pointY = 35.293; | ||
105 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
106 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
107 | context.lineTo(pointX, pointY); | ||
108 | pointX = 29.369; | ||
109 | pointY = 39.625; | ||
110 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
111 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
112 | context.lineTo(pointX, pointY); | ||
113 | pointX = 22.752; | ||
114 | pointY = 30.675; | ||
115 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
116 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
117 | context.lineTo(pointX, pointY); | ||
118 | pointX = 15.944; | ||
119 | pointY = 39.625; | ||
120 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
121 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
122 | context.lineTo(pointX, pointY); | ||
123 | pointX = 9.85; | ||
124 | pointY = 35.293; | ||
125 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
126 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
127 | context.lineTo(pointX, pointY); | ||
128 | pointX = 16.515; | ||
129 | pointY = 25.819; | ||
130 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
131 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
132 | context.lineTo(pointX, pointY); | ||
133 | pointX = 6.375; | ||
134 | pointY = 22.677; | ||
135 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
136 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
137 | context.lineTo(pointX, pointY); | ||
138 | pointX = 8.613; | ||
139 | pointY = 15.583; | ||
140 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
141 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
142 | context.lineTo(pointX, pointY); | ||
143 | context.closePath(); | ||
144 | pointX = 42.081; | ||
145 | pointY = 77.949; | ||
146 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
147 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
148 | context.moveTo(pointX, pointY); | ||
149 | context.fillStyle = aColor; | ||
150 | context.fill(); | ||
151 | |||
152 | context.restore(); | ||
153 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js new file mode 100644 index 0000000..216fd24 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js | |||
@@ -0,0 +1,156 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //close.js | ||
31 | //close | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/14/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Tips_closeWidth = 310.0; | ||
39 | var kClipperz_PM_UI_Canvas_Tips_closeHeight = 6.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Tips_close(canvas, aColor, aBackgroundColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | if (window.devicePixelRatio) | ||
50 | resolution = window.devicePixelRatio; | ||
51 | else | ||
52 | resolution = 1.0; | ||
53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); | ||
54 | |||
55 | context.save(); | ||
56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); | ||
57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_closeWidth, kClipperz_PM_UI_Canvas_Tips_closeHeight); | ||
58 | |||
59 | // background | ||
60 | |||
61 | alignStroke = 0.0; | ||
62 | context.beginPath(); | ||
63 | pointX = 310.0; | ||
64 | pointY = 6.0; | ||
65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
67 | context.moveTo(pointX, pointY); | ||
68 | pointX = 310.0; | ||
69 | pointY = 0.0; | ||
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
72 | context.lineTo(pointX, pointY); | ||
73 | pointX = 0.0; | ||
74 | pointY = 0.0; | ||
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
77 | context.lineTo(pointX, pointY); | ||
78 | pointX = 0.0; | ||
79 | pointY = 6.0; | ||
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
82 | context.lineTo(pointX, pointY); | ||
83 | pointX = 310.0; | ||
84 | pointY = 6.0; | ||
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
87 | context.lineTo(pointX, pointY); | ||
88 | context.closePath(); | ||
89 | context.fillStyle = aBackgroundColor; | ||
90 | context.fill(); | ||
91 | |||
92 | // grid | ||
93 | |||
94 | // background | ||
95 | |||
96 | alignStroke = 0.0; | ||
97 | context.beginPath(); | ||
98 | pointX = 310.0; | ||
99 | pointY = 6.0; | ||
100 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
101 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
102 | context.moveTo(pointX, pointY); | ||
103 | pointX = 310.0; | ||
104 | pointY = 0.0; | ||
105 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
106 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
107 | context.lineTo(pointX, pointY); | ||
108 | pointX = 0.0; | ||
109 | pointY = 0.0; | ||
110 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
111 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
112 | context.lineTo(pointX, pointY); | ||
113 | pointX = 0.0; | ||
114 | pointY = 6.0; | ||
115 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
116 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
117 | context.lineTo(pointX, pointY); | ||
118 | pointX = 310.0; | ||
119 | pointY = 6.0; | ||
120 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
121 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
122 | context.lineTo(pointX, pointY); | ||
123 | context.closePath(); | ||
124 | context.fillStyle = aBackgroundColor; | ||
125 | context.fill(); | ||
126 | |||
127 | // toggle | ||
128 | |||
129 | alignStroke = 0.0; | ||
130 | context.beginPath(); | ||
131 | pointX = 149.0; | ||
132 | pointY = 6.0; | ||
133 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
134 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
135 | context.moveTo(pointX, pointY); | ||
136 | pointX = 161.0; | ||
137 | pointY = 6.0; | ||
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
140 | context.lineTo(pointX, pointY); | ||
141 | pointX = 155.0; | ||
142 | pointY = 0.0; | ||
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
145 | context.lineTo(pointX, pointY); | ||
146 | pointX = 149.0; | ||
147 | pointY = 6.0; | ||
148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
150 | context.lineTo(pointX, pointY); | ||
151 | context.closePath(); | ||
152 | context.fillStyle = aColor; | ||
153 | context.fill(); | ||
154 | |||
155 | context.restore(); | ||
156 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js new file mode 100644 index 0000000..f1bdaa9 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js | |||
@@ -0,0 +1,163 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | // | ||
30 | //open.js | ||
31 | //open | ||
32 | // | ||
33 | //Created by Giulio Cesare Solaroli on 3/14/10 | ||
34 | //Copyright 2010 Clipperz | ||
35 | //This code was generated by Opacity. You may use or modify it in any way. | ||
36 | // | ||
37 | |||
38 | var kClipperz_PM_UI_Canvas_Tips_openWidth = 310.0; | ||
39 | var kClipperz_PM_UI_Canvas_Tips_openHeight = 6.0; | ||
40 | |||
41 | function Clipperz_PM_UI_Canvas_Tips_open(canvas, aColor, aBackgroundColor) | ||
42 | { | ||
43 | var context = canvas.getContext("2d"); | ||
44 | var alignStroke; | ||
45 | var resolution; | ||
46 | var path; | ||
47 | var pointX; | ||
48 | var pointY; | ||
49 | var color; | ||
50 | if (window.devicePixelRatio) | ||
51 | resolution = window.devicePixelRatio; | ||
52 | else | ||
53 | resolution = 1.0; | ||
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); | ||
55 | |||
56 | context.save(); | ||
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); | ||
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_openWidth, kClipperz_PM_UI_Canvas_Tips_openHeight); | ||
59 | |||
60 | // background | ||
61 | |||
62 | alignStroke = 0.0; | ||
63 | context.beginPath(); | ||
64 | pointX = 310.0; | ||
65 | pointY = 6.0; | ||
66 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
67 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
68 | context.moveTo(pointX, pointY); | ||
69 | pointX = 310.0; | ||
70 | pointY = 0.0; | ||
71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
73 | context.lineTo(pointX, pointY); | ||
74 | pointX = 0.0; | ||
75 | pointY = 0.0; | ||
76 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
77 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
78 | context.lineTo(pointX, pointY); | ||
79 | pointX = 0.0; | ||
80 | pointY = 6.0; | ||
81 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
82 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
83 | context.lineTo(pointX, pointY); | ||
84 | pointX = 310.0; | ||
85 | pointY = 6.0; | ||
86 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
87 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
88 | context.lineTo(pointX, pointY); | ||
89 | context.closePath(); | ||
90 | context.fillStyle = aBackgroundColor; | ||
91 | context.fill(); | ||
92 | |||
93 | // grid | ||
94 | |||
95 | // background | ||
96 | |||
97 | alignStroke = 0.0; | ||
98 | context.beginPath(); | ||
99 | pointX = 310.0; | ||
100 | pointY = 6.0; | ||
101 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
102 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
103 | context.moveTo(pointX, pointY); | ||
104 | pointX = 310.0; | ||
105 | pointY = 0.0; | ||
106 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
107 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
108 | context.lineTo(pointX, pointY); | ||
109 | pointX = 0.0; | ||
110 | pointY = 0.0; | ||
111 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
112 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
113 | context.lineTo(pointX, pointY); | ||
114 | pointX = 0.0; | ||
115 | pointY = 6.0; | ||
116 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
117 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
118 | context.lineTo(pointX, pointY); | ||
119 | pointX = 310.0; | ||
120 | pointY = 6.0; | ||
121 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
122 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
123 | context.lineTo(pointX, pointY); | ||
124 | context.closePath(); | ||
125 | context.fillStyle = aBackgroundColor; | ||
126 | context.fill(); | ||
127 | |||
128 | // Layer 1 | ||
129 | |||
130 | alignStroke = 0.0; | ||
131 | context.save(); | ||
132 | context.translate(155.0, 3.0); | ||
133 | context.rotate(-3.142); | ||
134 | context.translate(-155.0, -3.0); | ||
135 | context.beginPath(); | ||
136 | pointX = 149.0; | ||
137 | pointY = 6.0; | ||
138 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
139 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
140 | context.moveTo(pointX, pointY); | ||
141 | pointX = 161.0; | ||
142 | pointY = 6.0; | ||
143 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
144 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
145 | context.lineTo(pointX, pointY); | ||
146 | pointX = 155.0; | ||
147 | pointY = 0.0; | ||
148 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
149 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
150 | context.lineTo(pointX, pointY); | ||
151 | pointX = 149.0; | ||
152 | pointY = 6.0; | ||
153 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
154 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
155 | context.lineTo(pointX, pointY); | ||
156 | context.closePath(); | ||
157 | color = "#FFFFFF"; | ||
158 | context.fillStyle = color; | ||
159 | context.fill(); | ||
160 | context.restore(); | ||
161 | |||
162 | context.restore(); | ||
163 | } | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js new file mode 100644 index 0000000..26f2fc4 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js | |||
@@ -0,0 +1,611 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | var _Clipperz_PM_Components_base_id_ = 0; | ||
34 | |||
35 | //############################################################################# | ||
36 | |||
37 | Clipperz.PM.UI.Common.Components.BaseComponent = function(args) { | ||
38 | args = args || {}; | ||
39 | Clipperz.PM.UI.Common.Components.BaseComponent.superclass.constructor.call(this, args); | ||
40 | |||
41 | this._element = args.element || null; | ||
42 | this._ids = {}; | ||
43 | |||
44 | this._slots = {}; | ||
45 | this._slotComponents = {}; | ||
46 | |||
47 | this._components = {}; | ||
48 | |||
49 | this._cachedSlots = {}; | ||
50 | |||
51 | this._isModal = false; | ||
52 | |||
53 | this._isActive = false; | ||
54 | this._elementUsedToEnterModalState; | ||
55 | |||
56 | this._isFullyRendered = false; | ||
57 | this._renderingWaitingQueue = []; | ||
58 | |||
59 | //this._slots = { | ||
60 | // 'header':'header', | ||
61 | // 'body': 'body', | ||
62 | // 'footer':'footer' | ||
63 | //}; | ||
64 | |||
65 | return this; | ||
66 | } | ||
67 | |||
68 | //============================================================================= | ||
69 | |||
70 | //TODO get back to MochiKit.Base.update as we are not extending anything | ||
71 | //MochiKit.Base.update(Clipperz.PM.UI.Common.Components.BaseComponent.prototype, { | ||
72 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Component*/ Object, { | ||
73 | |||
74 | 'isClipperzPMComponent': true, | ||
75 | |||
76 | //------------------------------------------------------------------------- | ||
77 | |||
78 | 'toString': function () { | ||
79 | return "Clipperz.PM.UI.Common.Components.BaseComponent component"; | ||
80 | }, | ||
81 | |||
82 | 'componentId': function () { | ||
83 | return this.getId('_id_'); | ||
84 | }, | ||
85 | |||
86 | //------------------------------------------------------------------------- | ||
87 | /* | ||
88 | 'slots': function() { | ||
89 | return this._slots; | ||
90 | }, | ||
91 | */ | ||
92 | 'slotComponents': function() { | ||
93 | return this._slotComponents; | ||
94 | }, | ||
95 | |||
96 | //------------------------------------------------------------------------- | ||
97 | |||
98 | 'components': function () { | ||
99 | return this._components; | ||
100 | }, | ||
101 | |||
102 | 'addComponent': function (aComponent) { | ||
103 | this.components()[aComponent.componentId()] = aComponent; | ||
104 | }, | ||
105 | |||
106 | 'removeComponent': function (aComponent) { | ||
107 | var componentId; | ||
108 | |||
109 | componentId = aComponent.componentId(); | ||
110 | this.components()[componentId].remove(); | ||
111 | delete this.components()[componentId]; | ||
112 | }, | ||
113 | |||
114 | //------------------------------------------------------------------------- | ||
115 | /* | ||
116 | 'domHelper': function() { | ||
117 | return Clipperz.YUI.DomHelper; | ||
118 | }, | ||
119 | */ | ||
120 | //------------------------------------------------------------------------- | ||
121 | /* | ||
122 | 'domHelperAppend': function(aValue) { | ||
123 | Clipperz.YUI.DomHelper.append(this.element().dom, aValue); | ||
124 | }, | ||
125 | */ | ||
126 | //------------------------------------------------------------------------- | ||
127 | |||
128 | 'element': function() { | ||
129 | //MochiKit.Logging.logDebug(">>> BaseComponent.element"); | ||
130 | return MochiKit.DOM.getElement(this._element); | ||
131 | }, | ||
132 | |||
133 | 'setElement': function(aNode) { | ||
134 | this._element = aNode; | ||
135 | }, | ||
136 | |||
137 | //----------------------------------------------------- | ||
138 | |||
139 | 'displayElement': function() { | ||
140 | return this.element(); | ||
141 | }, | ||
142 | |||
143 | //------------------------------------------------------------------------- | ||
144 | |||
145 | 'renderInNode': function(aDomNode) { | ||
146 | this.setElement(aDomNode); | ||
147 | this.render(); | ||
148 | }, | ||
149 | |||
150 | 'render': function() { | ||
151 | this.clear(); | ||
152 | this.renderSelf(); | ||
153 | this.renderComponents(); | ||
154 | if (this.shouldShowTranslationHints()) { | ||
155 | this.renderTranslationHints(); | ||
156 | } | ||
157 | if (this.shouldShowElementWhileRendering()) { | ||
158 | MochiKit.Style.showElement(this.displayElement()); | ||
159 | }; | ||
160 | |||
161 | this._isFullyRendered = true; | ||
162 | |||
163 | MochiKit.Iter.forEach(this.renderingWaitingQueue(), MochiKit.Base.methodcaller('callback')); | ||
164 | this.resetRenderingWaitingQueue(); | ||
165 | }, | ||
166 | |||
167 | 'renderSelf': function() { | ||
168 | throw Clipperz.Base.exception.AbstractMethod; | ||
169 | }, | ||
170 | |||
171 | 'renderComponents': function() { | ||
172 | varslotName; | ||
173 | |||
174 | for (slotName in this.slotComponents()) { | ||
175 | this.slotComponents()[slotName].renderInNode(this.elementForSlotNamed(slotName)); | ||
176 | } | ||
177 | }, | ||
178 | |||
179 | //......................................................................... | ||
180 | |||
181 | 'isFullyRendered': function () { | ||
182 | return this._isFullyRendered; | ||
183 | }, | ||
184 | |||
185 | //......................................................................... | ||
186 | |||
187 | 'renderingWaitingQueue': function () { | ||
188 | return this._renderingWaitingQueue; | ||
189 | }, | ||
190 | |||
191 | 'resetRenderingWaitingQueue': function () { | ||
192 | this._renderingWaitingQueue = []; | ||
193 | }, | ||
194 | |||
195 | //......................................................................... | ||
196 | |||
197 | 'waitUntilFullyRendered': function () { | ||
198 | var deferredResult; | ||
199 | |||
200 | if (this.isFullyRendered() == true) { | ||
201 | deferredResult = MochiKit.Async.succeed | ||
202 | } else { | ||
203 | deferredResult = new Clipperz.Async.Deferred("BaseComponent.waitUntilFullyRendered", {trace:false}); | ||
204 | this.renderingWaitingQueue().push(deferredResult); | ||
205 | } | ||
206 | |||
207 | return deferredResult; | ||
208 | }, | ||
209 | |||
210 | //----------------------------------------------------- | ||
211 | |||
212 | 'renderTranslationHints': function () { | ||
213 | vartranslatableItems; | ||
214 | |||
215 | translatableItems = MochiKit.Selector.findChildElements(this.displayElement(), ['[stringID]']); | ||
216 | MochiKit.Iter.forEach(translatableItems, MochiKit.Base.method(this, 'enhanceTranslatableElement')) | ||
217 | }, | ||
218 | |||
219 | 'enhanceTranslatableElement': function (anElement) { | ||
220 | //Clipperz.log(">>> enhanceTranslatableElement", anElement); | ||
221 | // new Clipperz.PM.UI.Common.Components.TranslatorWidget({ | ||
222 | // 'element':anElement | ||
223 | // }); | ||
224 | |||
225 | MochiKit.Signal.connect(anElement, 'onmouseenter', MochiKit.Base.partial(Clipperz.PM.UI.Common.Components.TranslatorWidget.show, anElement, MochiKit.DOM.getNodeAttribute(anElement, 'stringID'))); | ||
226 | MochiKit.Signal.connect(anElement, 'onmouseleave', Clipperz.PM.UI.Common.Components.TranslatorWidget.hide); | ||
227 | //Clipperz.log("<<< enhanceTranslatableElement"); | ||
228 | }, | ||
229 | |||
230 | //----------------------------------------------------- | ||
231 | |||
232 | 'update': function(args) { | ||
233 | throw Clipperz.Base.exception.AbstractMethod; | ||
234 | }, | ||
235 | |||
236 | 'updateSelf': function(args) { | ||
237 | throw Clipperz.Base.exception.AbstractMethod; | ||
238 | }, | ||
239 | |||
240 | 'updateComponents': function(args) { | ||
241 | throw Clipperz.Base.exception.AbstractMethod; | ||
242 | }, | ||
243 | |||
244 | //----------------------------------------------------- | ||
245 | |||
246 | 'refresh': function() { | ||
247 | throw Clipperz.Base.exception.AbstractMethod; | ||
248 | }, | ||
249 | |||
250 | 'refreshSelf': function() { | ||
251 | throw Clipperz.Base.exception.AbstractMethod; | ||
252 | }, | ||
253 | |||
254 | 'refreshComponents': function(args) { | ||
255 | throw Clipperz.Base.exception.AbstractMethod; | ||
256 | }, | ||
257 | |||
258 | //----------------------------------------------------- | ||
259 | |||
260 | 'checkSlotNamed': function(aSlotName) { | ||
261 | if (typeof(this._slots[aSlotName]) == 'undefined') { | ||
262 | throw new Error("undefined slot"); | ||
263 | }; | ||
264 | }, | ||
265 | |||
266 | //----------------------------------------------------- | ||
267 | |||
268 | 'cachedSlots': function() { | ||
269 | return this._cachedSlots; | ||
270 | }, | ||
271 | |||
272 | 'slotNamed': function(aSlotName) { | ||
273 | var result; | ||
274 | |||
275 | this.checkSlotNamed(aSlotName); | ||
276 | if (typeof(this.cachedSlots()[aSlotName]) == 'undefined') { | ||
277 | this.cachedSlots()[aSlotName] = new Clipperz.PM.UI.Common.Components.ComponentSlot(this,aSlotName); | ||
278 | } | ||
279 | |||
280 | result = this.cachedSlots()[aSlotName]; | ||
281 | |||
282 | return result; | ||
283 | }, | ||
284 | |||
285 | //----------------------------------------------------- | ||
286 | |||
287 | 'elementForSlotNamed': function(aSlotName) { | ||
288 | return MochiKit.DOM.getElement(this._slots[aSlotName]); | ||
289 | }, | ||
290 | |||
291 | //----------------------------------------------------- | ||
292 | |||
293 | 'componentForSlotNamed': function(aSlotName) { | ||
294 | return this.slotComponents()[aSlotName]; | ||
295 | }, | ||
296 | |||
297 | 'setComponentForSlotNamed': function(aComponent, aSlotName) { | ||
298 | var domNode; | ||
299 | |||
300 | this.checkSlotNamed(aSlotName); | ||
301 | |||
302 | if (this.slotComponents()[aSlotName] != null) { | ||
303 | this.slotComponents()[aSlotName].remove(); | ||
304 | } | ||
305 | |||
306 | this.slotComponents()[aSlotName] = aComponent; | ||
307 | |||
308 | // domNode = MochiKit.DOM.getElement(this.slotNamed(aSlotName)); | ||
309 | domNode = this.elementForSlotNamed(aSlotName); | ||
310 | |||
311 | if (domNode != null) { | ||
312 | aComponent.renderInNode(domNode); | ||
313 | } | ||
314 | }, | ||
315 | |||
316 | //----------------------------------------------------- | ||
317 | /* | ||
318 | 'purgeListeners': function() { | ||
319 | //MochiKit.Logging.logDebug(">>> Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners [" + this + "]"); | ||
320 | //MochiKit.Logging.logDebug("--- " + this + ".purgeListeners"); | ||
321 | Clipperz.NotificationCenter.unregister(this); | ||
322 | MochiKit.Signal.disconnectAllTo(this); | ||
323 | //MochiKit.Logging.logDebug("<<< Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners"); | ||
324 | }, | ||
325 | */ | ||
326 | //----------------------------------------------------- | ||
327 | |||
328 | 'clear': function() { | ||
329 | varslotName; | ||
330 | var componentId; | ||
331 | |||
332 | MochiKit.Signal.disconnectAllTo(this); | ||
333 | |||
334 | for (slotName in this.slotComponents()) { | ||
335 | this.slotComponents()[slotName].clear(); | ||
336 | } | ||
337 | |||
338 | for (componentId in this.components()) { | ||
339 | this.components()[componentId].clear(); | ||
340 | } | ||
341 | |||
342 | // if (this.element() != null) { | ||
343 | // this.element().innerHTML = ""; | ||
344 | // } | ||
345 | |||
346 | if (this.displayElement() != null) { | ||
347 | if (this.element() != this.displayElement()) { | ||
348 | MochiKit.DOM.removeElement(this.displayElement()); | ||
349 | } else { | ||
350 | this.displayElement().innerHTML = ""; | ||
351 | } | ||
352 | } | ||
353 | |||
354 | if (this.isModal()) { | ||
355 | //TODO: cleanup when the closed element was shown modally. | ||
356 | } | ||
357 | }, | ||
358 | |||
359 | |||
360 | 'remove': function() { | ||
361 | varslotName; | ||
362 | var componentId; | ||
363 | |||
364 | for (slotName in this.slotComponents()) { | ||
365 | this.slotComponents()[slotName].remove(); | ||
366 | delete this.slotComponents()[slotName]; | ||
367 | } | ||
368 | |||
369 | for (componentId in this.components()) { | ||
370 | this.components()[componentId].remove(); | ||
371 | delete this.components()[componentId]; | ||
372 | } | ||
373 | |||
374 | this.clear(); | ||
375 | MochiKit.Signal.disconnectAll(this); | ||
376 | }, | ||
377 | |||
378 | 'append': function(aNode, aValue) { | ||
379 | return Clipperz.DOM.Helper.append(aNode, aValue); | ||
380 | }, | ||
381 | |||
382 | 'insertBefore': function (aNode, aValue) { | ||
383 | return Clipperz.DOM.Helper.insertBefore(aNode, aValue); | ||
384 | }, | ||
385 | |||
386 | 'insertAfter': function (aNode, aValue) { | ||
387 | return Clipperz.DOM.Helper.insertAfter(aNode, aValue); | ||
388 | }, | ||
389 | |||
390 | //------------------------------------------------------------------------- | ||
391 | |||
392 | 'getId': function(aValue) { | ||
393 | varresult; | ||
394 | |||
395 | if (typeof(aValue) != 'undefined') { | ||
396 | result = this._ids[aValue]; | ||
397 | |||
398 | if (typeof(result) == 'undefined') { | ||
399 | _Clipperz_PM_Components_base_id_ ++; | ||
400 | |||
401 | result = "Clipperz_PM_Components_" + aValue + "_" + _Clipperz_PM_Components_base_id_; | ||
402 | this._ids[aValue] = result; | ||
403 | } | ||
404 | } else { | ||
405 | // result = Clipperz.PM.UI.Common.Components.BaseComponent.superclass.getId.call(this); | ||
406 | throw "call to BaseComponent.getId with an undefined value"; | ||
407 | } | ||
408 | |||
409 | return result; | ||
410 | }, | ||
411 | |||
412 | //------------------------------------------------------------------------- | ||
413 | |||
414 | 'getElement': function(aValue) { | ||
415 | return Clipperz.DOM.get(this.getId(aValue)); | ||
416 | }, | ||
417 | |||
418 | //------------------------------------------------------------------------- | ||
419 | |||
420 | 'hideElement': function(anElementName) { | ||
421 | MochiKit.Style.hideElement(this.getElement(anElementName)); | ||
422 | }, | ||
423 | |||
424 | 'showElement': function(anElementName) { | ||
425 | MochiKit.Style.showElement(this.getElement(anElementName)); | ||
426 | }, | ||
427 | |||
428 | //------------------------------------------------------------------------- | ||
429 | |||
430 | 'activate': function () { | ||
431 | this._isActive = true; | ||
432 | }, | ||
433 | |||
434 | 'deactivate': function () { | ||
435 | this._isActive = false; | ||
436 | }, | ||
437 | |||
438 | 'isActive': function () { | ||
439 | return this._isActive; | ||
440 | }, | ||
441 | |||
442 | //------------------------------------------------------------------------- | ||
443 | |||
444 | 'hideSlot': function(aSlotName) { | ||
445 | if (this.componentForSlotNamed(aSlotName)) { | ||
446 | this.componentForSlotNamed(aSlotName).deactivate(); | ||
447 | } | ||
448 | MochiKit.Style.hideElement(this.elementForSlotNamed(aSlotName)); | ||
449 | }, | ||
450 | |||
451 | 'showSlot': function(aSlotName) { | ||
452 | if (this.componentForSlotNamed(aSlotName)) { | ||
453 | this.componentForSlotNamed(aSlotName).activate(); | ||
454 | } | ||
455 | MochiKit.Style.showElement(this.elementForSlotNamed(aSlotName)); | ||
456 | }, | ||
457 | |||
458 | //------------------------------------------------------------------------- | ||
459 | |||
460 | 'shouldShowTranslationHints': function () { | ||
461 | return false; | ||
462 | }, | ||
463 | |||
464 | 'shouldShowElementWhileRendering': function() { | ||
465 | return true; | ||
466 | }, | ||
467 | |||
468 | //'shouldRemoveElementWhenClearningUp': function () { | ||
469 | // return true; | ||
470 | //}, | ||
471 | |||
472 | //------------------------------------------------------------------------- | ||
473 | |||
474 | 'isModal': function() { | ||
475 | return this._isModal; | ||
476 | }, | ||
477 | |||
478 | 'setIsModal': function(aValue) { | ||
479 | this._isModal = aValue; | ||
480 | }, | ||
481 | |||
482 | //------------------------------------------------------------------------- | ||
483 | |||
484 | 'elementUsedToEnterModalState': function () { | ||
485 | return this._elementUsedToEnterModalState; | ||
486 | }, | ||
487 | |||
488 | 'setElementUsedToEnterModalState': function (aValue) { | ||
489 | this._elementUsedToEnterModalState = aValue; | ||
490 | }, | ||
491 | |||
492 | //------------------------------------------------------------------------- | ||
493 | |||
494 | 'modalDialogMask': function () { | ||
495 | return 'modalDialogMask'; | ||
496 | }, | ||
497 | |||
498 | 'modalDialog': function () { | ||
499 | return 'modalDialog'; | ||
500 | }, | ||
501 | |||
502 | 'modalDialogFrame': function() { | ||
503 | return 'modalDialogFrame' | ||
504 | }, | ||
505 | |||
506 | //------------------------------------------------------------------------- | ||
507 | |||
508 | 'deferredShowModal': function(args) { | ||
509 | var deferredResult; | ||
510 | |||
511 | deferredResult = new Clipperz.Async.Deferred("BaseComponent.deferredShowModal", {trace:false}); | ||
512 | |||
513 | deferredResult.addMethod(this, 'setIsModal', true); | ||
514 | deferredResult.addCallback(MochiKit.Style.showElement, this.modalDialogMask()); | ||
515 | deferredResult.addCallback(MochiKit.Base.bind(function(someArgs) { | ||
516 | var result; | ||
517 | var duration; | ||
518 | var from; | ||
519 | var to; | ||
520 | |||
521 | duration = someArgs.duration || 0.4; | ||
522 | |||
523 | this.setElementUsedToEnterModalState(someArgs.openFromElement); | ||
524 | from = Clipperz.Style.getSizeAndPosition(someArgs.openFromElement); | ||
525 | this.renderInNode(this.modalDialog()); | ||
526 | MochiKit.DOM.addElementClass(this.modalDialog(), 'fixed'); | ||
527 | to = Clipperz.Style.getSizeAndPosition(this.displayElement()); | ||
528 | Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition = Clipperz.Base.deepClone(to); | ||
529 | |||
530 | MochiKit.Style.hideElement(this.displayElement()); | ||
531 | MochiKit.Style.showElement(this.modalDialogFrame()); | ||
532 | |||
533 | result = {from:from, to:to, duration:duration}; | ||
534 | return result; | ||
535 | }, this, args)); | ||
536 | deferredResult.addCallback(Clipperz.Visual.deferredResize, this.modalDialogFrame()); | ||
537 | deferredResult.addCallback(MochiKit.Base.bind(function(someArgs) { | ||
538 | MochiKit.Style.hideElement(this.modalDialogFrame()); | ||
539 | MochiKit.Style.showElement(this.displayElement()); | ||
540 | }, this)); | ||
541 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | ||
542 | deferredResult.callback(); | ||
543 | |||
544 | return deferredResult; | ||
545 | }, | ||
546 | |||
547 | //------------------------------------------------------------------------- | ||
548 | |||
549 | 'deferredHideModal': function(args) { | ||
550 | var deferredResult; | ||
551 | |||
552 | args = args || {}; | ||
553 | |||
554 | deferredResult = new Clipperz.Async.Deferred("BaseComponent.deferredHideModal", {trace:false}); | ||
555 | deferredResult.addCallback(MochiKit.Base.bind(function(someArgs) { | ||
556 | var result; | ||
557 | var from; | ||
558 | var toElement; | ||
559 | var to; | ||
560 | var duration; | ||
561 | |||
562 | toElement = args.closeToElement || this.elementUsedToEnterModalState(); | ||
563 | duration = someArgs.duration || 0.4; | ||
564 | from = Clipperz.Style.getSizeAndPosition(this.displayElement()); | ||
565 | to = Clipperz.Style.getSizeAndPosition(toElement); | ||
566 | |||
567 | MochiKit.Style.hideElement(this.displayElement()); | ||
568 | MochiKit.Style.showElement(this.modalDialogFrame()); | ||
569 | |||
570 | result = {from:from, to:to, duration:duration}; | ||
571 | return result; | ||
572 | }, this, args)); | ||
573 | deferredResult.addCallback(Clipperz.Visual.deferredResize, this.modalDialogFrame()); | ||
574 | deferredResult.addCallback(MochiKit.Base.bind(function() { | ||
575 | MochiKit.Style.hideElement(this.modalDialogFrame()); | ||
576 | MochiKit.Style.hideElement(this.modalDialogMask()); | ||
577 | }, this)); | ||
578 | deferredResult.addMethod(this, 'setIsModal', false); | ||
579 | deferredResult.addMethod(this, 'clear'); //############## | ||
580 | deferredResult.addCallback(MochiKit.Async.succeed, arguments[arguments.length - 1]); | ||
581 | deferredResult.callback(); | ||
582 | |||
583 | return deferredResult; | ||
584 | }, | ||
585 | |||
586 | //------------------------------------------------------------------------- | ||
587 | |||
588 | __syntaxFix__: "syntax fix" | ||
589 | |||
590 | }); | ||
591 | |||
592 | Clipperz.PM.UI.Common.Components.BaseComponent_modalDialog = function() { | ||
593 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, | ||
594 | {tag:'div', id:'modalDialogWrapper', cls:'modalDialogWrapper', children:[ | ||
595 | {tag:'div', id:'modalDialogMask', cls:'modalDialogMask'}, | ||
596 | {tag:'div', id:'modalDialogFrame', cls:'modalDialogFrame' /*, html:"modal dialog frame"*/}, | ||
597 | {tag:'div', id:'modalDialog', cls:'modalDialog'} | ||
598 | // {tag:'div', id:'modalDialog', cls:'modalDialog', children:[{tag:'div'}]} | ||
599 | ]} | ||
600 | ); | ||
601 | |||
602 | //MochiKit.Style.hideElement('modalDialogWrapper'); | ||
603 | MochiKit.Style.hideElement('modalDialogMask'); | ||
604 | MochiKit.Style.hideElement('modalDialogFrame'); | ||
605 | //MochiKit.Style.hideElement('modalDialog'); | ||
606 | |||
607 | }; | ||
608 | |||
609 | //Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition = {'x':'X', 'y':'Y'}; | ||
610 | |||
611 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Common.Components.BaseComponent_modalDialog); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js new file mode 100644 index 0000000..b2761ea --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js | |||
@@ -0,0 +1,108 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.Button = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Common.Components.Button.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._element = args.element || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | this._isDefault = args.isDefault|| false; | ||
39 | |||
40 | this.render(); | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | //============================================================================= | ||
46 | |||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'toString': function () { | ||
52 | return "Clipperz.PM.UI.Common.Components.Button component"; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'text': function () { | ||
58 | return this._text; | ||
59 | }, | ||
60 | |||
61 | 'isDefault': function () { | ||
62 | return this._isDefault; | ||
63 | }, | ||
64 | |||
65 | //------------------------------------------------------------------------- | ||
66 | |||
67 | 'renderSelf': function () { | ||
68 | this.append(this.element(), {tag:'div', id:this.getId('wrapper'), cls:'button_wrapper', children:[ | ||
69 | {tag:'div', id:this.getId('bodyWrapper'), cls:'button_bodyWrapper', children:[ | ||
70 | {tag:'div', id:this.getId('body'), cls:'button_body', children:[ | ||
71 | {tag:'span', html:this.text()} | ||
72 | ]}, | ||
73 | {tag:'div', id:this.getId('footer'), cls:'button_footer'} | ||
74 | ]} | ||
75 | ]}); | ||
76 | |||
77 | if (this.isDefault()) { | ||
78 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'default'); | ||
79 | } | ||
80 | |||
81 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseenter',this, 'handleOnMouseEnter'); | ||
82 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmouseleave',this, 'handleOnMouseLeave'); | ||
83 | MochiKit.Signal.connect(this.getId('wrapper'), 'onmousedown',this, 'handleOnMouseDown'); | ||
84 | MochiKit.Signal.connect(this.getId('wrapper'), 'onclick', this, 'handleOnClick'); | ||
85 | }, | ||
86 | |||
87 | //------------------------------------------------------------------------- | ||
88 | |||
89 | 'handleOnMouseEnter': function (anEvent) { | ||
90 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'hover'); | ||
91 | }, | ||
92 | |||
93 | 'handleOnMouseLeave': function (anEvent) { | ||
94 | MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'hover'); | ||
95 | MochiKit.DOM.removeElementClass(this.getId('wrapper'), 'clicked'); | ||
96 | }, | ||
97 | |||
98 | 'handleOnMouseDown': function (anEvent) { | ||
99 | MochiKit.DOM.addElementClass(this.getId('wrapper'), 'clicked'); | ||
100 | }, | ||
101 | |||
102 | 'handleOnClick': function (anEvent) { | ||
103 | MochiKit.Signal.signal(this, 'onclick', anEvent); | ||
104 | }, | ||
105 | |||
106 | //------------------------------------------------------------------------- | ||
107 | __syntaxFix__: "syntax fix" | ||
108 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js new file mode 100644 index 0000000..0c6e221 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | |||
34 | Clipperz.PM.UI.Common.Components.ComponentSlot = function(aComponent, aSlotName) { | ||
35 | this._component = aComponent; | ||
36 | this._slotName = aSlotName; | ||
37 | |||
38 | return this; | ||
39 | } | ||
40 | |||
41 | //============================================================================= | ||
42 | |||
43 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ComponentSlot, Object, { | ||
44 | |||
45 | //------------------------------------------------------------------------- | ||
46 | |||
47 | 'slotName': function() { | ||
48 | return this._slotName; | ||
49 | }, | ||
50 | |||
51 | 'component': function() { | ||
52 | return this._component; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'setContent': function(aComponent) { | ||
58 | this.component().setComponentForSlotNamed(aComponent, this.slotName()); | ||
59 | }, | ||
60 | |||
61 | //------------------------------------------------------------------------- | ||
62 | __syntaxFix__: "syntax fix" | ||
63 | |||
64 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js new file mode 100644 index 0000000..4735f5c --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.FaviconComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Common.Components.FaviconComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this.render(); | ||
37 | this.setSrc(args.src); | ||
38 | |||
39 | return this; | ||
40 | } | ||
41 | |||
42 | //============================================================================= | ||
43 | |||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
45 | |||
46 | //------------------------------------------------------------------------- | ||
47 | |||
48 | 'toString': function () { | ||
49 | return "Clipperz.PM.UI.Common.Components.FaviconComponent component"; | ||
50 | }, | ||
51 | |||
52 | //------------------------------------------------------------------------- | ||
53 | |||
54 | 'src': function () { | ||
55 | return this.element().src; | ||
56 | }, | ||
57 | |||
58 | 'setSrc': function (aValue) { | ||
59 | this.element().src = (aValue || Clipperz.PM.Strings.getValue('defaultFaviconUrl')); | ||
60 | }, | ||
61 | |||
62 | //------------------------------------------------------------------------- | ||
63 | |||
64 | 'clear': function () {}, | ||
65 | |||
66 | //------------------------------------------------------------------------- | ||
67 | |||
68 | 'renderSelf': function () { | ||
69 | MochiKit.Signal.connect(this.element(), 'onerror',this, 'setDefaultFavicon'); | ||
70 | MochiKit.Signal.connect(this.element(), 'onabort',this, 'setDefaultFavicon'); | ||
71 | MochiKit.Signal.connect(this.element(), 'onload',this, 'handleOnLoad'); | ||
72 | }, | ||
73 | |||
74 | //------------------------------------------------------------------------- | ||
75 | |||
76 | 'setDefaultFavicon': function (anEvent) { | ||
77 | MochiKit.Signal.disconnectAll(anEvent.src()); | ||
78 | this.setSrc(null); | ||
79 | }, | ||
80 | |||
81 | 'handleOnLoad': function (anEvent) { | ||
82 | MochiKit.Signal.disconnectAll(anEvent.src()); | ||
83 | //console.log("HANDLE ON LOAD", anEvent, anEvent.src().src); | ||
84 | if (anEvent.src().complete == false) { | ||
85 | this.setSrc(null); | ||
86 | } | ||
87 | }, | ||
88 | |||
89 | //------------------------------------------------------------------------- | ||
90 | __syntaxFix__: "syntax fix" | ||
91 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js new file mode 100644 index 0000000..275bbed --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | // this._openFromElement = args.openFromElement || null; | ||
37 | this._onOkCloseToElement = args.onOkCloseToElement || null; | ||
38 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; | ||
39 | |||
40 | this._canCancelWhileProcessing= ((typeof(args.canCancelWhileProcessing) == 'undefined') ? true : args.canCancelWhileProcessing); | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | //============================================================================= | ||
46 | |||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'toString': function () { | ||
52 | return "Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar component"; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | /* | ||
57 | 'openFromElement': function () { | ||
58 | return this._openFromElement; | ||
59 | }, | ||
60 | */ | ||
61 | //------------------------------------------------------------------------- | ||
62 | |||
63 | 'onOkCloseToElement': function () { | ||
64 | return this._onOkCloseToElement; | ||
65 | }, | ||
66 | |||
67 | 'setOnOkCloseToElement': function (anElement) { | ||
68 | this._onOkCloseToElement = anElement; | ||
69 | }, | ||
70 | |||
71 | //------------------------------------------------------------------------- | ||
72 | |||
73 | 'onCancelCloseToElement': function () { | ||
74 | return this._onCancelCloseToElement; | ||
75 | }, | ||
76 | |||
77 | 'setOnCancelCloseToElement': function (anElement) { | ||
78 | this._onCancelCloseToElement = anElement; | ||
79 | }, | ||
80 | |||
81 | //------------------------------------------------------------------------- | ||
82 | |||
83 | 'canCancelWhileProcessing': function () { | ||
84 | return this._canCancelWhileProcessing; | ||
85 | }, | ||
86 | |||
87 | //------------------------------------------------------------------------- | ||
88 | |||
89 | 'deferredShowModal': function (someArgs, aResult) { | ||
90 | if (someArgs['onOkCloseToElement'] != null) { | ||
91 | this.setOnOkCloseToElement(someArgs['onOkCloseToElement']); | ||
92 | } | ||
93 | |||
94 | if (someArgs['onCancelCloseToElement'] != null) { | ||
95 | this.setOnCancelCloseToElement(someArgs['onCancelCloseToElement']); | ||
96 | } | ||
97 | |||
98 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.deferredShowModal.apply(this, arguments); | ||
99 | return this.deferred(); | ||
100 | }, | ||
101 | |||
102 | //------------------------------------------------------------------------- | ||
103 | |||
104 | 'showProgressBar': function () { | ||
105 | varprogressBarElement; | ||
106 | |||
107 | this.getElement('container').innerHTML = ''; | ||
108 | |||
109 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); | ||
110 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); | ||
111 | |||
112 | if (this.canCancelWhileProcessing() == true) { | ||
113 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); | ||
114 | } else { | ||
115 | this.setButtons([]); | ||
116 | } | ||
117 | }, | ||
118 | |||
119 | //------------------------------------------------------------------------- | ||
120 | |||
121 | 'showFailure': function (someParameters) { | ||
122 | // this.setType('ALERT'); | ||
123 | this.setType(someParameters['type']); | ||
124 | // this.setTitle("Login failed"); | ||
125 | this.setTitle(someParameters['title']); | ||
126 | // this.setText("Wrong passphrase; the unlock has failed."); | ||
127 | this.setText(someParameters['text']); | ||
128 | // this.getElement('container').innerHTML = ''; | ||
129 | this.getElement('container').innerHTML = ''; | ||
130 | // this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); | ||
131 | this.setButtons(someParameters['buttons']); | ||
132 | }, | ||
133 | |||
134 | //------------------------------------------------------------------------- | ||
135 | |||
136 | 'closeOk': function () { | ||
137 | //console.log("=== closeOk"); | ||
138 | this.showProgressBar(); | ||
139 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback')); | ||
140 | this._deferred = null; | ||
141 | }, | ||
142 | |||
143 | 'closeCancel': function () { | ||
144 | //console.log("=== closeCancel"); | ||
145 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); | ||
146 | this.deferred().cancel(); | ||
147 | this._deferred = null; | ||
148 | }, | ||
149 | |||
150 | //------------------------------------------------------------------------- | ||
151 | |||
152 | 'deferredDone': function () { | ||
153 | //console.log("=== deferredDone"); | ||
154 | return this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); | ||
155 | }, | ||
156 | |||
157 | 'deferredError': function (someParameters) { | ||
158 | //console.log("=== deferredError"); | ||
159 | this.showFailure(someParameters); | ||
160 | }, | ||
161 | |||
162 | //------------------------------------------------------------------------- | ||
163 | __syntaxFix__: "syntax fix" | ||
164 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js new file mode 100644 index 0000000..c1b4f13 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | //MochiKit.Logging.logDebug(">>> new TextFormField"); | ||
35 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args); | ||
36 | |||
37 | this._wrapperElement = null; | ||
38 | this._entropyElement = null; | ||
39 | |||
40 | this.render(); | ||
41 | //MochiKit.Logging.logDebug("<<< new TextFormField"); | ||
42 | |||
43 | return this; | ||
44 | }; | ||
45 | |||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
47 | |||
48 | 'toString': function() { | ||
49 | return "Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay"; | ||
50 | }, | ||
51 | |||
52 | //----------------------------------------------------- | ||
53 | |||
54 | 'wrapperElement': function() { | ||
55 | return this._wrapperElement; | ||
56 | }, | ||
57 | |||
58 | 'setWrapperElement': function(aValue) { | ||
59 | this._wrapperElement = aValue; | ||
60 | }, | ||
61 | |||
62 | //----------------------------------------------------- | ||
63 | |||
64 | 'passwordElement': function() { | ||
65 | return this.element(); | ||
66 | }, | ||
67 | |||
68 | //----------------------------------------------------- | ||
69 | |||
70 | 'entropyElement': function() { | ||
71 | return this._entropyElement; | ||
72 | }, | ||
73 | |||
74 | 'setEntropyElement': function(aValue) { | ||
75 | this._entropyElement = aValue; | ||
76 | }, | ||
77 | |||
78 | //----------------------------------------------------- | ||
79 | |||
80 | 'render': function() { | ||
81 | /* | ||
82 | MochiKit.Signal.disconnectAllTo(this); | ||
83 | |||
84 | this.setWrapperElement(this.element().wrap({tag:'div'})); | ||
85 | this.setEntropyElement(Clipperz.DOM.Helper.append(this.wrapperElement().dom, {tag:'div', cls:'passwordEntropy', html:" "}, true)); | ||
86 | // this.setEntropyElement(Clipperz.DOM.Helper.insertBefore(this.element(), {tag:'div', cls:'passwordEntropy', html:" "}, true)); | ||
87 | this.entropyElement().wrap({tag:'div', cls:'passwordEntropyWrapper'}); | ||
88 | |||
89 | this.updateEntropyElement(); | ||
90 | |||
91 | this.connect('onkeyup', 'updateEntropyElement'); | ||
92 | this.connect('onchange', 'updateEntropyElement'); | ||
93 | this.connect('onblur', 'updateEntropyElement'); | ||
94 | */ | ||
95 | MochiKit.Signal.disconnectAllTo(this); | ||
96 | |||
97 | this.setEntropyElement(this.element()); | ||
98 | this.entropyElement().addClass("entropyLevelIndicator"); | ||
99 | |||
100 | this.updateEntropyElement(); | ||
101 | |||
102 | this.connect('onkeyup', 'updateEntropyElement'); | ||
103 | this.connect('onchange', 'updateEntropyElement'); | ||
104 | this.connect('onblur', 'updateEntropyElement'); | ||
105 | }, | ||
106 | |||
107 | //----------------------------------------------------- | ||
108 | |||
109 | 'computeEntropyForString': function(aValue) { | ||
110 | return Clipperz.PM.Crypto.passwordEntropy(aValue); | ||
111 | }, | ||
112 | |||
113 | //----------------------------------------------------- | ||
114 | |||
115 | 'updateEntropyElement': function(anEvent) { | ||
116 | /* | ||
117 | //MochiKit.Logging.logDebug(">>> PasswordEntropyDisplay.updateEntropyElement"); | ||
118 | varmaxExtent; | ||
119 | varentropy; | ||
120 | |||
121 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); | ||
122 | //MochiKit.Logging.logDebug("--- PasswordEntropyDisplay.updateEntropyElement - entropy: " + entropy); | ||
123 | this.entropyElement().setStyle('background-position', "0px " + -entropy + "px"); | ||
124 | this.entropyElement().setWidth(this.passwordElement().getWidth() * (entropy/128)); | ||
125 | //MochiKit.Logging.logDebug("<<< PasswordEntropyDisplay.updateEntropyElement"); | ||
126 | */ | ||
127 | varentropy; | ||
128 | |||
129 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); | ||
130 | |||
131 | if (entropy == 0) { | ||
132 | this.entropyElement().setStyle('background-position', "0px 26px"); | ||
133 | } else { | ||
134 | this.entropyElement().setStyle('background-position', "0px -" + (128-entropy)*26 + "px"); | ||
135 | } | ||
136 | }, | ||
137 | |||
138 | //----------------------------------------------------- | ||
139 | __syntaxFix__: '__syntaxFix__' | ||
140 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js new file mode 100644 index 0000000..7e7f8fe --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.ProgressBar = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Common.Components.ProgressBar.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | |||
38 | this.renderSelf(); | ||
39 | |||
40 | MochiKit.Signal.connect(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', this, 'updateProgressHandler') | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | //============================================================================= | ||
46 | |||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ProgressBar, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'toString': function () { | ||
52 | return "Clipperz.PM.UI.Common.Components.ProgressBar component"; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'renderSelf': function() { | ||
58 | this.append(this.element(), {tag:'div', cls:'loadingBar', children:[ | ||
59 | {tag:'div', cls:'loadingBarProgressBox', children:[ | ||
60 | {tag:'div', id:this.getId('loadingBarProgress'), cls:'loadingBarProgress'} | ||
61 | ]} | ||
62 | ]}); | ||
63 | }, | ||
64 | |||
65 | //------------------------------------------------------------------------- | ||
66 | |||
67 | 'updateProgressHandler': function (anEvent) { | ||
68 | MochiKit.Style.setElementDimensions(this.getId('loadingBarProgress'), {w:anEvent}, '%'); | ||
69 | }, | ||
70 | |||
71 | //------------------------------------------------------------------------- | ||
72 | __syntaxFix__: "syntax fix" | ||
73 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js new file mode 100644 index 0000000..b9bb850 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js | |||
@@ -0,0 +1,282 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._title = args.title || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | this._type = args.type || Clipperz.Base.exception.raise('MandatoryParameter'); //ALERT, INFO, ERROR | ||
39 | this._buttons = args.buttons || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
40 | |||
41 | this._buttonComponents = []; | ||
42 | this._deferred = null; | ||
43 | |||
44 | this.renderModalMask(); | ||
45 | |||
46 | return this; | ||
47 | } | ||
48 | |||
49 | //============================================================================= | ||
50 | |||
51 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
52 | |||
53 | //------------------------------------------------------------------------- | ||
54 | |||
55 | 'toString': function () { | ||
56 | return "Clipperz.PM.UI.Common.Components.SimpleMessagePanel component"; | ||
57 | }, | ||
58 | |||
59 | //------------------------------------------------------------------------- | ||
60 | |||
61 | 'deferred': function() { | ||
62 | if (this._deferred == null) { | ||
63 | this._deferred = new Clipperz.Async.Deferred("SimpleMessagePanel.deferred", {trace:false}); | ||
64 | } | ||
65 | |||
66 | return this._deferred; | ||
67 | }, | ||
68 | |||
69 | //------------------------------------------------------------------------- | ||
70 | |||
71 | 'title': function () { | ||
72 | return this._title; | ||
73 | }, | ||
74 | |||
75 | 'setTitle': function (aValue) { | ||
76 | this._title = aValue; | ||
77 | |||
78 | if (this.getElement('title') != null) { | ||
79 | this.getElement('title').innerHTML = aValue; | ||
80 | } | ||
81 | }, | ||
82 | |||
83 | //------------------------------------------------------------------------- | ||
84 | |||
85 | 'text': function () { | ||
86 | return this._text; | ||
87 | }, | ||
88 | |||
89 | 'setText': function (aValue) { | ||
90 | this._text = aValue; | ||
91 | |||
92 | if (this.getElement('text') != null) { | ||
93 | this.getElement('text').innerHTML = aValue; | ||
94 | } | ||
95 | }, | ||
96 | |||
97 | //------------------------------------------------------------------------- | ||
98 | |||
99 | 'type': function () { | ||
100 | return this._type; | ||
101 | }, | ||
102 | |||
103 | 'setType': function (aValue) { | ||
104 | if (this.getElement('icon') != null) { | ||
105 | MochiKit.DOM.removeElementClass(this.getId('icon'), this._type); | ||
106 | MochiKit.DOM.addElementClass(this.getId('icon'), aValue); | ||
107 | } | ||
108 | |||
109 | this._type = aValue; | ||
110 | }, | ||
111 | |||
112 | //------------------------------------------------------------------------- | ||
113 | |||
114 | 'buttons': function () { | ||
115 | return this._buttons; | ||
116 | }, | ||
117 | |||
118 | 'setButtons': function (someValues) { | ||
119 | MochiKit.Iter.forEach(this.buttonComponents(), MochiKit.Base.methodcaller('clear')); | ||
120 | |||
121 | this._buttons = someValues; | ||
122 | |||
123 | if (this.getElement('buttonArea') != null) { | ||
124 | this.renderButtons(); | ||
125 | } | ||
126 | }, | ||
127 | |||
128 | //......................................................................... | ||
129 | |||
130 | 'buttonComponents': function () { | ||
131 | return this._buttonComponents; | ||
132 | }, | ||
133 | |||
134 | //------------------------------------------------------------------------- | ||
135 | |||
136 | 'renderSelf': function() { | ||
137 | this.append(this.element(), {tag:'div', cls:'SimpleMessagePanel', id:this.getId('panel'), children: [ | ||
138 | {tag:'div', cls:'header', children:[]}, | ||
139 | {tag:'div', cls:'body', children:[ | ||
140 | {tag:'div', id:this.getId('icon'),cls:'img ' + this.type(), children:[{tag:'div'}]}, | ||
141 | {tag:'h3', id:this.getId('title'),html:this.title()}, | ||
142 | {tag:'p', id:this.getId('text'),html:this.text()}, | ||
143 | {tag:'div', id:this.getId('container')}, | ||
144 | {tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]} | ||
145 | ]}, | ||
146 | {tag:'div', cls:'footer', children:[]} | ||
147 | ]}); | ||
148 | |||
149 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler'); | ||
150 | |||
151 | this.renderButtons(); | ||
152 | }, | ||
153 | |||
154 | //------------------------------------------------------------------------- | ||
155 | |||
156 | 'renderButtons': function () { | ||
157 | this.getElement('buttonArea').innerHTML = ''; | ||
158 | |||
159 | MochiKit.Base.map(MochiKit.Base.bind(function (aButton) { | ||
160 | var buttonElement; | ||
161 | var buttonComponent; | ||
162 | |||
163 | // element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[ | ||
164 | // {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']} | ||
165 | // ]}); | ||
166 | |||
167 | buttonElement = this.append(this.getElement('buttonArea'), {tag:'div'}); | ||
168 | buttonComponent = new Clipperz.PM.UI.Common.Components.Button({'element':buttonElement, 'text':aButton['text'], 'isDefault':aButton['isDefault']}); | ||
169 | this.buttonComponents().push(buttonComponent); | ||
170 | |||
171 | MochiKit.Signal.connect(buttonComponent, 'onclick', MochiKit.Base.method(this, 'buttonEventHandler', aButton)); | ||
172 | }, this), MochiKit.Iter.reversed(this.buttons())); | ||
173 | }, | ||
174 | |||
175 | //------------------------------------------------------------------------- | ||
176 | |||
177 | 'displayElement': function() { | ||
178 | return this.getElement('panel'); | ||
179 | }, | ||
180 | |||
181 | //------------------------------------------------------------------------- | ||
182 | |||
183 | 'closeOk': function () { | ||
184 | this.deferred().callback(); | ||
185 | this._deferred = null; | ||
186 | }, | ||
187 | |||
188 | 'closeCancel': function () { | ||
189 | this.deferred().cancel(); | ||
190 | this._deferred = null; | ||
191 | }, | ||
192 | |||
193 | 'closeError': function () { | ||
194 | this.deferred().errback(); | ||
195 | this._deferred = null; | ||
196 | }, | ||
197 | |||
198 | //------------------------------------------------------------------------- | ||
199 | |||
200 | 'buttonEventHandler': function(aButton, anEvent) { | ||
201 | anEvent.preventDefault(); | ||
202 | |||
203 | // MochiKit.Signal.signal(this, 'cancelEvent'); | ||
204 | switch (aButton['result']) { | ||
205 | case 'OK': | ||
206 | //console.log("==> OK"); | ||
207 | this.closeOk(); | ||
208 | break; | ||
209 | case 'CANCEL': | ||
210 | //console.log("==> CANCEL"); | ||
211 | this.closeCancel(); | ||
212 | break; | ||
213 | default: | ||
214 | //console.log("==> ????"); | ||
215 | this.closeError(); | ||
216 | break; | ||
217 | } | ||
218 | //console.log("<=="); | ||
219 | }, | ||
220 | |||
221 | //------------------------------------------------------------------------- | ||
222 | |||
223 | 'deferredShow': function (someArgs, aResult) { | ||
224 | this.deferredShowModal(someArgs); | ||
225 | |||
226 | this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); | ||
227 | this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); | ||
228 | this.deferred().addCallback(MochiKit.Async.succeed, aResult); | ||
229 | |||
230 | return this.deferred(); | ||
231 | }, | ||
232 | |||
233 | //------------------------------------------------------------------------- | ||
234 | |||
235 | 'modalDialogMask': function () { | ||
236 | return this.getId('modalDialogMask'); | ||
237 | }, | ||
238 | |||
239 | 'modalDialog': function () { | ||
240 | return this.getId('modalDialog'); | ||
241 | }, | ||
242 | |||
243 | 'modalDialogFrame': function() { | ||
244 | return this.getId('modalDialogFrame'); | ||
245 | }, | ||
246 | |||
247 | //------------------------------------------------------------------------- | ||
248 | |||
249 | 'renderModalMask': function () { | ||
250 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, | ||
251 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper simpleMessagePanelMask', children:[ | ||
252 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask simpleMessagePanelMask'}, | ||
253 | {tag:'div', id:this.getId('modalDialogFrame'), cls:'modalDialogFrame simpleMessagePanelMask'}, | ||
254 | {tag:'div', id:this.getId('modalDialog'), cls:'modalDialog simpleMessagePanelMask'} | ||
255 | ]} | ||
256 | ); | ||
257 | |||
258 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); | ||
259 | MochiKit.Style.hideElement(this.getId('modalDialogFrame')); | ||
260 | }, | ||
261 | |||
262 | //------------------------------------------------------------------------- | ||
263 | |||
264 | 'keyDownHandler': function (anEvent) { | ||
265 | if (anEvent.key().string == 'KEY_ENTER') { | ||
266 | anEvent.preventDefault(); | ||
267 | //console.log("13 - RETURN ?", this); | ||
268 | this.closeOk(); | ||
269 | //console.log('<<< 13') | ||
270 | } | ||
271 | |||
272 | if (anEvent.key().string == 'KEY_ESCAPE') { | ||
273 | anEvent.preventDefault(); | ||
274 | //console.log("27 - ESC ?", this); | ||
275 | this.closeCancel(); | ||
276 | //console.log("<<< 27"); | ||
277 | } | ||
278 | }, | ||
279 | |||
280 | //------------------------------------------------------------------------- | ||
281 | __syntaxFix__: "syntax fix" | ||
282 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js new file mode 100644 index 0000000..afb3bf9 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.TabPanelComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | Clipperz.PM.UI.Common.Components.TabPanelComponent.superclass.constructor.call(this, args); | ||
34 | |||
35 | this._tabPanelController = null; | ||
36 | |||
37 | return this; | ||
38 | } | ||
39 | |||
40 | //============================================================================= | ||
41 | |||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TabPanelComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
43 | |||
44 | 'toString': function () { | ||
45 | return "Clipperz.PM.UI.Common.Components.TabPanelComponent component"; | ||
46 | }, | ||
47 | |||
48 | //------------------------------------------------------------------------- | ||
49 | |||
50 | 'tabPanelControllerConfiguration': function() { | ||
51 | return this._tabPanelControllerConfiguration; | ||
52 | }, | ||
53 | |||
54 | 'tabPanelController': function() { | ||
55 | if (this._tabPanelController == null) { | ||
56 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({component:this, configuration:this.tabPanelControllerConfiguration()}); | ||
57 | } | ||
58 | |||
59 | return this._tabPanelController; | ||
60 | }, | ||
61 | |||
62 | 'initiallySelectedTab': function() { | ||
63 | return this._initiallySelectedTab; | ||
64 | }, | ||
65 | |||
66 | //------------------------------------------------------------------------- | ||
67 | __syntaxFix__: "syntax fix" | ||
68 | |||
69 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js new file mode 100644 index 0000000..7507b86 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js | |||
@@ -0,0 +1,216 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.Tooltip = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Common.Components.Tooltip.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | this._position = args.position || 'BELOW'; //'BELOW', 'ABOVE', 'LEFT', 'RIGHT' | ||
39 | |||
40 | this._boxDimensions = null; | ||
41 | this._enabled = (typeof(args.enabled) == 'undefined' ? true : args.enabled); | ||
42 | this._isVisible = false; | ||
43 | |||
44 | this.renderSelf(); | ||
45 | |||
46 | return this; | ||
47 | } | ||
48 | |||
49 | //============================================================================= | ||
50 | |||
51 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
52 | |||
53 | //------------------------------------------------------------------------- | ||
54 | |||
55 | 'toString': function () { | ||
56 | return "Clipperz.PM.UI.Common.Components.Tooltip component"; | ||
57 | }, | ||
58 | |||
59 | //------------------------------------------------------------------------- | ||
60 | |||
61 | 'text': function () { | ||
62 | return this._text; | ||
63 | }, | ||
64 | |||
65 | 'setText': function (aValue) { | ||
66 | this._text = aValue; | ||
67 | }, | ||
68 | |||
69 | //------------------------------------------------------------------------- | ||
70 | |||
71 | 'position': function () { | ||
72 | return this._position; | ||
73 | }, | ||
74 | |||
75 | 'setPosition': function (aValue) { | ||
76 | this._position = aValue; | ||
77 | }, | ||
78 | |||
79 | //------------------------------------------------------------------------- | ||
80 | |||
81 | 'enabled': function () { | ||
82 | return this._enabled; | ||
83 | }, | ||
84 | |||
85 | 'setIsEnabled': function (aValue) { | ||
86 | this._enabled = aValue; | ||
87 | }, | ||
88 | |||
89 | //------------------------------------------------------------------------- | ||
90 | |||
91 | 'isVisible': function () { | ||
92 | return this._isVisible; | ||
93 | }, | ||
94 | |||
95 | 'setIsVisible': function (aValue) { | ||
96 | this._isVisible = aValue; | ||
97 | }, | ||
98 | |||
99 | //------------------------------------------------------------------------- | ||
100 | |||
101 | 'renderSelf': function() { | ||
102 | // this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | ||
103 | // this.append(MochiKit.DOM.currentDocument().body, {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | ||
104 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | ||
105 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ | ||
106 | {tag:'div', cls:'tooltip_text', children:[ | ||
107 | {tag:'span', html:this.text()} | ||
108 | ]}, | ||
109 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} | ||
110 | ]}, | ||
111 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} | ||
112 | ]}); | ||
113 | |||
114 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | ||
115 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | ||
116 | |||
117 | MochiKit.Style.hideElement(this.displayElement()); | ||
118 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | ||
119 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | ||
120 | }, | ||
121 | |||
122 | //----------------------------------------------------- | ||
123 | |||
124 | 'displayElement': function() { | ||
125 | return this.getElement('tooltip'); | ||
126 | }, | ||
127 | |||
128 | //------------------------------------------------------------------------- | ||
129 | |||
130 | 'boxDimensions': function () { | ||
131 | return this._boxDimensions; | ||
132 | }, | ||
133 | |||
134 | //------------------------------------------------------------------------- | ||
135 | |||
136 | 'show': function () { | ||
137 | var elementSizeAndPosition; | ||
138 | var arrowPosition; | ||
139 | var bodyPosition; | ||
140 | |||
141 | if (this.isVisible() == false) { | ||
142 | arrowPosition = {}; | ||
143 | bodyPosition = {}; | ||
144 | |||
145 | this.setIsVisible(true); | ||
146 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); | ||
147 | //console.log("ELEMENT SIZE AND POSITION", Clipperz.Base.serializeJSON(elementSizeAndPosition)); | ||
148 | //console.log("BOX DIMENSIONS", Clipperz.Base.serializeJSON(this.boxDimensions())); | ||
149 | switch (this.position()) { | ||
150 | case 'ABOVE': | ||
151 | //console.log("ABOVE"); | ||
152 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | ||
153 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | ||
154 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; | ||
155 | |||
156 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | ||
157 | arrowPosition.y = elementSizeAndPosition.position.y - 13; | ||
158 | break; | ||
159 | case 'BELOW': | ||
160 | //console.log("BELOW"); | ||
161 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | ||
162 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | ||
163 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; | ||
164 | |||
165 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | ||
166 | arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; | ||
167 | break; | ||
168 | case 'LEFT': | ||
169 | //console.log("LEFT"); | ||
170 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | ||
171 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; | ||
172 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | ||
173 | |||
174 | arrowPosition.x = elementSizeAndPosition.position.x -13; | ||
175 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | ||
176 | break; | ||
177 | case 'RIGHT': | ||
178 | //console.log("RIGHT"); | ||
179 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | ||
180 | bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13; | ||
181 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | ||
182 | |||
183 | arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; | ||
184 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | ||
185 | break; | ||
186 | } | ||
187 | //console.log("X: " + bodyPosition.x + ", Y: " + bodyPosition.y); | ||
188 | |||
189 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | ||
190 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); | ||
191 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); | ||
192 | } | ||
193 | }, | ||
194 | |||
195 | 'hide': function () { | ||
196 | if (this.isVisible() == true) { | ||
197 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); | ||
198 | this.setIsVisible(false); | ||
199 | } | ||
200 | }, | ||
201 | |||
202 | //------------------------------------------------------------------------- | ||
203 | /* | ||
204 | 'shouldRemoveElementWhenClearningUp': function () { | ||
205 | return false; | ||
206 | }, | ||
207 | */ | ||
208 | //------------------------------------------------------------------------- | ||
209 | __syntaxFix__: "syntax fix" | ||
210 | }); | ||
211 | |||
212 | Clipperz.PM.UI.Common.Components.Tooltip.initTooltips = function () { | ||
213 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'}); | ||
214 | } | ||
215 | |||
216 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Common.Components.Tooltip.initTooltips); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js new file mode 100644 index 0000000..c31969e --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js | |||
@@ -0,0 +1,170 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Components.TranslatorWidget = function(args) { | ||
32 | Clipperz.log(">>> TranslatorWidget.new"); | ||
33 | args = args || {}; | ||
34 | |||
35 | Clipperz.PM.UI.Common.Components.TranslatorWidget.superclass.constructor.apply(this, arguments); | ||
36 | |||
37 | // this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | // this._stringID = args.stringID || MochiKit.DOM.getNodeAttribute(this.element(), 'stringID')|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
39 | |||
40 | //MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | ||
41 | //MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | ||
42 | |||
43 | Clipperz.log("<<< TranslatorWidget.new"); | ||
44 | return this; | ||
45 | } | ||
46 | |||
47 | //============================================================================= | ||
48 | |||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TranslatorWidget, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
50 | |||
51 | //------------------------------------------------------------------------- | ||
52 | |||
53 | 'toString': function () { | ||
54 | return "Clipperz.PM.UI.Common.Components.TranslatorWidget component"; | ||
55 | }, | ||
56 | |||
57 | //------------------------------------------------------------------------- | ||
58 | /* | ||
59 | 'renderSelf': function() { | ||
60 | this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | ||
61 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ | ||
62 | {tag:'div', cls:'tooltip_text', children:[ | ||
63 | {tag:'span', html:this.text()} | ||
64 | ]}, | ||
65 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} | ||
66 | ]}, | ||
67 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} | ||
68 | ]}); | ||
69 | |||
70 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | ||
71 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | ||
72 | |||
73 | MochiKit.Style.hideElement(this.displayElement()); | ||
74 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | ||
75 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | ||
76 | }, | ||
77 | */ | ||
78 | //----------------------------------------------------- | ||
79 | /* | ||
80 | 'displayElement': function() { | ||
81 | return this.getElement('tooltip'); | ||
82 | }, | ||
83 | */ | ||
84 | //------------------------------------------------------------------------- | ||
85 | /* | ||
86 | 'boxDimensions': function () { | ||
87 | return this._boxDimensions; | ||
88 | }, | ||
89 | */ | ||
90 | //------------------------------------------------------------------------- | ||
91 | |||
92 | 'show': function (anElement, aStringID) { | ||
93 | Clipperz.log(">>> Clipperz.PM.UI.Common.Components.TranslatorWidget.show: " + aStringID); | ||
94 | /* | ||
95 | var elementSizeAndPosition; | ||
96 | var arrowPosition; | ||
97 | var bodyPosition; | ||
98 | |||
99 | arrowPosition = {}; | ||
100 | bodyPosition = {}; | ||
101 | |||
102 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); | ||
103 | switch (this.position()) { | ||
104 | case 'ABOVE': | ||
105 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | ||
106 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | ||
107 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; | ||
108 | |||
109 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | ||
110 | arrowPosition.y = elementSizeAndPosition.position.y - 13; | ||
111 | break; | ||
112 | case 'BELOW': | ||
113 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | ||
114 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | ||
115 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; | ||
116 | |||
117 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | ||
118 | arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; | ||
119 | break; | ||
120 | case 'LEFT': | ||
121 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | ||
122 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; | ||
123 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | ||
124 | |||
125 | arrowPosition.x = elementSizeAndPosition.position.x -13; | ||
126 | arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | ||
127 | break; | ||
128 | case 'RIGHT': | ||
129 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | ||
130 | break; | ||
131 | } | ||
132 | |||
133 | // MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | ||
134 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | ||
135 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); | ||
136 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); | ||
137 | */ | ||
138 | }, | ||
139 | |||
140 | //------------------------------------------------------------------------- | ||
141 | |||
142 | 'hide': function () { | ||
143 | Clipperz.log("<<< Clipperz.PM.UI.Common.Components.TranslatorWidget.hide"); | ||
144 | // MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); | ||
145 | }, | ||
146 | |||
147 | //------------------------------------------------------------------------- | ||
148 | __syntaxFix__: "syntax fix" | ||
149 | }); | ||
150 | |||
151 | //############################################################################# | ||
152 | |||
153 | Clipperz.PM.UI.Common.Components.TranslatorWidget._widget = null; | ||
154 | |||
155 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget = function () { | ||
156 | if (Clipperz.PM.UI.Common.Components.TranslatorWidget._widget == null) { | ||
157 | Clipperz.PM.UI.Common.Components.TranslatorWidget._widget = new Clipperz.PM.UI.Common.Components.TranslatorWidget(); | ||
158 | } | ||
159 | |||
160 | return Clipperz.PM.UI.Common.Components.TranslatorWidget._widget; | ||
161 | } | ||
162 | Clipperz.PM.UI.Common.Components.TranslatorWidget.show = function (anElement, aStringID) { | ||
163 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget().show(anElement, aStringID); | ||
164 | } | ||
165 | |||
166 | Clipperz.PM.UI.Common.Components.TranslatorWidget.hide = function () { | ||
167 | Clipperz.PM.UI.Common.Components.TranslatorWidget.widget().hide(); | ||
168 | } | ||
169 | |||
170 | //############################################################################# | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js new file mode 100644 index 0000000..e534435 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js | |||
@@ -0,0 +1,267 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner = function(args) { | ||
32 | this._directLogin = args['directLogin'] || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
33 | this._target = Clipperz.PM.Crypto.randomKey(); | ||
34 | |||
35 | return this; | ||
36 | } | ||
37 | |||
38 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototype, { | ||
39 | |||
40 | 'toString': function() { | ||
41 | return "Clipperz.PM.UI.Common.Controllers.DirectLoginRunner"; | ||
42 | }, | ||
43 | |||
44 | //----------------------------------------------------------------------------- | ||
45 | |||
46 | 'directLogin': function () { | ||
47 | return this._directLogin; | ||
48 | }, | ||
49 | |||
50 | //----------------------------------------------------------------------------- | ||
51 | |||
52 | 'target': function () { | ||
53 | return this._target; | ||
54 | }, | ||
55 | |||
56 | //============================================================================= | ||
57 | |||
58 | 'setWindowTitle': function (aWindow, aTitle) { | ||
59 | aWindow.document.title = aTitle; | ||
60 | }, | ||
61 | |||
62 | 'setWindowBody': function (aWindow, anHTML) { | ||
63 | aWindow.document.body.innerHTML = anHTML; | ||
64 | }, | ||
65 | |||
66 | //============================================================================= | ||
67 | |||
68 | 'initialWindowSetup': function (aWindow) { | ||
69 | this.setWindowTitle(aWindow, "Loading Clipperz Direct Login"); | ||
70 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3("Loading Clipperz Direct Login ..."))); | ||
71 | }, | ||
72 | |||
73 | //----------------------------------------------------------------------------- | ||
74 | |||
75 | 'updateWindowWithDirectLoginLabel': function (aWindow, aLabel) { | ||
76 | var titleText; | ||
77 | var bodyText; | ||
78 | |||
79 | titleText = "Loading '__label__' Direct Login".replace(/__label__/, aLabel) | ||
80 | bodyText = "Loading '__label__' Direct Login... ".replace(/__label__/, aLabel) | ||
81 | |||
82 | this.setWindowTitle(aWindow, titleText); | ||
83 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3(bodyText))); | ||
84 | }, | ||
85 | |||
86 | //----------------------------------------------------------------------------- | ||
87 | |||
88 | 'updateWindowWithHTMLContent': function (aWindow, anHtml) { | ||
89 | this.setWindowBody(aWindow, anHtml); | ||
90 | }, | ||
91 | |||
92 | //============================================================================= | ||
93 | |||
94 | 'submitLoginForm': function(aWindow, aSubmitFunction) { | ||
95 | MochiKit.DOM.withWindow(aWindow, MochiKit.Base.bind(function () { | ||
96 | var formElement; | ||
97 | var submitButtons; | ||
98 | |||
99 | formElement = MochiKit.DOM.getElement('directLoginForm'); | ||
100 | |||
101 | submitButtons = MochiKit.Base.filter(function(anInputElement) { | ||
102 | return ((anInputElement.tagName.toLowerCase() == 'input') && (anInputElement.getAttribute('type').toLowerCase() == 'submit')); | ||
103 | }, formElement.elements); | ||
104 | |||
105 | if (submitButtons.length == 0) { | ||
106 | if (typeof(formElement.submit) == 'function') { | ||
107 | formElement.submit(); | ||
108 | } else { | ||
109 | aSubmitFunction.apply(formElement); | ||
110 | } | ||
111 | /* | ||
112 | varformSubmitFunction; | ||
113 | |||
114 | formSubmitFunction = MochiKit.Base.method(formElement, 'submit'); | ||
115 | if (Clipperz_IEisBroken == true) { | ||
116 | formElement.submit(); | ||
117 | } else { | ||
118 | formSubmitFunction(); | ||
119 | } | ||
120 | */ | ||
121 | } else { | ||
122 | submitButtons[0].click(); | ||
123 | } | ||
124 | }, this)); | ||
125 | }, | ||
126 | |||
127 | //------------------------------------------------------------------------- | ||
128 | |||
129 | 'runSubmitFormDirectLogin': function (aWindow, someAttributes) { | ||
130 | var html; | ||
131 | var formElement; | ||
132 | var submitFunction; | ||
133 | |||
134 | formElement = MochiKit.DOM.FORM({ | ||
135 | 'id':'directLoginForm', | ||
136 | 'method':someAttributes['formAttributes']['method'], | ||
137 | 'action':someAttributes['formAttributes']['action'] | ||
138 | }); | ||
139 | |||
140 | submitFunction = formElement.submit; | ||
141 | |||
142 | MochiKit.DOM.appendChildNodes(formElement, MochiKit.Base.map(function (anInputAttributes) { | ||
143 | return MochiKit.DOM.INPUT({'type':'hidden', 'name':anInputAttributes[0], 'value':anInputAttributes[1]}); | ||
144 | }, MochiKit.Base.items(someAttributes['inputValues']))); | ||
145 | |||
146 | html =''; | ||
147 | html += '<h3>Loading ' + someAttributes['label'] + ' ...</h3>'; | ||
148 | html +=MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV(), MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV({style:'display:none; visibility:hidden;'}), formElement)).innerHTML; | ||
149 | |||
150 | this.updateWindowWithHTMLContent(aWindow, html); | ||
151 | this.submitLoginForm(aWindow, submitFunction); | ||
152 | }, | ||
153 | |||
154 | //------------------------------------------------------------------------- | ||
155 | |||
156 | 'runHttpAuthDirectLogin': function(aWindow, someAttributes) { | ||
157 | var completeUrl; | ||
158 | var url; | ||
159 | |||
160 | //console.log("runHttpAuthDirectLogin", someAttributes); | ||
161 | url = someAttributes['inputValues']['url']; | ||
162 | |||
163 | if (/^https?\:\/\//.test(url) == false) { | ||
164 | url = 'http://' + url; | ||
165 | } | ||
166 | |||
167 | if (Clipperz_IEisBroken === true) { | ||
168 | completeUrl = url; | ||
169 | } else { | ||
170 | var username; | ||
171 | var password; | ||
172 | |||
173 | username = someAttributes['inputValues']['username']; | ||
174 | password = someAttributes['inputValues']['password']; | ||
175 | /(^https?\:\/\/)?(.*)/.test(url); | ||
176 | |||
177 | completeUrl = RegExp.$1 + username + ':' + password + '@' + RegExp.$2; | ||
178 | } | ||
179 | |||
180 | window.open(completeUrl, this.target()); | ||
181 | }, | ||
182 | |||
183 | //============================================================================= | ||
184 | |||
185 | 'runDirectLogin': function (aWindow) { | ||
186 | var deferredResult; | ||
187 | |||
188 | //console.log(">>> runDirectLogin"); | ||
189 | deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false}); | ||
190 | deferredResult.addMethod(this, 'initialWindowSetup', aWindow); | ||
191 | deferredResult.addMethod(this.directLogin(), 'label'); | ||
192 | deferredResult.addMethod(this, 'updateWindowWithDirectLoginLabel', aWindow); | ||
193 | deferredResult.collectResults({ | ||
194 | 'type': MochiKit.Base.method(this.directLogin(), 'type'), | ||
195 | 'label': MochiKit.Base.method(this.directLogin(), 'label'), | ||
196 | 'formAttributes':MochiKit.Base.method(this.directLogin(), 'formAttributes'), | ||
197 | 'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues') | ||
198 | }); | ||
199 | //deferredResult.addCallback(function (aValue) { console.log("SOME ATTRIBUTES", aValue); return aValue; }); | ||
200 | deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) { | ||
201 | //console.log("SOME ATTRIBUTES", someAttributes); | ||
202 | switch (someAttributes['type']) { | ||
203 | case 'http_auth': | ||
204 | this.runHttpAuthDirectLogin(aWindow, someAttributes); | ||
205 | break; | ||
206 | case 'simple_url': | ||
207 | this.runSimpleUrlDirectLogin(aWindow, someAttributes); | ||
208 | break; | ||
209 | default: | ||
210 | this.runSubmitFormDirectLogin(aWindow, someAttributes); | ||
211 | break; | ||
212 | } | ||
213 | }, this)); | ||
214 | deferredResult.callback(); | ||
215 | //console.log("<<< runDirectLogin"); | ||
216 | |||
217 | return deferredResult; | ||
218 | }, | ||
219 | |||
220 | //============================================================================= | ||
221 | |||
222 | 'run': function () { | ||
223 | var newWindow; | ||
224 | |||
225 | newWindow = window.open(Clipperz.PM.Strings.getValue('directLoginJumpPageUrl'), this.target()); | ||
226 | |||
227 | return this.runDirectLogin(newWindow); | ||
228 | }, | ||
229 | |||
230 | //============================================================================= | ||
231 | |||
232 | 'test': function () { | ||
233 | var iFrame; | ||
234 | var newWindow; | ||
235 | |||
236 | iFrame = MochiKit.DOM.createDOM('iframe'); | ||
237 | MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, iFrame); | ||
238 | |||
239 | newWindow = iFrame.contentWindow; | ||
240 | |||
241 | return this.runDirectLogin(newWindow); | ||
242 | }, | ||
243 | |||
244 | //============================================================================= | ||
245 | __syntaxFix__: "syntax fix" | ||
246 | }); | ||
247 | |||
248 | //----------------------------------------------------------------------------- | ||
249 | |||
250 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin = function (aDirectLogin) { | ||
251 | varrunner; | ||
252 | |||
253 | runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); | ||
254 | return runner.run(); | ||
255 | }; | ||
256 | |||
257 | //----------------------------------------------------------------------------- | ||
258 | |||
259 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.testDirectLogin = function (aDirectLogin) { | ||
260 | varrunner; | ||
261 | |||
262 | //console.log(">>>>>> TESTING DIRECT LOGIN"); | ||
263 | runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); | ||
264 | return runner.test(); | ||
265 | }; | ||
266 | |||
267 | //----------------------------------------------------------------------------- | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js new file mode 100644 index 0000000..a4fa400 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js | |||
@@ -0,0 +1,143 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Controllers.ProgressBarController = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | this._numberOfSteps= 0; | ||
35 | this._currentStep= 0; | ||
36 | |||
37 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); | ||
38 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); | ||
39 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); | ||
40 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.ProgressBarController.prototype, { | ||
46 | |||
47 | 'toString': function() { | ||
48 | return "Clipperz.PM.UI.Common.Controllers.ProgressBarController"; | ||
49 | }, | ||
50 | |||
51 | //----------------------------------------------------------------------------- | ||
52 | |||
53 | 'numberOfSteps': function() { | ||
54 | return this._numberOfSteps; | ||
55 | }, | ||
56 | |||
57 | 'setNumberOfSteps': function (aValue) { | ||
58 | this._numberOfSteps = aValue; | ||
59 | }, | ||
60 | |||
61 | 'updateNumberOfSteps': function (aValue) { | ||
62 | this._numberOfSteps += aValue; | ||
63 | }, | ||
64 | |||
65 | //----------------------------------------------------------------------------- | ||
66 | |||
67 | 'currentStep': function() { | ||
68 | return this._currentStep; | ||
69 | }, | ||
70 | |||
71 | 'advanceCurrentStep': function () { | ||
72 | this._currentStep ++; | ||
73 | }, | ||
74 | |||
75 | //----------------------------------------------------------------------------- | ||
76 | |||
77 | 'completedPercentage': function () { | ||
78 | var result; | ||
79 | //Clipperz.log(">>> completedPercentage" + this.currentStep() + "/" + this.numberOfSteps(), this.currentStep() / this.numberOfSteps()); | ||
80 | if (this.numberOfSteps() == 0) { | ||
81 | result = 0; | ||
82 | } else { | ||
83 | result = (Math.min(100, 100 * (this.currentStep() / this.numberOfSteps()))); | ||
84 | } | ||
85 | //Clipperz.log("<<< completedPercentage", result); | ||
86 | return result; | ||
87 | }, | ||
88 | |||
89 | //----------------------------------------------------------------------------- | ||
90 | |||
91 | 'resetStatus': function () { | ||
92 | this._numberOfSteps= 0; | ||
93 | this._currentStep= 0; | ||
94 | }, | ||
95 | |||
96 | //----------------------------------------------------------------------------- | ||
97 | |||
98 | 'updateProgress': function () { | ||
99 | //Clipperz.log(">>> updateProgress: " + this.completedPercentage() + "%"); | ||
100 | MochiKit.Signal.signal(this, 'updateProgress', this.completedPercentage()); | ||
101 | }, | ||
102 | |||
103 | //============================================================================= | ||
104 | |||
105 | 'initProgressHandle': function (anEvent) { | ||
106 | //Clipperz.log(">>> initProgressHandle - steps: " + (anEvent != null ? anEvent['steps'] : 0)); | ||
107 | this.resetStatus(); | ||
108 | if (anEvent != null) { | ||
109 | this.setNumberOfSteps(anEvent['steps']); | ||
110 | } | ||
111 | MochiKit.Signal.signal(this, 'initProgress'); | ||
112 | this.updateProgress(); | ||
113 | }, | ||
114 | |||
115 | //............................................................................. | ||
116 | |||
117 | 'updateProgressHandle': function (anEvent) { | ||
118 | this.updateNumberOfSteps(anEvent['extraSteps']); | ||
119 | //Clipperz.log("=== updateProgressHandle - steps: " + this.numberOfSteps() + " (extra " + anEvent['extraSteps'] + ")"); | ||
120 | this.updateProgress(); | ||
121 | }, | ||
122 | |||
123 | //............................................................................. | ||
124 | |||
125 | 'advanceProgressHandle': function (anEvent) { | ||
126 | this.advanceCurrentStep(); | ||
127 | //Clipperz.log("--- advanceProgressHandle: " + this.currentStep() + "/" + this.numberOfSteps()); | ||
128 | this.updateProgress(); | ||
129 | }, | ||
130 | |||
131 | //............................................................................. | ||
132 | |||
133 | 'progressDoneHandle': function (anEvent) { | ||
134 | //Clipperz.log("<<< progressDoneHandle: " + this.currentStep() + "/" + this.numberOfSteps()); | ||
135 | this.resetStatus(); | ||
136 | MochiKit.Signal.signal(this, 'progressDone'); | ||
137 | }, | ||
138 | |||
139 | //============================================================================= | ||
140 | __syntaxFix__: "syntax fix" | ||
141 | }); | ||
142 | |||
143 | Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController = new Clipperz.PM.UI.Common.Controllers.ProgressBarController(); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js new file mode 100644 index 0000000..fbc5929 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js | |||
@@ -0,0 +1,188 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Common.Controllers.TabPanelController = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | this._component = args.component; | ||
35 | this._configuration = args.configuration; | ||
36 | this._isEnabled = args.enabled || true; | ||
37 | |||
38 | this._selectedTab = null; | ||
39 | return this; | ||
40 | } | ||
41 | |||
42 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.TabPanelController.prototype, { | ||
43 | |||
44 | 'toString': function() { | ||
45 | return "Clipperz.PM.UI.Common.Controllers.TabPanelController"; | ||
46 | }, | ||
47 | |||
48 | //----------------------------------------------------------------------------- | ||
49 | |||
50 | 'component': function() { | ||
51 | return this._component; | ||
52 | }, | ||
53 | |||
54 | 'configuration': function() { | ||
55 | return this._configuration; | ||
56 | }, | ||
57 | |||
58 | //----------------------------------------------------------------------------- | ||
59 | |||
60 | 'getElement': function(anElementID) { | ||
61 | return this.component().getElement(anElementID); | ||
62 | }, | ||
63 | |||
64 | 'tabForTabElement': function(anElement) { | ||
65 | varresult; | ||
66 | |||
67 | for (result in this.configuration()) { | ||
68 | if (this.getElement(this.configuration()[result]['tab']) == anElement) { | ||
69 | break; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | return result; | ||
74 | }, | ||
75 | |||
76 | //----------------------------------------------------------------------------- | ||
77 | |||
78 | 'setupTab': function(aConfiguration) { | ||
79 | vartabElement; | ||
80 | |||
81 | tabElement = this.getElement(aConfiguration['tab']); | ||
82 | |||
83 | MochiKit.DOM.removeElementClass(tabElement, 'selected'); | ||
84 | MochiKit.Signal.connect(tabElement, 'onclick', this, 'handleTabClick') | ||
85 | }, | ||
86 | |||
87 | 'setupPanel': function(aConfiguration) { | ||
88 | this.hidePanel(aConfiguration['panel']); | ||
89 | }, | ||
90 | |||
91 | 'setup': function(args) { | ||
92 | args = args || {}; | ||
93 | |||
94 | MochiKit.Base.map(MochiKit.Base.method(this, 'setupTab'),MochiKit.Base.values(this.configuration())); | ||
95 | MochiKit.Base.map(MochiKit.Base.method(this, 'setupPanel'),MochiKit.Base.values(this.configuration())); | ||
96 | this.selectTab(args.selected); | ||
97 | }, | ||
98 | |||
99 | //----------------------------------------------------------------------------- | ||
100 | |||
101 | 'hidePanel': function(aPanel) { | ||
102 | MochiKit.DOM.removeElementClass(this.getElement(aPanel), 'selected'); | ||
103 | }, | ||
104 | |||
105 | 'selectTab': function(aTab) { | ||
106 | if ((aTab != this.selectedTab()) && (this.isEnabled())) { | ||
107 | if (this.selectedTab() != null) { | ||
108 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[this.selectedTab()]['tab']),'selected'); | ||
109 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[this.selectedTab()]['panel']),'selected'); | ||
110 | } | ||
111 | |||
112 | if (aTab != null) { | ||
113 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTab]['tab']),'selected'); | ||
114 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTab]['panel']),'selected'); | ||
115 | } | ||
116 | |||
117 | this.setSelectedTab(aTab); | ||
118 | MochiKit.Signal.signal(this, 'tabSelected', aTab); | ||
119 | } | ||
120 | }, | ||
121 | |||
122 | //----------------------------------------------------------------------------- | ||
123 | |||
124 | 'selectedTab': function() { | ||
125 | return this._selectedTab; | ||
126 | }, | ||
127 | |||
128 | 'setSelectedTab': function(aTab) { | ||
129 | this._selectedTab = aTab; | ||
130 | }, | ||
131 | |||
132 | //----------------------------------------------------------------------------- | ||
133 | |||
134 | 'selectedTabElement': function() { | ||
135 | var result; | ||
136 | |||
137 | if (this.selectedTab() != null) { | ||
138 | result = this.getElement(this.configuration()[this.selectedTab()]['tab']); | ||
139 | } else { | ||
140 | result = null; | ||
141 | } | ||
142 | |||
143 | return null; | ||
144 | }, | ||
145 | |||
146 | 'selectedTabPanelElement': function() { | ||
147 | var result; | ||
148 | |||
149 | if (this.selectedTab() != null) { | ||
150 | result = this.getElement(this.configuration()[this.selectedTab()]['panel']); | ||
151 | } else { | ||
152 | result = null; | ||
153 | } | ||
154 | |||
155 | return result; | ||
156 | }, | ||
157 | |||
158 | //----------------------------------------------------------------------------- | ||
159 | |||
160 | 'handleTabClick': function(anEvent) { | ||
161 | this.selectTab(this.tabForTabElement(anEvent.src())); | ||
162 | anEvent.preventDefault(); | ||
163 | }, | ||
164 | |||
165 | //============================================================================= | ||
166 | |||
167 | 'isEnabled': function () { | ||
168 | return this._isEnabled; | ||
169 | }, | ||
170 | |||
171 | 'enable': function () { | ||
172 | this._isEnabled = true; | ||
173 | MochiKit.Base.map(MochiKit.Base.bind(function (aTabComponentID) { | ||
174 | MochiKit.DOM.removeElementClass(this.getElement(this.configuration()[aTabComponentID]['tab']), 'disabled'); | ||
175 | }, this), MochiKit.Base.keys(this.configuration())); | ||
176 | }, | ||
177 | |||
178 | 'disable': function () { | ||
179 | this._isEnabled = false; | ||
180 | MochiKit.Base.map(MochiKit.Base.bind(function (aTabComponentID) { | ||
181 | MochiKit.DOM.addElementClass(this.getElement(this.configuration()[aTabComponentID]['tab']), 'disabled'); | ||
182 | }, this), MochiKit.Base.keys(this.configuration())); | ||
183 | }, | ||
184 | |||
185 | //============================================================================= | ||
186 | |||
187 | __syntaxFix__: "syntax fix" | ||
188 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js new file mode 100644 index 0000000..868cea6 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | //Still empty, but here it should be reasonable to factor in code duplicated between | ||
30 | //- DirectLoginWizardController | ||
31 | //- NewUserWizardController \ No newline at end of file | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js new file mode 100644 index 0000000..22258f6 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Compact'); | ||
30 | |||
31 | Clipperz.PM.UI.Compact.MainController = function() { | ||
32 | //this._loginPanel = null; | ||
33 | //this._user = null; | ||
34 | // | ||
35 | //this._isRunningCompact = false; | ||
36 | // | ||
37 | //Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); | ||
38 | //Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); | ||
39 | // | ||
40 | //Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, { | ||
46 | |||
47 | 'toString': function() { | ||
48 | return "Clipperz.PM.UI.Compact.MainController"; | ||
49 | }, | ||
50 | |||
51 | //----------------------------------------------------------------------------- | ||
52 | |||
53 | 'run': function(shouldShowRegistrationForm) { | ||
54 | MochiKit.Logging.logDebug("running " + this.toString()); | ||
55 | }, | ||
56 | |||
57 | //----------------------------------------------------------------------------- | ||
58 | __syntaxFix__: "syntax fix" | ||
59 | }); \ No newline at end of file | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js new file mode 100644 index 0000000..4378b19 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js | |||
@@ -0,0 +1,148 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | //this._initiallySelectedTab = args.selected || 'ACCOUNT'; | ||
37 | this._initiallySelectedTab = args.selected || 'PASSPHRASE'; | ||
38 | this._tabPanelControllerConfiguration = { | ||
39 | // 'ACCOUNT': { | ||
40 | // tab:'accountTab', | ||
41 | // panel:'accountPanel' | ||
42 | // }, | ||
43 | 'PASSPHRASE': { | ||
44 | tab:'passphraseTab', | ||
45 | panel:'passphrasePanel' | ||
46 | }, | ||
47 | 'PREFERENCES': { | ||
48 | tab:'preferencesTab', | ||
49 | panel:'preferencesPanel' | ||
50 | }, | ||
51 | 'LOGIN_HISTORY': { | ||
52 | tab:'loginHistoryTab', | ||
53 | panel:'loginHistoryPanel' | ||
54 | } | ||
55 | }; | ||
56 | |||
57 | return this; | ||
58 | } | ||
59 | |||
60 | //============================================================================= | ||
61 | |||
62 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | ||
63 | |||
64 | //------------------------------------------------------------------------- | ||
65 | |||
66 | 'toString': function () { | ||
67 | return "Clipperz.PM.UI.Web.Components.AccountPanel component"; | ||
68 | }, | ||
69 | |||
70 | //------------------------------------------------------------------------- | ||
71 | |||
72 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
73 | //Clipperz.log("AccountPanel.renderSelf element", this.element()); | ||
74 | this.append(this.element(), [ | ||
75 | {tag:'div', cls:'header', children:[ | ||
76 | {tag:'div', cls:'subPanelTabs', children:[ | ||
77 | {tag:'ul', children:[ | ||
78 | // {tag:'li', id:this.getId('accountTab'), children:[{tag:'a', href:'#', html:'Account'}], cls:'first'}, | ||
79 | {tag:'li', id:this.getId('passphraseTab'), children:[{tag:'a', href:'#', html:'Passphrase'}], cls:'first'}, | ||
80 | {tag:'li', id:this.getId('preferencesTab'), children:[{tag:'a', href:'#', html:'Preferences'}]}, | ||
81 | {tag:'li', id:this.getId('loginHistoryTab'),children:[{tag:'a', href:'#', html:'Login history'}]} | ||
82 | ]} | ||
83 | ]} | ||
84 | ]}, | ||
85 | {tag:'div', cls:'body', children:[ | ||
86 | {tag:'div', cls:'accountPanel', children:[ | ||
87 | {tag:'div', cls:'subPanelContent', children:[ | ||
88 | {tag:'ul', children:[ | ||
89 | // {tag:'li', id:this.getId('accountPanel'),children:[ | ||
90 | // {tag:'h3', html:"-- Account --"} | ||
91 | // ]}, | ||
92 | {tag:'li', id:this.getId('passphrasePanel'),children:[ | ||
93 | {tag:'h3', cls:'changePassphrase', html:"Change passphrase"}, | ||
94 | {tag:'form', id:this.getId('changePassphrase'), cls:'changePassphrase', children:[ | ||
95 | {tag:'div', cls:'currentCredentials', children:[ | ||
96 | {tag:'div', cls:'field username', children:[ | ||
97 | {tag:'label', html:"username", 'for':this.getId('currentUsername')}, | ||
98 | {tag:'input', id:this.getId('currentUsername')} | ||
99 | ]}, | ||
100 | {tag:'div', cls:'field passphrase', children:[ | ||
101 | {tag:'label', html:"passphrase", 'for':this.getId('currentPassphrase')}, | ||
102 | {tag:'input', id:this.getId('currentPassphrase')} | ||
103 | ]} | ||
104 | ]}, | ||
105 | {tag:'div', cls:'newPassphrase', children:[ | ||
106 | {tag:'div', cls:'field', children:[ | ||
107 | {tag:'label', html:"new passphrase", 'for':this.getId('newPassphrase')}, | ||
108 | {tag:'input', id:this.getId('newPassphrase')} | ||
109 | ]}, | ||
110 | {tag:'div', cls:'field', children:[ | ||
111 | {tag:'label', html:"re-new passphrase", 'for':this.getId('reNewPassphrase')}, | ||
112 | {tag:'input', id:this.getId('reNewPassphrase')} | ||
113 | ]} | ||
114 | ]}, | ||
115 | {tag:'div', cls:'confirm', children:[ | ||
116 | {tag:'input', type:'checkbox', id:this.getId('confirm')}, | ||
117 | {tag:'label', html:"I understand that Clipperz will not be able to recover a lost passphrase", 'for':this.getId('confirm')} | ||
118 | ]} | ||
119 | ]}, | ||
120 | {tag:'div', cls:'clear'}, | ||
121 | {tag:'div', cls:'confirmButton', id:this.getId('confirmationButton'), children:[ | ||
122 | {tag:'span', html:"change passphrase"} | ||
123 | ]}, | ||
124 | |||
125 | {tag:'h3', cls:'manageOTP', html:"Manage One-Time Passphrases"}, | ||
126 | {} | ||
127 | ]}, | ||
128 | {tag:'li', id:this.getId('preferencesPanel'), children:[ | ||
129 | {tag:'h3', html:"-- Preferences --"} | ||
130 | ]}, | ||
131 | {tag:'li', id:this.getId('loginHistoryPanel'), children:[ | ||
132 | {tag:'h3', html:"-- Login History --"} | ||
133 | ]} | ||
134 | ]} | ||
135 | ]} | ||
136 | ]} | ||
137 | ]}, | ||
138 | {tag:'div', cls:'footer'} | ||
139 | ]); | ||
140 | |||
141 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); | ||
142 | }, | ||
143 | |||
144 | //------------------------------------------------------------------------- | ||
145 | |||
146 | |||
147 | __syntaxFix__: "syntax fix" | ||
148 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js new file mode 100644 index 0000000..67247df --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.AppPage = function(args) { | ||
32 | args = args || {}; | ||
33 | Clipperz.PM.UI.Web.Components.AppPage.superclass.constructor.call(this, args); | ||
34 | |||
35 | this._element = args.element || null; | ||
36 | |||
37 | this._slots = { | ||
38 | 'cardGrid' : this.getId('cardGrid'), | ||
39 | // 'directLoginGrid' : this.getId('directLoginGrid'), | ||
40 | 'accountPanel': this.getId('accountPanel'), | ||
41 | 'dataPanel': this.getId('dataPanel'), | ||
42 | 'toolsPanel': this.getId('toolsPanel'), | ||
43 | 'userInfoBox': this.getId('userInfoBox'), | ||
44 | 'tabSidePanel': this.getId('tabSidePanel') | ||
45 | }; | ||
46 | |||
47 | return this; | ||
48 | } | ||
49 | |||
50 | //============================================================================= | ||
51 | |||
52 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AppPage, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
53 | |||
54 | //------------------------------------------------------------------------- | ||
55 | |||
56 | 'toString': function () { | ||
57 | return "Clipperz.PM.UI.Web.Components.AppPage component"; | ||
58 | }, | ||
59 | |||
60 | //------------------------------------------------------------------------- | ||
61 | |||
62 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
63 | this.append(this.element(), {tag:'div', id:this.getId('userInfoBox'), cls:'userInfoBox'}); | ||
64 | this.append(this.element(), {tag:'div', id:this.getId('sidePanels'), cls:'sidePanels'}); | ||
65 | this.append(this.getId('sidePanels'),{tag:'div', id:this.getId('tabSidePanel'), cls:'tabSidePanel', children:[]}); | ||
66 | |||
67 | this.append(this.element(), {tag:'div', id:this.getId('mainPanels'), cls:'mainPanels'}); | ||
68 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('cardGrid'), cls:'gridComponent cardGrid'}); | ||
69 | // this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('directLoginGrid'), cls:'gridComponent directLoginGrid'}); | ||
70 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('accountPanel'), cls:'otherPanel'}); | ||
71 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('dataPanel'), cls:'otherPanel'}); | ||
72 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('toolsPanel'), cls:'otherPanel'}); | ||
73 | }, | ||
74 | |||
75 | //------------------------------------------------------------------------- | ||
76 | |||
77 | __syntaxFix__: "syntax fix" | ||
78 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js new file mode 100644 index 0000000..42a6052 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js | |||
@@ -0,0 +1,109 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); | ||
35 | MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); | ||
36 | |||
37 | return this; | ||
38 | } | ||
39 | |||
40 | //============================================================================= | ||
41 | |||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
43 | |||
44 | //------------------------------------------------------------------------- | ||
45 | |||
46 | 'toString': function () { | ||
47 | return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; | ||
48 | }, | ||
49 | |||
50 | //------------------------------------------------------------------------- | ||
51 | |||
52 | 'renderSelf': function() { | ||
53 | // var bookmarkletUrl; | ||
54 | // | ||
55 | // if (Clipperz_IEisBroken == true) { | ||
56 | // bookmarkletUrl = bookmarklet_ie; | ||
57 | // } else { | ||
58 | /// bookmarkletUrl = bookmarklet; | ||
59 | // bookmarkletUrl = Clipperz.PM.Strings['bookmarklet']; | ||
60 | // } | ||
61 | |||
62 | this.append(this.element(), {tag:'div', cls:'bookmarklet', children: [ | ||
63 | {tag:'div', id:this.getId('linkBlock'), cls:'bookmarklet_link', children:[ | ||
64 | // {tag:'a', id:this.getId('link'), href:bookmarkletUrl, children:[ | ||
65 | {tag:'a', id:this.getId('link'), href:'#', children:[ | ||
66 | {tag:'div', cls:'icon'}, | ||
67 | {tag:'div', cls:'text', children:[ | ||
68 | {tag:'span', html:"add to Clipperz"} | ||
69 | ]} | ||
70 | ]} | ||
71 | ]} | ||
72 | ]}); | ||
73 | |||
74 | new Clipperz.PM.UI.Common.Components.Tooltip({ | ||
75 | element:this.getElement('linkBlock'), | ||
76 | text: "Drag and drop the \"add to Clipperz\" link above to the bookmark bar.", | ||
77 | position:'BELOW' | ||
78 | }); | ||
79 | |||
80 | MochiKit.Signal.connect(this.getId('link'), 'onclick', this, 'handleOnclick'); | ||
81 | this.updateBookmarkletURLs(); | ||
82 | }, | ||
83 | |||
84 | //------------------------------------------------------------------------- | ||
85 | |||
86 | 'handleOnclick': function (anEvent) { | ||
87 | anEvent.preventDefault(); | ||
88 | |||
89 | Clipperz.log("BOOKMARKLET CLICK"); | ||
90 | }, | ||
91 | |||
92 | //------------------------------------------------------------------------- | ||
93 | |||
94 | 'updateBookmarkletURLs': function () { | ||
95 | var bookmarkletUrl; | ||
96 | |||
97 | if (Clipperz_IEisBroken == true) { | ||
98 | bookmarkletUrl = bookmarklet_ie; | ||
99 | } else { | ||
100 | // bookmarkletUrl = bookmarklet; | ||
101 | bookmarkletUrl = Clipperz.PM.Strings.getValue('bookmarklet'); | ||
102 | } | ||
103 | |||
104 | this.getElement('link').href = bookmarkletUrl; | ||
105 | }, | ||
106 | |||
107 | //------------------------------------------------------------------------- | ||
108 | __syntaxFix__: "syntax fix" | ||
109 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js new file mode 100644 index 0000000..e3238ca --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js | |||
@@ -0,0 +1,881 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.CardDialogComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.CardDialogComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._tabPanelController = null; | ||
37 | |||
38 | this._tabPanelControllerConfiguration = { | ||
39 | 'DETAILS': { | ||
40 | tab:'detailTab', | ||
41 | panel:'detailTabpanel' | ||
42 | }, | ||
43 | 'DIRECT_LOGINS': { | ||
44 | tab:'directLoginTab', | ||
45 | panel:'directLoginTabpanel' | ||
46 | }, | ||
47 | 'SHARING': { | ||
48 | tab:'sharingTab', | ||
49 | panel:'sharingTabpanel' | ||
50 | } | ||
51 | }; | ||
52 | |||
53 | this._tooltips = null; | ||
54 | |||
55 | this._isSavingEnabled = false; | ||
56 | this._hintMode = 'OFF'; //'ON' | ||
57 | |||
58 | this._fieldComponents = {}; | ||
59 | this._directLoginComponents = {}; | ||
60 | |||
61 | this._displayMode = 'fixed'; //'scrollable'; | ||
62 | |||
63 | return this; | ||
64 | } | ||
65 | |||
66 | //============================================================================= | ||
67 | |||
68 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
69 | |||
70 | //------------------------------------------------------------------------- | ||
71 | |||
72 | 'toString': function () { | ||
73 | return "Clipperz.PM.UI.Web.Components.CardDialogComponent component"; | ||
74 | }, | ||
75 | |||
76 | //------------------------------------------------------------------------- | ||
77 | |||
78 | 'tabPanelController': function () { | ||
79 | if (this._tabPanelController == null) { | ||
80 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ | ||
81 | component:this, | ||
82 | configuration:this._tabPanelControllerConfiguration | ||
83 | }); | ||
84 | |||
85 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') | ||
86 | } | ||
87 | |||
88 | return this._tabPanelController; | ||
89 | }, | ||
90 | |||
91 | //------------------------------------------------------------------------- | ||
92 | |||
93 | 'renderSelf': function() { | ||
94 | this.append(this.element(), {tag:'div', cls:'CardDialog mainDialog loading', id:this.getId('panel'), children: [ | ||
95 | {tag:'form', id:this.getId('form'), children:[ | ||
96 | // {tag:'input', type:'text', id:this.getId('hidden'), cls:'hidden'}, | ||
97 | {tag:'div', cls:'header', children:[ | ||
98 | {tag:'div', cls:'title', children:[ | ||
99 | {tag:'input', type:'text', id:this.getId('title')} | ||
100 | ]} | ||
101 | ]}, | ||
102 | {tag:'div', id:this.getId('body'), cls:'body', children:[ | ||
103 | {tag:'div', cls:'tabs', children:[ | ||
104 | {tag:'ul', cls:'tabs', children:[ | ||
105 | {tag:'li', id:this.getId('detailTab'), children:[{tag:'span', html:"details"}]}, | ||
106 | {tag:'li', id:this.getId('directLoginTab'), children:[ | ||
107 | {tag:'span', html:"direct logins"}//, | ||
108 | // {tag:'div', id:this.getId('addDirectLoginButton'), cls:'addDirectLoginButton', children:[ | ||
109 | // {tag:'span', html:"+"} | ||
110 | // ]} | ||
111 | ]}, | ||
112 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'span', html:"sharing"}]} | ||
113 | ]} | ||
114 | ]}, | ||
115 | {tag:'div', cls:'tabPanels', children:[ | ||
116 | {tag:'ul', cls:'tabPanels', children:[ | ||
117 | {tag:'li', id:this.getId('detailTabpanel'), cls:'tabPanel', children:[ | ||
118 | {tag:'div', id:this.getId('recordFields'), children:[ | ||
119 | {tag:'table', cls:'fields', cellpadding:'0', id:this.getId('fieldTable'), cellspacing:'0', children:[ | ||
120 | {tag:'thead', children:[ | ||
121 | {tag:'tr', children:[ | ||
122 | {tag:'th', cls:'fieldStateTH',html:""}, | ||
123 | {tag:'th', cls:'fieldLabelTH',html:"label"}, | ||
124 | {tag:'th', cls:'fieldLockTH',html:""}, | ||
125 | {tag:'th', cls:'fieldValueTH',html:"value"}, | ||
126 | {tag:'th', cls:'fieldActionTH',html:""}, | ||
127 | {tag:'th', cls:'fieldDeleteTH',html:""} | ||
128 | ]} | ||
129 | ]}, | ||
130 | {tag:'tfoot'}, | ||
131 | {tag:'tbody', id:this.getId('tableBody'), children:[ | ||
132 | {tag:'tr', id:this.getId('newFieldTR'), cls:'newFieldTR', children:[ | ||
133 | {tag:'td', cls:'fieldState'}, | ||
134 | {tag:'td', cls:'fieldLabel', children:[ | ||
135 | {tag:'input', cls:'label', id:this.getId('newFieldLabel')} | ||
136 | ]}, | ||
137 | {tag:'td', cls:'fieldLock', children:[ | ||
138 | {tag:'div', cls:'unlocked', id:this.getId('newFieldIsLocked')} | ||
139 | ]}, | ||
140 | {tag:'td', cls:'fieldValue', children:[ | ||
141 | {tag:'div', cls:'unlocked', id:this.getId('newFieldValueWrapper'), children:[ | ||
142 | {tag:'input',type:'text', cls:'value', id:this.getId('newFieldValue')} | ||
143 | ]} | ||
144 | ]}, | ||
145 | {tag:'td', cls:'fieldAction', children:[ | ||
146 | {tag:'div', html:' '} | ||
147 | ]}, | ||
148 | {tag:'td', cls:'fieldAddDelete', children:[ | ||
149 | {tag:'div', cls:'new', children:[ | ||
150 | {tag:'span', children:[ | ||
151 | {tag:'a', href:'#', id:this.getId('newFieldAddButton'), html:"add"} | ||
152 | ]} | ||
153 | ]} | ||
154 | ]} | ||
155 | ]} | ||
156 | ]} | ||
157 | ]} | ||
158 | ]}, | ||
159 | {tag:'div', cls:'notes', children:[ | ||
160 | {tag:'div', children:[ | ||
161 | {tag:'textarea', id:this.getId('recordNote'), value:""} | ||
162 | ]} | ||
163 | ]} | ||
164 | ]}, | ||
165 | {tag:'li', id:this.getId('directLoginTabpanel'), cls:'tabPanel', children:[ | ||
166 | {tag:'div', id:this.getId('directLoginsComponentContainer'), cls:'directLoginsComponentContainer', children:[ | ||
167 | {tag:'div', id:this.getId('directLogins'), cls:'directLogins', children:[ | ||
168 | {tag:'div', id:this.getId('addNewDirectLoginSplash'), cls:'addNewDirectLoginSplash', children:[ | ||
169 | {tag:'h3', html:"Here you can add a Direct Login for this card: instant access to your favorit website!"}, | ||
170 | {tag:'a', href:'#', id:this.getId('addNewDirectLoginSplashButton'), children:[{tag:'span', html:"Add Direct Login"}]} | ||
171 | ]}, | ||
172 | {tag:'div', id:this.getId('directLoginsList')}, | ||
173 | {tag:'div', cls:'addDirectLoginListItem', id:this.getId('addDirectLoginListItem'), children:[{tag:'a', href:'#', id:this.getId('addNewDirectLoginListItemButton'), children:[{tag:'span', html:"Add Direct Login"}]}]} | ||
174 | ]}, | ||
175 | {tag:'div', id:this.getId('directLoginEditDetail'), cls:'directLoginEditDetail'} | ||
176 | ]} | ||
177 | ]}, | ||
178 | {tag:'li', id:this.getId('sharingTabpanel'), cls:'tabPanel', children:[ | ||
179 | {tag:'h2', html:"Coming soon!"} | ||
180 | ]} | ||
181 | ]} | ||
182 | ]}, | ||
183 | {tag:'div', cls:'mask', children:[ | ||
184 | {tag:'div', id:this.getId('progress'), children:[ | ||
185 | {tag:'h3', id:this.getId('progressDescription'), cls:'progressDescription', html:"Loading"}, | ||
186 | {tag:'div', id:this.getId('progressBar')} | ||
187 | ]}, | ||
188 | {tag:'div', id:this.getId('error'), cls:'error', children:[ | ||
189 | {tag:'div', cls:'img'}, | ||
190 | {tag:'p', id:this.getId('errorMessage')} | ||
191 | ]} | ||
192 | ]} | ||
193 | ]}, | ||
194 | {tag:'div', cls:'footer', children:[ | ||
195 | {tag:'div', cls:'buttonArea', children:[ | ||
196 | {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, | ||
197 | {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} | ||
198 | ]} | ||
199 | ]} | ||
200 | ]} | ||
201 | ]}); | ||
202 | |||
203 | |||
204 | this.insertAllTooltips(); | ||
205 | |||
206 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | ||
207 | |||
208 | this.tabPanelController().setup({selected:'DETAILS'}); | ||
209 | // this.tabPanelController().setup({selected:'DIRECT_LOGINS'}); | ||
210 | |||
211 | MochiKit.Style.hideElement(this.getId('error')); | ||
212 | MochiKit.Style.hideElement(this.getElement('directLoginEditDetail')); | ||
213 | MochiKit.Style.hideElement(this.getElement('addDirectLoginListItem')); | ||
214 | this.plumbDetailsPanel(); | ||
215 | |||
216 | MochiKit.Signal.connect(this.getId('cancelButton'), 'onclick', this, 'handleCancelEvent'); | ||
217 | MochiKit.Signal.connect(this.getId('saveButton'), 'onclick', this, 'handleSaveEvent'); | ||
218 | |||
219 | MochiKit.Signal.connect(this.getId('addNewDirectLoginSplashButton'), 'onclick', this, 'handleAddDirectLogin'); | ||
220 | MochiKit.Signal.connect(this.getId('addNewDirectLoginListItemButton'), 'onclick', this, 'handleAddDirectLogin'); | ||
221 | |||
222 | MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown',this, 'handleKeyEvent'); | ||
223 | }, | ||
224 | |||
225 | //------------------------------------------------------------------------- | ||
226 | |||
227 | 'displayMode': function () { | ||
228 | return this._displayMode; | ||
229 | }, | ||
230 | |||
231 | 'setDisplayMode': function (aValue) { | ||
232 | this._displayMode = aValue; | ||
233 | }, | ||
234 | |||
235 | //------------------------------------------------------------------------- | ||
236 | |||
237 | 'plumbDetailsPanel': function () { | ||
238 | MochiKit.Signal.connect(this.getId('title'), 'onfocus', MochiKit.Base.method(this, 'handleOnFocusEvent',this.getElement('title').parentNode)); | ||
239 | MochiKit.Signal.connect(this.getId('title'), 'onblur',MochiKit.Base.method(this, 'handleLooseFocusEvent', this.getElement('title').parentNode)); | ||
240 | MochiKit.Signal.connect(this.getId('title'), 'onchange',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
241 | MochiKit.Signal.connect(this.getId('title'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
242 | |||
243 | MochiKit.Signal.connect(this.getId('recordNote'), 'onfocus', MochiKit.Base.method(this, 'handleOnFocusEvent',MochiKit.Selector.findChildElements(this.element(), ['div.notes'])[0])); | ||
244 | MochiKit.Signal.connect(this.getId('recordNote'), 'onblur',MochiKit.Base.method(this, 'handleLooseFocusEvent', MochiKit.Selector.findChildElements(this.element(), ['div.notes'])[0])); | ||
245 | MochiKit.Signal.connect(this.getId('recordNote'), 'onchange',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
246 | MochiKit.Signal.connect(this.getId('recordNote'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
247 | |||
248 | MochiKit.Signal.connect(this.getId('newFieldValue'), 'onkeydown',this, 'handleKeyDownOnNewFieldValue'); | ||
249 | |||
250 | MochiKit.Signal.connect(this.getId('newFieldLabel'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
251 | MochiKit.Signal.connect(this.getId('newFieldIsLocked'), 'onclick',this, 'toggleNewFieldIsHidden'); | ||
252 | MochiKit.Signal.connect(this.getId('newFieldValue'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
253 | |||
254 | MochiKit.Signal.connect(this.getId('newFieldAddButton'), 'onclick', this, 'handleAddClick'); | ||
255 | }, | ||
256 | |||
257 | //------------------------------------------------------------------------- | ||
258 | |||
259 | 'insertAllTooltips': function () { | ||
260 | var tooltips; | ||
261 | var tooltipEnabled; | ||
262 | |||
263 | tooltips = {}; | ||
264 | tooltipEnabled = (this.hintMode() == 'ON'); | ||
265 | |||
266 | tooltips['title'] = new Clipperz.PM.UI.Common.Components.Tooltip({ | ||
267 | 'element':this.getElement('title'), | ||
268 | 'text': "Insert here the title of the card", | ||
269 | 'position':'RIGHT' | ||
270 | }); | ||
271 | this.addComponent(tooltips['title']); | ||
272 | MochiKit.Signal.connect(this.getId('title'), 'onfocus',MochiKit.Base.method(this, 'showTooltipOnFocus', 'title')); | ||
273 | MochiKit.Signal.connect(this.getId('title'), 'onblur', MochiKit.Base.method(this, 'hideTooltipOnBlur', 'title')); | ||
274 | |||
275 | tooltips['newFieldTR'] = new Clipperz.PM.UI.Common.Components.Tooltip({ | ||
276 | 'element':this.getElement('newFieldTR'), | ||
277 | 'text': "Insert your card new values here", | ||
278 | 'position':'RIGHT' | ||
279 | }); | ||
280 | this.addComponent(tooltips['newFieldTR']); | ||
281 | MochiKit.Signal.connect(this.getId('newFieldLabel'), 'onfocus',MochiKit.Base.method(this, 'showTooltipOnFocus', 'newFieldTR')); | ||
282 | MochiKit.Signal.connect(this.getId('newFieldValue'), 'onblur', MochiKit.Base.method(this, 'hideTooltipOnBlur', 'newFieldTR')); | ||
283 | |||
284 | tooltips['recordNote'] = new Clipperz.PM.UI.Common.Components.Tooltip({ | ||
285 | 'element':this.getElement('recordNote'), | ||
286 | 'text': "You can insert some notes here", | ||
287 | 'position':'RIGHT' | ||
288 | }); | ||
289 | this.addComponent(tooltips['recordNote']); | ||
290 | MochiKit.Signal.connect(this.getId('recordNote'), 'onfocus',MochiKit.Base.method(this, 'showTooltipOnFocus', 'recordNote')); | ||
291 | MochiKit.Signal.connect(this.getId('recordNote'), 'onblur', MochiKit.Base.method(this, 'hideTooltipOnBlur', 'recordNote')); | ||
292 | |||
293 | this._tooltips = tooltips; | ||
294 | }, | ||
295 | |||
296 | //......................................................................... | ||
297 | |||
298 | 'updateAllTooltipsEnabledMode': function (aStatus) { | ||
299 | vartooltipLabel; | ||
300 | var tooltipEnabled; | ||
301 | |||
302 | tooltipEnabled = (aStatus == 'ON') ? true : false; | ||
303 | |||
304 | for (tooltipLabel in this.tooltips()) { | ||
305 | this.tooltips()[tooltipLabel].setIsEnabled(tooltipEnabled); | ||
306 | } | ||
307 | }, | ||
308 | |||
309 | //......................................................................... | ||
310 | |||
311 | 'tooltips': function () { | ||
312 | return this._tooltips; | ||
313 | }, | ||
314 | |||
315 | //......................................................................... | ||
316 | |||
317 | 'showTooltipOnFocus': function (aTooltip, anEvent) { | ||
318 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.tooltips()[aTooltip], 'show')); | ||
319 | }, | ||
320 | |||
321 | //......................................................................... | ||
322 | |||
323 | 'hideTooltipOnBlur': function (aTooltip, anEvent) { | ||
324 | this.tooltips()[aTooltip].hide(); | ||
325 | }, | ||
326 | |||
327 | //------------------------------------------------------------------------- | ||
328 | |||
329 | 'displayElement': function() { | ||
330 | return this.getElement('panel'); | ||
331 | }, | ||
332 | |||
333 | //------------------------------------------------------------------------- | ||
334 | |||
335 | 'fieldComponents': function () { | ||
336 | return this._fieldComponents; | ||
337 | }, | ||
338 | |||
339 | //------------------------------------------------------------------------- | ||
340 | |||
341 | 'directLoginComponents': function () { | ||
342 | return this._directLoginComponents; | ||
343 | }, | ||
344 | |||
345 | //------------------------------------------------------------------------- | ||
346 | |||
347 | 'hintMode': function () { | ||
348 | return this._hintMode; | ||
349 | }, | ||
350 | |||
351 | 'setHintMode': function (aValue) { | ||
352 | if (this._hintMode != aValue) { | ||
353 | this._hintMode = aValue; | ||
354 | |||
355 | this.updateAllTooltipsEnabledMode(this._hintMode); | ||
356 | // if (this._hintMode == 'ON') { | ||
357 | // this.enableHints(); | ||
358 | // } | ||
359 | } | ||
360 | }, | ||
361 | |||
362 | //------------------------------------------------------------------------- | ||
363 | |||
364 | 'focusOnNewFieldLabel': function () { | ||
365 | this.getElement('newFieldLabel').focus(); | ||
366 | }, | ||
367 | |||
368 | //========================================================================= | ||
369 | |||
370 | 'isSavingEnabled': function () { | ||
371 | return this._isSavingEnabled; | ||
372 | }, | ||
373 | |||
374 | 'setShouldEnableSaving': function (aValue) { | ||
375 | this._isSavingEnabled = aValue || this.newFieldHasPendingChanges(); | ||
376 | |||
377 | if (this._isSavingEnabled == true) { | ||
378 | MochiKit.DOM.addElementClass(this.getElement('panel'), 'hasPendingChanges'); | ||
379 | MochiKit.DOM.removeElementClass(this.getId('saveButton'), 'disabled'); | ||
380 | } else { | ||
381 | MochiKit.DOM.removeElementClass(this.getElement('panel'), 'hasPendingChanges'); | ||
382 | MochiKit.DOM.addElementClass(this.getId('saveButton'), 'disabled'); | ||
383 | } | ||
384 | }, | ||
385 | |||
386 | //========================================================================= | ||
387 | |||
388 | 'title': function () { | ||
389 | return this.getElement('title').value; | ||
390 | }, | ||
391 | |||
392 | 'setTitle': function (aValue) { | ||
393 | this.renderTitle(aValue); | ||
394 | }, | ||
395 | |||
396 | //------------------------------------------------------------------------- | ||
397 | |||
398 | 'renderTitle': function (aValue) { | ||
399 | this.getElement('title').value = Clipperz.Base.sanitizeString(aValue); | ||
400 | }, | ||
401 | |||
402 | //------------------------------------------------------------------------- | ||
403 | |||
404 | 'setFocusOnTitleField': function () { | ||
405 | this.getElement('title').focus(); | ||
406 | }, | ||
407 | |||
408 | //------------------------------------------------------------------------- | ||
409 | |||
410 | 'disableCardTitleEditing': function () { | ||
411 | this.getElement('title').disabled = true; | ||
412 | MochiKit.DOM.addElementClass(this.getElement('title').parentNode, 'disabled'); | ||
413 | }, | ||
414 | |||
415 | |||
416 | 'enableCardTitleEditing': function () { | ||
417 | this.getElement('title').disabled = false; | ||
418 | MochiKit.DOM.removeElementClass(this.getElement('title').parentNode, 'disabled'); | ||
419 | }, | ||
420 | |||
421 | //========================================================================= | ||
422 | |||
423 | 'notes': function () { | ||
424 | return this.getElement('recordNote').value; | ||
425 | }, | ||
426 | |||
427 | 'setNotes': function (aValue) { | ||
428 | this.renderNotes(aValue); | ||
429 | }, | ||
430 | |||
431 | //------------------------------------------------------------------------- | ||
432 | |||
433 | 'renderNotes': function (aValue) { | ||
434 | var noteElement; | ||
435 | |||
436 | noteElement = this.getElement('recordNote'); | ||
437 | |||
438 | if ((aValue != null) && (typeof(aValue) != 'undefined')) { | ||
439 | noteElement.value = aValue; | ||
440 | } else { | ||
441 | noteElement.value = ""; | ||
442 | } | ||
443 | |||
444 | this.fixNotesHeight(); | ||
445 | }, | ||
446 | |||
447 | //========================================================================= | ||
448 | |||
449 | 'addFieldRowComponent': function (aFieldComponent) { | ||
450 | varfieldTR; | ||
451 | |||
452 | fieldTR = this.insertBefore(this.getElement('newFieldTR'), {tag:'tr', id:'recordFieldReferece_'+aFieldComponent.reference()}); | ||
453 | aFieldComponent.renderInNode(fieldTR); | ||
454 | this.fieldComponents()[aFieldComponent.reference()] = aFieldComponent; | ||
455 | }, | ||
456 | |||
457 | //========================================================================= | ||
458 | |||
459 | 'addDirectLoginComponent': function (aDirectLoginComponent) { | ||
460 | var directLoginDIV; | ||
461 | |||
462 | if (MochiKit.Base.keys(this.directLoginComponents()).length == 0) { | ||
463 | this.hideNewDirectLoginSplash(); | ||
464 | } | ||
465 | |||
466 | directLoginDIV = this.append(this.getElement('directLoginsList'), {tag:'div', cls:'directLoginItem'}); | ||
467 | aDirectLoginComponent.renderInNode(directLoginDIV); | ||
468 | this.directLoginComponents()[aDirectLoginComponent.reference()] = aDirectLoginComponent; | ||
469 | }, | ||
470 | |||
471 | 'removeDirectLoginComponent': function (aDirectLoginComponent) { | ||
472 | delete this.directLoginComponents()[aDirectLoginComponent.reference()]; | ||
473 | aDirectLoginComponent.remove(); | ||
474 | |||
475 | if (MochiKit.Base.keys(this.directLoginComponents()).length == 0) { | ||
476 | this.showNewDirectLoginSplash(); | ||
477 | } | ||
478 | }, | ||
479 | |||
480 | //========================================================================= | ||
481 | |||
482 | 'showNewDirectLoginSplash': function () { | ||
483 | MochiKit.Style.showElement(this.getElement('addNewDirectLoginSplash')); | ||
484 | MochiKit.Style.hideElement(this.getElement('addDirectLoginListItem')); | ||
485 | }, | ||
486 | |||
487 | 'hideNewDirectLoginSplash': function () { | ||
488 | MochiKit.Style.hideElement(this.getElement('addNewDirectLoginSplash')); | ||
489 | MochiKit.Style.showElement(this.getElement('addDirectLoginListItem')); | ||
490 | }, | ||
491 | |||
492 | //========================================================================= | ||
493 | |||
494 | 'renderDirectLoginEditingComponent': function (aDirectLoginEditingComponent) { | ||
495 | aDirectLoginEditingComponent.renderInNode(this.getElement('directLoginEditDetail')); | ||
496 | }, | ||
497 | |||
498 | 'placeDirectLoginEditingComponent': function () { | ||
499 | var width; | ||
500 | |||
501 | width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; | ||
502 | |||
503 | return Clipperz.Async.callbacks("CardDialogComponent.renderDirectLoginEditingComponent", [ | ||
504 | MochiKit.Base.bind(function () { | ||
505 | MochiKit.Style.setElementPosition (this.getElement('directLoginEditDetail'), {x:width, y:-MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); | ||
506 | MochiKit.Style.setElementDimensions(this.getElement('directLoginEditDetail'), {w:width}); | ||
507 | }, this), | ||
508 | |||
509 | MochiKit.Base.noop | ||
510 | ], {trace:false}); | ||
511 | }, | ||
512 | |||
513 | //========================================================================= | ||
514 | |||
515 | 'newFieldLabel': function () { | ||
516 | return this.getElement('newFieldLabel').value; | ||
517 | }, | ||
518 | |||
519 | 'setNewFieldLabel': function (aValue) { | ||
520 | this.getElement('newFieldLabel').value = aValue; | ||
521 | }, | ||
522 | |||
523 | //------------------------------------------------------------------------- | ||
524 | |||
525 | 'newFieldValue': function () { | ||
526 | return this.getElement('newFieldValue').value; | ||
527 | }, | ||
528 | |||
529 | 'setNewFieldValue': function (aValue) { | ||
530 | this.getElement('newFieldValue').value = aValue; | ||
531 | }, | ||
532 | |||
533 | //------------------------------------------------------------------------- | ||
534 | |||
535 | 'newFieldIsHidden': function () { | ||
536 | return MochiKit.DOM.hasElementClass(this.getElement('newFieldIsLocked'), 'locked'); | ||
537 | }, | ||
538 | |||
539 | 'setNewFieldIsHidden': function (aValue) { | ||
540 | MochiKit.DOM.setElementClass(this.getElement('newFieldIsLocked'), (aValue ? 'locked': 'unlocked')); | ||
541 | MochiKit.DOM.setElementClass(this.getElement('newFieldValueWrapper'), (aValue ? 'locked': 'unlocked')); | ||
542 | }, | ||
543 | |||
544 | 'toggleNewFieldIsHidden': function (anEvent) { | ||
545 | anEvent.preventDefault(); | ||
546 | |||
547 | this.setNewFieldIsHidden(! this.newFieldIsHidden()); | ||
548 | MochiKit.Signal.signal(this, 'changedValue'); | ||
549 | }, | ||
550 | |||
551 | //------------------------------------------------------------------------- | ||
552 | |||
553 | 'newFieldHasPendingChanges': function () { | ||
554 | return ((this.newFieldLabel() != '') || (this.newFieldValue() != '') || (this.newFieldIsHidden() == true)); | ||
555 | }, | ||
556 | |||
557 | 'resetNewFieldInputs': function () { | ||
558 | this.setNewFieldLabel(''); | ||
559 | this.setNewFieldValue(''); | ||
560 | this.setNewFieldIsHidden(false); | ||
561 | }, | ||
562 | |||
563 | //========================================================================= | ||
564 | |||
565 | 'handleKeyDownOnNewFieldValue': function (anEvent) { | ||
566 | MochiKit.Signal.signal(this, 'keyPressed', anEvent); | ||
567 | /* | ||
568 | if ((anEvent.key().string == 'KEY_TAB') && this.newFieldHasPendingChanges()) { | ||
569 | anEvent.preventDefault(); | ||
570 | |||
571 | MochiKit.Signal.signal(this, 'addField'); | ||
572 | this.getElement('newFieldLabel').focus(); | ||
573 | } | ||
574 | */ | ||
575 | }, | ||
576 | |||
577 | //------------------------------------------------------------------------- | ||
578 | |||
579 | 'handleAddClick': function (anEvent) { | ||
580 | anEvent.preventDefault(); | ||
581 | MochiKit.Signal.signal(this, 'addField'); | ||
582 | this.getElement('newFieldLabel').focus(); | ||
583 | }, | ||
584 | |||
585 | //========================================================================= | ||
586 | |||
587 | 'handleDeleteClick': function (aFieldKey, anEvent) { | ||
588 | anEvent.preventDefault(); | ||
589 | MochiKit.Signal.signal(this, 'deleteField', aFieldKey); | ||
590 | }, | ||
591 | |||
592 | //------------------------------------------------------------------------- | ||
593 | |||
594 | 'toggleLock': function (aFieldKey, anEvent) { | ||
595 | var shouldRedrawAsLocked; | ||
596 | var currentTRElement; | ||
597 | |||
598 | anEvent.preventDefault(); | ||
599 | |||
600 | currentTRElement = Clipperz.DOM.get(aFieldKey); | ||
601 | shouldRedrawAsLocked = (MochiKit.DOM.hasElementClass(currentTRElement, 'locked') ? false : true); | ||
602 | |||
603 | this.renderFieldTR(currentTRElement, { | ||
604 | label:MochiKit.Selector.findChildElements(currentTRElement, ['td.fieldLabel input'])[0].value, | ||
605 | value:MochiKit.Selector.findChildElements(currentTRElement, ['td.fieldValue input'])[0].value | ||
606 | }, shouldRedrawAsLocked, MochiKit.DOM.hasElementClass(currentTRElement, 'new')); | ||
607 | }, | ||
608 | |||
609 | //========================================================================= | ||
610 | |||
611 | 'fixNotesHeight': function () { | ||
612 | var element; | ||
613 | |||
614 | element = this.getElement('recordNote'); | ||
615 | |||
616 | if (element.scrollHeight == 0) { | ||
617 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'fixNotesHeight')); | ||
618 | } else { | ||
619 | var textareaHeight; | ||
620 | |||
621 | textareaHeight = Math.min(Math.max(50, element.scrollHeight), 500); | ||
622 | |||
623 | MochiKit.Style.setElementDimensions(element, {h:textareaHeight}, 'px'); | ||
624 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'fixRendering')); | ||
625 | } | ||
626 | }, | ||
627 | |||
628 | //------------------------------------------------------------------------- | ||
629 | |||
630 | 'fixRendering': function () { | ||
631 | // varheight; | ||
632 | var y; | ||
633 | varscrollHeight; | ||
634 | var viewportHeight; | ||
635 | var viewportY; | ||
636 | var footerElement; | ||
637 | var footerElementPosition; | ||
638 | var footerElementDimensions; | ||
639 | var footerComputedHeight; | ||
640 | |||
641 | // height = MochiKit.Style.getElementDimensions(this.displayElement())['h']; | ||
642 | y = MochiKit.Style.getElementPosition(this.displayElement())['y']; | ||
643 | |||
644 | footerElement = MochiKit.Selector.findChildElements(this.displayElement(), ['div.footer'])[0]; | ||
645 | footerElementPosition = MochiKit.Style.getElementPosition(footerElement); | ||
646 | footerElementDimensions = MochiKit.Style.getElementDimensions(footerElement); | ||
647 | footerComputedHeight = footerElementPosition['y'] + footerElementDimensions['h'] - y; | ||
648 | |||
649 | // scrollHeight = this.displayElement().scrollHeight; | ||
650 | scrollHeight = footerComputedHeight; | ||
651 | |||
652 | viewportHeight = MochiKit.Style.getViewportDimensions()['h']; | ||
653 | viewportY = MochiKit.Style.getViewportPosition()['y']; | ||
654 | |||
655 | if ((y + scrollHeight) > (viewportY + viewportHeight)) { | ||
656 | this.setDisplayMode('scrollable'); | ||
657 | MochiKit.DOM.addElementClass(this.element(), 'scrollable'); | ||
658 | MochiKit.DOM.removeElementClass(this.element(), 'fixed'); | ||
659 | MochiKit.Style.setElementPosition(this.displayElement(), {y:Math.max(0, Math.min(y, (viewportY + viewportHeight) - scrollHeight))}, 'px'); | ||
660 | MochiKit.Visual.ScrollTo(this.displayElement(), {duration:0.5}); | ||
661 | } else { | ||
662 | this.setDisplayMode('fixed'); | ||
663 | MochiKit.DOM.removeElementClass(this.element(), 'scrollable'); | ||
664 | MochiKit.DOM.addElementClass(this.element(), 'fixed'); | ||
665 | } | ||
666 | }, | ||
667 | |||
668 | //========================================================================= | ||
669 | |||
670 | 'unselectCurrentSelectedItems': function () { | ||
671 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.displayElement(), ['.selectedField']), function (anElement) { | ||
672 | MochiKit.DOM.removeElementClass(anElement, 'selectedField'); | ||
673 | }); | ||
674 | }, | ||
675 | |||
676 | //========================================================================= | ||
677 | |||
678 | 'hideProgressMask': function () { | ||
679 | MochiKit.DOM.removeElementClass(this.getId('panel'), 'loading'); | ||
680 | }, | ||
681 | |||
682 | 'showProgressMask': function () { | ||
683 | this.getElement('progressDescription').innerHTML = "Saving"; | ||
684 | MochiKit.DOM.addElementClass(this.getId('panel'), 'loading'); | ||
685 | }, | ||
686 | |||
687 | 'showError': function (anError) { | ||
688 | //console.log(">>> showError", anError); | ||
689 | MochiKit.Style.hideElement(this.getId('progress')); | ||
690 | this.getElement('errorMessage').innerHTML = Clipperz.PM.Strings.errorDescriptionForException(anError['message']); | ||
691 | MochiKit.Style.showElement(this.getId('error')); | ||
692 | }, | ||
693 | |||
694 | //------------------------------------------------------------------------- | ||
695 | |||
696 | 'cancel': function () { | ||
697 | /* | ||
698 | var deferredResult; | ||
699 | |||
700 | deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.cancel", {trace:false}); | ||
701 | deferredResult.addCallback(MochiKit.Base.method(this, 'isSavingEnabled')); | ||
702 | deferredResult.addIf([ | ||
703 | MochiKit.Base.method(this, 'askConfirmationForLoosingPendingChanges') | ||
704 | ], []); | ||
705 | deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Signal.signal, this, 'cancel')); | ||
706 | deferredResult.callback(); | ||
707 | |||
708 | return deferredResult; | ||
709 | */ | ||
710 | MochiKit.Signal.signal(this, 'cancel'); | ||
711 | }, | ||
712 | |||
713 | 'handleCancelEvent': function (anEvent) { | ||
714 | anEvent.preventDefault(); | ||
715 | this.cancel(); | ||
716 | }, | ||
717 | |||
718 | //------------------------------------------------------------------------- | ||
719 | |||
720 | 'handleSaveEvent': function (anEvent) { | ||
721 | anEvent.preventDefault(); | ||
722 | |||
723 | if (! MochiKit.DOM.hasElementClass(anEvent.src(), 'disabled')) { | ||
724 | MochiKit.Signal.signal(this, 'save'); | ||
725 | } | ||
726 | }, | ||
727 | |||
728 | //------------------------------------------------------------------------- | ||
729 | |||
730 | 'handleAddDirectLogin': function (anEvent) { | ||
731 | anEvent.preventDefault(); | ||
732 | |||
733 | MochiKit.Signal.signal(this, 'addDirectLogin'); | ||
734 | }, | ||
735 | |||
736 | //------------------------------------------------------------------------- | ||
737 | |||
738 | 'handleOnFocusEvent': function (anElement, anEvent) { | ||
739 | this.unselectCurrentSelectedItems(); | ||
740 | MochiKit.DOM.addElementClass(anElement, 'selectedField'); | ||
741 | }, | ||
742 | |||
743 | 'handleLooseFocusEvent': function (anElement, anEvent) { | ||
744 | this.unselectCurrentSelectedItems(); | ||
745 | }, | ||
746 | |||
747 | //------------------------------------------------------------------------- | ||
748 | |||
749 | 'handleTabSelected': function (aSelectedTab) { | ||
750 | this.unselectCurrentSelectedItems(); | ||
751 | |||
752 | switch (aSelectedTab) { | ||
753 | case 'DETAILS': | ||
754 | // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); | ||
755 | break; | ||
756 | case 'DIRECT_LOGINS': | ||
757 | // MochiKit.Style.showElement(this.getElement('addDirectLoginButton')); | ||
758 | break; | ||
759 | case 'SHARING': | ||
760 | // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); | ||
761 | break; | ||
762 | } | ||
763 | }, | ||
764 | |||
765 | //------------------------------------------------------------------------- | ||
766 | |||
767 | 'handleKeyEvent': function (anEvent) { | ||
768 | //console.log("####", anEvent.key().string); | ||
769 | if (anEvent.key().string == 'KEY_ESCAPE') { | ||
770 | MochiKit.Signal.signal(this, 'changedValue'); | ||
771 | this.cancel(); | ||
772 | } else if (anEvent.key().string == 'KEY_ENTER') { | ||
773 | if (anEvent.target().nodeName == 'TEXTAREA') { | ||
774 | |||
775 | } else { | ||
776 | anEvent.preventDefault(); | ||
777 | } | ||
778 | } | ||
779 | }, | ||
780 | |||
781 | //========================================================================= | ||
782 | |||
783 | 'askConfirmationForLoosingPendingChanges': function () { | ||
784 | var deferredResult; | ||
785 | var confirmationDialog; | ||
786 | |||
787 | confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ | ||
788 | title:"Alert", | ||
789 | text:"Should lost pending changes?", | ||
790 | type:'ALERT', | ||
791 | buttons: [ | ||
792 | {text:"Cancel",result:'CANCEL', isDefault:true}, | ||
793 | {text:"Ok", result:'OK'} | ||
794 | ] | ||
795 | }); | ||
796 | |||
797 | deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.askConfirmationForLoosingPendingChanges", {trace:false}); | ||
798 | // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()}); | ||
799 | deferredResult.addMethod(confirmationDialog, 'deferredShow', { | ||
800 | 'openFromElement': this.getElement('cancelButton'), | ||
801 | 'onOkCloseToElement': null, //this.getElement('cancelButton'), | ||
802 | 'onCancelCloseToElement':this.getElement('cancelButton') | ||
803 | }); | ||
804 | // deferredResult.addCallback(function () { console.log("DELETE: " + anObject.toString(), anObject); }); | ||
805 | // deferredResult.addErrbackPass(function () { console.log("skip deletion: " + anObject.toString(), anObject); }); | ||
806 | deferredResult.callback(); | ||
807 | |||
808 | return deferredResult; | ||
809 | }, | ||
810 | |||
811 | //========================================================================= | ||
812 | |||
813 | 'showDirectLoginEditingComponent': function () { | ||
814 | varwidth; | ||
815 | var transition; | ||
816 | var duration; | ||
817 | |||
818 | width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; | ||
819 | transition = MochiKit.Visual.Transitions.sinoidal; | ||
820 | duration = 1; | ||
821 | |||
822 | return Clipperz.Async.callbacks("CardDialogComponent.showDirectLoginEditingComponent", [ | ||
823 | MochiKit.Base.method(this, 'disableCardTitleEditing'), | ||
824 | MochiKit.Base.method(this.tabPanelController(), 'disable'), | ||
825 | |||
826 | MochiKit.Base.bind(function () { | ||
827 | MochiKit.Style.setElementPosition (this.getElement('directLoginEditDetail'), {x:width, y:-MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); | ||
828 | MochiKit.Style.setElementDimensions(this.getElement('directLoginEditDetail'), {w:width}); | ||
829 | MochiKit.Style.showElement(this.getElement('directLoginEditDetail')); | ||
830 | MochiKit.Style.setOpacity(this.getElement('directLoginEditDetail'), 0); | ||
831 | MochiKit.Style.setElementDimensions(this.getElement('directLoginsComponentContainer'), { | ||
832 | h:Math.max( | ||
833 | MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h'], | ||
834 | MochiKit.Style.getElementDimensions(this.getElement('directLoginEditDetail'))['h'] | ||
835 | ) | ||
836 | }); | ||
837 | // MochiKit.Style.setElementDimensions(this.getElement('directLoginsComponentContainer'), {h:MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); | ||
838 | }, this), | ||
839 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimations,MochiKit.Visual.Parallel, [ | ||
840 | new MochiKit.Visual.Move(this.getElement('directLogins'), {x:-width, y:0, mode:'relative', transition:transition, sync:true}), | ||
841 | new MochiKit.Visual.Opacity(this.getElement('directLogins'), {from:1.0, to:0.0, transition:transition, sync:true}), | ||
842 | new MochiKit.Visual.Move(this.getElement('directLoginEditDetail'), {x:-width, y:0, mode:'relative', transition:transition, sync:true}), | ||
843 | new MochiKit.Visual.Opacity(this.getElement('directLoginEditDetail'),{from:0.0, to:1.0, transition:transition, sync:true}) | ||
844 | ], {duration:duration}), | ||
845 | |||
846 | MochiKit.Base.noop | ||
847 | ], {trace:false}); | ||
848 | }, | ||
849 | |||
850 | //------------------------------------------------------------------------- | ||
851 | |||
852 | 'hideDirectLoginEditingComponent': function () { | ||
853 | varwidth; | ||
854 | var transition; | ||
855 | var duration; | ||
856 | |||
857 | width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; | ||
858 | transition = MochiKit.Visual.Transitions.sinoidal; | ||
859 | duration = 1; | ||
860 | |||
861 | return Clipperz.Async.callbacks("CardDialogComponent.hideDirectLoginEditingComponent", [ | ||
862 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimations,MochiKit.Visual.Parallel, [ | ||
863 | new MochiKit.Visual.Move(this.getElement('directLogins'), {x:width, y:0, mode:'relative', transition:transition, sync:true}), | ||
864 | new MochiKit.Visual.Opacity(this.getElement('directLogins'), {from:0.0, to:1.0, transition:transition, sync:true}), | ||
865 | new MochiKit.Visual.Move(this.getElement('directLoginEditDetail'), {x:width, y:0, mode:'relative', transition:transition, sync:true}), | ||
866 | new MochiKit.Visual.Opacity(this.getElement('directLoginEditDetail'),{from:1.0, to:0.0, transition:transition, sync:true}) | ||
867 | ], {duration:duration}), | ||
868 | // MochiKit.Base.partial(MochiKit.Visual.appear, this.getElement('addDirectLoginButton'), {duration:0.3}), | ||
869 | Clipperz.Async.clearResult, | ||
870 | MochiKit.Base.partial(MochiKit.Style.hideElement, this.getElement('directLoginEditDetail')), | ||
871 | // MochiKit.Base.partial(MochiKit.Style.showElement, this.getElement('directLogins')), | ||
872 | MochiKit.Base.partial(MochiKit.Style.setElementDimensions, this.getElement('directLoginsComponentContainer'), {h:MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}), | ||
873 | |||
874 | MochiKit.Base.method(this, 'enableCardTitleEditing'), | ||
875 | MochiKit.Base.method(this.tabPanelController(), 'enable') | ||
876 | ], {trace:false}); | ||
877 | }, | ||
878 | |||
879 | //========================================================================= | ||
880 | __syntaxFix__: "syntax fix" | ||
881 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js new file mode 100644 index 0000000..126c5b1 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js | |||
@@ -0,0 +1,182 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._faviconComponent = null; | ||
38 | |||
39 | return this; | ||
40 | } | ||
41 | |||
42 | //============================================================================= | ||
43 | |||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
45 | |||
46 | //------------------------------------------------------------------------- | ||
47 | |||
48 | 'toString': function () { | ||
49 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component"; | ||
50 | }, | ||
51 | |||
52 | //------------------------------------------------------------------------- | ||
53 | |||
54 | 'reference': function () { | ||
55 | return this._reference; | ||
56 | }, | ||
57 | |||
58 | //------------------------------------------------------------------------- | ||
59 | |||
60 | 'renderSelf': function() { | ||
61 | //console.log(">>> CardDialogRecordDirectLoginComponent.renderSelf"); | ||
62 | this.append(this.element(), [ | ||
63 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[ | ||
64 | {tag:'img', cls:'favicon', id:this.getId('favicon')} | ||
65 | ]}, | ||
66 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[ | ||
67 | {tag:'input', id:this.getId('label'), type:'text'} | ||
68 | ]}, | ||
69 | {tag:'div', cls:'open', children:[ | ||
70 | {tag:'span', children:[ | ||
71 | {tag:'a', href:'open', id:this.getId('open'), html:' '} | ||
72 | ]} | ||
73 | ]}, | ||
74 | {tag:'div', cls:'edit', children:[ | ||
75 | {tag:'span', children:[ | ||
76 | {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"} | ||
77 | ]} | ||
78 | ]}, | ||
79 | {tag:'div', cls:'delete', children:[ | ||
80 | {tag:'span', children:[ | ||
81 | {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"} | ||
82 | ]} | ||
83 | ]} | ||
84 | /* | ||
85 | {tag:'td', cls:'fieldState'}, | ||
86 | {tag:'td', cls:'fieldLabel', children:[ | ||
87 | {tag:'input', cls:'label', id:this.getId('label')} | ||
88 | ]}, | ||
89 | {tag:'td', cls:'fieldLock', children:[ | ||
90 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | ||
91 | ]}, | ||
92 | {tag:'td', cls:'fieldValue', children:[ | ||
93 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | ||
94 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | ||
95 | ]} | ||
96 | ]}, | ||
97 | {tag:'td', cls:'fieldAddDelete', children:[ | ||
98 | {tag:'div', cls:'delete', children:[ | ||
99 | {tag:'span', children:[ | ||
100 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | ||
101 | ]} | ||
102 | ]} | ||
103 | ]} | ||
104 | */ | ||
105 | ]); | ||
106 | |||
107 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
108 | MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin'); | ||
109 | MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin'); | ||
110 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin'); | ||
111 | }, | ||
112 | |||
113 | //------------------------------------------------------------------------- | ||
114 | |||
115 | 'shouldShowElementWhileRendering': function () { | ||
116 | return false; | ||
117 | }, | ||
118 | |||
119 | //------------------------------------------------------------------------- | ||
120 | |||
121 | 'faviconComponent': function () { | ||
122 | if (this._faviconComponent == null) { | ||
123 | //console.log("created the FAVICON component"); | ||
124 | this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); | ||
125 | } | ||
126 | |||
127 | return this._faviconComponent; | ||
128 | }, | ||
129 | |||
130 | //========================================================================= | ||
131 | |||
132 | 'label': function () { | ||
133 | return this.getElement('label').value; | ||
134 | }, | ||
135 | |||
136 | 'setLabel': function (aValue) { | ||
137 | this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); | ||
138 | }, | ||
139 | |||
140 | //------------------------------------------------------------------------- | ||
141 | |||
142 | 'favicon': function () { | ||
143 | // return this.getElement('favicon').src; | ||
144 | return this.faviconComponent().src(); | ||
145 | }, | ||
146 | |||
147 | 'setFavicon': function (aValue) { | ||
148 | // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue); | ||
149 | this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue)); | ||
150 | }, | ||
151 | |||
152 | //========================================================================= | ||
153 | |||
154 | 'openDirectLogin': function (anEvent) { | ||
155 | anEvent.preventDefault(); | ||
156 | |||
157 | MochiKit.Signal.signal(this, 'openDirectLogin', this.reference()); | ||
158 | }, | ||
159 | |||
160 | //------------------------------------------------------------------------- | ||
161 | |||
162 | 'editDirectLogin': function (anEvent) { | ||
163 | anEvent.preventDefault(); | ||
164 | |||
165 | MochiKit.Signal.signal(this, 'editDirectLogin', this.reference()); | ||
166 | //console.log("EDIT DIRECT LOGIN"); | ||
167 | }, | ||
168 | |||
169 | //------------------------------------------------------------------------- | ||
170 | |||
171 | 'deleteDirectLogin': function (anEvent) { | ||
172 | anEvent.preventDefault(); | ||
173 | |||
174 | MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference()); | ||
175 | //console.log("DELETE DIRECT LOGIN"); | ||
176 | }, | ||
177 | |||
178 | |||
179 | |||
180 | //========================================================================= | ||
181 | __syntaxFix__: "syntax fix" | ||
182 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js new file mode 100644 index 0000000..c1a7c13 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js | |||
@@ -0,0 +1,190 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._actionType = null; | ||
38 | |||
39 | return this; | ||
40 | } | ||
41 | |||
42 | //============================================================================= | ||
43 | |||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
45 | |||
46 | //------------------------------------------------------------------------- | ||
47 | |||
48 | 'toString': function () { | ||
49 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; | ||
50 | }, | ||
51 | |||
52 | //------------------------------------------------------------------------- | ||
53 | |||
54 | 'renderSelf': function() { | ||
55 | this.append(this.element(), [ | ||
56 | {tag:'td', cls:'fieldState'}, | ||
57 | {tag:'td', cls:'fieldLabel', children:[ | ||
58 | {tag:'input', cls:'label', id:this.getId('label')} | ||
59 | ]}, | ||
60 | {tag:'td', cls:'fieldLock', children:[ | ||
61 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | ||
62 | ]}, | ||
63 | {tag:'td', cls:'fieldValue', children:[ | ||
64 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | ||
65 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | ||
66 | ]} | ||
67 | ]}, | ||
68 | {tag:'td', cls:'fieldAction', children:[ | ||
69 | {tag:'a', href:'#', id:this.getId('actionLink'), html:' '} | ||
70 | ]}, | ||
71 | {tag:'td', cls:'fieldAddDelete', children:[ | ||
72 | {tag:'div', cls:'delete', children:[ | ||
73 | {tag:'span', children:[ | ||
74 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | ||
75 | ]} | ||
76 | ]} | ||
77 | ]} | ||
78 | ]); | ||
79 | |||
80 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
81 | MochiKit.Signal.connect(this.getId('isHidden'), 'onclick',this, 'toggleIsHidden'); | ||
82 | MochiKit.Signal.connect(this.getId('value'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | ||
83 | MochiKit.Signal.connect(this.getId('actionLink'), 'onclick',this, 'handleActionLink'); | ||
84 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteField'); | ||
85 | // MochiKit.Signal.connect(this.getId('delete'), 'onclick',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'deleteField', this.reference())); | ||
86 | }, | ||
87 | |||
88 | //------------------------------------------------------------------------- | ||
89 | |||
90 | 'shouldShowElementWhileRendering': function () { | ||
91 | return false; | ||
92 | }, | ||
93 | |||
94 | //========================================================================= | ||
95 | |||
96 | 'reference': function () { | ||
97 | return this._reference; | ||
98 | }, | ||
99 | |||
100 | //========================================================================= | ||
101 | |||
102 | 'label': function () { | ||
103 | return this.getElement('label').value; | ||
104 | }, | ||
105 | |||
106 | 'setLabel': function (aValue) { | ||
107 | // this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); | ||
108 | this.getElement('label').value = aValue; | ||
109 | }, | ||
110 | |||
111 | //========================================================================= | ||
112 | |||
113 | 'value': function () { | ||
114 | return this.getElement('value').value; | ||
115 | }, | ||
116 | |||
117 | 'setValue': function (aValue) { | ||
118 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); | ||
119 | this.getElement('value').value = aValue; | ||
120 | }, | ||
121 | |||
122 | //------------------------------------------------------------------------- | ||
123 | |||
124 | 'actionType': function () { | ||
125 | return this._actionType; | ||
126 | }, | ||
127 | |||
128 | 'setActionType': function (anActionType) { | ||
129 | this._actionType = anActionType; | ||
130 | |||
131 | switch (this._actionType) { | ||
132 | case 'NONE': | ||
133 | MochiKit.Style.hideElement(this.getId('actionLink')); | ||
134 | MochiKit.DOM.setElementClass(this.getId('actionLink'), ''); | ||
135 | break; | ||
136 | case 'URL': | ||
137 | MochiKit.Style.showElement(this.getId('actionLink')); | ||
138 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'url'); | ||
139 | break; | ||
140 | case 'EMAIL': | ||
141 | MochiKit.Style.showElement(this.getId('actionLink')); | ||
142 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'email'); | ||
143 | break; | ||
144 | case 'PASSWORD': | ||
145 | MochiKit.Style.showElement(this.getId('actionLink')); | ||
146 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'password'); | ||
147 | break; | ||
148 | } | ||
149 | }, | ||
150 | |||
151 | //========================================================================= | ||
152 | |||
153 | 'isHidden': function () { | ||
154 | // return this.getElement('value').value; | ||
155 | return MochiKit.DOM.hasElementClass(this.getElement('isHidden'), 'locked'); | ||
156 | }, | ||
157 | |||
158 | 'setIsHidden': function (aValue) { | ||
159 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); | ||
160 | MochiKit.DOM.setElementClass(this.getElement('isHidden'), (aValue ? 'locked': 'unlocked')); | ||
161 | MochiKit.DOM.setElementClass(this.getElement('valueWrapper'), (aValue ? 'locked': 'unlocked')); | ||
162 | }, | ||
163 | |||
164 | 'toggleIsHidden': function (anEvent) { | ||
165 | anEvent.preventDefault(); | ||
166 | |||
167 | this.setIsHidden(! this.isHidden()); | ||
168 | MochiKit.Signal.signal(this, 'changedValue'); | ||
169 | }, | ||
170 | |||
171 | //========================================================================= | ||
172 | |||
173 | 'handleActionLink': function (anEvent) { | ||
174 | anEvent.preventDefault(); | ||
175 | |||
176 | //console.log("ACTION LINK - " + this.actionType()); | ||
177 | MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target()); | ||
178 | }, | ||
179 | |||
180 | //========================================================================= | ||
181 | |||
182 | 'deleteField': function (anEvent) { | ||
183 | anEvent.preventDefault(); | ||
184 | |||
185 | MochiKit.Signal.signal(this, 'deleteField', this.reference()); | ||
186 | }, | ||
187 | |||
188 | //========================================================================= | ||
189 | __syntaxFix__: "syntax fix" | ||
190 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js new file mode 100644 index 0000000..bfc7e61 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js | |||
@@ -0,0 +1,203 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.ColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.ColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | this._name = args.name || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | this._selector = args.selector|| Clipperz.Base.exception.raise('MandatoryParameter');; | ||
39 | this._label = args.label || null; | ||
40 | this._isSortable = args.sortable|| false; | ||
41 | this._comparator = args.comparator|| null; | ||
42 | this._sorted = args.sorted || 'UNSORTED'; //'ASCENDING' | 'DESCENDING' | 'UNSORTED' | ||
43 | this._cssClass = args.cssClass|| ''; | ||
44 | |||
45 | this._signalIdentifiers = []; | ||
46 | |||
47 | return this; | ||
48 | } | ||
49 | |||
50 | //============================================================================= | ||
51 | |||
52 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ColumnManager, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
53 | |||
54 | 'toString': function () { | ||
55 | return "Clipperz.PM.UI.Web.Components.ColumnManager - " + this._name; | ||
56 | }, | ||
57 | |||
58 | 'name': function () { | ||
59 | return this._name; | ||
60 | }, | ||
61 | |||
62 | 'label': function () { | ||
63 | return this._label; | ||
64 | }, | ||
65 | |||
66 | 'selector': function () { | ||
67 | return this._selector; | ||
68 | }, | ||
69 | |||
70 | 'comparator': function() { | ||
71 | return this._comparator; | ||
72 | }, | ||
73 | |||
74 | 'cssClass': function() { | ||
75 | return this._cssClass; | ||
76 | }, | ||
77 | |||
78 | //------------------------------------------------------------------------- | ||
79 | |||
80 | 'isSortable': function () { | ||
81 | return this._isSortable; | ||
82 | }, | ||
83 | |||
84 | //------------------------------------------------------------------------- | ||
85 | |||
86 | 'sorted': function () { | ||
87 | return this._sorted; | ||
88 | }, | ||
89 | |||
90 | 'isSorted': function () { | ||
91 | return (this.sorted() != 'UNSORTED'); | ||
92 | }, | ||
93 | |||
94 | 'setSorted': function(aValue) { | ||
95 | this._sorted = aValue; | ||
96 | this.updateSortIcon(); | ||
97 | }, | ||
98 | |||
99 | //------------------------------------------------------------------------- | ||
100 | |||
101 | 'signalIdentifiers': function () { | ||
102 | return this._signalIdentifiers; | ||
103 | }, | ||
104 | |||
105 | 'resetSignalIdentifiers': function () { | ||
106 | this._signalIdentifiers = []; | ||
107 | }, | ||
108 | |||
109 | //------------------------------------------------------------------------- | ||
110 | |||
111 | 'disconnectRowsSignals': function () { | ||
112 | MochiKit.Base.map(MochiKit.Signal.disconnect, this.signalIdentifiers()); | ||
113 | this.resetSignalIdentifiers(); | ||
114 | }, | ||
115 | |||
116 | 'connectEvent': function () { | ||
117 | var ident; | ||
118 | |||
119 | ident = MochiKit.Signal.connect.apply(null, arguments); | ||
120 | this.signalIdentifiers().push(ident); | ||
121 | }, | ||
122 | |||
123 | //------------------------------------------------------------------------- | ||
124 | |||
125 | 'renderHeader': function(aTRElement) { | ||
126 | varthElement; | ||
127 | |||
128 | thElement = Clipperz.DOM.Helper.append(aTRElement, {tag:'th', cls:(this.cssClass() + 'TH'), id:this.getId('sortLink'), children:[ | ||
129 | {tag:'span', html:this.label() ? this.label() : ' '} | ||
130 | ]}); | ||
131 | |||
132 | if (this.isSortable()) { | ||
133 | Clipperz.DOM.Helper.append(thElement, {tag:'span', cls:'sortable', children:[ | ||
134 | {tag:'a', href:'#'/*, id:this.getId('sortLink')*/, html:' '} | ||
135 | ]}); | ||
136 | |||
137 | MochiKit.DOM.addElementClass(thElement, 'sortable'); | ||
138 | MochiKit.Signal.connect(thElement, 'onclick', this, 'handleClickOnSortingCriteria'); | ||
139 | }; | ||
140 | |||
141 | this.updateSortIcon(); | ||
142 | }, | ||
143 | |||
144 | //------------------------------------------------------------------------- | ||
145 | |||
146 | 'toggleSorting': function () { | ||
147 | var result; | ||
148 | switch (this.sorted()) { | ||
149 | case 'UNSORTED': | ||
150 | result = 'ASCENDING'; | ||
151 | break; | ||
152 | case 'ASCENDING': | ||
153 | result = 'DESCENDING'; | ||
154 | break; | ||
155 | case 'DESCENDING': | ||
156 | result = 'ASCENDING'; | ||
157 | break; | ||
158 | default: | ||
159 | result = 'UNSORTED'; | ||
160 | break; | ||
161 | } | ||
162 | |||
163 | this.setSorted(result); | ||
164 | |||
165 | return result; | ||
166 | }, | ||
167 | |||
168 | //------------------------------------------------------------------------- | ||
169 | |||
170 | 'sortElementClass': function () { | ||
171 | return this.sorted().toLowerCase(); | ||
172 | }, | ||
173 | |||
174 | //------------------------------------------------------------------------- | ||
175 | |||
176 | 'updateSortIcon': function () { | ||
177 | if (this.isSortable()) { | ||
178 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'ascending'); | ||
179 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'descending'); | ||
180 | MochiKit.DOM.removeElementClass(this.getId('sortLink'), 'unsorted'); | ||
181 | |||
182 | MochiKit.DOM.addElementClass(this.getId('sortLink'), this.sortElementClass()); | ||
183 | } | ||
184 | }, | ||
185 | |||
186 | //------------------------------------------------------------------------- | ||
187 | |||
188 | 'renderCell': function(aRowElement, anObject) { | ||
189 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[{tag:'span', html:anObject[this.name()]}]}); | ||
190 | }, | ||
191 | |||
192 | //----------------------------------------------------- | ||
193 | |||
194 | 'handleClickOnSortingCriteria': function (anEvent) { | ||
195 | anEvent.preventDefault(); | ||
196 | MochiKit.Signal.signal(this, 'sort', this); | ||
197 | }, | ||
198 | |||
199 | //----------------------------------------------------- | ||
200 | '__syntax_fix__' : 'syntax fix' | ||
201 | |||
202 | }); | ||
203 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js new file mode 100644 index 0000000..61d6ead --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | return this; | ||
37 | } | ||
38 | |||
39 | //============================================================================= | ||
40 | |||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
42 | |||
43 | //------------------------------------------------------------------------- | ||
44 | |||
45 | 'toString': function () { | ||
46 | return "Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent component"; | ||
47 | }, | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'renderSelf': function() { | ||
52 | this.append(this.element(), [ | ||
53 | {tag:'div', cls:'createNewCardSplash', id:this.getId('button'), children:[ | ||
54 | {tag:'span', html:"Create New Card"} | ||
55 | ]} | ||
56 | ]); | ||
57 | |||
58 | MochiKit.Signal.connect(this.getElement('button'), 'onclick', this, 'handleClick'); | ||
59 | }, | ||
60 | |||
61 | //------------------------------------------------------------------------- | ||
62 | |||
63 | 'handleClick': function (anEvent) { | ||
64 | anEvent.preventDefault(); | ||
65 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'addCard', this.element()); | ||
66 | }, | ||
67 | |||
68 | //------------------------------------------------------------------------- | ||
69 | |||
70 | __syntaxFix__: "syntax fix" | ||
71 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js new file mode 100644 index 0000000..91d99e3 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js | |||
@@ -0,0 +1,111 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.DataPanel = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.DataPanel.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._initiallySelectedTab = args.selected || 'OFFLINE_COPY'; | ||
37 | this._tabPanelControllerConfiguration = { | ||
38 | 'OFFLINE_COPY': { | ||
39 | tab:'offlineCopyTab', | ||
40 | panel:'offlineCopyPanel' | ||
41 | }, | ||
42 | 'SHARING': { | ||
43 | tab:'sharingTab', | ||
44 | panel:'sharingPanel' | ||
45 | }, | ||
46 | 'IMPORT': { | ||
47 | tab:'importTab', | ||
48 | panel:'importPanel' | ||
49 | }, | ||
50 | 'EXPORT': { | ||
51 | tab:'exportTab', | ||
52 | panel:'exportPanel' | ||
53 | } | ||
54 | }; | ||
55 | |||
56 | return this; | ||
57 | } | ||
58 | |||
59 | //============================================================================= | ||
60 | |||
61 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DataPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | ||
62 | |||
63 | //------------------------------------------------------------------------- | ||
64 | |||
65 | 'toString': function () { | ||
66 | return "Clipperz.PM.UI.Web.Components.DataPanel component"; | ||
67 | }, | ||
68 | |||
69 | //------------------------------------------------------------------------- | ||
70 | |||
71 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
72 | this.append(this.element(), [ | ||
73 | {tag:'div', cls:'header', children:[ | ||
74 | {tag:'div', cls:'subPanelTabs', children:[ | ||
75 | {tag:'ul', children:[ | ||
76 | {tag:'li', id:this.getId('offlineCopyTab'),children:[{tag:'a', href:'#', html:'Offline copy'}], cls:'first'}, | ||
77 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'a', href:'#', html:'Sharing'}]}, | ||
78 | {tag:'li', id:this.getId('importTab'), children:[{tag:'a', href:'#', html:'Import'}]}, | ||
79 | {tag:'li', id:this.getId('exportTab'), children:[{tag:'a', href:'#', html:'Export'}]} | ||
80 | ]} | ||
81 | ]} | ||
82 | ]}, | ||
83 | {tag:'div', cls:'body', children:[ | ||
84 | {tag:'div', cls:'accountPanel', children:[ | ||
85 | {tag:'div', cls:'subPanelContent', children:[ | ||
86 | {tag:'ul', children:[ | ||
87 | {tag:'li', id:this.getId('offlineCopyPanel'),children:[ | ||
88 | {tag:'h3', html:"Offline copy"} | ||
89 | ]}, | ||
90 | {tag:'li', id:this.getId('sharingPanel'),children:[ | ||
91 | {tag:'h3', html:"Sharing"} | ||
92 | ]}, | ||
93 | {tag:'li', id:this.getId('importPanel'), children:[ | ||
94 | {tag:'h3', html:"Import"} | ||
95 | ]}, | ||
96 | {tag:'li', id:this.getId('exportPanel'), children:[ | ||
97 | {tag:'h3', html:"Export"} | ||
98 | ]} | ||
99 | ]} | ||
100 | ]} | ||
101 | ]} | ||
102 | ]}, | ||
103 | {tag:'div', cls:'footer'} | ||
104 | ]); | ||
105 | |||
106 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); | ||
107 | }, | ||
108 | |||
109 | //------------------------------------------------------------------------- | ||
110 | __syntaxFix__: "syntax fix" | ||
111 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js new file mode 100644 index 0000000..3f8aa88 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.DateColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.DateColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | this._format = args.format|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | |||
39 | return this; | ||
40 | } | ||
41 | |||
42 | //============================================================================= | ||
43 | |||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DateColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | ||
45 | |||
46 | 'toString': function () { | ||
47 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | ||
48 | }, | ||
49 | |||
50 | //------------------------------------------------------------------------- | ||
51 | |||
52 | 'format': function () { | ||
53 | return this._format; | ||
54 | }, | ||
55 | |||
56 | //------------------------------------------------------------------------- | ||
57 | |||
58 | 'renderCell': function(aRowElement, anObject) { | ||
59 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | ||
60 | { | ||
61 | tag:'span', | ||
62 | title:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], "D, d M Y H:i:s"), | ||
63 | html:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], this.format()) | ||
64 | } | ||
65 | ]}); | ||
66 | }, | ||
67 | |||
68 | //----------------------------------------------------- | ||
69 | |||
70 | '__syntax_fix__' : 'syntax fix' | ||
71 | }); | ||
72 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js new file mode 100644 index 0000000..ee60f2f --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | return this; | ||
38 | } | ||
39 | |||
40 | //============================================================================= | ||
41 | |||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager, Clipperz.PM.UI.Web.Components.LinkColumnManager, { | ||
43 | |||
44 | 'toString': function () { | ||
45 | return "Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager component"; | ||
46 | }, | ||
47 | |||
48 | //------------------------------------------------------------------------- | ||
49 | |||
50 | 'renderCell': function(aRowElement, anObject) { | ||
51 | var tdElement; | ||
52 | var linkElement; | ||
53 | |||
54 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | ||
55 | {tag:'div', cls:'delete', children:[ | ||
56 | {tag:'span', children:[ | ||
57 | {tag:'a', href:'delete', html:"delete"} | ||
58 | ]} | ||
59 | ]} | ||
60 | ]}); | ||
61 | |||
62 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | ||
63 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | ||
64 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | ||
65 | }, | ||
66 | |||
67 | //----------------------------------------------------- | ||
68 | '__syntax_fix__' : 'syntax fix' | ||
69 | }); | ||
70 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js new file mode 100644 index 0000000..4bf9020 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js | |||
@@ -0,0 +1,90 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | /* | ||
30 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
31 | |||
32 | //############################################################################# | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager = function(args) { | ||
35 | args = args || {}; | ||
36 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager.superclass.constructor.call(this, args); | ||
37 | |||
38 | this._actionMethod = args.actionMethod || null; | ||
39 | |||
40 | return this; | ||
41 | } | ||
42 | |||
43 | //============================================================================= | ||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | ||
46 | |||
47 | 'toString': function () { | ||
48 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | ||
49 | }, | ||
50 | |||
51 | //------------------------------------------------------------------------- | ||
52 | |||
53 | 'actionMethod': function () { | ||
54 | return this._actionMethod; | ||
55 | }, | ||
56 | |||
57 | //------------------------------------------------------------------------- | ||
58 | |||
59 | 'renderCell': function(aRowElement, anObject) { | ||
60 | vartdElement; | ||
61 | varlinkElement; | ||
62 | |||
63 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | ||
64 | {tag:'div', cls:'directLogin_directLogin', children:[ | ||
65 | {tag:'div', cls:'directLogin_directLogin_body', children:[ | ||
66 | {tag:'a', href:'#', html:anObject[this.name()]} | ||
67 | ]} | ||
68 | ]} | ||
69 | ]}); | ||
70 | |||
71 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | ||
72 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | ||
73 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | ||
74 | }, | ||
75 | |||
76 | //----------------------------------------------------- | ||
77 | |||
78 | 'handleLinkClick': function (anObject, anEvent) { | ||
79 | anEvent.preventDefault(); | ||
80 | |||
81 | if (this.actionMethod() != null) { | ||
82 | this.actionMethod()(anObject, anEvent); | ||
83 | } | ||
84 | }, | ||
85 | |||
86 | //----------------------------------------------------- | ||
87 | '__syntax_fix__' : 'syntax fix' | ||
88 | }); | ||
89 | |||
90 | */ \ No newline at end of file | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js new file mode 100644 index 0000000..9a9c0b2 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._fields = args.fields || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | this._initiallySelectedFieldKey = args.selectedFieldKey|| null; | ||
39 | |||
40 | return this; | ||
41 | } | ||
42 | |||
43 | //============================================================================= | ||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
46 | |||
47 | //------------------------------------------------------------------------- | ||
48 | |||
49 | 'toString': function () { | ||
50 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent component"; | ||
51 | }, | ||
52 | |||
53 | //------------------------------------------------------------------------- | ||
54 | |||
55 | 'formFieldName': function () { | ||
56 | return this._formFieldName; | ||
57 | }, | ||
58 | |||
59 | //------------------------------------------------------------------------- | ||
60 | |||
61 | 'fields': function () { | ||
62 | return this._fields; | ||
63 | }, | ||
64 | |||
65 | //------------------------------------------------------------------------- | ||
66 | |||
67 | 'selectedValue': function () { | ||
68 | var result; | ||
69 | |||
70 | result = this.getElement('select').value; | ||
71 | |||
72 | if (result == '---') { | ||
73 | result = null; | ||
74 | } | ||
75 | |||
76 | return result; | ||
77 | }, | ||
78 | |||
79 | 'initiallySelectedFieldKey': function () { | ||
80 | return this._initiallySelectedFieldKey; | ||
81 | }, | ||
82 | |||
83 | //========================================================================= | ||
84 | |||
85 | 'renderSelf': function() { | ||
86 | var initiallySelectedOptions; | ||
87 | |||
88 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'binding', children:[ | ||
89 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, | ||
90 | {tag:'span', cls:'fieldLock', id:this.getId('isHidden'), children:[ | ||
91 | {tag:'a', href:'#', id:this.getId('showHide'), html:' '} | ||
92 | ]}, | ||
93 | {tag:'input', id:this.getId('input'), cls:'formFieldExampleValue', disabled:true, value:''}, | ||
94 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: | ||
95 | MochiKit.Base.flattenArguments( | ||
96 | {tag:'option', value:'---', html:"---"}, | ||
97 | MochiKit.Base.map( | ||
98 | MochiKit.Base.bind(function (aField) { return {tag:'option', value:aField['reference'], html:aField['label']}; }, this), | ||
99 | this.fields() | ||
100 | ) | ||
101 | ) | ||
102 | } | ||
103 | ]}); | ||
104 | |||
105 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); | ||
106 | MochiKit.Signal.connect(this.getElement('showHide'), 'onclick', this, 'handleShowHide'); | ||
107 | |||
108 | if (! MochiKit.Base.isUndefinedOrNull(this.initiallySelectedFieldKey())) { | ||
109 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initiallySelectedFieldKey() + ']']); | ||
110 | if (initiallySelectedOptions.length == 1) { | ||
111 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); | ||
112 | this.handleSelectChange(); | ||
113 | } | ||
114 | } | ||
115 | }, | ||
116 | |||
117 | //------------------------------------------------------------------------- | ||
118 | |||
119 | 'setFieldValue': function (aValue) { | ||
120 | this.getElement('input').value = aValue; | ||
121 | }, | ||
122 | |||
123 | 'isHidden': function () { | ||
124 | return MochiKit.DOM.hasElementClass(this.getElement('div'), 'locked'); | ||
125 | }, | ||
126 | |||
127 | 'setIsHidden': function (aValue) { | ||
128 | if (aValue == true) { | ||
129 | MochiKit.DOM.addElementClass(this.getElement('div'), 'locked'); | ||
130 | MochiKit.DOM.addElementClass(this.getElement('div'), 'showLocked'); | ||
131 | } else { | ||
132 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'locked'); | ||
133 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'showLocked'); | ||
134 | } | ||
135 | }, | ||
136 | |||
137 | 'isShowLocked': function () { | ||
138 | return MochiKit.DOM.hasElementClass(this.getElement('div'), 'showLocked'); | ||
139 | }, | ||
140 | |||
141 | //------------------------------------------------------------------------- | ||
142 | |||
143 | 'handleSelectChange': function (anEvent) { | ||
144 | // this.getElement('input').value = this.valueOfField(anEvent.src().value); | ||
145 | MochiKit.Signal.signal(this, 'bindChange', this); | ||
146 | }, | ||
147 | |||
148 | 'handleShowHide': function (anEvent) { | ||
149 | anEvent.preventDefault(); | ||
150 | |||
151 | if (this.isShowLocked()) { | ||
152 | MochiKit.DOM.removeElementClass(this.getElement('div'), 'showLocked'); | ||
153 | } else { | ||
154 | MochiKit.DOM.addElementClass(this.getElement('div'), 'showLocked'); | ||
155 | } | ||
156 | }, | ||
157 | |||
158 | //========================================================================= | ||
159 | __syntaxFix__: "syntax fix" | ||
160 | }); | ||
161 | |||
162 | |||
163 | |||
164 | |||
165 | |||
166 | |||
167 | |||
168 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js new file mode 100644 index 0000000..d254c29 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js | |||
@@ -0,0 +1,481 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._tabPanelController = null; | ||
37 | |||
38 | this._initiallySelectedTab = args.selected || 'TYPE'; | ||
39 | this._tabPanelControllerConfiguration = { | ||
40 | 'LABEL': { | ||
41 | tab:'labelTab', | ||
42 | panel:'labelTabpanel' | ||
43 | }, | ||
44 | 'TYPE': { | ||
45 | tab:'typeTab', | ||
46 | panel:'typeTabpanel' | ||
47 | }, | ||
48 | 'CONFIGURATION': { | ||
49 | tab:'configurationTab', | ||
50 | panel:'configurationTabpanel' | ||
51 | }, | ||
52 | 'BINDINGS': { | ||
53 | tab:'bindingsTab', | ||
54 | panel:'bindingsTabpanel' | ||
55 | }, | ||
56 | 'FAVICON': { | ||
57 | tab:'faviconTab', | ||
58 | panel:'faviconTabpanel' | ||
59 | }, | ||
60 | 'DONE': { | ||
61 | tab:'doneTab', | ||
62 | panel:'doneTabpanel' | ||
63 | } | ||
64 | }; | ||
65 | |||
66 | this._directLoginReference = null; | ||
67 | |||
68 | this._directLoginFavicon = null; | ||
69 | |||
70 | this._updateFaviconCounter = 0; | ||
71 | this._faviconComponent = null; | ||
72 | |||
73 | this._bindingComponents= []; | ||
74 | this._formValueComponents = []; | ||
75 | |||
76 | return this; | ||
77 | } | ||
78 | |||
79 | //============================================================================= | ||
80 | |||
81 | //Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
82 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | ||
83 | |||
84 | //------------------------------------------------------------------------- | ||
85 | |||
86 | 'toString': function () { | ||
87 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component"; | ||
88 | }, | ||
89 | |||
90 | //========================================================================= | ||
91 | |||
92 | 'directLoginReference': function () { | ||
93 | return this._directLoginReference; | ||
94 | }, | ||
95 | |||
96 | //------------------------------------------------------------------------- | ||
97 | |||
98 | 'setDirectLoginReference': function (aDirectLoginReference) { | ||
99 | this._directLoginReference = aDirectLoginReference; | ||
100 | |||
101 | return this._directLoginReference; | ||
102 | }, | ||
103 | |||
104 | //========================================================================= | ||
105 | |||
106 | 'label': function () { | ||
107 | return this.getElement('label').value | ||
108 | }, | ||
109 | |||
110 | 'setLabel': function (aValue) { | ||
111 | //console.log("##> LABEL: " + aValue); | ||
112 | this.getElement('label').value = (aValue ? aValue : ''); | ||
113 | }, | ||
114 | |||
115 | //------------------------------------------------------------------------- | ||
116 | |||
117 | 'favicon': function () { | ||
118 | return this.getElement('faviconURL').value; | ||
119 | }, | ||
120 | |||
121 | 'setFavicon': function (aValue) { | ||
122 | var regexp; | ||
123 | var displayValue; | ||
124 | |||
125 | regexp = new RegExp('^data\:\/\/.*', 'i'); | ||
126 | if (regexp.test(aValue)) { | ||
127 | displayValue = '' | ||
128 | } else { | ||
129 | displayValue = (aValue ? aValue : ''); | ||
130 | } | ||
131 | |||
132 | this.getElement('faviconURL').value = displayValue; | ||
133 | this.faviconComponent().setSrc(aValue); | ||
134 | }, | ||
135 | |||
136 | //'setFaviconData': function (aValue) { | ||
137 | // this.getElement('faviconIcon').src = aValue; | ||
138 | //}, | ||
139 | |||
140 | 'directLoginFavicon': function () { | ||
141 | return this._directLoginFavicon; | ||
142 | }, | ||
143 | |||
144 | 'setDirectLoginFavicon': function (aValue) { | ||
145 | this._directLoginFavicon = aValue; | ||
146 | this.setFavicon(aValue); | ||
147 | }, | ||
148 | |||
149 | //------------------------------------------------------------------------- | ||
150 | |||
151 | 'bookmarkletConfiguration': function () { | ||
152 | return this.getElement('bookmarkletConfiguration').value | ||
153 | }, | ||
154 | |||
155 | 'setBookmarkletConfiguration': function (aValue) { | ||
156 | this.getElement('bookmarkletConfiguration').value = aValue; | ||
157 | }, | ||
158 | |||
159 | 'highlightConfigurationSyntaxError': function () { | ||
160 | MochiKit.DOM.addElementClass(this.getElement('bookmarkletConfiguration'), 'error'); | ||
161 | }, | ||
162 | |||
163 | 'removeHighlightConfigurationSyntaxError': function () { | ||
164 | MochiKit.DOM.removeElementClass(this.getElement('bookmarkletConfiguration'), 'error'); | ||
165 | }, | ||
166 | |||
167 | //========================================================================= | ||
168 | |||
169 | 'disableAllPanels': function () { | ||
170 | this.getElement('label').disabled = true; | ||
171 | MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); | ||
172 | |||
173 | this.tabPanelController().selectTab(null); | ||
174 | }, | ||
175 | |||
176 | //------------------------------------------------------------------------- | ||
177 | |||
178 | //'disableLabelField': function () { | ||
179 | // this.getElement('label').disabled = true; | ||
180 | // MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); | ||
181 | //}, | ||
182 | |||
183 | 'enableLabelField': function () { | ||
184 | this.getElement('label').disabled = false; | ||
185 | MochiKit.DOM.removeElementClass(this.getElement('label').parentNode, 'disabled'); | ||
186 | this.tabPanelController().selectTab('LABEL'); | ||
187 | }, | ||
188 | |||
189 | //------------------------------------------------------------------------- | ||
190 | |||
191 | //'disableTypeField': function () { | ||
192 | // this.tabPanelController().selectTab(null); | ||
193 | //}, | ||
194 | |||
195 | 'enableTypeField': function () { | ||
196 | this.tabPanelController().selectTab('TYPE'); | ||
197 | }, | ||
198 | |||
199 | //------------------------------------------------------------------------- | ||
200 | |||
201 | //'disableConfigurationField': function () { | ||
202 | // this.tabPanelController().selectTab(null); | ||
203 | //}, | ||
204 | |||
205 | 'enableConfigurationField': function () { | ||
206 | this.tabPanelController().selectTab('CONFIGURATION'); | ||
207 | }, | ||
208 | |||
209 | //------------------------------------------------------------------------- | ||
210 | |||
211 | //'disableBindingFields': function () { | ||
212 | // this.tabPanelController().selectTab(null); | ||
213 | //}, | ||
214 | |||
215 | 'enableBindingFields': function () { | ||
216 | this.tabPanelController().selectTab('BINDINGS'); | ||
217 | }, | ||
218 | |||
219 | //------------------------------------------------------------------------- | ||
220 | |||
221 | //'disableFaviconField': function () { | ||
222 | // this.tabPanelController().selectTab(null); | ||
223 | //}, | ||
224 | |||
225 | 'enableFaviconField': function () { | ||
226 | this.tabPanelController().selectTab('FAVICON'); | ||
227 | }, | ||
228 | |||
229 | //------------------------------------------------------------------------- | ||
230 | |||
231 | 'enableDonePanel': function () { | ||
232 | this.tabPanelController().selectTab('DONE'); | ||
233 | }, | ||
234 | |||
235 | //========================================================================= | ||
236 | |||
237 | 'shouldShowElementWhileRendering': function() { | ||
238 | return false; | ||
239 | }, | ||
240 | |||
241 | //========================================================================= | ||
242 | |||
243 | 'faviconComponent': function () { | ||
244 | if (this._faviconComponent == null) { | ||
245 | this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); | ||
246 | } | ||
247 | |||
248 | return this._faviconComponent; | ||
249 | }, | ||
250 | |||
251 | //========================================================================= | ||
252 | |||
253 | 'tabPanelController': function () { | ||
254 | if (this._tabPanelController == null) { | ||
255 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ | ||
256 | component:this, | ||
257 | configuration:this._tabPanelControllerConfiguration | ||
258 | }); | ||
259 | |||
260 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') | ||
261 | } | ||
262 | |||
263 | return this._tabPanelController; | ||
264 | }, | ||
265 | |||
266 | //------------------------------------------------------------------------- | ||
267 | |||
268 | 'renderSelf': function() { | ||
269 | varbookmarkletComponent; | ||
270 | |||
271 | this.append(this.element(), {tag:'div', cls:'directLoginEditing', id:this.getId('panel'), children: [ | ||
272 | // {tag:'div', cls:'back', children:[ | ||
273 | // {tag:'a', href:'#', id:this.getId('back'), html:" "} | ||
274 | // ]}, | ||
275 | {tag:'form', id:this.getId('form'), cls:'directLoginEditingForm', children:[ | ||
276 | {tag:'div', cls:'title', children:[ | ||
277 | {tag:'img', id:this.getId('favicon'), cls:'favicon'}, | ||
278 | {tag:'input', type:'text', id:this.getId('label')}//, | ||
279 | // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.LABEL.description')}]}, | ||
280 | ]}, | ||
281 | {tag:'div', cls:'tabContainer', children:[ | ||
282 | {tag:'ul', cls:'tabs', children:[ | ||
283 | {tag:'li', id:this.getId('labelTab'), children:[{tag:'span', html:"label"}]}, | ||
284 | {tag:'li', id:this.getId('typeTab'), children:[{tag:'span', html:"type"}]}, | ||
285 | {tag:'li', id:this.getId('configurationTab'),children:[{tag:'span', html:"configuration"}]}, | ||
286 | {tag:'li', id:this.getId('bindingsTab'), children:[{tag:'span', html:"bindings"}]}, | ||
287 | {tag:'li', id:this.getId('faviconTab'), children:[{tag:'span', html:"favicon"}]}, | ||
288 | {tag:'li', id:this.getId('doneTab'), children:[{tag:'span', html:"done"}]} | ||
289 | ]}, | ||
290 | {tag:'ul', cls:'tabPanels', children:[ | ||
291 | {tag:'li', id:this.getId('labelTabpanel'), cls:'tabPanel label', children:[ | ||
292 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.LABEL.description')}]} | ||
293 | ]}, | ||
294 | {tag:'li', id:this.getId('typeTabpanel'), cls:'tabPanel type', children:[ | ||
295 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.TYPE.description')}]}, | ||
296 | {tag:'h2', html:"type"} | ||
297 | ]}, | ||
298 | {tag:'li', id:this.getId('configurationTabpanel'), cls:'tabPanel configuration', children:[ | ||
299 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.CONFIGURATION.description')}]}, | ||
300 | {tag:'div', cls:'bookmarkletConfigurationWrapper', children:[ | ||
301 | {tag:'textarea', id:this.getId('bookmarkletConfiguration'), value:""}, | ||
302 | // {tag:'div', cls:'bookmarkletComponentWrapper', children:[{tag:'div', id:this.getId('bookmarkletComponent'), cls:'bookmarkletComponent'}]} | ||
303 | {tag:'div', id:this.getId('bookmarkletComponent'), cls:'bookmarkletComponent'} | ||
304 | ]} | ||
305 | ]}, | ||
306 | {tag:'li', id:this.getId('bindingsTabpanel'), cls:'tabPanel bindings', children:[ | ||
307 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.BINDINGS.description')}]}, | ||
308 | {tag:'div', cls:'bindings', id:this.getId('bindings'), children:[]}, | ||
309 | {tag:'div', cls:'formValues', id:this.getId('formValues'), children:[]} | ||
310 | ]}, | ||
311 | {tag:'li', id:this.getId('faviconTabpanel'), cls:'tabPanel favicon', children:[ | ||
312 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.FAVICON.description')}]}, | ||
313 | {tag:'div', cls:'favicon', children:[ | ||
314 | {tag:'input', type:'text', id:this.getId('faviconURL')} | ||
315 | ]} | ||
316 | ]}, | ||
317 | {tag:'li', id:this.getId('doneTabpanel'), cls:'tabPanel done', children:[ | ||
318 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', id:this.getId('doneDescription')/*, html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.DONE.description')*/}]} | ||
319 | ]} | ||
320 | ]} | ||
321 | ]} | ||
322 | ]}, | ||
323 | {tag:'div', cls:'clear'} | ||
324 | ]}); | ||
325 | |||
326 | bookmarkletComponent = new Clipperz.PM.UI.Web.Components.BookmarkletComponent({element:this.getElement('bookmarkletComponent')}); | ||
327 | bookmarkletComponent.render(); | ||
328 | |||
329 | this.tabPanelController().setup(/*{selected:this.initiallySelectedTab()}*/); | ||
330 | |||
331 | MochiKit.Signal.connect(this.getId('label'), 'onchange', this, 'changedValue'); | ||
332 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup', this, 'changedValue'); | ||
333 | |||
334 | MochiKit.Signal.connect(this.getId('bookmarkletConfiguration'),'onchange', this, 'changedValue'); | ||
335 | MochiKit.Signal.connect(this.getId('bookmarkletConfiguration'),'onkeyup', this, 'changedValue'); | ||
336 | |||
337 | MochiKit.Signal.connect(this.getId('faviconURL'), 'onchange', this, 'changedValue'); | ||
338 | MochiKit.Signal.connect(this.getId('faviconURL'), 'onkeyup', this, 'changedValue'); | ||
339 | |||
340 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown',this, 'handleKeyEvent'); | ||
341 | }, | ||
342 | |||
343 | //------------------------------------------------------------------------- | ||
344 | |||
345 | 'handleTabSelected': function (aSelectedTab) { | ||
346 | switch (aSelectedTab) { | ||
347 | case 'DETAILS': | ||
348 | break; | ||
349 | case 'DIRECT_LOGINS': | ||
350 | MochiKit.Style.hideElement(this.getElement('backToDirectLoginList')); | ||
351 | break; | ||
352 | case 'SHARING': | ||
353 | break; | ||
354 | } | ||
355 | }, | ||
356 | |||
357 | //========================================================================= | ||
358 | |||
359 | 'incrementUpdateFaviconCounter': function () { | ||
360 | this._updateFaviconCounter ++; | ||
361 | }, | ||
362 | |||
363 | 'decrementUpdateFaviconCounter': function () { | ||
364 | this._updateFaviconCounter --; | ||
365 | }, | ||
366 | |||
367 | 'updateFaviconCounter': function () { | ||
368 | return this._updateFaviconCounter; | ||
369 | }, | ||
370 | |||
371 | //------------------------------------------------------------------------- | ||
372 | |||
373 | 'updateFavicon': function () { | ||
374 | this.decrementUpdateFaviconCounter(); | ||
375 | |||
376 | if (this.updateFaviconCounter() == 0) { | ||
377 | this.setFavicon(this.favicon()); | ||
378 | } | ||
379 | }, | ||
380 | |||
381 | //========================================================================= | ||
382 | |||
383 | 'bindingComponents': function () { | ||
384 | return this._bindingComponents; | ||
385 | }, | ||
386 | |||
387 | 'clearAllBindingsComponents': function () { | ||
388 | MochiKit.Iter.forEach(this.bindingComponents(), MochiKit.Base.methodcaller('remove')); | ||
389 | this._bindingComponents = []; | ||
390 | this.getElement('bindings').innerHTML = ''; | ||
391 | }, | ||
392 | |||
393 | 'addBindingComponent': function (aBindingComponent) { | ||
394 | this.bindingComponents().push(aBindingComponent); | ||
395 | aBindingComponent.renderInNode(this.append(this.getElement('bindings'), {tag:'div'})); | ||
396 | }, | ||
397 | |||
398 | //========================================================================= | ||
399 | |||
400 | 'formValueComponents': function () { | ||
401 | return this._formValueComponents; | ||
402 | }, | ||
403 | |||
404 | 'clearAllFormValueComponents': function () { | ||
405 | MochiKit.Iter.forEach(this.formValueComponents(), MochiKit.Base.methodcaller('remove')); | ||
406 | this._formValueComponents = []; | ||
407 | this.getElement('formValues').innerHTML = ''; | ||
408 | }, | ||
409 | |||
410 | 'addFormValueComponent': function (aFormValueComponent) { | ||
411 | this.formValueComponents().push(aFormValueComponent); | ||
412 | aFormValueComponent.renderInNode(this.append(this.getElement('formValues'), {tag:'div'})); | ||
413 | }, | ||
414 | |||
415 | //========================================================================= | ||
416 | |||
417 | 'changedValue': function (anEvent) { | ||
418 | MochiKit.Signal.signal(this, 'changedValue', anEvent); | ||
419 | |||
420 | this.incrementUpdateFaviconCounter(); | ||
421 | MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon')); | ||
422 | }, | ||
423 | |||
424 | //------------------------------------------------------------------------- | ||
425 | |||
426 | 'handleBackClick': function (anEvent) { | ||
427 | anEvent.preventDefault(); | ||
428 | |||
429 | MochiKit.Signal.signal(this, 'back'); | ||
430 | }, | ||
431 | |||
432 | //========================================================================= | ||
433 | |||
434 | 'bottomMargin': function () { | ||
435 | returnMochiKit.Style.getElementPosition(this.element().parentNode)['y'] + | ||
436 | MochiKit.Style.getElementDimensions(this.element())['h']; | ||
437 | }, | ||
438 | |||
439 | //========================================================================= | ||
440 | |||
441 | 'focusOnLabelElement': function () { | ||
442 | this.getElement('label').focus(); | ||
443 | }, | ||
444 | |||
445 | 'focusOnBookmarkletConfigurationElement': function () { | ||
446 | this.getElement('bookmarkletConfiguration').focus(); | ||
447 | }, | ||
448 | |||
449 | 'focusOnFaviconElement': function () { | ||
450 | this.getElement('faviconURL').focus(); | ||
451 | }, | ||
452 | |||
453 | //========================================================================= | ||
454 | |||
455 | 'setDoneDescriptionWithKeys': function (someKeys) { | ||
456 | // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', id:this.getId('doneDescription')/*, html:Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.DONE.description')*/}]} | ||
457 | this.getElement('doneDescription').innerHTML = Clipperz.PM.Strings.getValue('Wizards.DirectLoginWizard.DONE.description', someKeys); | ||
458 | }, | ||
459 | |||
460 | //========================================================================= | ||
461 | |||
462 | 'handleKeyEvent': function (anEvent) { | ||
463 | MochiKit.Signal.signal(this, 'keyPressed', anEvent); | ||
464 | /* | ||
465 | if (anEvent.key().string == 'KEY_ENTER') { | ||
466 | if (anEvent.target().nodeName != 'TEXTAREA') { | ||
467 | MochiKit.Signal.signal(this, 'moveForward'); | ||
468 | anEvent.preventDefault(); | ||
469 | } | ||
470 | } else if (anEvent.key().string == 'KEY_TAB') { | ||
471 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { | ||
472 | MochiKit.Signal.signal(this, 'moveForward'); | ||
473 | anEvent.preventDefault(); | ||
474 | } | ||
475 | } | ||
476 | */ | ||
477 | }, | ||
478 | |||
479 | //========================================================================= | ||
480 | __syntaxFix__: "syntax fix" | ||
481 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js new file mode 100644 index 0000000..b91eb98 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js | |||
@@ -0,0 +1,179 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._fieldOptions = args.fieldOptions || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | this._initialValue = args.initialValue || null; | ||
39 | |||
40 | return this; | ||
41 | } | ||
42 | |||
43 | //============================================================================= | ||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
46 | |||
47 | //------------------------------------------------------------------------- | ||
48 | |||
49 | 'toString': function () { | ||
50 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent component"; | ||
51 | }, | ||
52 | |||
53 | //------------------------------------------------------------------------- | ||
54 | |||
55 | 'formFieldName': function () { | ||
56 | return this._formFieldName; | ||
57 | }, | ||
58 | |||
59 | //------------------------------------------------------------------------- | ||
60 | |||
61 | 'fieldOptions': function () { | ||
62 | return this._fieldOptions; | ||
63 | }, | ||
64 | |||
65 | 'fieldType': function () { | ||
66 | return this.fieldOptions()['type']; | ||
67 | }, | ||
68 | |||
69 | 'optionValues': function () { | ||
70 | return MochiKit.Base.map(function (anOptionValue) { | ||
71 | return { | ||
72 | 'label': anOptionValue['label'] || anOptionValue['value'], | ||
73 | 'value': anOptionValue['value'] | ||
74 | } | ||
75 | }, this.fieldOptions()['options']); | ||
76 | }, | ||
77 | |||
78 | //------------------------------------------------------------------------- | ||
79 | |||
80 | 'selectedValue': function () { | ||
81 | var result; | ||
82 | |||
83 | result = this.getElement('select').value; | ||
84 | |||
85 | if (result == '---') { | ||
86 | result = null; | ||
87 | } | ||
88 | |||
89 | return result; | ||
90 | }, | ||
91 | |||
92 | 'initialValue': function () { | ||
93 | return this._initialValue; | ||
94 | }, | ||
95 | |||
96 | //========================================================================= | ||
97 | |||
98 | 'renderSelf': function() { | ||
99 | //console.log(">>> DirectLoginEditingFormValueComponent.renderSelf"); | ||
100 | //console.log("FIELD OPTIONS", this.fieldOptions()); | ||
101 | //console.log("OPTION VALUES", this.optionValues()); | ||
102 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[ | ||
103 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, | ||
104 | {tag:'div', id:this.getId('values')} | ||
105 | ]}); | ||
106 | |||
107 | if ((this.fieldType() == 'radio') || (this.fieldType() == 'select')) { | ||
108 | this.append(this.getElement('values'), | ||
109 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: | ||
110 | MochiKit.Base.flattenArguments( | ||
111 | // {tag:'option', value:'---', html:"---"}, | ||
112 | MochiKit.Base.map( | ||
113 | MochiKit.Base.bind(function (aValue) { return {tag:'option', value:aValue['value'], html:aValue['label']}; }, this), | ||
114 | this.optionValues() | ||
115 | ) | ||
116 | ) | ||
117 | } | ||
118 | ); | ||
119 | |||
120 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); | ||
121 | |||
122 | if (! MochiKit.Base.isUndefinedOrNull(this.initialValue())) { | ||
123 | var initiallySelectedOptions; | ||
124 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initialValue() + ']']); | ||
125 | if (initiallySelectedOptions.length == 1) { | ||
126 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); | ||
127 | this.handleSelectChange(); | ||
128 | } else { | ||
129 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); | ||
130 | } | ||
131 | } else { | ||
132 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); | ||
133 | } | ||
134 | } else if (this.fieldType() == 'checkbox') { | ||
135 | this.append(this.getElement('values'), | ||
136 | {tag:'input', type:'checkbox', name:this.formFieldName(), id:this.getId('checkbox'), cls:'formFieldMatchinCardField'} | ||
137 | ); | ||
138 | |||
139 | MochiKit.Signal.connect(this.getElement('checkbox'), 'onchange', this, 'handleSelectChange'); | ||
140 | |||
141 | if (this.initialValue()) { | ||
142 | MochiKit.DOM.updateNodeAttributes(this.getElement('checkbox'), {checked:true}); | ||
143 | } | ||
144 | } else { | ||
145 | WTF = TODO; | ||
146 | } | ||
147 | //console.log("<<< DirectLoginEditingFormValueComponent.renderSelf"); | ||
148 | }, | ||
149 | |||
150 | //========================================================================= | ||
151 | |||
152 | 'handleSelectChange': function (anEvent) { | ||
153 | //console.log("handleSelectChange", anEvent, anEvent.src(), anEvent.src().value); | ||
154 | var options; | ||
155 | |||
156 | options = {}; | ||
157 | |||
158 | options['fieldName'] = this.formFieldName(); | ||
159 | |||
160 | if (this.fieldType() == 'checkbox') { | ||
161 | options['selectedValue'] = (this.getElement('checkbox').checked ? 1 : null); | ||
162 | } else { | ||
163 | options['selectedValue'] = this.selectedValue(); | ||
164 | } | ||
165 | |||
166 | MochiKit.Signal.signal(this, 'formValueChange', options); | ||
167 | }, | ||
168 | |||
169 | //========================================================================= | ||
170 | __syntaxFix__: "syntax fix" | ||
171 | }); | ||
172 | |||
173 | |||
174 | |||
175 | |||
176 | |||
177 | |||
178 | |||
179 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js new file mode 100644 index 0000000..1f49575 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js | |||
@@ -0,0 +1,271 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | this._enterLeaveCounter = 0; | ||
38 | this._selectedRowObject = null; | ||
39 | |||
40 | return this; | ||
41 | } | ||
42 | |||
43 | //============================================================================= | ||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | ||
46 | |||
47 | 'toString': function () { | ||
48 | return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; | ||
49 | }, | ||
50 | |||
51 | //------------------------------------------------------------------------- | ||
52 | |||
53 | 'renderHeader': function(aTRElement) { | ||
54 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.renderHeader.call(this, aTRElement); | ||
55 | |||
56 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, {tag:'div', cls:'DirectLoginListPopup', id:this.getId('DirectLoginListPopup'), children:[ | ||
57 | {tag:'div', cls:'DirectLoginListPopup_body', children:[ | ||
58 | {tag:'ul', id:this.getId('DirectLoginListPopup_list'), children:[ | ||
59 | // {tag:'li', children:[ | ||
60 | // {tag:'img', cls:'favicon', src:'http://www.microsoft.com/favicon.ico'}, | ||
61 | // {tag:'a', href:'#', html:"Google Mail"} | ||
62 | // ]}, | ||
63 | // ... | ||
64 | ]} | ||
65 | ]}, | ||
66 | {tag:'div', cls:'DirectLoginListPopup_footer'} | ||
67 | ]}); | ||
68 | |||
69 | MochiKit.Style.hideElement(this.getId('DirectLoginListPopup')); | ||
70 | |||
71 | //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'); | ||
73 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseleave', this, 'handleDirectLoginListPopupLeave'); | ||
74 | }, | ||
75 | |||
76 | //------------------------------------------------------------------------- | ||
77 | |||
78 | 'renderCell': function(aRowElement, anObject) { | ||
79 | var i,c; | ||
80 | var directLoginsInfo; | ||
81 | |||
82 | directLoginsInfo = anObject[this.name()]; | ||
83 | |||
84 | TDElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:'card_directLogins'}); | ||
85 | |||
86 | c = Math.min(2, directLoginsInfo.length); | ||
87 | for (i=0; i<c; i++) { | ||
88 | var elementID; | ||
89 | |||
90 | elementID = 'directLogin_' + directLoginsInfo[i]['_reference']; | ||
91 | |||
92 | Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin', children:[ | ||
93 | {tag:'div', cls:'card_directLogin_body', children:[ | ||
94 | {tag:'a', href:'#', id:elementID, html:directLoginsInfo[i]['label']} | ||
95 | ]} | ||
96 | ]}); | ||
97 | // 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'])); | ||
99 | } | ||
100 | |||
101 | if (directLoginsInfo.length > 2) { | ||
102 | var ellipsesElement; | ||
103 | |||
104 | ellipsesElement = Clipperz.DOM.Helper.append(TDElement, {tag:'div', cls:'card_directLogin_ellipses', children:[ | ||
105 | {tag:'div', cls:'card_directLogin_ellipses_body', children:[ | ||
106 | {tag:'span', html:'…'} | ||
107 | ]} | ||
108 | ]}); | ||
109 | |||
110 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseenter', MochiKit.Base.method(this, 'handleEllipsesEnter', anObject)); | ||
111 | /// MochiKit.Signal.connect(ellipsesElement, 'onmouseleave', MochiKit.Base.method(this, 'handleEllipsesLeave')); | ||
112 | // MochiKit.Signal.connect(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); | ||
113 | this.connectEvent(TDElement, 'onmouseleave', MochiKit.Base.method(this, 'handleTDLeave')); | ||
114 | } | ||
115 | // MochiKit.Signal.connect(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); | ||
116 | this.connectEvent(TDElement, 'onmouseenter', MochiKit.Base.method(this, 'handleTDEnter', anObject)); | ||
117 | |||
118 | }, | ||
119 | |||
120 | //========================================================================= | ||
121 | /* | ||
122 | 'handleEllipsesEnter': function (aRecordInfo, anEvent) { | ||
123 | this._enterLeaveCounter ++; | ||
124 | if (this._enterLeaveCounter > 2) { | ||
125 | this._enterLeaveCounter = 2; | ||
126 | } | ||
127 | |||
128 | if (this._enterLeaveCounter == 1) { | ||
129 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); | ||
130 | } | ||
131 | }, | ||
132 | |||
133 | 'handleEllipsesLeave': function (anEvent) { | ||
134 | this._enterLeaveCounter --; | ||
135 | |||
136 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { | ||
137 | if (this._enterLeaveCounter == 0) { | ||
138 | this.hideDirectLoginListPopup(); | ||
139 | } | ||
140 | }, this)) | ||
141 | }, | ||
142 | */ | ||
143 | //------------------------------------------------------------------------- | ||
144 | |||
145 | 'handleTDEnter': function (aRecordInfo, anEvent) { | ||
146 | if (MochiKit.Selector.findChildElements(anEvent.src(), ['div.card_directLogin_ellipses']).length > 0) { | ||
147 | this._enterLeaveCounter ++; | ||
148 | if (this._enterLeaveCounter > 2) { | ||
149 | this._enterLeaveCounter = 2; | ||
150 | } | ||
151 | |||
152 | if (this._enterLeaveCounter == 1) { | ||
153 | this.showDirectLoginListPopup(aRecordInfo, anEvent.src()); | ||
154 | } | ||
155 | } else { | ||
156 | if (this._selectedRowObject != null) { | ||
157 | this.hideDirectLoginListPopup(); | ||
158 | } | ||
159 | } | ||
160 | }, | ||
161 | |||
162 | 'handleTDLeave': function (anEvent) { | ||
163 | this._enterLeaveCounter --; | ||
164 | if (this._enterLeaveCounter < 0) { | ||
165 | this._enterLeaveCounter = 0; | ||
166 | } | ||
167 | |||
168 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { | ||
169 | if (this._enterLeaveCounter == 0) { | ||
170 | this.hideDirectLoginListPopup(); | ||
171 | } | ||
172 | }, this)) | ||
173 | }, | ||
174 | |||
175 | //------------------------------------------------------------------------- | ||
176 | |||
177 | 'handleDirectLoginListPopupEnter': function (anEvent) { | ||
178 | this._enterLeaveCounter ++; | ||
179 | if (this._enterLeaveCounter > 2) { | ||
180 | this._enterLeaveCounter = 2; | ||
181 | } | ||
182 | }, | ||
183 | |||
184 | 'handleDirectLoginListPopupLeave': function (anEvent) { | ||
185 | this._enterLeaveCounter --; | ||
186 | if (this._enterLeaveCounter < 0) { | ||
187 | this._enterLeaveCounter = 0; | ||
188 | } | ||
189 | |||
190 | MochiKit.Async.callLater(0.3, MochiKit.Base.bind(function () { | ||
191 | if (this._enterLeaveCounter == 0) { | ||
192 | this.hideDirectLoginListPopup(); | ||
193 | } | ||
194 | }, this)) | ||
195 | }, | ||
196 | |||
197 | //========================================================================= | ||
198 | |||
199 | 'showDirectLoginListPopup': function (aRecordInfo, anElement) { | ||
200 | var position; | ||
201 | var directLoginsInfo; | ||
202 | var directLoginsListElement; | ||
203 | var ellipsesElement; | ||
204 | |||
205 | |||
206 | ellipsesElement = MochiKit.Selector.findChildElements(anElement, ['div.card_directLogin_ellipses'])[0]; | ||
207 | position = MochiKit.Style.getElementPosition(ellipsesElement); | ||
208 | // position = MochiKit.Style.getElementPosition(anElement); | ||
209 | position.x += 14; | ||
210 | position.y -= 26; | ||
211 | |||
212 | MochiKit.Style.setElementPosition(this.getId('DirectLoginListPopup'), position /*[, units='px'] */); | ||
213 | |||
214 | directLoginsListElement = this.getElement('DirectLoginListPopup_list'); | ||
215 | directLoginsListElement.innerHTML = ''; | ||
216 | |||
217 | directLoginsInfo = aRecordInfo[this.name()]; | ||
218 | c = directLoginsInfo.length; | ||
219 | for (i=0; i<c; i++) { | ||
220 | varelementID; | ||
221 | varlabel; | ||
222 | var trunkedLabel; | ||
223 | |||
224 | label = directLoginsInfo[i]['label']; | ||
225 | trunkedLabel = (label.length > 20 ? label.slice(0,20) + '…' : label); | ||
226 | |||
227 | elementID = this.getId('directLoginList_' + directLoginsInfo[i]['_reference']); | ||
228 | |||
229 | Clipperz.DOM.Helper.append(directLoginsListElement, {tag:'li', children:[ | ||
230 | {tag:'div', children:[ | ||
231 | {tag:'img', cls:'favicon', src:directLoginsInfo[i]['favicon']}, | ||
232 | (label == trunkedLabel ? {tag:'a', href:'#', id:elementID, html:trunkedLabel} : {tag:'a', href:'#', id:elementID, title:label, html:trunkedLabel}) | ||
233 | ]} | ||
234 | ]}); | ||
235 | |||
236 | // MochiKit.Signal.connect(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); | ||
237 | this.connectEvent(elementID, 'onclick', MochiKit.Base.method(this, 'handleDirectLoginClick', directLoginsInfo[i]['_rowObject'])); | ||
238 | } | ||
239 | |||
240 | // MochiKit.Style.showElement(this.getId('DirectLoginListPopup')); | ||
241 | MochiKit.Visual.appear(this.getId('DirectLoginListPopup'), {duration:0.5}); | ||
242 | MochiKit.Signal.signal(this, 'selectRow', aRecordInfo); | ||
243 | |||
244 | this._selectedRowObject = aRecordInfo; | ||
245 | }, | ||
246 | |||
247 | //------------------------------------------------------------------------- | ||
248 | |||
249 | 'hideDirectLoginListPopup': function () { | ||
250 | if (this._selectedRowObject != null) { | ||
251 | MochiKit.Signal.signal(this, 'unselectRow', this._selectedRowObject); | ||
252 | MochiKit.Visual.fade(this.getId('DirectLoginListPopup'), {duration:0.5}); | ||
253 | this._selectedRowObject = null; | ||
254 | this._enterLeaveCounter = 0; | ||
255 | } | ||
256 | }, | ||
257 | |||
258 | //========================================================================= | ||
259 | |||
260 | 'handleDirectLoginClick': function (aDirectLogin, anEvent) { | ||
261 | anEvent.preventDefault(); | ||
262 | // aDirectLogin.runDirectLogin(); | ||
263 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin(aDirectLogin); | ||
264 | }, | ||
265 | |||
266 | //------------------------------------------------------------------------- | ||
267 | |||
268 | '__syntax_fix__' : 'syntax fix' | ||
269 | |||
270 | }); | ||
271 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js new file mode 100644 index 0000000..19d1635 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.FaviconColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.FaviconColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | return this; | ||
38 | } | ||
39 | |||
40 | //============================================================================= | ||
41 | |||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.FaviconColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | ||
43 | |||
44 | 'toString': function () { | ||
45 | return "Clipperz.PM.UI.Web.Components.FaviconColumnManager component"; | ||
46 | }, | ||
47 | |||
48 | //------------------------------------------------------------------------- | ||
49 | |||
50 | 'renderCell': function(aRowElement, anObject) { | ||
51 | varfaviconImageElement; | ||
52 | var faviconUrl; | ||
53 | |||
54 | faviconImageElement = this.getId('favicon'); | ||
55 | faviconUrl = anObject[this.name()]; | ||
56 | |||
57 | if (faviconUrl == null) { | ||
58 | faviconUrl = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | ||
59 | } | ||
60 | |||
61 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | ||
62 | {tag:'img', id:faviconImageElement, src:faviconUrl} | ||
63 | ]}); | ||
64 | |||
65 | MochiKit.Signal.connect(faviconImageElement, 'onload', this, 'handleLoadedFaviconImage'); | ||
66 | MochiKit.Signal.connect(faviconImageElement, 'onerror', this, 'handleMissingFaviconImage'); | ||
67 | MochiKit.Signal.connect(faviconImageElement, 'onabort', this, 'handleMissingFaviconImage'); | ||
68 | }, | ||
69 | |||
70 | //----------------------------------------------------- | ||
71 | |||
72 | 'handleLoadedFaviconImage': function(anEvent) { | ||
73 | MochiKit.Signal.disconnectAllTo(anEvent.src()); | ||
74 | if (anEvent.src().complete == false) { | ||
75 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | ||
76 | } | ||
77 | }, | ||
78 | |||
79 | //----------------------------------------------------- | ||
80 | |||
81 | 'handleMissingFaviconImage': function(anEvent) { | ||
82 | MochiKit.Signal.disconnectAllTo(anEvent.src()); | ||
83 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | ||
84 | }, | ||
85 | |||
86 | //----------------------------------------------------- | ||
87 | '__syntax_fix__' : 'syntax fix' | ||
88 | }); | ||
89 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js new file mode 100644 index 0000000..8b3e6c9 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js | |||
@@ -0,0 +1,262 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.GridComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._columnsManagers = args.columnsManagers; | ||
37 | |||
38 | this._rowsObjects = []; | ||
39 | this._noRowsGridComponent = null; | ||
40 | |||
41 | this._slots = { | ||
42 | 'headerSlot':this.getId('headerSlot') | ||
43 | }; | ||
44 | |||
45 | return this; | ||
46 | } | ||
47 | |||
48 | //============================================================================= | ||
49 | |||
50 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
51 | |||
52 | //------------------------------------------------------------------------- | ||
53 | |||
54 | 'toString': function () { | ||
55 | return "Clipperz.PM.UI.Web.Components.GridComponent component"; | ||
56 | }, | ||
57 | |||
58 | //------------------------------------------------------------------------- | ||
59 | |||
60 | 'rows': function () { | ||
61 | throw Clipperz.Base.exception.AbstractMethod; | ||
62 | // return this._rows; | ||
63 | }, | ||
64 | |||
65 | //------------------------------------------------------------------------- | ||
66 | |||
67 | 'columnsManagers': function () { | ||
68 | return this._columnsManagers; | ||
69 | }, | ||
70 | |||
71 | //------------------------------------------------------------------------- | ||
72 | |||
73 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
74 | this.append(this.element(), [ | ||
75 | {tag:'div', cls:'header', children:[ | ||
76 | {tag:'form', id:this.getId('searchForm'), cls:'search', children:[ | ||
77 | {tag:'div', cls:'search', children:[ | ||
78 | {tag:'input', type:'text', id:this.getId('search'), cls:'search', placeholder:"search", name:'textToSearch'/*, value:"clipperz"*/} | ||
79 | ]}, | ||
80 | {tag:'div', cls:'clearSearchButton', id:this.getId('clearSearch')}, | ||
81 | // {tag:'input', type:'button', cls:'searchButton', name:'searchButton', value:"search"}, | ||
82 | {tag:'div', cls:'headerSlot', id:this.getId('headerSlot')} | ||
83 | ]} | ||
84 | ]}, | ||
85 | {tag:'div', cls:'body', children:[ | ||
86 | {tag:'div', cls:'rows', id:this.getId('rows'), children:[ | ||
87 | {tag:'table', cellpadding:'0', cellspacing:'0', cls:'rows', children:[ | ||
88 | {tag:'thead', children:[ | ||
89 | {tag:'tr', id:this.getId('thead_tr'), children:[]} | ||
90 | ]}, | ||
91 | {tag:'tbody', id:this.getId('gridRows'), children:[]} | ||
92 | ]} | ||
93 | ]}, | ||
94 | {tag:'div', cls:'noRowsBlock', id:this.getId('noRowsBlock'), children:[]} | ||
95 | ]}, | ||
96 | {tag:'div', cls:'footer'} | ||
97 | ]); | ||
98 | |||
99 | this.renderHeader(); | ||
100 | MochiKit.Signal.connect(this.getId('clearSearch'), 'onclick', this, 'clearSearchHandler'); | ||
101 | }, | ||
102 | |||
103 | //------------------------------------------------------------------------- | ||
104 | |||
105 | 'renderHeader': function () { | ||
106 | var headerElement; | ||
107 | |||
108 | headerElement = this.getElement('thead_tr'); | ||
109 | headerElement.innerHTML = ""; | ||
110 | |||
111 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | ||
112 | aColumnManager.renderHeader(headerElement); | ||
113 | }); | ||
114 | }, | ||
115 | |||
116 | //------------------------------------------------------------------------- | ||
117 | |||
118 | 'update': function (someObjects) { | ||
119 | this._rowsObjects = someObjects | ||
120 | this.refresh(); | ||
121 | this.focus(); | ||
122 | }, | ||
123 | |||
124 | 'focus': function () { | ||
125 | this.getElement('search').focus(); | ||
126 | }, | ||
127 | |||
128 | //------------------------------------------------------------------------- | ||
129 | |||
130 | 'startSearch': function () { | ||
131 | //console.log("--> startSearch"); | ||
132 | MochiKit.DOM.addElementClass(this.getElement('search'), 'running'); | ||
133 | }, | ||
134 | |||
135 | 'endSearch': function () { | ||
136 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'running'); | ||
137 | //console.log("<-- startSearch"); | ||
138 | }, | ||
139 | |||
140 | //------------------------------------------------------------------------- | ||
141 | |||
142 | 'disconnectColumnManagersRowsSignals': function () { | ||
143 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | ||
144 | aColumnManager.disconnectRowsSignals(); | ||
145 | }); | ||
146 | }, | ||
147 | |||
148 | //------------------------------------------------------------------------- | ||
149 | |||
150 | 'refresh': function () { | ||
151 | var gridRowsElement; | ||
152 | var rowClass; | ||
153 | |||
154 | this.disconnectColumnManagersRowsSignals(); | ||
155 | |||
156 | { | ||
157 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'disabled'); | ||
158 | // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', null); | ||
159 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); | ||
160 | MochiKit.DOM.removeElementClass(this.element(), 'noRows'); | ||
161 | } | ||
162 | |||
163 | |||
164 | gridRowsElement = this.getElement('gridRows'); | ||
165 | gridRowsElement.innerHTML = ""; | ||
166 | |||
167 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); | ||
168 | |||
169 | rowClass = 'odd'; | ||
170 | MochiKit.Iter.forEach(this._rowsObjects, MochiKit.Base.bind(function (aRowObject) { | ||
171 | var cardRowElement; | ||
172 | |||
173 | cardRowElement = this.append(gridRowsElement, {tag:'tr', id:this.getId(aRowObject['_reference']), cls:rowClass}); | ||
174 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | ||
175 | aColumnManager.renderCell(cardRowElement, aRowObject); | ||
176 | }); | ||
177 | |||
178 | rowClass = (rowClass == 'odd') ? 'even' : 'odd'; | ||
179 | }, this)); | ||
180 | }, | ||
181 | |||
182 | //----------------------------------------------------------------------------- | ||
183 | |||
184 | 'filterElement': function () { | ||
185 | return this.getElement('search'); | ||
186 | }, | ||
187 | |||
188 | //------------------------------------------------------------------------- | ||
189 | |||
190 | 'shouldShowElementWhileRendering': function () { | ||
191 | return false; | ||
192 | }, | ||
193 | |||
194 | //------------------------------------------------------------------------- | ||
195 | |||
196 | 'selectRow': function (aRowObject) { | ||
197 | MochiKit.DOM.addElementClass(this.getId(aRowObject['_reference']), 'selected'); | ||
198 | }, | ||
199 | |||
200 | 'unselectRow': function (aRowObject) { | ||
201 | MochiKit.DOM.removeElementClass(this.getId(aRowObject['_reference']), 'selected'); | ||
202 | }, | ||
203 | |||
204 | //------------------------------------------------------------------------- | ||
205 | /* | ||
206 | 'passOpenDirectLogin': function(aDirectLoginReferenceId) { | ||
207 | MochiKit.Signal.signal(this, 'openDirectLogin', aDirectLoginReferenceId); | ||
208 | }, | ||
209 | */ | ||
210 | //------------------------------------------------------------------------- | ||
211 | |||
212 | 'clearSearchHandler': function (anEvent) { | ||
213 | var searchElement; | ||
214 | |||
215 | anEvent.preventDefault(); | ||
216 | |||
217 | searchElement = this.getElement('search'); | ||
218 | searchElement.value = ""; | ||
219 | searchElement.focus(); | ||
220 | }, | ||
221 | |||
222 | //------------------------------------------------------------------------- | ||
223 | |||
224 | 'drawEmpty': function () { | ||
225 | this.disconnectColumnManagersRowsSignals(); | ||
226 | MochiKit.DOM.addElementClass(this.getElement('search'), 'disabled'); | ||
227 | // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', 'disabled'); | ||
228 | |||
229 | gridRowsElement = this.getElement('gridRows'); | ||
230 | gridRowsElement.innerHTML = ""; | ||
231 | MochiKit.DOM.addElementClass(this.element(), 'empty'); | ||
232 | }, | ||
233 | |||
234 | //------------------------------------------------------------------------- | ||
235 | |||
236 | 'setNoRowsGridComponent': function (aComponent) { | ||
237 | this.removeNoRowsGridComponent(); | ||
238 | this._noRowsGridComponent = aComponent; | ||
239 | |||
240 | this.disconnectColumnManagersRowsSignals(); | ||
241 | MochiKit.DOM.addElementClass(this.getElement('search'), 'disabled'); | ||
242 | // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', 'disabled'); | ||
243 | |||
244 | gridRowsElement = this.getElement('gridRows'); | ||
245 | gridRowsElement.innerHTML = ""; | ||
246 | MochiKit.DOM.addElementClass(this.element(), 'noRows'); | ||
247 | |||
248 | if (aComponent != null) { | ||
249 | aComponent.renderInNode(this.getElement('noRowsBlock')); | ||
250 | } | ||
251 | }, | ||
252 | |||
253 | 'removeNoRowsGridComponent': function () { | ||
254 | if (this._noRowsGridComponent != null) { | ||
255 | this._noRowsGridComponent.remove(); | ||
256 | this._noRowsGridComponent = null; | ||
257 | } | ||
258 | }, | ||
259 | |||
260 | //------------------------------------------------------------------------- | ||
261 | __syntaxFix__: "syntax fix" | ||
262 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js new file mode 100644 index 0000000..07b8dcc --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.ImageColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.ImageColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | return this; | ||
38 | } | ||
39 | |||
40 | //============================================================================= | ||
41 | |||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ImageColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | ||
43 | |||
44 | 'toString': function () { | ||
45 | return "Clipperz.PM.UI.Web.Components.ImageColumnManager component"; | ||
46 | }, | ||
47 | |||
48 | //------------------------------------------------------------------------- | ||
49 | |||
50 | 'renderCell': function(aRowElement, anObject) { | ||
51 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | ||
52 | {tag:'img', src:anObject[this.name()]} | ||
53 | ]}); | ||
54 | |||
55 | // return Clipperz.Async.callbacks("ImageColumnManager.renderCell", [ | ||
56 | // this.selector(), | ||
57 | // MochiKit.Base.bind(function (aValue) { | ||
58 | // Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | ||
59 | // {tag:'img', src:aValue} | ||
60 | // ]}); | ||
61 | // }, this) | ||
62 | // ], {trace:false}, anObject); | ||
63 | }, | ||
64 | |||
65 | //----------------------------------------------------- | ||
66 | '__syntax_fix__' : 'syntax fix' | ||
67 | }); | ||
68 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js new file mode 100644 index 0000000..e833190 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js | |||
@@ -0,0 +1,92 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.LinkColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.LinkColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | this._actionMethod = args.actionMethod || null; | ||
38 | |||
39 | return this; | ||
40 | } | ||
41 | |||
42 | //============================================================================= | ||
43 | |||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LinkColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | ||
45 | |||
46 | 'toString': function () { | ||
47 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | ||
48 | }, | ||
49 | |||
50 | //------------------------------------------------------------------------- | ||
51 | |||
52 | 'actionMethod': function () { | ||
53 | return this._actionMethod; | ||
54 | }, | ||
55 | |||
56 | //------------------------------------------------------------------------- | ||
57 | |||
58 | 'renderCell': function(aRowElement, anObject) { | ||
59 | vartdElement; | ||
60 | varlinkElement; | ||
61 | |||
62 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | ||
63 | {tag:'span', children:[ | ||
64 | {tag:'a', href:'#', html:anObject[this.name()]} | ||
65 | ]} | ||
66 | ]}); | ||
67 | |||
68 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | ||
69 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | ||
70 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | ||
71 | }, | ||
72 | |||
73 | //----------------------------------------------------- | ||
74 | |||
75 | 'handleLinkClick': function (anObject, anEvent) { | ||
76 | anEvent.preventDefault(); | ||
77 | |||
78 | if (this.actionMethod() != null) { | ||
79 | var deferredResult; | ||
80 | |||
81 | deferredResult = new Clipperz.Async.Deferred("LinkColumnManager.handleLinkClick", {trace:false}); | ||
82 | // deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'selectRow', anObject); | ||
83 | deferredResult.addCallback(this.actionMethod(), anObject, anEvent); | ||
84 | // deferredResult.addBothPass(MochiKit.Signal.signal, this, 'unselectRow', anObject); | ||
85 | deferredResult.callback(); | ||
86 | } | ||
87 | }, | ||
88 | |||
89 | //----------------------------------------------------- | ||
90 | '__syntax_fix__' : 'syntax fix' | ||
91 | }); | ||
92 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js new file mode 100644 index 0000000..de20853 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js | |||
@@ -0,0 +1,203 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.LoginForm = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | this._autocomplete = args.autocomplete || 'off'; | ||
35 | |||
36 | Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); | ||
37 | |||
38 | this._slots = { | ||
39 | 'passphraseEntropy':this.getId('passphraseEntropy') | ||
40 | }; | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | //============================================================================= | ||
46 | |||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'toString': function () { | ||
52 | return "Clipperz.PM.UI.Web.Components.LoginForm component"; | ||
53 | }, | ||
54 | |||
55 | 'autocomplete': function () { | ||
56 | return this._autocomplete; | ||
57 | }, | ||
58 | |||
59 | //------------------------------------------------------------------------- | ||
60 | |||
61 | 'renderSelf': function() { | ||
62 | this.append(this.element(), {tag:'div', id:'loginBox', children:[ | ||
63 | {tag:'div', cls:'header'}, | ||
64 | {tag:'div', cls:'body', id:this.getId('body'), children:[ | ||
65 | {tag:'div', id:this.getId('loginForm'), children:[ | ||
66 | {tag:'div', children:[ | ||
67 | {tag:'h4', html:'Login'}, | ||
68 | // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ | ||
69 | {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ | ||
70 | {tag:'label', html:'username', 'for':this.getId('usernameField')}, | ||
71 | {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'/*, value:'joe'*/}, | ||
72 | {tag:'ul', id:this.getId('passwordOptions'), children:[ | ||
73 | {tag:'li', id:this.getId('passphraseOption'), children:[ | ||
74 | {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, | ||
75 | {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'/*, value:'clipperz'*/} | ||
76 | ]} //, | ||
77 | /* | ||
78 | {tag:'li', id:this.getId('otpOption'), children:[ | ||
79 | {tag:'label', html:'one-time password', 'for':this.getId('otpField_1')}, | ||
80 | {tag:'input', id:this.getId('otpField_1'), type:'text', cls:'otp', value:'abcd-efgh'}, | ||
81 | {tag:'input', id:this.getId('otpField_2'), type:'text', cls:'otp', value:'abcd-efgh'}, | ||
82 | {tag:'input', id:this.getId('otpField_3'), type:'text', cls:'otp', value:'abcd-efgh'}, | ||
83 | {tag:'input', id:this.getId('otpField_4'), type:'text', cls:'otp', value:'abcd-efgh'} | ||
84 | ]} | ||
85 | */ | ||
86 | ]}, | ||
87 | // {tag:'input', id:this.getId('otpCheckbox'), type:'checkbox', cls:'checkbox'}, | ||
88 | // {tag:'label', html:'use a one-time passphrase', 'for':this.getId('otpCheckbox'), cls:'checkbox'}, | ||
89 | |||
90 | {tag:'div', cls:'translations', children:[ | ||
91 | {tag:'h4', html:'choose your language'}, | ||
92 | {tag:'ul', children:[ | ||
93 | {tag:'li', cls:'selected', html:'english'}, | ||
94 | {tag:'li', html:'italiano'}, | ||
95 | {tag:'li', html:'dutch'}, | ||
96 | {tag:'li', html:'french'}, | ||
97 | {tag:'li', html:'spanish'}, | ||
98 | {tag:'li', html:'chinese'}, | ||
99 | {tag:'li', html:'japanese'}, | ||
100 | {tag:'li', html:'portugal'}, | ||
101 | {tag:'li', html:'arabic'} | ||
102 | ]} | ||
103 | ]}, | ||
104 | |||
105 | {tag:'input', id:this.getId('submitButton'), type:'submit', value:'login', cls:'submit'} | ||
106 | ]} | ||
107 | ]} | ||
108 | ]} | ||
109 | ]}, | ||
110 | {tag:'div', cls:'footer'} | ||
111 | ]}); | ||
112 | |||
113 | if (this.autocomplete() == 'off') { | ||
114 | MochiKit.DOM.updateNodeAttributes(this.getElement('form'), {autocomplete:'off'}); | ||
115 | } | ||
116 | |||
117 | // Clipperz.Style.setBackgroundGradient(this.getElement('body'), {from:"#ff9955", to:"#ff6622"}) | ||
118 | |||
119 | // this.setEntropyDisplay(new Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay(this.getElement('passphraseField'))); | ||
120 | |||
121 | // MochiKit.Signal.connect(this.getId('otpCheckbox'), 'onclick', this, 'togglePasswordFields'); | ||
122 | // this.showPassphraseField(); | ||
123 | |||
124 | this.getElement('usernameField').focus(); | ||
125 | |||
126 | MochiKit.Signal.connect(this.getElement('loginForm'), 'onsubmit', this, 'loginEventHandler'); | ||
127 | }, | ||
128 | |||
129 | //----------------------------------------------------------------------------- | ||
130 | /* | ||
131 | 'togglePasswordFields': function(anEvent) { | ||
132 | var shouldUseOTP; | ||
133 | |||
134 | shouldUseOTP = this.getElement('otpCheckbox').checked; | ||
135 | |||
136 | if (shouldUseOTP == false) { | ||
137 | this.showPassphraseField(); | ||
138 | } else { | ||
139 | this.showOTPFields(); | ||
140 | } | ||
141 | }, | ||
142 | */ | ||
143 | //----------------------------------------------------------------------------- | ||
144 | /* | ||
145 | 'showPassphraseField': function() { | ||
146 | this.showElement('passphraseOption'); | ||
147 | this.hideElement('otpOption'); | ||
148 | }, | ||
149 | */ | ||
150 | //----------------------------------------------------------------------------- | ||
151 | |||
152 | 'focusOnPassphraseField': function () { | ||
153 | this.getElement('passphraseField').focus(); | ||
154 | this.getElement('passphraseField').select(); | ||
155 | }, | ||
156 | |||
157 | //----------------------------------------------------------------------------- | ||
158 | /* | ||
159 | 'showOTPFields': function() { | ||
160 | this.hideElement('passphraseOption'); | ||
161 | this.showElement('otpOption'); | ||
162 | }, | ||
163 | */ | ||
164 | //------------------------------------------------------------------------- | ||
165 | |||
166 | 'loginEventHandler': function(anEvent) { | ||
167 | varusername; | ||
168 | var passphrase; | ||
169 | // var shouldUseOTP; | ||
170 | // var otp; | ||
171 | var signalArguments; | ||
172 | |||
173 | anEvent.preventDefault(); | ||
174 | |||
175 | username = this.getElement('usernameField').value; | ||
176 | passphrase = this.getElement('passphraseField').value; | ||
177 | // otp =this.getElement('otpField_1').value + | ||
178 | // this.getElement('otpField_2').value + | ||
179 | // this.getElement('otpField_3').value + | ||
180 | // this.getElement('otpField_4').value; | ||
181 | // shouldUseOTP = this.getElement('otpCheckbox').checked; | ||
182 | |||
183 | signalArguments = {username:username}; | ||
184 | |||
185 | // if (shouldUseOTP) { | ||
186 | // signalArguments.otp = otp; | ||
187 | // } else { | ||
188 | signalArguments.passphrase = passphrase; | ||
189 | // } | ||
190 | |||
191 | MochiKit.Signal.signal(this, 'doLogin', signalArguments); | ||
192 | }, | ||
193 | |||
194 | //------------------------------------------------------------------------- | ||
195 | |||
196 | 'submitButtonElement': function() { | ||
197 | return this.getElement('submitButton'); | ||
198 | }, | ||
199 | |||
200 | //------------------------------------------------------------------------- | ||
201 | |||
202 | __syntaxFix__: "syntax fix" | ||
203 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js new file mode 100644 index 0000000..49c030d --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js | |||
@@ -0,0 +1,206 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.LoginPage = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.LoginPage.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._slots = { | ||
37 | 'loginForm':this.getId('loginBoxSlot') | ||
38 | }; | ||
39 | |||
40 | return this; | ||
41 | } | ||
42 | |||
43 | //============================================================================= | ||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginPage, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
46 | |||
47 | //------------------------------------------------------------------------- | ||
48 | |||
49 | 'toString': function () { | ||
50 | return "Clipperz.PM.UI.Web.Components.LoginPage component"; | ||
51 | }, | ||
52 | |||
53 | //------------------------------------------------------------------------- | ||
54 | |||
55 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
56 | this.append(this.element(), [ | ||
57 | {tag:'div', id:this.getId('loginBoxSlot')}, | ||
58 | {tag:'div', id:'main', children:[ | ||
59 | {tag:'div', id:'featurePoints', children:[ | ||
60 | {tag:'table', children:[ | ||
61 | {tag:'tr', children:[ | ||
62 | {tag:'td', children:[ | ||
63 | {tag:'div', cls:'block', children:[ | ||
64 | {tag:'h3', html:'Clipperz is:'}, | ||
65 | {tag:'ul', children:[ | ||
66 | {tag:'li', html:'a secure and simple password manager'}, | ||
67 | {tag:'li', html:'an effective single sign-on solution'}, | ||
68 | {tag:'li', html:'a digital vault for your personal data'} | ||
69 | ]} | ||
70 | ]}, | ||
71 | {tag:'div', cls:'block', children:[ | ||
72 | {tag:'h3', html:'Clipperz benefits:'}, | ||
73 | {tag:'ul', children:[ | ||
74 | {tag:'li', html:'free and completely anonymous'}, | ||
75 | {tag:'li', html:'access it any time from any computer'}, | ||
76 | {tag:'li', html:'no software to download and nothing to install'}, | ||
77 | {tag:'li', html:'avoid keeping secrets on your PC or on paper'} | ||
78 | ]} | ||
79 | ]} | ||
80 | ]}, {tag:'td', children:[ | ||
81 | {tag:'div', cls:'block', children:[ | ||
82 | {tag:'h3', html:'Clipperz security:'}, | ||
83 | {tag:'ul', children:[ | ||
84 | {tag:'li', html:'your secretes are locally encrypted by your browser before being uploaded to Clipperz'}, | ||
85 | {tag:'li', html:'the encryption key is a passphrase known only to you'}, | ||
86 | {tag:'li', html:'Clipperz hosts your sensitive data in an encrypted form and could never access the data in its plain form'}, | ||
87 | {tag:'li', html:'Clipperz is built upon standard encryption schemes, nothing fancies of homemade'}, | ||
88 | {tag:'li', html:'you can review the source code anytime you like, but you need to know nothing about cryptography to be an happy user!'} | ||
89 | ]} | ||
90 | ]} | ||
91 | ]} | ||
92 | ]} | ||
93 | ]} | ||
94 | ]}, | ||
95 | {tag:'div', cls:'activeFeatures', children:[ | ||
96 | {tag:'div', id:this.getId('registerButton'), cls:'createAccountLink', children:[ | ||
97 | {tag:'canvas', id:this.getId('registerButtonIcon')}, | ||
98 | {tag:'a', href:'#', id:this.getId('createAccountLink'), cls:'createAccountLink', children:[ | ||
99 | {tag:'span', cls:'payoff', html:"Free sign up!"}, | ||
100 | {tag:'span', cls:'link', html:"Create account >>"} | ||
101 | ]} | ||
102 | ]}, | ||
103 | {tag:'div', cls:'keepTogether', children:[ | ||
104 | {tag:'div', id:this.getId('screenshotLink'), cls:'screenshotLink', children:[ | ||
105 | {tag:'canvas', id:this.getId('lookIcon')}, | ||
106 | {tag:'a', href:'#', cls:'screenshotLink', children:[ | ||
107 | {tag:'span', cls:'payoff', html:"Look Clipperz!"}, | ||
108 | {tag:'span', cls:'link', html:"screenshot tour >>"} | ||
109 | ]} | ||
110 | ]}, | ||
111 | {tag:'div', id:this.getId('offlineLink'), cls:'offlineLink', children:[ | ||
112 | {tag:'canvas', id:this.getId('downloadIcon')}, | ||
113 | {tag:'a', href:'#', cls:'offlineLink', children:[ | ||
114 | {tag:'span', cls:'payoff', html:"Download!"}, | ||
115 | {tag:'span', cls:'link', html:"Offline version >>"} | ||
116 | ]} | ||
117 | ]} | ||
118 | ]} | ||
119 | ]} | ||
120 | ]} | ||
121 | ]); | ||
122 | |||
123 | this.setRegistrationButtonIconDefaultColors(); | ||
124 | this.setLookIconDefaultColors(); | ||
125 | this.setDownloadIconDefaultColors(); | ||
126 | |||
127 | // MochiKit.Signal.connect(this.getElement('createAccountLink'), 'onclick', this, 'handleCreateAccountLink') | ||
128 | |||
129 | MochiKit.Signal.connect(this.getElement('registerButton'), 'onmouseenter', this, 'handleMouseEnterOnRegisterButtonIcon'); | ||
130 | MochiKit.Signal.connect(this.getElement('registerButton'), 'onmouseleave', this, 'handleMouseLeaveOnRegisterButtonIcon'); | ||
131 | |||
132 | MochiKit.Signal.connect(this.getElement('screenshotLink'), 'onmouseenter', this, 'handleMouseEnterOnLookIcon'); | ||
133 | MochiKit.Signal.connect(this.getElement('screenshotLink'), 'onmouseleave', this, 'handleMouseLeaveOnLookIcon'); | ||
134 | |||
135 | MochiKit.Signal.connect(this.getElement('offlineLink'), 'onmouseenter', this, 'handleMouseEnterOnDownloadIcon'); | ||
136 | MochiKit.Signal.connect(this.getElement('offlineLink'), 'onmouseleave', this, 'handleMouseLeaveOnDownloadIcon'); | ||
137 | |||
138 | MochiKit.Signal.connect(this.getElement('createAccountLink'), 'onclick', this, 'handleCreateAccountLink') | ||
139 | }, | ||
140 | |||
141 | //------------------------------------------------------------------------- | ||
142 | |||
143 | 'setRegistrationButtonIconDefaultColors': function () { | ||
144 | Clipperz.PM.UI.Canvas.registerButton.normal(this.getElement('registerButtonIcon'), "#eeeeee", "#eeeeee", "#ecab12", "#e14624", "#ffffff"); | ||
145 | }, | ||
146 | |||
147 | 'setRegistrationButtonIconHoverColors': function () { | ||
148 | Clipperz.PM.UI.Canvas.registerButton.normal(this.getElement('registerButtonIcon'), "#cccccc", "#999999", "#ffb710", "#ff4d27", "#ffffff"); | ||
149 | }, | ||
150 | |||
151 | 'handleMouseEnterOnRegisterButtonIcon': function (anEvent) { | ||
152 | this.setRegistrationButtonIconHoverColors(); | ||
153 | }, | ||
154 | |||
155 | 'handleMouseLeaveOnRegisterButtonIcon': function (anEvent) { | ||
156 | this.setRegistrationButtonIconDefaultColors(); | ||
157 | }, | ||
158 | |||
159 | //------------------------------------------------------------------------- | ||
160 | |||
161 | 'setLookIconDefaultColors': function () { | ||
162 | Clipperz.PM.UI.Canvas.coverActions.look(this.getElement('lookIcon'), "#7e7e7e", "#ffffff", 1); | ||
163 | }, | ||
164 | |||
165 | 'setLookIconHoverColors': function () { | ||
166 | Clipperz.PM.UI.Canvas.coverActions.look(this.getElement('lookIcon'), "#666666", "#ffffff", 2); | ||
167 | }, | ||
168 | |||
169 | 'handleMouseEnterOnLookIcon': function (anEvent) { | ||
170 | this.setLookIconHoverColors(); | ||
171 | }, | ||
172 | |||
173 | 'handleMouseLeaveOnLookIcon': function (anEvent) { | ||
174 | this.setLookIconDefaultColors(); | ||
175 | }, | ||
176 | |||
177 | //------------------------------------------------------------------------- | ||
178 | |||
179 | 'setDownloadIconDefaultColors': function () { | ||
180 | Clipperz.PM.UI.Canvas.coverActions.download(this.getElement('downloadIcon'), "#7e7e7e", "#ffffff", 1); | ||
181 | }, | ||
182 | |||
183 | 'setDownloadIconHoverColors': function () { | ||
184 | Clipperz.PM.UI.Canvas.coverActions.download(this.getElement('downloadIcon'), "#666666", "#ffffff", 2); | ||
185 | }, | ||
186 | |||
187 | 'handleMouseEnterOnDownloadIcon': function (anEvent) { | ||
188 | this.setDownloadIconHoverColors(); | ||
189 | }, | ||
190 | |||
191 | 'handleMouseLeaveOnDownloadIcon': function (anEvent) { | ||
192 | this.setDownloadIconDefaultColors(); | ||
193 | }, | ||
194 | |||
195 | //------------------------------------------------------------------------- | ||
196 | |||
197 | 'handleCreateAccountLink': function (anEvent) { | ||
198 | anEvent.preventDefault(); | ||
199 | |||
200 | MochiKit.Signal.signal(this, 'createNewAccountClick', anEvent.src()); | ||
201 | }, | ||
202 | |||
203 | //------------------------------------------------------------------------- | ||
204 | |||
205 | __syntaxFix__: "syntax fix" | ||
206 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js new file mode 100644 index 0000000..03c7b9e --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.LoginProgress = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._deferred = null; | ||
37 | |||
38 | return this; | ||
39 | } | ||
40 | |||
41 | //============================================================================= | ||
42 | |||
43 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
44 | |||
45 | //------------------------------------------------------------------------- | ||
46 | |||
47 | 'toString': function () { | ||
48 | return "Clipperz.PM.UI.Web.Components.LoginProgress component"; | ||
49 | }, | ||
50 | |||
51 | //------------------------------------------------------------------------- | ||
52 | |||
53 | 'deferred': function() { | ||
54 | return this._deferred; | ||
55 | }, | ||
56 | |||
57 | 'setDeferred': function(aValue) { | ||
58 | this._deferred = aValue; | ||
59 | }, | ||
60 | |||
61 | //------------------------------------------------------------------------- | ||
62 | |||
63 | 'renderSelf': function() { | ||
64 | // var loginProgressElement; | ||
65 | // | ||
66 | // loginProgressElement = MochiKit.DOM.getElement('loginProgress'); | ||
67 | // | ||
68 | // if (loginProgressElement == null) { | ||
69 | // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true); | ||
70 | // } | ||
71 | |||
72 | //console.log(">> LoginProgress.renderSelf", this.element()); | ||
73 | this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [ | ||
74 | // this.append(loginProgressElement, [ | ||
75 | {tag:'div', cls:'header', children:[ | ||
76 | {tag:'h3', id:this.getId('title'), html:"login progress"} | ||
77 | ]}, | ||
78 | {tag:'div', cls:'body', children:[ | ||
79 | {tag:'div', id:this.getId('progressBar')}, | ||
80 | {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[ | ||
81 | // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]}, | ||
82 | {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]}, | ||
83 | {tag:'p', html:"Login failed"} | ||
84 | ]} | ||
85 | ]}, | ||
86 | {tag:'div', cls:'footer', children:[ | ||
87 | {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[ | ||
88 | {tag:'div', cls:'button', id:this.getId('button'), children:[ | ||
89 | {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} | ||
90 | ]} | ||
91 | ]} | ||
92 | ]} | ||
93 | ]}); | ||
94 | // ]); | ||
95 | |||
96 | Clipperz.PM.UI.Canvas.marks['!'](this.getElement('canvas'), "#ffffff"); | ||
97 | |||
98 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | ||
99 | MochiKit.Style.hideElement(this.getElement('errorBox')); | ||
100 | |||
101 | MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler'); | ||
102 | }, | ||
103 | |||
104 | //------------------------------------------------------------------------- | ||
105 | |||
106 | 'displayElement': function() { | ||
107 | return MochiKit.DOM.getElement('loginProgress'); | ||
108 | }, | ||
109 | |||
110 | //------------------------------------------------------------------------- | ||
111 | |||
112 | 'cancelEventHandler': function(anEvent) { | ||
113 | anEvent.preventDefault(); | ||
114 | |||
115 | MochiKit.Signal.signal(this, 'cancelEvent'); | ||
116 | }, | ||
117 | |||
118 | //------------------------------------------------------------------------- | ||
119 | |||
120 | 'disableCancel': function() { | ||
121 | MochiKit.Style.hideElement(this.getElement('buttonArea')); | ||
122 | }, | ||
123 | |||
124 | //------------------------------------------------------------------------- | ||
125 | |||
126 | 'showErrorMessage': function() { | ||
127 | this.getElement('buttonLink').innerHTML = "close"; | ||
128 | |||
129 | MochiKit.Style.hideElement(this.getElement('progressBar')); | ||
130 | |||
131 | this.getElement('title').innerHTML = "Error"; | ||
132 | MochiKit.Style.showElement(this.getElement('errorBox')); | ||
133 | MochiKit.Style.showElement(this.getElement('buttonArea')); | ||
134 | }, | ||
135 | |||
136 | //------------------------------------------------------------------------- | ||
137 | |||
138 | 'deferredHideModalAndRemove': function(someParameters, aResult) { | ||
139 | vardeferredResult; | ||
140 | |||
141 | deferredResult = new Clipperz.Async.Deferred("LoginProgress.deferredHideModalAndRemove", {trace:false}); | ||
142 | deferredResult.addMethod(this, 'deferredHideModal'); | ||
143 | deferredResult.addMethod(this, 'remove'); | ||
144 | deferredResult.addCallback(function () { | ||
145 | return aResult; | ||
146 | }); | ||
147 | deferredResult.callback(someParameters); | ||
148 | |||
149 | return deferredResult; | ||
150 | }, | ||
151 | |||
152 | //------------------------------------------------------------------------- | ||
153 | |||
154 | __syntaxFix__: "syntax fix" | ||
155 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js new file mode 100644 index 0000000..b40d1f3 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js | |||
@@ -0,0 +1,430 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._tabPanelController = null; | ||
37 | |||
38 | this._initiallySelectedTab = args.selected || 'CREDENTIALS'; | ||
39 | this._tabPanelControllerConfiguration = { | ||
40 | 'CREDENTIALS': { | ||
41 | tab:'credentialsTab', | ||
42 | panel:'credentialsTabpanel' | ||
43 | }, | ||
44 | 'CHECK_CREDENTIALS': { | ||
45 | tab:'checkCredentialsTab', | ||
46 | panel:'checkCredentialsTabpanel' | ||
47 | }, | ||
48 | 'TERMS_OF_SERVICE': { | ||
49 | tab:'termsOfServiceTab', | ||
50 | panel:'termsOfServiceTabpanel' | ||
51 | }, | ||
52 | 'CREATE_USER': { | ||
53 | tab:'createUserTab', | ||
54 | panel:'createUserTabpanel' | ||
55 | }//, | ||
56 | /* | ||
57 | 'LOGIN': { | ||
58 | tab:'loginTab', | ||
59 | panel:'loginTabpanel' | ||
60 | } | ||
61 | */ | ||
62 | }; | ||
63 | |||
64 | return this; | ||
65 | } | ||
66 | |||
67 | //============================================================================= | ||
68 | |||
69 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | ||
70 | |||
71 | //------------------------------------------------------------------------- | ||
72 | |||
73 | 'toString': function () { | ||
74 | return "Clipperz.PM.UI.Web.Components.NewUserCreationComponent component"; | ||
75 | }, | ||
76 | |||
77 | //========================================================================= | ||
78 | |||
79 | 'disableAllPanels': function () { | ||
80 | this.tabPanelController().selectTab(null); | ||
81 | }, | ||
82 | |||
83 | //------------------------------------------------------------------------- | ||
84 | |||
85 | 'enableCredentialsPanel': function () { | ||
86 | this.tabPanelController().selectTab('CREDENTIALS'); | ||
87 | }, | ||
88 | |||
89 | 'enableCheckCredentialsPanel': function () { | ||
90 | this.tabPanelController().selectTab('CHECK_CREDENTIALS'); | ||
91 | }, | ||
92 | |||
93 | 'enableTermsOfServicePanel': function () { | ||
94 | this.tabPanelController().selectTab('TERMS_OF_SERVICE'); | ||
95 | }, | ||
96 | |||
97 | 'enableCreateUserPanel': function () { | ||
98 | this.tabPanelController().selectTab('CREATE_USER'); | ||
99 | }, | ||
100 | |||
101 | //'enableLoginPanel': function () { | ||
102 | // this.tabPanelController().selectTab('LOGIN'); | ||
103 | //}, | ||
104 | |||
105 | //========================================================================= | ||
106 | |||
107 | 'shouldShowElementWhileRendering': function() { | ||
108 | return false; | ||
109 | }, | ||
110 | |||
111 | //========================================================================= | ||
112 | |||
113 | 'tabPanelController': function () { | ||
114 | if (this._tabPanelController == null) { | ||
115 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ | ||
116 | component:this, | ||
117 | configuration:this._tabPanelControllerConfiguration | ||
118 | }); | ||
119 | |||
120 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') | ||
121 | } | ||
122 | |||
123 | return this._tabPanelController; | ||
124 | }, | ||
125 | |||
126 | //------------------------------------------------------------------------- | ||
127 | |||
128 | 'renderSelf': function() { | ||
129 | //console.log('** Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition)); | ||
130 | |||
131 | this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [ | ||
132 | {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[ | ||
133 | {tag:'div', cls:'header', children:[ | ||
134 | {tag:'div', cls:'title', children:[ | ||
135 | {tag:'h3', id:this.getId('title'), html:"Create new user"} | ||
136 | ]} | ||
137 | ]}, | ||
138 | {tag:'div', id:this.getId('body'), cls:'body', children:[ | ||
139 | {tag:'div', cls:'tabContainer', children:[ | ||
140 | {tag:'ul', cls:'tabs', children:[ | ||
141 | {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]}, | ||
142 | {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]}, | ||
143 | {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]}, | ||
144 | {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//, | ||
145 | // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]}, | ||
146 | ]}, | ||
147 | {tag:'ul', cls:'tabPanels', children:[ | ||
148 | {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[ | ||
149 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]}, | ||
150 | {tag:'ul', cls:'credentials', children:[ | ||
151 | {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]}, | ||
152 | {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]} | ||
153 | ]} | ||
154 | ]}, | ||
155 | {tag:'li', id:this.getId('checkCredentialsTabpanel'), cls:'tabPanel checkCredentials', children:[ | ||
156 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CHECK_CREDENTIALS.description')}]}, | ||
157 | {tag:'ul', cls:'credentials', children:[ | ||
158 | {tag:'li', children:[{tag:'span', cls:'label', html:"re-passphrase"},{tag:'input', type:'password', id:this.getId('re-passphrase')/*, value:'test'*/}]} | ||
159 | ]} | ||
160 | ]}, | ||
161 | {tag:'li', id:this.getId('termsOfServiceTabpanel'), cls:'tabPanel termsOfService', children:[ | ||
162 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.TERMS_OF_SERVICE.description')}]}, | ||
163 | {tag:'ul', cls:'termsOfService', children:[ | ||
164 | {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('awareOfUnrecoverablePassphrase')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('awareOfUnrecoverablePassphrase'), html:"I understand that Clipperz will not be able to recover a lost passphrase."}]}, | ||
165 | {tag:'li', children:[{tag:'input', type:'checkbox', id:this.getId('readTermsOfService')/*, checked:true*/}, {tag:'label', cls:'label', 'for':this.getId('readTermsOfService'), htmlString:"I have read and agreed to the <a href='http://www.clipperz.com/terms_of_service' target='_blank'>Terms of Service</a>."}]} | ||
166 | ]} | ||
167 | ]}, | ||
168 | {tag:'li', id:this.getId('createUserTabpanel'), cls:'tabPanel createUser', children:[ | ||
169 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREATE_USER.description')}]}, | ||
170 | {tag:'ul', cls:'createUserStates', children:[ | ||
171 | {tag:'li', cls:'creating', id:this.getId('creatingRegistering'), children:[{tag:'span', html:"registering user"}]}, | ||
172 | {tag:'li', cls:'done', id:this.getId('creatingDone'), children:[{tag:'span', html:"done"}]}, | ||
173 | {tag:'li', cls:'fail', id:this.getId('creatingFailed'), children:[{tag:'span', html:"fail"}]} | ||
174 | ]} | ||
175 | ]}//, | ||
176 | // {tag:'li', id:this.getId('loginTabpanel'), cls:'tabPanel login', children:[ | ||
177 | // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.LOGIN.description')}]}, | ||
178 | // ]} | ||
179 | ]} | ||
180 | ]} | ||
181 | ]}, | ||
182 | {tag:'div', id:this.getId('footer'), cls:'footer', children:[ | ||
183 | {tag:'div', cls:'buttonArea', children:[ | ||
184 | // {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, | ||
185 | // {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} | ||
186 | ]} | ||
187 | ]} | ||
188 | ]}, | ||
189 | {tag:'div', cls:'clear'} | ||
190 | ]}); | ||
191 | |||
192 | this.tabPanelController().setup(); | ||
193 | // MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'handleKeyEvent'); | ||
194 | MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown', this, 'handleKeyEvent'); | ||
195 | MochiKit.Signal.connect(this.getId('awareOfUnrecoverablePassphrase'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); | ||
196 | MochiKit.Signal.connect(this.getId('readTermsOfService'), 'onchange', this, 'handleTermsOfServiceCheckboxChange'); | ||
197 | }, | ||
198 | |||
199 | //------------------------------------------------------------------------- | ||
200 | /* | ||
201 | 'resetContent': function () { | ||
202 | this.getElement('username').value = ''; | ||
203 | this.getElement('passphrase').value = ''; | ||
204 | }, | ||
205 | */ | ||
206 | //------------------------------------------------------------------------- | ||
207 | |||
208 | 'displayElement': function() { | ||
209 | return this.getElement('panel'); | ||
210 | }, | ||
211 | |||
212 | //------------------------------------------------------------------------- | ||
213 | |||
214 | 'handleTabSelected': function (aSelectedTab) { | ||
215 | /* | ||
216 | switch (aSelectedTab) { | ||
217 | case 'DETAILS': | ||
218 | break; | ||
219 | case 'DIRECT_LOGINS': | ||
220 | MochiKit.Style.hideElement(this.getElement('backToDirectLoginList')); | ||
221 | break; | ||
222 | case 'SHARING': | ||
223 | break; | ||
224 | } | ||
225 | */ | ||
226 | }, | ||
227 | |||
228 | //========================================================================= | ||
229 | |||
230 | 'username': function () { | ||
231 | return this.getElement('username').value; | ||
232 | }, | ||
233 | |||
234 | 'usernameElement': function () { | ||
235 | return this.getElement('username'); | ||
236 | }, | ||
237 | |||
238 | 'passphrase': function () { | ||
239 | return this.getElement('passphrase').value; | ||
240 | }, | ||
241 | |||
242 | 'rePassphrase': function () { | ||
243 | return this.getElement('re-passphrase').value; | ||
244 | }, | ||
245 | |||
246 | 'awareOfUnrecoverablePassphrase': function () { | ||
247 | return this.getElement('awareOfUnrecoverablePassphrase').value; | ||
248 | }, | ||
249 | |||
250 | 'readTermsOfService': function () { | ||
251 | return this.getElement('readTermsOfService').value; | ||
252 | }, | ||
253 | |||
254 | //========================================================================= | ||
255 | /* | ||
256 | 'incrementUpdateFaviconCounter': function () { | ||
257 | this._updateFaviconCounter ++; | ||
258 | }, | ||
259 | |||
260 | 'decrementUpdateFaviconCounter': function () { | ||
261 | this._updateFaviconCounter --; | ||
262 | }, | ||
263 | |||
264 | 'updateFaviconCounter': function () { | ||
265 | return this._updateFaviconCounter; | ||
266 | }, | ||
267 | */ | ||
268 | //------------------------------------------------------------------------- | ||
269 | /* | ||
270 | 'updateFavicon': function () { | ||
271 | this.decrementUpdateFaviconCounter(); | ||
272 | |||
273 | if (this.updateFaviconCounter() == 0) { | ||
274 | this.setFavicon(this.favicon()); | ||
275 | } | ||
276 | }, | ||
277 | */ | ||
278 | //========================================================================= | ||
279 | /* | ||
280 | 'bindingComponents': function () { | ||
281 | return this._bindingComponents; | ||
282 | }, | ||
283 | |||
284 | 'clearAllBindingsComponents': function () { | ||
285 | MochiKit.Iter.forEach(this.bindingComponents(), MochiKit.Base.methodcaller('remove')); | ||
286 | this._bindingComponents = []; | ||
287 | this.getElement('bindings').innerHTML = ''; | ||
288 | }, | ||
289 | |||
290 | 'addBindingComponent': function (aBindingComponent) { | ||
291 | this.bindingComponents().push(aBindingComponent); | ||
292 | aBindingComponent.renderInNode(this.append(this.getElement('bindings'), {tag:'div'})); | ||
293 | }, | ||
294 | */ | ||
295 | //========================================================================= | ||
296 | /* | ||
297 | 'formValueComponents': function () { | ||
298 | return this._formValueComponents; | ||
299 | }, | ||
300 | |||
301 | 'clearAllFormValueComponents': function () { | ||
302 | MochiKit.Iter.forEach(this.formValueComponents(), MochiKit.Base.methodcaller('remove')); | ||
303 | this._formValueComponents = []; | ||
304 | this.getElement('formValues').innerHTML = ''; | ||
305 | }, | ||
306 | |||
307 | 'addFormValueComponent': function (aFormValueComponent) { | ||
308 | this.formValueComponents().push(aFormValueComponent); | ||
309 | aFormValueComponent.renderInNode(this.append(this.getElement('formValues'), {tag:'div'})); | ||
310 | }, | ||
311 | */ | ||
312 | //========================================================================= | ||
313 | |||
314 | 'changedValue': function (anEvent) { | ||
315 | MochiKit.Signal.signal(this, 'changedValue', anEvent); | ||
316 | |||
317 | this.incrementUpdateFaviconCounter(); | ||
318 | MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon')); | ||
319 | }, | ||
320 | |||
321 | //------------------------------------------------------------------------- | ||
322 | |||
323 | 'handleBackClick': function (anEvent) { | ||
324 | anEvent.preventDefault(); | ||
325 | |||
326 | MochiKit.Signal.signal(this, 'back'); | ||
327 | }, | ||
328 | |||
329 | //========================================================================= | ||
330 | |||
331 | 'bottomMargin': function () { | ||
332 | var result; | ||
333 | |||
334 | //TODO: WTF!!! | ||
335 | // result =MochiKit.Style.getElementPosition(this.element())['y'] + | ||
336 | // MochiKit.Style.getElementDimensions(this.element())['h']; | ||
337 | |||
338 | // result =MochiKit.Style.getElementPosition(this.getElement('footer'))['y']; | ||
339 | //console.log("### bottomMargin"); | ||
340 | //console.log('displayElement', this.displayElement()); | ||
341 | //console.log('-- Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition)); | ||
342 | //console.log('element', MochiKit.Style.getElementPosition('modalDialog') ['y'], MochiKit.Style.getElementDimensions('modalDialog')['h']); | ||
343 | // result = 450; | ||
344 | |||
345 | result =Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] + | ||
346 | Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['dimensions']['h'] - | ||
347 | 60; | ||
348 | |||
349 | return result; | ||
350 | }, | ||
351 | |||
352 | //========================================================================= | ||
353 | |||
354 | 'focusOnUsernameElement': function () { | ||
355 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('username'), 'focus')); | ||
356 | }, | ||
357 | |||
358 | 'focusOnRePassphraseElement': function () { | ||
359 | this.getElement('re-passphrase').focus(); | ||
360 | }, | ||
361 | /* | ||
362 | 'focusOnBookmarkletConfigurationElement': function () { | ||
363 | this.getElement('bookmarkletConfiguration').focus(); | ||
364 | }, | ||
365 | |||
366 | 'focusOnFaviconElement': function () { | ||
367 | this.getElement('faviconURL').focus(); | ||
368 | }, | ||
369 | */ | ||
370 | |||
371 | //========================================================================= | ||
372 | |||
373 | 'hideAllProgeressStates': function () { | ||
374 | MochiKit.Style.hideElement(this.getElement('creatingRegistering')); | ||
375 | MochiKit.Style.hideElement(this.getElement('creatingDone')); | ||
376 | MochiKit.Style.hideElement(this.getElement('creatingFailed')); | ||
377 | }, | ||
378 | |||
379 | 'showProgressOnUserCreation': function () { | ||
380 | //Clipperz.log(">>> NewUserCreationComponent.showProgressOnUserCreation"); | ||
381 | this.hideAllProgeressStates(); | ||
382 | MochiKit.Style.showElement(this.getElement('creatingRegistering')); | ||
383 | }, | ||
384 | |||
385 | 'showUserCreationDone': function () { | ||
386 | //Clipperz.log(">>> NewUserCreationComponent.showUserCreationDone"); | ||
387 | this.hideAllProgeressStates(); | ||
388 | MochiKit.Style.showElement(this.getElement('creatingDone')); | ||
389 | //Clipperz.log("<<< NewUserCreationComponent.showUserCreationDone"); | ||
390 | }, | ||
391 | |||
392 | 'showUserCreationFailed': function () { | ||
393 | //Clipperz.log(">>> NewUserCreationComponent.showUserCreationFailed"); | ||
394 | this.hideAllProgeressStates(); | ||
395 | MochiKit.Style.showElement(this.getElement('creatingFailed')); | ||
396 | }, | ||
397 | |||
398 | //========================================================================= | ||
399 | |||
400 | 'handleKeyEvent': function (anEvent) { | ||
401 | MochiKit.Signal.signal(this, 'keyPressed', anEvent); | ||
402 | /* | ||
403 | if (anEvent.key().string == 'KEY_ENTER') { | ||
404 | if (anEvent.target().nodeName != 'TEXTAREA') { | ||
405 | MochiKit.Signal.signal(this, 'moveForward'); | ||
406 | anEvent.preventDefault(); | ||
407 | } | ||
408 | } else if (anEvent.key().string == 'KEY_TAB') { | ||
409 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { | ||
410 | MochiKit.Signal.signal(this, 'moveForward'); | ||
411 | anEvent.preventDefault(); | ||
412 | } | ||
413 | } | ||
414 | */ | ||
415 | }, | ||
416 | |||
417 | 'handleTermsOfServiceCheckboxChange': function (anEvent) { | ||
418 | MochiKit.Signal.signal(this, 'changedValue'); | ||
419 | }, | ||
420 | |||
421 | //========================================================================= | ||
422 | |||
423 | 'clear': function () { | ||
424 | this.tabPanelController().selectTab(null); | ||
425 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.clear.apply(this, arguments); | ||
426 | }, | ||
427 | |||
428 | //========================================================================= | ||
429 | __syntaxFix__: "syntax fix" | ||
430 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js new file mode 100644 index 0000000..bed6675 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.Page = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.Page.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._slots = { | ||
37 | 'header':'pageHeader', | ||
38 | 'body': 'pageBody', | ||
39 | 'footer':'pageFooter' | ||
40 | }; | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | //============================================================================= | ||
46 | |||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.Page, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'toString': function () { | ||
52 | return "Clipperz.PM.UI.Web.Components.Page component"; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
58 | this.append(this.element(), [ | ||
59 | {tag:'div', id:'pageHeaderAndBody', cls:'pageHeaderAndBody', children:[ | ||
60 | {tag:'div', id:'pageHeader', cls:'pageHeader'}, | ||
61 | {tag:'div', id:'pageBody', cls:'pageBody'} | ||
62 | ]}, | ||
63 | {tag:'div', id:'pageFooter', cls:'pageFooter'} | ||
64 | ]); | ||
65 | |||
66 | }, | ||
67 | |||
68 | //------------------------------------------------------------------------- | ||
69 | |||
70 | __syntaxFix__: "syntax fix" | ||
71 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js new file mode 100644 index 0000000..11135d8 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.PageFooter = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.PageFooter.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | return this; | ||
37 | } | ||
38 | |||
39 | //============================================================================= | ||
40 | |||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageFooter, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
42 | |||
43 | //------------------------------------------------------------------------- | ||
44 | |||
45 | 'toString': function () { | ||
46 | return "Clipperz.PM.UI.Web.Components.PageFooter component"; | ||
47 | }, | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
52 | this.append(this.element(), [ | ||
53 | {tag:'div', cls:'footerWrapper', children:[ | ||
54 | {tag:'div', cls:'footerContent', children:[ | ||
55 | // {tag:'div', cls:'footerStarIcon'}, | ||
56 | {tag:'canvas', id:this.getId('footerStarIcon'), cls:'footerStarIcon'}, | ||
57 | {tag:'span', cls:'copyright', html:'Copyright © 2009 Clipperz Srl'}, | ||
58 | {tag:'a', href:'http://www.clipperz.com/terms_of_service',target:'_blank', html:'terms of service'}, | ||
59 | {tag:'a', href:'http://www.clipperz.com/privacy_policy',target:'_blank', html:'privacy policy'}, | ||
60 | {tag:'span', cls:'applicationVersion', html:'application version: [1992]'} | ||
61 | ]} | ||
62 | ]} | ||
63 | ]); | ||
64 | |||
65 | Clipperz.PM.UI.Canvas.star.normal(this.getElement('footerStarIcon'), "#7e7e7e"); | ||
66 | }, | ||
67 | |||
68 | //------------------------------------------------------------------------- | ||
69 | |||
70 | __syntaxFix__: "syntax fix" | ||
71 | }); | ||
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 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.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 | |||
45 | Clipperz.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 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js new file mode 100644 index 0000000..79c8d4f --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | |||
39 | this._boxDimensions = null; | ||
40 | this._isVisible = false; | ||
41 | |||
42 | this.renderSelf(); | ||
43 | |||
44 | return this; | ||
45 | } | ||
46 | |||
47 | //============================================================================= | ||
48 | |||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
50 | |||
51 | //------------------------------------------------------------------------- | ||
52 | |||
53 | 'toString': function () { | ||
54 | return "Clipperz.PM.UI.Web.Components.PasswordTooltip component"; | ||
55 | }, | ||
56 | |||
57 | //------------------------------------------------------------------------- | ||
58 | |||
59 | 'referenceElement': function () { | ||
60 | return this._referenceElement; | ||
61 | }, | ||
62 | |||
63 | //------------------------------------------------------------------------- | ||
64 | |||
65 | 'text': function () { | ||
66 | return this._text; | ||
67 | }, | ||
68 | |||
69 | 'setText': function (aValue) { | ||
70 | this._text = aValue; | ||
71 | }, | ||
72 | |||
73 | //------------------------------------------------------------------------- | ||
74 | |||
75 | 'isVisible': function () { | ||
76 | return this._isVisible; | ||
77 | }, | ||
78 | |||
79 | 'setIsVisible': function (aValue) { | ||
80 | this._isVisible = aValue; | ||
81 | }, | ||
82 | |||
83 | //------------------------------------------------------------------------- | ||
84 | |||
85 | 'renderSelf': function() { | ||
86 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'passwordTooltip', children:[ | ||
87 | {tag:'div', id:this.getId('body'), cls:'passwordTooltip_body', children:[ | ||
88 | {tag:'div', cls:'passwordTooltip_text', children:[ | ||
89 | {tag:'span', html:this.text()} | ||
90 | ]}, | ||
91 | {tag:'div', id:this.getId('footer'), cls:'passwordTooltip_footer'} | ||
92 | ]}, | ||
93 | {tag:'div', id:this.getId('arrow'), cls:'passwordTooltip_arrow'} | ||
94 | ]}); | ||
95 | |||
96 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | ||
97 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | ||
98 | |||
99 | MochiKit.Style.hideElement(this.displayElement()); | ||
100 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | ||
101 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | ||
102 | }, | ||
103 | |||
104 | //----------------------------------------------------- | ||
105 | |||
106 | 'displayElement': function() { | ||
107 | return this.getElement('tooltip'); | ||
108 | }, | ||
109 | |||
110 | //------------------------------------------------------------------------- | ||
111 | |||
112 | 'boxDimensions': function () { | ||
113 | return this._boxDimensions; | ||
114 | }, | ||
115 | |||
116 | //------------------------------------------------------------------------- | ||
117 | |||
118 | 'show': function () { | ||
119 | var elementSizeAndPosition; | ||
120 | var arrowPosition; | ||
121 | var bodyPosition; | ||
122 | |||
123 | if (this.isVisible() == false) { | ||
124 | arrowPosition = {}; | ||
125 | bodyPosition = {}; | ||
126 | |||
127 | this.setIsVisible(true); | ||
128 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); | ||
129 | |||
130 | MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | ||
131 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | ||
132 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; | ||
133 | |||
134 | arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | ||
135 | arrowPosition.y = elementSizeAndPosition.position.y - 13; | ||
136 | |||
137 | MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | ||
138 | MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); | ||
139 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); | ||
140 | } | ||
141 | }, | ||
142 | |||
143 | 'hide': function () { | ||
144 | if (this.isVisible() == true) { | ||
145 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); | ||
146 | this.setIsVisible(false); | ||
147 | } | ||
148 | }, | ||
149 | |||
150 | //------------------------------------------------------------------------- | ||
151 | /* | ||
152 | 'shouldRemoveElementWhenClearningUp': function () { | ||
153 | return false; | ||
154 | }, | ||
155 | */ | ||
156 | //------------------------------------------------------------------------- | ||
157 | __syntaxFix__: "syntax fix" | ||
158 | }); | ||
159 | |||
160 | Clipperz.PM.UI.Web.Components.PasswordTooltip.initTooltips = function () { | ||
161 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Web_Components_PasswordTooltip_wrapperNode'}); | ||
162 | } | ||
163 | |||
164 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Web.Components.PasswordTooltip.initTooltips); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js new file mode 100644 index 0000000..ab8a38c --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js | |||
@@ -0,0 +1,324 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); | ||
34 | |||
35 | this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
36 | // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._steps = args.steps; | ||
38 | |||
39 | this._currentStep = -1; | ||
40 | |||
41 | return this; | ||
42 | } | ||
43 | |||
44 | //============================================================================= | ||
45 | |||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
47 | |||
48 | //------------------------------------------------------------------------- | ||
49 | |||
50 | 'toString': function () { | ||
51 | return "Clipperz.PM.UI.Web.Components.RulerComponent component"; | ||
52 | }, | ||
53 | |||
54 | //------------------------------------------------------------------------- | ||
55 | |||
56 | 'resetStatus': function (args) { | ||
57 | args = args || {}; | ||
58 | |||
59 | if (this.currentStep() != 0) { | ||
60 | var shouldAnimateTransition; | ||
61 | |||
62 | shouldAnimateTransition = args.animateTransition || false; | ||
63 | |||
64 | if (shouldAnimateTransition) { | ||
65 | this.moveToFirstStep(MochiKit.Base.method(this, 'cursorMoved')); | ||
66 | } else { | ||
67 | this._currentStep = 0; | ||
68 | this.cursorMoved(); | ||
69 | } | ||
70 | } | ||
71 | }, | ||
72 | |||
73 | //------------------------------------------------------------------------- | ||
74 | |||
75 | 'translationContext': function () { | ||
76 | return this._translationContext; | ||
77 | }, | ||
78 | |||
79 | 'steps': function () { | ||
80 | return this._steps; | ||
81 | }, | ||
82 | |||
83 | 'setSteps': function (aValue) { | ||
84 | this._steps = aValue; | ||
85 | this.renderStepsComponents(); | ||
86 | this.resetStatus(); | ||
87 | }, | ||
88 | |||
89 | 'translatedStepDescription': function (aStep) { | ||
90 | return Clipperz.PM.Strings.getValue(this.translationContext() + '.' + aStep + '.' + 'name'); | ||
91 | }, | ||
92 | |||
93 | //------------------------------------------------------------------------- | ||
94 | |||
95 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
96 | this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ | ||
97 | {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ | ||
98 | {tag:'div', cls:'ruler', children:[ | ||
99 | {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:' '}, | ||
100 | {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:' '}, | ||
101 | {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:' '}, | ||
102 | {tag:'div', cls:'marker', id:this.getId('marker'), children:[ | ||
103 | {tag:'div', cls:'previous', id:this.getId('previousButton')}, | ||
104 | {tag:'div', cls:'markerBody'}, | ||
105 | {tag:'div', cls:'next', id:this.getId('nextButton')} | ||
106 | ]}, | ||
107 | {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, | ||
108 | // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ | ||
109 | // {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map(MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), this.steps())} | ||
110 | // ]}, | ||
111 | {tag:'div', cls:'dots', id:this.getId('dotsFrame')} | ||
112 | // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ | ||
113 | // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} | ||
114 | // ]} | ||
115 | ]} | ||
116 | ]} | ||
117 | ])); | ||
118 | //console.log("ELEMENT", this.element()); | ||
119 | |||
120 | MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); | ||
121 | |||
122 | MochiKit.Signal.connect(this.getElement('previousButton'), 'onclick', this, 'handlePrevious'); | ||
123 | MochiKit.Signal.connect(this.getElement('smallPreviousButton'),'onclick', this, 'handlePrevious'); | ||
124 | |||
125 | MochiKit.Signal.connect(this.getElement('nextButton'), 'onclick', this, 'handleNext'); | ||
126 | MochiKit.Signal.connect(this.getElement('smallNextButton'), 'onclick', this, 'handleNext'); | ||
127 | |||
128 | this.enablePrevious(false); | ||
129 | this.enableNext(false); | ||
130 | |||
131 | // this.cursorMoved(); | ||
132 | }, | ||
133 | |||
134 | //......................................................................... | ||
135 | |||
136 | 'renderStepsComponents': function () { | ||
137 | varstepsFrame; | ||
138 | var dotsFrame; | ||
139 | |||
140 | stepsFrames = this.getElement('stepsFrame'); | ||
141 | MochiKit.DOM.setElementClass(stepsFrames, 'steps'); | ||
142 | MochiKit.DOM.addElementClass(stepsFrames, 'steps_' + this.steps().length); | ||
143 | |||
144 | stepsFrames.innerHTML = ""; | ||
145 | this.append(stepsFrames, {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map( | ||
146 | MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), | ||
147 | this.steps())} | ||
148 | ); | ||
149 | |||
150 | dotsFrames = this.getElement('dotsFrame'); | ||
151 | MochiKit.DOM.setElementClass(dotsFrames, 'dots'); | ||
152 | MochiKit.DOM.addElementClass(dotsFrames, 'steps_' + this.steps().length); | ||
153 | |||
154 | dotsFrames.innerHTML = ""; | ||
155 | this.append(dotsFrames, {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map( | ||
156 | function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}; }, | ||
157 | this.steps())} | ||
158 | ); | ||
159 | }, | ||
160 | |||
161 | //------------------------------------------------------------------------- | ||
162 | |||
163 | 'handleExit': function (anEvent) { | ||
164 | anEvent.preventDefault(); | ||
165 | |||
166 | MochiKit.Signal.signal(this, 'exit'); | ||
167 | }, | ||
168 | |||
169 | //------------------------------------------------------------------------- | ||
170 | |||
171 | 'handlePrevious': function (anEvent) { | ||
172 | anEvent.preventDefault(); | ||
173 | |||
174 | // if (!MochiKit.DOM.hasElementClass(this.getElement('previousButton'), 'disabled')) { | ||
175 | // this.moveBackward(); | ||
176 | // } | ||
177 | |||
178 | MochiKit.Signal.signal(this, 'moveBackward'); | ||
179 | }, | ||
180 | |||
181 | 'handleNext': function (anEvent) { | ||
182 | anEvent.preventDefault(); | ||
183 | |||
184 | // if (!MochiKit.DOM.hasElementClass(this.getElement('nextButton'), 'disabled')) { | ||
185 | // this.moveForward(); | ||
186 | // } | ||
187 | |||
188 | MochiKit.Signal.signal(this, 'moveForward'); | ||
189 | }, | ||
190 | |||
191 | //------------------------------------------------------------------------- | ||
192 | |||
193 | 'currentStep': function () { | ||
194 | return this._currentStep; | ||
195 | }, | ||
196 | |||
197 | 'markerInitialOffset': function () { | ||
198 | return -246; | ||
199 | }, | ||
200 | |||
201 | 'markerStepOffset': function () { | ||
202 | return 410 / (this.steps().length - 1); | ||
203 | // return 100; | ||
204 | }, | ||
205 | |||
206 | //------------------------------------------------------------------------- | ||
207 | |||
208 | 'moveToFirstStep': function (aCallback) { | ||
209 | varstepsToMove; | ||
210 | |||
211 | stepsToMove = this._currentStep; | ||
212 | this._currentStep = 0; | ||
213 | |||
214 | this.enablePrevious(false); | ||
215 | this.enableNext(false); | ||
216 | // MochiKit.Signal.signal(this, 'moveBackward'); | ||
217 | MochiKit.Base.map( | ||
218 | function (anElement) { MochiKit.DOM.removeElementClass(anElement, 'selected'); }, | ||
219 | MochiKit.Selector.findChildElements(this.element(), ['li.selected']) | ||
220 | ); | ||
221 | new MochiKit.Visual.Move(this.getElement('marker'), { | ||
222 | x:-(this.markerStepOffset() * stepsToMove), | ||
223 | mode:'relative', | ||
224 | duration:(0.5 * (stepsToMove/2)), | ||
225 | // afterFinish:MochiKit.Base.method(this, 'cursorMoved') | ||
226 | afterFinish:MochiKit.Base.compose(MochiKit.Base.method(this, 'cursorMoved'), aCallback) | ||
227 | }); | ||
228 | }, | ||
229 | |||
230 | 'moveBackward': function (aCallback) { | ||
231 | this._currentStep --; | ||
232 | |||
233 | this.enablePrevious(false); | ||
234 | this.enableNext(false); | ||
235 | // MochiKit.Signal.signal(this, 'moveBackward'); | ||
236 | MochiKit.Base.map( | ||
237 | function (anElement) { MochiKit.DOM.removeElementClass(anElement, 'selected'); }, | ||
238 | MochiKit.Selector.findChildElements(this.element(), ['li.selected']) | ||
239 | ); | ||
240 | new MochiKit.Visual.Move(this.getElement('marker'), { | ||
241 | x:-this.markerStepOffset(), | ||
242 | mode:'relative', | ||
243 | duration:0.5, | ||
244 | // afterFinish:MochiKit.Base.method(this, 'cursorMoved') | ||
245 | afterFinish:MochiKit.Base.compose(MochiKit.Base.method(this, 'cursorMoved'), aCallback) | ||
246 | }); | ||
247 | }, | ||
248 | |||
249 | 'moveForward': function (aCallback) { | ||
250 | this._currentStep ++; | ||
251 | |||
252 | if (this._currentStep < this.steps().length) { | ||
253 | this.enablePrevious(false); | ||
254 | this.enableNext(false); | ||
255 | // MochiKit.Signal.signal(this, 'moveForward'); | ||
256 | MochiKit.Base.map( | ||
257 | function (anElement) { MochiKit.DOM.removeElementClass(anElement, 'selected'); }, | ||
258 | MochiKit.Selector.findChildElements(this.element(), ['li.selected']) | ||
259 | ); | ||
260 | new MochiKit.Visual.Move(this.getElement('marker'), { | ||
261 | x:this.markerStepOffset(), | ||
262 | mode:'relative', | ||
263 | duration:0.5, | ||
264 | // afterFinish:MochiKit.Base.method(this, 'cursorMoved') | ||
265 | afterFinish:MochiKit.Base.compose(MochiKit.Base.method(this, 'cursorMoved'), aCallback) | ||
266 | }); | ||
267 | } else { | ||
268 | MochiKit.Signal.signal(this, 'done'); | ||
269 | } | ||
270 | }, | ||
271 | |||
272 | //------------------------------------------------------------------------- | ||
273 | |||
274 | 'enablePrevious': function (aValue) { | ||
275 | if (aValue == true) { | ||
276 | MochiKit.DOM.removeElementClass(this.getElement('previousButton'), 'disabled'); | ||
277 | MochiKit.DOM.removeElementClass(this.getElement('smallPreviousButton'), 'disabled'); | ||
278 | } else { | ||
279 | MochiKit.DOM.addElementClass(this.getElement('previousButton'), 'disabled'); | ||
280 | MochiKit.DOM.addElementClass(this.getElement('smallPreviousButton'), 'disabled'); | ||
281 | } | ||
282 | }, | ||
283 | |||
284 | //'disablePrevious': function () { | ||
285 | // MochiKit.DOM.addElementClass(this.getElement('previousButton'), 'disabled'); | ||
286 | //}, | ||
287 | |||
288 | //......................................................................... | ||
289 | |||
290 | 'enableNext': function (aValue) { | ||
291 | if (aValue == true) { | ||
292 | MochiKit.DOM.removeElementClass(this.getElement('nextButton'), 'disabled'); | ||
293 | MochiKit.DOM.removeElementClass(this.getElement('smallNextButton'), 'disabled'); | ||
294 | } else { | ||
295 | MochiKit.DOM.addElementClass(this.getElement('nextButton'), 'disabled'); | ||
296 | MochiKit.DOM.addElementClass(this.getElement('smallNextButton'), 'disabled'); | ||
297 | } | ||
298 | }, | ||
299 | |||
300 | //'disableNext': function () { | ||
301 | // MochiKit.DOM.addElementClass(this.getElement('nextButton'), 'disabled'); | ||
302 | //}, | ||
303 | |||
304 | //------------------------------------------------------------------------- | ||
305 | |||
306 | 'cursorMoved': function () { | ||
307 | MochiKit.Style.setElementPosition(this.getElement('marker'), {x:this.markerStepOffset() * this.currentStep() + this.markerInitialOffset()}) | ||
308 | MochiKit.Signal.signal(this, 'cursorMoved'); | ||
309 | |||
310 | MochiKit.DOM.addElementClass(this.getElement('steps').childNodes[this.currentStep()], 'selected'); | ||
311 | MochiKit.DOM.addElementClass(this.getElement('dots').childNodes[this.currentStep()], 'selected'); | ||
312 | }, | ||
313 | |||
314 | //------------------------------------------------------------------------- | ||
315 | |||
316 | 'setDisplayMode': function (aValue) { | ||
317 | MochiKit.DOM.removeElementClass(this.getElement('rulerWrapper'), 'fixed'); | ||
318 | MochiKit.DOM.removeElementClass(this.getElement('rulerWrapper'), 'scrollable'); | ||
319 | MochiKit.DOM.addElementClass(this.getElement('rulerWrapper'), aValue); | ||
320 | }, | ||
321 | |||
322 | //------------------------------------------------------------------------- | ||
323 | __syntaxFix__: "syntax fix" | ||
324 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js new file mode 100644 index 0000000..39a1ccb --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js | |||
@@ -0,0 +1,193 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.TabSidePanel = function(args) { | ||
32 | args = args || {}; | ||
33 | Clipperz.PM.UI.Web.Components.TabSidePanel.superclass.constructor.call(this, args); | ||
34 | |||
35 | this._element = args.element || null; | ||
36 | |||
37 | this._slots = { | ||
38 | }; | ||
39 | |||
40 | return this; | ||
41 | } | ||
42 | |||
43 | //============================================================================= | ||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TabSidePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
46 | |||
47 | //------------------------------------------------------------------------- | ||
48 | |||
49 | 'toString': function () { | ||
50 | return "Clipperz.PM.UI.Web.Components.TabSidePanel component"; | ||
51 | }, | ||
52 | |||
53 | //------------------------------------------------------------------------- | ||
54 | |||
55 | 'deselectAllTabs': function() { | ||
56 | var tabListItems; | ||
57 | |||
58 | tabListItems = [ | ||
59 | 'cardsLI', | ||
60 | // 'directLoginLI', | ||
61 | 'accountLI', | ||
62 | 'dataLI', | ||
63 | 'toolsLI' | ||
64 | ]; | ||
65 | |||
66 | //Clipperz.log("=== TabSidePanel.tabSelected anEvent.src().id", anEvent.src().id); | ||
67 | for (var i in tabListItems) { | ||
68 | //Clipperz.log("=== TabSidePanel.tabSelected aTabListItem", tabListItems[i]); | ||
69 | MochiKit.DOM.removeElementClass(this.getId(tabListItems[i]), 'selected'); | ||
70 | } | ||
71 | }, | ||
72 | |||
73 | 'selectTab': function(aTabName) { | ||
74 | this.deselectAllTabs(); | ||
75 | MochiKit.DOM.addElementClass(this.getId(this.listItemIdForTabNamed(aTabName)), 'selected'); | ||
76 | MochiKit.Signal.signal(this, 'tabSelected', aTabName); | ||
77 | }, | ||
78 | |||
79 | 'tabNameForAnchorId': function(anId) { | ||
80 | var result; | ||
81 | |||
82 | switch(anId) { | ||
83 | case 'cards_tabSidePanel': | ||
84 | result = 'cards'; | ||
85 | break; | ||
86 | // case 'directLogins_tabSidePanel': | ||
87 | // result = 'directLogins'; | ||
88 | // break; | ||
89 | case 'account_tabSidePanel': | ||
90 | result = 'account'; | ||
91 | break; | ||
92 | case 'data_tabSidePanel': | ||
93 | result = 'data'; | ||
94 | break; | ||
95 | case 'tools_tabSidePanel': | ||
96 | result = 'tools'; | ||
97 | break; | ||
98 | } | ||
99 | |||
100 | return result; | ||
101 | }, | ||
102 | |||
103 | 'listItemIdForTabNamed': function(aTabName) { | ||
104 | var result; | ||
105 | |||
106 | switch (aTabName) { | ||
107 | case 'cards': | ||
108 | result = 'cardsLI'; | ||
109 | break; | ||
110 | // case 'directLogins': | ||
111 | // result = 'directLoginLI'; | ||
112 | // break; | ||
113 | case 'account': | ||
114 | result = 'accountLI'; | ||
115 | break; | ||
116 | case 'data': | ||
117 | result = 'dataLI'; | ||
118 | break; | ||
119 | case 'tools': | ||
120 | result = 'toolsLI'; | ||
121 | break; | ||
122 | } | ||
123 | |||
124 | return result; | ||
125 | }, | ||
126 | |||
127 | 'tabSelected': function (anEvent) { | ||
128 | this.selectTab(this.tabNameForAnchorId(anEvent.src().id)); | ||
129 | // anEvent.stop(); | ||
130 | anEvent.preventDefault(); | ||
131 | }, | ||
132 | |||
133 | //------------------------------------------------------------------------- | ||
134 | |||
135 | 'addCard': function (anEvent) { | ||
136 | anEvent.stop(); | ||
137 | MochiKit.Signal.signal(this, 'addCard', anEvent.src()); | ||
138 | }, | ||
139 | |||
140 | //------------------------------------------------------------------------- | ||
141 | |||
142 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
143 | this.append(this.element(), [ | ||
144 | {tag:'div', cls:'header'}, | ||
145 | {tag:'div', cls:'body', children:[ | ||
146 | {tag:'ul', cls:'mainTabs', children:[ | ||
147 | {tag:'li', id:this.getId('cardsLI'), cls:'cards', children:[ | ||
148 | {tag:'a', id:'cards_tabSidePanel', href:'#', html:"cards"}, | ||
149 | {tag:'div', cls:'selectionHighlighter', children:[ | ||
150 | {tag:'img', src:'./images/old/main/tabs/selectionHighligher.png'}, | ||
151 | {tag:'a', id:this.getId('addCardA'), cls:'add', href:'#', children:[ | ||
152 | {tag:'span', html:"add"}, | ||
153 | {tag:'h3', html:"+"} | ||
154 | ]} | ||
155 | ]} | ||
156 | ]} | ||
157 | ]}, | ||
158 | {tag:'ul', cls:'otherTabs', children:[ | ||
159 | {tag:'li', id:this.getId('accountLI'), children:[ | ||
160 | {tag:'a', id:'account_tabSidePanel', href:'#', html:"account"}, | ||
161 | {tag:'div', cls:'selectionHighlighter', children:[ | ||
162 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} | ||
163 | ]} | ||
164 | ]}, | ||
165 | {tag:'li', id:this.getId('dataLI'), children:[ | ||
166 | {tag:'a', id:'data_tabSidePanel', href:'#', html:"data"}, | ||
167 | {tag:'div', cls:'selectionHighlighter', children:[ | ||
168 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} | ||
169 | ]} | ||
170 | ]}, | ||
171 | {tag:'li', id:this.getId('toolsLI'), children:[ | ||
172 | {tag:'a', id:'tools_tabSidePanel', href:'#', html:"tools"}, | ||
173 | {tag:'div', cls:'selectionHighlighter', children:[ | ||
174 | {tag:'img', src:'./images/old/main/tabs/selectionHighligherGray.png'} | ||
175 | ]} | ||
176 | ]} | ||
177 | ]} | ||
178 | ]}, | ||
179 | {tag:'div', cls:'footer'} | ||
180 | ]); | ||
181 | |||
182 | MochiKit.Signal.connect('cards_tabSidePanel', 'onclick', this, 'tabSelected'); | ||
183 | // MochiKit.Signal.connect('directLogins_tabSidePanel', 'onclick', this, 'tabSelected'); | ||
184 | MochiKit.Signal.connect('account_tabSidePanel', 'onclick', this, 'tabSelected'); | ||
185 | MochiKit.Signal.connect('data_tabSidePanel', 'onclick', this, 'tabSelected'); | ||
186 | MochiKit.Signal.connect('tools_tabSidePanel', 'onclick', this, 'tabSelected'); | ||
187 | MochiKit.Signal.connect(this.getId('addCardA'), 'onclick', this, 'addCard'); | ||
188 | }, | ||
189 | |||
190 | //------------------------------------------------------------------------- | ||
191 | |||
192 | __syntaxFix__: "syntax fix" | ||
193 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js new file mode 100644 index 0000000..97e81b4 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | //############################################################################# | ||
32 | |||
33 | Clipperz.PM.UI.Web.Components.TextColumnManager = function(args) { | ||
34 | args = args || {}; | ||
35 | Clipperz.PM.UI.Web.Components.TextColumnManager.superclass.constructor.call(this, args); | ||
36 | |||
37 | return this; | ||
38 | } | ||
39 | |||
40 | //============================================================================= | ||
41 | |||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TextColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | ||
43 | |||
44 | 'toString': function () { | ||
45 | return "Clipperz.PM.UI.Web.Components.TextColumnManager component"; | ||
46 | }, | ||
47 | |||
48 | //----------------------------------------------------- | ||
49 | |||
50 | '__syntax_fix__' : 'syntax fix' | ||
51 | |||
52 | }); | ||
53 | |||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js new file mode 100644 index 0000000..179c495 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js | |||
@@ -0,0 +1,113 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.ToolsPanel = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.ToolsPanel.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._initiallySelectedTab = args.selected || 'PASSWORD_GENERATOR'; | ||
37 | this._tabPanelControllerConfiguration = { | ||
38 | 'PASSWORD_GENERATOR': { | ||
39 | tab:'passwordGeneratorTab', | ||
40 | panel:'passwordGeneratorPanel' | ||
41 | }, | ||
42 | 'BOOKMARKLET': { | ||
43 | tab:'bookmarkletTab', | ||
44 | panel:'bookmarkletPanel' | ||
45 | }, | ||
46 | 'COMPACT_EDITION': { | ||
47 | tab:'compactEditionTab', | ||
48 | panel:'compactEditionPanel' | ||
49 | }, | ||
50 | 'HTTP_AUTH': { | ||
51 | tab:'httpAuthTab', | ||
52 | panel:'httpAuthPanel' | ||
53 | } | ||
54 | }; | ||
55 | |||
56 | return this; | ||
57 | } | ||
58 | |||
59 | //============================================================================= | ||
60 | |||
61 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ToolsPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | ||
62 | |||
63 | //------------------------------------------------------------------------- | ||
64 | |||
65 | 'toString': function () { | ||
66 | return "Clipperz.PM.UI.Web.Components.ToolsPanel component"; | ||
67 | }, | ||
68 | |||
69 | //------------------------------------------------------------------------- | ||
70 | |||
71 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
72 | this.append(this.element(), [ | ||
73 | {tag:'div', cls:'header', children:[ | ||
74 | {tag:'div', cls:'subPanelTabs', children:[ | ||
75 | {tag:'ul', children:[ | ||
76 | {tag:'li', id:this.getId('passwordGeneratorTab'),children:[{tag:'a', href:'#', html:'Password generator'}], cls:'first'}, | ||
77 | {tag:'li', id:this.getId('bookmarkletTab'), children:[{tag:'a', href:'#', html:'Bookmarklet'}]}, | ||
78 | {tag:'li', id:this.getId('compactEditionTab'), children:[{tag:'a', href:'#', html:'Compact edition'}]}, | ||
79 | {tag:'li', id:this.getId('httpAuthTab'), children:[{tag:'a', href:'#', html:'HTTP Auth'}]} | ||
80 | ]} | ||
81 | ]} | ||
82 | ]}, | ||
83 | {tag:'div', cls:'body', children:[ | ||
84 | {tag:'div', cls:'accountPanel', children:[ | ||
85 | {tag:'div', cls:'subPanelContent', children:[ | ||
86 | {tag:'ul', children:[ | ||
87 | {tag:'li', id:this.getId('passwordGeneratorPanel'),children:[ | ||
88 | {tag:'h3', html:"Password generator"} | ||
89 | ]}, | ||
90 | {tag:'li', id:this.getId('bookmarkletPanel'),children:[ | ||
91 | {tag:'h3', html:"Bookmarklet"} | ||
92 | ]}, | ||
93 | {tag:'li', id:this.getId('compactEditionPanel'), children:[ | ||
94 | {tag:'h3', html:"Compact edition"} | ||
95 | ]}, | ||
96 | {tag:'li', id:this.getId('httpAuthPanel'), children:[ | ||
97 | {tag:'h3', html:"HTTP Auth"} | ||
98 | ]} | ||
99 | ]} | ||
100 | ]} | ||
101 | ]} | ||
102 | ]}, | ||
103 | {tag:'div', cls:'footer'} | ||
104 | ]); | ||
105 | |||
106 | this.tabPanelController().setup({selected:this.initiallySelectedTab()}); | ||
107 | }, | ||
108 | |||
109 | //------------------------------------------------------------------------- | ||
110 | |||
111 | |||
112 | __syntaxFix__: "syntax fix" | ||
113 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js new file mode 100644 index 0000000..5b9d522 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js | |||
@@ -0,0 +1,184 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._openFromElement = args.openFromElement || null; | ||
37 | this._onOkCloseToElement = args.onOkCloseToElement || null; | ||
38 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; | ||
39 | |||
40 | this._progressBarComponent = null; | ||
41 | |||
42 | return this; | ||
43 | } | ||
44 | |||
45 | //============================================================================= | ||
46 | |||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'toString': function () { | ||
52 | return "Clipperz.PM.UI.Web.Components.UnlockPasswordComponent component"; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'getPassphrase': function () { | ||
58 | /* var deferredResult; | ||
59 | |||
60 | if (this.passphrase() == null) { | ||
61 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | ||
62 | deferredResult = this.deferred(); | ||
63 | } else { | ||
64 | deferredResult = MochiKit.Async.succeed(this.passphrase()); | ||
65 | } | ||
66 | |||
67 | return deferredResult; | ||
68 | */ | ||
69 | |||
70 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | ||
71 | |||
72 | return this.deferred(); | ||
73 | }, | ||
74 | |||
75 | //------------------------------------------------------------------------- | ||
76 | |||
77 | 'deferredShowModal': function (someParameters) { | ||
78 | return Clipperz.Async.callbacks("UnlockPasswordComponent.deferredShowModal", [ | ||
79 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.deferredShowModal, this, someParameters), | ||
80 | MochiKit.Base.method(this, 'getElement', 'passphrase'), | ||
81 | MochiKit.Base.methodcaller('focus') | ||
82 | ], {trace:false}) | ||
83 | }, | ||
84 | |||
85 | //------------------------------------------------------------------------- | ||
86 | |||
87 | 'openFromElement': function () { | ||
88 | return this._openFromElement; | ||
89 | }, | ||
90 | |||
91 | 'onOkCloseToElement': function () { | ||
92 | return this._onOkCloseToElement; | ||
93 | }, | ||
94 | |||
95 | 'onCancelCloseToElement': function () { | ||
96 | return this._onCancelCloseToElement; | ||
97 | }, | ||
98 | |||
99 | //------------------------------------------------------------------------- | ||
100 | |||
101 | 'renderSelf': function() { | ||
102 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.renderSelf.apply(this, arguments); | ||
103 | |||
104 | this.append(this.getElement('container'), {tag:'div', cls:'passphrase', children: [ | ||
105 | // {tag:'form', id:this.getId('passphraseForm'), children:[ | ||
106 | {tag:'input', id:this.getId('passphrase'), type:'password', name:'passphrase', value:''} | ||
107 | // ]} | ||
108 | ]}); | ||
109 | |||
110 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userSuccessfullyLoggedIn', this, 'userSuccessfullyLoggedInHandler'); | ||
111 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userLoginFailed', this, 'userLoginFailedHandler'); | ||
112 | |||
113 | |||
114 | // MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('passphrase'), 'focus')); | ||
115 | // this.getElement('passphrase').select(); | ||
116 | }, | ||
117 | |||
118 | //------------------------------------------------------------------------- | ||
119 | |||
120 | 'showProgressBar': function () { | ||
121 | varprogressBarElement; | ||
122 | |||
123 | this.getElement('container').innerHTML = ''; | ||
124 | |||
125 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); | ||
126 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); | ||
127 | |||
128 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); | ||
129 | }, | ||
130 | |||
131 | //------------------------------------------------------------------------- | ||
132 | |||
133 | 'showFailure': function () { | ||
134 | this.setType('ALERT'); | ||
135 | this.setTitle("Login failed"); | ||
136 | this.setText("Wrong passphrase; the unlock has failed."); | ||
137 | this.getElement('container').innerHTML = ''; | ||
138 | this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); | ||
139 | }, | ||
140 | |||
141 | //------------------------------------------------------------------------- | ||
142 | |||
143 | 'closeOk': function () { | ||
144 | var passphrase; | ||
145 | |||
146 | passphrase = this.getElement('passphrase').value; | ||
147 | this.showProgressBar(); | ||
148 | // this.deferred().callback(passphrase); | ||
149 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback', passphrase)); | ||
150 | this._deferred = null; | ||
151 | }, | ||
152 | |||
153 | 'closeCancel': function () { | ||
154 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); | ||
155 | this.deferred().cancel(); | ||
156 | this._deferred = null; | ||
157 | }, | ||
158 | |||
159 | //------------------------------------------------------------------------- | ||
160 | |||
161 | 'userSuccessfullyLoggedInHandler': function (anEvent) { | ||
162 | this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); | ||
163 | }, | ||
164 | |||
165 | 'userLoginFailedHandler': function (anEvent) { | ||
166 | //console.log("############### FAILED LOGIN ################"); | ||
167 | this.showFailure(); | ||
168 | }, | ||
169 | |||
170 | //------------------------------------------------------------------------- | ||
171 | /* | ||
172 | 'deferredShow': function (someArgs, aResult) { | ||
173 | this.deferredShowModal(someArgs); | ||
174 | |||
175 | // this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); | ||
176 | // this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); | ||
177 | // this.deferred().addCallback(MochiKit.Async.succeed, aResult); | ||
178 | |||
179 | return this.deferred(); | ||
180 | }, | ||
181 | */ | ||
182 | //------------------------------------------------------------------------- | ||
183 | __syntaxFix__: "syntax fix" | ||
184 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js new file mode 100644 index 0000000..f26118e --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js | |||
@@ -0,0 +1,346 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._slots = {}; | ||
37 | this._isLocked = false; | ||
38 | this._lockTooltip = null; | ||
39 | |||
40 | return this; | ||
41 | } | ||
42 | |||
43 | //============================================================================= | ||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
46 | |||
47 | //------------------------------------------------------------------------- | ||
48 | |||
49 | 'toString': function () { | ||
50 | return "Clipperz.PM.UI.Web.Components.UserInfoBox component"; | ||
51 | }, | ||
52 | |||
53 | //------------------------------------------------------------------------- | ||
54 | |||
55 | 'handleLogout': function(anEvent) { | ||
56 | //Clipperz.log(">>> UserInfoBox.handleLogout"); | ||
57 | anEvent.preventDefault(); | ||
58 | MochiKit.Signal.signal(this, 'logout'); | ||
59 | //Clipperz.log("<<< UserInfoBox.handleLogout"); | ||
60 | }, | ||
61 | |||
62 | //------------------------------------------------------------------------- | ||
63 | |||
64 | 'lockTooltip': function () { | ||
65 | return this._lockTooltip; | ||
66 | }, | ||
67 | |||
68 | //------------------------------------------------------------------------- | ||
69 | |||
70 | 'isLocked': function () { | ||
71 | return this._isLocked; | ||
72 | }, | ||
73 | |||
74 | 'setIsLocked': function (aValue) { | ||
75 | this._isLocked = aValue; | ||
76 | }, | ||
77 | |||
78 | 'toggleLock': function(anEvent) { | ||
79 | var deferredResult; | ||
80 | var shouldLock; | ||
81 | |||
82 | //console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]"); | ||
83 | anEvent.preventDefault(); | ||
84 | this.lockTooltip().hide(); | ||
85 | |||
86 | shouldLock = (this.isLocked() == false); | ||
87 | |||
88 | if (shouldLock) { | ||
89 | var maskElement; | ||
90 | |||
91 | this.setIsLocked(true); | ||
92 | maskElement = this.getId('modalDialogMask'); | ||
93 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ | ||
94 | MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), | ||
95 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), | ||
96 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), | ||
97 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') | ||
98 | ], {trace:false}); | ||
99 | } else { | ||
100 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ | ||
101 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') | ||
102 | ], {trace:false}); | ||
103 | } | ||
104 | //console.log("<<< UserInfoBox.toggleLock"); | ||
105 | |||
106 | return deferredResult; | ||
107 | }, | ||
108 | |||
109 | //------------------------------------------------------------------------- | ||
110 | |||
111 | 'unlock': function () { | ||
112 | var deferredResult; | ||
113 | var maskElement; | ||
114 | |||
115 | this.setIsLocked(false); | ||
116 | maskElement = this.getId('modalDialogMask'); | ||
117 | |||
118 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ | ||
119 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | ||
120 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | ||
121 | MochiKit.Base.partial(MochiKit.DOM.removeElementClass, this.element(), 'locked') | ||
122 | ], {trace:false}); | ||
123 | }, | ||
124 | |||
125 | //------------------------------------------------------------------------- | ||
126 | |||
127 | 'askForPassphrase': function () { | ||
128 | varunlockPasswordComponent; | ||
129 | /* | ||
130 | vardeferredResult; | ||
131 | |||
132 | deferredResult = new Clipperz.Async.Deferred("UserInfoBox.askForPassphrase", {trace:false}); | ||
133 | deferredResult.addCallback(MochiKit.Async.succeed, 'test'); | ||
134 | |||
135 | deferredResult.callback(); | ||
136 | |||
137 | return deferredResult; | ||
138 | */ | ||
139 | //console.log(">>> UserInfoBox.askForPassphrase"); | ||
140 | unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({ | ||
141 | 'title':"Unlock account", | ||
142 | 'text': "Insert the passprase to unlock the account", | ||
143 | 'type': 'INFO', | ||
144 | 'buttons': [ | ||
145 | {text:"Cancel",result:'CANCEL'}, | ||
146 | {text:"Unlock", result:'OK',isDefault:true} | ||
147 | ], | ||
148 | 'openFromElement': this.getElement('lock'), | ||
149 | 'onOkCloseToElement': null, | ||
150 | 'onCancelCloseToElement':this.getId('lock') | ||
151 | }); | ||
152 | //console.log("<<< UserInfoBox.askForPassphrase"); | ||
153 | |||
154 | return unlockPasswordComponent.getPassphrase(); | ||
155 | }, | ||
156 | |||
157 | //========================================================================= | ||
158 | |||
159 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
160 | this.append(this.element(), [ | ||
161 | // {tag:'canvas', id:this.getId('canvas'), cls:'canvas', width:'188', height:'154'}, | ||
162 | {tag:'div', cls:'header', children:[ | ||
163 | {tag:'h1', html:"Welcome"}, | ||
164 | {tag:'a', cls:'lockButton', href:'#', id:this.getId('lock'), html:' '} | ||
165 | ]}, | ||
166 | {tag:'div', cls:'body', children:[ | ||
167 | {tag:'h3', id:this.getId('username'), html:""}, | ||
168 | {tag:'ul', children:[ | ||
169 | {tag:'li', id:this.getId('cards'), children:[ | ||
170 | {tag:'span', id:this.getId('cardsNumber'), cls:'number', html:"-"}, | ||
171 | {tag:'span', id:this.getId('cardsLabel'), html:"cards"} | ||
172 | ]}, | ||
173 | {tag:'li', id:this.getId('directLogins'), children:[ | ||
174 | {tag:'span', id:this.getId('directLoginsNumber'), cls:'number', html:"-"}, | ||
175 | {tag:'span', id:this.getId('directLoginsLabel'), html:"direct logins"} | ||
176 | ]} | ||
177 | ]}, | ||
178 | {tag:'a', href:'#', id:this.getId('logout'), html:"logout >"} | ||
179 | ]}, | ||
180 | {tag:'div', cls:'footer'} | ||
181 | ]); | ||
182 | |||
183 | MochiKit.Signal.connect(this.getElement('logout'), 'onclick', this, 'handleLogout'); | ||
184 | MochiKit.Signal.connect(this.getElement('lock'), 'onclick', this, 'toggleLock'); | ||
185 | |||
186 | this._lockTooltip = new Clipperz.PM.UI.Common.Components.Tooltip({ | ||
187 | element:this.getElement('lock'), | ||
188 | text: "Click here to lock/unlock your account.", | ||
189 | position:'RIGHT' | ||
190 | }); | ||
191 | |||
192 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, | ||
193 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper', children:[ | ||
194 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask userInfoBoxMask'} | ||
195 | ]} | ||
196 | ); | ||
197 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); | ||
198 | |||
199 | // this.drawUserInfoBackground(this.getElement('canvas')); | ||
200 | }, | ||
201 | |||
202 | //------------------------------------------------------------------------- | ||
203 | /* | ||
204 | 'drawUserInfoBackground': function (canvas) { | ||
205 | var kMyDrawingFunctionWidth = 188.0; | ||
206 | var kMyDrawingFunctionHeight = 154.0; | ||
207 | |||
208 | var context = canvas.getContext("2d"); | ||
209 | var color; | ||
210 | var resolution; | ||
211 | var alignStroke; | ||
212 | var path; | ||
213 | var pointX; | ||
214 | var pointY; | ||
215 | var controlPoint1X; | ||
216 | var controlPoint1Y; | ||
217 | var controlPoint2X; | ||
218 | var controlPoint2Y; | ||
219 | var gradient; | ||
220 | if (window.devicePixelRatio) | ||
221 | resolution = window.devicePixelRatio; | ||
222 | else | ||
223 | resolution = 1.0; | ||
224 | resolution *= 0.5 * (canvas.width / kMyDrawingFunctionWidth + canvas.height / kMyDrawingFunctionHeight); | ||
225 | |||
226 | context.save(); | ||
227 | context.scale(canvas.width / kMyDrawingFunctionWidth, canvas.height / kMyDrawingFunctionHeight); | ||
228 | context.clearRect(0.0, 0.0, kMyDrawingFunctionWidth, kMyDrawingFunctionHeight); | ||
229 | |||
230 | // Setup for Shadow Effect | ||
231 | color = "rgba(0.0%, 0.0%, 0.0%, 0.667)"; | ||
232 | context.save(); | ||
233 | context.shadowColor = color; | ||
234 | context.shadowBlur = 3.0; | ||
235 | context.shadowOffsetX = 5.729 * Math.cos(7.592) * resolution; | ||
236 | context.shadowOffsetY = 5.729 * Math.sin(7.592) * resolution; | ||
237 | |||
238 | // Layer 1 | ||
239 | |||
240 | alignStroke = 0.0; | ||
241 | context.beginPath(); | ||
242 | pointX = 169.5; | ||
243 | pointY = 141.5; | ||
244 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
245 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
246 | context.moveTo(pointX, pointY); | ||
247 | pointX = 177.5; | ||
248 | pointY = 133.5; | ||
249 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
250 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
251 | controlPoint1X = 173.889; | ||
252 | controlPoint1Y = 141.5; | ||
253 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
254 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
255 | controlPoint2X = 177.5; | ||
256 | controlPoint2Y = 137.889; | ||
257 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
258 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
259 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
260 | pointX = 177.5; | ||
261 | pointY = 19.5; | ||
262 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
263 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
264 | context.lineTo(pointX, pointY); | ||
265 | pointX = 169.5; | ||
266 | pointY = 11.5; | ||
267 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
268 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
269 | controlPoint1X = 177.5; | ||
270 | controlPoint1Y = 15.111; | ||
271 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
272 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
273 | controlPoint2X = 173.889; | ||
274 | controlPoint2Y = 11.5; | ||
275 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
276 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
277 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
278 | pointX = 18.5; | ||
279 | pointY = 11.5; | ||
280 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
281 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
282 | context.lineTo(pointX, pointY); | ||
283 | pointX = 10.5; | ||
284 | pointY = 19.5; | ||
285 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
286 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
287 | controlPoint1X = 14.111; | ||
288 | controlPoint1Y = 11.5; | ||
289 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
290 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
291 | controlPoint2X = 10.5; | ||
292 | controlPoint2Y = 15.111; | ||
293 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
294 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
295 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
296 | pointX = 10.5; | ||
297 | pointY = 133.5; | ||
298 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
299 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
300 | context.lineTo(pointX, pointY); | ||
301 | pointX = 18.5; | ||
302 | pointY = 141.5; | ||
303 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
304 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
305 | controlPoint1X = 10.5; | ||
306 | controlPoint1Y = 137.889; | ||
307 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | ||
308 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | ||
309 | controlPoint2X = 14.111; | ||
310 | controlPoint2Y = 141.5; | ||
311 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | ||
312 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | ||
313 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | ||
314 | pointX = 169.5; | ||
315 | pointY = 141.5; | ||
316 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | ||
317 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | ||
318 | context.lineTo(pointX, pointY); | ||
319 | context.closePath(); | ||
320 | gradient = context.createLinearGradient(94.0, 11.5, 94.0, 141.5); | ||
321 | color = "#EE9B69"; | ||
322 | gradient.addColorStop(0.0, color); | ||
323 | color = "#E38D62"; | ||
324 | gradient.addColorStop(1.0, color); | ||
325 | context.fillStyle = gradient; | ||
326 | context.fill(); | ||
327 | |||
328 | // Shadow Effect | ||
329 | context.restore(); | ||
330 | |||
331 | context.restore(); | ||
332 | }, | ||
333 | */ | ||
334 | //------------------------------------------------------------------------- | ||
335 | |||
336 | 'updateUserDetails': function (someUserInfo) { | ||
337 | varelementName; | ||
338 | |||
339 | for (elementName in someUserInfo) { | ||
340 | this.getElement(elementName).innerHTML = someUserInfo[elementName]; | ||
341 | } | ||
342 | }, | ||
343 | |||
344 | //------------------------------------------------------------------------- | ||
345 | __syntaxFix__: "syntax fix" | ||
346 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js new file mode 100644 index 0000000..05563bf --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js | |||
@@ -0,0 +1,329 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.AppController = function(args) { | ||
32 | |||
33 | this._user = null; | ||
34 | this._tabSlotNames = { | ||
35 | //tabName: slotName | ||
36 | 'cards': 'cardGrid', | ||
37 | // 'directLogins':'directLoginGrid', | ||
38 | 'account': 'accountPanel', | ||
39 | 'data': 'dataPanel', | ||
40 | 'tools': 'toolsPanel' | ||
41 | }; | ||
42 | |||
43 | //controllers | ||
44 | this._cardsController= null; | ||
45 | //this._directLoginsController = null; | ||
46 | this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController(); | ||
47 | |||
48 | //components | ||
49 | this._appPage = null; | ||
50 | this._userInfoBox = null; | ||
51 | this._tabSidePanel = null; | ||
52 | |||
53 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'editCard', this, 'handleEditCard'); | ||
54 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'deleteCard',this, 'handleDeleteCard'); | ||
55 | |||
56 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userDataSuccessfullySaved',this, 'userDataSuccessfullySavedHandler'); | ||
57 | |||
58 | return this; | ||
59 | } | ||
60 | |||
61 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | ||
62 | |||
63 | 'toString': function() { | ||
64 | return "Clipperz.PM.UI.Web.Controllers.AppController"; | ||
65 | }, | ||
66 | |||
67 | //----------------------------------------------------------------------------- | ||
68 | |||
69 | 'setUser': function(anUser) { | ||
70 | this._user = anUser; | ||
71 | }, | ||
72 | |||
73 | 'user': function() { | ||
74 | return this._user; | ||
75 | }, | ||
76 | |||
77 | //----------------------------------------------------------------------------- | ||
78 | /* | ||
79 | 'tabSlotNames': function() { | ||
80 | return this._tabSlotNames; | ||
81 | }, | ||
82 | */ | ||
83 | 'slotNameForTab': function(aTabName) { | ||
84 | return this._tabSlotNames[aTabName]; | ||
85 | }, | ||
86 | |||
87 | 'hideAllAppPageTabSlots': function() { | ||
88 | var aTabName; | ||
89 | |||
90 | for (aTabName in this._tabSlotNames) { | ||
91 | this.appPage().hideSlot(this.slotNameForTab(aTabName)); | ||
92 | } | ||
93 | }, | ||
94 | |||
95 | //----------------------------------------------------------------------------- | ||
96 | |||
97 | 'appPage': function() { | ||
98 | if (this._appPage == null) { | ||
99 | this._appPage = new Clipperz.PM.UI.Web.Components.AppPage(); | ||
100 | } | ||
101 | |||
102 | return this._appPage; | ||
103 | }, | ||
104 | |||
105 | //----------------------------------------------------------------------------- | ||
106 | |||
107 | 'tabSidePanel': function() { | ||
108 | if (this._tabSidePanel == null) { | ||
109 | this._tabSidePanel = new Clipperz.PM.UI.Web.Components.TabSidePanel(); | ||
110 | } | ||
111 | |||
112 | return this._tabSidePanel; | ||
113 | }, | ||
114 | |||
115 | //----------------------------------------------------------------------------- | ||
116 | |||
117 | 'userInfoBox': function() { | ||
118 | if (this._userInfoBox == null) { | ||
119 | this._userInfoBox = new Clipperz.PM.UI.Web.Components.UserInfoBox(); | ||
120 | |||
121 | MochiKit.Signal.connect(this._userInfoBox, 'logout',this, 'handleLogout'); | ||
122 | MochiKit.Signal.connect(this._userInfoBox, 'lock', this, 'handleLock'); | ||
123 | MochiKit.Signal.connect(this._userInfoBox, 'unlock',this, 'handleUnlock'); | ||
124 | } | ||
125 | |||
126 | return this._userInfoBox; | ||
127 | }, | ||
128 | |||
129 | //----------------------------------------------------------------------------- | ||
130 | |||
131 | 'accountPanel': function () { | ||
132 | if (this._accountPanel == null) { | ||
133 | this._accountPanel = new Clipperz.PM.UI.Web.Components.AccountPanel(/*{selected:'Preferences'}*/); | ||
134 | } | ||
135 | |||
136 | return this._accountPanel; | ||
137 | }, | ||
138 | |||
139 | //......................................................................... | ||
140 | |||
141 | 'dataPanel': function () { | ||
142 | if (this._dataPanel == null) { | ||
143 | this._dataPanel = new Clipperz.PM.UI.Web.Components.DataPanel(); | ||
144 | } | ||
145 | |||
146 | return this._dataPanel; | ||
147 | }, | ||
148 | |||
149 | //......................................................................... | ||
150 | |||
151 | 'toolsPanel': function () { | ||
152 | if (this._toolsPanel == null) { | ||
153 | this._toolsPanel = new Clipperz.PM.UI.Web.Components.ToolsPanel(); | ||
154 | } | ||
155 | |||
156 | return this._toolsPanel; | ||
157 | }, | ||
158 | |||
159 | //----------------------------------------------------------------------------- | ||
160 | |||
161 | 'filterController': function () { | ||
162 | if (this._filterController == null) { | ||
163 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); | ||
164 | } | ||
165 | |||
166 | return this._filterController; | ||
167 | }, | ||
168 | |||
169 | 'cardsController': function() { | ||
170 | if (this._cardsController == null) { | ||
171 | this._cardsController = new Clipperz.PM.UI.Web.Controllers.CardsController({'filterController':this._filterController}); | ||
172 | } | ||
173 | |||
174 | return this._cardsController; | ||
175 | }, | ||
176 | |||
177 | //----------------------------------------------------------------------------- | ||
178 | /* | ||
179 | 'directLoginsController': function() { | ||
180 | //Clipperz.log(">>> AppController.directLoginsController"); | ||
181 | if (this._directLoginsController == null) { | ||
182 | this._directLoginsController = new Clipperz.PM.UI.Web.Controllers.DirectLoginsController({'filterController':this._filterController}); | ||
183 | } | ||
184 | //Clipperz.log("<<< AppController.directLoginsController"); | ||
185 | |||
186 | return this._directLoginsController; | ||
187 | }, | ||
188 | */ | ||
189 | //----------------------------------------------------------------------------- | ||
190 | |||
191 | 'populateUserInfo': function() { | ||
192 | var deferredResult; | ||
193 | |||
194 | deferredResult = new Clipperz.Async.Deferred("AppController.populateUserInfo", {trace:false}); | ||
195 | deferredResult.collectResults({ | ||
196 | 'username':MochiKit.Base.methodcaller('displayName'), | ||
197 | 'cardsNumber':[ | ||
198 | MochiKit.Base.methodcaller('getRecords'), | ||
199 | function (someResults) { return someResults.length; } | ||
200 | ], | ||
201 | 'directLoginsNumber': [ | ||
202 | MochiKit.Base.methodcaller('getDirectLogins'), | ||
203 | function (someResults) { return someResults.length; } | ||
204 | ] | ||
205 | }) | ||
206 | deferredResult.addMethod(this.userInfoBox(), 'updateUserDetails'); | ||
207 | deferredResult.callback(this.user()); | ||
208 | |||
209 | return deferredResult; | ||
210 | }, | ||
211 | |||
212 | //----------------------------------------------------------------------------- | ||
213 | |||
214 | 'run': function(args) { | ||
215 | var deferredResult; | ||
216 | varslot; | ||
217 | varpage; | ||
218 | var user; | ||
219 | |||
220 | slot = args.slot; | ||
221 | user = args.user; | ||
222 | |||
223 | this.setUser(user); | ||
224 | |||
225 | slot.setContent(this.appPage()); | ||
226 | |||
227 | this.appPage().slotNamed('userInfoBox').setContent(this.userInfoBox()); | ||
228 | this.appPage().slotNamed('tabSidePanel').setContent(this.tabSidePanel()); | ||
229 | |||
230 | this.appPage().slotNamed('accountPanel').setContent(this.accountPanel()); | ||
231 | this.appPage().slotNamed('dataPanel').setContent(this.dataPanel()); | ||
232 | this.appPage().slotNamed('toolsPanel').setContent(this.toolsPanel()); | ||
233 | |||
234 | this.hideAllAppPageTabSlots(); | ||
235 | this.appPage().showSlot(this.slotNameForTab('cards')); | ||
236 | |||
237 | MochiKit.Signal.connect(this.tabSidePanel(), 'tabSelected',this, 'handleTabSelected'); | ||
238 | MochiKit.Signal.connect(this.tabSidePanel(), 'addCard', this, 'handleAddCard'); | ||
239 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'addCard', this, 'handleAddCard'); | ||
240 | |||
241 | deferredResult = new Clipperz.Async.Deferred("AppController.run", {trace:false}); | ||
242 | |||
243 | deferredResult.addMethod(this.cardsController(), 'run', {slot:this.appPage().slotNamed('cardGrid'), user:user}); | ||
244 | // deferredResult.addMethod(this.directLoginsController(), 'run', {slot:this.appPage().slotNamed('directLoginGrid'), user:user}); | ||
245 | deferredResult.addMethod(this, 'populateUserInfo'); | ||
246 | |||
247 | deferredResult.addCallback(MochiKit.Visual.ScrollTo, 'miscLinks', {duration:0}); | ||
248 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN'); | ||
249 | deferredResult.addMethod(this.tabSidePanel(), 'selectTab', 'cards'); | ||
250 | deferredResult.callback(); | ||
251 | }, | ||
252 | |||
253 | //----------------------------------------------------------------------------- | ||
254 | |||
255 | 'handleTabSelected': function (selectedTabName) { | ||
256 | var aTabName; | ||
257 | var aSlotName; | ||
258 | |||
259 | //Clipperz.log(">>> AppController.handleTabSelected", selectedTabName); | ||
260 | this.hideAllAppPageTabSlots(); | ||
261 | this.appPage().showSlot(this.slotNameForTab(selectedTabName)); | ||
262 | |||
263 | switch (selectedTabName) { | ||
264 | case 'cards': | ||
265 | this.cardsController().focus(); | ||
266 | break; | ||
267 | // case 'directLogins': | ||
268 | // this.directLoginsController().focus(); | ||
269 | // break; | ||
270 | case 'data': | ||
271 | break; | ||
272 | case 'account': | ||
273 | break; | ||
274 | case 'tools': | ||
275 | break; | ||
276 | } | ||
277 | //Clipperz.log("<-- AppController.handleTabSelected", aTabName); | ||
278 | }, | ||
279 | |||
280 | //============================================================================= | ||
281 | |||
282 | 'handleAddCard': function (aSourceElement) { | ||
283 | //Clipperz.log("=== AppController.addCard", aSourceElement); | ||
284 | this.cardsController().addCard(aSourceElement); | ||
285 | }, | ||
286 | |||
287 | //============================================================================= | ||
288 | |||
289 | 'userDataSuccessfullySavedHandler': function (anEvent) { | ||
290 | this.populateUserInfo(); | ||
291 | }, | ||
292 | |||
293 | //============================================================================= | ||
294 | |||
295 | 'handleLogout': function(anEvent) { | ||
296 | var deferredResult; | ||
297 | |||
298 | deferredResult = new Clipperz.Async.Deferred("AppController.handleLogout", {trace:false}); | ||
299 | deferredResult.addMethod(this.user(), 'logout'); | ||
300 | deferredResult.addCallback(MochiKit.Signal.signal, this, 'logout'); | ||
301 | deferredResult.callback(); | ||
302 | |||
303 | return deferredResult; | ||
304 | }, | ||
305 | |||
306 | //----------------------------------------------------------------------------- | ||
307 | |||
308 | 'handleLock': function (anEvent) { | ||
309 | return Clipperz.Async.callbacks("AppController.handleLock", [ | ||
310 | MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'), | ||
311 | MochiKit.Base.method(this.user(), 'lock') | ||
312 | ], {trace:false}); | ||
313 | }, | ||
314 | |||
315 | //............................................................................. | ||
316 | |||
317 | 'handleUnlock': function (anEvent) { | ||
318 | return Clipperz.Async.callbacks("AppController.handleUnock", [ | ||
319 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'), | ||
320 | MochiKit.Base.method(this.user(), 'login'), | ||
321 | MochiKit.Base.method(this.cardsController(), 'focus'), | ||
322 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'), | ||
323 | MochiKit.Base.method(this.userInfoBox(), 'unlock') | ||
324 | ], {trace:false}); | ||
325 | }, | ||
326 | |||
327 | //============================================================================= | ||
328 | __syntaxFix__: "syntax fix" | ||
329 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js new file mode 100644 index 0000000..2340aeb --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js | |||
@@ -0,0 +1,652 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); | ||
35 | |||
36 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
37 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
38 | |||
39 | this._referenceElement = null; | ||
40 | this._cardDialogComponent = null; | ||
41 | |||
42 | this._fieldsReferences = {}; | ||
43 | this._directLoginReferences = {}; | ||
44 | |||
45 | this._directLoginWizardController = null; | ||
46 | this._directLoginEditingComponent = null; | ||
47 | this._isDirectLoginEditingComponentVisible = false; | ||
48 | |||
49 | return this; | ||
50 | }; | ||
51 | |||
52 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { | ||
53 | |||
54 | 'toString': function() { | ||
55 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; | ||
56 | }, | ||
57 | |||
58 | //------------------------------------------------------------------------- | ||
59 | |||
60 | 'record': function () { | ||
61 | return this._record; | ||
62 | }, | ||
63 | |||
64 | 'delegate': function () { | ||
65 | return this._delegate; | ||
66 | }, | ||
67 | |||
68 | //------------------------------------------------------------------------- | ||
69 | |||
70 | 'fieldsReferences': function () { | ||
71 | return this._fieldsReferences; | ||
72 | }, | ||
73 | |||
74 | 'directLoginReferences': function () { | ||
75 | return this._directLoginReferences; | ||
76 | }, | ||
77 | |||
78 | //------------------------------------------------------------------------- | ||
79 | |||
80 | 'referenceElement': function () { | ||
81 | return this._referenceElement; | ||
82 | }, | ||
83 | |||
84 | 'setReferenceElement': function (anElement) { | ||
85 | this._referenceElement = anElement; | ||
86 | }, | ||
87 | |||
88 | //------------------------------------------------------------------------- | ||
89 | |||
90 | 'cardDialogComponent': function () { | ||
91 | if (this._cardDialogComponent == null) { | ||
92 | this._cardDialogComponent = new Clipperz.PM.UI.Web.Components.CardDialogComponent(); | ||
93 | |||
94 | MochiKit.Signal.connect(this._cardDialogComponent, 'cancel', this, 'handleCancel'); | ||
95 | MochiKit.Signal.connect(this._cardDialogComponent, 'save', this, 'handleSave'); | ||
96 | |||
97 | MochiKit.Signal.connect(this._cardDialogComponent, 'addField', this, 'handleAddField'); | ||
98 | MochiKit.Signal.connect(this._cardDialogComponent, 'changedValue',this, 'handleChangedValue'); | ||
99 | |||
100 | MochiKit.Signal.connect(this._cardDialogComponent, 'addDirectLogin',this, 'handleAddDirectLogin'); | ||
101 | MochiKit.Signal.connect(this._cardDialogComponent, 'keyPressed',this, 'handleCardDialogComponentKeyPressed'); | ||
102 | } | ||
103 | |||
104 | return this._cardDialogComponent; | ||
105 | }, | ||
106 | |||
107 | //========================================================================= | ||
108 | |||
109 | 'directLoginWizardController': function () { | ||
110 | if (this._directLoginWizardController == null) { | ||
111 | this._directLoginWizardController = new Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController({ | ||
112 | 'cardLabel': this.cardDialogComponent().title(), | ||
113 | 'directLoginEditingComponent': this.directLoginEditingComponent() | ||
114 | }) | ||
115 | |||
116 | MochiKit.Signal.connect(this._directLoginWizardController, 'exit',this, 'handleHideDirectLoginEditingComponent'); | ||
117 | MochiKit.Signal.connect(this._directLoginWizardController, 'done',this, 'handleCompleteDirectLoginEditingComponent'); | ||
118 | } | ||
119 | |||
120 | return this._directLoginWizardController; | ||
121 | }, | ||
122 | |||
123 | //------------------------------------------------------------------------- | ||
124 | |||
125 | 'directLoginEditingComponent': function () { | ||
126 | if (this._directLoginEditingComponent == null) { | ||
127 | this._directLoginEditingComponent = new Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent(); | ||
128 | |||
129 | this.cardDialogComponent().renderDirectLoginEditingComponent(this._directLoginEditingComponent); | ||
130 | |||
131 | // MochiKit.Signal.connect(this._directLoginEditingComponent, 'back', this, 'handleHideDirectLoginEditingComponent') | ||
132 | // MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); | ||
133 | // MochiKit.Signal.connect(this.__directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); | ||
134 | } | ||
135 | |||
136 | return this._directLoginEditingComponent; | ||
137 | }, | ||
138 | |||
139 | //------------------------------------------------------------------------- | ||
140 | |||
141 | 'isDirectLoginEditingComponentVisible': function () { | ||
142 | return this._isDirectLoginEditingComponentVisible; | ||
143 | }, | ||
144 | |||
145 | 'setIsDirectLoginEditingComponentVisible': function (aValue) { | ||
146 | this._isDirectLoginEditingComponentVisible = aValue; | ||
147 | }, | ||
148 | |||
149 | //========================================================================= | ||
150 | |||
151 | 'run': function (anElement) { | ||
152 | var deferredResult; | ||
153 | |||
154 | this.setReferenceElement(anElement); | ||
155 | |||
156 | deferredResult = new Clipperz.Async.Deferred("CardDialogController.run", {trace:false}); | ||
157 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':11}); | ||
158 | |||
159 | deferredResult.addMethod(this.cardDialogComponent(), 'deferredShowModal', {openFromElement:this.referenceElement()}); | ||
160 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); | ||
161 | |||
162 | deferredResult.addMethod(this.record(), 'label'); | ||
163 | deferredResult.addMethod(this.cardDialogComponent(), 'setTitle'); | ||
164 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); | ||
165 | |||
166 | deferredResult.addMethod(this, 'updateComponentState'); | ||
167 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'advanceProgress'); | ||
168 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'); | ||
169 | |||
170 | deferredResult.addMethod(this.cardDialogComponent(), 'fixRendering'); | ||
171 | deferredResult.addMethod(this.cardDialogComponent(), 'hideProgressMask'); | ||
172 | |||
173 | if (this.record().isBrandNew()) { | ||
174 | deferredResult.addMethod(this.cardDialogComponent(), 'setHintMode', 'ON'); | ||
175 | deferredResult.addMethod(this.cardDialogComponent(), 'setFocusOnTitleField'); | ||
176 | } | ||
177 | |||
178 | deferredResult.addErrback(MochiKit.Base.method(this.cardDialogComponent(), 'showError')); | ||
179 | deferredResult.callback(); | ||
180 | |||
181 | return deferredResult; | ||
182 | }, | ||
183 | |||
184 | //========================================================================= | ||
185 | |||
186 | 'updateComponentState': function () { | ||
187 | return Clipperz.Async.callbacks("CardDialogController.updateComponentState", [ | ||
188 | MochiKit.Base.method(this.record(), 'hasPendingChanges'), | ||
189 | MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving'), | ||
190 | |||
191 | MochiKit.Base.method(this.record(), 'label'), | ||
192 | MochiKit.Base.method(this.cardDialogComponent(), 'setTitle'), | ||
193 | MochiKit.Base.method(this.record(), 'notes'), | ||
194 | MochiKit.Base.method(this.cardDialogComponent(), 'setNotes'), | ||
195 | |||
196 | MochiKit.Base.method(this.record(), 'fields'), | ||
197 | MochiKit.Base.values, | ||
198 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithField')), | ||
199 | |||
200 | MochiKit.Base.method(this.record(), 'directLogins'), | ||
201 | MochiKit.Base.values, | ||
202 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithDirectLogin')), | ||
203 | |||
204 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), | ||
205 | MochiKit.Base.noop | ||
206 | ], {trace:false}); | ||
207 | }, | ||
208 | |||
209 | //------------------------------------------------------------------------- | ||
210 | |||
211 | 'addCardDialogComponentWithField': function (aField) { | ||
212 | varfieldComponent; | ||
213 | |||
214 | fieldComponent = new Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent({reference: aField.reference()}); | ||
215 | MochiKit.Signal.connect(fieldComponent, 'changedValue',this, 'handleChangedValue'); | ||
216 | MochiKit.Signal.connect(fieldComponent, 'performAction',this, 'handlePerformFieldAction'); | ||
217 | MochiKit.Signal.connect(fieldComponent, 'deleteField',this, 'handleDeleteField'); | ||
218 | |||
219 | // this.fieldsReferences().push({'field':aField, 'component':fieldComponent}); | ||
220 | this.fieldsReferences()[aField.reference()] = {'field':aField, 'component':fieldComponent}; | ||
221 | |||
222 | return Clipperz.Async.callbacks("CardDialogController.addCardDialogComponentWithField", [ | ||
223 | MochiKit.Base.method(this.cardDialogComponent(), 'addFieldRowComponent', fieldComponent), | ||
224 | |||
225 | MochiKit.Base.method(aField, 'label'), | ||
226 | MochiKit.Base.method(fieldComponent, 'setLabel'), | ||
227 | MochiKit.Base.method(aField, 'value'), | ||
228 | MochiKit.Base.method(fieldComponent, 'setValue'), | ||
229 | MochiKit.Base.method(aField, 'actionType'), | ||
230 | MochiKit.Base.method(fieldComponent, 'setActionType'), | ||
231 | MochiKit.Base.method(aField, 'isHidden'), | ||
232 | MochiKit.Base.method(fieldComponent, 'setIsHidden') | ||
233 | ], {trace:false}); | ||
234 | }, | ||
235 | |||
236 | //------------------------------------------------------------------------- | ||
237 | |||
238 | 'addCardDialogComponentWithDirectLogin': function (aDirectLogin) { | ||
239 | var directLoginComponent; | ||
240 | |||
241 | directLoginComponent = new Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent({reference: aDirectLogin.reference()}); | ||
242 | MochiKit.Signal.connect(directLoginComponent, 'changedValue', this, 'handleChangedValue'); | ||
243 | MochiKit.Signal.connect(directLoginComponent, 'deleteDirectLogin',this, 'handleDeleteDirectLogin'); | ||
244 | MochiKit.Signal.connect(directLoginComponent, 'editDirectLogin',this, 'handleEditDirectLogin'); | ||
245 | MochiKit.Signal.connect(directLoginComponent, 'openDirectLogin',this, 'handleOpenDirectLogin'); | ||
246 | |||
247 | this.directLoginReferences()[aDirectLogin.reference()] = {'directLogin':aDirectLogin, 'component':directLoginComponent}; | ||
248 | |||
249 | return Clipperz.Async.callbacks("CardDialogController.addCardDialogComponentWithDirectLogin", [ | ||
250 | MochiKit.Base.method(this.cardDialogComponent(), 'addDirectLoginComponent', directLoginComponent), | ||
251 | MochiKit.Base.method(this, 'refreshDirectLoginComponent', this.directLoginReferences()[aDirectLogin.reference()]) | ||
252 | ], {trace:false}); | ||
253 | }, | ||
254 | |||
255 | //------------------------------------------------------------------------- | ||
256 | |||
257 | 'refreshDirectLoginComponent': function (aDirectLoginReference) { | ||
258 | return Clipperz.Async.callbacks("CardDialogController.refreshDirectLoginComponent", [ | ||
259 | MochiKit.Base.method(aDirectLoginReference['directLogin'],'favicon'), | ||
260 | // MochiKit.Base.method(aDirectLoginReference['directLogin'],'faviconData'), | ||
261 | MochiKit.Base.method(aDirectLoginReference['component'],'setFavicon'), | ||
262 | MochiKit.Base.method(aDirectLoginReference['directLogin'],'label'), | ||
263 | MochiKit.Base.method(aDirectLoginReference['component'],'setLabel') | ||
264 | ], {trace:false}); | ||
265 | }, | ||
266 | |||
267 | 'refreshDirectLoginComponents': function () { | ||
268 | return Clipperz.Async.callbacks("CardDialogController.refreshDirectLoginComponents", [ | ||
269 | MochiKit.Base.method(this, 'directLoginReferences'), | ||
270 | MochiKit.Base.values, | ||
271 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'refreshDirectLoginComponent')), | ||
272 | Clipperz.Async.collectAll | ||
273 | ]) | ||
274 | }, | ||
275 | |||
276 | //------------------------------------------------------------------------- | ||
277 | |||
278 | 'updateRecordValues': function () { | ||
279 | return Clipperz.Async.callbacks('CardDialogController.updateRecordValues', [ | ||
280 | MochiKit.Base.method(this.cardDialogComponent(), 'title'), | ||
281 | MochiKit.Base.method(this.record(), 'setLabel'), | ||
282 | MochiKit.Base.method(this.cardDialogComponent(), 'notes'), | ||
283 | MochiKit.Base.method(this.record(), 'setNotes'), | ||
284 | |||
285 | MochiKit.Base.method(this, 'fieldsReferences'), | ||
286 | MochiKit.Base.values, | ||
287 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'updateRecordFieldValues')), | ||
288 | |||
289 | MochiKit.Base.method(this, 'directLoginReferences'), | ||
290 | MochiKit.Base.values, | ||
291 | MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'updateRecordDirectLoginValues')), | ||
292 | |||
293 | MochiKit.Base.method(this.directLoginEditingComponent(), 'directLoginReference'), | ||
294 | MochiKit.Base.method(this.record(), 'directLoginWithReference'), | ||
295 | MochiKit.Base.method(this, 'updateRecordDirectLoginDetails'), | ||
296 | |||
297 | MochiKit.Base.noop | ||
298 | ], {trace:false}); | ||
299 | }, | ||
300 | |||
301 | //------------------------------------------------------------------------- | ||
302 | |||
303 | 'updateRecordFieldValues': function (aFieldReference) { | ||
304 | var deferredResult; | ||
305 | |||
306 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordFieldValues', [ | ||
307 | MochiKit.Base.method(aFieldReference['component'],'label'), | ||
308 | MochiKit.Base.method(aFieldReference['field'], 'setLabel'), | ||
309 | |||
310 | MochiKit.Base.method(aFieldReference['component'],'value'), | ||
311 | MochiKit.Base.method(aFieldReference['field'], 'setValue'), | ||
312 | |||
313 | MochiKit.Base.method(aFieldReference['component'],'isHidden'), | ||
314 | MochiKit.Base.method(aFieldReference['field'], 'setIsHidden'), | ||
315 | |||
316 | MochiKit.Base.method(aFieldReference['field'], 'actionType'), | ||
317 | MochiKit.Base.method(aFieldReference['component'],'setActionType') | ||
318 | ], {trace:false}); | ||
319 | |||
320 | return deferredResult; | ||
321 | }, | ||
322 | |||
323 | //------------------------------------------------------------------------- | ||
324 | |||
325 | 'updateRecordDirectLoginValues': function (aDirectLoginReference) { | ||
326 | var deferredResult; | ||
327 | |||
328 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordDirectLoginValues', [ | ||
329 | MochiKit.Base.method(aDirectLoginReference['component'], 'label'), | ||
330 | MochiKit.Base.method(aDirectLoginReference['directLogin'], 'setLabel') | ||
331 | ], {trace:false}); | ||
332 | |||
333 | return deferredResult; | ||
334 | }, | ||
335 | |||
336 | //------------------------------------------------------------------------- | ||
337 | |||
338 | 'updateRecordDirectLoginDetails': function (aDirectLogin) { | ||
339 | var result; | ||
340 | |||
341 | if (MochiKit.Base.isUndefinedOrNull(aDirectLogin)) { | ||
342 | result = MochiKit.Async.succeed(); | ||
343 | } else { | ||
344 | result = Clipperz.Async.callbacks("CardDialogController.updateRecordDirectLoginDetails", [ | ||
345 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), | ||
346 | MochiKit.Base.method(aDirectLogin, 'setLabel'), | ||
347 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), | ||
348 | MochiKit.Base.method(aDirectLogin, 'setFavicon') | ||
349 | ], {trace:false}); | ||
350 | } | ||
351 | |||
352 | return result; | ||
353 | }, | ||
354 | |||
355 | //========================================================================= | ||
356 | |||
357 | 'addField': function () { | ||
358 | return this.record().addField({ | ||
359 | 'label':this.cardDialogComponent().newFieldLabel(), | ||
360 | 'value':this.cardDialogComponent().newFieldValue(), | ||
361 | 'isHidden':this.cardDialogComponent().newFieldIsHidden() | ||
362 | }); | ||
363 | }, | ||
364 | |||
365 | 'handleAddField': function () { | ||
366 | return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ | ||
367 | MochiKit.Base.method(this, 'addField'), | ||
368 | |||
369 | MochiKit.Base.method(this, 'addCardDialogComponentWithField'), | ||
370 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), | ||
371 | |||
372 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | ||
373 | MochiKit.Base.method(this, 'handleChangedValue') | ||
374 | ], {trace:false}) | ||
375 | }, | ||
376 | |||
377 | //------------------------------------------------------------------------- | ||
378 | |||
379 | 'handlePerformFieldAction': function (aFieldID, aTargetElement) { | ||
380 | //console.log("### targetElement", aTargetElement); | ||
381 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | ||
382 | MochiKit.Base.method(this.record(), 'fields'), | ||
383 | MochiKit.Base.itemgetter(aFieldID), | ||
384 | Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { | ||
385 | 'value':MochiKit.Base.methodcaller('value'), | ||
386 | 'type': MochiKit.Base.methodcaller('actionType') | ||
387 | }, {trace:false}), | ||
388 | MochiKit.Base.bind(function (someValues) { | ||
389 | switch (someValues['type']) { | ||
390 | case 'NONE': | ||
391 | throw "this event handler should not be triggered for fields with type 'NONE'"; | ||
392 | break; | ||
393 | case 'URL': | ||
394 | var url; | ||
395 | |||
396 | url = someValues['value']; | ||
397 | if (/^https?\:\/\//.test(url) == false) { | ||
398 | url = 'http://' + url; | ||
399 | } | ||
400 | |||
401 | window.open(url); | ||
402 | break; | ||
403 | case 'EMAIL': | ||
404 | var url; | ||
405 | |||
406 | url = 'mailto:' + someValues['value']; | ||
407 | |||
408 | MochiKit.DOM.currentWindow().location = url; | ||
409 | break; | ||
410 | case 'PASSWORD': | ||
411 | //Clipperz.log("SHOW PASSWORD " + someValues['value']); | ||
412 | this.showPasswordTooltip(someValues['value'], aTargetElement); | ||
413 | break; | ||
414 | } | ||
415 | }, this) | ||
416 | ], {trace:false}); | ||
417 | }, | ||
418 | |||
419 | //------------------------------------------------------------------------- | ||
420 | |||
421 | 'handleDeleteField': function (aFieldID) { | ||
422 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | ||
423 | MochiKit.Base.method(this.record(), 'fields'), | ||
424 | MochiKit.Base.itemgetter(aFieldID), | ||
425 | MochiKit.Base.method(this.record(), 'removeField'), | ||
426 | |||
427 | MochiKit.Base.method(this, 'fieldsReferences'), | ||
428 | MochiKit.Base.itemgetter(aFieldID), | ||
429 | MochiKit.Base.itemgetter('component'), | ||
430 | |||
431 | function (aComponent) { | ||
432 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField [fade and remove]", [ | ||
433 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | ||
434 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | ||
435 | MochiKit.Base.method(aComponent, 'remove') | ||
436 | ], {trace:false}); | ||
437 | }, | ||
438 | |||
439 | MochiKit.Base.bind(function () { | ||
440 | delete this.fieldsReferences()[aFieldID]; | ||
441 | }, this), | ||
442 | |||
443 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | ||
444 | MochiKit.Base.method(this, 'handleChangedValue') | ||
445 | ], {trace:false}); | ||
446 | }, | ||
447 | |||
448 | //========================================================================= | ||
449 | |||
450 | 'handleDeleteDirectLogin': function(aDirectLoginReference) { | ||
451 | var cardDialogComponent; | ||
452 | |||
453 | cardDialogComponent = this.cardDialogComponent(); | ||
454 | |||
455 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteDirectLogin", [ | ||
456 | MochiKit.Base.method(this.record(), 'directLogins'), | ||
457 | MochiKit.Base.itemgetter(aDirectLoginReference), | ||
458 | MochiKit.Base.methodcaller('remove'), | ||
459 | |||
460 | MochiKit.Base.method(this, 'directLoginReferences'), | ||
461 | MochiKit.Base.itemgetter(aDirectLoginReference), | ||
462 | MochiKit.Base.itemgetter('component'), | ||
463 | |||
464 | function (aComponent) { | ||
465 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteDirectLogin [fade and remove]", [ | ||
466 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}),// Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | ||
467 | /// MochiKit.Base.method(aComponent, 'remove') | ||
468 | MochiKit.Base.method(cardDialogComponent, 'removeDirectLoginComponent', aComponent) | ||
469 | ], {trace:false}); | ||
470 | }, | ||
471 | |||
472 | MochiKit.Base.bind(function () { | ||
473 | delete this.directLoginReferences()[aDirectLoginReference]; | ||
474 | }, this), | ||
475 | |||
476 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | ||
477 | MochiKit.Base.method(this, 'handleChangedValue') | ||
478 | ], {trace:false}); | ||
479 | }, | ||
480 | |||
481 | //------------------------------------------------------------------------- | ||
482 | |||
483 | 'handleOpenDirectLogin': function (aDirectLoginReference) { | ||
484 | return Clipperz.Async.callbacks("CardDialogController.handleOpenDirectLogin", [ | ||
485 | MochiKit.Base.method(this.record(), 'directLoginWithReference', aDirectLoginReference), | ||
486 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin | ||
487 | ], {trace:false}); | ||
488 | }, | ||
489 | |||
490 | //------------------------------------------------------------------------- | ||
491 | |||
492 | 'handleEditDirectLogin': function (aDirectLoginReference) { | ||
493 | return Clipperz.Async.callbacks("CardDialogController.handleEditDirectLogin", [ | ||
494 | MochiKit.Base.method(this, 'setIsDirectLoginEditingComponentVisible', true), | ||
495 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setDirectLoginReference', aDirectLoginReference), | ||
496 | MochiKit.Base.method(this.cardDialogComponent(), 'placeDirectLoginEditingComponent'), | ||
497 | MochiKit.Base.method(this.record(), 'directLoginWithReference', aDirectLoginReference), | ||
498 | MochiKit.Base.method(this.directLoginWizardController(), 'runWithDirectLogin'), | ||
499 | MochiKit.Base.method(this.directLoginWizardController(), 'fixRulerRendering', this.cardDialogComponent().displayMode()), | ||
500 | MochiKit.Base.method(this.cardDialogComponent(), 'showDirectLoginEditingComponent') | ||
501 | ], {trace:false}); | ||
502 | }, | ||
503 | |||
504 | //------------------------------------------------------------------------- | ||
505 | |||
506 | 'handleHideDirectLoginEditingComponent': function () { | ||
507 | return Clipperz.Async.callbacks("CardDialogController.handleHideDirectLoginEditingComponent", [ | ||
508 | MochiKit.Base.method(this, 'setIsDirectLoginEditingComponentVisible', false), | ||
509 | MochiKit.Base.method(this.directLoginWizardController(), 'hideRuler'), | ||
510 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setDirectLoginReference', null), | ||
511 | MochiKit.Base.method(this, 'refreshDirectLoginComponents'), | ||
512 | MochiKit.Base.method(this.cardDialogComponent(), 'hideDirectLoginEditingComponent') | ||
513 | ], {trace:false}) | ||
514 | }, | ||
515 | |||
516 | 'handleCompleteDirectLoginEditingComponent': function (someParameters) { | ||
517 | return Clipperz.Async.callbacks("CardDialogController.handleCompleteDirectLoginEditingComponent", [ | ||
518 | MochiKit.Base.method(this, 'setIsDirectLoginEditingComponentVisible', false), | ||
519 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setDirectLoginReference', null), | ||
520 | MochiKit.Base.partial(MochiKit.Async.succeed, someParameters['hasJustBeenAdded']), | ||
521 | Clipperz.Async.deferredIf("CardDialogController.handleCompleteDirectLoginEditingComponent - should addTheEditedDirectLogin", [ | ||
522 | MochiKit.Base.method(this, 'addCardDialogComponentWithDirectLogin', someParameters['directLogin']) | ||
523 | ], []), | ||
524 | MochiKit.Base.method(this, 'refreshDirectLoginComponents'), | ||
525 | MochiKit.Base.method(this, 'handleChangedValue'), | ||
526 | MochiKit.Base.method(this.cardDialogComponent(), 'hideDirectLoginEditingComponent') | ||
527 | ], {trace:false}) | ||
528 | }, | ||
529 | |||
530 | //========================================================================= | ||
531 | |||
532 | 'handleChangedValue': function () { | ||
533 | return Clipperz.Async.callbacks("CardDialogController.handleChangedValue", [ | ||
534 | MochiKit.Base.method(this, 'updateRecordValues'), | ||
535 | MochiKit.Base.method(this.record(), 'hasPendingChanges'), | ||
536 | MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving') | ||
537 | ], {trace:false}); | ||
538 | }, | ||
539 | |||
540 | //------------------------------------------------------------------------- | ||
541 | |||
542 | 'handleSave': function () { | ||
543 | var deferredResult; | ||
544 | |||
545 | deferredResult = new Clipperz.Async.Deferred("CardDialogController.handleSave", {trace:false}); | ||
546 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':8}); | ||
547 | deferredResult.addMethod(this.cardDialogComponent(), 'showProgressMask'); | ||
548 | deferredResult.addMethod(this.cardDialogComponent(), 'newFieldHasPendingChanges'); | ||
549 | deferredResult.addIf([ | ||
550 | MochiKit.Base.method(this, 'addField') | ||
551 | ], []) | ||
552 | deferredResult.addMethod(this, 'saveChanges'); | ||
553 | deferredResult.addMethod(this.cardDialogComponent(), 'deferredHideModal', {closeToElement:null}); | ||
554 | deferredResult.addMethod(this.cardDialogComponent(), 'remove'); | ||
555 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed'); | ||
556 | |||
557 | deferredResult.callback(); | ||
558 | |||
559 | return deferredResult; | ||
560 | }, | ||
561 | |||
562 | //......................................................................... | ||
563 | |||
564 | 'saveChanges': function () { | ||
565 | var deferredResult; | ||
566 | |||
567 | deferredResult = new Clipperz.Async.Deferred("CardDialogController.handleSave", {trace:false}); | ||
568 | deferredResult.addMethod(this.delegate(), 'saveChanges'); | ||
569 | deferredResult.addErrback(function (aValue) { Clipperz.log("SHIT HAPPENS!!"); return aValue; }); | ||
570 | |||
571 | deferredResult.callback(); | ||
572 | |||
573 | return deferredResult; | ||
574 | }, | ||
575 | |||
576 | //------------------------------------------------------------------------- | ||
577 | |||
578 | 'handleCancel': function () { | ||
579 | var deferredResult; | ||
580 | |||
581 | if (this.isDirectLoginEditingComponentVisible()) { | ||
582 | deferredResult = this.handleHideDirectLoginEditingComponent(); | ||
583 | } else { | ||
584 | deferredResult = new Clipperz.Async.Deferred("CardDialogController.handleCancel", {trace:false}); | ||
585 | // deferredResult.addMethod(this.record(), 'hasPendingChanges'), | ||
586 | deferredResult.addMethod(this.delegate(), 'hasPendingChanges'), | ||
587 | deferredResult.addIf([ | ||
588 | MochiKit.Base.method(this.cardDialogComponent(), 'askConfirmationForLoosingPendingChanges') | ||
589 | ], []) | ||
590 | deferredResult.addMethod(this.delegate(), 'revertChanges'); | ||
591 | deferredResult.addMethod(this.cardDialogComponent(), 'deferredHideModal', {closeToElement:this.referenceElement()}); | ||
592 | deferredResult.addMethod(this.cardDialogComponent(), 'remove'); | ||
593 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed'); | ||
594 | |||
595 | deferredResult.callback(); | ||
596 | } | ||
597 | |||
598 | return deferredResult; | ||
599 | }, | ||
600 | |||
601 | //------------------------------------------------------------------------- | ||
602 | |||
603 | 'handleAddDirectLogin': function () { | ||
604 | return Clipperz.Async.callbacks("CardDialogController.handleAddDirectLogin", [ | ||
605 | MochiKit.Base.method(this.record(), 'createNewDirectLogin'), | ||
606 | MochiKit.Base.bind(function (aDirectLogin) { | ||
607 | return Clipperz.Async.callbacks("CardDialogController.handleAddDirectLogin - directLogin", [ | ||
608 | MochiKit.Base.method(this.cardDialogComponent(), 'newFieldHasPendingChanges'), | ||
609 | Clipperz.Async.deferredIf("cardDialogComponent.newFieldHasPendingChanges", [ | ||
610 | MochiKit.Base.method(this, 'handleAddField') | ||
611 | ], []), | ||
612 | |||
613 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setDirectLoginReference', aDirectLogin.reference()), | ||
614 | MochiKit.Base.method(this.cardDialogComponent(), 'placeDirectLoginEditingComponent'), | ||
615 | MochiKit.Base.method(this.directLoginWizardController(), 'runWithDirectLogin', aDirectLogin, true), | ||
616 | MochiKit.Base.method(this.directLoginWizardController(), 'fixRulerRendering', this.cardDialogComponent().displayMode()), | ||
617 | MochiKit.Base.method(this.cardDialogComponent(), 'showDirectLoginEditingComponent') | ||
618 | ], {trace:false}); | ||
619 | }, this) | ||
620 | ], {trace:false}); | ||
621 | }, | ||
622 | |||
623 | //========================================================================= | ||
624 | |||
625 | 'handleCardDialogComponentKeyPressed': function (anEvent) { | ||
626 | if ((anEvent.key().string == 'KEY_TAB') && this.cardDialogComponent().newFieldHasPendingChanges()) { | ||
627 | anEvent.preventDefault(); | ||
628 | |||
629 | // MochiKit.Signal.signal(this.cardDialogComponent(), 'addField'); | ||
630 | this.handleAddField() | ||
631 | this.cardDialogComponent().focusOnNewFieldLabel(); | ||
632 | } | ||
633 | }, | ||
634 | |||
635 | //========================================================================= | ||
636 | |||
637 | 'showPasswordTooltip': function (aValue, anElement) { | ||
638 | varpasswordTooltip; | ||
639 | |||
640 | passwordTooltip = new Clipperz.PM.UI.Web.Components.PasswordTooltip({ | ||
641 | 'referebceElement': anElement, | ||
642 | 'text': aValue | ||
643 | }); | ||
644 | |||
645 | passwordTooltip.show(); | ||
646 | |||
647 | |||
648 | }, | ||
649 | |||
650 | //========================================================================= | ||
651 | __syntaxFix__: "syntax fix" | ||
652 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js new file mode 100644 index 0000000..b1a34b2 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.CardsController = function() { | ||
32 | Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); | ||
33 | |||
34 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); | ||
35 | |||
36 | return this; | ||
37 | } | ||
38 | |||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { | ||
40 | |||
41 | 'toString': function() { | ||
42 | return "Clipperz.PM.UI.Web.Controllers.CardsController"; | ||
43 | }, | ||
44 | |||
45 | 'createGrid': function () { | ||
46 | var grid; | ||
47 | |||
48 | grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | ||
49 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | ||
50 | 'name': 'Cards.favicon', | ||
51 | 'selector': MochiKit.Base.methodcaller('favicon'), | ||
52 | 'cssClass': 'favicon' | ||
53 | }), | ||
54 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | ||
55 | 'name': 'Cards.title', | ||
56 | 'selector': MochiKit.Base.methodcaller('label'), | ||
57 | 'label': 'title', | ||
58 | 'cssClass': 'title', | ||
59 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | ||
60 | 'sortable': true, | ||
61 | 'sorted': 'ASCENDING', | ||
62 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'editCard', {objectData:anObject, element:anEvent.src()})} | ||
63 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | ||
64 | }), | ||
65 | new Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager({ | ||
66 | 'name': 'Cards.directLogins', | ||
67 | 'selector': MochiKit.Base.methodcaller('directLoginReferences'), | ||
68 | 'label': 'direct logins', | ||
69 | 'cssClass': 'directLogin' | ||
70 | }), | ||
71 | new Clipperz.PM.UI.Web.Components.DateColumnManager({ | ||
72 | 'name': 'Cards.latestUpdate', | ||
73 | 'selector': MochiKit.Base.methodcaller('updateDate'), | ||
74 | 'label': 'latest update', | ||
75 | 'cssClass': 'latestUpdate', | ||
76 | 'format': 'd-m-Y', | ||
77 | 'comparator': MochiKit.Base.compare, | ||
78 | 'sortable': true, | ||
79 | 'sorted': 'UNSORTED' | ||
80 | }), | ||
81 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ | ||
82 | 'name': 'Cards.delete', | ||
83 | 'selector': MochiKit.Base.noop, | ||
84 | 'cssClass': 'delete', | ||
85 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteCard', {objectData:anObject, element:anEvent.src()})} | ||
86 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteCard') | ||
87 | }) | ||
88 | ]}); | ||
89 | |||
90 | grid.setComponentForSlotNamed(new Clipperz.PM.UI.Web.Components.BookmarkletComponent(), 'headerSlot'); | ||
91 | |||
92 | return grid; | ||
93 | }, | ||
94 | |||
95 | //----------------------------------------------------------------------------- | ||
96 | |||
97 | 'getRows': function () { | ||
98 | //TODO relying on user() in GridController, bad code smell :| | ||
99 | return this.user().getRecords(); | ||
100 | }, | ||
101 | |||
102 | //============================================================================= | ||
103 | |||
104 | 'displayEmptyContent': function () { | ||
105 | varemptyGridComponent; | ||
106 | |||
107 | emptyGridComponent = new Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent(); | ||
108 | |||
109 | return Clipperz.Async.callbacks("CardsController.displayEmptyContent", [ | ||
110 | MochiKit.Base.method(this.grid(), 'setNoRowsGridComponent', emptyGridComponent), | ||
111 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Controllers.CardsController.superclass.displayEmptyContent, this) | ||
112 | ], {trace:false}); | ||
113 | }, | ||
114 | |||
115 | 'displaySelectedRows': function (aFilter) { | ||
116 | this.columnManagerWithName('Cards.directLogins').hideDirectLoginListPopup(); | ||
117 | |||
118 | return Clipperz.PM.UI.Web.Controllers.CardsController.superclass.displaySelectedRows.apply(this, arguments); | ||
119 | }, | ||
120 | |||
121 | //============================================================================= | ||
122 | |||
123 | 'handleShowCard': function (anObject, anEvent) { | ||
124 | var cardDialogController; | ||
125 | |||
126 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:anObject, delegate:this}); | ||
127 | this.grid().selectRow(anObject); | ||
128 | |||
129 | cardDialogController.run(anEvent.src()); | ||
130 | }, | ||
131 | |||
132 | //......................................................................... | ||
133 | |||
134 | 'handleHideCard': function () { | ||
135 | this.focus(); | ||
136 | }, | ||
137 | |||
138 | //----------------------------------------------------------------------------- | ||
139 | |||
140 | 'addCard': function (aSourceElement) { | ||
141 | return Clipperz.Async.callbacks("CardsController.addCard", [ | ||
142 | Clipperz.Async.collectResults("CardsController.addCard <inner results>", { | ||
143 | 'record': MochiKit.Base.method(this.user(), 'createNewRecord'), | ||
144 | 'delegate':MochiKit.Base.partial(MochiKit.Async.succeed, this) | ||
145 | }, {trace:false}), | ||
146 | function (someParameters) { | ||
147 | return new Clipperz.PM.UI.Web.Controllers.CardDialogController(someParameters); | ||
148 | }, | ||
149 | MochiKit.Base.methodcaller('run', aSourceElement) | ||
150 | ], {trace:false}); | ||
151 | }, | ||
152 | |||
153 | //----------------------------------------------------------------------------- | ||
154 | |||
155 | 'handleDeleteCard': function (anObject, anEvent) { | ||
156 | var deferredResult; | ||
157 | var confirmationDialog; | ||
158 | |||
159 | // confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ | ||
160 | confirmationDialog = new Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar({ | ||
161 | 'title':"Delete Card", | ||
162 | 'text': "Do you want to delete …", | ||
163 | 'type': 'ALERT', | ||
164 | 'buttons': [ | ||
165 | {text:"Cancel",result:'CANCEL'}, | ||
166 | {text:"Delete", result:'OK', isDefault:true} | ||
167 | ], | ||
168 | 'canCancelWhileProcessing':false | ||
169 | }); | ||
170 | |||
171 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDeleteCard", {trace:false}); | ||
172 | deferredResult.addCallback(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':5}), | ||
173 | deferredResult.addMethod(this.grid(), 'selectRow', anObject); | ||
174 | deferredResult.addMethod(confirmationDialog, 'deferredShowModal', { | ||
175 | 'openFromElement': anEvent.src(), | ||
176 | 'onOkCloseToElement': null, //MochiKit.DOM.currentDocument().body, | ||
177 | 'onCancelCloseToElement':anEvent.src() | ||
178 | }); | ||
179 | // deferredResult.addCallback(function () { Clipperz.log("DELETE: " + anObject.toString(), anObject); }); | ||
180 | deferredResult.addMethod(this.user(), 'deleteRecord', anObject); | ||
181 | deferredResult.addBothPass(MochiKit.Base.method(this.grid(), 'unselectRow', anObject)); | ||
182 | deferredResult.addMethod(this, 'saveChanges'); | ||
183 | deferredResult.addMethod(confirmationDialog, 'deferredDone'); | ||
184 | deferredResult.addErrbackPass(function (anError) { | ||
185 | var result; | ||
186 | |||
187 | if (! (anError instanceof MochiKit.Async.CancelledError)) { | ||
188 | result = confirmationDialog.deferredError({ | ||
189 | 'type': 'ALERT', | ||
190 | 'title':"Error", | ||
191 | 'text': Clipperz.PM.Strings.errorDescriptionForException(anError), | ||
192 | 'buttons':[{text:"Close", result:'CANCEL', isDefault:true}] | ||
193 | }) | ||
194 | } else { | ||
195 | result = anError; | ||
196 | } | ||
197 | |||
198 | return result; | ||
199 | }); | ||
200 | deferredResult.callback(); | ||
201 | |||
202 | return deferredResult; | ||
203 | }, | ||
204 | |||
205 | //============================================================================= | ||
206 | __syntaxFix__: "syntax fix" | ||
207 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js new file mode 100644 index 0000000..38fdc08 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js | |||
@@ -0,0 +1,611 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) { | ||
32 | this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
33 | this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); | ||
34 | |||
35 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); | ||
36 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); | ||
37 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); | ||
38 | |||
39 | this._directLogin = null; | ||
40 | this._directLoginHasJustBeenAdded = false; | ||
41 | |||
42 | this._rulerComponent = null; | ||
43 | |||
44 | this._steps = null; | ||
45 | this._currentStepIndex = 0; | ||
46 | this._isNextEnabled = false; | ||
47 | |||
48 | this._recordFields = null; | ||
49 | this._originalBindings = null; | ||
50 | |||
51 | this._bindingComponents = []; | ||
52 | this._formValueComponents = []; | ||
53 | |||
54 | return this; | ||
55 | } | ||
56 | |||
57 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.prototype, { | ||
58 | |||
59 | 'toString': function() { | ||
60 | return "Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController"; | ||
61 | }, | ||
62 | |||
63 | //------------------------------------------------------------------------- | ||
64 | |||
65 | 'directLogin': function () { | ||
66 | return this._directLogin; | ||
67 | }, | ||
68 | |||
69 | //------------------------------------------------------------------------- | ||
70 | |||
71 | 'directLoginHasJustBeenAdded': function () { | ||
72 | return this._directLoginHasJustBeenAdded; | ||
73 | }, | ||
74 | |||
75 | 'setDirectLoginHasJustBeenAdded': function (aValue) { | ||
76 | this._directLoginHasJustBeenAdded = aValue; | ||
77 | }, | ||
78 | |||
79 | //------------------------------------------------------------------------- | ||
80 | |||
81 | 'directLoginEditingComponent': function () { | ||
82 | return this._directLoginEditingComponent; | ||
83 | }, | ||
84 | |||
85 | //============================================================================= | ||
86 | |||
87 | 'cardLabel': function () { | ||
88 | return this._cardLabel; | ||
89 | }, | ||
90 | |||
91 | //============================================================================= | ||
92 | |||
93 | 'resetCurrentStepIndex': function () { | ||
94 | this._currentStepIndex = 0; | ||
95 | this.rulerComponent().resetStatus(); | ||
96 | }, | ||
97 | |||
98 | //----------------------------------------------------------------------------- | ||
99 | |||
100 | 'enableNext': function (aValue) { | ||
101 | this.rulerComponent().enableNext(aValue); | ||
102 | this._isNextEnabled = aValue; | ||
103 | }, | ||
104 | |||
105 | 'isNextEnabled': function () { | ||
106 | return this._isNextEnabled; | ||
107 | }, | ||
108 | |||
109 | //----------------------------------------------------------------------------- | ||
110 | |||
111 | 'enablePrevious': function (aValue) { | ||
112 | this.rulerComponent().enablePrevious(aValue); | ||
113 | }, | ||
114 | |||
115 | //============================================================================= | ||
116 | |||
117 | 'bindingComponents': function () { | ||
118 | return this._bindingComponents; | ||
119 | }, | ||
120 | |||
121 | 'resetBindingComponents': function () { | ||
122 | this.directLoginEditingComponent().clearAllBindingsComponents(); | ||
123 | this._bindingComponents = []; | ||
124 | }, | ||
125 | |||
126 | //============================================================================= | ||
127 | |||
128 | 'formValueComponents': function () { | ||
129 | return this._formValueComponents; | ||
130 | }, | ||
131 | |||
132 | 'resetFormValueComponents': function () { | ||
133 | this.directLoginEditingComponent().clearAllFormValueComponents(); | ||
134 | this._formValueComponents = []; | ||
135 | }, | ||
136 | |||
137 | //============================================================================= | ||
138 | |||
139 | 'recordFields': function () { | ||
140 | return this._recordFields; | ||
141 | }, | ||
142 | |||
143 | 'setRecordFields': function (aValue) { | ||
144 | this._recordFields = aValue; | ||
145 | }, | ||
146 | |||
147 | 'recordFieldWithReference': function (aReference) { | ||
148 | var matchingValues; | ||
149 | var result; | ||
150 | |||
151 | matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); | ||
152 | |||
153 | if (matchingValues.length == 0) { | ||
154 | result = null; | ||
155 | } else { | ||
156 | result = matchingValues[0]; | ||
157 | } | ||
158 | |||
159 | return result; | ||
160 | }, | ||
161 | |||
162 | //----------------------------------------------------------------------------- | ||
163 | |||
164 | 'originalBindings': function () { | ||
165 | return this._originalBindings; | ||
166 | }, | ||
167 | |||
168 | 'setOriginalBindings': function (aValue) { | ||
169 | //console.log("BINDINGS", aValue); | ||
170 | this._originalBindings = aValue; | ||
171 | }, | ||
172 | |||
173 | //============================================================================= | ||
174 | |||
175 | 'rulerComponent': function () { | ||
176 | if (this._rulerComponent == null) { | ||
177 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | ||
178 | translationContext:'Wizards.DirectLoginWizard' | ||
179 | }); | ||
180 | this._rulerComponent.render(); | ||
181 | |||
182 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | ||
183 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | ||
184 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | ||
185 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | ||
186 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | ||
187 | } | ||
188 | |||
189 | return this._rulerComponent; | ||
190 | }, | ||
191 | |||
192 | //----------------------------------------------------------------------------- | ||
193 | |||
194 | 'showRuler': function (someSteps) { | ||
195 | var rulerElement; | ||
196 | |||
197 | this.setSteps(someSteps); | ||
198 | |||
199 | rulerElement = this.rulerComponent().element(); | ||
200 | this.directLoginEditingComponent().disableAllPanels(); | ||
201 | |||
202 | MochiKit.Style.showElement(rulerElement); | ||
203 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.directLoginEditingComponent().bottomMargin()}); | ||
204 | new MochiKit.Visual.Move(rulerElement, { | ||
205 | x:0, y:this.directLoginEditingComponent().bottomMargin(), | ||
206 | mode:'absolute', | ||
207 | duration:1, | ||
208 | afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') | ||
209 | }); | ||
210 | }, | ||
211 | |||
212 | 'fixRulerRendering': function (aValue) { | ||
213 | this.rulerComponent().setDisplayMode(aValue); | ||
214 | }, | ||
215 | |||
216 | //----------------------------------------------------------------------------- | ||
217 | |||
218 | 'hideRuler': function () { | ||
219 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:1}); | ||
220 | }, | ||
221 | |||
222 | 'doneWithRuler': function () { | ||
223 | var rulerComponentElement; | ||
224 | |||
225 | rulerComponentElement = this.rulerComponent().element(); | ||
226 | new MochiKit.Visual.Move(this.rulerComponent().element(), { | ||
227 | x:1000, | ||
228 | mode:'relative', | ||
229 | duration:1, | ||
230 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) | ||
231 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } | ||
232 | }); | ||
233 | }, | ||
234 | |||
235 | //============================================================================= | ||
236 | |||
237 | 'addNewDirectLoginRulerSteps': function () { | ||
238 | return MochiKit.Base.concat([ 'LABEL'], this.editDirectLoginRulerSteps()); | ||
239 | |||
240 | }, | ||
241 | |||
242 | 'editDirectLoginRulerSteps': function () { | ||
243 | return [ /*'TYPE',*/ 'CONFIGURATION', 'BINDINGS','FAVICON', 'DONE']; | ||
244 | }, | ||
245 | |||
246 | //------------------------------------------------------------------------- | ||
247 | |||
248 | 'runWithDirectLogin': function (aDirectLogin, hasJustBeenAdded) { | ||
249 | this._directLogin = aDirectLogin; | ||
250 | this.setDirectLoginHasJustBeenAdded(hasJustBeenAdded); | ||
251 | |||
252 | return Clipperz.Async.callbacks("DirectLoginWizardController.runWithDirectLogin", [ | ||
253 | MochiKit.Base.method(aDirectLogin, 'label'), | ||
254 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setLabel'), | ||
255 | |||
256 | MochiKit.Base.method(aDirectLogin, 'favicon'), | ||
257 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setDirectLoginFavicon'), | ||
258 | |||
259 | MochiKit.Base.method(aDirectLogin, 'bookmarkletConfiguration'), | ||
260 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setBookmarkletConfiguration'), | ||
261 | |||
262 | MochiKit.Base.method(aDirectLogin, 'bindings'), | ||
263 | MochiKit.Base.method(this, 'setOriginalBindings'), | ||
264 | |||
265 | MochiKit.Base.method(aDirectLogin, 'record'), | ||
266 | MochiKit.Base.methodcaller('fields'), | ||
267 | MochiKit.Base.values, | ||
268 | MochiKit.Base.partial(MochiKit.Base.map, Clipperz.Async.collectResults("Record.directLoginReferences - collectResults", { | ||
269 | 'reference': MochiKit.Base.methodcaller('reference'), | ||
270 | 'label': MochiKit.Base.methodcaller('label'), | ||
271 | 'isHidden': MochiKit.Base.methodcaller('isHidden'), | ||
272 | 'value': MochiKit.Base.methodcaller('value') | ||
273 | }, {trace:false})), | ||
274 | Clipperz.Async.collectAll, | ||
275 | |||
276 | MochiKit.Base.method(this, 'setRecordFields'), | ||
277 | |||
278 | MochiKit.Base.partial(MochiKit.Async.succeed, hasJustBeenAdded), | ||
279 | Clipperz.Async.deferredIf("Direct login has just been added", [ | ||
280 | MochiKit.Base.method(this, 'addNewDirectLoginRulerSteps') | ||
281 | ], [ | ||
282 | MochiKit.Base.method(this, 'editDirectLoginRulerSteps') | ||
283 | ]), | ||
284 | MochiKit.Base.method(this, 'showRuler') | ||
285 | ], {trace:false}); | ||
286 | }, | ||
287 | |||
288 | //----------------------------------------------------------------------------- | ||
289 | |||
290 | 'checkState': function () { | ||
291 | var enablePrevious; | ||
292 | var enableNext; | ||
293 | |||
294 | enablePrevious = true; | ||
295 | enableNext = false; | ||
296 | |||
297 | this.directLoginEditingComponent().disableAllPanels(); | ||
298 | |||
299 | switch(this.currentStep()) { | ||
300 | case 'LABEL': | ||
301 | this.directLoginEditingComponent().enableLabelField(); | ||
302 | |||
303 | enableNext = (this.directLoginEditingComponent().label() != ''); | ||
304 | enablePrevious = false; | ||
305 | break; | ||
306 | case 'TYPE': | ||
307 | this.directLoginEditingComponent().enableTypeField(); | ||
308 | |||
309 | enableNext = true; | ||
310 | enablePrevious = true; | ||
311 | break | ||
312 | case 'CONFIGURATION': | ||
313 | this.directLoginEditingComponent().enableConfigurationField(); | ||
314 | |||
315 | enableNext = (this.directLoginEditingComponent().bookmarkletConfiguration() != ''); | ||
316 | |||
317 | if (enableNext == true) { | ||
318 | try { | ||
319 | Clipperz.PM.DataModel.DirectLogin.checkBookmarkletConfiguration(this.directLoginEditingComponent().bookmarkletConfiguration()); | ||
320 | this.directLoginEditingComponent().removeHighlightConfigurationSyntaxError(); | ||
321 | } catch (e) { | ||
322 | this.directLoginEditingComponent().highlightConfigurationSyntaxError(); | ||
323 | enableNext = false; | ||
324 | } | ||
325 | } | ||
326 | break; | ||
327 | case 'BINDINGS': | ||
328 | enableNext = MochiKit.Iter.every(this.bindingComponents(), function (aBindingComponent) { return aBindingComponent.selectedValue() != null; }) | ||
329 | this.directLoginEditingComponent().enableBindingFields(); | ||
330 | break; | ||
331 | case 'FAVICON': | ||
332 | enableNext = true; | ||
333 | this.directLoginEditingComponent().enableFaviconField(); | ||
334 | break; | ||
335 | case 'DONE': | ||
336 | enableNext = true; | ||
337 | this.directLoginEditingComponent().enableDonePanel(); | ||
338 | break; | ||
339 | } | ||
340 | |||
341 | if (this.currentStepIndex() > 0) { | ||
342 | this.enablePrevious(enablePrevious); | ||
343 | } else { | ||
344 | this.enablePrevious(false); | ||
345 | } | ||
346 | this.enableNext(enableNext); | ||
347 | }, | ||
348 | |||
349 | //----------------------------------------------------------------------------- | ||
350 | |||
351 | 'setFocus': function () { | ||
352 | switch(this.currentStep()) { | ||
353 | case 'LABEL': | ||
354 | this.directLoginEditingComponent().focusOnLabelElement(); | ||
355 | break; | ||
356 | case 'TYPE': | ||
357 | break; | ||
358 | case 'CONFIGURATION': | ||
359 | this.directLoginEditingComponent().focusOnBookmarkletConfigurationElement(); | ||
360 | break; | ||
361 | case 'BINDINGS': | ||
362 | // this.directLoginEditingComponent().getElement('???').focus(); | ||
363 | break; | ||
364 | case 'FAVICON': | ||
365 | this.directLoginEditingComponent().focusOnFaviconElement(); | ||
366 | break; | ||
367 | case 'DONE': | ||
368 | break; | ||
369 | } | ||
370 | }, | ||
371 | |||
372 | //============================================================================= | ||
373 | |||
374 | 'steps': function () { | ||
375 | return this._steps; | ||
376 | }, | ||
377 | |||
378 | 'setSteps': function (aValue) { | ||
379 | this._steps = aValue; | ||
380 | |||
381 | this.rulerComponent().setSteps(aValue); | ||
382 | this.resetCurrentStepIndex(); | ||
383 | }, | ||
384 | |||
385 | 'currentStepIndex': function () { | ||
386 | return this._currentStepIndex; | ||
387 | }, | ||
388 | |||
389 | 'currentStep': function () { | ||
390 | return this.steps()[this.currentStepIndex()]; | ||
391 | }, | ||
392 | |||
393 | //============================================================================= | ||
394 | |||
395 | 'handleExit': function () { | ||
396 | MochiKit.Signal.signal(this, 'exit'); | ||
397 | }, | ||
398 | |||
399 | 'done': function () { | ||
400 | this.doneWithRuler(); | ||
401 | |||
402 | Clipperz.Async.callbacks("DirectLoginWizardController.done", [ | ||
403 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), | ||
404 | MochiKit.Base.method(this.directLogin(), 'setLabel'), | ||
405 | |||
406 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bookmarkletConfiguration'), | ||
407 | MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration'), | ||
408 | |||
409 | //Bindings | ||
410 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'), | ||
411 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) { | ||
412 | Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) { | ||
413 | //console.log("aBindingComponent", aBindingComponent); | ||
414 | // this.directLogin(). | ||
415 | return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [ | ||
416 | MochiKit.Base.method(this.directLogin(), 'bindings'), | ||
417 | MochiKit.Base.itemgetter(aBindingComponent.formFieldName()), | ||
418 | MochiKit.Base.methodcaller('setFieldKey', aBindingComponent.selectedValue()) | ||
419 | ], {trace:false}); | ||
420 | }, this)), | ||
421 | |||
422 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), | ||
423 | MochiKit.Base.method(this.directLogin(), 'setFavicon'), | ||
424 | |||
425 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'done', { | ||
426 | 'directLogin': this.directLogin(), | ||
427 | 'hasJustBeenAdded':this.directLoginHasJustBeenAdded() | ||
428 | }) | ||
429 | ], {trace:false}); | ||
430 | }, | ||
431 | |||
432 | //============================================================================= | ||
433 | |||
434 | 'handleMoveBackward': function () { | ||
435 | if (this._currentStepIndex > 0) { | ||
436 | varafterMoveAction; | ||
437 | |||
438 | this._currentStepIndex --; | ||
439 | afterMoveAction = MochiKit.Base.noop; | ||
440 | |||
441 | switch(this.currentStep()) { | ||
442 | case 'LABEL': | ||
443 | break; | ||
444 | case 'TYPE': | ||
445 | break; | ||
446 | case 'CONFIGURATION': | ||
447 | break; | ||
448 | case 'BINDINGS': | ||
449 | break; | ||
450 | case 'FAVICON': | ||
451 | break; | ||
452 | case 'DONE': | ||
453 | break; | ||
454 | }; | ||
455 | |||
456 | this.rulerComponent().moveBackward(afterMoveAction); | ||
457 | } | ||
458 | |||
459 | if (this._currentStepIndex == 0) { | ||
460 | this.enablePrevious(false); | ||
461 | } | ||
462 | }, | ||
463 | |||
464 | 'handleMoveForward': function () { | ||
465 | if (this.isNextEnabled()) { | ||
466 | varafterMoveAction; | ||
467 | |||
468 | this._currentStepIndex ++; | ||
469 | afterMoveAction = MochiKit.Base.noop; | ||
470 | |||
471 | switch(this.currentStep()) { | ||
472 | case 'LABEL': | ||
473 | break; | ||
474 | case 'TYPE': | ||
475 | break; | ||
476 | case 'CONFIGURATION': | ||
477 | break; | ||
478 | case 'BINDINGS': | ||
479 | this.resetBindingComponents(); | ||
480 | this.resetFormValueComponents(); | ||
481 | |||
482 | afterMoveAction = MochiKit.Base.partial(Clipperz.Async.callbacks, "DirectLoginWizardController.handleMoveForward - BINDINGS", [ | ||
483 | MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration', this.directLoginEditingComponent().bookmarkletConfiguration()), | ||
484 | |||
485 | MochiKit.Base.method(this.directLogin(), 'favicon'), | ||
486 | MochiKit.Base.method(this.directLoginEditingComponent(), 'setDirectLoginFavicon'), | ||
487 | |||
488 | MochiKit.Base.method(this.directLogin(), 'bindings'), | ||
489 | MochiKit.Base.values, | ||
490 | Clipperz.Async.forEach(MochiKit.Base.bind(function (aBinding) { | ||
491 | var bindingComponent; | ||
492 | |||
493 | bindingComponent = new Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent({ | ||
494 | formFieldName: aBinding.key(), | ||
495 | fields: this.recordFields(), | ||
496 | selectedFieldKey: aBinding.fieldKey() | ||
497 | }); | ||
498 | |||
499 | this.bindingComponents().push(bindingComponent); | ||
500 | |||
501 | MochiKit.Signal.connect(bindingComponent, 'bindChange', this, 'handleBindChange', bindingComponent); | ||
502 | this.directLoginEditingComponent().addBindingComponent(bindingComponent); | ||
503 | |||
504 | }, this)), | ||
505 | |||
506 | MochiKit.Base.method(this.directLogin(), 'formValues'), | ||
507 | MochiKit.Base.values, | ||
508 | Clipperz.Async.forEach(MochiKit.Base.bind(function (aFormValue) { | ||
509 | var formValueComponent; | ||
510 | |||
511 | formValueComponent = new Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent({ | ||
512 | 'formFieldName': aFormValue.key(), | ||
513 | 'fieldOptions': aFormValue.fieldOptions(), | ||
514 | 'initialValue': aFormValue.value() | ||
515 | }); | ||
516 | |||
517 | this.formValueComponents().push(formValueComponent); | ||
518 | |||
519 | MochiKit.Signal.connect(formValueComponent, 'formValueChange', this, 'handleFormValueChange', formValueComponent); | ||
520 | this.directLoginEditingComponent().addFormValueComponent(formValueComponent); | ||
521 | }, this)) | ||
522 | |||
523 | ], {trace:false}); | ||
524 | |||
525 | break; | ||
526 | case 'FAVICON': | ||
527 | break; | ||
528 | case 'DONE': | ||
529 | this.directLoginEditingComponent().setDoneDescriptionWithKeys({ | ||
530 | '__cardName__': this.cardLabel(), | ||
531 | '__directLoginName__': this.directLoginEditingComponent().label() | ||
532 | }); | ||
533 | break; | ||
534 | }; | ||
535 | |||
536 | this.rulerComponent().moveForward(afterMoveAction); | ||
537 | }; | ||
538 | }, | ||
539 | |||
540 | 'handleCursorMoved': function () { | ||
541 | this.checkState(); | ||
542 | this.setFocus(); | ||
543 | }, | ||
544 | |||
545 | //------------------------------------------------------------------------- | ||
546 | |||
547 | 'handleChangedValue': function (anEvent) { | ||
548 | this.checkState(); | ||
549 | }, | ||
550 | |||
551 | //......................................................................... | ||
552 | |||
553 | 'handleBindChange': function (aDirectLoginEditingBindingComponent) { | ||
554 | varselectedField; | ||
555 | |||
556 | selectedField = this.recordFieldWithReference(aDirectLoginEditingBindingComponent.selectedValue()); | ||
557 | |||
558 | return Clipperz.Async.callbacks("DirectLoginWizardController.handleBindChange", [ | ||
559 | MochiKit.Base.method(this.directLogin(), 'bindings'), | ||
560 | MochiKit.Base.itemgetter(aDirectLoginEditingBindingComponent.formFieldName()), | ||
561 | MochiKit.Base.methodcaller('setFieldKey', selectedField['reference']), | ||
562 | function () { | ||
563 | if (selectedField != null) { | ||
564 | aDirectLoginEditingBindingComponent.setFieldValue(selectedField['value']); | ||
565 | aDirectLoginEditingBindingComponent.setIsHidden(selectedField['isHidden']); | ||
566 | } else { | ||
567 | aDirectLoginEditingBindingComponent.setFieldValue(''); | ||
568 | aDirectLoginEditingBindingComponent.setIsHidden(false); | ||
569 | } | ||
570 | }, | ||
571 | MochiKit.Base.method(this, 'checkState') | ||
572 | ], {trace:false}); | ||
573 | }, | ||
574 | |||
575 | //......................................................................... | ||
576 | |||
577 | 'handleFormValueChange': function (someOptions) { | ||
578 | return Clipperz.Async.callbacks("DirectLoginWizardController.handleFormValueChange", [ | ||
579 | MochiKit.Base.method(this.directLogin(), 'formValues'), | ||
580 | MochiKit.Base.itemgetter(someOptions['fieldName']), | ||
581 | MochiKit.Base.methodcaller('setValue', someOptions['selectedValue']), | ||
582 | MochiKit.Base.method(this, 'checkState') | ||
583 | ], {trace:false}); | ||
584 | }, | ||
585 | |||
586 | //------------------------------------------------------------------------- | ||
587 | |||
588 | 'handleDirectLoginEditingComponentKeyPressed': function (anEvent) { | ||
589 | if (anEvent.key().string == 'KEY_ENTER') { | ||
590 | if (anEvent.target().nodeName != 'TEXTAREA') { | ||
591 | anEvent.preventDefault(); | ||
592 | this.handleMoveForward(); | ||
593 | } | ||
594 | } else if (anEvent.key().string == 'KEY_TAB') { | ||
595 | this.handleMoveForward(); | ||
596 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { | ||
597 | anEvent.preventDefault(); | ||
598 | } | ||
599 | } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) { | ||
600 | this.handleMoveForward(); | ||
601 | } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) { | ||
602 | this.handleMoveBackward(); | ||
603 | } else if (anEvent.key().string == 'KEY_ESCAPE') { | ||
604 | anEvent.stop(); | ||
605 | this.handleExit(); | ||
606 | } | ||
607 | }, | ||
608 | |||
609 | //============================================================================= | ||
610 | __syntaxFix__: "syntax fix" | ||
611 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js new file mode 100644 index 0000000..28401a2 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js | |||
@@ -0,0 +1,145 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | /* | ||
30 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
31 | |||
32 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { | ||
33 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); | ||
34 | |||
35 | return this; | ||
36 | }; | ||
37 | |||
38 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { | ||
39 | |||
40 | 'createGrid': function () { | ||
41 | return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | ||
42 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | ||
43 | 'name': 'DirectLogins.favicon', | ||
44 | 'selector': MochiKit.Base.methodcaller('favicon'), | ||
45 | 'cssClass': 'favicon' | ||
46 | }), | ||
47 | // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | ||
48 | new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ | ||
49 | 'name': 'DirectLogins.title', | ||
50 | 'selector': MochiKit.Base.methodcaller('label'), | ||
51 | 'label': 'title', | ||
52 | 'cssClass': 'title', | ||
53 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | ||
54 | 'sortable': true, | ||
55 | 'sorted': 'ASCENDING', | ||
56 | 'actionMethod': MochiKit.Base.methodcaller('runDirectLogin') | ||
57 | }), | ||
58 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | ||
59 | // 'label':'strength', | ||
60 | // 'cssClass':'title', | ||
61 | // 'selector': MochiKit.Base.methodcaller('label') //should be 'strength' or a strenght evaluation function | ||
62 | // }), | ||
63 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | ||
64 | 'name': 'DirectLogins.cardTitle', | ||
65 | 'selector': MochiKit.Base.compose(MochiKit.Base.methodcaller('label'), MochiKit.Base.methodcaller('record')), | ||
66 | 'label': 'card', | ||
67 | 'cssClass': 'cardTitle', | ||
68 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | ||
69 | 'sortable': true, | ||
70 | 'sorted': 'UNSORTED', | ||
71 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | ||
72 | }), | ||
73 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | ||
74 | // 'label':'last access', | ||
75 | // 'cssClass':'title', | ||
76 | // 'selector': MochiKit.Base.methodcaller('label') | ||
77 | // // 'sortable': true, | ||
78 | // // 'sorted': 'UNSORTED' | ||
79 | // }), | ||
80 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ | ||
81 | // 'label':'commands', | ||
82 | // 'cssClass':'title', | ||
83 | // 'selector': MochiKit.Base.methodcaller('label'), //should be a function for commands display | ||
84 | // }), | ||
85 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ | ||
86 | 'name': 'DirectLogins.delete', | ||
87 | 'selector': MochiKit.Base.noop, | ||
88 | 'cssClass': 'delete', | ||
89 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteDirectLogin', {objectData:anObject, element:anEvent.src()})} | ||
90 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteDirectLogin') | ||
91 | }) | ||
92 | ]}); | ||
93 | |||
94 | }, | ||
95 | |||
96 | //----------------------------------------------------------------------------- | ||
97 | |||
98 | 'getRows': function () { | ||
99 | //TODO: relying on user() in GridController, bad code smell :| | ||
100 | return this.user().getDirectLogins(); | ||
101 | }, | ||
102 | |||
103 | //----------------------------------------------------------------------------- | ||
104 | |||
105 | 'handleShowCard': function (anObject, anEvent) { | ||
106 | var cardDialogController; | ||
107 | |||
108 | cardDialogController = new Clipperz.PM.UI.Web.Controllers.CardDialogController({record:anObject.record()}) | ||
109 | cardDialogController.run(anEvent.src()); | ||
110 | }, | ||
111 | |||
112 | //----------------------------------------------------------------------------- | ||
113 | |||
114 | 'handleDeleteDirectLogin': function (anObject, anEvent) { | ||
115 | var deferredResult; | ||
116 | var confirmationDialog; | ||
117 | |||
118 | confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ | ||
119 | title:"Delete DirectLogin", | ||
120 | text:"Do you want to delete …", | ||
121 | type:'ALERT', | ||
122 | buttons: [ | ||
123 | {text:"Cancel",result:'CANCEL', isDefault:true}, | ||
124 | {text:"Delete", result:'OK'} | ||
125 | ] | ||
126 | }); | ||
127 | |||
128 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDeleteCard", {trace:false}); | ||
129 | // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()}); | ||
130 | deferredResult.addMethod(confirmationDialog, 'deferredShow', { | ||
131 | 'openFromElement': anEvent.src(), | ||
132 | 'onOkCloseToElement': null, //MochiKit.DOM.currentDocument().body, | ||
133 | 'onCancelCloseToElement':anEvent.src() | ||
134 | }); | ||
135 | deferredResult.addCallback(function () { Clipperz.log("DELETE: " + anObject.toString(), anObject); }); | ||
136 | deferredResult.addErrbackPass(function () { Clipperz.log("skip deletion: " + anObject.toString(), anObject); }); | ||
137 | deferredResult.callback(); | ||
138 | |||
139 | return deferredResult; | ||
140 | }, | ||
141 | |||
142 | //----------------------------------------------------------------------------- | ||
143 | __syntaxFix__: "syntax fix" | ||
144 | }); | ||
145 | */ \ No newline at end of file | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js new file mode 100644 index 0000000..13e02bc --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.FilterController = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); | ||
35 | |||
36 | this._filterElements = []; | ||
37 | this._filter = ""; | ||
38 | |||
39 | this._pendingSearchClicks = 0; | ||
40 | |||
41 | return this; | ||
42 | }; | ||
43 | |||
44 | |||
45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { | ||
46 | |||
47 | //----------------------------------------------------------------------------- | ||
48 | |||
49 | 'getFilter': function () { | ||
50 | return this._filter; | ||
51 | }, | ||
52 | |||
53 | '_setFilter': function (aFilterElement, aFilter) { | ||
54 | if (aFilter != this._filter) { | ||
55 | this._filter = aFilter; | ||
56 | MochiKit.Signal.signal(this, 'filterUpdated', aFilter); | ||
57 | this.updateFilterElements(aFilterElement, aFilter); | ||
58 | } | ||
59 | }, | ||
60 | |||
61 | 'setFilter': function (aFilter) { | ||
62 | this._setFilter(null, aFilter); | ||
63 | }, | ||
64 | |||
65 | //----------------------------------------------------------------------------- | ||
66 | |||
67 | 'filterElements': function () { | ||
68 | return this._filterElements; | ||
69 | }, | ||
70 | |||
71 | 'registerFilterElement': function (aFilterElement) { | ||
72 | //Clipperz.log("=== FilterController.registerFilterElement", aFilterElement); | ||
73 | this._filterElements.push(aFilterElement); | ||
74 | MochiKit.Signal.connect(aFilterElement, 'onkeydown', this, 'searchClickHandler'); | ||
75 | MochiKit.Signal.connect(aFilterElement, 'onfocus', this, 'searchClickHandler'); | ||
76 | }, | ||
77 | |||
78 | 'removeFilterElement': function (aFilterElement) { | ||
79 | var i; | ||
80 | var filterElements; | ||
81 | for (i=0; i < filterElements; i++) { | ||
82 | if (filterElements[i] == aFilterElement); | ||
83 | filterElements.splice(i, 1); | ||
84 | // TODO unregister/disconnect filterElement ??MochiKit.Signal.disconnect(this.grid().filterElement(), 'updateFilter', this.filterController(), 'handleUpdateFilter'); | ||
85 | } | ||
86 | }, | ||
87 | |||
88 | 'updateFilterElements': function (aSourceElement, aFilterString) { | ||
89 | MochiKit.Iter.forEach(this.filterElements(), | ||
90 | function (aFilterElement) { | ||
91 | if (aFilterElement != aSourceElement) { | ||
92 | aFilterElement.value = aFilterString; | ||
93 | } | ||
94 | } | ||
95 | ); | ||
96 | |||
97 | if (aSourceElement != null) { | ||
98 | aSourceElement.focus(); | ||
99 | } | ||
100 | }, | ||
101 | |||
102 | //----------------------------------------------------------------------------- | ||
103 | |||
104 | 'run': function () { | ||
105 | //Clipperz.log("=== FilterController.run"); | ||
106 | }, | ||
107 | |||
108 | //----------------------------------------------------------------------------- | ||
109 | |||
110 | 'pendingSearchClicks': function () { | ||
111 | return this._pendingSearchClicks; | ||
112 | }, | ||
113 | |||
114 | 'incrementPendingSearchClicks': function () { | ||
115 | this._pendingSearchClicks++; | ||
116 | }, | ||
117 | |||
118 | 'decrementPendingSearchClicks': function () { | ||
119 | this._pendingSearchClicks--; | ||
120 | }, | ||
121 | |||
122 | //----------------------------------------------------------------------------- | ||
123 | |||
124 | 'searchClickHandler': function (anEvent) { | ||
125 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { | ||
126 | anEvent.preventDefault(); | ||
127 | } else { | ||
128 | var value; | ||
129 | |||
130 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { | ||
131 | value = "" | ||
132 | } else if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ARROW_UP')) { | ||
133 | } else if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ARROW_DOWN')) { | ||
134 | } else { | ||
135 | value = null; | ||
136 | } | ||
137 | |||
138 | this.incrementPendingSearchClicks(); | ||
139 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, "searchClickDeferredHandler", anEvent.src(), value)); | ||
140 | } | ||
141 | }, | ||
142 | |||
143 | //......................................................................... | ||
144 | |||
145 | 'searchClickDeferredHandler': function (aFilterElement, aValue) { | ||
146 | if (aValue != null) { | ||
147 | aFilterElement.value = aValue; | ||
148 | } | ||
149 | |||
150 | this.decrementPendingSearchClicks(); | ||
151 | if (this.pendingSearchClicks()==0) { | ||
152 | this._setFilter(aFilterElement, aFilterElement.value); | ||
153 | } | ||
154 | }, | ||
155 | |||
156 | //----------------------------------------------------------------------------- | ||
157 | 'syntaxFix': 'syntax fix' | ||
158 | }); \ No newline at end of file | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js new file mode 100644 index 0000000..740a091 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js | |||
@@ -0,0 +1,374 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.GridController = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); | ||
35 | |||
36 | this._grid = null; | ||
37 | this._user = null; | ||
38 | this._sortedColumnManager = null; | ||
39 | this._cachedObjects = null; | ||
40 | this._filterController = args.filterController || null; | ||
41 | |||
42 | this._deferredDisplaySelectedRowsInvocation = null; | ||
43 | |||
44 | return this; | ||
45 | }; | ||
46 | |||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { | ||
48 | |||
49 | 'toString': function() { | ||
50 | return "Clipperz.PM.UI.Web.Controllers.GridController"; | ||
51 | }, | ||
52 | |||
53 | //----------------------------------------------------------------------------- | ||
54 | |||
55 | 'createGrid': function () { | ||
56 | throw Clipperz.Base.exception.AbstractMethod; | ||
57 | }, | ||
58 | |||
59 | 'setupWithGrid': function (aGrid) { | ||
60 | this._grid = aGrid; | ||
61 | |||
62 | if (this._grid != null) { | ||
63 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | ||
64 | if (aColumnManager.isSortable()) { | ||
65 | if (aColumnManager.isSorted()) { | ||
66 | this.setSortedColumnManager(aColumnManager); | ||
67 | } | ||
68 | MochiKit.Signal.connect(aColumnManager, 'sort', this, 'handleColumnManagerSort'); | ||
69 | } | ||
70 | MochiKit.Signal.connect(aColumnManager, 'selectRow', this, 'handleColumnManagerSelectRow'); | ||
71 | MochiKit.Signal.connect(aColumnManager, 'unselectRow', this, 'handleColumnManagerUnselectRow'); | ||
72 | }, this); | ||
73 | } | ||
74 | }, | ||
75 | |||
76 | 'grid': function() { | ||
77 | if (this._grid == null) { | ||
78 | this.setupWithGrid(this.createGrid()); | ||
79 | } | ||
80 | |||
81 | return this._grid; | ||
82 | }, | ||
83 | |||
84 | 'filterController': function () { | ||
85 | //Clipperz.log('GridController.filterController >>>', this._filterController); | ||
86 | if (this._filterController == null) { | ||
87 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); | ||
88 | } | ||
89 | //Clipperz.log('GridController.filterController <<<', this._filterController); | ||
90 | return this._filterController; | ||
91 | }, | ||
92 | |||
93 | //----------------------------------------------------------------------------- | ||
94 | |||
95 | 'columnsManagers': function () { | ||
96 | return this.grid().columnsManagers(); | ||
97 | }, | ||
98 | |||
99 | 'columnManagerWithName': function (aName) { | ||
100 | varmanagers; | ||
101 | var result; | ||
102 | |||
103 | managers = MochiKit.Base.filter(function (aManager) { return aManager.name() == aName; } , this.columnsManagers()); | ||
104 | |||
105 | if (managers.length == 1) { | ||
106 | result = managers[0]; | ||
107 | } else if (managers.length == 0) { | ||
108 | result = null; | ||
109 | } else { | ||
110 | throw "WTF!!!"; | ||
111 | } | ||
112 | |||
113 | return result; | ||
114 | }, | ||
115 | |||
116 | 'sortedColumnManager': function () { | ||
117 | return this._sortedColumnManager; | ||
118 | }, | ||
119 | |||
120 | 'setSortedColumnManager': function(aValue) { | ||
121 | if (aValue.sorted() != 'UNSORTED') { | ||
122 | this._sortedColumnManager = aValue; | ||
123 | } else { | ||
124 | this._sortedColumnManager = null; | ||
125 | } | ||
126 | }, | ||
127 | |||
128 | //----------------------------------------------------------------------------- | ||
129 | |||
130 | 'handleColumnManagerSort': function(aSelectedColumnManager) { | ||
131 | MochiKit.Iter.forEach(this.columnsManagers(), function(aColumnManager) { | ||
132 | if (aSelectedColumnManager != aColumnManager) { | ||
133 | if (aColumnManager.isSortable()) { | ||
134 | aColumnManager.setSorted('UNSORTED'); | ||
135 | } | ||
136 | } | ||
137 | }); | ||
138 | |||
139 | aSelectedColumnManager.toggleSorting(); | ||
140 | this.setSortedColumnManager(aSelectedColumnManager); | ||
141 | |||
142 | this.displaySelectedRows(this.filterController().getFilter()); | ||
143 | }, | ||
144 | |||
145 | 'handleColumnManagerSelectRow': function (aRowObject) { | ||
146 | this.grid().selectRow(aRowObject); | ||
147 | }, | ||
148 | |||
149 | 'handleColumnManagerUnselectRow': function (aRowObject) { | ||
150 | this.grid().unselectRow(aRowObject); | ||
151 | }, | ||
152 | |||
153 | //----------------------------------------------------------------------------- | ||
154 | |||
155 | 'handleFilterUpdated': function (aFilter) { | ||
156 | if (this.grid().isActive()) { | ||
157 | this.displaySelectedRows(aFilter); | ||
158 | } | ||
159 | }, | ||
160 | |||
161 | //----------------------------------------------------------------------------- | ||
162 | //TODO: relying on user() in GridController, bad code smell :| | ||
163 | //mhh: a controller should have access to business logic object too. Otherwise it will fail its controller role. [Giulio Cesare] | ||
164 | |||
165 | 'setUser': function(anUser) { | ||
166 | this._user = anUser; | ||
167 | }, | ||
168 | |||
169 | 'user': function() { | ||
170 | return this._user; | ||
171 | }, | ||
172 | |||
173 | //----------------------------------------------------------------------------- | ||
174 | |||
175 | 'run': function(args) { | ||
176 | //Clipperz.log("=== GridController.run"); | ||
177 | var deferredResult; | ||
178 | |||
179 | this.setUser(args.user); | ||
180 | args.slot.setContent(this.grid()); | ||
181 | this.filterController().registerFilterElement(this.grid().filterElement()); | ||
182 | MochiKit.Signal.connect(this.filterController(), 'filterUpdated', this, 'handleFilterUpdated'); | ||
183 | |||
184 | return this.displaySelectedRows(); | ||
185 | }, | ||
186 | |||
187 | //----------------------------------------------------------------------------- | ||
188 | |||
189 | 'handleGenericError': function(anError) { | ||
190 | var result; | ||
191 | |||
192 | if (anError instanceof MochiKit.Async.CancelledError) { | ||
193 | result = anError; | ||
194 | } else { | ||
195 | Clipperz.log("## GridController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); | ||
196 | result = new MochiKit.Async.CancelledError(anError); | ||
197 | } | ||
198 | |||
199 | return result; | ||
200 | }, | ||
201 | |||
202 | //----------------------------------------------------------------------------- | ||
203 | |||
204 | 'getRows': function () { | ||
205 | throw Clipperz.Base.AbstractMethod; | ||
206 | }, | ||
207 | |||
208 | //----------------------------------------------------------------------------- | ||
209 | |||
210 | 'setDeferredDisplaySelectedRowsInvocation': function (aDeferred) { | ||
211 | if (this._deferredDisplaySelectedRowsInvocation != null) { | ||
212 | this._deferredDisplaySelectedRowsInvocation.cancel(); | ||
213 | } | ||
214 | |||
215 | this._deferredDisplaySelectedRowsInvocation = aDeferred; | ||
216 | }, | ||
217 | |||
218 | //----------------------------------------------------------------------------- | ||
219 | |||
220 | 'resetDeferredDisplaySelectedRowsInvocation': function () { | ||
221 | if (this._deferredDisplaySelectedRowsInvocation != null) { | ||
222 | this._deferredDisplaySelectedRowsInvocation.cancel(); | ||
223 | } | ||
224 | }, | ||
225 | |||
226 | //----------------------------------------------------------------------------- | ||
227 | |||
228 | '_displaySelectedRows': function (aFilter, someRows) { | ||
229 | var result; | ||
230 | var delay; | ||
231 | |||
232 | if ((aFilter != null) && (aFilter != '')) { | ||
233 | var filter; | ||
234 | varfilterRegExp; | ||
235 | |||
236 | filter = aFilter.replace(/[^A-Za-z0-9]/g, "\\$&"); | ||
237 | filterRegExp = new RegExp(filter, "i"); | ||
238 | result = MochiKit.Base.filter(function (aCachedResult) { return filterRegExp.test(aCachedResult['_searchableContent'])}, someRows); | ||
239 | delay = 0.002*result.length; | ||
240 | |||
241 | this.setDeferredDisplaySelectedRowsInvocation(MochiKit.Async.callLater(delay, MochiKit.Base.method(this, "deferredDisplaySelectedRows", result))); | ||
242 | } else { | ||
243 | result = someRows; | ||
244 | |||
245 | this.resetDeferredDisplaySelectedRowsInvocation(); | ||
246 | this.deferredDisplaySelectedRows(result); | ||
247 | } | ||
248 | |||
249 | }, | ||
250 | |||
251 | //----------------------------------------------------------------------------- | ||
252 | |||
253 | 'deferredDisplaySelectedRows': function (someRows) { | ||
254 | if (this.sortedColumnManager() != null) { | ||
255 | var comparator; | ||
256 | var fieldName; | ||
257 | |||
258 | fieldName = this.sortedColumnManager().name(); | ||
259 | comparator = this.sortedColumnManager().comparator(); | ||
260 | if (this.sortedColumnManager().sorted() == 'DESCENDING') { | ||
261 | comparator = Clipperz.Base.reverseComparator(comparator); | ||
262 | } | ||
263 | |||
264 | someRows.sort(MochiKit.Base.partial(function(aKey, aComparator, aObject, bObject){ | ||
265 | return comparator(aObject[aKey], bObject[aKey]); | ||
266 | }, this.sortedColumnManager().name(), comparator)); | ||
267 | } | ||
268 | |||
269 | this.grid().update(someRows); | ||
270 | this.grid().endSearch(); | ||
271 | }, | ||
272 | |||
273 | //----------------------------------------------------------------------------- | ||
274 | |||
275 | 'getCachedValues': function () { | ||
276 | var deferredResult; | ||
277 | |||
278 | if (this._cachedObjects != null) { | ||
279 | deferredResult = MochiKit.Async.succeed(this._cachedObjects); | ||
280 | } else { | ||
281 | var objectCollectResultsConfiguration; | ||
282 | |||
283 | objectCollectResultsConfiguration = { | ||
284 | '_rowObject': MochiKit.Async.succeed, | ||
285 | '_reference': MochiKit.Base.methodcaller('reference'), | ||
286 | '_searchableContent':MochiKit.Base.methodcaller('searchableContent') | ||
287 | }; | ||
288 | |||
289 | MochiKit.Base.map(function (aColumnManager) { | ||
290 | objectCollectResultsConfiguration[aColumnManager.name()] = aColumnManager.selector(); | ||
291 | }, this.columnsManagers()); | ||
292 | |||
293 | deferredResult = new Clipperz.Async.Deferred("GridController.getCachedValues", {trace:false}); | ||
294 | deferredResult.addMethod(this, 'getRows'); | ||
295 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("GridController.getCachedValues - collectResults", objectCollectResultsConfiguration, {trace:false})); | ||
296 | deferredResult.addCallback(Clipperz.Async.collectAll); | ||
297 | deferredResult.addCallback(MochiKit.Base.bind(function (someRows) { | ||
298 | this._cachedObjects = someRows; | ||
299 | return this._cachedObjects; | ||
300 | }, this)); | ||
301 | deferredResult.callback(); | ||
302 | } | ||
303 | |||
304 | return deferredResult; | ||
305 | }, | ||
306 | |||
307 | //----------------------------------------------------------------------------- | ||
308 | |||
309 | 'hasPendingChanges': function () { | ||
310 | return this.user().hasPendingChanges(); | ||
311 | }, | ||
312 | |||
313 | 'saveChanges': function () { | ||
314 | this._cachedObjects = null; | ||
315 | |||
316 | return Clipperz.Async.callbacks("GridController.saveChanges", [ | ||
317 | MochiKit.Base.method(this.user(), 'saveChanges'), | ||
318 | MochiKit.Base.method(this, 'focus') | ||
319 | ], {trace:false}); | ||
320 | }, | ||
321 | |||
322 | 'revertChanges': function () { | ||
323 | return this.user().revertChanges(); | ||
324 | }, | ||
325 | |||
326 | //----------------------------------------------------------------------------- | ||
327 | |||
328 | 'displayEmptyContent': function () { | ||
329 | }, | ||
330 | |||
331 | 'hideEmptyContent': function () { | ||
332 | this.grid().removeNoRowsGridComponent(); | ||
333 | }, | ||
334 | |||
335 | 'displaySelectedRows': function (aFilter) { | ||
336 | if ((aFilter != null) && (aFilter != '')){ | ||
337 | this.grid().startSearch(); | ||
338 | } | ||
339 | |||
340 | return Clipperz.Async.callbacks("GridController.displaySelectedrows", [ | ||
341 | MochiKit.Base.method(this, 'getCachedValues'), | ||
342 | MochiKit.Base.itemgetter('length'), | ||
343 | Clipperz.Async.deferredIf("There are some items to show in the grid", [ | ||
344 | MochiKit.Base.method(this, 'hideEmptyContent'), | ||
345 | MochiKit.Base.method(this, 'getCachedValues'), | ||
346 | MochiKit.Base.method(this, '_displaySelectedRows', aFilter) | ||
347 | ], [ | ||
348 | MochiKit.Base.method(this, 'displayEmptyContent'), | ||
349 | MochiKit.Base.method(this.grid(), 'endSearch') | ||
350 | ]) | ||
351 | ], {trace:false}); | ||
352 | }, | ||
353 | |||
354 | //----------------------------------------------------------------------------- | ||
355 | |||
356 | 'focus': function () { | ||
357 | return Clipperz.Async.callbacks("GridController.focus", [ | ||
358 | MochiKit.Base.method(this, 'displaySelectedRows', this.filterController().getFilter()), | ||
359 | MochiKit.Base.method(this.grid(), 'focus') | ||
360 | ], {trace:false}) | ||
361 | //*##*/this.displaySelectedRows(this.filterController().getFilter()); | ||
362 | // this.grid().focus(); | ||
363 | }, | ||
364 | |||
365 | //============================================================================= | ||
366 | |||
367 | 'deleteAllCleanTextData': function () { | ||
368 | this._cachedObjects = null; | ||
369 | this.grid().drawEmpty(); | ||
370 | }, | ||
371 | |||
372 | //============================================================================= | ||
373 | __syntaxFix__: "syntax fix" | ||
374 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js new file mode 100644 index 0000000..d88af41 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js | |||
@@ -0,0 +1,259 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.LoginController = function(args) { | ||
32 | this._args = args || {}; | ||
33 | |||
34 | this._loginPage = null; | ||
35 | |||
36 | this._newUserWizardController = null; | ||
37 | this._newUserCreationComponent = null; | ||
38 | |||
39 | return this; | ||
40 | } | ||
41 | |||
42 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { | ||
43 | |||
44 | 'toString': function() { | ||
45 | return "Clipperz.PM.UI.Web.Controllers.LoginController"; | ||
46 | }, | ||
47 | |||
48 | 'args': function () { | ||
49 | return this._args; | ||
50 | }, | ||
51 | |||
52 | //----------------------------------------------------------------------------- | ||
53 | |||
54 | 'loginPage': function() { | ||
55 | if (this._loginPage == null) { | ||
56 | this._loginPage = new Clipperz.PM.UI.Web.Components.LoginPage(); | ||
57 | |||
58 | MochiKit.Signal.connect(this._loginPage, 'createNewAccountClick', this, 'handleCreateNewAccountClick') | ||
59 | } | ||
60 | |||
61 | return this._loginPage; | ||
62 | }, | ||
63 | |||
64 | //----------------------------------------------------------------------------- | ||
65 | |||
66 | 'run': function(args) { | ||
67 | varslot; | ||
68 | varloginPage; | ||
69 | varloginForm; | ||
70 | |||
71 | slot = args.slot; | ||
72 | |||
73 | loginForm =new Clipperz.PM.UI.Web.Components.LoginForm({'autocomplete': this.args()['autocomplete']}); | ||
74 | |||
75 | slot.setContent(this.loginPage()); | ||
76 | this.loginPage().slotNamed('loginForm').setContent(loginForm); | ||
77 | |||
78 | MochiKit.Signal.connect(loginForm, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); | ||
79 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); | ||
80 | }, | ||
81 | |||
82 | //----------------------------------------------------------------------------- | ||
83 | |||
84 | 'doLogin': function(aLoginForm, anEvent) { | ||
85 | var deferredResult; | ||
86 | varparameters; | ||
87 | // varshouldUseOTP; | ||
88 | var loginProgress; | ||
89 | varuser; | ||
90 | var getPassphraseDelegate; | ||
91 | |||
92 | parameters = anEvent; | ||
93 | // shouldUseOTP = (typeof(parameters.passphrase) == 'undefined'); | ||
94 | |||
95 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, parameters.passphrase); | ||
96 | user = new Clipperz.PM.DataModel.User({'username':parameters.username, 'getPassphraseFunction':MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase')}); | ||
97 | |||
98 | loginProgress = new Clipperz.PM.UI.Web.Components.LoginProgress(); | ||
99 | |||
100 | deferredResult = new Clipperz.Async.Deferred("LoginController.doLogin", {trace:false}); | ||
101 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); | ||
102 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', getPassphraseDelegate); | ||
103 | deferredResult.addMethod(loginProgress, 'deferredShowModal', {deferredObject:deferredResult, openFromElement:aLoginForm.submitButtonElement()}); | ||
104 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); | ||
105 | // if (shouldUseOTP == false) { | ||
106 | deferredResult.addMethod(user, 'login'); | ||
107 | // } else { | ||
108 | // deferredResult.addMethod(user, 'loginUsingOTP', parameters.username, parameters.otp); | ||
109 | // } | ||
110 | deferredResult.addCallback(function(aLoginProgress, res) { | ||
111 | aLoginProgress.disableCancel(); | ||
112 | return res; | ||
113 | }, loginProgress); | ||
114 | deferredResult.addCallback(function () { | ||
115 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(loginProgress, 'deferredHideModalAndRemove', {closeToElement:MochiKit.DOM.currentDocument().body})); | ||
116 | }) | ||
117 | deferredResult.addMethod(this, 'userLoggedIn', user, loginProgress, aLoginForm); | ||
118 | deferredResult.addErrback (MochiKit.Base.method(this, 'handleFailedLogin', loginProgress)); | ||
119 | |||
120 | deferredResult.addErrback (MochiKit.Base.method(loginProgress, 'deferredHideModalAndRemove', {closeToElement:aLoginForm.submitButtonElement()})); | ||
121 | deferredResult.addErrbackPass (MochiKit.Base.method(aLoginForm, 'focusOnPassphraseField')); | ||
122 | deferredResult.addBoth(MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'removePassphraseDelegate', getPassphraseDelegate)); | ||
123 | deferredResult.callback(); | ||
124 | |||
125 | MochiKit.Signal.connect(loginProgress, 'cancelEvent', deferredResult, 'cancel'); | ||
126 | |||
127 | return deferredResult; | ||
128 | }, | ||
129 | |||
130 | //----------------------------------------------------------------------------- | ||
131 | |||
132 | 'userLoggedIn': function(aUser) { | ||
133 | //Clipperz.log(">>> LoginController.userLoggedIn"); | ||
134 | MochiKit.Signal.signal(this, 'userLoggedIn', {user: aUser}); | ||
135 | //Clipperz.log("<<< LoginController.userLoggedIn"); | ||
136 | }, | ||
137 | |||
138 | //========================================================================= | ||
139 | |||
140 | 'handleCreateNewAccountClick': function (aComponent) { | ||
141 | // return Clipperz.PM.DataModel.User.registerNewAccount("new", "user"); | ||
142 | return Clipperz.Async.callbacks("LoginController.handleCreateNewAccountClick", [ | ||
143 | //' MochiKit.Base.method(this, 'newUserCreationComponent'), | ||
144 | // MochiKit.Base.methodcaller('deferredShowModal', {openFromElement:aComponent}), | ||
145 | // MochiKit.Base.method(this.newUserWizardController(), 'run') | ||
146 | |||
147 | |||
148 | MochiKit.Base.method(this, 'newUserCreationComponent'), | ||
149 | Clipperz.Async.forkAndJoin("Async.test succeedingForkedAndWaitDeferrer", [ | ||
150 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredShowModal', {openFromElement:aComponent, duration:0.5}), | ||
151 | MochiKit.Base.method(this.newUserWizardController(), 'run') | ||
152 | ], {trace:false}), | ||
153 | // MochiKit.Base.method(this.newUserCreationComponent(), 'enableCredentialsField') | ||
154 | ], {trace:false}); | ||
155 | }, | ||
156 | |||
157 | //----------------------------------------------------------------------------- | ||
158 | |||
159 | 'newUserWizardController': function () { | ||
160 | if (this._newUserWizardController == null) { | ||
161 | this._newUserWizardController = new Clipperz.PM.UI.Web.Controllers.NewUserWizardController({ | ||
162 | 'newUserCreationComponent': this.newUserCreationComponent() | ||
163 | }) | ||
164 | |||
165 | // MochiKit.Signal.connect(this._newUserWizardController, 'exit',this, 'handleHideNewUserCreationComponent'); | ||
166 | MochiKit.Signal.connect(this._newUserWizardController, 'done',this, 'handleCompleteNewUserCreationComponent'); | ||
167 | } | ||
168 | |||
169 | return this._newUserWizardController; | ||
170 | }, | ||
171 | |||
172 | //------------------------------------------------------------------------- | ||
173 | |||
174 | 'newUserCreationComponent': function () { | ||
175 | if (this._newUserCreationComponent == null) { | ||
176 | this._newUserCreationComponent = new Clipperz.PM.UI.Web.Components.NewUserCreationComponent(); | ||
177 | } | ||
178 | |||
179 | return this._newUserCreationComponent; | ||
180 | }, | ||
181 | |||
182 | 'clearNewUserCreationComponent': function () { | ||
183 | if (this._newUserCreationComponent != null) { | ||
184 | this._newUserCreationComponent.clear(); | ||
185 | } | ||
186 | this._newUserCreationComponent = null; | ||
187 | }, | ||
188 | |||
189 | //------------------------------------------------------------------------- | ||
190 | |||
191 | 'handleHideNewUserCreationComponent': function () { | ||
192 | this.clearNewUserCreationComponent(); | ||
193 | }, | ||
194 | |||
195 | 'handleCompleteNewUserCreationComponent': function (someParameters) { | ||
196 | vardeferredResult; | ||
197 | varuser; | ||
198 | varnewUserCreationComponent; | ||
199 | |||
200 | user = someParameters.user; | ||
201 | newUserCreationComponent = this.newUserCreationComponent(); | ||
202 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), | ||
203 | |||
204 | deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); | ||
205 | |||
206 | deferredResult.addCallbackList([ | ||
207 | MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), | ||
208 | MochiKit.Base.method(user, 'login'), | ||
209 | MochiKit.Base.method(this, 'userLoggedIn', user), | ||
210 | MochiKit.Base.method(this, 'clearNewUserCreationComponent') | ||
211 | ]); | ||
212 | deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); | ||
213 | deferredResult.callback(); | ||
214 | |||
215 | return deferredResult; | ||
216 | }, | ||
217 | |||
218 | |||
219 | //========================================================================= | ||
220 | |||
221 | 'handleFailedLogin': function(aLoginProgress, anError) { | ||
222 | var result; | ||
223 | |||
224 | //console.log("anError", anError); | ||
225 | if (anError instanceof MochiKit.Async.CancelledError) { | ||
226 | result = anError; | ||
227 | } else { | ||
228 | var deferredResult; | ||
229 | |||
230 | MochiKit.Logging.logError("## MainController - FAILED LOGIN: " + anError); | ||
231 | deferredResult = new MochiKit.Async.Deferred(); | ||
232 | |||
233 | aLoginProgress.showErrorMessage("failed login"); | ||
234 | // Clipperz.NotificationCenter.register(loginProgress, 'cancelEvent', deferredResult, 'callback'); | ||
235 | MochiKit.Signal.connect(aLoginProgress, 'cancelEvent', deferredResult, 'callback'); | ||
236 | deferredResult.addCallback(MochiKit.Async.fail, anError) | ||
237 | result = deferredResult; | ||
238 | } | ||
239 | |||
240 | return result; | ||
241 | }, | ||
242 | |||
243 | 'handleGenericError': function(anError) { | ||
244 | var result; | ||
245 | |||
246 | if (anError instanceof MochiKit.Async.CancelledError) { | ||
247 | result = anError; | ||
248 | } else { | ||
249 | MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); | ||
250 | //console.log(anError); | ||
251 | result = new MochiKit.Async.CancelledError(anError); | ||
252 | } | ||
253 | |||
254 | return result; | ||
255 | }, | ||
256 | |||
257 | //----------------------------------------------------------------------------- | ||
258 | __syntaxFix__: "syntax fix" | ||
259 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js new file mode 100644 index 0000000..aa0d6ad --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js | |||
@@ -0,0 +1,218 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.MainController = function(args) { | ||
32 | this._args = args; | ||
33 | |||
34 | //controllers | ||
35 | this._loginController =null; | ||
36 | this._appController =null; | ||
37 | |||
38 | //components | ||
39 | this._headerComponent = null; | ||
40 | this._pageComponent =null; | ||
41 | this._footerComponent = null; | ||
42 | |||
43 | this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); | ||
44 | this._passphraseDelegateLock.acquire(); | ||
45 | //Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); | ||
46 | this._passphraseDelegate = null; | ||
47 | |||
48 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); | ||
49 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); | ||
50 | |||
51 | return this; | ||
52 | } | ||
53 | |||
54 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { | ||
55 | |||
56 | 'toString': function() { | ||
57 | return "Clipperz.PM.UI.Web.Controllers.MainController"; | ||
58 | }, | ||
59 | |||
60 | 'args': function () { | ||
61 | return this._args; | ||
62 | }, | ||
63 | |||
64 | //----------------------------------------------------------------------------- | ||
65 | |||
66 | 'headerComponent': function() { | ||
67 | if (this._headerComponent == null) { | ||
68 | this._headerComponent = new Clipperz.PM.UI.Web.Components.PageHeader(); | ||
69 | } | ||
70 | |||
71 | return this._headerComponent; | ||
72 | }, | ||
73 | |||
74 | 'footerComponent': function() { | ||
75 | if (this._footerComponent == null) { | ||
76 | this._footerComponent = new Clipperz.PM.UI.Web.Components.PageFooter(); | ||
77 | } | ||
78 | |||
79 | return this._footerComponent; | ||
80 | }, | ||
81 | |||
82 | //----------------------------------------------------------------------------- | ||
83 | |||
84 | 'pageComponent': function() { | ||
85 | if (this._pageComponent == null) { | ||
86 | this._pageComponent = new Clipperz.PM.UI.Web.Components.Page({element:MochiKit.DOM.getElement('mainDiv')}); | ||
87 | } | ||
88 | |||
89 | return this._pageComponent; | ||
90 | }, | ||
91 | |||
92 | //----------------------------------------------------------------------------- | ||
93 | |||
94 | 'loginController': function() { | ||
95 | if (this._loginController == null) { | ||
96 | this._loginController = new Clipperz.PM.UI.Web.Controllers.LoginController(this.args()); | ||
97 | |||
98 | MochiKit.Signal.connect(this._loginController, 'userLoggedIn', this, 'loginControllerUserLoggedInCallback'); | ||
99 | } | ||
100 | |||
101 | return this._loginController; | ||
102 | }, | ||
103 | |||
104 | 'appController': function() { | ||
105 | if (this._appController == null) { | ||
106 | this._appController = new Clipperz.PM.UI.Web.Controllers.AppController(); | ||
107 | |||
108 | MochiKit.Signal.connect(this._appController, 'logout', this, 'handleLogout'); | ||
109 | } | ||
110 | |||
111 | return this._appController; | ||
112 | }, | ||
113 | |||
114 | //----------------------------------------------------------------------------- | ||
115 | |||
116 | 'run': function(shoudShowRegistrationForm) { | ||
117 | this.pageComponent().slotNamed('header').setContent(this.headerComponent()); | ||
118 | this.pageComponent().slotNamed('footer').setContent(this.footerComponent()); | ||
119 | |||
120 | this.pageComponent().render(); | ||
121 | |||
122 | this.loginController().run({slot:this.pageComponent().slotNamed('body')}); | ||
123 | |||
124 | if (shoudShowRegistrationForm) { | ||
125 | MochiKit.Signal.signal(this.loginController().loginPage(), 'createNewAccountClick'); | ||
126 | // this.loginController().handleCreateNewAccountClick(); | ||
127 | } | ||
128 | }, | ||
129 | |||
130 | //----------------------------------------------------------------------------- | ||
131 | |||
132 | 'getPassphrase': function () { | ||
133 | var deferredResult; | ||
134 | |||
135 | deferredResult = new Clipperz.Async.Deferred("MainController.getPassphrase", {trace:false}); | ||
136 | |||
137 | deferredResult.acquireLock(this._passphraseDelegateLock); | ||
138 | deferredResult.addMethod(this, 'invokePassphraseDelegate'); | ||
139 | deferredResult.releaseLock(this._passphraseDelegateLock); | ||
140 | deferredResult.callback(); | ||
141 | |||
142 | return deferredResult; | ||
143 | }, | ||
144 | |||
145 | //......................................................................... | ||
146 | |||
147 | 'invokePassphraseDelegate': function () { | ||
148 | return this._passphraseDelegate(); | ||
149 | }, | ||
150 | |||
151 | 'passphraseDelegateLock': function () { | ||
152 | return this._passphraseDelegateLock; | ||
153 | }, | ||
154 | |||
155 | //......................................................................... | ||
156 | |||
157 | 'setPassphraseDelegate': function (aDelegate) { | ||
158 | var shouldReleaseLock; | ||
159 | |||
160 | shouldReleaseLock = (this._passphraseDelegate == null); | ||
161 | |||
162 | this._passphraseDelegate = aDelegate; | ||
163 | |||
164 | if (shouldReleaseLock) { | ||
165 | this._passphraseDelegateLock.release(); | ||
166 | } | ||
167 | }, | ||
168 | |||
169 | //......................................................................... | ||
170 | |||
171 | 'removePassphraseDelegate': function (aDelegate) { | ||
172 | if (this._passphraseDelegate == aDelegate) { | ||
173 | this._passphraseDelegate = null; | ||
174 | this._passphraseDelegateLock.acquire(); | ||
175 | } | ||
176 | }, | ||
177 | |||
178 | //------------------------------------------------------------------------- | ||
179 | |||
180 | 'loginControllerUserLoggedInCallback': function(anEvent) { | ||
181 | //Clipperz.log(">>> loginControllerUserLoggedInCallback", anEvent); | ||
182 | // this.setUser(anEvent.parameters()['user']); | ||
183 | //console.log("--- loginControllerUserLoggedInCallback - 1"); | ||
184 | |||
185 | //console.log("--- loginControllerUserLoggedInCallback - 2"); | ||
186 | this.headerComponent().switchToLoggedMode(); | ||
187 | this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); | ||
188 | //Clipperz.log("<<< loginControllerUserLoggedInCallback"); | ||
189 | }, | ||
190 | |||
191 | //----------------------------------------------------------------------------- | ||
192 | |||
193 | 'handleRemoteRequestSent': function () { | ||
194 | //Clipperz.log("REMOTE REQUEST sent >>>"); | ||
195 | }, | ||
196 | |||
197 | 'handleRemoteRequestReceived': function () { | ||
198 | //Clipperz.log("REMOTE REQUEST received <<<"); | ||
199 | }, | ||
200 | |||
201 | //----------------------------------------------------------------------------- | ||
202 | |||
203 | 'handleLogout': function(anEvent) { | ||
204 | this.exit('logout.html'); | ||
205 | }, | ||
206 | |||
207 | //----------------------------------------------------------------------------- | ||
208 | |||
209 | 'exit': function(aPageName) { | ||
210 | //Clipperz.log("### exit " + aPageName); | ||
211 | MochiKit.Async.wait(0).addCallback(function() { | ||
212 | window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; | ||
213 | }); | ||
214 | }, | ||
215 | |||
216 | //----------------------------------------------------------------------------- | ||
217 | __syntaxFix__: "syntax fix" | ||
218 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js new file mode 100644 index 0000000..28d9d20 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js | |||
@@ -0,0 +1,469 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | ||
30 | |||
31 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { | ||
32 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | ||
33 | |||
34 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); | ||
35 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); | ||
36 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); | ||
37 | |||
38 | this._rulerComponent = null; | ||
39 | |||
40 | this._steps = null; | ||
41 | this._currentStepIndex = 0; | ||
42 | this._isNextEnabled = false; | ||
43 | |||
44 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' | ||
45 | this._user = null; | ||
46 | return this; | ||
47 | } | ||
48 | |||
49 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { | ||
50 | |||
51 | 'toString': function() { | ||
52 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'newUserCreationComponent': function () { | ||
58 | return this._newUserCreationComponent; | ||
59 | }, | ||
60 | |||
61 | //============================================================================= | ||
62 | |||
63 | 'user': function () { | ||
64 | return this._user; | ||
65 | }, | ||
66 | |||
67 | 'setUser': function (aValue) { | ||
68 | this._user = aValue; | ||
69 | }, | ||
70 | |||
71 | //----------------------------------------------------------------------------- | ||
72 | |||
73 | 'userCreationState': function () { | ||
74 | return this._userCreationState; | ||
75 | }, | ||
76 | |||
77 | 'setUserCreationState': function (aValue) { | ||
78 | //console.log("+++ NewUserWizardController.setUserCreationState", aValue); | ||
79 | this._userCreationState = aValue; | ||
80 | this.checkState(); | ||
81 | }, | ||
82 | |||
83 | //============================================================================= | ||
84 | |||
85 | 'resetCurrentStepIndex': function () { | ||
86 | this._currentStepIndex = 0; | ||
87 | this.rulerComponent().resetStatus({animateTransition:true}); | ||
88 | }, | ||
89 | |||
90 | //----------------------------------------------------------------------------- | ||
91 | |||
92 | 'enableNext': function (aValue) { | ||
93 | this.rulerComponent().enableNext(aValue); | ||
94 | this._isNextEnabled = aValue; | ||
95 | }, | ||
96 | |||
97 | 'isNextEnabled': function () { | ||
98 | return this._isNextEnabled; | ||
99 | }, | ||
100 | |||
101 | //----------------------------------------------------------------------------- | ||
102 | |||
103 | 'enablePrevious': function (aValue) { | ||
104 | this.rulerComponent().enablePrevious(aValue); | ||
105 | }, | ||
106 | |||
107 | //============================================================================= | ||
108 | |||
109 | 'rulerComponent': function () { | ||
110 | if (this._rulerComponent == null) { | ||
111 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | ||
112 | translationContext:'Wizards.NewUserWizard' | ||
113 | }); | ||
114 | this._rulerComponent.render(); | ||
115 | |||
116 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | ||
117 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | ||
118 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | ||
119 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | ||
120 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | ||
121 | } | ||
122 | |||
123 | return this._rulerComponent; | ||
124 | }, | ||
125 | |||
126 | 'resetRuler': function () { | ||
127 | // if (this._rulerComponent != null) { | ||
128 | // this._rulerComponent.clear(); | ||
129 | // } | ||
130 | // this._rulerComponent = null; | ||
131 | }, | ||
132 | |||
133 | //----------------------------------------------------------------------------- | ||
134 | |||
135 | 'showRuler': function (someSteps) { | ||
136 | var rulerElement; | ||
137 | |||
138 | this.setSteps(someSteps); | ||
139 | |||
140 | rulerElement = this.rulerComponent().element(); | ||
141 | this.newUserCreationComponent().disableAllPanels(); | ||
142 | |||
143 | MochiKit.Style.showElement(rulerElement); | ||
144 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.newUserCreationComponent().bottomMargin()}); | ||
145 | new MochiKit.Visual.Move(rulerElement, { | ||
146 | x:0, y:this.newUserCreationComponent().bottomMargin(), | ||
147 | mode:'absolute', | ||
148 | duration:0.5, | ||
149 | // afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') | ||
150 | afterFinish:MochiKit.Base.method(this, 'handleRulerShowed') | ||
151 | }); | ||
152 | }, | ||
153 | |||
154 | //----------------------------------------------------------------------------- | ||
155 | |||
156 | 'handleRulerShowed':function () { | ||
157 | return Clipperz.Async.callbacks("NewUserWizardController.handlerRulerShowed", [ | ||
158 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), | ||
159 | MochiKit.Base.method(this, 'handleCursorMoved') | ||
160 | ], {trace:false}); | ||
161 | }, | ||
162 | |||
163 | //----------------------------------------------------------------------------- | ||
164 | |||
165 | 'hideRuler': function () { | ||
166 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:0.5}); | ||
167 | }, | ||
168 | |||
169 | 'doneWithRuler': function () { | ||
170 | var rulerComponentElement; | ||
171 | |||
172 | rulerComponentElement = this.rulerComponent().element(); | ||
173 | new MochiKit.Visual.Move(this.rulerComponent().element(), { | ||
174 | x:1000, | ||
175 | mode:'relative', | ||
176 | duration:1, | ||
177 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) | ||
178 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } | ||
179 | }); | ||
180 | }, | ||
181 | |||
182 | //============================================================================= | ||
183 | |||
184 | 'createNewUserRulerSteps': function () { | ||
185 | return [ 'CREDENTIALS', 'CHECK_CREDENTIALS', 'TERMS_OF_SERVICE', 'CREATE_USER'/*, 'LOGIN' */]; | ||
186 | }, | ||
187 | |||
188 | //------------------------------------------------------------------------- | ||
189 | |||
190 | 'run': function () { | ||
191 | return Clipperz.Async.callbacks("NewUserWizardController.run", [ | ||
192 | MochiKit.Base.method(this, 'createNewUserRulerSteps'), | ||
193 | MochiKit.Base.method(this, 'showRuler') | ||
194 | ], {trace:false}); | ||
195 | }, | ||
196 | |||
197 | //----------------------------------------------------------------------------- | ||
198 | |||
199 | 'checkState': function () { | ||
200 | var enablePrevious; | ||
201 | var enableNext; | ||
202 | |||
203 | enablePrevious = true; | ||
204 | enableNext = false; | ||
205 | |||
206 | this.newUserCreationComponent().disableAllPanels(); | ||
207 | |||
208 | switch(this.currentStep()) { | ||
209 | case 'CREDENTIALS': | ||
210 | this.newUserCreationComponent().enableCredentialsPanel(); | ||
211 | |||
212 | enableNext = ( | ||
213 | (this.newUserCreationComponent().username() != '') | ||
214 | && | ||
215 | (this.newUserCreationComponent().passphrase() != '') | ||
216 | ); | ||
217 | // enablePrevious = false; | ||
218 | break; | ||
219 | case 'CHECK_CREDENTIALS': | ||
220 | this.newUserCreationComponent().enableCheckCredentialsPanel(); | ||
221 | |||
222 | enableNext = (this.newUserCreationComponent().passphrase() == this.newUserCreationComponent().rePassphrase()); | ||
223 | // enablePrevious = true; | ||
224 | break | ||
225 | case 'TERMS_OF_SERVICE': | ||
226 | this.newUserCreationComponent().enableTermsOfServicePanel(); | ||
227 | |||
228 | //console.log("awareOfUnrecoverablePassphrase", this.newUserCreationComponent().awareOfUnrecoverablePassphrase()); | ||
229 | //console.log("readTermsOfService", this.newUserCreationComponent().readTermsOfService()); | ||
230 | enableNext = ( | ||
231 | (this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on') | ||
232 | && | ||
233 | (this.newUserCreationComponent().readTermsOfService() == 'on') | ||
234 | ) | ||
235 | break; | ||
236 | case 'CREATE_USER': | ||
237 | //console.log(">>> CREATE_USER", this.userCreationState()); | ||
238 | this.newUserCreationComponent().enableCreateUserPanel(); | ||
239 | |||
240 | switch (this.userCreationState()) { | ||
241 | case 'IDLE': | ||
242 | this.setUserCreationState('IN PROGRESS'); | ||
243 | this.preformActualUserRegistration(); | ||
244 | |||
245 | enablePrevious = false; | ||
246 | enableNext = false; | ||
247 | break; | ||
248 | case 'IN PROGRESS': | ||
249 | enablePrevious = false; | ||
250 | enableNext = false; | ||
251 | break; | ||
252 | case 'DONE': | ||
253 | enablePrevious = false; | ||
254 | enableNext = true; | ||
255 | break; | ||
256 | case 'FAILED': | ||
257 | enablePrevious = true; | ||
258 | enableNext = false; | ||
259 | break; | ||
260 | }; | ||
261 | break; | ||
262 | // case 'LOGIN': | ||
263 | // this.newUserCreationComponent().enableLoginPanel(); | ||
264 | // break; | ||
265 | } | ||
266 | |||
267 | if (this.currentStepIndex() > 0) { | ||
268 | this.enablePrevious(enablePrevious); | ||
269 | } else { | ||
270 | this.enablePrevious(false); | ||
271 | } | ||
272 | this.enableNext(enableNext); | ||
273 | }, | ||
274 | |||
275 | //----------------------------------------------------------------------------- | ||
276 | |||
277 | 'setFocus': function () { | ||
278 | switch(this.currentStep()) { | ||
279 | case 'CREDENTIALS': | ||
280 | this.newUserCreationComponent().focusOnUsernameElement(); | ||
281 | break; | ||
282 | case 'CHECK_CREDENTIALS': | ||
283 | this.newUserCreationComponent().focusOnRePassphraseElement(); | ||
284 | break | ||
285 | case 'TERMS_OF_SERVICE': | ||
286 | break; | ||
287 | case 'CREATE_USER': | ||
288 | break; | ||
289 | // case 'LOGIN': | ||
290 | // break; | ||
291 | } | ||
292 | }, | ||
293 | |||
294 | //============================================================================= | ||
295 | |||
296 | 'steps': function () { | ||
297 | return this._steps; | ||
298 | }, | ||
299 | |||
300 | 'setSteps': function (aValue) { | ||
301 | this._steps = aValue; | ||
302 | |||
303 | this.rulerComponent().setSteps(aValue); | ||
304 | this.resetCurrentStepIndex(); | ||
305 | }, | ||
306 | |||
307 | 'currentStepIndex': function () { | ||
308 | return this._currentStepIndex; | ||
309 | }, | ||
310 | |||
311 | 'currentStep': function () { | ||
312 | return this.steps()[this.currentStepIndex()]; | ||
313 | }, | ||
314 | |||
315 | //============================================================================= | ||
316 | |||
317 | 'handleExit': function () { | ||
318 | return Clipperz.Async.callbacks("NewUserWizardController.handleExit", [ | ||
319 | // MochiKit.Base.method(this.newUserCreationComponent(), 'resetContent'), | ||
320 | Clipperz.Async.forkAndJoin("NewUserWizardController.handleExit - fork and join", [ | ||
321 | MochiKit.Base.method(this, 'hideRuler'), | ||
322 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredHideModal') | ||
323 | ], {trace:false}), | ||
324 | MochiKit.Base.method(this, 'resetRuler'), | ||
325 | // MochiKit.Base.method(this.newUserCreationComponent(), 'reset'), | ||
326 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'exit') | ||
327 | ], {trace:false}) | ||
328 | }, | ||
329 | |||
330 | 'done': function () { | ||
331 | this.doneWithRuler(); | ||
332 | MochiKit.Signal.signal(this, 'done', {'user': this.user()}); | ||
333 | }, | ||
334 | |||
335 | //============================================================================= | ||
336 | |||
337 | 'handleMoveBackward': function () { | ||
338 | if (this._currentStepIndex > 0) { | ||
339 | varafterMoveAction; | ||
340 | |||
341 | afterMoveAction = MochiKit.Base.noop; | ||
342 | |||
343 | //console.log("<-- backward", this.currentStep()); | ||
344 | switch(this.currentStep()) { | ||
345 | case 'CREDENTIALS': | ||
346 | case 'CHECK_CREDENTIALS': | ||
347 | case 'TERMS_OF_SERVICE': | ||
348 | this._currentStepIndex --; | ||
349 | this.rulerComponent().moveBackward(afterMoveAction); | ||
350 | break; | ||
351 | case 'CREATE_USER': | ||
352 | this.setUser(null); | ||
353 | this.newUserCreationComponent().hideAllProgeressStates(); | ||
354 | this.resetCurrentStepIndex(); | ||
355 | this.setUserCreationState('IDLE'); | ||
356 | break; | ||
357 | // case 'LOGIN': | ||
358 | // break; | ||
359 | }; | ||
360 | |||
361 | } | ||
362 | |||
363 | if (this._currentStepIndex == 0) { | ||
364 | this.enablePrevious(false); | ||
365 | } | ||
366 | }, | ||
367 | |||
368 | 'handleMoveForward': function () { | ||
369 | if (this.isNextEnabled()) { | ||
370 | varafterMoveAction; | ||
371 | |||
372 | this._currentStepIndex ++; | ||
373 | afterMoveAction = MochiKit.Base.noop; | ||
374 | |||
375 | switch(this.currentStep()) { | ||
376 | case 'CREDENTIALS': | ||
377 | break; | ||
378 | case 'CHECK_CREDENTIALS': | ||
379 | break | ||
380 | case 'TERMS_OF_SERVICE': | ||
381 | break; | ||
382 | case 'CREATE_USER': | ||
383 | break; | ||
384 | // case 'LOGIN': | ||
385 | // break; | ||
386 | }; | ||
387 | |||
388 | this.rulerComponent().moveForward(afterMoveAction); | ||
389 | }; | ||
390 | }, | ||
391 | |||
392 | 'handleCursorMoved': function () { | ||
393 | // this.checkState(); | ||
394 | // this.setFocus(); | ||
395 | |||
396 | return Clipperz.Async.callbacks("NewUserWizardController.handleCursorMoved", [ | ||
397 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), | ||
398 | MochiKit.Base.method(this, 'checkState'), | ||
399 | MochiKit.Base.method(this, 'setFocus') | ||
400 | ], {trace:false}); | ||
401 | }, | ||
402 | |||
403 | //------------------------------------------------------------------------- | ||
404 | |||
405 | 'handleChangedValue': function (anEvent) { | ||
406 | this.checkState(); | ||
407 | }, | ||
408 | |||
409 | //------------------------------------------------------------------------- | ||
410 | |||
411 | 'handleNewUserCreationComponentKeyPressed': function (anEvent) { | ||
412 | //console.log(">>> handleNewUserCreationComponentKeyPressed", anEvent.key().string); | ||
413 | if (anEvent.key().string == 'KEY_ENTER') { | ||
414 | if (anEvent.target().nodeName != 'TEXTAREA') { | ||
415 | anEvent.preventDefault(); | ||
416 | this.handleMoveForward(); | ||
417 | } | ||
418 | } else if (anEvent.key().string == 'KEY_TAB') { | ||
419 | if (anEvent.target() == this.newUserCreationComponent().usernameElement()) { | ||
420 | } else { | ||
421 | this.handleMoveForward(); | ||
422 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { | ||
423 | anEvent.preventDefault(); | ||
424 | } | ||
425 | } | ||
426 | } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) { | ||
427 | this.handleMoveForward(); | ||
428 | } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) { | ||
429 | this.handleMoveBackward(); | ||
430 | } else if (anEvent.key().string == 'KEY_ESCAPE') { | ||
431 | anEvent.stop(); | ||
432 | this.handleExit(); | ||
433 | } else { | ||
434 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'checkState')); | ||
435 | } | ||
436 | }, | ||
437 | |||
438 | //============================================================================= | ||
439 | |||
440 | 'preformActualUserRegistration': function () { | ||
441 | vardeferredResult; | ||
442 | |||
443 | deferredResult = new Clipperz.Async.Deferred("NewUSerWizardController.preformActualUserRegistration", {trace:false}); | ||
444 | deferredResult.addMethod(this.newUserCreationComponent(), 'showProgressOnUserCreation'); | ||
445 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this.newUserCreationComponent(), 'passphrase')); | ||
446 | deferredResult.addCallback(Clipperz.PM.DataModel.User.registerNewAccount, | ||
447 | this.newUserCreationComponent().username(), | ||
448 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase') | ||
449 | ); | ||
450 | deferredResult.addMethod(this, 'setUser'); | ||
451 | deferredResult.addMethod(this.newUserCreationComponent(), 'showUserCreationDone'); | ||
452 | deferredResult.addMethod(this, 'setUserCreationState', 'DONE'); | ||
453 | |||
454 | // deferredResult.addErrback(MochiKit.Base.method(this.newUserCreationComponent(), 'showUserCreationFailed')); | ||
455 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUser', null)); | ||
456 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUserCreationState', 'FAILED')); | ||
457 | deferredResult.addErrback(MochiKit.Base.bind(function (aValue) { | ||
458 | this.newUserCreationComponent().showUserCreationFailed(); | ||
459 | this.setUser(null); | ||
460 | this.setUserCreationState('FAILED'); | ||
461 | }, this)); | ||
462 | deferredResult.callback(); | ||
463 | |||
464 | return deferredResult; | ||
465 | }, | ||
466 | |||
467 | //============================================================================= | ||
468 | __syntaxFix__: "syntax fix" | ||
469 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js new file mode 100644 index 0000000..23fd236 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardDetail.js | |||
@@ -0,0 +1,166 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.iPhone.Components.CardDetail = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.iPhone.Components.CardDetail.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._cardReference = null; | ||
37 | |||
38 | return this; | ||
39 | } | ||
40 | |||
41 | //============================================================================= | ||
42 | |||
43 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
44 | |||
45 | //------------------------------------------------------------------------- | ||
46 | |||
47 | 'toString': function () { | ||
48 | return "Clipperz.PM.UI.iPhone.Components.CardDetail component"; | ||
49 | }, | ||
50 | |||
51 | //------------------------------------------------------------------------- | ||
52 | |||
53 | 'cardReference': function () { | ||
54 | return this._cardReference; | ||
55 | }, | ||
56 | |||
57 | 'setCardReference': function (aValue) { | ||
58 | this._cardReference = aValue; | ||
59 | }, | ||
60 | |||
61 | //------------------------------------------------------------------------- | ||
62 | |||
63 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
64 | this.append(this.element(), [ | ||
65 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ | ||
66 | {tag:'div', id:this.getId('progressBar')} //, | ||
67 | // {tag:'h1', cls:'loading', html:"loading"} | ||
68 | ]} | ||
69 | ]); | ||
70 | |||
71 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | ||
72 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); | ||
73 | }, | ||
74 | |||
75 | //========================================================================= | ||
76 | |||
77 | 'showCardDetails': function (someData) { | ||
78 | this.element().innerHTML = ''; | ||
79 | this.append(this.element(), [ | ||
80 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { | ||
81 | return {tag:'div', cls:'row', children:[ | ||
82 | {tag:'label', html:aFieldData['label']}, | ||
83 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} | ||
84 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ | ||
85 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} | ||
86 | ]} | ||
87 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} | ||
88 | |||
89 | ]} | ||
90 | }, someData['fields'])} | ||
91 | ]); | ||
92 | |||
93 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { | ||
94 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) | ||
95 | }, this)); | ||
96 | |||
97 | if (someData['directLogins'].length > 0) { | ||
98 | this.append(this.element(), [ | ||
99 | {tag:'h2', html:"Direct logins"}, | ||
100 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { | ||
101 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ | ||
102 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, | ||
103 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} | ||
104 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} | ||
105 | ]} | ||
106 | }, someData['directLogins'])} | ||
107 | ]); | ||
108 | |||
109 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { | ||
110 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); | ||
111 | }, this), | ||
112 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) | ||
113 | ) | ||
114 | }; | ||
115 | |||
116 | if (someData['notes'] != '') { | ||
117 | this.append(this.element(), [ | ||
118 | {tag:'h2', html:"Notes"}, | ||
119 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | ||
120 | {tag:'div', cls:'row notes', children:[ | ||
121 | {tag:'span', html:someData['notes']} | ||
122 | ]} | ||
123 | ]} | ||
124 | ]); | ||
125 | }; | ||
126 | |||
127 | return true; | ||
128 | }, | ||
129 | |||
130 | //------------------------------------------------------------------------- | ||
131 | /* | ||
132 | 'toggleClickHandler': function (anEvent) { | ||
133 | varnextState; | ||
134 | varfieldValue; | ||
135 | |||
136 | //console.log("TOGGLE"); | ||
137 | anEvent.preventDefault; | ||
138 | fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0]; | ||
139 | |||
140 | nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true'); | ||
141 | if (nextState) { | ||
142 | MochiKit.DOM.removeElementClass(fieldValue, 'clear'); | ||
143 | } else { | ||
144 | MochiKit.DOM.addElementClass(fieldValue, 'clear'); | ||
145 | } | ||
146 | |||
147 | MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState); | ||
148 | }, | ||
149 | */ | ||
150 | //========================================================================= | ||
151 | |||
152 | 'directLoginClickHandler': function (anEvent) { | ||
153 | anEvent.preventDefault(); | ||
154 | |||
155 | if (/(directLogin_)/.test(anEvent.src().id)) { | ||
156 | var directLoginReference; | ||
157 | |||
158 | directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2]; | ||
159 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference}); | ||
160 | } | ||
161 | }, | ||
162 | |||
163 | //========================================================================= | ||
164 | |||
165 | __syntaxFix__: "syntax fix" | ||
166 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardList.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardList.js new file mode 100644 index 0000000..770f983 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/CardList.js | |||
@@ -0,0 +1,204 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.iPhone.Components.CardList = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.iPhone.Components.CardList.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | this._cardDetail = null; | ||
37 | |||
38 | return this; | ||
39 | } | ||
40 | |||
41 | //============================================================================= | ||
42 | |||
43 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
44 | |||
45 | //------------------------------------------------------------------------- | ||
46 | |||
47 | 'toString': function () { | ||
48 | return "Clipperz.PM.UI.iPhone.Components.CardList component"; | ||
49 | }, | ||
50 | |||
51 | //------------------------------------------------------------------------- | ||
52 | |||
53 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
54 | this.append(this.element(), [ | ||
55 | {tag:'div', cls:'toolbar', id:'toolbar', children:[ | ||
56 | {tag:'h1', id:'pageTitle', html:"cards"}, | ||
57 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"cards"} | ||
58 | ]}, | ||
59 | {tag:'div', cls:'cardList', id:this.getId('cardList'), children:[ | ||
60 | {tag:'form', title:'search', cls:'panel cardListSearchForm', id:this.getId('cardListSearchForm'), children:[ | ||
61 | {tag:'input', type:'search', name:'search', value:"", placeholder:"search", id:this.getId('searchField')} | ||
62 | ]}, | ||
63 | {tag:'ul', cls:'panel cardListPanel', id:this.getId('cardListPanel'), children:[]} | ||
64 | ]}, | ||
65 | {tag:'div', cls:'panel cardDetailPanel', id:this.getId('cardDetail')} | ||
66 | ]); | ||
67 | |||
68 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onsubmit', this,'searchHandler'); | ||
69 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeydown', this,'searchHandler'); | ||
70 | MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeyup', this,'searchHandler'); | ||
71 | |||
72 | MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this,'cardListClickHandler'); | ||
73 | MochiKit.Signal.connect('backButton', 'onclick', this,'backButtonClickHandler'); | ||
74 | |||
75 | MochiKit.Style.hideElement('backButton'); | ||
76 | MochiKit.Style.hideElement(this.getElement('cardDetail')); | ||
77 | }, | ||
78 | |||
79 | //------------------------------------------------------------------------- | ||
80 | |||
81 | 'searchHandler': function (anEvent) { | ||
82 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { //RETURN | ||
83 | anEvent.preventDefault(); | ||
84 | } else { | ||
85 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { | ||
86 | anEvent.target().value = ""; | ||
87 | } | ||
88 | |||
89 | if (anEvent.type() == 'keyup') { | ||
90 | MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value); | ||
91 | } | ||
92 | } | ||
93 | }, | ||
94 | |||
95 | //------------------------------------------------------------------------- | ||
96 | |||
97 | 'update': function (someObjects) { | ||
98 | varcardListPanel; | ||
99 | var i,c; | ||
100 | |||
101 | cardListPanel = this.getElement('cardListPanel'); | ||
102 | cardListPanel.innerHTML = ''; | ||
103 | |||
104 | c = someObjects.length; | ||
105 | |||
106 | for (i=0; i<c; i++) { | ||
107 | this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[ | ||
108 | {tag:'img', src:(someObjects[i]['favicon'] ? someObjects[i]['favicon'] : 'data:application/octet-stream;charset=utf-8;base64,AAABAAEAFxcAAAEAGAD8BgAAFgAAACgAAAAXAAAALgAAAAEAGAAAAAAAAAAAABIXAAASFwAAAAAAAAAAAAD///////////////////////////////////////////////////////////////////////////////////////////9zAC////////////////////////////////////////////////////////////////////////////////////////////9pAG////////////////////////////////////////////////////////////////////////////////////////////9rAC////////////////////////////////////////////////////////////////////////////////////////////9yAHP////////////////////////IyMizs7O6urrq6ur////////////Ozs6zs7Ozs7Pq6ur///////////////////////8AAAD////////////////////V1dWXl5eXl5eXl5elpaX4+Pj////Ozs6Xl5eXl5eXl5eenp7///////////////////////8AAAD////////////////////Ozs6Xl5eXl5eXl5eXl5fBwcHq6uqenp6Xl5eXl5eXl5eXl5f///////////////////////8AAAD////////////////////j4+OXl5eXl5eXl5eXl5eXl5elpaWXl5eXl5eXl5eXl5ezs7P///////////////////////8AAAD////////////////////////IyMiXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eenp7x8fH////////////////////////////////////////////////////4+PilpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5fOzs7////////////////////////////////////////////////////////q6uq6urqXl5eXl5eXl5eXl5eXl5eXl5eenp7V1dX4+Pj///////////////////////8AAAD////////////4+PjOzs6lpaWXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5e6urrj4+P///////////////8AAAD////////////BwcGXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fx8fH///////////8AAAD///////////+zs7OXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5fj4+P///////////8AAAD////////////IyMiXl5eXl5eXl5eXl5e6urqXl5eXl5eXl5eXl5esrKylpaWXl5eXl5eXl5eenp7x8fH///////////8AAAD////////////////Ozs7Ozs7V1dX4+Pj///+Xl5eXl5eXl5eXl5fOzs7////q6urOzs7Ozs7q6ur///////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD///////////////////////////////////+Xl5eXl5eXl5eXl5fOzs7///////////////////////////////////8AAAD////////////////////////////////////IyMiXl5eXl5eenp7x8fH///////////////////////////////////8AAAD////////////////////////////////////////j4+Pj4+Px8fH///////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAD///////////////////////////////////////////////////////////////////////////////////////////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAo=')}, | ||
109 | {tag:'a', id:('cardListReference_' + someObjects[i]['_reference']), href:'#', html:someObjects[i]['label']} | ||
110 | ]}) | ||
111 | |||
112 | MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler'); | ||
113 | } | ||
114 | |||
115 | }, | ||
116 | |||
117 | 'cardListClickHandler': function (anEvent) { | ||
118 | anEvent.preventDefault(); | ||
119 | |||
120 | if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) { | ||
121 | var cardListReference; | ||
122 | |||
123 | cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2]; | ||
124 | //console.log("Showing detail for card named", cardListReference); | ||
125 | MochiKit.Signal.signal(this, 'selectedCard', cardListReference); | ||
126 | } | ||
127 | }, | ||
128 | |||
129 | //========================================================================= | ||
130 | |||
131 | 'cardDetail': function (someData) { | ||
132 | if (this._cardDetail == null) { | ||
133 | this._cardDetail = new Clipperz.PM.UI.iPhone.Components.CardDetail({element:this.getElement('cardDetail')}); | ||
134 | } | ||
135 | |||
136 | return this._cardDetail; | ||
137 | }, | ||
138 | |||
139 | //------------------------------------------------------------------------- | ||
140 | |||
141 | 'removeCardDetail': function () { | ||
142 | if (this._cardDetail != null) { | ||
143 | this._cardDetail.remove(); | ||
144 | this._cardDetail = null; | ||
145 | } | ||
146 | }, | ||
147 | |||
148 | //========================================================================= | ||
149 | |||
150 | 'showCard': function (someData) { | ||
151 | vardeferredResult; | ||
152 | varoffset; | ||
153 | |||
154 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); | ||
155 | this.cardDetail().render(); | ||
156 | this.cardDetail().setCardReference(someData['_reference']); | ||
157 | MochiKit.Style.setElementPosition(this.cardDetail().element(), {x:offset}); | ||
158 | new MochiKit.Visual.Sequence([ | ||
159 | // new MochiKit.Visual.Move(this.cardDetail().element(), {x:offset, y:45, mode:'absolute', duration:0, sync:true}), | ||
160 | new MochiKit.Visual.Parallel([ | ||
161 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:-offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | ||
162 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:0, y:45, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), | ||
163 | // new MochiKit.Visual.ScrollTo('toolbar', {sync:true}), | ||
164 | MochiKit.Visual.appear ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) | ||
165 | ], {duration:1, sync:true}), | ||
166 | MochiKit.Visual.fade(this.getElement('cardList'), {duration:0, sync:true}) | ||
167 | ], {}) | ||
168 | |||
169 | MochiKit.DOM.getElement('pageTitle').innerHTML = someData['title']; | ||
170 | |||
171 | return true; | ||
172 | }, | ||
173 | |||
174 | //------------------------------------------------------------------------- | ||
175 | |||
176 | 'showCardDetails': function (someData) { | ||
177 | return this.cardDetail().showCardDetails(someData); | ||
178 | }, | ||
179 | |||
180 | //========================================================================= | ||
181 | |||
182 | 'backButtonClickHandler': function (anEvent) { | ||
183 | varoffset; | ||
184 | |||
185 | anEvent.preventDefault(); | ||
186 | |||
187 | MochiKit.DOM.getElement('pageTitle').innerHTML = "cards"; | ||
188 | |||
189 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); | ||
190 | MochiKit.Style.setElementPosition(this.getElement('cardList'), {x:-offset}); | ||
191 | MochiKit.DOM.showElement(this.getElement('cardList')); | ||
192 | |||
193 | new MochiKit.Visual.Parallel([ | ||
194 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | ||
195 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | ||
196 | MochiKit.Visual.fade (this.getElement('cardDetail'), { transition:MochiKit.Visual.Transitions.linear, sync:true}), | ||
197 | MochiKit.Visual.fade ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) | ||
198 | ], {duration:1, afterFinish:MochiKit.Base.method(this, 'removeCardDetail')}) | ||
199 | |||
200 | }, | ||
201 | |||
202 | //========================================================================= | ||
203 | __syntaxFix__: "syntax fix" | ||
204 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js new file mode 100644 index 0000000..eec83b0 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Components/LoginForm.js | |||
@@ -0,0 +1,181 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Components'); | ||
30 | |||
31 | Clipperz.PM.UI.iPhone.Components.LoginForm = function(args) { | ||
32 | args = args || {}; | ||
33 | |||
34 | Clipperz.PM.UI.iPhone.Components.LoginForm.superclass.constructor.apply(this, arguments); | ||
35 | |||
36 | return this; | ||
37 | } | ||
38 | |||
39 | //============================================================================= | ||
40 | |||
41 | Clipperz.Base.extend(Clipperz.PM.UI.iPhone.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | ||
42 | |||
43 | //------------------------------------------------------------------------- | ||
44 | |||
45 | 'toString': function () { | ||
46 | return "Clipperz.PM.UI.iPhone.Components.LoginForm component"; | ||
47 | }, | ||
48 | |||
49 | //------------------------------------------------------------------------- | ||
50 | |||
51 | 'focusOnUsername': function () { | ||
52 | this.getElement('username').focus(); | ||
53 | }, | ||
54 | |||
55 | //------------------------------------------------------------------------- | ||
56 | |||
57 | 'username': function () { | ||
58 | return this.getElement('username').value; | ||
59 | }, | ||
60 | |||
61 | 'passphrase': function () { | ||
62 | return this.getElement('passphrase').value; | ||
63 | }, | ||
64 | |||
65 | //------------------------------------------------------------------------- | ||
66 | |||
67 | 'renderSelf': function(/*aContainer, aPosition*/) { | ||
68 | this.append(this.element(), [ | ||
69 | {tag:'div', cls:'toolbar iPhoneClipperzToolbar', children:[ | ||
70 | {tag:'h1', id:'pageTitle', html:'Clipperz'}, | ||
71 | {tag:'a', id:'backButton', cls:'button', href:'#', html:"back"} | ||
72 | ]}, | ||
73 | {tag:'form', title:'Theaters', cls:'panel toolbarlessPanel loginForm', id:this.getId('loginFormPanel'), children:[ | ||
74 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | ||
75 | {tag:'div', cls:'row', children:[ | ||
76 | {tag:'label', html:"username"}, | ||
77 | {tag:'input', type:'text', name:'username', value:"", autocorrect:'off', autocapitalize:'off', id:this.getId('username')} | ||
78 | ]}, | ||
79 | {tag:'div', cls:'row', children:[ | ||
80 | {tag:'label', html:"passphrase"}, | ||
81 | {tag:'input', type:'password', name:'passphrase', value:"", id:this.getId('passphrase')} | ||
82 | ]} | ||
83 | ]}, | ||
84 | {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Login", id:this.getId('submit')} | ||
85 | ]}, | ||
86 | {tag:'div', cls:'panel toolbarlessPanel loginProgressPanel', id:this.getId('loginProgressPanel'), children:[ | ||
87 | {tag:'div', id:this.getId('progressBar')} //, | ||
88 | // {tag:'a', cls:'whiteButton', type:'submit', href:'#', html:"Cancel", id:this.getId('cancel')} | ||
89 | ]}, | ||
90 | {tag:'div', cls:'panel loginErrorPanel', id:this.getId('loginErrorPanel'), children:[ | ||
91 | {tag:'div', cls:'errorMessage', id:this.getId('errorMessageBox'), children:[ | ||
92 | {tag:'h2', id:this.getId('errorMessage'), html:"Login failed"} | ||
93 | ]} | ||
94 | ]} | ||
95 | ]); | ||
96 | |||
97 | MochiKit.Signal.connect(this.getElement('submit'), 'onclick',this, 'submitHandler'); | ||
98 | MochiKit.Signal.connect(this.getElement('loginFormPanel'), 'onsubmit',this, 'submitHandler'); | ||
99 | |||
100 | // MochiKit.Signal.connect(this.getElement('cancel'), 'onclick',this, 'cancelHandler'); | ||
101 | MochiKit.Signal.connect('backButton', 'onclick',this, 'backHandler'); | ||
102 | |||
103 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | ||
104 | |||
105 | // MochiKit.Style.hideElement(this.getElement('errorMessage')); | ||
106 | |||
107 | this.showLoginForm(); | ||
108 | // MochiKit.Async.callLater(0.2, MochiKit.Base.method(this, 'focusOnUsername')); | ||
109 | }, | ||
110 | |||
111 | //------------------------------------------------------------------------- | ||
112 | |||
113 | 'showLoginForm': function () { | ||
114 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); | ||
115 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); | ||
116 | MochiKit.Style.hideElement(this.getElement('loginErrorPanel')); | ||
117 | MochiKit.Style.hideElement('backButton'); | ||
118 | }, | ||
119 | |||
120 | 'slideInLoginForm': function () { | ||
121 | varoffset; | ||
122 | |||
123 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); | ||
124 | |||
125 | MochiKit.Style.showElement(this.getElement('loginFormPanel')); | ||
126 | MochiKit.Style.setElementPosition(this.getElement('loginFormPanel'), {x:-offset, y:0}); | ||
127 | |||
128 | new MochiKit.Visual.Sequence([ | ||
129 | new MochiKit.Visual.Parallel([ | ||
130 | new MochiKit.Visual.Move(this.getElement('loginErrorPanel'), {x:offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | ||
131 | new MochiKit.Visual.Move(this.getElement('loginFormPanel'), {x:0, y:0, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), | ||
132 | MochiKit.Visual.fade ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) | ||
133 | ], {duration:0.5, sync:true}), | ||
134 | MochiKit.Visual.fade(this.getElement('loginErrorPanel'), {duration:0, sync:true}) | ||
135 | ], {}) | ||
136 | }, | ||
137 | |||
138 | 'showLoginProgress': function () { | ||
139 | MochiKit.Style.hideElement(this.getElement('loginFormPanel')); | ||
140 | MochiKit.Style.showElement(this.getElement('loginProgressPanel')); | ||
141 | }, | ||
142 | |||
143 | 'showLoginError': function (anError) { | ||
144 | this.getElement('errorMessage').innerHTML = "Login error"; | ||
145 | |||
146 | MochiKit.Style.showElement('backButton'); | ||
147 | MochiKit.Style.hideElement(this.getElement('loginProgressPanel')); | ||
148 | MochiKit.Style.showElement(this.getElement('loginErrorPanel')); | ||
149 | MochiKit.Style.setElementPosition(this.getElement('loginErrorPanel'), {x:0, y:45}); | ||
150 | }, | ||
151 | |||
152 | //------------------------------------------------------------------------- | ||
153 | /* | ||
154 | 'disableCancelButton': function () { | ||
155 | MochiKit.DOM.hideElement(this.getElement('cancel')); | ||
156 | }, | ||
157 | */ | ||
158 | //------------------------------------------------------------------------- | ||
159 | |||
160 | 'submitHandler': function (anEvent) { | ||
161 | anEvent.preventDefault(); | ||
162 | |||
163 | MochiKit.Signal.signal(this, 'doLogin', {'username':this.username(), 'passphrase':this.passphrase()}); | ||
164 | }, | ||
165 | |||
166 | 'cancelHandler': function (anEvent) { | ||
167 | anEvent.preventDefault(); | ||
168 | |||
169 | //console.log("CANCEL"); | ||
170 | }, | ||
171 | |||
172 | 'backHandler': function (anEvent) { | ||
173 | anEvent.preventDefault(); | ||
174 | |||
175 | this.slideInLoginForm(); | ||
176 | }, | ||
177 | |||
178 | //------------------------------------------------------------------------- | ||
179 | |||
180 | __syntaxFix__: "syntax fix" | ||
181 | }); | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/iPhone/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Controllers/MainController.js new file mode 100644 index 0000000..b43d877 --- a/dev/null +++ b/frontend/gamma/js/Clipperz/PM/UI/iPhone/Controllers/MainController.js | |||
@@ -0,0 +1,372 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2011 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz's Javascript Crypto Library. | ||
6 | Javascript Crypto Library provides web developers with an extensive | ||
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 | ||
11 | refer 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 | |||
29 | Clipperz.Base.module('Clipperz.PM.UI.iPhone.Controllers'); | ||
30 | |||
31 | //Some parts of this controller have been derived from the iUI library. | ||
32 | |||
33 | Clipperz.PM.UI.iPhone.Controllers.MainController = function() { | ||
34 | this._loginForm = null; | ||
35 | this._cardList = null; | ||
36 | this._cachedValues =null; | ||
37 | this._user = null; | ||
38 | |||
39 | if (typeof window.onorientationchange == 'object') { | ||
40 | MochiKit.Signal.connect(window, 'onorientationchange', this, 'orientationChangeHandler'); | ||
41 | MochiKit.Async.callLater(0, MochiKit.Base.method(this, 'orientationChangeHandler')); | ||
42 | } else { | ||
43 | this.setOrientation('portrait'); | ||
44 | // this.setOrientation('landscape'); | ||
45 | } | ||
46 | |||
47 | this.addMetaTag('viewport', 'width=devicewidth; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;'); | ||
48 | this.addMetaTag('apple-mobile-web-app-capable', 'yes'); | ||
49 | this.addMetaTag('apple-mobile-web-app-status-bar-style', 'black'); | ||
50 | |||
51 | this.addLinkTag('apple-touch-icon', 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAF8AAABfCAYAAACOTBv1AAAACXBIWXMAAAsTAAALEwEAmpwYAAAQC0lEQVR4nO2ce3wU1b3AvzOzz2TzBpKQhIS3CnLxgYoPqAgiQS8igiAqiFprtT571YpKUa9tvVgrVvhc7IXS4lUUvGgR5CWIoiAIYoQgJGDI+0k2yW42szNz7h8pGBHIPmazqeb7+UD4DHt+vzPfPTnnzJkzIwGCLqKCHO0K/JTpkh9FuuRHkS75UaRLfhTpkh9FuuRHkS75UaRLfhTpkh9FLNGuwKnIzc3l9WXLQAIhQILWvwQnjn3vUNtjkoQQ4kSZr77KY+TIkR1/EgHQKeWnp6eTkJiI0P2gqyeOnxD7T+ttxf/wp4SwOOnTp0/UzqM9OqV8oFXygSVIm3/xvePSKf59up/cWfO9z3c2OnmfH646qVMv2XZa+RKtrT8cWruoztv2O6384/15OLSODZ237Xda+W1nMKEiROe+U9Rp5ZtFJ+51Oq/8E/P7MOjE3oFOLL/1Iik8fUJoCF03pT6RoNPKF4Q/2zF0P0J0yQ8aM/pqoesIXQs/UITotPKFYRDuXMXQ/dDV8oNECIShgRGmOKFjGIY5dYoAnVK+QCB0DSNM+Ybmb/0SOylhy8/NzWXYsGFm1OU7hGhd0RThtdrW2Y758kdcdhGLX30h7Dhhr2ouWrSI9PQ0ykrLeHn+fBYsWIDX6w0zqsAwNOQwW77QtbBnTMdJSkzgkfvuZPqkXOJi7SAMLhl2Htt37gk5ZlgtPycnh7TU7oiGo6TH6zz/3DPUVpXz3qp3+Lch54YeWLR2OyLcbkcPf9wY/bNL2fjuMg7uWM09t11PnE1FaSwADB65746wYofV8ufMeQph6MhfvoT09atIWWORBt7GNaOv5urRWyktLeWll//MXxb/FZ/PF3BcgcDQVeRwux1DQxjBz1m7JSfx2IM/Z/J1Y3A5LUiShFK3G3vpWuwVW9Bjs6i/eCGXnjcgrPqF1fJzrxkLuopUuAJJGMhH12LZMA3LG2ej7JxDZmwT//W7uVSVFPDW/y5l4ID+gQUWAmHo4V8g6VrAA64kSYwfM5It//g7+z9Zye2TxxJPDY7CpSRsnUrCzgdwlH2AZPiwNB5CajyMYqjkjhkRcvVCbvnnnzeUBJcDUbIFyVv+/RNprsKSNx/y5mP0uAS53zSuvWoc48duoqi4lD++vIC/vb4cVVVPHVyA0P1hLw0Yhh/EmU8xtXsyv3noHiaMu5xYmwXJ8GMr34ijfB3Wut2nvR3jKN9EU850fnXHNNZs2BpS/UKW/+QTj4GhIxe+fcbPyVXbsVVtR1ifRMueQE7fKbz0u6f5/dzfsGb9JuY8+wJHiopPKmXObAdDwzhFtyPLMhPGjeKRe2cyIDsVCYHiPoCjcB32qi3Imqfd0PaqrTRmTWFw31QURUbXg69ryPKvuOxihN+LXLQ6oM9L/kasBcuwFixDTzwbS+8buf6q8UwYu4bDR8t4cf5/8+bK99C01hmKOfP87/f5PdO6M/vhX3DdmOHYLTKyWo/92zdxlm/A4j0aVGyLrxzFfQDD1ZdpE8exbMX7QdcvJPmjR/2MWJuCVLIBSXUHXV6pz0fZ8yz2vS+gZYymX/ZEXvnDbOY99yjvrd1CwZFiU65wDd0PhsTUieN44O7p9E5PQhI6trrPcJavx1a7E4nQf7uc1Z/gj8nmjptCk39860tQrFu9ksuGDcX+6f1YioNPeir0mEzUrOtQs65FtyYhSWA7uorYr0O/mKm5/C0MJRYhDBRPEc6KjTirNiP7g28wp6yzNZHywfMQsoUBo+7C1+IPqnxILf+ioYMRaj1K2aZQip8SxVuC85uFOA4uwt/9EloyxkOYSwNSyzEcdRtxVm7C2lRoUk2/Q/HXY2vYj881kLumX88ri888/p1M0PKnTr4BRfKjHN2ApAc+dw8USejYqrZhq9qGkJSwYiXv+iVShFc1nXXbaXb2Ydq1VwQtP+h5/r13zUAYOpbiwAbacAhXXKTFA8S492BoPlLjBPGumKDKBiVfURQG9ctCeKuxVH0WVKIfK4rRjLMhD8lQeWDWpKDKBiX/njtngFCxlK7rkFb1r4KrYTeG5ue6kcGtZwUlf8bUCWBo2ErWBZXkx06MJx+hNZFg8dCzR1LA5QKWH+N0kpOeCJ4yLPVfhVTJHyuy0HA17Qeh8+Cs6wMvF+gHH77vTjA0JG85emx2SJX8saLJsaA3I3Q/V52fE3C5gKeaY6+6AmH4UV39qRu2EMVThL1qK47qj7F4S0Kp8780ftlFo3MATc6z8Fp6Ht/ZS0xiMg6bFZ/a/gVXwFe4TqeTqVMmMevm6zk7pwea9xhCGCAEFk8RjpptOGo/xdJcFuZpdV78sotGxwAanQNptvZEIJAkGUtiDnuLmnht+Xo2bNoS8E37kJYXYmNjmXbTjcy8aTwDMpLRmmtb1+CFQPEcIaZuB87a7VhaKoMN3enwy3E0OgfQYO9PsyWt1ZikYEnKIa+oidfe2sj6jZtD2iURkvy2uFwupk+9kRmTc+mT7kLz1CAMAQgsniPEHNtJzLGdWNTqcNJ0KKoST6O9Pw2O/visaQjDQJJlrEl9+KrYy+IVm/hg/YfoYd5vCFt+W+Lj47ll2mRuvWE02d0crV+EECAMbN4iYty7iKnfjcVfa1ZK01CVBBrs/Wi098dnTUUIA0lubeH7in0sXrmZNes2hi28LabKb0tCQgIzpk/h5glXkpko//OLaB0jbM1FxLh3E9uwF6t2LBLpA0JVEmiw9afB3heftUfrLjlZxprUm/wylSXvbOH9DzaiaZHZ+xMx+W1JSkpi5i1TuGn85fSMF2hNVSe6JntzEbGNe3E15WHRzFnqPRMtSiIN9n402Pris3RrHasAW3IfDlT4WfLOVlav3RAx4W3pEPltSUlJYdYtU5g8bjipMS2oDa2DclzDLlJrVkU0twCK4q7DY81AIGFP6UN+ucZfV33M6rUb8PuDW48Plw6X35aZU3J5YvowbGoVWRWvIYvItzZNclIQNxHVlsK4B/5OWXV9xHOejqjt1UzvkcRj04eD5iWtenmHiAewiGYyPZsQ3jqWzp2CIkdvu2pUMsuyxMo/3Y+keehRtxq7Vteh+V16Janql6RY3Lz48IQOzd2WqMh/dc7PSbJ6iG/cSUJzfjSqQKq2D5dWyuV9YPKYoVGpQ4fLv/Ga4YwY6MTmKyO1YUtHpz+BBORon2PVm3h0Yj/6ZAS+FGwWHSo/My2FObMuR9K8ZLjfRya6N2SsqPQWu8DvZsmjY3DYwrtnHCwdJl+WJd78w+2gNtKzaSN2I/Jz+kCI4xgZ4iBOo4ZFj4/v0NwdJn/h0zOJl9wkN+8lQT0cdjyBRAtOE2oGaVIRcUYF/WJr+NVkkx/0OAMdIn/KuEu4OBuc/nLSmneYErNc6k8hF2CY8KizJEFfy0FseJk2zMqFZ6WaUMP2ibj8XunJzJ42FFn3kOXdjBzG9rzjeIinzMjBI2IpNQLcdt4OVkljgO0QQvXw4syBxDkj3/9HVL4iyyx75iaMlnqyfNuwi/Z3/7aHISQO62cj2eOxxCRTbvTEbSSaUFuIUzxk24qR1RqWPnpFxF8XE1H5C2ZPxWXU0K1lP4lGqSkxS4zeeA0HGwqd/N8+G8IwKFD7429nH36gZDjqSJLrSDaKmDvjfFNino6IyZ86bhgXpHtxalVkGHmmxGw04inX0tESB/HEvGU8+6eluBOGoxoShS05puQAGOiqxI6XKzIqGHdRpmlxTyYi8nN6JvPrCX1QdC+99R2mvGxLFzIFLb2R7XHc+8cNJ54yvPnx17B0P4taNZZyNSXsPAAWWXBOQi3oXv7jaomMFLspcU/GdPkWRWbp7FyE6ibH2IMdczbTFqkZeDWZLSUp7N136MTx2to65r5xGMUWw2FPCh7dZkq+eJtG3zg3oqWEhXenYY3A+Gu6/AWPT8ShVtDDKCBRMue+bb3mosyXgEgewuPz3vjB/7+/8RN2egah6xr57m4YwpyBMivOoLsDnL6jvDjLnFlVW0yVf8v4CxmSXItL1JIlFZgSUxMyhzypWOxxPLjgs9PuEnjouSWQOQqPJlHYGGdKboCzUwQOBAMdBdx2lbn9v2ny+2amcN+YZBTdSz9ln2mv1zrs6YZPk9hWm80XeQdP+zld15n5n+uwJedQ0iRT4zOnn7DIMCQNEIKbB9UwqFesKXHBRPnzf/3vGC1udF3jmBZvSszaFgflXgei+1Aem9f+gwdHior5y45YJFmQX2vQYsK6nRBQ3dT6eJhQVZ672bzuxzT5D/75I6SMK9ENQaEvk2+8vdBE6OH9hsQ37ngUu5NH/+frgLdsLF6+nrKECbSosK86vDcUtmiwq0jiYIWEoUnY++by9HvhXygexzT5hwoOM+L2F9mnjES2u6huiWFPQ28aNEdI8Q7Wx9Ki+dnlGcyOPQeCKnvnb9/Gnn0NtR6ZohBv0dY0wceHJKobQFJiqO11K7lPbSRv/6H2CweIAvzWrGCGYfCPjds5ZhvAqGF98R4roaI5BgmDeKsa8DhQ6VU44jawpF3ILXM3BL0VT9M08sqtjD03luraerq7wB7gBbAQcLAS8opB80s4087hrbLBPPXKO6ZvJzFV/nHyDx7m3c+rmXDDJOT6/dSrFtwtFpLtLSjt/K6pOnxZJZBsCcxeBUUlVSHVoayyhoxBo+glDlHnEWQmgtzOl+9TYddhiZJaCYSM45wJ3Pu3YjZ8/EVIdWiPiC0vVFZWcvVd8/nUPxqrqzt1PoMdlQ5qfWdOub9Gwq9J7NNHsG1XcN3NyTy/8B18fabS2Az729k8XemGj/KhpkFCtrqoyJrO+CfX8E3Bt2HV4Ux0yL6dEZdewO9vTaO5cC1CCHrFCfom/bAlljbA/moJS/pljH1qhymbmJKTk1j50CCaDm/jwt6CtJMWQA0D8kuhsEJCGODKOpcl+d14/d0Pw87dHhHpdk6mqLicFZ9Ucc3E27A35lPv1anxQrKTE5ftPj98WS6BEscz66wcKTZne3lzs48q0rm0ZwsV1V4yUr7L6W2B7QehvFYCAc5zJ3H3kkNs3bHXlNzt0WG3Ed1uNzfcv4j368fh6H4Obi98+i2UN7QOcnnlEqoKB61XsvXz/abmXrt5B/tixtCiSuwuaM1XVgeb86DeI6M4Ezjaazrjn1zFkaKOe8omKtsFzx00kFd/eR6evOUgQYJdUN8sYc+8hHHPfnH69/CEgaIorHl+Es1fvU2yS3DMIyOEIC7nfBbujmXF2tDemRMOUdur6XA4WPDUbWRVr0D11CNbY5i3pzebPjNn7f9U9M7O5LWpyTSV5CFJYB08hbvmf0RpWUXEcp6JDunzT4Wmabz74ReIjBEMH9iNQwzhleWRbX317gbktCGcn6ZzICGX2597i4aGxojmbA8R7T/ZvTKF3W7rsHwDB/SL+jkDIqpbxH/qdMrX+f5U6JIfRbrkR5Eu+VGkS34U6ZIfRbrkR5Eu+VGkS34U6ZIfRbrkR5H/Bx8z6HmTXnicAAAAAElFTkSuQmCCCg=='); | ||
52 | //this.addLinkTag('apple-touch-startup-image', 'default.png'); | ||
53 | |||
54 | // if (!window.navigator.standalone)// not running as an installed app | ||
55 | |||
56 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', this, 'selectedDirectLoginHandler'); | ||
57 | |||
58 | MochiKit.DOM.addElementClass(document.body, 'iPhone'); | ||
59 | return this; | ||
60 | } | ||
61 | |||
62 | MochiKit.Base.update(Clipperz.PM.UI.iPhone.Controllers.MainController.prototype, { | ||
63 | |||
64 | 'toString': function () { | ||
65 | return "Clipperz.PM.UI.iPhone.Controllers.MainController"; | ||
66 | }, | ||
67 | |||
68 | //========================================================================= | ||
69 | |||
70 | 'user': function () { | ||
71 | return this._user; | ||
72 | }, | ||
73 | |||
74 | 'setUser': function (aValue) { | ||
75 | this._user = aValue; | ||
76 | }, | ||
77 | |||
78 | //========================================================================= | ||
79 | |||
80 | 'loginForm': function() { | ||
81 | if (this._loginForm == null) { | ||
82 | MochiKit.DOM.removeElement('mainDiv'); | ||
83 | this._loginForm = new Clipperz.PM.UI.iPhone.Components.LoginForm({element:MochiKit.DOM.currentDocument().body}); | ||
84 | MochiKit.Signal.connect(this._loginForm, 'doLogin', this, 'doLoginHandler') | ||
85 | } | ||
86 | |||
87 | return this._loginForm; | ||
88 | }, | ||
89 | |||
90 | 'removeLoginForm': function () { | ||
91 | if (this._loginForm != null) { | ||
92 | this._loginForm.remove(); | ||
93 | this._loginForm = null; | ||
94 | } | ||
95 | }, | ||
96 | |||
97 | //----------------------------------------------------------------------------- | ||
98 | |||
99 | 'cardList': function () { | ||
100 | if (this._cardList == null) { | ||
101 | this._cardList = new Clipperz.PM.UI.iPhone.Components.CardList({element:MochiKit.DOM.currentDocument().body}); | ||
102 | MochiKit.Signal.connect(this._cardList, 'searchEvent',this, 'searchEventHandler') | ||
103 | MochiKit.Signal.connect(this._cardList, 'selectedCard',this, 'selecetedCardHandler') | ||
104 | } | ||
105 | |||
106 | return this._cardList; | ||
107 | }, | ||
108 | |||
109 | //========================================================================= | ||
110 | |||
111 | 'currentWidth': function () { | ||
112 | return this._currentWidth; | ||
113 | }, | ||
114 | |||
115 | 'setCurrentWidth': function (aValue) { | ||
116 | this._currentWidth = aValue; | ||
117 | }, | ||
118 | |||
119 | //========================================================================= | ||
120 | |||
121 | 'orientationChangeHandler': function () { | ||
122 | switch(window.orientation) { | ||
123 | case 0: | ||
124 | this.setOrientation('portrait'); | ||
125 | break; | ||
126 | case 90: | ||
127 | case -90: | ||
128 | this.setOrientation('landscape'); | ||
129 | break; | ||
130 | } | ||
131 | }, | ||
132 | |||
133 | //------------------------------------------------------------------------- | ||
134 | |||
135 | 'setOrientation': function (anOrientation) { | ||
136 | document.body.setAttribute('orientation', anOrientation); | ||
137 | setTimeout(scrollTo, 100, 0, 1); | ||
138 | }, | ||
139 | |||
140 | //------------------------------------------------------------------------- | ||
141 | |||
142 | 'slidePages': function (fromPage, toPage, backwards) { | ||
143 | var axis; | ||
144 | var slideDone; | ||
145 | |||
146 | slideDone = function () { | ||
147 | // console.log("slideDone"); | ||
148 | if (!hasClass(toPage, "dialog")) { | ||
149 | fromPage.removeAttribute("selected"); | ||
150 | } | ||
151 | checkTimer = setInterval(checkOrientAndLocation, 300); | ||
152 | setTimeout(updatePage, 0, toPage, fromPage); | ||
153 | fromPage.removeEventListener('webkitTransitionEnd', slideDone, false); | ||
154 | } | ||
155 | |||
156 | axis = (backwards ? fromPage : toPage).getAttribute("axis"); | ||
157 | |||
158 | clearInterval(checkTimer); | ||
159 | |||
160 | if (canDoSlideAnim() && axis != 'y') { | ||
161 | slide2(fromPage, toPage, backwards, slideDone); | ||
162 | } else { | ||
163 | slide1(fromPage, toPage, backwards, axis, slideDone); | ||
164 | } | ||
165 | }, | ||
166 | |||
167 | //------------------------------------------------------------------------- | ||
168 | |||
169 | 'getCachedValues': function () { | ||
170 | var deferredResult; | ||
171 | |||
172 | if (this._cachedObjects != null) { | ||
173 | deferredResult = MochiKit.Async.succeed(this._cachedObjects); | ||
174 | } else { | ||
175 | deferredResult = new Clipperz.Async.Deferred("MainController.getCachedValues", {trace:false}); | ||
176 | deferredResult.addMethod(this.user(), 'getRecords'); | ||
177 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("MainController.getCachedValues - collectResults", { | ||
178 | '_rowObject': MochiKit.Async.succeed, | ||
179 | '_reference': MochiKit.Base.methodcaller('reference'), | ||
180 | 'label': MochiKit.Base.methodcaller('label'), | ||
181 | 'favicon': MochiKit.Base.methodcaller('favicon'), | ||
182 | '_searchableContent':MochiKit.Base.methodcaller('searchableContent') | ||
183 | }, {trace:false})); | ||
184 | deferredResult.addCallback(Clipperz.Async.collectAll); | ||
185 | deferredResult.addCallback(MochiKit.Base.bind(function (someRows) { | ||
186 | this._cachedObjects = someRows; | ||
187 | return this._cachedObjects; | ||
188 | }, this)); | ||
189 | deferredResult.callback(); | ||
190 | } | ||
191 | |||
192 | return deferredResult; | ||
193 | }, | ||
194 | //========================================================================= | ||
195 | |||
196 | 'run': function(shouldShowRegistrationForm) { | ||
197 | this.loginForm().render(); | ||
198 | MochiKit.Async.callLater(1, MochiKit.Base.method(this.loginForm(), 'focusOnUsername')); | ||
199 | }, | ||
200 | |||
201 | //========================================================================= | ||
202 | |||
203 | 'doLoginHandler': function (someArgs) { | ||
204 | var deferredResult; | ||
205 | varparameters; | ||
206 | varshouldUseOTP; | ||
207 | // var loginProgress; | ||
208 | varuser; | ||
209 | var getPassphraseDelegate; | ||
210 | |||
211 | parameters = someArgs; | ||
212 | shouldUseOTP = (typeof(parameters.passphrase) == 'undefined'); | ||
213 | |||
214 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, parameters.passphrase); | ||
215 | user = new Clipperz.PM.DataModel.User({'username':parameters.username, 'getPassphraseFunction':getPassphraseDelegate}); | ||
216 | |||
217 | deferredResult = new Clipperz.Async.Deferred("MainController.doLogin", {trace:false}); | ||
218 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); | ||
219 | deferredResult.addMethod(this.loginForm(), 'showLoginProgress'); | ||
220 | deferredResult.addCallback(MochiKit.Async.wait, 0.1); | ||
221 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); | ||
222 | deferredResult.addMethod(user, 'login'); | ||
223 | deferredResult.addMethod(this, 'setUser', user); | ||
224 | deferredResult.addMethod(user, 'getRecords'); | ||
225 | deferredResult.addMethod(this, 'removeLoginForm'); | ||
226 | deferredResult.addMethod(this.cardList(), 'render'); | ||
227 | deferredResult.addMethod(this, 'displaySelectedRecords', ''); | ||
228 | deferredResult.addErrback(MochiKit.Base.method(this.loginForm(), 'showLoginError')); | ||
229 | deferredResult.callback(); | ||
230 | |||
231 | return deferredResult; | ||
232 | }, | ||
233 | |||
234 | //========================================================================= | ||
235 | |||
236 | 'searchEventHandler': function (aValue) { | ||
237 | //console.log("searching for ... " + aValue); | ||
238 | return this.displaySelectedRecords(aValue); | ||
239 | }, | ||
240 | |||
241 | //========================================================================= | ||
242 | |||
243 | '_displaySelectedRows': function (aFilter, someRows) { | ||
244 | var result; | ||
245 | |||
246 | result = someRows; | ||
247 | |||
248 | if (aFilter != null) { | ||
249 | var filter; | ||
250 | varfilterRegExp; | ||
251 | |||
252 | filter = aFilter.replace(/[^A-Za-z0-9]/g, "\\$&"); | ||
253 | filterRegExp = new RegExp(filter, "i"); | ||
254 | result = MochiKit.Base.filter(function (aCachedResult) { return filterRegExp.test(aCachedResult['_searchableContent'])}, result); | ||
255 | } | ||
256 | |||
257 | |||
258 | result.sort(MochiKit.Base.partial(function (aKey, aComparator, aObject, bObject) { | ||
259 | return aComparator(aObject[aKey], bObject[aKey]); | ||
260 | }, 'label', Clipperz.Base.caseInsensitiveCompare)); | ||
261 | |||
262 | this.cardList().update(result); | ||
263 | }, | ||
264 | |||
265 | //------------------------------------------------------------------------- | ||
266 | |||
267 | 'displaySelectedRecords': function (aFilter) { | ||
268 | return Clipperz.Async.callbacks("MainController.displaySelectedrows", [ | ||
269 | MochiKit.Base.method(this, 'getCachedValues'), | ||
270 | MochiKit.Base.method(this, '_displaySelectedRows', aFilter) | ||
271 | ], {trace:false}); | ||
272 | }, | ||
273 | |||
274 | //========================================================================= | ||
275 | |||
276 | 'selecetedCardHandler': function (aRecordReference) { | ||
277 | vardeferredResult; | ||
278 | varrecordData; | ||
279 | |||
280 | recordData = {}; | ||
281 | //console.log("Showing detail for card with reference", aRecordReference); | ||
282 | deferredResult = new Clipperz.Async.Deferred("MainController.selectedCardHandler", {trace:false}); | ||
283 | deferredResult.addMethod(this.user(), 'getRecord', aRecordReference); | ||
284 | deferredResult.collectResults({ | ||
285 | '_reference':MochiKit.Base.methodcaller('reference'), | ||
286 | 'title': MochiKit.Base.methodcaller('label'), | ||
287 | 'favicon': MochiKit.Base.methodcaller('favicon') | ||
288 | }); | ||
289 | deferredResult.addCallback(function (someData) { | ||
290 | MochiKit.Base.update(recordData, someData); | ||
291 | }) | ||
292 | deferredResult.addMethod(this.cardList(), 'showCard', recordData); | ||
293 | |||
294 | deferredResult.addMethod(this.user(), 'getRecord', aRecordReference); | ||
295 | deferredResult.addMethodcaller('notes'); | ||
296 | deferredResult.addCallback(function (someNotes) { | ||
297 | recordData['notes'] = someNotes; | ||
298 | }) | ||
299 | |||
300 | deferredResult.addMethod(this.user(), 'getRecord', aRecordReference); | ||
301 | deferredResult.addMethodcaller('getCurrentRecordVersion'); | ||
302 | deferredResult.addMethodcaller('fields'); | ||
303 | deferredResult.addCallback(MochiKit.Base.values); | ||
304 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("MainController.selectedCardHandler - fields", { | ||
305 | 'label':MochiKit.Base.methodcaller('label'), | ||
306 | 'value':MochiKit.Base.methodcaller('value'), | ||
307 | 'isHidden':MochiKit.Base.methodcaller('isHidden') | ||
308 | }, {trace:false})); | ||
309 | deferredResult.addCallback(Clipperz.Async.collectAll); | ||
310 | deferredResult.addCallback(function (someData) { | ||
311 | recordData['fields'] = someData; | ||
312 | }); | ||
313 | |||
314 | deferredResult.addMethod(this.user(), 'getRecord', aRecordReference); | ||
315 | deferredResult.addMethodcaller('directLogins'); | ||
316 | deferredResult.addCallback(MochiKit.Base.values); | ||
317 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("MainController.selectedCardHandler - directLogins", { | ||
318 | 'label': MochiKit.Base.methodcaller('label'), | ||
319 | 'favicon': MochiKit.Base.methodcaller('favicon'), | ||
320 | '_reference':MochiKit.Base.methodcaller('reference') | ||
321 | }, {trace:false})); | ||
322 | deferredResult.addCallback(Clipperz.Async.collectAll); | ||
323 | deferredResult.addCallback(function (someData) { | ||
324 | recordData['directLogins'] = someData; | ||
325 | }); | ||
326 | |||
327 | deferredResult.addMethod(this.cardList(), 'showCardDetails', recordData); | ||
328 | deferredResult.callback(); | ||
329 | |||
330 | return deferredResult; | ||
331 | }, | ||
332 | |||
333 | //========================================================================= | ||
334 | |||
335 | 'selectedDirectLoginHandler': function (someData) { | ||
336 | vardeferredResult; | ||
337 | |||
338 | //console.log("<<< signal - directLogin"); | ||
339 | deferredResult = new Clipperz.Async.Deferred("MainController.selectedDirectLoginHandler", {trace:false}); | ||
340 | deferredResult.addMethod(this.user(), 'getRecord', someData['cardReference']); | ||
341 | deferredResult.addMethodcaller('directLogins'); | ||
342 | deferredResult.addCallback(MochiKit.Base.itemgetter(someData['directLoginReference'])); | ||
343 | // deferredResult.addMethodcaller('runDirectLogin'); | ||
344 | deferredResult.addCallback(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin); | ||
345 | deferredResult.callback(); | ||
346 | |||
347 | return deferredResult; | ||
348 | }, | ||
349 | |||
350 | //========================================================================= | ||
351 | |||
352 | 'addMetaTag': function (aName, aContent) { | ||
353 | varmetaTag; | ||
354 | |||
355 | metaTag = document.createElement('meta'); | ||
356 | metaTag.name = aName; | ||
357 | metaTag.content = aContent; | ||
358 | document.getElementsByTagName('head')[0].appendChild(metaTag); | ||
359 | }, | ||
360 | |||
361 | 'addLinkTag': function (aRel, anHref) { | ||
362 | var linkTag; | ||
363 | |||
364 | linkTag = document.createElement('link'); | ||
365 | linkTag.rel = aRel; | ||
366 | linkTag.href = anHref; | ||
367 | document.getElementsByTagName('head')[0].appendChild(linkTag); | ||
368 | }, | ||
369 | |||
370 | //========================================================================= | ||
371 | __syntaxFix__: "syntax fix" | ||
372 | }); \ No newline at end of file | ||