Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI') (more/less context) (ignore whitespace changes)
79 files changed, 805 insertions, 1080 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 index 25e82ca..f667526 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //download.js | 25 | //download.js |
28 | //Download | 26 | //Download |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/15/10 | 28 | //Created by Giulio Cesare Solaroli on 3/15/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; | 33 | var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; |
36 | var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; | 34 | var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) | 36 | function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var stroke; | 41 | var stroke; |
44 | var path; | 42 | var path; |
45 | var pointX; | 43 | var pointX; |
46 | var pointY; | 44 | var pointY; |
47 | if (window.devicePixelRatio) | 45 | if (window.devicePixelRatio) |
48 | resolution = window.devicePixelRatio; | 46 | resolution = window.devicePixelRatio; |
49 | else | 47 | else |
50 | resolution = 1.0; | 48 | resolution = 1.0; |
51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 49 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
52 | 50 | ||
53 | context.save(); | 51 | context.save(); |
54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 52 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 53 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
56 | 54 | ||
57 | // arrow | 55 | // arrow |
58 | 56 | ||
59 | stroke = aThickness; | 57 | stroke = aThickness; |
60 | stroke *= resolution; | 58 | stroke *= resolution; |
61 | if (stroke < 1.0) | 59 | if (stroke < 1.0) |
62 | stroke = Math.ceil(stroke); | 60 | stroke = Math.ceil(stroke); |
63 | else | 61 | else |
64 | stroke = Math.round(stroke); | 62 | stroke = Math.round(stroke); |
65 | stroke /= resolution; | 63 | stroke /= resolution; |
66 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 64 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
67 | context.beginPath(); | 65 | context.beginPath(); |
68 | pointX = 16.5; | 66 | pointX = 16.5; |
69 | pointY = 22.5; | 67 | pointY = 22.5; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 68 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 69 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.moveTo(pointX, pointY); | 70 | context.moveTo(pointX, pointY); |
73 | pointX = 19.5; | 71 | pointX = 19.5; |
74 | pointY = 8.5; | 72 | pointY = 8.5; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | context.lineTo(pointX, pointY); | 75 | context.lineTo(pointX, pointY); |
78 | pointX = 30.038; | 76 | pointX = 30.038; |
79 | pointY = 10.605; | 77 | pointY = 10.605; |
80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
82 | context.lineTo(pointX, pointY); | 80 | context.lineTo(pointX, pointY); |
83 | pointX = 27.354; | 81 | pointX = 27.354; |
84 | pointY = 24.354; | 82 | pointY = 24.354; |
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js index ba425ec..dae5a2d 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //look.js | 25 | //look.js |
28 | //Look | 26 | //Look |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/15/10 | 28 | //Created by Giulio Cesare Solaroli on 3/15/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; | 33 | var kClipperz_PM_UI_Canvas_CoverActions_lookWidth = 46.0; |
36 | var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; | 34 | var kClipperz_PM_UI_Canvas_CoverActions_lookHeight = 46.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) | 36 | function Clipperz_PM_UI_Canvas_CoverActions_look(canvas, aColor, aFillColor, aThickness) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var stroke; | 41 | var stroke; |
44 | var path; | 42 | var path; |
45 | var pointX; | 43 | var pointX; |
46 | var pointY; | 44 | var pointY; |
47 | if (window.devicePixelRatio) | 45 | if (window.devicePixelRatio) |
48 | resolution = window.devicePixelRatio; | 46 | resolution = window.devicePixelRatio; |
49 | else | 47 | else |
50 | resolution = 1.0; | 48 | resolution = 1.0; |
51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | 49 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); |
52 | 50 | ||
53 | context.save(); | 51 | context.save(); |
54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | 52 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_lookWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_lookHeight); |
55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight); | 53 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_lookWidth, kClipperz_PM_UI_Canvas_CoverActions_lookHeight); |
56 | 54 | ||
57 | // Layer 6 | 55 | // Layer 6 |
58 | 56 | ||
59 | stroke = aThickness; | 57 | stroke = aThickness; |
60 | stroke *= resolution; | 58 | stroke *= resolution; |
61 | if (stroke < 1.0) | 59 | if (stroke < 1.0) |
62 | stroke = Math.ceil(stroke); | 60 | stroke = Math.ceil(stroke); |
63 | else | 61 | else |
64 | stroke = Math.round(stroke); | 62 | stroke = Math.round(stroke); |
65 | stroke /= resolution; | 63 | stroke /= resolution; |
66 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 64 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
67 | context.save(); | 65 | context.save(); |
68 | context.translate(17.5, 23.0); | 66 | context.translate(17.5, 23.0); |
69 | context.rotate(-0.503); | 67 | context.rotate(-0.503); |
70 | context.translate(-17.5, -23.0); | 68 | context.translate(-17.5, -23.0); |
71 | context.beginPath(); | 69 | context.beginPath(); |
72 | pointX = 28.5; | 70 | pointX = 28.5; |
73 | pointY = 31.5; | 71 | pointY = 31.5; |
74 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
75 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
76 | context.moveTo(pointX, pointY); | 74 | context.moveTo(pointX, pointY); |
77 | pointX = 28.5; | 75 | pointX = 28.5; |
78 | pointY = 14.5; | 76 | pointY = 14.5; |
79 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
80 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
81 | context.lineTo(pointX, pointY); | 79 | context.lineTo(pointX, pointY); |
82 | pointX = 6.5; | 80 | pointX = 6.5; |
83 | pointY = 14.5; | 81 | pointY = 14.5; |
84 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
85 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
86 | context.lineTo(pointX, pointY); | 84 | context.lineTo(pointX, pointY); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js index 5c1f860..497fd05 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //directLogin.js | 25 | //directLogin.js |
28 | //directLogin | 26 | //directLogin |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/7/10 | 28 | //Created by Giulio Cesare Solaroli on 3/7/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Features_directLoginWidth = 76.0; | 33 | var kClipperz_PM_UI_Canvas_Features_directLoginWidth = 76.0; |
36 | var kClipperz_PM_UI_Canvas_Features_directLoginHeight = 76.0; | 34 | var kClipperz_PM_UI_Canvas_Features_directLoginHeight = 76.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Features_directLogin(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 36 | function Clipperz_PM_UI_Canvas_Features_directLogin(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var stroke; | 41 | var stroke; |
44 | var path; | 42 | var path; |
45 | var pointX; | 43 | var pointX; |
46 | var pointY; | 44 | var pointY; |
47 | if (window.devicePixelRatio) | 45 | if (window.devicePixelRatio) |
48 | resolution = window.devicePixelRatio; | 46 | resolution = window.devicePixelRatio; |
49 | else | 47 | else |
50 | resolution = 1.0; | 48 | resolution = 1.0; |
51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); | 49 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); |
52 | 50 | ||
53 | context.save(); | 51 | context.save(); |
54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); | 52 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_directLoginWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_directLoginHeight); |
55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_directLoginWidth, kClipperz_PM_UI_Canvas_Features_directLoginHeight); | 53 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_directLoginWidth, kClipperz_PM_UI_Canvas_Features_directLoginHeight); |
56 | 54 | ||
57 | // Layer 2 | 55 | // Layer 2 |
58 | 56 | ||
59 | stroke = 6.0; | 57 | stroke = 6.0; |
60 | stroke *= resolution; | 58 | stroke *= resolution; |
61 | if (stroke < 1.0) | 59 | if (stroke < 1.0) |
62 | stroke = Math.ceil(stroke); | 60 | stroke = Math.ceil(stroke); |
63 | else | 61 | else |
64 | stroke = Math.round(stroke); | 62 | stroke = Math.round(stroke); |
65 | stroke /= resolution; | 63 | stroke /= resolution; |
66 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 64 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
67 | context.beginPath(); | 65 | context.beginPath(); |
68 | pointX = 30.0; | 66 | pointX = 30.0; |
69 | pointY = 41.0; | 67 | pointY = 41.0; |
70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 68 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 69 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
72 | context.moveTo(pointX, pointY); | 70 | context.moveTo(pointX, pointY); |
73 | pointX = 45.579; | 71 | pointX = 45.579; |
74 | pointY = 25.451; | 72 | pointY = 25.451; |
75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
77 | context.lineTo(pointX, pointY); | 75 | context.lineTo(pointX, pointY); |
78 | context.strokeStyle = aColor; | 76 | context.strokeStyle = aColor; |
79 | context.lineWidth = stroke; | 77 | context.lineWidth = stroke; |
80 | context.lineCap = "square"; | 78 | context.lineCap = "square"; |
81 | context.stroke(); | 79 | context.stroke(); |
82 | 80 | ||
83 | alignStroke = 0.0; | 81 | alignStroke = 0.0; |
84 | context.beginPath(); | 82 | context.beginPath(); |
85 | pointX = 34.207; | 83 | pointX = 34.207; |
86 | pointY = 45.697; | 84 | pointY = 45.697; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js index b829ed6..f015535 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //protect.js | 25 | //protect.js |
28 | //protect | 26 | //protect |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/7/10 | 28 | //Created by Giulio Cesare Solaroli on 3/7/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Features_protectWidth = 76.0; | 33 | var kClipperz_PM_UI_Canvas_Features_protectWidth = 76.0; |
36 | var kClipperz_PM_UI_Canvas_Features_protectHeight = 76.0; | 34 | var kClipperz_PM_UI_Canvas_Features_protectHeight = 76.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Features_protect(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 36 | function Clipperz_PM_UI_Canvas_Features_protect(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | var controlPoint1X; | 44 | var controlPoint1X; |
47 | var controlPoint1Y; | 45 | var controlPoint1Y; |
48 | var controlPoint2X; | 46 | var controlPoint2X; |
49 | var controlPoint2Y; | 47 | var controlPoint2Y; |
50 | var stroke; | 48 | var stroke; |
51 | if (window.devicePixelRatio) | 49 | if (window.devicePixelRatio) |
52 | resolution = window.devicePixelRatio; | 50 | resolution = window.devicePixelRatio; |
53 | else | 51 | else |
54 | resolution = 1.0; | 52 | resolution = 1.0; |
55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); | 53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); |
56 | 54 | ||
57 | context.save(); | 55 | context.save(); |
58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); | 56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_protectWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_protectHeight); |
59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_protectWidth, kClipperz_PM_UI_Canvas_Features_protectHeight); | 57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_protectWidth, kClipperz_PM_UI_Canvas_Features_protectHeight); |
60 | 58 | ||
61 | // Layer 1 | 59 | // Layer 1 |
62 | 60 | ||
63 | alignStroke = 0.0; | 61 | alignStroke = 0.0; |
64 | context.beginPath(); | 62 | context.beginPath(); |
65 | pointX = 38.5; | 63 | pointX = 38.5; |
66 | pointY = 36.0; | 64 | pointY = 36.0; |
67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
69 | context.moveTo(pointX, pointY); | 67 | context.moveTo(pointX, pointY); |
70 | pointX = 37.068; | 68 | pointX = 37.068; |
71 | pointY = 38.816; | 69 | pointY = 38.816; |
72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
74 | controlPoint1X = 37.41; | 72 | controlPoint1X = 37.41; |
75 | controlPoint1Y = 36.234; | 73 | controlPoint1Y = 36.234; |
76 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 74 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
77 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 75 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
78 | controlPoint2X = 37.175; | 76 | controlPoint2X = 37.175; |
79 | controlPoint2Y = 37.907; | 77 | controlPoint2Y = 37.907; |
80 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 78 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
81 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 79 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
82 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 80 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
83 | pointX = 37.031; | 81 | pointX = 37.031; |
84 | pointY = 40.802; | 82 | pointY = 40.802; |
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js index 8d73cc7..47972fc 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //share.js | 25 | //share.js |
28 | //share | 26 | //share |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/7/10 | 28 | //Created by Giulio Cesare Solaroli on 3/7/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Features_shareWidth = 76.0; | 33 | var kClipperz_PM_UI_Canvas_Features_shareWidth = 76.0; |
36 | var kClipperz_PM_UI_Canvas_Features_shareHeight = 76.0; | 34 | var kClipperz_PM_UI_Canvas_Features_shareHeight = 76.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Features_share(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 36 | function Clipperz_PM_UI_Canvas_Features_share(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | var controlPoint1X; | 44 | var controlPoint1X; |
47 | var controlPoint1Y; | 45 | var controlPoint1Y; |
48 | var controlPoint2X; | 46 | var controlPoint2X; |
49 | var controlPoint2Y; | 47 | var controlPoint2Y; |
50 | var stroke; | 48 | var stroke; |
51 | if (window.devicePixelRatio) | 49 | if (window.devicePixelRatio) |
52 | resolution = window.devicePixelRatio; | 50 | resolution = window.devicePixelRatio; |
53 | else | 51 | else |
54 | resolution = 1.0; | 52 | resolution = 1.0; |
55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); | 53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); |
56 | 54 | ||
57 | context.save(); | 55 | context.save(); |
58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); | 56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_shareWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_shareHeight); |
59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_shareWidth, kClipperz_PM_UI_Canvas_Features_shareHeight); | 57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_shareWidth, kClipperz_PM_UI_Canvas_Features_shareHeight); |
60 | 58 | ||
61 | // Layer 1 | 59 | // Layer 1 |
62 | 60 | ||
63 | alignStroke = 0.0; | 61 | alignStroke = 0.0; |
64 | context.beginPath(); | 62 | context.beginPath(); |
65 | pointX = 43.179; | 63 | pointX = 43.179; |
66 | pointY = 18.621; | 64 | pointY = 18.621; |
67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
69 | context.moveTo(pointX, pointY); | 67 | context.moveTo(pointX, pointY); |
70 | pointX = 37.163; | 68 | pointX = 37.163; |
71 | pointY = 12.605; | 69 | pointY = 12.605; |
72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
74 | controlPoint1X = 43.179; | 72 | controlPoint1X = 43.179; |
75 | controlPoint1Y = 15.32; | 73 | controlPoint1Y = 15.32; |
76 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 74 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
77 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 75 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
78 | controlPoint2X = 40.463; | 76 | controlPoint2X = 40.463; |
79 | controlPoint2Y = 12.605; | 77 | controlPoint2Y = 12.605; |
80 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 78 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
81 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 79 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
82 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 80 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
83 | pointX = 31.147; | 81 | pointX = 31.147; |
84 | pointY = 18.621; | 82 | pointY = 18.621; |
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js index 572d9be..a4f30b2 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //store.js | 25 | //store.js |
28 | //store | 26 | //store |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/7/10 | 28 | //Created by Giulio Cesare Solaroli on 3/7/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Features_storeWidth = 76.0; | 33 | var kClipperz_PM_UI_Canvas_Features_storeWidth = 76.0; |
36 | var kClipperz_PM_UI_Canvas_Features_storeHeight = 76.0; | 34 | var kClipperz_PM_UI_Canvas_Features_storeHeight = 76.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Features_store(canvas, aColor, aBannerColor, aBannerBackgroundColor) | 36 | function Clipperz_PM_UI_Canvas_Features_store(canvas, aColor, aBannerColor, aBannerBackgroundColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | if (window.devicePixelRatio) | 44 | if (window.devicePixelRatio) |
47 | resolution = window.devicePixelRatio; | 45 | resolution = window.devicePixelRatio; |
48 | else | 46 | else |
49 | resolution = 1.0; | 47 | resolution = 1.0; |
50 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); | 48 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth + canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); |
51 | 49 | ||
52 | context.save(); | 50 | context.save(); |
53 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); | 51 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Features_storeWidth, canvas.height / kClipperz_PM_UI_Canvas_Features_storeHeight); |
54 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_storeWidth, kClipperz_PM_UI_Canvas_Features_storeHeight); | 52 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Features_storeWidth, kClipperz_PM_UI_Canvas_Features_storeHeight); |
55 | 53 | ||
56 | // Layer 1 | 54 | // Layer 1 |
57 | 55 | ||
58 | alignStroke = 0.0; | 56 | alignStroke = 0.0; |
59 | context.beginPath(); | 57 | context.beginPath(); |
60 | pointX = 27.0; | 58 | pointX = 27.0; |
61 | pointY = 29.5; | 59 | pointY = 29.5; |
62 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 60 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
63 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 61 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
64 | context.moveTo(pointX, pointY); | 62 | context.moveTo(pointX, pointY); |
65 | pointX = 27.0; | 63 | pointX = 27.0; |
66 | pointY = 24.5; | 64 | pointY = 24.5; |
67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
69 | context.lineTo(pointX, pointY); | 67 | context.lineTo(pointX, pointY); |
70 | pointX = 22.0; | 68 | pointX = 22.0; |
71 | pointY = 24.5; | 69 | pointY = 24.5; |
72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
74 | context.lineTo(pointX, pointY); | 72 | context.lineTo(pointX, pointY); |
75 | pointX = 22.0; | 73 | pointX = 22.0; |
76 | pointY = 29.5; | 74 | pointY = 29.5; |
77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
79 | context.lineTo(pointX, pointY); | 77 | context.lineTo(pointX, pointY); |
80 | pointX = 27.0; | 78 | pointX = 27.0; |
81 | pointY = 29.5; | 79 | pointY = 29.5; |
82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
84 | context.lineTo(pointX, pointY); | 82 | context.lineTo(pointX, pointY); |
85 | context.closePath(); | 83 | context.closePath(); |
86 | context.fillStyle = aColor; | 84 | context.fillStyle = aColor; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js index b9443bd..dccefab 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js | |||
@@ -1,65 +1,63 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Canvas'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Canvas'); |
27 | 25 | ||
28 | MochiKit.Base.update(Clipperz.PM.UI.Canvas , { | 26 | MochiKit.Base.update(Clipperz.PM.UI.Canvas , { |
29 | 'marks': { | 27 | 'marks': { |
30 | '!':Clipperz_PM_UI_Canvas_Marks_exclamationMark, | 28 | '!':Clipperz_PM_UI_Canvas_Marks_exclamationMark, |
31 | '?':Clipperz_PM_UI_Canvas_Marks_questionMark, | 29 | '?':Clipperz_PM_UI_Canvas_Marks_questionMark, |
32 | 'i':Clipperz_PM_UI_Canvas_Marks_info | 30 | 'i':Clipperz_PM_UI_Canvas_Marks_info |
33 | }, | 31 | }, |
34 | 32 | ||
35 | 'features': { | 33 | 'features': { |
36 | 'store': Clipperz_PM_UI_Canvas_Features_store, | 34 | 'store': Clipperz_PM_UI_Canvas_Features_store, |
37 | 'protect': Clipperz_PM_UI_Canvas_Features_protect, | 35 | 'protect': Clipperz_PM_UI_Canvas_Features_protect, |
38 | 'directLogin':Clipperz_PM_UI_Canvas_Features_directLogin, | 36 | 'directLogin':Clipperz_PM_UI_Canvas_Features_directLogin, |
39 | 'share': Clipperz_PM_UI_Canvas_Features_share | 37 | 'share': Clipperz_PM_UI_Canvas_Features_share |
40 | }, | 38 | }, |
41 | 39 | ||
42 | 'tips': { | 40 | 'tips': { |
43 | 'open': Clipperz_PM_UI_Canvas_Tips_open, | 41 | 'open': Clipperz_PM_UI_Canvas_Tips_open, |
44 | 'close': Clipperz_PM_UI_Canvas_Tips_close | 42 | 'close': Clipperz_PM_UI_Canvas_Tips_close |
45 | }, | 43 | }, |
46 | 44 | ||
47 | 'star': { | 45 | 'star': { |
48 | 'normal': Clipperz_PM_UI_Canvas_Star_normal | 46 | 'normal': Clipperz_PM_UI_Canvas_Star_normal |
49 | }, | 47 | }, |
50 | 48 | ||
51 | 'coverActions': { | 49 | 'coverActions': { |
52 | 'look': Clipperz_PM_UI_Canvas_CoverActions_look, | 50 | 'look': Clipperz_PM_UI_Canvas_CoverActions_look, |
53 | 'download': Clipperz_PM_UI_Canvas_CoverActions_download | 51 | 'download': Clipperz_PM_UI_Canvas_CoverActions_download |
54 | }, | 52 | }, |
55 | 53 | ||
56 | 'registerButton': { | 54 | 'registerButton': { |
57 | 'normal': Clipperz_PM_UI_Canvas_RegisterButton_normal | 55 | 'normal': Clipperz_PM_UI_Canvas_RegisterButton_normal |
58 | }, | 56 | }, |
59 | 57 | ||
60 | 'logo': { | 58 | 'logo': { |
61 | 'normal': Clipperz_PM_UI_Canvas_Logo_normal | 59 | 'normal': Clipperz_PM_UI_Canvas_Logo_normal |
62 | }, | 60 | }, |
63 | 61 | ||
64 | __syntaxFix__: "syntax fix" | 62 | __syntaxFix__: "syntax fix" |
65 | }); | 63 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js index cc60bba..24c0bc3 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js | |||
@@ -1,54 +1,52 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //normal.js | 25 | //normal.js |
28 | //New Image | 26 | //New Image |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 2/13/12 | 28 | //Created by Giulio Cesare Solaroli on 2/13/12 |
31 | //Copyright 2012 Clipperz | 29 | //Copyright 2012 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Logo_normalWidth = 150.0; | 33 | var kClipperz_PM_UI_Canvas_Logo_normalWidth = 150.0; |
36 | var kClipperz_PM_UI_Canvas_Logo_normalHeight = 39.0; | 34 | var kClipperz_PM_UI_Canvas_Logo_normalHeight = 39.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Logo_normal(canvas, logo, fontSize, text_color) | 36 | function Clipperz_PM_UI_Canvas_Logo_normal(canvas, logo, fontSize, text_color) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | 39 | ||
42 | canvas.width = kClipperz_PM_UI_Canvas_Logo_normalWidth; | 40 | canvas.width = kClipperz_PM_UI_Canvas_Logo_normalWidth; |
43 | canvas.height = kClipperz_PM_UI_Canvas_Logo_normalHeight; | 41 | canvas.height = kClipperz_PM_UI_Canvas_Logo_normalHeight; |
44 | 42 | ||
45 | context.save(); | 43 | context.save(); |
46 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Logo_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Logo_normalHeight); | 44 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Logo_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Logo_normalHeight); |
47 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Logo_normalWidth, kClipperz_PM_UI_Canvas_Logo_normalHeight); | 45 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Logo_normalWidth, kClipperz_PM_UI_Canvas_Logo_normalHeight); |
48 | 46 | ||
49 | context.font = fontSize + " HelveticaNeue-Bold"; | 47 | context.font = fontSize + " HelveticaNeue-Bold"; |
50 | context.fillStyle = text_color; | 48 | context.fillStyle = text_color; |
51 | context.fillText(logo, 3, 30); | 49 | context.fillText(logo, 3, 30); |
52 | 50 | ||
53 | context.restore(); | 51 | context.restore(); |
54 | } | 52 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js index 02f2f80..5982f0d 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //exclamationMark.js | 25 | //exclamationMark.js |
28 | //! | 26 | //! |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/7/10 | 28 | //Created by Giulio Cesare Solaroli on 3/7/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth = 50.0; | 33 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth = 50.0; |
36 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight = 50.0; | 34 | var kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight = 50.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Marks_exclamationMark(canvas, aColor) | 36 | function Clipperz_PM_UI_Canvas_Marks_exclamationMark(canvas, aColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | var controlPoint1X; | 44 | var controlPoint1X; |
47 | var controlPoint1Y; | 45 | var controlPoint1Y; |
48 | var controlPoint2X; | 46 | var controlPoint2X; |
49 | var controlPoint2Y; | 47 | var controlPoint2Y; |
50 | if (window.devicePixelRatio) | 48 | if (window.devicePixelRatio) |
51 | resolution = window.devicePixelRatio; | 49 | resolution = window.devicePixelRatio; |
52 | else | 50 | else |
53 | resolution = 1.0; | 51 | resolution = 1.0; |
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | 52 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); |
55 | 53 | ||
56 | context.save(); | 54 | context.save(); |
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | 55 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); |
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); | 56 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_exclamationMarkWidth, kClipperz_PM_UI_Canvas_Marks_exclamationMarkHeight); |
59 | 57 | ||
60 | // Layer 1 | 58 | // Layer 1 |
61 | 59 | ||
62 | alignStroke = 0.0; | 60 | alignStroke = 0.0; |
63 | context.beginPath(); | 61 | context.beginPath(); |
64 | pointX = 26.499; | 62 | pointX = 26.499; |
65 | pointY = 10.848; | 63 | pointY = 10.848; |
66 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 64 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
67 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 65 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
68 | context.moveTo(pointX, pointY); | 66 | context.moveTo(pointX, pointY); |
69 | pointX = 20.887; | 67 | pointX = 20.887; |
70 | pointY = 11.584; | 68 | pointY = 11.584; |
71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 69 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 70 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
73 | controlPoint1X = 25.395; | 71 | controlPoint1X = 25.395; |
74 | controlPoint1Y = 10.802; | 72 | controlPoint1Y = 10.802; |
75 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 73 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
76 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 74 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
77 | controlPoint2X = 22.175; | 75 | controlPoint2X = 22.175; |
78 | controlPoint2Y = 11.078; | 76 | controlPoint2Y = 11.078; |
79 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 77 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
80 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 78 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
81 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 79 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
82 | pointX = 20.013; | 80 | pointX = 20.013; |
83 | pointY = 13.194; | 81 | pointY = 13.194; |
84 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
85 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
86 | controlPoint1X = 20.335; | 84 | controlPoint1X = 20.335; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js index fad5c10..2501992 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //info.js | 25 | //info.js |
28 | //i | 26 | //i |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/7/10 | 28 | //Created by Giulio Cesare Solaroli on 3/7/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Marks_infoWidth = 50.0; | 33 | var kClipperz_PM_UI_Canvas_Marks_infoWidth = 50.0; |
36 | var kClipperz_PM_UI_Canvas_Marks_infoHeight = 50.0; | 34 | var kClipperz_PM_UI_Canvas_Marks_infoHeight = 50.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Marks_info(canvas, aColor) | 36 | function Clipperz_PM_UI_Canvas_Marks_info(canvas, aColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | var controlPoint1X; | 44 | var controlPoint1X; |
47 | var controlPoint1Y; | 45 | var controlPoint1Y; |
48 | var controlPoint2X; | 46 | var controlPoint2X; |
49 | var controlPoint2Y; | 47 | var controlPoint2Y; |
50 | var color; | 48 | var color; |
51 | if (window.devicePixelRatio) | 49 | if (window.devicePixelRatio) |
52 | resolution = window.devicePixelRatio; | 50 | resolution = window.devicePixelRatio; |
53 | else | 51 | else |
54 | resolution = 1.0; | 52 | resolution = 1.0; |
55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); | 53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); |
56 | 54 | ||
57 | context.save(); | 55 | context.save(); |
58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); | 56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_infoWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_infoHeight); |
59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_infoWidth, kClipperz_PM_UI_Canvas_Marks_infoHeight); | 57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_infoWidth, kClipperz_PM_UI_Canvas_Marks_infoHeight); |
60 | 58 | ||
61 | // Layer 1 | 59 | // Layer 1 |
62 | 60 | ||
63 | alignStroke = 0.0; | 61 | alignStroke = 0.0; |
64 | context.beginPath(); | 62 | context.beginPath(); |
65 | pointX = 30.253; | 63 | pointX = 30.253; |
66 | pointY = 37.436; | 64 | pointY = 37.436; |
67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
69 | context.moveTo(pointX, pointY); | 67 | context.moveTo(pointX, pointY); |
70 | pointX = 28.505; | 68 | pointX = 28.505; |
71 | pointY = 37.022; | 69 | pointY = 37.022; |
72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
74 | context.lineTo(pointX, pointY); | 72 | context.lineTo(pointX, pointY); |
75 | pointX = 27.677; | 73 | pointX = 27.677; |
76 | pointY = 35.09; | 74 | pointY = 35.09; |
77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
79 | controlPoint1X = 27.953; | 77 | controlPoint1X = 27.953; |
80 | controlPoint1Y = 36.792; | 78 | controlPoint1Y = 36.792; |
81 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 79 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
82 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 80 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
83 | controlPoint2X = 27.677; | 81 | controlPoint2X = 27.677; |
84 | controlPoint2Y = 36.47; | 82 | controlPoint2Y = 36.47; |
85 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 83 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
86 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 84 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js index 5842828..9a8ac7d 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //questionMark.js | 25 | //questionMark.js |
28 | //? | 26 | //? |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/7/10 | 28 | //Created by Giulio Cesare Solaroli on 3/7/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Marks_questionMarkWidth = 50.0; | 33 | var kClipperz_PM_UI_Canvas_Marks_questionMarkWidth = 50.0; |
36 | var kClipperz_PM_UI_Canvas_Marks_questionMarkHeight = 50.0; | 34 | var kClipperz_PM_UI_Canvas_Marks_questionMarkHeight = 50.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Marks_questionMark(canvas, aColor) | 36 | function Clipperz_PM_UI_Canvas_Marks_questionMark(canvas, aColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | var controlPoint1X; | 44 | var controlPoint1X; |
47 | var controlPoint1Y; | 45 | var controlPoint1Y; |
48 | var controlPoint2X; | 46 | var controlPoint2X; |
49 | var controlPoint2Y; | 47 | var controlPoint2Y; |
50 | var color; | 48 | var color; |
51 | if (window.devicePixelRatio) | 49 | if (window.devicePixelRatio) |
52 | resolution = window.devicePixelRatio; | 50 | resolution = window.devicePixelRatio; |
53 | else | 51 | else |
54 | resolution = 1.0; | 52 | resolution = 1.0; |
55 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | 53 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth + canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); |
56 | 54 | ||
57 | context.save(); | 55 | context.save(); |
58 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | 56 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, canvas.height / kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); |
59 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); | 57 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Marks_questionMarkWidth, kClipperz_PM_UI_Canvas_Marks_questionMarkHeight); |
60 | 58 | ||
61 | // Layer 1 | 59 | // Layer 1 |
62 | 60 | ||
63 | alignStroke = 0.0; | 61 | alignStroke = 0.0; |
64 | context.beginPath(); | 62 | context.beginPath(); |
65 | pointX = 24.118; | 63 | pointX = 24.118; |
66 | pointY = 24.464; | 64 | pointY = 24.464; |
67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
69 | context.moveTo(pointX, pointY); | 67 | context.moveTo(pointX, pointY); |
70 | pointX = 24.854; | 68 | pointX = 24.854; |
71 | pointY = 23.406; | 69 | pointY = 23.406; |
72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
74 | controlPoint1X = 24.118; | 72 | controlPoint1X = 24.118; |
75 | controlPoint1Y = 24.05; | 73 | controlPoint1Y = 24.05; |
76 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 74 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
77 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 75 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
78 | controlPoint2X = 24.44; | 76 | controlPoint2X = 24.44; |
79 | controlPoint2Y = 23.636; | 77 | controlPoint2Y = 23.636; |
80 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 78 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
81 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 79 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
82 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 80 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
83 | pointX = 29.454; | 81 | pointX = 29.454; |
84 | pointY = 20.6; | 82 | pointY = 20.6; |
85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
86 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js index 2462d0e..65e5ca6 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //normal.js | 25 | //normal.js |
28 | //normal | 26 | //normal |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/24/10 | 28 | //Created by Giulio Cesare Solaroli on 3/24/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_RegisterButton_normalWidth = 282.0; | 33 | var kClipperz_PM_UI_Canvas_RegisterButton_normalWidth = 282.0; |
36 | var kClipperz_PM_UI_Canvas_RegisterButton_normalHeight = 93.0; | 34 | var kClipperz_PM_UI_Canvas_RegisterButton_normalHeight = 93.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_RegisterButton_normal(canvas, aBackgroundColor, aDarkBackgroundColor, aLightColor, aDarkColor, aStarColor) | 36 | function Clipperz_PM_UI_Canvas_RegisterButton_normal(canvas, aBackgroundColor, aDarkBackgroundColor, aLightColor, aDarkColor, aStarColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | var controlPoint1X; | 44 | var controlPoint1X; |
47 | var controlPoint1Y; | 45 | var controlPoint1Y; |
48 | var controlPoint2X; | 46 | var controlPoint2X; |
49 | var controlPoint2Y; | 47 | var controlPoint2Y; |
50 | var gradient; | 48 | var gradient; |
51 | var color; | 49 | var color; |
52 | if (window.devicePixelRatio) | 50 | if (window.devicePixelRatio) |
53 | resolution = window.devicePixelRatio; | 51 | resolution = window.devicePixelRatio; |
54 | else | 52 | else |
55 | resolution = 1.0; | 53 | resolution = 1.0; |
56 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | 54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); |
57 | 55 | ||
58 | context.save(); | 56 | context.save(); |
59 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | 57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); |
60 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); | 58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_RegisterButton_normalWidth, kClipperz_PM_UI_Canvas_RegisterButton_normalHeight); |
61 | 59 | ||
62 | // background | 60 | // background |
63 | 61 | ||
64 | alignStroke = 0.0; | 62 | alignStroke = 0.0; |
65 | context.beginPath(); | 63 | context.beginPath(); |
66 | pointX = 241.0; | 64 | pointX = 241.0; |
67 | pointY = 80.0; | 65 | pointY = 80.0; |
68 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 66 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
69 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 67 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
70 | context.moveTo(pointX, pointY); | 68 | context.moveTo(pointX, pointY); |
71 | pointX = 274.0; | 69 | pointX = 274.0; |
72 | pointY = 47.0; | 70 | pointY = 47.0; |
73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
75 | controlPoint1X = 259.103; | 73 | controlPoint1X = 259.103; |
76 | controlPoint1Y = 80.0; | 74 | controlPoint1Y = 80.0; |
77 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; | 75 | controlPoint1X = (Math.round(resolution * controlPoint1X + alignStroke) - alignStroke) / resolution; |
78 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; | 76 | controlPoint1Y = (Math.round(resolution * controlPoint1Y + alignStroke) - alignStroke) / resolution; |
79 | controlPoint2X = 274.0; | 77 | controlPoint2X = 274.0; |
80 | controlPoint2Y = 65.103; | 78 | controlPoint2Y = 65.103; |
81 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; | 79 | controlPoint2X = (Math.round(resolution * controlPoint2X + alignStroke) - alignStroke) / resolution; |
82 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; | 80 | controlPoint2Y = (Math.round(resolution * controlPoint2Y + alignStroke) - alignStroke) / resolution; |
83 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); | 81 | context.bezierCurveTo(controlPoint1X, controlPoint1Y, controlPoint2X, controlPoint2Y, pointX, pointY); |
84 | pointX = 274.0; | 82 | pointX = 274.0; |
85 | pointY = 45.0; | 83 | pointY = 45.0; |
86 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 84 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js index cf475c6..5b344ef 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //normal.js | 25 | //normal.js |
28 | //normal | 26 | //normal |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/15/10 | 28 | //Created by Giulio Cesare Solaroli on 3/15/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Star_normalWidth = 46.0; | 33 | var kClipperz_PM_UI_Canvas_Star_normalWidth = 46.0; |
36 | var kClipperz_PM_UI_Canvas_Star_normalHeight = 46.0; | 34 | var kClipperz_PM_UI_Canvas_Star_normalHeight = 46.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Star_normal(canvas, aColor) | 36 | function Clipperz_PM_UI_Canvas_Star_normal(canvas, aColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | if (window.devicePixelRatio) | 44 | if (window.devicePixelRatio) |
47 | resolution = window.devicePixelRatio; | 45 | resolution = window.devicePixelRatio; |
48 | else | 46 | else |
49 | resolution = 1.0; | 47 | resolution = 1.0; |
50 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); | 48 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth + canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); |
51 | 49 | ||
52 | context.save(); | 50 | context.save(); |
53 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); | 51 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Star_normalWidth, canvas.height / kClipperz_PM_UI_Canvas_Star_normalHeight); |
54 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Star_normalWidth, kClipperz_PM_UI_Canvas_Star_normalHeight); | 52 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Star_normalWidth, kClipperz_PM_UI_Canvas_Star_normalHeight); |
55 | 53 | ||
56 | // * | 54 | // * |
57 | 55 | ||
58 | alignStroke = 0.0; | 56 | alignStroke = 0.0; |
59 | context.beginPath(); | 57 | context.beginPath(); |
60 | pointX = 8.613; | 58 | pointX = 8.613; |
61 | pointY = 15.583; | 59 | pointY = 15.583; |
62 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 60 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
63 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 61 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
64 | context.moveTo(pointX, pointY); | 62 | context.moveTo(pointX, pointY); |
65 | pointX = 18.563; | 63 | pointX = 18.563; |
66 | pointY = 18.821; | 64 | pointY = 18.821; |
67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
69 | context.lineTo(pointX, pointY); | 67 | context.lineTo(pointX, pointY); |
70 | pointX = 18.563; | 68 | pointX = 18.563; |
71 | pointY = 7.347; | 69 | pointY = 7.347; |
72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
74 | context.lineTo(pointX, pointY); | 72 | context.lineTo(pointX, pointY); |
75 | pointX = 26.799; | 73 | pointX = 26.799; |
76 | pointY = 7.347; | 74 | pointY = 7.347; |
77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
79 | context.lineTo(pointX, pointY); | 77 | context.lineTo(pointX, pointY); |
80 | pointX = 26.799; | 78 | pointX = 26.799; |
81 | pointY = 18.821; | 79 | pointY = 18.821; |
82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
84 | context.lineTo(pointX, pointY); | 82 | context.lineTo(pointX, pointY); |
85 | pointX = 36.749; | 83 | pointX = 36.749; |
86 | pointY = 15.583; | 84 | pointY = 15.583; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js index cd7ed90..21dfcc0 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //close.js | 25 | //close.js |
28 | //close | 26 | //close |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/14/10 | 28 | //Created by Giulio Cesare Solaroli on 3/14/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Tips_closeWidth = 310.0; | 33 | var kClipperz_PM_UI_Canvas_Tips_closeWidth = 310.0; |
36 | var kClipperz_PM_UI_Canvas_Tips_closeHeight = 6.0; | 34 | var kClipperz_PM_UI_Canvas_Tips_closeHeight = 6.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Tips_close(canvas, aColor, aBackgroundColor) | 36 | function Clipperz_PM_UI_Canvas_Tips_close(canvas, aColor, aBackgroundColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | if (window.devicePixelRatio) | 44 | if (window.devicePixelRatio) |
47 | resolution = window.devicePixelRatio; | 45 | resolution = window.devicePixelRatio; |
48 | else | 46 | else |
49 | resolution = 1.0; | 47 | resolution = 1.0; |
50 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); | 48 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); |
51 | 49 | ||
52 | context.save(); | 50 | context.save(); |
53 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); | 51 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_closeWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_closeHeight); |
54 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_closeWidth, kClipperz_PM_UI_Canvas_Tips_closeHeight); | 52 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_closeWidth, kClipperz_PM_UI_Canvas_Tips_closeHeight); |
55 | 53 | ||
56 | // background | 54 | // background |
57 | 55 | ||
58 | alignStroke = 0.0; | 56 | alignStroke = 0.0; |
59 | context.beginPath(); | 57 | context.beginPath(); |
60 | pointX = 310.0; | 58 | pointX = 310.0; |
61 | pointY = 6.0; | 59 | pointY = 6.0; |
62 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 60 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
63 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 61 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
64 | context.moveTo(pointX, pointY); | 62 | context.moveTo(pointX, pointY); |
65 | pointX = 310.0; | 63 | pointX = 310.0; |
66 | pointY = 0.0; | 64 | pointY = 0.0; |
67 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 65 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
68 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 66 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
69 | context.lineTo(pointX, pointY); | 67 | context.lineTo(pointX, pointY); |
70 | pointX = 0.0; | 68 | pointX = 0.0; |
71 | pointY = 0.0; | 69 | pointY = 0.0; |
72 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
73 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
74 | context.lineTo(pointX, pointY); | 72 | context.lineTo(pointX, pointY); |
75 | pointX = 0.0; | 73 | pointX = 0.0; |
76 | pointY = 6.0; | 74 | pointY = 6.0; |
77 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
78 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
79 | context.lineTo(pointX, pointY); | 77 | context.lineTo(pointX, pointY); |
80 | pointX = 310.0; | 78 | pointX = 310.0; |
81 | pointY = 6.0; | 79 | pointY = 6.0; |
82 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
83 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
84 | context.lineTo(pointX, pointY); | 82 | context.lineTo(pointX, pointY); |
85 | context.closePath(); | 83 | context.closePath(); |
86 | context.fillStyle = aBackgroundColor; | 84 | context.fillStyle = aBackgroundColor; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js index 30c1c69..9c76865 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | // | 24 | // |
27 | //open.js | 25 | //open.js |
28 | //open | 26 | //open |
29 | // | 27 | // |
30 | //Created by Giulio Cesare Solaroli on 3/14/10 | 28 | //Created by Giulio Cesare Solaroli on 3/14/10 |
31 | //Copyright 2010 Clipperz | 29 | //Copyright 2010 Clipperz |
32 | //This code was generated by Opacity. You may use or modify it in any way. | 30 | //This code was generated by Opacity. You may use or modify it in any way. |
33 | // | 31 | // |
34 | 32 | ||
35 | var kClipperz_PM_UI_Canvas_Tips_openWidth = 310.0; | 33 | var kClipperz_PM_UI_Canvas_Tips_openWidth = 310.0; |
36 | var kClipperz_PM_UI_Canvas_Tips_openHeight = 6.0; | 34 | var kClipperz_PM_UI_Canvas_Tips_openHeight = 6.0; |
37 | 35 | ||
38 | function Clipperz_PM_UI_Canvas_Tips_open(canvas, aColor, aBackgroundColor) | 36 | function Clipperz_PM_UI_Canvas_Tips_open(canvas, aColor, aBackgroundColor) |
39 | { | 37 | { |
40 | var context = canvas.getContext("2d"); | 38 | var context = canvas.getContext("2d"); |
41 | var alignStroke; | 39 | var alignStroke; |
42 | var resolution; | 40 | var resolution; |
43 | var path; | 41 | var path; |
44 | var pointX; | 42 | var pointX; |
45 | var pointY; | 43 | var pointY; |
46 | var color; | 44 | var color; |
47 | if (window.devicePixelRatio) | 45 | if (window.devicePixelRatio) |
48 | resolution = window.devicePixelRatio; | 46 | resolution = window.devicePixelRatio; |
49 | else | 47 | else |
50 | resolution = 1.0; | 48 | resolution = 1.0; |
51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); | 49 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth + canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); |
52 | 50 | ||
53 | context.save(); | 51 | context.save(); |
54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); | 52 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_Tips_openWidth, canvas.height / kClipperz_PM_UI_Canvas_Tips_openHeight); |
55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_openWidth, kClipperz_PM_UI_Canvas_Tips_openHeight); | 53 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_Tips_openWidth, kClipperz_PM_UI_Canvas_Tips_openHeight); |
56 | 54 | ||
57 | // background | 55 | // background |
58 | 56 | ||
59 | alignStroke = 0.0; | 57 | alignStroke = 0.0; |
60 | context.beginPath(); | 58 | context.beginPath(); |
61 | pointX = 310.0; | 59 | pointX = 310.0; |
62 | pointY = 6.0; | 60 | pointY = 6.0; |
63 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 61 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
64 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 62 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
65 | context.moveTo(pointX, pointY); | 63 | context.moveTo(pointX, pointY); |
66 | pointX = 310.0; | 64 | pointX = 310.0; |
67 | pointY = 0.0; | 65 | pointY = 0.0; |
68 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 66 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
69 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 67 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
70 | context.lineTo(pointX, pointY); | 68 | context.lineTo(pointX, pointY); |
71 | pointX = 0.0; | 69 | pointX = 0.0; |
72 | pointY = 0.0; | 70 | pointY = 0.0; |
73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 71 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 72 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
75 | context.lineTo(pointX, pointY); | 73 | context.lineTo(pointX, pointY); |
76 | pointX = 0.0; | 74 | pointX = 0.0; |
77 | pointY = 6.0; | 75 | pointY = 6.0; |
78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 76 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 77 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
80 | context.lineTo(pointX, pointY); | 78 | context.lineTo(pointX, pointY); |
81 | pointX = 310.0; | 79 | pointX = 310.0; |
82 | pointY = 6.0; | 80 | pointY = 6.0; |
83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 81 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 82 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
85 | context.lineTo(pointX, pointY); | 83 | context.lineTo(pointX, pointY); |
86 | context.closePath(); | 84 | context.closePath(); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js index b9d7adf..58b7593 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js | |||
@@ -1,190 +1,187 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | var _Clipperz_PM_Components_base_id_ = 0; | 28 | var _Clipperz_PM_Components_base_id_ = 0; |
31 | 29 | ||
32 | //############################################################################# | 30 | //############################################################################# |
33 | 31 | ||
34 | Clipperz.PM.UI.Common.Components.BaseComponent = function(args) { | 32 | Clipperz.PM.UI.Common.Components.BaseComponent = function(args) { |
35 | args = args || {}; | 33 | args = args || {}; |
36 | Clipperz.PM.UI.Common.Components.BaseComponent.superclass.constructor.call(this, args); | 34 | Clipperz.PM.UI.Common.Components.BaseComponent.superclass.constructor.call(this, args); |
37 | 35 | ||
38 | this._element = args.element || null; | 36 | this._element = args.element || null; |
39 | this._ids = {}; | 37 | this._ids = {}; |
40 | 38 | ||
41 | this._slots = {}; | 39 | this._slots = {}; |
42 | this._slotComponents = {}; | 40 | this._slotComponents = {}; |
43 | 41 | ||
44 | this._components = {}; | 42 | this._components = {}; |
45 | 43 | ||
46 | this._cachedSlots = {}; | 44 | this._cachedSlots = {}; |
47 | 45 | ||
48 | this._isModal = false; | 46 | this._isModal = false; |
49 | 47 | ||
50 | this._isActive = false; | 48 | this._isActive = false; |
51 | this._elementUsedToEnterModalState; | 49 | this._elementUsedToEnterModalState; |
52 | 50 | ||
53 | this._isFullyRendered = false; | 51 | this._isFullyRendered = false; |
54 | this._renderingWaitingQueue = []; | 52 | this._renderingWaitingQueue = []; |
55 | 53 | ||
56 | //this._slots = { | 54 | //this._slots = { |
57 | // 'header':'header', | 55 | // 'header':'header', |
58 | // 'body': 'body', | 56 | // 'body': 'body', |
59 | // 'footer':'footer' | 57 | // 'footer':'footer' |
60 | //}; | 58 | //}; |
61 | 59 | ||
62 | return this; | 60 | return this; |
63 | } | 61 | } |
64 | 62 | ||
65 | //============================================================================= | 63 | //============================================================================= |
66 | 64 | ||
67 | //TODO get back to MochiKit.Base.update as we are not extending anything | 65 | //TODO get back to MochiKit.Base.update as we are not extending anything |
68 | //MochiKit.Base.update(Clipperz.PM.UI.Common.Components.BaseComponent.prototype, { | 66 | //MochiKit.Base.update(Clipperz.PM.UI.Common.Components.BaseComponent.prototype, { |
69 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Component*/ Object, { | 67 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Component*/ Object, { |
70 | 68 | ||
71 | 'isClipperzPMComponent': true, | 69 | 'isClipperzPMComponent': true, |
72 | 70 | ||
73 | //------------------------------------------------------------------------- | 71 | //------------------------------------------------------------------------- |
74 | 72 | ||
75 | 'toString': function () { | 73 | 'toString': function () { |
76 | return "Clipperz.PM.UI.Common.Components.BaseComponent component"; | 74 | return "Clipperz.PM.UI.Common.Components.BaseComponent component"; |
77 | }, | 75 | }, |
78 | 76 | ||
79 | 'componentId': function () { | 77 | 'componentId': function () { |
80 | return this.getId('_id_'); | 78 | return this.getId('_id_'); |
81 | }, | 79 | }, |
82 | 80 | ||
83 | //------------------------------------------------------------------------- | 81 | //------------------------------------------------------------------------- |
84 | /* | 82 | /* |
85 | 'slots': function() { | 83 | 'slots': function() { |
86 | return this._slots; | 84 | return this._slots; |
87 | }, | 85 | }, |
88 | */ | 86 | */ |
89 | 'slotComponents': function() { | 87 | 'slotComponents': function() { |
90 | return this._slotComponents; | 88 | return this._slotComponents; |
91 | }, | 89 | }, |
92 | 90 | ||
93 | //------------------------------------------------------------------------- | 91 | //------------------------------------------------------------------------- |
94 | 92 | ||
95 | 'components': function () { | 93 | 'components': function () { |
96 | return this._components; | 94 | return this._components; |
97 | }, | 95 | }, |
98 | 96 | ||
99 | 'addComponent': function (aComponent) { | 97 | 'addComponent': function (aComponent) { |
100 | this.components()[aComponent.componentId()] = aComponent; | 98 | this.components()[aComponent.componentId()] = aComponent; |
101 | }, | 99 | }, |
102 | 100 | ||
103 | 'removeComponent': function (aComponent) { | 101 | 'removeComponent': function (aComponent) { |
104 | var componentId; | 102 | var componentId; |
105 | 103 | ||
106 | componentId = aComponent.componentId(); | 104 | componentId = aComponent.componentId(); |
107 | this.components()[componentId].remove(); | 105 | this.components()[componentId].remove(); |
108 | delete this.components()[componentId]; | 106 | delete this.components()[componentId]; |
109 | }, | 107 | }, |
110 | 108 | ||
111 | //------------------------------------------------------------------------- | 109 | //------------------------------------------------------------------------- |
112 | /* | 110 | /* |
113 | 'domHelper': function() { | 111 | 'domHelper': function() { |
114 | return Clipperz.YUI.DomHelper; | 112 | return Clipperz.YUI.DomHelper; |
115 | }, | 113 | }, |
116 | */ | 114 | */ |
117 | //------------------------------------------------------------------------- | 115 | //------------------------------------------------------------------------- |
118 | /* | 116 | /* |
119 | 'domHelperAppend': function(aValue) { | 117 | 'domHelperAppend': function(aValue) { |
120 | Clipperz.YUI.DomHelper.append(this.element().dom, aValue); | 118 | Clipperz.YUI.DomHelper.append(this.element().dom, aValue); |
121 | }, | 119 | }, |
122 | */ | 120 | */ |
123 | //------------------------------------------------------------------------- | 121 | //------------------------------------------------------------------------- |
124 | 122 | ||
125 | 'element': function() { | 123 | 'element': function() { |
126 | //MochiKit.Logging.logDebug(">>> BaseComponent.element"); | ||
127 | return MochiKit.DOM.getElement(this._element); | 124 | return MochiKit.DOM.getElement(this._element); |
128 | }, | 125 | }, |
129 | 126 | ||
130 | 'setElement': function(aNode) { | 127 | 'setElement': function(aNode) { |
131 | this._element = aNode; | 128 | this._element = aNode; |
132 | }, | 129 | }, |
133 | 130 | ||
134 | //----------------------------------------------------- | 131 | //----------------------------------------------------- |
135 | 132 | ||
136 | 'displayElement': function() { | 133 | 'displayElement': function() { |
137 | return this.element(); | 134 | return this.element(); |
138 | }, | 135 | }, |
139 | 136 | ||
140 | //------------------------------------------------------------------------- | 137 | //------------------------------------------------------------------------- |
141 | 138 | ||
142 | 'renderInNode': function(aDomNode) { | 139 | 'renderInNode': function(aDomNode) { |
143 | this.setElement(aDomNode); | 140 | this.setElement(aDomNode); |
144 | this.render(); | 141 | this.render(); |
145 | }, | 142 | }, |
146 | 143 | ||
147 | 'render': function() { | 144 | 'render': function() { |
148 | this.clear(); | 145 | this.clear(); |
149 | this.renderSelf(); | 146 | this.renderSelf(); |
150 | this.renderComponents(); | 147 | this.renderComponents(); |
151 | if (this.shouldShowTranslationHints()) { | 148 | if (this.shouldShowTranslationHints()) { |
152 | this.renderTranslationHints(); | 149 | this.renderTranslationHints(); |
153 | } | 150 | } |
154 | if (this.shouldShowElementWhileRendering()) { | 151 | if (this.shouldShowElementWhileRendering()) { |
155 | MochiKit.Style.showElement(this.displayElement()); | 152 | MochiKit.Style.showElement(this.displayElement()); |
156 | }; | 153 | }; |
157 | 154 | ||
158 | this._isFullyRendered = true; | 155 | this._isFullyRendered = true; |
159 | 156 | ||
160 | MochiKit.Iter.forEach(this.renderingWaitingQueue(), MochiKit.Base.methodcaller('callback')); | 157 | MochiKit.Iter.forEach(this.renderingWaitingQueue(), MochiKit.Base.methodcaller('callback')); |
161 | this.resetRenderingWaitingQueue(); | 158 | this.resetRenderingWaitingQueue(); |
162 | }, | 159 | }, |
163 | 160 | ||
164 | 'renderSelf': function() { | 161 | 'renderSelf': function() { |
165 | throw Clipperz.Base.exception.AbstractMethod; | 162 | throw Clipperz.Base.exception.AbstractMethod; |
166 | }, | 163 | }, |
167 | 164 | ||
168 | 'renderComponents': function() { | 165 | 'renderComponents': function() { |
169 | varslotName; | 166 | varslotName; |
170 | 167 | ||
171 | for (slotName in this.slotComponents()) { | 168 | for (slotName in this.slotComponents()) { |
172 | this.slotComponents()[slotName].renderInNode(this.elementForSlotNamed(slotName)); | 169 | this.slotComponents()[slotName].renderInNode(this.elementForSlotNamed(slotName)); |
173 | } | 170 | } |
174 | }, | 171 | }, |
175 | 172 | ||
176 | //......................................................................... | 173 | //......................................................................... |
177 | 174 | ||
178 | 'isFullyRendered': function () { | 175 | 'isFullyRendered': function () { |
179 | return this._isFullyRendered; | 176 | return this._isFullyRendered; |
180 | }, | 177 | }, |
181 | 178 | ||
182 | //......................................................................... | 179 | //......................................................................... |
183 | 180 | ||
184 | 'renderingWaitingQueue': function () { | 181 | 'renderingWaitingQueue': function () { |
185 | return this._renderingWaitingQueue; | 182 | return this._renderingWaitingQueue; |
186 | }, | 183 | }, |
187 | 184 | ||
188 | 'resetRenderingWaitingQueue': function () { | 185 | 'resetRenderingWaitingQueue': function () { |
189 | this._renderingWaitingQueue = []; | 186 | this._renderingWaitingQueue = []; |
190 | }, | 187 | }, |
@@ -252,133 +249,130 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Compo | |||
252 | throw Clipperz.Base.exception.AbstractMethod; | 249 | throw Clipperz.Base.exception.AbstractMethod; |
253 | }, | 250 | }, |
254 | 251 | ||
255 | //----------------------------------------------------- | 252 | //----------------------------------------------------- |
256 | 253 | ||
257 | 'checkSlotNamed': function(aSlotName) { | 254 | 'checkSlotNamed': function(aSlotName) { |
258 | if (typeof(this._slots[aSlotName]) == 'undefined') { | 255 | if (typeof(this._slots[aSlotName]) == 'undefined') { |
259 | throw new Error("undefined slot"); | 256 | throw new Error("undefined slot"); |
260 | }; | 257 | }; |
261 | }, | 258 | }, |
262 | 259 | ||
263 | //----------------------------------------------------- | 260 | //----------------------------------------------------- |
264 | 261 | ||
265 | 'cachedSlots': function() { | 262 | 'cachedSlots': function() { |
266 | return this._cachedSlots; | 263 | return this._cachedSlots; |
267 | }, | 264 | }, |
268 | 265 | ||
269 | 'slotNamed': function(aSlotName) { | 266 | 'slotNamed': function(aSlotName) { |
270 | var result; | 267 | var result; |
271 | 268 | ||
272 | this.checkSlotNamed(aSlotName); | 269 | this.checkSlotNamed(aSlotName); |
273 | if (typeof(this.cachedSlots()[aSlotName]) == 'undefined') { | 270 | if (typeof(this.cachedSlots()[aSlotName]) == 'undefined') { |
274 | this.cachedSlots()[aSlotName] = new Clipperz.PM.UI.Common.Components.ComponentSlot(this,aSlotName); | 271 | this.cachedSlots()[aSlotName] = new Clipperz.PM.UI.Common.Components.ComponentSlot(this,aSlotName); |
275 | } | 272 | } |
276 | 273 | ||
277 | result = this.cachedSlots()[aSlotName]; | 274 | result = this.cachedSlots()[aSlotName]; |
278 | 275 | ||
279 | return result; | 276 | return result; |
280 | }, | 277 | }, |
281 | 278 | ||
282 | //----------------------------------------------------- | 279 | //----------------------------------------------------- |
283 | 280 | ||
284 | 'elementForSlotNamed': function(aSlotName) { | 281 | 'elementForSlotNamed': function(aSlotName) { |
285 | return MochiKit.DOM.getElement(this._slots[aSlotName]); | 282 | return MochiKit.DOM.getElement(this._slots[aSlotName]); |
286 | }, | 283 | }, |
287 | 284 | ||
288 | //----------------------------------------------------- | 285 | //----------------------------------------------------- |
289 | 286 | ||
290 | 'componentForSlotNamed': function(aSlotName) { | 287 | 'componentForSlotNamed': function(aSlotName) { |
291 | return this.slotComponents()[aSlotName]; | 288 | return this.slotComponents()[aSlotName]; |
292 | }, | 289 | }, |
293 | 290 | ||
294 | 'setComponentForSlotNamed': function(aComponent, aSlotName) { | 291 | 'setComponentForSlotNamed': function(aComponent, aSlotName) { |
295 | var domNode; | 292 | var domNode; |
296 | 293 | ||
297 | this.checkSlotNamed(aSlotName); | 294 | this.checkSlotNamed(aSlotName); |
298 | 295 | ||
299 | if (this.slotComponents()[aSlotName] != null) { | 296 | if (this.slotComponents()[aSlotName] != null) { |
300 | this.slotComponents()[aSlotName].remove(); | 297 | this.slotComponents()[aSlotName].remove(); |
301 | } | 298 | } |
302 | 299 | ||
303 | this.slotComponents()[aSlotName] = aComponent; | 300 | this.slotComponents()[aSlotName] = aComponent; |
304 | 301 | ||
305 | // domNode = MochiKit.DOM.getElement(this.slotNamed(aSlotName)); | 302 | // domNode = MochiKit.DOM.getElement(this.slotNamed(aSlotName)); |
306 | domNode = this.elementForSlotNamed(aSlotName); | 303 | domNode = this.elementForSlotNamed(aSlotName); |
307 | 304 | ||
308 | if (domNode != null) { | 305 | if (domNode != null) { |
309 | aComponent.renderInNode(domNode); | 306 | aComponent.renderInNode(domNode); |
310 | } | 307 | } |
311 | }, | 308 | }, |
312 | 309 | ||
313 | //----------------------------------------------------- | 310 | //----------------------------------------------------- |
314 | /* | 311 | /* |
315 | 'purgeListeners': function() { | 312 | 'purgeListeners': function() { |
316 | //MochiKit.Logging.logDebug(">>> Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners [" + this + "]"); | ||
317 | //MochiKit.Logging.logDebug("--- " + this + ".purgeListeners"); | ||
318 | Clipperz.NotificationCenter.unregister(this); | 313 | Clipperz.NotificationCenter.unregister(this); |
319 | MochiKit.Signal.disconnectAllTo(this); | 314 | MochiKit.Signal.disconnectAllTo(this); |
320 | //MochiKit.Logging.logDebug("<<< Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners"); | ||
321 | }, | 315 | }, |
322 | */ | 316 | */ |
323 | //----------------------------------------------------- | 317 | //----------------------------------------------------- |
324 | 318 | ||
325 | 'clear': function() { | 319 | 'clear': function() { |
326 | varslotName; | 320 | varslotName; |
327 | var componentId; | 321 | var componentId; |
328 | 322 | ||
329 | MochiKit.Signal.disconnectAllTo(this); | 323 | MochiKit.Signal.disconnectAllTo(this); |
330 | 324 | ||
331 | for (slotName in this.slotComponents()) { | 325 | for (slotName in this.slotComponents()) { |
332 | this.slotComponents()[slotName].clear(); | 326 | this.slotComponents()[slotName].clear(); |
333 | } | 327 | } |
334 | 328 | ||
335 | for (componentId in this.components()) { | 329 | for (componentId in this.components()) { |
336 | this.components()[componentId].clear(); | 330 | this.components()[componentId].clear(); |
337 | } | 331 | } |
338 | 332 | ||
339 | // if (this.element() != null) { | 333 | // if (this.element() != null) { |
340 | // this.element().innerHTML = ""; | 334 | // this.element().innerHTML = ""; |
341 | // } | 335 | // } |
342 | 336 | ||
343 | if (this.displayElement() != null) { | 337 | if (this.displayElement() != null) { |
344 | if (this.element() != this.displayElement()) { | 338 | if (this.element() != this.displayElement()) { |
345 | MochiKit.DOM.removeElement(this.displayElement()); | 339 | MochiKit.DOM.removeElement(this.displayElement()); |
346 | } else { | 340 | } else { |
347 | this.displayElement().innerHTML = ""; | 341 | this.displayElement().innerHTML = ""; |
348 | } | 342 | } |
349 | } | 343 | } |
350 | 344 | ||
351 | if (this.isModal()) { | 345 | if (this.isModal()) { |
352 | //TODO: cleanup when the closed element was shown modally. | 346 | //TODO: cleanup when the closed element was shown modally. |
353 | } | 347 | } |
354 | }, | 348 | }, |
355 | 349 | ||
356 | 350 | ||
357 | 'remove': function() { | 351 | 'remove': function() { |
358 | varslotName; | 352 | varslotName; |
359 | var componentId; | 353 | var componentId; |
360 | 354 | ||
361 | for (slotName in this.slotComponents()) { | 355 | for (slotName in this.slotComponents()) { |
362 | this.slotComponents()[slotName].remove(); | 356 | this.slotComponents()[slotName].remove(); |
363 | delete this.slotComponents()[slotName]; | 357 | delete this.slotComponents()[slotName]; |
364 | } | 358 | } |
365 | 359 | ||
366 | for (componentId in this.components()) { | 360 | for (componentId in this.components()) { |
367 | this.components()[componentId].remove(); | 361 | this.components()[componentId].remove(); |
368 | delete this.components()[componentId]; | 362 | delete this.components()[componentId]; |
369 | } | 363 | } |
370 | 364 | ||
371 | this.clear(); | 365 | this.clear(); |
372 | MochiKit.Signal.disconnectAll(this); | 366 | MochiKit.Signal.disconnectAll(this); |
373 | }, | 367 | }, |
374 | 368 | ||
375 | 'append': function(aNode, aValue) { | 369 | 'append': function(aNode, aValue) { |
376 | return Clipperz.DOM.Helper.append(aNode, aValue); | 370 | return Clipperz.DOM.Helper.append(aNode, aValue); |
377 | }, | 371 | }, |
378 | 372 | ||
379 | 'insertBefore': function (aNode, aValue) { | 373 | 'insertBefore': function (aNode, aValue) { |
380 | return Clipperz.DOM.Helper.insertBefore(aNode, aValue); | 374 | return Clipperz.DOM.Helper.insertBefore(aNode, aValue); |
381 | }, | 375 | }, |
382 | 376 | ||
383 | 'insertAfter': function (aNode, aValue) { | 377 | 'insertAfter': function (aNode, aValue) { |
384 | return Clipperz.DOM.Helper.insertAfter(aNode, aValue); | 378 | return Clipperz.DOM.Helper.insertAfter(aNode, aValue); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js index 1010c9d..1268118 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.Button = function(args) { | 26 | Clipperz.PM.UI.Common.Components.Button = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Common.Components.Button.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Common.Components.Button.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._element = args.element || Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._element = args.element || Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | this._isDefault = args.isDefault|| false; | 33 | this._isDefault = args.isDefault|| false; |
36 | 34 | ||
37 | this.render(); | 35 | this.render(); |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | //============================================================================= | 40 | //============================================================================= |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Button, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'toString': function () { | 46 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Common.Components.Button component"; | 47 | return "Clipperz.PM.UI.Common.Components.Button component"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'text': function () { | 52 | 'text': function () { |
55 | return this._text; | 53 | return this._text; |
56 | }, | 54 | }, |
57 | 55 | ||
58 | 'isDefault': function () { | 56 | 'isDefault': function () { |
59 | return this._isDefault; | 57 | return this._isDefault; |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'renderSelf': function () { | 62 | 'renderSelf': function () { |
65 | /* | 63 | /* |
66 | this.append(this.element(), {tag:'div', id:this.getId('button'), cls:'button_wrapper', children:[ | 64 | this.append(this.element(), {tag:'div', id:this.getId('button'), cls:'button_wrapper', children:[ |
67 | {tag:'div', id:this.getId('bodyWrapper'), cls:'button_bodyWrapper', children:[ | 65 | {tag:'div', id:this.getId('bodyWrapper'), cls:'button_bodyWrapper', children:[ |
68 | {tag:'div', id:this.getId('body'), cls:'button_body', children:[ | 66 | {tag:'div', id:this.getId('body'), cls:'button_body', children:[ |
69 | {tag:'span', html:this.text()} | 67 | {tag:'span', html:this.text()} |
70 | ]}, | 68 | ]}, |
71 | {tag:'div', id:this.getId('footer'), cls:'button_footer'} | 69 | {tag:'div', id:this.getId('footer'), cls:'button_footer'} |
72 | ]} | 70 | ]} |
73 | ]}); | 71 | ]}); |
74 | */ | 72 | */ |
75 | /* | 73 | /* |
76 | this.append(this.element(), {tag:'div', id:this.getId('button'), cls:'button', children:[ | 74 | this.append(this.element(), {tag:'div', id:this.getId('button'), cls:'button', children:[ |
77 | {tag:'span', html:this.text()} | 75 | {tag:'span', html:this.text()} |
78 | ]}); | 76 | ]}); |
79 | */ | 77 | */ |
80 | this.append(this.element(), {tag:'a', id:this.getId('button'), cls:'button', html:this.text()}); | 78 | this.append(this.element(), {tag:'a', id:this.getId('button'), cls:'button', html:this.text()}); |
81 | 79 | ||
82 | if (this.isDefault()) { | 80 | if (this.isDefault()) { |
83 | MochiKit.DOM.addElementClass(this.getId('button'), 'default'); | 81 | MochiKit.DOM.addElementClass(this.getId('button'), 'default'); |
84 | } | 82 | } |
85 | 83 | ||
86 | // MochiKit.Signal.connect(this.getId('button'), 'onmouseenter',this, 'handleOnMouseEnter'); | 84 | // MochiKit.Signal.connect(this.getId('button'), 'onmouseenter',this, 'handleOnMouseEnter'); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js index 7f56c1e..2f82359 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js | |||
@@ -1,61 +1,59 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | 28 | ||
31 | Clipperz.PM.UI.Common.Components.ComponentSlot = function(aComponent, aSlotName) { | 29 | Clipperz.PM.UI.Common.Components.ComponentSlot = function(aComponent, aSlotName) { |
32 | this._component = aComponent; | 30 | this._component = aComponent; |
33 | this._slotName = aSlotName; | 31 | this._slotName = aSlotName; |
34 | 32 | ||
35 | return this; | 33 | return this; |
36 | } | 34 | } |
37 | 35 | ||
38 | //============================================================================= | 36 | //============================================================================= |
39 | 37 | ||
40 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ComponentSlot, Object, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ComponentSlot, Object, { |
41 | 39 | ||
42 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
43 | 41 | ||
44 | 'slotName': function() { | 42 | 'slotName': function() { |
45 | return this._slotName; | 43 | return this._slotName; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | 'component': function() { | 46 | 'component': function() { |
49 | return this._component; | 47 | return this._component; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'setContent': function(aComponent) { | 52 | 'setContent': function(aComponent) { |
55 | this.component().setComponentForSlotNamed(aComponent, this.slotName()); | 53 | this.component().setComponentForSlotNamed(aComponent, this.slotName()); |
56 | }, | 54 | }, |
57 | 55 | ||
58 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
59 | __syntaxFix__: "syntax fix" | 57 | __syntaxFix__: "syntax fix" |
60 | 58 | ||
61 | }); | 59 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js index 2db2489..bf00ffc 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js | |||
@@ -1,88 +1,86 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.FaviconComponent = function(args) { | 26 | Clipperz.PM.UI.Common.Components.FaviconComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Common.Components.FaviconComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Common.Components.FaviconComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this.render(); | 31 | this.render(); |
34 | this.setSrc(args.src); | 32 | this.setSrc(args.src); |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | //============================================================================= | 37 | //============================================================================= |
40 | 38 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
42 | 40 | ||
43 | //------------------------------------------------------------------------- | 41 | //------------------------------------------------------------------------- |
44 | 42 | ||
45 | 'toString': function () { | 43 | 'toString': function () { |
46 | return "Clipperz.PM.UI.Common.Components.FaviconComponent component"; | 44 | return "Clipperz.PM.UI.Common.Components.FaviconComponent component"; |
47 | }, | 45 | }, |
48 | 46 | ||
49 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
50 | 48 | ||
51 | 'src': function () { | 49 | 'src': function () { |
52 | return this.element().src; | 50 | return this.element().src; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | 'setSrc': function (aValue) { | 53 | 'setSrc': function (aValue) { |
56 | this.element().src = (aValue || Clipperz.PM.Strings.getValue('defaultFaviconUrl')); | 54 | this.element().src = (aValue || Clipperz.PM.Strings.getValue('defaultFaviconUrl')); |
57 | }, | 55 | }, |
58 | 56 | ||
59 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
60 | 58 | ||
61 | 'clear': function () {}, | 59 | 'clear': function () {}, |
62 | 60 | ||
63 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
64 | 62 | ||
65 | 'renderSelf': function () { | 63 | 'renderSelf': function () { |
66 | MochiKit.Signal.connect(this.element(), 'onerror',this, 'setDefaultFavicon'); | 64 | MochiKit.Signal.connect(this.element(), 'onerror',this, 'setDefaultFavicon'); |
67 | MochiKit.Signal.connect(this.element(), 'onabort',this, 'setDefaultFavicon'); | 65 | MochiKit.Signal.connect(this.element(), 'onabort',this, 'setDefaultFavicon'); |
68 | MochiKit.Signal.connect(this.element(), 'onload',this, 'handleOnLoad'); | 66 | MochiKit.Signal.connect(this.element(), 'onload',this, 'handleOnLoad'); |
69 | }, | 67 | }, |
70 | 68 | ||
71 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
72 | 70 | ||
73 | 'setDefaultFavicon': function (anEvent) { | 71 | 'setDefaultFavicon': function (anEvent) { |
74 | MochiKit.Signal.disconnectAll(anEvent.src()); | 72 | MochiKit.Signal.disconnectAll(anEvent.src()); |
75 | this.setSrc(null); | 73 | this.setSrc(null); |
76 | }, | 74 | }, |
77 | 75 | ||
78 | 'handleOnLoad': function (anEvent) { | 76 | 'handleOnLoad': function (anEvent) { |
79 | MochiKit.Signal.disconnectAll(anEvent.src()); | 77 | MochiKit.Signal.disconnectAll(anEvent.src()); |
80 | //console.log("HANDLE ON LOAD", anEvent, anEvent.src().src); | 78 | |
81 | if (anEvent.src().complete == false) { | 79 | if (anEvent.src().complete == false) { |
82 | this.setSrc(null); | 80 | this.setSrc(null); |
83 | } | 81 | } |
84 | }, | 82 | }, |
85 | 83 | ||
86 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
87 | __syntaxFix__: "syntax fix" | 85 | __syntaxFix__: "syntax fix" |
88 | }); | 86 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js index 2788b79..020290b 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js | |||
@@ -1,161 +1,155 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar = function(args) { | 26 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | // this._openFromElement = args.openFromElement || null; | 31 | // this._openFromElement = args.openFromElement || null; |
34 | this._onOkCloseToElement = args.onOkCloseToElement || null; | 32 | this._onOkCloseToElement = args.onOkCloseToElement || null; |
35 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; | 33 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; |
36 | 34 | ||
37 | this._canCancelWhileProcessing= ((typeof(args.canCancelWhileProcessing) == 'undefined') ? true : args.canCancelWhileProcessing); | 35 | this._canCancelWhileProcessing= ((typeof(args.canCancelWhileProcessing) == 'undefined') ? true : args.canCancelWhileProcessing); |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | //============================================================================= | 40 | //============================================================================= |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'toString': function () { | 46 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar component"; | 47 | return "Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar component"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | /* | 51 | /* |
54 | 'openFromElement': function () { | 52 | 'openFromElement': function () { |
55 | return this._openFromElement; | 53 | return this._openFromElement; |
56 | }, | 54 | }, |
57 | */ | 55 | */ |
58 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
59 | 57 | ||
60 | 'onOkCloseToElement': function () { | 58 | 'onOkCloseToElement': function () { |
61 | return this._onOkCloseToElement; | 59 | return this._onOkCloseToElement; |
62 | }, | 60 | }, |
63 | 61 | ||
64 | 'setOnOkCloseToElement': function (anElement) { | 62 | 'setOnOkCloseToElement': function (anElement) { |
65 | this._onOkCloseToElement = anElement; | 63 | this._onOkCloseToElement = anElement; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
69 | 67 | ||
70 | 'onCancelCloseToElement': function () { | 68 | 'onCancelCloseToElement': function () { |
71 | return this._onCancelCloseToElement; | 69 | return this._onCancelCloseToElement; |
72 | }, | 70 | }, |
73 | 71 | ||
74 | 'setOnCancelCloseToElement': function (anElement) { | 72 | 'setOnCancelCloseToElement': function (anElement) { |
75 | this._onCancelCloseToElement = anElement; | 73 | this._onCancelCloseToElement = anElement; |
76 | }, | 74 | }, |
77 | 75 | ||
78 | //------------------------------------------------------------------------- | 76 | //------------------------------------------------------------------------- |
79 | 77 | ||
80 | 'canCancelWhileProcessing': function () { | 78 | 'canCancelWhileProcessing': function () { |
81 | return this._canCancelWhileProcessing; | 79 | return this._canCancelWhileProcessing; |
82 | }, | 80 | }, |
83 | 81 | ||
84 | //------------------------------------------------------------------------- | 82 | //------------------------------------------------------------------------- |
85 | 83 | ||
86 | 'deferredShowModal': function (someArgs, aResult) { | 84 | 'deferredShowModal': function (someArgs, aResult) { |
87 | if (someArgs['onOkCloseToElement'] != null) { | 85 | if (someArgs['onOkCloseToElement'] != null) { |
88 | this.setOnOkCloseToElement(someArgs['onOkCloseToElement']); | 86 | this.setOnOkCloseToElement(someArgs['onOkCloseToElement']); |
89 | } | 87 | } |
90 | 88 | ||
91 | if (someArgs['onCancelCloseToElement'] != null) { | 89 | if (someArgs['onCancelCloseToElement'] != null) { |
92 | this.setOnCancelCloseToElement(someArgs['onCancelCloseToElement']); | 90 | this.setOnCancelCloseToElement(someArgs['onCancelCloseToElement']); |
93 | } | 91 | } |
94 | 92 | ||
95 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.deferredShowModal.apply(this, arguments); | 93 | Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBar.superclass.deferredShowModal.apply(this, arguments); |
96 | return this.deferred(); | 94 | return this.deferred(); |
97 | }, | 95 | }, |
98 | 96 | ||
99 | //------------------------------------------------------------------------- | 97 | //------------------------------------------------------------------------- |
100 | 98 | ||
101 | 'showProgressBar': function () { | 99 | 'showProgressBar': function () { |
102 | varprogressBarElement; | 100 | varprogressBarElement; |
103 | 101 | ||
104 | this.getElement('container').innerHTML = ''; | 102 | this.getElement('container').innerHTML = ''; |
105 | 103 | ||
106 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); | 104 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); |
107 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); | 105 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); |
108 | 106 | ||
109 | if (this.canCancelWhileProcessing() == true) { | 107 | if (this.canCancelWhileProcessing() == true) { |
110 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); | 108 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); |
111 | } else { | 109 | } else { |
112 | this.setButtons([]); | 110 | this.setButtons([]); |
113 | } | 111 | } |
114 | }, | 112 | }, |
115 | 113 | ||
116 | //------------------------------------------------------------------------- | 114 | //------------------------------------------------------------------------- |
117 | 115 | ||
118 | 'showFailure': function (someParameters) { | 116 | 'showFailure': function (someParameters) { |
119 | // this.setType('ALERT'); | 117 | // this.setType('ALERT'); |
120 | this.setType(someParameters['type']); | 118 | this.setType(someParameters['type']); |
121 | // this.setTitle("Login failed"); | 119 | // this.setTitle("Login failed"); |
122 | this.setTitle(someParameters['title']); | 120 | this.setTitle(someParameters['title']); |
123 | // this.setText("Wrong passphrase; the unlock has failed."); | 121 | // this.setText("Wrong passphrase; the unlock has failed."); |
124 | this.setText(someParameters['text']); | 122 | this.setText(someParameters['text']); |
125 | // this.getElement('container').innerHTML = ''; | 123 | // this.getElement('container').innerHTML = ''; |
126 | this.getElement('container').innerHTML = ''; | 124 | this.getElement('container').innerHTML = ''; |
127 | // this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); | 125 | // this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); |
128 | this.setButtons(someParameters['buttons']); | 126 | this.setButtons(someParameters['buttons']); |
129 | }, | 127 | }, |
130 | 128 | ||
131 | //------------------------------------------------------------------------- | 129 | //------------------------------------------------------------------------- |
132 | 130 | ||
133 | 'closeOk': function () { | 131 | 'closeOk': function () { |
134 | //console.log("=== closeOk"); | ||
135 | this.showProgressBar(); | 132 | this.showProgressBar(); |
136 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback')); | 133 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback')); |
137 | this._deferred = null; | 134 | this._deferred = null; |
138 | }, | 135 | }, |
139 | 136 | ||
140 | 'closeCancel': function () { | 137 | 'closeCancel': function () { |
141 | //console.log("=== closeCancel"); | ||
142 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); | 138 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); |
143 | this.deferred().cancel(); | 139 | this.deferred().cancel(); |
144 | this._deferred = null; | 140 | this._deferred = null; |
145 | }, | 141 | }, |
146 | 142 | ||
147 | //------------------------------------------------------------------------- | 143 | //------------------------------------------------------------------------- |
148 | 144 | ||
149 | 'deferredDone': function () { | 145 | 'deferredDone': function () { |
150 | //console.log("=== deferredDone"); | ||
151 | return this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); | 146 | return this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); |
152 | }, | 147 | }, |
153 | 148 | ||
154 | 'deferredError': function (someParameters) { | 149 | 'deferredError': function (someParameters) { |
155 | //console.log("=== deferredError"); | ||
156 | this.showFailure(someParameters); | 150 | this.showFailure(someParameters); |
157 | }, | 151 | }, |
158 | 152 | ||
159 | //------------------------------------------------------------------------- | 153 | //------------------------------------------------------------------------- |
160 | __syntaxFix__: "syntax fix" | 154 | __syntaxFix__: "syntax fix" |
161 | }); | 155 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js index 089e3d4..78e8c9b 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js | |||
@@ -1,137 +1,122 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) { | 26 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | //MochiKit.Logging.logDebug(">>> new TextFormField"); | ||
32 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args); | 29 | Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args); |
33 | 30 | ||
34 | this._wrapperElement = null; | 31 | this._wrapperElement = null; |
35 | this._entropyElement = null; | 32 | this._entropyElement = null; |
36 | 33 | ||
37 | this.render(); | 34 | this.render(); |
38 | //MochiKit.Logging.logDebug("<<< new TextFormField"); | ||
39 | 35 | ||
40 | return this; | 36 | return this; |
41 | }; | 37 | }; |
42 | 38 | ||
43 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Clipperz.PM.UI.Common.Components.BaseComponent, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Clipperz.PM.UI.Common.Components.BaseComponent, { |
44 | 40 | ||
45 | 'toString': function() { | 41 | 'toString': function() { |
46 | return "Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay"; | 42 | return "Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay"; |
47 | }, | 43 | }, |
48 | 44 | ||
49 | //----------------------------------------------------- | 45 | //----------------------------------------------------- |
50 | 46 | ||
51 | 'wrapperElement': function() { | 47 | 'wrapperElement': function() { |
52 | return this._wrapperElement; | 48 | return this._wrapperElement; |
53 | }, | 49 | }, |
54 | 50 | ||
55 | 'setWrapperElement': function(aValue) { | 51 | 'setWrapperElement': function(aValue) { |
56 | this._wrapperElement = aValue; | 52 | this._wrapperElement = aValue; |
57 | }, | 53 | }, |
58 | 54 | ||
59 | //----------------------------------------------------- | 55 | //----------------------------------------------------- |
60 | 56 | ||
61 | 'passwordElement': function() { | 57 | 'passwordElement': function() { |
62 | return this.element(); | 58 | return this.element(); |
63 | }, | 59 | }, |
64 | 60 | ||
65 | //----------------------------------------------------- | 61 | //----------------------------------------------------- |
66 | 62 | ||
67 | 'entropyElement': function() { | 63 | 'entropyElement': function() { |
68 | return this._entropyElement; | 64 | return this._entropyElement; |
69 | }, | 65 | }, |
70 | 66 | ||
71 | 'setEntropyElement': function(aValue) { | 67 | 'setEntropyElement': function(aValue) { |
72 | this._entropyElement = aValue; | 68 | this._entropyElement = aValue; |
73 | }, | 69 | }, |
74 | 70 | ||
75 | //----------------------------------------------------- | 71 | //----------------------------------------------------- |
76 | 72 | ||
77 | 'render': function() { | 73 | 'render': function() { |
78 | /* | 74 | /* |
79 | MochiKit.Signal.disconnectAllTo(this); | 75 | MochiKit.Signal.disconnectAllTo(this); |
80 | 76 | ||
81 | this.setWrapperElement(this.element().wrap({tag:'div'})); | 77 | this.setWrapperElement(this.element().wrap({tag:'div'})); |
82 | this.setEntropyElement(Clipperz.DOM.Helper.append(this.wrapperElement().dom, {tag:'div', cls:'passwordEntropy', html:" "}, true)); | 78 | this.setEntropyElement(Clipperz.DOM.Helper.append(this.wrapperElement().dom, {tag:'div', cls:'passwordEntropy', html:" "}, true)); |
83 | // this.setEntropyElement(Clipperz.DOM.Helper.insertBefore(this.element(), {tag:'div', cls:'passwordEntropy', html:" "}, true)); | 79 | // this.setEntropyElement(Clipperz.DOM.Helper.insertBefore(this.element(), {tag:'div', cls:'passwordEntropy', html:" "}, true)); |
84 | this.entropyElement().wrap({tag:'div', cls:'passwordEntropyWrapper'}); | 80 | this.entropyElement().wrap({tag:'div', cls:'passwordEntropyWrapper'}); |
85 | 81 | ||
86 | this.updateEntropyElement(); | 82 | this.updateEntropyElement(); |
87 | 83 | ||
88 | this.connect('onkeyup', 'updateEntropyElement'); | 84 | this.connect('onkeyup', 'updateEntropyElement'); |
89 | this.connect('onchange', 'updateEntropyElement'); | 85 | this.connect('onchange', 'updateEntropyElement'); |
90 | this.connect('onblur', 'updateEntropyElement'); | 86 | this.connect('onblur', 'updateEntropyElement'); |
91 | */ | 87 | */ |
92 | MochiKit.Signal.disconnectAllTo(this); | 88 | MochiKit.Signal.disconnectAllTo(this); |
93 | 89 | ||
94 | this.setEntropyElement(this.element()); | 90 | this.setEntropyElement(this.element()); |
95 | this.entropyElement().addClass("entropyLevelIndicator"); | 91 | this.entropyElement().addClass("entropyLevelIndicator"); |
96 | 92 | ||
97 | this.updateEntropyElement(); | 93 | this.updateEntropyElement(); |
98 | 94 | ||
99 | this.connect('onkeyup', 'updateEntropyElement'); | 95 | this.connect('onkeyup', 'updateEntropyElement'); |
100 | this.connect('onchange', 'updateEntropyElement'); | 96 | this.connect('onchange', 'updateEntropyElement'); |
101 | this.connect('onblur', 'updateEntropyElement'); | 97 | this.connect('onblur', 'updateEntropyElement'); |
102 | }, | 98 | }, |
103 | 99 | ||
104 | //----------------------------------------------------- | 100 | //----------------------------------------------------- |
105 | 101 | ||
106 | 'computeEntropyForString': function(aValue) { | 102 | 'computeEntropyForString': function(aValue) { |
107 | return Clipperz.PM.Crypto.passwordEntropy(aValue); | 103 | return Clipperz.PM.Crypto.passwordEntropy(aValue); |
108 | }, | 104 | }, |
109 | 105 | ||
110 | //----------------------------------------------------- | 106 | //----------------------------------------------------- |
111 | 107 | ||
112 | 'updateEntropyElement': function(anEvent) { | 108 | 'updateEntropyElement': function(anEvent) { |
113 | /* | ||
114 | //MochiKit.Logging.logDebug(">>> PasswordEntropyDisplay.updateEntropyElement"); | ||
115 | varmaxExtent; | ||
116 | varentropy; | ||
117 | |||
118 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); | ||
119 | //MochiKit.Logging.logDebug("--- PasswordEntropyDisplay.updateEntropyElement - entropy: " + entropy); | ||
120 | this.entropyElement().setStyle('background-position', "0px " + -entropy + "px"); | ||
121 | this.entropyElement().setWidth(this.passwordElement().getWidth() * (entropy/128)); | ||
122 | //MochiKit.Logging.logDebug("<<< PasswordEntropyDisplay.updateEntropyElement"); | ||
123 | */ | ||
124 | varentropy; | 109 | varentropy; |
125 | 110 | ||
126 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); | 111 | entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value)); |
127 | 112 | ||
128 | if (entropy == 0) { | 113 | if (entropy == 0) { |
129 | this.entropyElement().setStyle('background-position', "0px 26px"); | 114 | this.entropyElement().setStyle('background-position', "0px 26px"); |
130 | } else { | 115 | } else { |
131 | this.entropyElement().setStyle('background-position', "0px -" + (128-entropy)*26 + "px"); | 116 | this.entropyElement().setStyle('background-position', "0px -" + (128-entropy)*26 + "px"); |
132 | } | 117 | } |
133 | }, | 118 | }, |
134 | 119 | ||
135 | //----------------------------------------------------- | 120 | //----------------------------------------------------- |
136 | __syntaxFix__: '__syntaxFix__' | 121 | __syntaxFix__: '__syntaxFix__' |
137 | }); | 122 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js index 5991530..6638008 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.ProgressBar = function(args) { | 26 | Clipperz.PM.UI.Common.Components.ProgressBar = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Common.Components.ProgressBar.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Common.Components.ProgressBar.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | 32 | ||
35 | this.renderSelf(); | 33 | this.renderSelf(); |
36 | 34 | ||
37 | MochiKit.Signal.connect(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', this, 'updateProgressHandler') | 35 | MochiKit.Signal.connect(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', this, 'updateProgressHandler') |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | //============================================================================= | 40 | //============================================================================= |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ProgressBar, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.ProgressBar, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'toString': function () { | 46 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Common.Components.ProgressBar component"; | 47 | return "Clipperz.PM.UI.Common.Components.ProgressBar component"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'renderSelf': function() { | 52 | 'renderSelf': function() { |
55 | this.append(this.element(), {tag:'div', cls:'loadingBar', children:[ | 53 | this.append(this.element(), {tag:'div', cls:'loadingBar', children:[ |
56 | {tag:'div', cls:'loadingBarProgressBox', children:[ | 54 | {tag:'div', cls:'loadingBarProgressBox', children:[ |
57 | {tag:'div', id:this.getId('loadingBarProgress'), cls:'loadingBarProgress'} | 55 | {tag:'div', id:this.getId('loadingBarProgress'), cls:'loadingBarProgress'} |
58 | ]} | 56 | ]} |
59 | ]}); | 57 | ]}); |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'updateProgressHandler': function (anEvent) { | 62 | 'updateProgressHandler': function (anEvent) { |
65 | MochiKit.Style.setElementDimensions(this.getId('loadingBarProgress'), {w:anEvent}, '%'); | 63 | MochiKit.Style.setElementDimensions(this.getId('loadingBarProgress'), {w:anEvent}, '%'); |
66 | }, | 64 | }, |
67 | 65 | ||
68 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
69 | __syntaxFix__: "syntax fix" | 67 | __syntaxFix__: "syntax fix" |
70 | }); | 68 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js index 1d816a9..8c98811 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel = function(args) { | 26 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Common.Components.SimpleMessagePanel.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._title = args.title || Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._title = args.title || Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | this._type = args.type || Clipperz.Base.exception.raise('MandatoryParameter'); //ALERT, INFO, ERROR | 33 | this._type = args.type || Clipperz.Base.exception.raise('MandatoryParameter'); //ALERT, INFO, ERROR |
36 | this._buttons = args.buttons || Clipperz.Base.exception.raise('MandatoryParameter'); | 34 | this._buttons = args.buttons || Clipperz.Base.exception.raise('MandatoryParameter'); |
37 | 35 | ||
38 | this._buttonComponents = []; | 36 | this._buttonComponents = []; |
39 | this._deferred = null; | 37 | this._deferred = null; |
40 | 38 | ||
41 | this.renderModalMask(); | 39 | this.renderModalMask(); |
42 | 40 | ||
43 | return this; | 41 | return this; |
44 | } | 42 | } |
45 | 43 | ||
46 | //============================================================================= | 44 | //============================================================================= |
47 | 45 | ||
48 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { | 46 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'toString': function () { | 50 | 'toString': function () { |
53 | return "Clipperz.PM.UI.Common.Components.SimpleMessagePanel component"; | 51 | return "Clipperz.PM.UI.Common.Components.SimpleMessagePanel component"; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
57 | 55 | ||
58 | 'deferred': function() { | 56 | 'deferred': function() { |
59 | if (this._deferred == null) { | 57 | if (this._deferred == null) { |
60 | this._deferred = new Clipperz.Async.Deferred("SimpleMessagePanel.deferred", {trace:false}); | 58 | this._deferred = new Clipperz.Async.Deferred("SimpleMessagePanel.deferred", {trace:false}); |
61 | } | 59 | } |
62 | 60 | ||
63 | return this._deferred; | 61 | return this._deferred; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'title': function () { | 66 | 'title': function () { |
69 | return this._title; | 67 | return this._title; |
70 | }, | 68 | }, |
71 | 69 | ||
72 | 'setTitle': function (aValue) { | 70 | 'setTitle': function (aValue) { |
73 | this._title = aValue; | 71 | this._title = aValue; |
74 | 72 | ||
75 | if (this.getElement('title') != null) { | 73 | if (this.getElement('title') != null) { |
76 | this.getElement('title').innerHTML = aValue; | 74 | this.getElement('title').innerHTML = aValue; |
77 | } | 75 | } |
78 | }, | 76 | }, |
79 | 77 | ||
80 | //------------------------------------------------------------------------- | 78 | //------------------------------------------------------------------------- |
81 | 79 | ||
82 | 'text': function () { | 80 | 'text': function () { |
83 | return this._text; | 81 | return this._text; |
84 | }, | 82 | }, |
85 | 83 | ||
86 | 'setText': function (aValue) { | 84 | 'setText': function (aValue) { |
@@ -157,141 +155,133 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe | |||
157 | {tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]} | 155 | {tag:'div', id:this.getId('buttonArea'), cls:'buttonArea', children:[]} |
158 | ]} | 156 | ]} |
159 | // {tag:'div', cls:'footer', children:[]} | 157 | // {tag:'div', cls:'footer', children:[]} |
160 | ]}); | 158 | ]}); |
161 | 159 | ||
162 | Clipperz.PM.UI.Canvas.marks[this.icon()](this.getElement('icon'), "#ffffff"); | 160 | Clipperz.PM.UI.Canvas.marks[this.icon()](this.getElement('icon'), "#ffffff"); |
163 | 161 | ||
164 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler'); | 162 | MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'keyDownHandler'); |
165 | 163 | ||
166 | this.renderButtons(); | 164 | this.renderButtons(); |
167 | }, | 165 | }, |
168 | 166 | ||
169 | //------------------------------------------------------------------------- | 167 | //------------------------------------------------------------------------- |
170 | 168 | ||
171 | 'renderButtons': function () { | 169 | 'renderButtons': function () { |
172 | this.getElement('buttonArea').innerHTML = ''; | 170 | this.getElement('buttonArea').innerHTML = ''; |
173 | 171 | ||
174 | MochiKit.Base.map(MochiKit.Base.bind(function (aButton) { | 172 | MochiKit.Base.map(MochiKit.Base.bind(function (aButton) { |
175 | var buttonElement; | 173 | var buttonElement; |
176 | var buttonComponent; | 174 | var buttonComponent; |
177 | 175 | ||
178 | // element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[ | 176 | // element = this.append(this.getElement('buttonArea'), {tag:'div', cls:'button' + (aButton['isDefault'] === true ? ' default' : ''), children:[ |
179 | // {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']} | 177 | // {tag:'a', href:'#'/*, id:this.getId('buttonLink')*/, html:aButton['text']} |
180 | // ]}); | 178 | // ]}); |
181 | 179 | ||
182 | buttonElement = this.append(this.getElement('buttonArea'), {tag:'div'}); | 180 | buttonElement = this.append(this.getElement('buttonArea'), {tag:'div'}); |
183 | buttonComponent = new Clipperz.PM.UI.Common.Components.Button({'element':buttonElement, 'text':aButton['text'], 'isDefault':aButton['isDefault']}); | 181 | buttonComponent = new Clipperz.PM.UI.Common.Components.Button({'element':buttonElement, 'text':aButton['text'], 'isDefault':aButton['isDefault']}); |
184 | this.buttonComponents().push(buttonComponent); | 182 | this.buttonComponents().push(buttonComponent); |
185 | 183 | ||
186 | MochiKit.Signal.connect(buttonComponent, 'onclick', MochiKit.Base.method(this, 'buttonEventHandler', aButton)); | 184 | MochiKit.Signal.connect(buttonComponent, 'onclick', MochiKit.Base.method(this, 'buttonEventHandler', aButton)); |
187 | }, this), MochiKit.Iter.reversed(this.buttons())); | 185 | }, this), MochiKit.Iter.reversed(this.buttons())); |
188 | }, | 186 | }, |
189 | 187 | ||
190 | //------------------------------------------------------------------------- | 188 | //------------------------------------------------------------------------- |
191 | 189 | ||
192 | 'displayElement': function() { | 190 | 'displayElement': function() { |
193 | return this.getElement('panel'); | 191 | return this.getElement('panel'); |
194 | }, | 192 | }, |
195 | 193 | ||
196 | //------------------------------------------------------------------------- | 194 | //------------------------------------------------------------------------- |
197 | 195 | ||
198 | 'closeOk': function () { | 196 | 'closeOk': function () { |
199 | this.deferred().callback(); | 197 | this.deferred().callback(); |
200 | this._deferred = null; | 198 | this._deferred = null; |
201 | }, | 199 | }, |
202 | 200 | ||
203 | 'closeCancel': function () { | 201 | 'closeCancel': function () { |
204 | this.deferred().cancel(); | 202 | this.deferred().cancel(); |
205 | this._deferred = null; | 203 | this._deferred = null; |
206 | }, | 204 | }, |
207 | 205 | ||
208 | 'closeError': function () { | 206 | 'closeError': function () { |
209 | this.deferred().errback(); | 207 | this.deferred().errback(); |
210 | this._deferred = null; | 208 | this._deferred = null; |
211 | }, | 209 | }, |
212 | 210 | ||
213 | //------------------------------------------------------------------------- | 211 | //------------------------------------------------------------------------- |
214 | 212 | ||
215 | 'buttonEventHandler': function(aButton, anEvent) { | 213 | 'buttonEventHandler': function(aButton, anEvent) { |
216 | anEvent.preventDefault(); | 214 | anEvent.preventDefault(); |
217 | 215 | ||
218 | // MochiKit.Signal.signal(this, 'cancelEvent'); | 216 | // MochiKit.Signal.signal(this, 'cancelEvent'); |
219 | switch (aButton['result']) { | 217 | switch (aButton['result']) { |
220 | case 'OK': | 218 | case 'OK': |
221 | //console.log("==> OK"); | ||
222 | this.closeOk(); | 219 | this.closeOk(); |
223 | break; | 220 | break; |
224 | case 'CANCEL': | 221 | case 'CANCEL': |
225 | //console.log("==> CANCEL"); | ||
226 | this.closeCancel(); | 222 | this.closeCancel(); |
227 | break; | 223 | break; |
228 | default: | 224 | default: |
229 | //console.log("==> ????"); | ||
230 | this.closeError(); | 225 | this.closeError(); |
231 | break; | 226 | break; |
232 | } | 227 | } |
233 | //console.log("<=="); | ||
234 | }, | 228 | }, |
235 | 229 | ||
236 | //------------------------------------------------------------------------- | 230 | //------------------------------------------------------------------------- |
237 | 231 | ||
238 | 'deferredShow': function (someArgs, aResult) { | 232 | 'deferredShow': function (someArgs, aResult) { |
239 | this.deferredShowModal(someArgs); | 233 | this.deferredShowModal(someArgs); |
240 | 234 | ||
241 | this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); | 235 | this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); |
242 | this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); | 236 | this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); |
243 | this.deferred().addCallback(MochiKit.Async.succeed, aResult); | 237 | this.deferred().addCallback(MochiKit.Async.succeed, aResult); |
244 | 238 | ||
245 | return this.deferred(); | 239 | return this.deferred(); |
246 | }, | 240 | }, |
247 | 241 | ||
248 | //------------------------------------------------------------------------- | 242 | //------------------------------------------------------------------------- |
249 | 243 | ||
250 | 'modalDialogMask': function () { | 244 | 'modalDialogMask': function () { |
251 | return this.getId('modalDialogMask'); | 245 | return this.getId('modalDialogMask'); |
252 | }, | 246 | }, |
253 | 247 | ||
254 | 'modalDialog': function () { | 248 | 'modalDialog': function () { |
255 | return this.getId('modalDialog'); | 249 | return this.getId('modalDialog'); |
256 | }, | 250 | }, |
257 | 251 | ||
258 | 'modalDialogFrame': function() { | 252 | 'modalDialogFrame': function() { |
259 | return this.getId('modalDialogFrame'); | 253 | return this.getId('modalDialogFrame'); |
260 | }, | 254 | }, |
261 | 255 | ||
262 | //------------------------------------------------------------------------- | 256 | //------------------------------------------------------------------------- |
263 | 257 | ||
264 | 'renderModalMask': function () { | 258 | 'renderModalMask': function () { |
265 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, | 259 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, |
266 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper simpleMessagePanelMask', children:[ | 260 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper simpleMessagePanelMask', children:[ |
267 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask simpleMessagePanelMask'}, | 261 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask simpleMessagePanelMask'}, |
268 | {tag:'div', id:this.getId('modalDialogFrame'), cls:'modalDialogFrame simpleMessagePanelMask'}, | 262 | {tag:'div', id:this.getId('modalDialogFrame'), cls:'modalDialogFrame simpleMessagePanelMask'}, |
269 | {tag:'div', id:this.getId('modalDialog'), cls:'modalDialog simpleMessagePanelMask'} | 263 | {tag:'div', id:this.getId('modalDialog'), cls:'modalDialog simpleMessagePanelMask'} |
270 | ]} | 264 | ]} |
271 | ); | 265 | ); |
272 | 266 | ||
273 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); | 267 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); |
274 | MochiKit.Style.hideElement(this.getId('modalDialogFrame')); | 268 | MochiKit.Style.hideElement(this.getId('modalDialogFrame')); |
275 | }, | 269 | }, |
276 | 270 | ||
277 | //------------------------------------------------------------------------- | 271 | //------------------------------------------------------------------------- |
278 | 272 | ||
279 | 'keyDownHandler': function (anEvent) { | 273 | 'keyDownHandler': function (anEvent) { |
280 | if (anEvent.key().string == 'KEY_ENTER') { | 274 | if (anEvent.key().string == 'KEY_ENTER') { |
281 | anEvent.preventDefault(); | 275 | anEvent.preventDefault(); |
282 | //console.log("13 - RETURN ?", this); | ||
283 | this.closeOk(); | 276 | this.closeOk(); |
284 | //console.log('<<< 13') | ||
285 | } | 277 | } |
286 | 278 | ||
287 | if (anEvent.key().string == 'KEY_ESCAPE') { | 279 | if (anEvent.key().string == 'KEY_ESCAPE') { |
288 | anEvent.preventDefault(); | 280 | anEvent.preventDefault(); |
289 | //console.log("27 - ESC ?", this); | ||
290 | this.closeCancel(); | 281 | this.closeCancel(); |
291 | //console.log("<<< 27"); | ||
292 | } | 282 | } |
293 | }, | 283 | }, |
294 | 284 | ||
295 | //------------------------------------------------------------------------- | 285 | //------------------------------------------------------------------------- |
296 | __syntaxFix__: "syntax fix" | 286 | __syntaxFix__: "syntax fix" |
297 | }); | 287 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js index 936514a..1e2a690 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js | |||
@@ -1,66 +1,64 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.TabPanelComponent = function(args) { | 26 | Clipperz.PM.UI.Common.Components.TabPanelComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | Clipperz.PM.UI.Common.Components.TabPanelComponent.superclass.constructor.call(this, args); | 28 | Clipperz.PM.UI.Common.Components.TabPanelComponent.superclass.constructor.call(this, args); |
31 | 29 | ||
32 | this._tabPanelController = null; | 30 | this._tabPanelController = null; |
33 | 31 | ||
34 | return this; | 32 | return this; |
35 | } | 33 | } |
36 | 34 | ||
37 | //============================================================================= | 35 | //============================================================================= |
38 | 36 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TabPanelComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 37 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TabPanelComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
40 | 38 | ||
41 | 'toString': function () { | 39 | 'toString': function () { |
42 | return "Clipperz.PM.UI.Common.Components.TabPanelComponent component"; | 40 | return "Clipperz.PM.UI.Common.Components.TabPanelComponent component"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
46 | 44 | ||
47 | 'tabPanelControllerConfiguration': function() { | 45 | 'tabPanelControllerConfiguration': function() { |
48 | return this._tabPanelControllerConfiguration; | 46 | return this._tabPanelControllerConfiguration; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | 'tabPanelController': function() { | 49 | 'tabPanelController': function() { |
52 | if (this._tabPanelController == null) { | 50 | if (this._tabPanelController == null) { |
53 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({component:this, configuration:this.tabPanelControllerConfiguration()}); | 51 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({component:this, configuration:this.tabPanelControllerConfiguration()}); |
54 | } | 52 | } |
55 | 53 | ||
56 | return this._tabPanelController; | 54 | return this._tabPanelController; |
57 | }, | 55 | }, |
58 | 56 | ||
59 | 'initiallySelectedTab': function() { | 57 | 'initiallySelectedTab': function() { |
60 | return this._initiallySelectedTab; | 58 | return this._initiallySelectedTab; |
61 | }, | 59 | }, |
62 | 60 | ||
63 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
64 | __syntaxFix__: "syntax fix" | 62 | __syntaxFix__: "syntax fix" |
65 | 63 | ||
66 | }); | 64 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js index 8df7e0e..6517d2a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js | |||
@@ -1,214 +1,205 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.Tooltip = function(args) { | 26 | Clipperz.PM.UI.Common.Components.Tooltip = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Common.Components.Tooltip.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Common.Components.Tooltip.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | this._position = args.position || 'BELOW'; //'BELOW', 'ABOVE', 'LEFT', 'RIGHT' | 33 | this._position = args.position || 'BELOW'; //'BELOW', 'ABOVE', 'LEFT', 'RIGHT' |
36 | 34 | ||
37 | this._boxDimensions = null; | 35 | this._boxDimensions = null; |
38 | this._enabled = (typeof(args.enabled) == 'undefined' ? true : args.enabled); | 36 | this._enabled = (typeof(args.enabled) == 'undefined' ? true : args.enabled); |
39 | this._isVisible = false; | 37 | this._isVisible = false; |
40 | 38 | ||
41 | this.renderSelf(); | 39 | this.renderSelf(); |
42 | 40 | ||
43 | return this; | 41 | return this; |
44 | } | 42 | } |
45 | 43 | ||
46 | //============================================================================= | 44 | //============================================================================= |
47 | 45 | ||
48 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { | 46 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'toString': function () { | 50 | 'toString': function () { |
53 | return "Clipperz.PM.UI.Common.Components.Tooltip component"; | 51 | return "Clipperz.PM.UI.Common.Components.Tooltip component"; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
57 | 55 | ||
58 | 'text': function () { | 56 | 'text': function () { |
59 | return this._text; | 57 | return this._text; |
60 | }, | 58 | }, |
61 | 59 | ||
62 | 'setText': function (aValue) { | 60 | 'setText': function (aValue) { |
63 | this._text = aValue; | 61 | this._text = aValue; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'position': function () { | 66 | 'position': function () { |
69 | return this._position; | 67 | return this._position; |
70 | }, | 68 | }, |
71 | 69 | ||
72 | 'setPosition': function (aValue) { | 70 | 'setPosition': function (aValue) { |
73 | this._position = aValue; | 71 | this._position = aValue; |
74 | }, | 72 | }, |
75 | 73 | ||
76 | //------------------------------------------------------------------------- | 74 | //------------------------------------------------------------------------- |
77 | 75 | ||
78 | 'enabled': function () { | 76 | 'enabled': function () { |
79 | return this._enabled; | 77 | return this._enabled; |
80 | }, | 78 | }, |
81 | 79 | ||
82 | 'setIsEnabled': function (aValue) { | 80 | 'setIsEnabled': function (aValue) { |
83 | this._enabled = aValue; | 81 | this._enabled = aValue; |
84 | }, | 82 | }, |
85 | 83 | ||
86 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
87 | 85 | ||
88 | 'isVisible': function () { | 86 | 'isVisible': function () { |
89 | return this._isVisible; | 87 | return this._isVisible; |
90 | }, | 88 | }, |
91 | 89 | ||
92 | 'setIsVisible': function (aValue) { | 90 | 'setIsVisible': function (aValue) { |
93 | this._isVisible = aValue; | 91 | this._isVisible = aValue; |
94 | }, | 92 | }, |
95 | 93 | ||
96 | //------------------------------------------------------------------------- | 94 | //------------------------------------------------------------------------- |
97 | 95 | ||
98 | 'renderSelf': function() { | 96 | 'renderSelf': function() { |
99 | // this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 97 | // this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
100 | // this.append(MochiKit.DOM.currentDocument().body, {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 98 | // this.append(MochiKit.DOM.currentDocument().body, {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
101 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 99 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
102 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ | 100 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ |
103 | {tag:'div', cls:'tooltip_text', children:[ | 101 | {tag:'div', cls:'tooltip_text', children:[ |
104 | {tag:'span', html:this.text()} | 102 | {tag:'span', html:this.text()} |
105 | ]}//, | 103 | ]}//, |
106 | // {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} | 104 | // {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} |
107 | ]}, | 105 | ]}, |
108 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} | 106 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} |
109 | ]}); | 107 | ]}); |
110 | 108 | ||
111 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | 109 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); |
112 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | 110 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; |
113 | 111 | ||
114 | MochiKit.Style.hideElement(this.displayElement()); | 112 | MochiKit.Style.hideElement(this.displayElement()); |
115 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 113 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
116 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 114 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
117 | }, | 115 | }, |
118 | 116 | ||
119 | //----------------------------------------------------- | 117 | //----------------------------------------------------- |
120 | 118 | ||
121 | 'displayElement': function() { | 119 | 'displayElement': function() { |
122 | return this.getElement('tooltip'); | 120 | return this.getElement('tooltip'); |
123 | }, | 121 | }, |
124 | 122 | ||
125 | //------------------------------------------------------------------------- | 123 | //------------------------------------------------------------------------- |
126 | 124 | ||
127 | 'boxDimensions': function () { | 125 | 'boxDimensions': function () { |
128 | return this._boxDimensions; | 126 | return this._boxDimensions; |
129 | }, | 127 | }, |
130 | 128 | ||
131 | //------------------------------------------------------------------------- | 129 | //------------------------------------------------------------------------- |
132 | 130 | ||
133 | 'show': function () { | 131 | 'show': function () { |
134 | var elementSizeAndPosition; | 132 | var elementSizeAndPosition; |
135 | var arrowPosition; | 133 | var arrowPosition; |
136 | var bodyPosition; | 134 | var bodyPosition; |
137 | 135 | ||
138 | if (this.isVisible() == false) { | 136 | if (this.isVisible() == false) { |
139 | arrowPosition = {}; | 137 | arrowPosition = {}; |
140 | bodyPosition = {}; | 138 | bodyPosition = {}; |
141 | 139 | ||
142 | this.setIsVisible(true); | 140 | this.setIsVisible(true); |
143 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); | 141 | elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element()); |
144 | //console.log("ELEMENT SIZE AND POSITION", Clipperz.Base.serializeJSON(elementSizeAndPosition)); | ||
145 | //console.log("BOX DIMENSIONS", Clipperz.Base.serializeJSON(this.boxDimensions())); | ||
146 | switch (this.position()) { | 142 | switch (this.position()) { |
147 | case 'ABOVE': | 143 | case 'ABOVE': |
148 | //console.log("ABOVE"); | ||
149 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | 144 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); |
150 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | 145 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); |
151 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; | 146 | bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13; |
152 | 147 | ||
153 | // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | 148 | // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); |
154 | // arrowPosition.y = elementSizeAndPosition.position.y - 13; | 149 | // arrowPosition.y = elementSizeAndPosition.position.y - 13; |
155 | break; | 150 | break; |
156 | case 'BELOW': | 151 | case 'BELOW': |
157 | //console.log("BELOW"); | ||
158 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); | 152 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px'); |
159 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); | 153 | bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2); |
160 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; | 154 | bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13; |
161 | 155 | ||
162 | // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); | 156 | // arrowPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - 36/2); |
163 | // arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; | 157 | // arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h; |
164 | break; | 158 | break; |
165 | case 'LEFT': | 159 | case 'LEFT': |
166 | //console.log("LEFT"); | ||
167 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | 160 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); |
168 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; | 161 | bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13; |
169 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | 162 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); |
170 | 163 | ||
171 | // arrowPosition.x = elementSizeAndPosition.position.x -13; | 164 | // arrowPosition.x = elementSizeAndPosition.position.x -13; |
172 | // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | 165 | // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); |
173 | break; | 166 | break; |
174 | case 'RIGHT': | 167 | case 'RIGHT': |
175 | //console.log("RIGHT"); | ||
176 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); | 168 | // MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px'); |
177 | bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13; | 169 | bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13; |
178 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); | 170 | bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2); |
179 | 171 | ||
180 | // arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; | 172 | // arrowPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w; |
181 | // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); | 173 | // arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2); |
182 | break; | 174 | break; |
183 | } | 175 | } |
184 | //console.log("X: " + bodyPosition.x + ", Y: " + bodyPosition.y); | ||
185 | 176 | ||
186 | MochiKit.Style.setElementPosition(this.getId('tooltip'), bodyPosition); | 177 | MochiKit.Style.setElementPosition(this.getId('tooltip'), bodyPosition); |
187 | // MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); | 178 | // MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition); |
188 | // MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); | 179 | // MochiKit.Style.setElementPosition(this.getId('arrow'), arrowPosition); |
189 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); | 180 | MochiKit.Visual.appear(this.displayElement(), {duration:0.4}); |
190 | } | 181 | } |
191 | }, | 182 | }, |
192 | 183 | ||
193 | 'hide': function () { | 184 | 'hide': function () { |
194 | if (this.isVisible() == true) { | 185 | if (this.isVisible() == true) { |
195 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); | 186 | MochiKit.Visual.fade(this.displayElement(), {duration:0.4}); |
196 | this.setIsVisible(false); | 187 | this.setIsVisible(false); |
197 | } | 188 | } |
198 | }, | 189 | }, |
199 | 190 | ||
200 | //------------------------------------------------------------------------- | 191 | //------------------------------------------------------------------------- |
201 | /* | 192 | /* |
202 | 'shouldRemoveElementWhenClearningUp': function () { | 193 | 'shouldRemoveElementWhenClearningUp': function () { |
203 | return false; | 194 | return false; |
204 | }, | 195 | }, |
205 | */ | 196 | */ |
206 | //------------------------------------------------------------------------- | 197 | //------------------------------------------------------------------------- |
207 | __syntaxFix__: "syntax fix" | 198 | __syntaxFix__: "syntax fix" |
208 | }); | 199 | }); |
209 | 200 | ||
210 | Clipperz.PM.UI.Common.Components.Tooltip.initTooltips = function () { | 201 | Clipperz.PM.UI.Common.Components.Tooltip.initTooltips = function () { |
211 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'}); | 202 | Clipperz.DOM.Helper.insertBefore(MochiKit.DOM.currentDocument().body.childNodes[0], {tag:'div', id:'Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'}); |
212 | } | 203 | } |
213 | 204 | ||
214 | MochiKit.DOM.addLoadEvent(Clipperz.PM.UI.Common.Components.Tooltip.initTooltips); | 205 | 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 index c41fc7c..ba58edd 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Components.TranslatorWidget = function(args) { | 26 | Clipperz.PM.UI.Common.Components.TranslatorWidget = function(args) { |
29 | Clipperz.log(">>> TranslatorWidget.new"); | 27 | Clipperz.log(">>> TranslatorWidget.new"); |
30 | args = args || {}; | 28 | args = args || {}; |
31 | 29 | ||
32 | Clipperz.PM.UI.Common.Components.TranslatorWidget.superclass.constructor.apply(this, arguments); | 30 | Clipperz.PM.UI.Common.Components.TranslatorWidget.superclass.constructor.apply(this, arguments); |
33 | 31 | ||
34 | // this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | // this._element = args.element|| Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | // this._stringID = args.stringID || MochiKit.DOM.getNodeAttribute(this.element(), 'stringID')|| Clipperz.Base.exception.raise('MandatoryParameter'); | 33 | // this._stringID = args.stringID || MochiKit.DOM.getNodeAttribute(this.element(), 'stringID')|| Clipperz.Base.exception.raise('MandatoryParameter'); |
36 | 34 | ||
37 | //MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 35 | //MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
38 | //MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 36 | //MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
39 | 37 | ||
40 | Clipperz.log("<<< TranslatorWidget.new"); | 38 | Clipperz.log("<<< TranslatorWidget.new"); |
41 | return this; | 39 | return this; |
42 | } | 40 | } |
43 | 41 | ||
44 | //============================================================================= | 42 | //============================================================================= |
45 | 43 | ||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TranslatorWidget, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.TranslatorWidget, Clipperz.PM.UI.Common.Components.BaseComponent, { |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'toString': function () { | 48 | 'toString': function () { |
51 | return "Clipperz.PM.UI.Common.Components.TranslatorWidget component"; | 49 | return "Clipperz.PM.UI.Common.Components.TranslatorWidget component"; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
55 | /* | 53 | /* |
56 | 'renderSelf': function() { | 54 | 'renderSelf': function() { |
57 | this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ | 55 | this.append(this.element(), {tag:'div', id:this.getId('tooltip'), cls:'tooltip ' + this.position(), children:[ |
58 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ | 56 | {tag:'div', id:this.getId('body'), cls:'tooltip_body', children:[ |
59 | {tag:'div', cls:'tooltip_text', children:[ | 57 | {tag:'div', cls:'tooltip_text', children:[ |
60 | {tag:'span', html:this.text()} | 58 | {tag:'span', html:this.text()} |
61 | ]}, | 59 | ]}, |
62 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} | 60 | {tag:'div', id:this.getId('footer'), cls:'tooltip_footer'} |
63 | ]}, | 61 | ]}, |
64 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} | 62 | {tag:'div', id:this.getId('arrow'), cls:'tooltip_arrow'} |
65 | ]}); | 63 | ]}); |
66 | 64 | ||
67 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); | 65 | this._boxDimensions = MochiKit.Style.getElementDimensions(this.getId('body')); |
68 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; | 66 | // this._boxDimensions.h += MochiKit.Style.getElementDimensions(this.getId('footer')).h; |
69 | 67 | ||
70 | MochiKit.Style.hideElement(this.displayElement()); | 68 | MochiKit.Style.hideElement(this.displayElement()); |
71 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); | 69 | MochiKit.Signal.connect(this.element(), 'onmouseenter', this, 'show'); |
72 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); | 70 | MochiKit.Signal.connect(this.element(), 'onmouseleave', this, 'hide'); |
73 | }, | 71 | }, |
74 | */ | 72 | */ |
75 | //----------------------------------------------------- | 73 | //----------------------------------------------------- |
76 | /* | 74 | /* |
77 | 'displayElement': function() { | 75 | 'displayElement': function() { |
78 | return this.getElement('tooltip'); | 76 | return this.getElement('tooltip'); |
79 | }, | 77 | }, |
80 | */ | 78 | */ |
81 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
82 | /* | 80 | /* |
83 | 'boxDimensions': function () { | 81 | 'boxDimensions': function () { |
84 | return this._boxDimensions; | 82 | return this._boxDimensions; |
85 | }, | 83 | }, |
86 | */ | 84 | */ |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js index 5fd10f9..77d59a5 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner = function(args) { | 26 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner = function(args) { |
29 | this._directLogin = args['directLogin'] || Clipperz.Base.exception.raise('MandatoryParameter'); | 27 | this._directLogin = args['directLogin'] || Clipperz.Base.exception.raise('MandatoryParameter'); |
30 | this._target = Clipperz.PM.Crypto.randomKey(); | 28 | this._target = Clipperz.PM.Crypto.randomKey(); |
31 | 29 | ||
32 | return this; | 30 | return this; |
33 | } | 31 | } |
34 | 32 | ||
35 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototype, { | 33 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototype, { |
36 | 34 | ||
37 | 'toString': function() { | 35 | 'toString': function() { |
38 | return "Clipperz.PM.UI.Common.Controllers.DirectLoginRunner"; | 36 | return "Clipperz.PM.UI.Common.Controllers.DirectLoginRunner"; |
39 | }, | 37 | }, |
40 | 38 | ||
41 | //----------------------------------------------------------------------------- | 39 | //----------------------------------------------------------------------------- |
42 | 40 | ||
43 | 'directLogin': function () { | 41 | 'directLogin': function () { |
44 | return this._directLogin; | 42 | return this._directLogin; |
45 | }, | 43 | }, |
46 | 44 | ||
47 | //----------------------------------------------------------------------------- | 45 | //----------------------------------------------------------------------------- |
48 | 46 | ||
49 | 'target': function () { | 47 | 'target': function () { |
50 | return this._target; | 48 | return this._target; |
51 | }, | 49 | }, |
52 | 50 | ||
53 | //============================================================================= | 51 | //============================================================================= |
54 | 52 | ||
55 | 'setWindowTitle': function (aWindow, aTitle) { | 53 | 'setWindowTitle': function (aWindow, aTitle) { |
56 | aWindow.document.title = aTitle; | 54 | aWindow.document.title = aTitle; |
57 | }, | 55 | }, |
58 | 56 | ||
59 | 'setWindowBody': function (aWindow, anHTML) { | 57 | 'setWindowBody': function (aWindow, anHTML) { |
60 | aWindow.document.body.innerHTML = anHTML; | 58 | aWindow.document.body.innerHTML = anHTML; |
61 | }, | 59 | }, |
62 | 60 | ||
63 | //============================================================================= | 61 | //============================================================================= |
64 | 62 | ||
65 | 'initialWindowSetup': function (aWindow) { | 63 | 'initialWindowSetup': function (aWindow) { |
66 | this.setWindowTitle(aWindow, "Loading Clipperz Direct Login"); | 64 | this.setWindowTitle(aWindow, "Loading Clipperz Direct Login"); |
67 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3("Loading Clipperz Direct Login ..."))); | 65 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3("Loading Clipperz Direct Login ..."))); |
68 | }, | 66 | }, |
69 | 67 | ||
70 | //----------------------------------------------------------------------------- | 68 | //----------------------------------------------------------------------------- |
71 | 69 | ||
72 | 'updateWindowWithDirectLoginLabel': function (aWindow, aLabel) { | 70 | 'updateWindowWithDirectLoginLabel': function (aWindow, aLabel) { |
73 | var titleText; | 71 | var titleText; |
74 | var bodyText; | 72 | var bodyText; |
75 | 73 | ||
76 | titleText = "Loading '__label__' Direct Login".replace(/__label__/, aLabel) | 74 | titleText = "Loading '__label__' Direct Login".replace(/__label__/, aLabel) |
77 | bodyText = "Loading '__label__' Direct Login... ".replace(/__label__/, aLabel) | 75 | bodyText = "Loading '__label__' Direct Login... ".replace(/__label__/, aLabel) |
78 | 76 | ||
79 | this.setWindowTitle(aWindow, titleText); | 77 | this.setWindowTitle(aWindow, titleText); |
80 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3(bodyText))); | 78 | this.setWindowBody (aWindow, MochiKit.DOM.toHTML(MochiKit.DOM.H3(bodyText))); |
81 | }, | 79 | }, |
82 | 80 | ||
83 | //----------------------------------------------------------------------------- | 81 | //----------------------------------------------------------------------------- |
84 | 82 | ||
85 | 'updateWindowWithHTMLContent': function (aWindow, anHtml) { | 83 | 'updateWindowWithHTMLContent': function (aWindow, anHtml) { |
86 | this.setWindowBody(aWindow, anHtml); | 84 | this.setWindowBody(aWindow, anHtml); |
@@ -93,172 +91,166 @@ MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototy | |||
93 | var formElement; | 91 | var formElement; |
94 | var submitButtons; | 92 | var submitButtons; |
95 | 93 | ||
96 | formElement = MochiKit.DOM.getElement('directLoginForm'); | 94 | formElement = MochiKit.DOM.getElement('directLoginForm'); |
97 | 95 | ||
98 | submitButtons = MochiKit.Base.filter(function(anInputElement) { | 96 | submitButtons = MochiKit.Base.filter(function(anInputElement) { |
99 | return ((anInputElement.tagName.toLowerCase() == 'input') && (anInputElement.getAttribute('type').toLowerCase() == 'submit')); | 97 | return ((anInputElement.tagName.toLowerCase() == 'input') && (anInputElement.getAttribute('type').toLowerCase() == 'submit')); |
100 | }, formElement.elements); | 98 | }, formElement.elements); |
101 | 99 | ||
102 | if (submitButtons.length == 0) { | 100 | if (submitButtons.length == 0) { |
103 | if (typeof(formElement.submit) == 'function') { | 101 | if (typeof(formElement.submit) == 'function') { |
104 | formElement.submit(); | 102 | formElement.submit(); |
105 | } else { | 103 | } else { |
106 | aSubmitFunction.apply(formElement); | 104 | aSubmitFunction.apply(formElement); |
107 | } | 105 | } |
108 | /* | 106 | /* |
109 | varformSubmitFunction; | 107 | varformSubmitFunction; |
110 | 108 | ||
111 | formSubmitFunction = MochiKit.Base.method(formElement, 'submit'); | 109 | formSubmitFunction = MochiKit.Base.method(formElement, 'submit'); |
112 | if (Clipperz_IEisBroken == true) { | 110 | if (Clipperz_IEisBroken == true) { |
113 | formElement.submit(); | 111 | formElement.submit(); |
114 | } else { | 112 | } else { |
115 | formSubmitFunction(); | 113 | formSubmitFunction(); |
116 | } | 114 | } |
117 | */ | 115 | */ |
118 | } else { | 116 | } else { |
119 | submitButtons[0].click(); | 117 | submitButtons[0].click(); |
120 | } | 118 | } |
121 | }, this)); | 119 | }, this)); |
122 | }, | 120 | }, |
123 | 121 | ||
124 | //------------------------------------------------------------------------- | 122 | //------------------------------------------------------------------------- |
125 | 123 | ||
126 | 'runSubmitFormDirectLogin': function (aWindow, someAttributes) { | 124 | 'runSubmitFormDirectLogin': function (aWindow, someAttributes) { |
127 | var html; | 125 | var html; |
128 | var formElement; | 126 | var formElement; |
129 | var submitFunction; | 127 | var submitFunction; |
130 | 128 | ||
131 | formElement = MochiKit.DOM.FORM({ | 129 | formElement = MochiKit.DOM.FORM({ |
132 | 'id':'directLoginForm', | 130 | 'id':'directLoginForm', |
133 | 'method':someAttributes['formAttributes']['method'], | 131 | 'method':someAttributes['formAttributes']['method'], |
134 | 'action':someAttributes['formAttributes']['action'] | 132 | 'action':someAttributes['formAttributes']['action'] |
135 | }); | 133 | }); |
136 | 134 | ||
137 | submitFunction = formElement.submit; | 135 | submitFunction = formElement.submit; |
138 | 136 | ||
139 | MochiKit.DOM.appendChildNodes(formElement, MochiKit.Base.map(function (anInputAttributes) { | 137 | MochiKit.DOM.appendChildNodes(formElement, MochiKit.Base.map(function (anInputAttributes) { |
140 | return MochiKit.DOM.INPUT({'type':'hidden', 'name':anInputAttributes[0], 'value':anInputAttributes[1]}); | 138 | return MochiKit.DOM.INPUT({'type':'hidden', 'name':anInputAttributes[0], 'value':anInputAttributes[1]}); |
141 | }, MochiKit.Base.items(someAttributes['inputValues']))); | 139 | }, MochiKit.Base.items(someAttributes['inputValues']))); |
142 | 140 | ||
143 | html =''; | 141 | html =''; |
144 | html += '<h3>Loading ' + someAttributes['label'] + ' ...</h3>'; | 142 | html += '<h3>Loading ' + someAttributes['label'] + ' ...</h3>'; |
145 | html +=MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV(), MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV({style:'display:none; visibility:hidden;'}), formElement)).innerHTML; | 143 | html +=MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV(), MochiKit.DOM.appendChildNodes(MochiKit.DOM.DIV({style:'display:none; visibility:hidden;'}), formElement)).innerHTML; |
146 | 144 | ||
147 | this.updateWindowWithHTMLContent(aWindow, html); | 145 | this.updateWindowWithHTMLContent(aWindow, html); |
148 | this.submitLoginForm(aWindow, submitFunction); | 146 | this.submitLoginForm(aWindow, submitFunction); |
149 | }, | 147 | }, |
150 | 148 | ||
151 | //------------------------------------------------------------------------- | 149 | //------------------------------------------------------------------------- |
152 | 150 | ||
153 | 'runHttpAuthDirectLogin': function(aWindow, someAttributes) { | 151 | 'runHttpAuthDirectLogin': function(aWindow, someAttributes) { |
154 | var completeUrl; | 152 | var completeUrl; |
155 | var url; | 153 | var url; |
156 | 154 | ||
157 | //console.log("runHttpAuthDirectLogin", someAttributes); | ||
158 | url = someAttributes['inputValues']['url']; | 155 | url = someAttributes['inputValues']['url']; |
159 | 156 | ||
160 | if (/^https?\:\/\//.test(url) == false) { | 157 | if (/^https?\:\/\//.test(url) == false) { |
161 | url = 'http://' + url; | 158 | url = 'http://' + url; |
162 | } | 159 | } |
163 | 160 | ||
164 | if (Clipperz_IEisBroken === true) { | 161 | if (Clipperz_IEisBroken === true) { |
165 | completeUrl = url; | 162 | completeUrl = url; |
166 | } else { | 163 | } else { |
167 | var username; | 164 | var username; |
168 | var password; | 165 | var password; |
169 | 166 | ||
170 | username = someAttributes['inputValues']['username']; | 167 | username = someAttributes['inputValues']['username']; |
171 | password = someAttributes['inputValues']['password']; | 168 | password = someAttributes['inputValues']['password']; |
172 | /(^https?\:\/\/)?(.*)/.test(url); | 169 | /(^https?\:\/\/)?(.*)/.test(url); |
173 | 170 | ||
174 | completeUrl = RegExp.$1 + username + ':' + password + '@' + RegExp.$2; | 171 | completeUrl = RegExp.$1 + username + ':' + password + '@' + RegExp.$2; |
175 | } | 172 | } |
176 | 173 | ||
177 | window.open(completeUrl, this.target()); | 174 | window.open(completeUrl, this.target()); |
178 | }, | 175 | }, |
179 | 176 | ||
180 | //============================================================================= | 177 | //============================================================================= |
181 | 178 | ||
182 | 'runDirectLogin': function (aWindow) { | 179 | 'runDirectLogin': function (aWindow) { |
183 | var deferredResult; | 180 | var deferredResult; |
184 | 181 | ||
185 | //console.log(">>> runDirectLogin"); | ||
186 | deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false}); | 182 | deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false}); |
187 | deferredResult.addMethod(this, 'initialWindowSetup', aWindow); | 183 | deferredResult.addMethod(this, 'initialWindowSetup', aWindow); |
188 | deferredResult.addMethod(this.directLogin(), 'label'); | 184 | deferredResult.addMethod(this.directLogin(), 'label'); |
189 | deferredResult.addMethod(this, 'updateWindowWithDirectLoginLabel', aWindow); | 185 | deferredResult.addMethod(this, 'updateWindowWithDirectLoginLabel', aWindow); |
190 | deferredResult.collectResults({ | 186 | deferredResult.collectResults({ |
191 | 'type': MochiKit.Base.method(this.directLogin(), 'type'), | 187 | 'type': MochiKit.Base.method(this.directLogin(), 'type'), |
192 | 'label': MochiKit.Base.method(this.directLogin(), 'label'), | 188 | 'label': MochiKit.Base.method(this.directLogin(), 'label'), |
193 | 'formAttributes':MochiKit.Base.method(this.directLogin(), 'formAttributes'), | 189 | 'formAttributes':MochiKit.Base.method(this.directLogin(), 'formAttributes'), |
194 | 'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues') | 190 | 'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues') |
195 | }); | 191 | }); |
196 | //deferredResult.addCallback(function (aValue) { console.log("SOME ATTRIBUTES", aValue); return aValue; }); | ||
197 | deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) { | 192 | deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) { |
198 | //console.log("SOME ATTRIBUTES", someAttributes); | ||
199 | switch (someAttributes['type']) { | 193 | switch (someAttributes['type']) { |
200 | case 'http_auth': | 194 | case 'http_auth': |
201 | this.runHttpAuthDirectLogin(aWindow, someAttributes); | 195 | this.runHttpAuthDirectLogin(aWindow, someAttributes); |
202 | break; | 196 | break; |
203 | case 'simple_url': | 197 | case 'simple_url': |
204 | this.runSimpleUrlDirectLogin(aWindow, someAttributes); | 198 | this.runSimpleUrlDirectLogin(aWindow, someAttributes); |
205 | break; | 199 | break; |
206 | default: | 200 | default: |
207 | this.runSubmitFormDirectLogin(aWindow, someAttributes); | 201 | this.runSubmitFormDirectLogin(aWindow, someAttributes); |
208 | break; | 202 | break; |
209 | } | 203 | } |
210 | }, this)); | 204 | }, this)); |
211 | deferredResult.callback(); | 205 | deferredResult.callback(); |
212 | //console.log("<<< runDirectLogin"); | ||
213 | 206 | ||
214 | return deferredResult; | 207 | return deferredResult; |
215 | }, | 208 | }, |
216 | 209 | ||
217 | //============================================================================= | 210 | //============================================================================= |
218 | 211 | ||
219 | 'run': function () { | 212 | 'run': function () { |
220 | var newWindow; | 213 | var newWindow; |
221 | 214 | ||
222 | newWindow = window.open(Clipperz.PM.Strings.getValue('directLoginJumpPageUrl'), this.target()); | 215 | newWindow = window.open(Clipperz.PM.Strings.getValue('directLoginJumpPageUrl'), this.target()); |
223 | 216 | ||
224 | return this.runDirectLogin(newWindow); | 217 | return this.runDirectLogin(newWindow); |
225 | }, | 218 | }, |
226 | 219 | ||
227 | //============================================================================= | 220 | //============================================================================= |
228 | 221 | ||
229 | 'test': function () { | 222 | 'test': function () { |
230 | var iFrame; | 223 | var iFrame; |
231 | var newWindow; | 224 | var newWindow; |
232 | 225 | ||
233 | iFrame = MochiKit.DOM.createDOM('iframe'); | 226 | iFrame = MochiKit.DOM.createDOM('iframe'); |
234 | MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, iFrame); | 227 | MochiKit.DOM.appendChildNodes(MochiKit.DOM.currentDocument().body, iFrame); |
235 | 228 | ||
236 | newWindow = iFrame.contentWindow; | 229 | newWindow = iFrame.contentWindow; |
237 | 230 | ||
238 | return this.runDirectLogin(newWindow); | 231 | return this.runDirectLogin(newWindow); |
239 | }, | 232 | }, |
240 | 233 | ||
241 | //============================================================================= | 234 | //============================================================================= |
242 | __syntaxFix__: "syntax fix" | 235 | __syntaxFix__: "syntax fix" |
243 | }); | 236 | }); |
244 | 237 | ||
245 | //----------------------------------------------------------------------------- | 238 | //----------------------------------------------------------------------------- |
246 | 239 | ||
247 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin = function (aDirectLogin) { | 240 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin = function (aDirectLogin) { |
248 | varrunner; | 241 | varrunner; |
249 | 242 | ||
250 | runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); | 243 | runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); |
251 | return runner.run(); | 244 | return runner.run(); |
252 | }; | 245 | }; |
253 | 246 | ||
254 | //----------------------------------------------------------------------------- | 247 | //----------------------------------------------------------------------------- |
255 | 248 | ||
256 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.testDirectLogin = function (aDirectLogin) { | 249 | Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.testDirectLogin = function (aDirectLogin) { |
257 | varrunner; | 250 | varrunner; |
258 | 251 | ||
259 | //console.log(">>>>>> TESTING DIRECT LOGIN"); | ||
260 | runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); | 252 | runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin}); |
261 | return runner.test(); | 253 | return runner.test(); |
262 | }; | 254 | }; |
263 | 255 | ||
264 | //----------------------------------------------------------------------------- | 256 | //----------------------------------------------------------------------------- |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js index 41fe17f..52d81d4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Controllers.ProgressBarController = function(args) { | 26 | Clipperz.PM.UI.Common.Controllers.ProgressBarController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | this._numberOfSteps= 0; | 29 | this._numberOfSteps= 0; |
32 | this._currentStep= 0; | 30 | this._currentStep= 0; |
33 | 31 | ||
34 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); | 32 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); |
35 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); | 33 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); |
36 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); | 34 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); |
37 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); | 35 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.ProgressBarController.prototype, { | 40 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.ProgressBarController.prototype, { |
43 | 41 | ||
44 | 'toString': function() { | 42 | 'toString': function() { |
45 | return "Clipperz.PM.UI.Common.Controllers.ProgressBarController"; | 43 | return "Clipperz.PM.UI.Common.Controllers.ProgressBarController"; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //----------------------------------------------------------------------------- | 46 | //----------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'numberOfSteps': function() { | 48 | 'numberOfSteps': function() { |
51 | return this._numberOfSteps; | 49 | return this._numberOfSteps; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | 'setNumberOfSteps': function (aValue) { | 52 | 'setNumberOfSteps': function (aValue) { |
55 | this._numberOfSteps = aValue; | 53 | this._numberOfSteps = aValue; |
56 | }, | 54 | }, |
57 | 55 | ||
58 | 'updateNumberOfSteps': function (aValue) { | 56 | 'updateNumberOfSteps': function (aValue) { |
59 | this._numberOfSteps += aValue; | 57 | this._numberOfSteps += aValue; |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //----------------------------------------------------------------------------- | 60 | //----------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'currentStep': function() { | 62 | 'currentStep': function() { |
65 | return this._currentStep; | 63 | return this._currentStep; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | 'advanceCurrentStep': function () { | 66 | 'advanceCurrentStep': function () { |
69 | this._currentStep ++; | 67 | this._currentStep ++; |
70 | }, | 68 | }, |
71 | 69 | ||
72 | //----------------------------------------------------------------------------- | 70 | //----------------------------------------------------------------------------- |
73 | 71 | ||
74 | 'completedPercentage': function () { | 72 | 'completedPercentage': function () { |
75 | var result; | 73 | var result; |
76 | //Clipperz.log(">>> completedPercentage" + this.currentStep() + "/" + this.numberOfSteps(), this.currentStep() / this.numberOfSteps()); | 74 | //Clipperz.log(">>> completedPercentage" + this.currentStep() + "/" + this.numberOfSteps(), this.currentStep() / this.numberOfSteps()); |
77 | if (this.numberOfSteps() == 0) { | 75 | if (this.numberOfSteps() == 0) { |
78 | result = 0; | 76 | result = 0; |
79 | } else { | 77 | } else { |
80 | result = (Math.min(100, 100 * (this.currentStep() / this.numberOfSteps()))); | 78 | result = (Math.min(100, 100 * (this.currentStep() / this.numberOfSteps()))); |
81 | } | 79 | } |
82 | //Clipperz.log("<<< completedPercentage", result); | 80 | //Clipperz.log("<<< completedPercentage", result); |
83 | return result; | 81 | return result; |
84 | }, | 82 | }, |
85 | 83 | ||
86 | //----------------------------------------------------------------------------- | 84 | //----------------------------------------------------------------------------- |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js index 341fde9..d3e86de 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Common.Controllers.TabPanelController = function(args) { | 26 | Clipperz.PM.UI.Common.Controllers.TabPanelController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | this._component = args.component; | 29 | this._component = args.component; |
32 | this._configuration = args.configuration; | 30 | this._configuration = args.configuration; |
33 | this._isEnabled = args.enabled || true; | 31 | this._isEnabled = args.enabled || true; |
34 | 32 | ||
35 | this._selectedTab = null; | 33 | this._selectedTab = null; |
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.TabPanelController.prototype, { | 37 | MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.TabPanelController.prototype, { |
40 | 38 | ||
41 | 'toString': function() { | 39 | 'toString': function() { |
42 | return "Clipperz.PM.UI.Common.Controllers.TabPanelController"; | 40 | return "Clipperz.PM.UI.Common.Controllers.TabPanelController"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | //----------------------------------------------------------------------------- | 43 | //----------------------------------------------------------------------------- |
46 | 44 | ||
47 | 'component': function() { | 45 | 'component': function() { |
48 | return this._component; | 46 | return this._component; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | 'configuration': function() { | 49 | 'configuration': function() { |
52 | return this._configuration; | 50 | return this._configuration; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //----------------------------------------------------------------------------- | 53 | //----------------------------------------------------------------------------- |
56 | 54 | ||
57 | 'getElement': function(anElementID) { | 55 | 'getElement': function(anElementID) { |
58 | return this.component().getElement(anElementID); | 56 | return this.component().getElement(anElementID); |
59 | }, | 57 | }, |
60 | 58 | ||
61 | 'tabForTabElement': function(anElement) { | 59 | 'tabForTabElement': function(anElement) { |
62 | varresult; | 60 | varresult; |
63 | 61 | ||
64 | for (result in this.configuration()) { | 62 | for (result in this.configuration()) { |
65 | if (this.getElement(this.configuration()[result]['tab']) == anElement) { | 63 | if (this.getElement(this.configuration()[result]['tab']) == anElement) { |
66 | break; | 64 | break; |
67 | } | 65 | } |
68 | } | 66 | } |
69 | 67 | ||
70 | return result; | 68 | return result; |
71 | }, | 69 | }, |
72 | 70 | ||
73 | //----------------------------------------------------------------------------- | 71 | //----------------------------------------------------------------------------- |
74 | 72 | ||
75 | 'setupTab': function(aConfiguration) { | 73 | 'setupTab': function(aConfiguration) { |
76 | vartabElement; | 74 | vartabElement; |
77 | 75 | ||
78 | tabElement = this.getElement(aConfiguration['tab']); | 76 | tabElement = this.getElement(aConfiguration['tab']); |
79 | 77 | ||
80 | MochiKit.DOM.removeElementClass(tabElement, 'selected'); | 78 | MochiKit.DOM.removeElementClass(tabElement, 'selected'); |
81 | MochiKit.Signal.connect(tabElement, 'onclick', this, 'handleTabClick') | 79 | MochiKit.Signal.connect(tabElement, 'onclick', this, 'handleTabClick') |
82 | }, | 80 | }, |
83 | 81 | ||
84 | 'setupPanel': function(aConfiguration) { | 82 | 'setupPanel': function(aConfiguration) { |
85 | this.hidePanel(aConfiguration['panel']); | 83 | this.hidePanel(aConfiguration['panel']); |
86 | }, | 84 | }, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js index ef38bc6..c13d96a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js | |||
@@ -1,28 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | //Still empty, but here it should be reasonable to factor in code duplicated between | 24 | //Still empty, but here it should be reasonable to factor in code duplicated between |
27 | //- DirectLoginWizardController | 25 | //- DirectLoginWizardController |
28 | //- NewUserWizardController \ No newline at end of file | 26 | //- 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 index ea987cd..f0ccdfb 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js | |||
@@ -1,56 +1,54 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Compact'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Compact'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Compact.MainController = function() { | 26 | Clipperz.PM.UI.Compact.MainController = function() { |
29 | //this._loginPanel = null; | 27 | //this._loginPanel = null; |
30 | //this._user = null; | 28 | //this._user = null; |
31 | // | 29 | // |
32 | //this._isRunningCompact = false; | 30 | //this._isRunningCompact = false; |
33 | // | 31 | // |
34 | //Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); | 32 | //Clipperz.NotificationCenter.register(null, 'userConnected', this, 'userConnectedCallback'); |
35 | //Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); | 33 | //Clipperz.NotificationCenter.register(null, 'switchLanguage', this, 'switchLanguageHandler'); |
36 | // | 34 | // |
37 | //Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); | 35 | //Clipperz.NotificationCenter.register(null, 'EXCEPTION', this, 'reportException'); |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, { | 40 | MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, { |
43 | 41 | ||
44 | 'toString': function() { | 42 | 'toString': function() { |
45 | return "Clipperz.PM.UI.Compact.MainController"; | 43 | return "Clipperz.PM.UI.Compact.MainController"; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //----------------------------------------------------------------------------- | 46 | //----------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'run': function(shouldShowRegistrationForm) { | 48 | 'run': function(shouldShowRegistrationForm) { |
51 | MochiKit.Logging.logDebug("running " + this.toString()); | 49 | Clipperz.logDebug("running " + this.toString()); |
52 | }, | 50 | }, |
53 | 51 | ||
54 | //----------------------------------------------------------------------------- | 52 | //----------------------------------------------------------------------------- |
55 | __syntaxFix__: "syntax fix" | 53 | __syntaxFix__: "syntax fix" |
56 | }); \ No newline at end of file | 54 | }); \ No newline at end of file |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js index 32dfa63..abf4758 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js | |||
@@ -1,299 +1,293 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Mobile.Components.CardDetail = function(args) { | 26 | Clipperz.PM.UI.Mobile.Components.CardDetail = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Mobile.Components.CardDetail.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Mobile.Components.CardDetail.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | //this._cardReference = null; | 31 | //this._cardReference = null; |
34 | 32 | ||
35 | return this; | 33 | return this; |
36 | } | 34 | } |
37 | 35 | ||
38 | //============================================================================= | 36 | //============================================================================= |
39 | 37 | ||
40 | Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardDetail, Clipperz.PM.UI.Common.Components.BaseComponent, { |
41 | 39 | ||
42 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
43 | 41 | ||
44 | 'toString': function () { | 42 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Mobile.Components.CardDetail component"; | 43 | return "Clipperz.PM.UI.Mobile.Components.CardDetail component"; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | /* | 47 | /* |
50 | 'cardReference': function () { | 48 | 'cardReference': function () { |
51 | return this._cardReference; | 49 | return this._cardReference; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | 'setCardReference': function (aValue) { | 52 | 'setCardReference': function (aValue) { |
55 | this._cardReference = aValue; | 53 | this._cardReference = aValue; |
56 | }, | 54 | }, |
57 | */ | 55 | */ |
58 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
59 | 57 | ||
60 | 'renderSelf': function () { | 58 | 'renderSelf': function () { |
61 | console.log("CardDetail.renderSelf"); | ||
62 | this.append(this.element(), {tag:'div', cls:'cardDetail', children:[ | 59 | this.append(this.element(), {tag:'div', cls:'cardDetail', children:[ |
63 | {tag:'div', cls:'toolbar', children:[ | 60 | {tag:'div', cls:'toolbar', children:[ |
64 | {tag:'a', href:'#', cls:'back', html:"List"}, | 61 | {tag:'a', href:'#', cls:'back', html:"List"}, |
65 | {tag:'h1', id:this.getId('cardTitle'), html:"…"} | 62 | {tag:'h1', id:this.getId('cardTitle'), html:"…"} |
66 | ]}, | 63 | ]}, |
67 | {tag:'div', cls:'scroll', id:this.getId('cardDetails'), children:[ | 64 | {tag:'div', cls:'scroll', id:this.getId('cardDetails'), children:[ |
68 | ]} | 65 | ]} |
69 | ]}); | 66 | ]}); |
70 | }, | 67 | }, |
71 | /* | 68 | /* |
72 | 'renderSelf': function() { | 69 | 'renderSelf': function() { |
73 | this.append(this.element(), [ | 70 | this.append(this.element(), [ |
74 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ | 71 | {tag:'div', cls:'cardDetail', id:this.getId('cardDetail'), children:[ |
75 | {tag:'div', id:this.getId('progressBar')} //, | 72 | {tag:'div', id:this.getId('progressBar')} //, |
76 | ]} | 73 | ]} |
77 | ]); | 74 | ]); |
78 | 75 | ||
79 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 76 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
80 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); | 77 | MochiKit.Signal.signal(Clipperz.PM.UI.Common.Controllers.ProgressBarController.defaultController, 'updateProgress', 0); |
81 | }, | 78 | }, |
82 | */ | 79 | */ |
83 | 80 | ||
84 | 'setTitle': function (aValue) { | 81 | 'setTitle': function (aValue) { |
85 | this.getElement('cardTitle').innerHTML = aValue; | 82 | this.getElement('cardTitle').innerHTML = aValue; |
86 | }, | 83 | }, |
87 | 84 | ||
88 | 'fieldListElement': function () { | 85 | 'fieldListElement': function () { |
89 | varresult; | 86 | varresult; |
90 | 87 | ||
91 | result = this.getElement('fieldList'); | 88 | result = this.getElement('fieldList'); |
92 | if (result == null) { | 89 | if (result == null) { |
93 | result = this.append(this.getElement('cardDetails'), {tag:'ul', cls:'rounded', id:this.getId('fieldList')}); | 90 | result = this.append(this.getElement('cardDetails'), {tag:'ul', cls:'rounded', id:this.getId('fieldList')}); |
94 | } | 91 | } |
95 | 92 | ||
96 | return result; | 93 | return result; |
97 | }, | 94 | }, |
98 | 95 | ||
99 | 'renderFieldValues': function (someFieldValues) { | 96 | 'renderFieldValues': function (someFieldValues) { |
100 | varfieldClass; | 97 | varfieldClass; |
101 | 98 | ||
102 | if ((someFieldValues['actionType'] != 'NONE') || (someFieldValues['label'] != '') && (someFieldValues['value'] != '')) { | 99 | if ((someFieldValues['actionType'] != 'NONE') || (someFieldValues['label'] != '') && (someFieldValues['value'] != '')) { |
103 | if (someFieldValues['isHidden'] == true) { | 100 | if (someFieldValues['isHidden'] == true) { |
104 | fieldClass = 'password'; | 101 | fieldClass = 'password'; |
105 | } else { | 102 | } else { |
106 | fieldClass = ''; | 103 | fieldClass = ''; |
107 | } | 104 | } |
108 | 105 | ||
109 | this.append(this.fieldListElement(), {tag:'li', cls:'cardField', children:[ | 106 | this.append(this.fieldListElement(), {tag:'li', cls:'cardField', children:[ |
110 | {tag:'a', href:'#', cls:fieldClass, html:someFieldValues['value'], children:[ | 107 | {tag:'a', href:'#', cls:fieldClass, html:someFieldValues['value'], children:[ |
111 | {tag:'small', cls:'label', html:someFieldValues['label']} | 108 | {tag:'small', cls:'label', html:someFieldValues['label']} |
112 | ]} | 109 | ]} |
113 | ]}) | 110 | ]}) |
114 | } | 111 | } |
115 | }, | 112 | }, |
116 | 113 | ||
117 | 'addField': function (aField) { | 114 | 'addField': function (aField) { |
118 | var deferredResult; | 115 | var deferredResult; |
119 | varfieldValues; | 116 | varfieldValues; |
120 | 117 | ||
121 | fieldValues = {}; | 118 | fieldValues = {}; |
122 | deferredResult = new Clipperz.Async.Deferred("CardDetail.addField", {trace:false}); | 119 | deferredResult = new Clipperz.Async.Deferred("CardDetail.addField", {trace:false}); |
123 | deferredResult.addMethod(aField, 'label'); | 120 | deferredResult.addMethod(aField, 'label'); |
124 | deferredResult.addCallback(function (aValue) { fieldValues['label'] = aValue; }); | 121 | deferredResult.addCallback(function (aValue) { fieldValues['label'] = aValue; }); |
125 | deferredResult.addMethod(aField, 'value'); | 122 | deferredResult.addMethod(aField, 'value'); |
126 | deferredResult.addCallback(function (aValue) { fieldValues['value'] = aValue; }); | 123 | deferredResult.addCallback(function (aValue) { fieldValues['value'] = aValue; }); |
127 | deferredResult.addMethod(aField, 'actionType'); | 124 | deferredResult.addMethod(aField, 'actionType'); |
128 | deferredResult.addCallback(function (aValue) { fieldValues['actionType'] = aValue; }); | 125 | deferredResult.addCallback(function (aValue) { fieldValues['actionType'] = aValue; }); |
129 | deferredResult.addMethod(aField, 'isHidden'); | 126 | deferredResult.addMethod(aField, 'isHidden'); |
130 | deferredResult.addCallback(function (aValue) { fieldValues['isHidden'] = aValue; }); | 127 | deferredResult.addCallback(function (aValue) { fieldValues['isHidden'] = aValue; }); |
131 | deferredResult.addMethod(this, 'renderFieldValues', fieldValues); | 128 | deferredResult.addMethod(this, 'renderFieldValues', fieldValues); |
132 | deferredResult.callback(); | 129 | deferredResult.callback(); |
133 | 130 | ||
134 | return deferredResult; | 131 | return deferredResult; |
135 | }, | 132 | }, |
136 | 133 | ||
137 | //------------------------------------------------------------------------- | 134 | //------------------------------------------------------------------------- |
138 | 135 | ||
139 | 'directLoginElement': function () { | 136 | 'directLoginElement': function () { |
140 | varresult; | 137 | varresult; |
141 | 138 | ||
142 | result = this.getElement('directLoginList'); | 139 | result = this.getElement('directLoginList'); |
143 | if (result == null) { | 140 | if (result == null) { |
144 | this.append(this.getElement('cardDetails'), {tag:'h2', html:"Direct login"}); | 141 | this.append(this.getElement('cardDetails'), {tag:'h2', html:"Direct login"}); |
145 | result = this.append(this.getElement('cardDetails'), {tag:'ul', cls:'rounded', id:this.getId('directLoginList')}); | 142 | result = this.append(this.getElement('cardDetails'), {tag:'ul', cls:'rounded', id:this.getId('directLoginList')}); |
146 | } | 143 | } |
147 | 144 | ||
148 | return result; | 145 | return result; |
149 | }, | 146 | }, |
150 | 147 | ||
151 | 'addDirectLogin': function (aDirectLogin) { | 148 | 'addDirectLogin': function (aDirectLogin) { |
152 | this.append(this.directLoginElement(), {tag:'li', cls:'directLogin forward', children:[ | 149 | this.append(this.directLoginElement(), {tag:'li', cls:'directLogin forward', children:[ |
153 | {tag:'a', href:'#', html:"direct login", children:[ | 150 | {tag:'a', href:'#', html:"direct login", children:[ |
154 | {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:'http://www.clipperz.com/favicon.ico'}]} | 151 | {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:'http://www.clipperz.com/favicon.ico'}]} |
155 | ]} | 152 | ]} |
156 | ]}) | 153 | ]}) |
157 | 154 | ||
158 | console.log("ADD DIRECT LOGIN", aDirectLogin); | ||
159 | }, | 155 | }, |
160 | 156 | ||
161 | //========================================================================= | 157 | //========================================================================= |
162 | 158 | ||
163 | 'showCard': function (aCard) { | 159 | 'showCard': function (aCard) { |
164 | var deferredResult; | 160 | var deferredResult; |
165 | 161 | ||
166 | // this.render(); | 162 | // this.render(); |
167 | 163 | ||
168 | console.log("CardDetail.showCard", aCard); | ||
169 | deferredResult = new Clipperz.Async.Deferred("CardDetail.showCard", {trace:false}); | 164 | deferredResult = new Clipperz.Async.Deferred("CardDetail.showCard", {trace:false}); |
170 | deferredResult.addMethod(aCard, 'label'); | 165 | deferredResult.addMethod(aCard, 'label'); |
171 | deferredResult.addMethod(this, 'setTitle'); | 166 | deferredResult.addMethod(this, 'setTitle'); |
172 | 167 | ||
173 | deferredResult.addMethod(aCard, 'fields'); | 168 | deferredResult.addMethod(aCard, 'fields'); |
174 | deferredResult.addCallback(MochiKit.Base.values); | 169 | deferredResult.addCallback(MochiKit.Base.values); |
175 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addField')); | 170 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addField')); |
176 | 171 | ||
177 | deferredResult.addMethod(aCard, 'directLogins'); | 172 | deferredResult.addMethod(aCard, 'directLogins'); |
178 | deferredResult.addCallback(MochiKit.Base.values); | 173 | deferredResult.addCallback(MochiKit.Base.values); |
179 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addDirectLogin')); | 174 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'addDirectLogin')); |
180 | 175 | ||
181 | 176 | ||
182 | deferredResult.callback(); | 177 | deferredResult.callback(); |
183 | 178 | ||
184 | return deferredResult; | 179 | return deferredResult; |
185 | // return Clipperz.Async.callbacks("CardDialogController.updateComponentState", [ | 180 | // return Clipperz.Async.callbacks("CardDialogController.updateComponentState", [ |
186 | // MochiKit.Base.method(this.record(), 'hasPendingChanges'), | 181 | // MochiKit.Base.method(this.record(), 'hasPendingChanges'), |
187 | // MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving'), | 182 | // MochiKit.Base.method(this.cardDialogComponent(), 'setShouldEnableSaving'), |
188 | // | 183 | // |
189 | // MochiKit.Base.method(this.record(), 'label'), | 184 | // MochiKit.Base.method(this.record(), 'label'), |
190 | // MochiKit.Base.method(this.cardDialogComponent(), 'setTitle'), | 185 | // MochiKit.Base.method(this.cardDialogComponent(), 'setTitle'), |
191 | // MochiKit.Base.method(this.record(), 'notes'), | 186 | // MochiKit.Base.method(this.record(), 'notes'), |
192 | // MochiKit.Base.method(this.cardDialogComponent(), 'setNotes'), | 187 | // MochiKit.Base.method(this.cardDialogComponent(), 'setNotes'), |
193 | // | 188 | // |
194 | // MochiKit.Base.method(this.record(), 'fields'), | 189 | // MochiKit.Base.method(this.record(), 'fields'), |
195 | // MochiKit.Base.values, | 190 | // MochiKit.Base.values, |
196 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithField')), | 191 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithField')), |
197 | // | 192 | // |
198 | // MochiKit.Base.method(this.record(), 'directLogins'), | 193 | // MochiKit.Base.method(this.record(), 'directLogins'), |
199 | // MochiKit.Base.values, | 194 | // MochiKit.Base.values, |
200 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithDirectLogin')), | 195 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.method(this, 'addCardDialogComponentWithDirectLogin')), |
201 | // | 196 | // |
202 | // MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), | 197 | // MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), |
203 | // MochiKit.Base.noop | 198 | // MochiKit.Base.noop |
204 | // ], {trace:false}); | 199 | // ], {trace:false}); |
205 | 200 | ||
206 | }, | 201 | }, |
207 | 202 | ||
208 | //========================================================================= | 203 | //========================================================================= |
209 | 204 | ||
210 | 'showCardDetails': function (someData) { | 205 | 'showCardDetails': function (someData) { |
211 | this.element().innerHTML = ''; | 206 | this.element().innerHTML = ''; |
212 | this.append(this.element(), [ | 207 | this.append(this.element(), [ |
213 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { | 208 | {tag:'fieldset', id:this.getId('fields'), children:MochiKit.Base.map(function (aFieldData) { |
214 | return {tag:'div', cls:'row', children:[ | 209 | return {tag:'div', cls:'row', children:[ |
215 | {tag:'label', html:aFieldData['label']}, | 210 | {tag:'label', html:aFieldData['label']}, |
216 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} | 211 | // {tag:'span', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), html:aFieldData['value']} |
217 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ | 212 | {tag:'div', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), children:[ |
218 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} | 213 | {tag:'div', children:[{tag:'p', html:aFieldData['value']}]} |
219 | ]} | 214 | ]} |
220 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} | 215 | // {tag:'input', type:'text', cls:('fieldValue ' + (aFieldData['isHidden']? 'password' : 'text')), value:aFieldData['value'], disabled:true} |
221 | 216 | ||
222 | ]} | 217 | ]} |
223 | }, someData['fields'])} | 218 | }, someData['fields'])} |
224 | ]); | 219 | ]); |
225 | 220 | ||
226 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { | 221 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.element(), ['span.password']), MochiKit.Base.bind(function (aPasswordElement) { |
227 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) | 222 | MochiKit.Signal.connect(aPasswordElement, 'onclick', function (anEvent) { alert(MochiKit.DOM.scrapeText(anEvent.src())); }) |
228 | }, this)); | 223 | }, this)); |
229 | 224 | ||
230 | if (someData['directLogins'].length > 0) { | 225 | if (someData['directLogins'].length > 0) { |
231 | this.append(this.element(), [ | 226 | this.append(this.element(), [ |
232 | {tag:'h2', html:"Direct logins"}, | 227 | {tag:'h2', html:"Direct logins"}, |
233 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { | 228 | {tag:'fieldset', id:this.getId('directLogins'), children:MochiKit.Base.map(function (aDirectLoginData) { |
234 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ | 229 | return {tag:'div', cls:'row', id:('directLogin_' + aDirectLoginData['_reference']), children:[ |
235 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, | 230 | {tag:'img', cls:'favicon', src:aDirectLoginData['favicon']}, |
236 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} | 231 | // {tag:'input', cls:'directLogin', disabled:'disabled', type:'text', name:aDirectLoginData['label'], value:aDirectLoginData['label']} |
237 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} | 232 | {tag:'span', cls:'directLogin', html:aDirectLoginData['label']} |
238 | ]} | 233 | ]} |
239 | }, someData['directLogins'])} | 234 | }, someData['directLogins'])} |
240 | ]); | 235 | ]); |
241 | 236 | ||
242 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { | 237 | MochiKit.Base.map(MochiKit.Base.bind(function (aRowNode) { |
243 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); | 238 | MochiKit.Signal.connect(aRowNode, 'onclick', this, 'directLoginClickHandler'); |
244 | }, this), | 239 | }, this), |
245 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) | 240 | MochiKit.Selector.findChildElements(this.getElement('directLogins'), ['div.row']) |
246 | ) | 241 | ) |
247 | }; | 242 | }; |
248 | 243 | ||
249 | if (someData['notes'] != '') { | 244 | if (someData['notes'] != '') { |
250 | this.append(this.element(), [ | 245 | this.append(this.element(), [ |
251 | {tag:'h2', html:"Notes"}, | 246 | {tag:'h2', html:"Notes"}, |
252 | {tag:'fieldset', id:this.getId('fieldset'), children:[ | 247 | {tag:'fieldset', id:this.getId('fieldset'), children:[ |
253 | {tag:'div', cls:'row notes', children:[ | 248 | {tag:'div', cls:'row notes', children:[ |
254 | {tag:'span', html:someData['notes']} | 249 | {tag:'span', html:someData['notes']} |
255 | ]} | 250 | ]} |
256 | ]} | 251 | ]} |
257 | ]); | 252 | ]); |
258 | }; | 253 | }; |
259 | 254 | ||
260 | return true; | 255 | return true; |
261 | }, | 256 | }, |
262 | 257 | ||
263 | //------------------------------------------------------------------------- | 258 | //------------------------------------------------------------------------- |
264 | /* | 259 | /* |
265 | 'toggleClickHandler': function (anEvent) { | 260 | 'toggleClickHandler': function (anEvent) { |
266 | varnextState; | 261 | varnextState; |
267 | varfieldValue; | 262 | varfieldValue; |
268 | 263 | ||
269 | //console.log("TOGGLE"); | ||
270 | anEvent.preventDefault; | 264 | anEvent.preventDefault; |
271 | fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0]; | 265 | fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0]; |
272 | 266 | ||
273 | nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true'); | 267 | nextState = (MochiKit.DOM.getNodeAttribute(anEvent.src(), 'toggled') != 'true'); |
274 | if (nextState) { | 268 | if (nextState) { |
275 | MochiKit.DOM.removeElementClass(fieldValue, 'clear'); | 269 | MochiKit.DOM.removeElementClass(fieldValue, 'clear'); |
276 | } else { | 270 | } else { |
277 | MochiKit.DOM.addElementClass(fieldValue, 'clear'); | 271 | MochiKit.DOM.addElementClass(fieldValue, 'clear'); |
278 | } | 272 | } |
279 | 273 | ||
280 | MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState); | 274 | MochiKit.DOM.setNodeAttribute(anEvent.src(), 'toggled', nextState); |
281 | }, | 275 | }, |
282 | * / | 276 | * / |
283 | //========================================================================= | 277 | //========================================================================= |
284 | /* | 278 | /* |
285 | 'directLoginClickHandler': function (anEvent) { | 279 | 'directLoginClickHandler': function (anEvent) { |
286 | anEvent.preventDefault(); | 280 | anEvent.preventDefault(); |
287 | 281 | ||
288 | if (/(directLogin_)/.test(anEvent.src().id)) { | 282 | if (/(directLogin_)/.test(anEvent.src().id)) { |
289 | var directLoginReference; | 283 | var directLoginReference; |
290 | 284 | ||
291 | directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2]; | 285 | directLoginReference = anEvent.src().id.match(/(directLogin_)(.*)/)[2]; |
292 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference}); | 286 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'selectedDirectLogin', {cardReference:this.cardReference(), directLoginReference:directLoginReference}); |
293 | } | 287 | } |
294 | }, | 288 | }, |
295 | */ | 289 | */ |
296 | //========================================================================= | 290 | //========================================================================= |
297 | 291 | ||
298 | __syntaxFix__: "syntax fix" | 292 | __syntaxFix__: "syntax fix" |
299 | }); | 293 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js index a4aa212..a0e4879 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js | |||
@@ -1,238 +1,232 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Mobile.Components.CardList = function(args) { | 26 | Clipperz.PM.UI.Mobile.Components.CardList = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Mobile.Components.CardList.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Mobile.Components.CardList.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._cardDetail = null; | 31 | this._cardDetail = null; |
34 | 32 | ||
35 | return this; | 33 | return this; |
36 | } | 34 | } |
37 | 35 | ||
38 | //============================================================================= | 36 | //============================================================================= |
39 | 37 | ||
40 | Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.Common.Components.BaseComponent, { |
41 | 39 | ||
42 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
43 | 41 | ||
44 | 'toString': function () { | 42 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Mobile.Components.CardList component"; | 43 | return "Clipperz.PM.UI.Mobile.Components.CardList component"; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'renderSelf': function () { | 48 | 'renderSelf': function () { |
51 | this.append(this.element(), {tag:'div', cls:'cardList', children:[ | 49 | this.append(this.element(), {tag:'div', cls:'cardList', children:[ |
52 | {tag:'div', cls:'toolbar', children:[ | 50 | {tag:'div', cls:'toolbar', children:[ |
53 | {tag:'h1', html:"clipperz"}, | 51 | {tag:'h1', html:"clipperz"}, |
54 | // {tag:'input', name:'search', type:'search', autocomplete:'off', placeholder:"search", id:this.getId('search')}, | 52 | // {tag:'input', name:'search', type:'search', autocomplete:'off', placeholder:"search", id:this.getId('search')}, |
55 | {tag:'a', href:'#', id:'settings', cls:'button', html:"*"} | 53 | {tag:'a', href:'#', id:'settings', cls:'button', html:"*"} |
56 | ]}, | 54 | ]}, |
57 | {tag:'div', cls:'scroll', id:this.getId('listBox'), children:[ | 55 | {tag:'div', cls:'scroll', id:this.getId('listBox'), children:[ |
58 | {tag:'ul', cls:'rounded', id:this.getId('list'), children:[ | 56 | {tag:'ul', cls:'rounded', id:this.getId('list'), children:[ |
59 | {tag:'li', html:'loading'} | 57 | {tag:'li', html:'loading'} |
60 | ]} | 58 | ]} |
61 | ]} | 59 | ]} |
62 | ]}); | 60 | ]}); |
63 | 61 | ||
64 | MochiKit.Signal.connect(this.getElement('list'), 'onclick', this, 'cardSelectionHandler'); | 62 | MochiKit.Signal.connect(this.getElement('list'), 'onclick', this, 'cardSelectionHandler'); |
65 | MochiKit.Signal.connect(this.getElement('list'), 'ontouchstart',this, 'cardSelectionHandler'); | 63 | MochiKit.Signal.connect(this.getElement('list'), 'ontouchstart',this, 'cardSelectionHandler'); |
66 | // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onsubmit', this,'searchHandler'); | 64 | // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onsubmit', this,'searchHandler'); |
67 | // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeydown', this,'searchHandler'); | 65 | // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeydown', this,'searchHandler'); |
68 | // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeyup', this,'searchHandler'); | 66 | // MochiKit.Signal.connect(this.getElement('cardListSearchForm'), 'onkeyup', this,'searchHandler'); |
69 | 67 | ||
70 | // MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this,'cardListClickHandler'); | 68 | // MochiKit.Signal.connect(this.getElement('cardListPanel'), 'onclick', this,'cardListClickHandler'); |
71 | // MochiKit.Signal.connect('backButton', 'onclick', this,'backButtonClickHandler'); | 69 | // MochiKit.Signal.connect('backButton', 'onclick', this,'backButtonClickHandler'); |
72 | 70 | ||
73 | // MochiKit.Style.hideElement('backButton'); | 71 | // MochiKit.Style.hideElement('backButton'); |
74 | // MochiKit.Style.hideElement(this.getElement('cardDetail')); | 72 | // MochiKit.Style.hideElement(this.getElement('cardDetail')); |
75 | }, | 73 | }, |
76 | 74 | ||
77 | 'showCards': function (someCards) { | 75 | 'showCards': function (someCards) { |
78 | varcardListElement; | 76 | varcardListElement; |
79 | if (this.isFullyRendered() == false) { | 77 | if (this.isFullyRendered() == false) { |
80 | this.render(); | 78 | this.render(); |
81 | }; | 79 | }; |
82 | 80 | ||
83 | cardListElement = this.getElement('list') | 81 | cardListElement = this.getElement('list') |
84 | 82 | ||
85 | cardInfo = { | 83 | cardInfo = { |
86 | '_rowObject': MochiKit.Async.succeed, | 84 | '_rowObject': MochiKit.Async.succeed, |
87 | '_reference': MochiKit.Base.methodcaller('reference'), | 85 | '_reference': MochiKit.Base.methodcaller('reference'), |
88 | '_searchableContent':MochiKit.Base.methodcaller('searchableContent'), | 86 | '_searchableContent':MochiKit.Base.methodcaller('searchableContent'), |
89 | 'label': MochiKit.Base.methodcaller('label'), | 87 | 'label': MochiKit.Base.methodcaller('label'), |
90 | 'favicon': MochiKit.Base.methodcaller('favicon') | 88 | 'favicon': MochiKit.Base.methodcaller('favicon') |
91 | }; | 89 | }; |
92 | 90 | ||
93 | //console.log("someCards", someCards); | ||
94 | deferredResult = new Clipperz.Async.Deferred("CardList.showCards", {trace:false}); | 91 | deferredResult = new Clipperz.Async.Deferred("CardList.showCards", {trace:false}); |
95 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("CardList.value - collectResults", cardInfo, {trace:false})); | 92 | deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("CardList.value - collectResults", cardInfo, {trace:false})); |
96 | deferredResult.addCallback(Clipperz.Async.collectAll); | 93 | deferredResult.addCallback(Clipperz.Async.collectAll); |
97 | deferredResult.addCallback(MochiKit.Base.methodcaller('sort', Clipperz.Base.caseInsensitiveKeyComparator('label'))); | 94 | deferredResult.addCallback(MochiKit.Base.methodcaller('sort', Clipperz.Base.caseInsensitiveKeyComparator('label'))); |
98 | deferredResult.addCallbackPass(MochiKit.DOM.replaceChildNodes, cardListElement); | 95 | deferredResult.addCallbackPass(MochiKit.DOM.replaceChildNodes, cardListElement); |
99 | // deferredResult.addCallbackPass(MochiKit.DOM.removeElementClass, cardListElement, 'loading'); | 96 | // deferredResult.addCallbackPass(MochiKit.DOM.removeElementClass, cardListElement, 'loading'); |
100 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'appendCardToList', cardListElement)); | 97 | deferredResult.addCallback(MochiKit.Base.map, MochiKit.Base.method(this, 'appendCardToList', cardListElement)); |
101 | deferredResult.callback(someCards); | 98 | deferredResult.callback(someCards); |
102 | }, | 99 | }, |
103 | 100 | ||
104 | 'appendCardToList': function (aCardListElement, aCardInfo) { | 101 | 'appendCardToList': function (aCardListElement, aCardInfo) { |
105 | //console.log("appendCardToList", aCardInfo); | ||
106 | this.append(aCardListElement, {tag:'li', cls:'cardListItem arrow', cardreference:aCardInfo['_reference'], children:[ | 102 | this.append(aCardListElement, {tag:'li', cls:'cardListItem arrow', cardreference:aCardInfo['_reference'], children:[ |
107 | {tag:'a', href:'#', html:aCardInfo['label'], children:[ | 103 | {tag:'a', href:'#', html:aCardInfo['label'], children:[ |
108 | {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]} | 104 | {tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]} |
109 | ]} | 105 | ]} |
110 | ]}); | 106 | ]}); |
111 | }, | 107 | }, |
112 | 108 | ||
113 | 'cardSelectionHandler': function (anEvent) { | 109 | 'cardSelectionHandler': function (anEvent) { |
114 | var listElement; | 110 | var listElement; |
115 | varcardReference; | 111 | varcardReference; |
116 | 112 | ||
117 | anEvent.preventDefault(); | 113 | anEvent.preventDefault(); |
118 | 114 | ||
119 | listElement = anEvent.target(); | 115 | listElement = anEvent.target(); |
120 | if (MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') == null) { | 116 | if (MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') == null) { |
121 | listElement = MochiKit.DOM.getFirstParentByTagAndClassName(anEvent.target(), tagName='li', className='cardListItem'); | 117 | listElement = MochiKit.DOM.getFirstParentByTagAndClassName(anEvent.target(), tagName='li', className='cardListItem'); |
122 | } | 118 | } |
123 | cardReference = MochiKit.DOM.getNodeAttribute(listElement, 'cardreference'); | 119 | cardReference = MochiKit.DOM.getNodeAttribute(listElement, 'cardreference'); |
124 | console.log("###", listElement, cardReference); | ||
125 | //TODO: Notify card with reference MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') has been selected | 120 | //TODO: Notify card with reference MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') has been selected |
126 | MochiKit.Signal.signal(this, 'selectedCard', cardReference); | 121 | MochiKit.Signal.signal(this, 'selectedCard', cardReference); |
127 | }, | 122 | }, |
128 | 123 | ||
129 | //------------------------------------------------------------------------- | 124 | //------------------------------------------------------------------------- |
130 | /* | 125 | /* |
131 | 'searchHandler': function (anEvent) { | 126 | 'searchHandler': function (anEvent) { |
132 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { //RETURN | 127 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ENTER')) { //RETURN |
133 | anEvent.preventDefault(); | 128 | anEvent.preventDefault(); |
134 | } else { | 129 | } else { |
135 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { | 130 | if ((typeof(anEvent.key()) != 'undefined') && (anEvent.key().string == 'KEY_ESCAPE')) { |
136 | anEvent.target().value = ""; | 131 | anEvent.target().value = ""; |
137 | } | 132 | } |
138 | 133 | ||
139 | if (anEvent.type() == 'keyup') { | 134 | if (anEvent.type() == 'keyup') { |
140 | MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value); | 135 | MochiKit.Signal.signal(this, 'searchEvent', anEvent.target().value); |
141 | } | 136 | } |
142 | } | 137 | } |
143 | }, | 138 | }, |
144 | 139 | ||
145 | //------------------------------------------------------------------------- | 140 | //------------------------------------------------------------------------- |
146 | 141 | ||
147 | 'update': function (someObjects) { | 142 | 'update': function (someObjects) { |
148 | varcardListPanel; | 143 | varcardListPanel; |
149 | var i,c; | 144 | var i,c; |
150 | 145 | ||
151 | cardListPanel = this.getElement('cardListPanel'); | 146 | cardListPanel = this.getElement('cardListPanel'); |
152 | cardListPanel.innerHTML = ''; | 147 | cardListPanel.innerHTML = ''; |
153 | 148 | ||
154 | c = someObjects.length; | 149 | c = someObjects.length; |
155 | 150 | ||
156 | for (i=0; i<c; i++) { | 151 | for (i=0; i<c; i++) { |
157 | this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[ | 152 | this.append(cardListPanel, {tag:'li', cls:'cardListItem', id:('cardListItem_' + someObjects[i]['_reference']), children:[ |
158 | {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=')}, | 153 | {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=')}, |
159 | {tag:'a', id:('cardListReference_' + someObjects[i]['_reference']), href:'#', html:someObjects[i]['label']} | 154 | {tag:'a', id:('cardListReference_' + someObjects[i]['_reference']), href:'#', html:someObjects[i]['label']} |
160 | ]}) | 155 | ]}) |
161 | 156 | ||
162 | MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler'); | 157 | MochiKit.Signal.connect('cardListItem_' + someObjects[i]['_reference'], 'onclick', this, 'cardListClickHandler'); |
163 | } | 158 | } |
164 | 159 | ||
165 | }, | 160 | }, |
166 | 161 | ||
167 | 'cardListClickHandler': function (anEvent) { | 162 | 'cardListClickHandler': function (anEvent) { |
168 | anEvent.preventDefault(); | 163 | anEvent.preventDefault(); |
169 | 164 | ||
170 | if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) { | 165 | if (/(cardListReference_|cardListItem_)/.test(anEvent.target().id)) { |
171 | var cardListReference; | 166 | var cardListReference; |
172 | 167 | ||
173 | cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2]; | 168 | cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2]; |
174 | //console.log("Showing detail for card named", cardListReference); | ||
175 | MochiKit.Signal.signal(this, 'selectedCard', cardListReference); | 169 | MochiKit.Signal.signal(this, 'selectedCard', cardListReference); |
176 | } | 170 | } |
177 | }, | 171 | }, |
178 | 172 | ||
179 | //========================================================================= | 173 | //========================================================================= |
180 | 174 | ||
181 | 'cardDetail': function (someData) { | 175 | 'cardDetail': function (someData) { |
182 | if (this._cardDetail == null) { | 176 | if (this._cardDetail == null) { |
183 | this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:this.getElement('cardDetail')}); | 177 | this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:this.getElement('cardDetail')}); |
184 | } | 178 | } |
185 | 179 | ||
186 | return this._cardDetail; | 180 | return this._cardDetail; |
187 | }, | 181 | }, |
188 | 182 | ||
189 | //------------------------------------------------------------------------- | 183 | //------------------------------------------------------------------------- |
190 | 184 | ||
191 | 'removeCardDetail': function () { | 185 | 'removeCardDetail': function () { |
192 | if (this._cardDetail != null) { | 186 | if (this._cardDetail != null) { |
193 | this._cardDetail.remove(); | 187 | this._cardDetail.remove(); |
194 | this._cardDetail = null; | 188 | this._cardDetail = null; |
195 | } | 189 | } |
196 | }, | 190 | }, |
197 | 191 | ||
198 | //========================================================================= | 192 | //========================================================================= |
199 | 193 | ||
200 | 'showCard': function (someData) { | 194 | 'showCard': function (someData) { |
201 | vardeferredResult; | 195 | vardeferredResult; |
202 | varoffset; | 196 | varoffset; |
203 | 197 | ||
204 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); | 198 | offset = ((MochiKit.DOM.getNodeAttribute(MochiKit.DOM.currentDocument().body, 'orientation') == 'portrait') ? 320 : 480); |
205 | this.cardDetail().render(); | 199 | this.cardDetail().render(); |
206 | this.cardDetail().setCardReference(someData['_reference']); | 200 | this.cardDetail().setCardReference(someData['_reference']); |
207 | MochiKit.Style.setElementPosition(this.cardDetail().element(), {x:offset}); | 201 | MochiKit.Style.setElementPosition(this.cardDetail().element(), {x:offset}); |
208 | new MochiKit.Visual.Sequence([ | 202 | new MochiKit.Visual.Sequence([ |
209 | // new MochiKit.Visual.Move(this.cardDetail().element(), {x:offset, y:45, mode:'absolute', duration:0, sync:true}), | 203 | // new MochiKit.Visual.Move(this.cardDetail().element(), {x:offset, y:45, mode:'absolute', duration:0, sync:true}), |
210 | new MochiKit.Visual.Parallel([ | 204 | new MochiKit.Visual.Parallel([ |
211 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:-offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 205 | new MochiKit.Visual.Move(this.getElement('cardList'), {x:-offset, y:0, mode:'relative',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
212 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:0, y:45, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), | 206 | new MochiKit.Visual.Move(this.getElement('cardDetail'), {x:0, y:45, mode:'absolute',transition:MochiKit.Visual.Transitions.linear, sync:true}), |
213 | // new MochiKit.Visual.ScrollTo('toolbar', {sync:true}), | 207 | // new MochiKit.Visual.ScrollTo('toolbar', {sync:true}), |
214 | MochiKit.Visual.appear ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) | 208 | MochiKit.Visual.appear ('backButton', { transition:MochiKit.Visual.Transitions.linear, sync:true}) |
215 | ], {duration:1, sync:true}), | 209 | ], {duration:1, sync:true}), |
216 | MochiKit.Visual.fade(this.getElement('cardList'), {duration:0, sync:true}) | 210 | MochiKit.Visual.fade(this.getElement('cardList'), {duration:0, sync:true}) |
217 | ], {}) | 211 | ], {}) |
218 | 212 | ||
219 | MochiKit.DOM.getElement('pageTitle').innerHTML = someData['title']; | 213 | MochiKit.DOM.getElement('pageTitle').innerHTML = someData['title']; |
220 | 214 | ||
221 | return true; | 215 | return true; |
222 | }, | 216 | }, |
223 | 217 | ||
224 | //------------------------------------------------------------------------- | 218 | //------------------------------------------------------------------------- |
225 | 219 | ||
226 | 'showCardDetails': function (someData) { | 220 | 'showCardDetails': function (someData) { |
227 | return this.cardDetail().showCardDetails(someData); | 221 | return this.cardDetail().showCardDetails(someData); |
228 | }, | 222 | }, |
229 | 223 | ||
230 | //========================================================================= | 224 | //========================================================================= |
231 | 225 | ||
232 | 'backButtonClickHandler': function (anEvent) { | 226 | 'backButtonClickHandler': function (anEvent) { |
233 | varoffset; | 227 | varoffset; |
234 | 228 | ||
235 | anEvent.preventDefault(); | 229 | anEvent.preventDefault(); |
236 | 230 | ||
237 | MochiKit.DOM.getElement('pageTitle').innerHTML = "cards"; | 231 | MochiKit.DOM.getElement('pageTitle').innerHTML = "cards"; |
238 | 232 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js index eafcdbc..3aeac0c 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js | |||
@@ -1,206 +1,203 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Mobile.Components.LoginForm = function(args) { | 26 | Clipperz.PM.UI.Mobile.Components.LoginForm = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | this._pin = ''; | 29 | this._pin = ''; |
32 | 30 | ||
33 | this._message = null; | 31 | this._message = null; |
34 | this._steps = 0; | 32 | this._steps = 0; |
35 | this._actualSteps = 0; | 33 | this._actualSteps = 0; |
36 | 34 | ||
37 | this._callback = null; | 35 | this._callback = null; |
38 | this._errorCallback = null; | 36 | this._errorCallback = null; |
39 | 37 | ||
40 | this._mode = 'CREDENTIALS'; | 38 | this._mode = 'CREDENTIALS'; |
41 | 39 | ||
42 | Clipperz.PM.UI.Mobile.Components.LoginForm.superclass.constructor.apply(this, arguments); | 40 | Clipperz.PM.UI.Mobile.Components.LoginForm.superclass.constructor.apply(this, arguments); |
43 | 41 | ||
44 | return this; | 42 | return this; |
45 | } | 43 | } |
46 | 44 | ||
47 | //============================================================================= | 45 | //============================================================================= |
48 | 46 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'toString': function () { | 51 | 'toString': function () { |
54 | return "Clipperz.PM.UI.Mobile.Components.LoginForm component"; | 52 | return "Clipperz.PM.UI.Mobile.Components.LoginForm component"; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'callback': function () { | 57 | 'callback': function () { |
60 | return this._callback; | 58 | return this._callback; |
61 | }, | 59 | }, |
62 | 60 | ||
63 | 'errorCallback': function () { | 61 | 'errorCallback': function () { |
64 | return this._errorCallback; | 62 | return this._errorCallback; |
65 | }, | 63 | }, |
66 | 64 | ||
67 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
68 | 66 | ||
69 | 'mode': function () { | 67 | 'mode': function () { |
70 | return this._mode; | 68 | return this._mode; |
71 | }, | 69 | }, |
72 | 70 | ||
73 | 'setMode': function (aValue) { | 71 | 'setMode': function (aValue) { |
74 | this._mode = aValue; | 72 | this._mode = aValue; |
75 | }, | 73 | }, |
76 | 74 | ||
77 | //.......................................................................... | 75 | //.......................................................................... |
78 | 76 | ||
79 | 'pin': function () { | 77 | 'pin': function () { |
80 | return this._pin; | 78 | return this._pin; |
81 | }, | 79 | }, |
82 | 80 | ||
83 | 'setPin': function (aValue) { | 81 | 'setPin': function (aValue) { |
84 | this._pin = aValue; | 82 | this._pin = aValue; |
85 | }, | 83 | }, |
86 | 84 | ||
87 | //.......................................................................... | 85 | //.......................................................................... |
88 | 86 | ||
89 | 'username': function () { | 87 | 'username': function () { |
90 | return this._username; | 88 | return this._username; |
91 | }, | 89 | }, |
92 | 90 | ||
93 | 'setUsername': function (aValue) { | 91 | 'setUsername': function (aValue) { |
94 | this._username = aValue; | 92 | this._username = aValue; |
95 | }, | 93 | }, |
96 | 94 | ||
97 | //.......................................................................... | 95 | //.......................................................................... |
98 | 96 | ||
99 | 'passphrase': function () { | 97 | 'passphrase': function () { |
100 | return this._passphrase; | 98 | return this._passphrase; |
101 | }, | 99 | }, |
102 | 100 | ||
103 | 'setPassphrase': function (aValue) { | 101 | 'setPassphrase': function (aValue) { |
104 | this._passphrase = aValue; | 102 | this._passphrase = aValue; |
105 | }, | 103 | }, |
106 | 104 | ||
107 | //------------------------------------------------------------------------- | 105 | //------------------------------------------------------------------------- |
108 | 106 | ||
109 | 'message': function () { | 107 | 'message': function () { |
110 | return this._message; | 108 | return this._message; |
111 | }, | 109 | }, |
112 | 110 | ||
113 | '_setMessage': function (aValue) { | 111 | '_setMessage': function (aValue) { |
114 | this._message = aValue; | 112 | this._message = aValue; |
115 | 113 | ||
116 | if (aValue == null) { | 114 | if (aValue == null) { |
117 | MochiKit.Style.hideElement(this.getElement('credentialsMessage')); | 115 | MochiKit.Style.hideElement(this.getElement('credentialsMessage')); |
118 | } else { | 116 | } else { |
119 | this.getElement('message').innerHTML = aValue; | 117 | this.getElement('message').innerHTML = aValue; |
120 | MochiKit.Style.showElement(this.getElement('credentialsMessage')); | 118 | MochiKit.Style.showElement(this.getElement('credentialsMessage')); |
121 | } | 119 | } |
122 | }, | 120 | }, |
123 | 121 | ||
124 | 'setMessage': function (aValue) { | 122 | 'setMessage': function (aValue) { |
125 | this._setMessage(aValue); | 123 | this._setMessage(aValue); |
126 | MochiKit.DOM.removeElementClass(this.getElement('credentialsMessage'), 'error'); | 124 | MochiKit.DOM.removeElementClass(this.getElement('credentialsMessage'), 'error'); |
127 | }, | 125 | }, |
128 | 126 | ||
129 | 'setErrorMessage': function (aValue) { | 127 | 'setErrorMessage': function (aValue) { |
130 | this._setMessage(aValue); | 128 | this._setMessage(aValue); |
131 | MochiKit.DOM.addElementClass(this.getElement('credentialsMessage'), 'error'); | 129 | MochiKit.DOM.addElementClass(this.getElement('credentialsMessage'), 'error'); |
132 | }, | 130 | }, |
133 | 131 | ||
134 | //------------------------------------------------------------------------- | 132 | //------------------------------------------------------------------------- |
135 | 133 | ||
136 | 'setCallbacks': function (args) { | 134 | 'setCallbacks': function (args) { |
137 | this._callback = args['callback']; | 135 | this._callback = args['callback']; |
138 | this._errorCallback = args['errorCallback']; | 136 | this._errorCallback = args['errorCallback']; |
139 | }, | 137 | }, |
140 | 138 | ||
141 | 'showErrors': function (args) { | 139 | 'showErrors': function (args) { |
142 | //console.log("LoginForm.showErrors", args); | ||
143 | if (args['previousFailedAttempt'] == 'LOGIN') { | 140 | if (args['previousFailedAttempt'] == 'LOGIN') { |
144 | this.setErrorMessage("Wrong credentials"); | 141 | this.setErrorMessage("Wrong credentials"); |
145 | } else if (args['previousFailedAttempt'] == 'PIN') { | 142 | } else if (args['previousFailedAttempt'] == 'PIN') { |
146 | if (args['failedAttempts'] == -1) { | 143 | if (args['failedAttempts'] == -1) { |
147 | this.setErrorMessage("Wrong PIN - Resetted"); | 144 | this.setErrorMessage("Wrong PIN - Resetted"); |
148 | } else { | 145 | } else { |
149 | this.setErrorMessage("Wrong PIN"); | 146 | this.setErrorMessage("Wrong PIN"); |
150 | } | 147 | } |
151 | } else { | 148 | } else { |
152 | this.setMessage(null); | 149 | this.setMessage(null); |
153 | } | 150 | } |
154 | }, | 151 | }, |
155 | 152 | ||
156 | 'updateWithArgs': function (args) { | 153 | 'updateWithArgs': function (args) { |
157 | this.renderIfNeeded(); | 154 | this.renderIfNeeded(); |
158 | this.setCallbacks(args); | 155 | this.setCallbacks(args); |
159 | this.showErrors(args); | 156 | this.showErrors(args); |
160 | this.updateRendering(); | 157 | this.updateRendering(); |
161 | }, | 158 | }, |
162 | 159 | ||
163 | 'showPinLogin': function (args) { | 160 | 'showPinLogin': function (args) { |
164 | this.setPin(''); | 161 | this.setPin(''); |
165 | this.setMode('PIN'); | 162 | this.setMode('PIN'); |
166 | this.updateWithArgs(args); | 163 | this.updateWithArgs(args); |
167 | 164 | ||
168 | // $(this.getAnchor('PIN')).focus(); | 165 | // $(this.getAnchor('PIN')).focus(); |
169 | this.getElement('PIN').focus(); | 166 | this.getElement('PIN').focus(); |
170 | }, | 167 | }, |
171 | 168 | ||
172 | 'showCredentialsLogin': function (args) { | 169 | 'showCredentialsLogin': function (args) { |
173 | this.setMode('CREDENTIALS'); | 170 | this.setMode('CREDENTIALS'); |
174 | this.updateWithArgs(args); | 171 | this.updateWithArgs(args); |
175 | 172 | ||
176 | if (this.getElement('usernameField').value.length == 0) { | 173 | if (this.getElement('usernameField').value.length == 0) { |
177 | // $(this.getAnchor('usernameField')).focus(); | 174 | // $(this.getAnchor('usernameField')).focus(); |
178 | this.getElement('usernameField').focus(); | 175 | this.getElement('usernameField').focus(); |
179 | } else { | 176 | } else { |
180 | // $(this.getAnchor('passphraseField')).focus(); | 177 | // $(this.getAnchor('passphraseField')).focus(); |
181 | this.getElement('passphraseField').focus(); | 178 | this.getElement('passphraseField').focus(); |
182 | this.getElement('passphraseField').select(); | 179 | this.getElement('passphraseField').select(); |
183 | } | 180 | } |
184 | }, | 181 | }, |
185 | 182 | ||
186 | //------------------------------------------------------------------------- | 183 | //------------------------------------------------------------------------- |
187 | 184 | ||
188 | 'renderIfNeeded': function () { | 185 | 'renderIfNeeded': function () { |
189 | if (this.isFullyRendered() == false) { | 186 | if (this.isFullyRendered() == false) { |
190 | this.render(); | 187 | this.render(); |
191 | }; | 188 | }; |
192 | this.updateRendering(); | 189 | this.updateRendering(); |
193 | }, | 190 | }, |
194 | 191 | ||
195 | 'updateRendering': function () { | 192 | 'updateRendering': function () { |
196 | MochiKit.Style.showElement(this.getElement('credentialsBody')); | 193 | MochiKit.Style.showElement(this.getElement('credentialsBody')); |
197 | MochiKit.Style.hideElement(this.getElement('validating')); | 194 | MochiKit.Style.hideElement(this.getElement('validating')); |
198 | 195 | ||
199 | // this.hideAllPanes(); | 196 | // this.hideAllPanes(); |
200 | MochiKit.Base.map(function (aNode) { MochiKit.Style.hideElement(aNode); }, MochiKit.Selector.findDocElements('div.credentialsBody > div')); | 197 | MochiKit.Base.map(function (aNode) { MochiKit.Style.hideElement(aNode); }, MochiKit.Selector.findDocElements('div.credentialsBody > div')); |
201 | if (this.mode() == 'CREDENTIALS') { | 198 | if (this.mode() == 'CREDENTIALS') { |
202 | selectedPanel = this.getElement('credentials') | 199 | selectedPanel = this.getElement('credentials') |
203 | } else if (this.mode() == 'PIN') { | 200 | } else if (this.mode() == 'PIN') { |
204 | selectedPanel = this.getElement('pin') | 201 | selectedPanel = this.getElement('pin') |
205 | // this.updatePinDisplay(); | 202 | // this.updatePinDisplay(); |
206 | } else { | 203 | } else { |
@@ -238,119 +235,113 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI. | |||
238 | {tag:'form', cls:'scroll', id:this.getId('credentialsForm'), children:[ | 235 | {tag:'form', cls:'scroll', id:this.getId('credentialsForm'), children:[ |
239 | {tag:'ul', cls:'edit rounded', children:[ | 236 | {tag:'ul', cls:'edit rounded', children:[ |
240 | {tag:'li', children:[{tag:'input', type:'email', name:'name', /*value:'joe',*/ placeholder:"username", id:this.getId('usernameField') }]}, | 237 | {tag:'li', children:[{tag:'input', type:'email', name:'name', /*value:'joe',*/ placeholder:"username", id:this.getId('usernameField') }]}, |
241 | {tag:'li', children:[{tag:'input', type:'password', name:'passphrase', /*value:'clipperz',*/placeholder:"passphrase", id:this.getId('passphraseField') }]} | 238 | {tag:'li', children:[{tag:'input', type:'password', name:'passphrase', /*value:'clipperz',*/placeholder:"passphrase", id:this.getId('passphraseField') }]} |
242 | ]}, | 239 | ]}, |
243 | {tag:'a', href:'#', cls:'greenButton', id:this.getId('credentialsSubmitButton'), html:"Login"} | 240 | {tag:'a', href:'#', cls:'greenButton', id:this.getId('credentialsSubmitButton'), html:"Login"} |
244 | // {tag:'input', type:'submit', cls:'greenButton', id:this.getId('credentialsSubmitButton'), value:"Login"} | 241 | // {tag:'input', type:'submit', cls:'greenButton', id:this.getId('credentialsSubmitButton'), value:"Login"} |
245 | 242 | ||
246 | ]} | 243 | ]} |
247 | ]}, | 244 | ]}, |
248 | //-------------------------------------------------------------- | 245 | //-------------------------------------------------------------- |
249 | ]}, | 246 | ]}, |
250 | //================================================================== | 247 | //================================================================== |
251 | {tag:'div', cls:'validating', id:this.getId('validating'), children:[ | 248 | {tag:'div', cls:'validating', id:this.getId('validating'), children:[ |
252 | {tag:'div', cls:'loading', children:[ | 249 | {tag:'div', cls:'loading', children:[ |
253 | {tag:'div', cls:'spinner', children:[ | 250 | {tag:'div', cls:'spinner', children:[ |
254 | {tag:'div', cls:'bar01'}, | 251 | {tag:'div', cls:'bar01'}, |
255 | {tag:'div', cls:'bar02'}, | 252 | {tag:'div', cls:'bar02'}, |
256 | {tag:'div', cls:'bar03'}, | 253 | {tag:'div', cls:'bar03'}, |
257 | {tag:'div', cls:'bar04'}, | 254 | {tag:'div', cls:'bar04'}, |
258 | {tag:'div', cls:'bar05'}, | 255 | {tag:'div', cls:'bar05'}, |
259 | {tag:'div', cls:'bar06'}, | 256 | {tag:'div', cls:'bar06'}, |
260 | {tag:'div', cls:'bar07'}, | 257 | {tag:'div', cls:'bar07'}, |
261 | {tag:'div', cls:'bar08'}, | 258 | {tag:'div', cls:'bar08'}, |
262 | {tag:'div', cls:'bar09'}, | 259 | {tag:'div', cls:'bar09'}, |
263 | {tag:'div', cls:'bar10'}, | 260 | {tag:'div', cls:'bar10'}, |
264 | {tag:'div', cls:'bar11'}, | 261 | {tag:'div', cls:'bar11'}, |
265 | {tag:'div', cls:'bar12'} | 262 | {tag:'div', cls:'bar12'} |
266 | ]} | 263 | ]} |
267 | ]}, | 264 | ]}, |
268 | {tag:'div', id:this.getId('loadingMessage')}, | 265 | {tag:'div', id:this.getId('loadingMessage')}, |
269 | {tag:'a', href:'#', cls:'grayButton', id:this.getId('loginCancelButton'), html:"Cancel"} | 266 | {tag:'a', href:'#', cls:'grayButton', id:this.getId('loginCancelButton'), html:"Cancel"} |
270 | ]} | 267 | ]} |
271 | //================================================================== | 268 | //================================================================== |
272 | ]} | 269 | ]} |
273 | ]}); | 270 | ]}); |
274 | 271 | ||
275 | MochiKit.Signal.connect(this.getElement('credentialsForm'), 'onsubmit', this, 'submitCredentialsHandler'); | 272 | MochiKit.Signal.connect(this.getElement('credentialsForm'), 'onsubmit', this, 'submitCredentialsHandler'); |
276 | MochiKit.Signal.connect(this.getElement('credentialsSubmitButton'), 'onclick', this, 'submitCredentialsHandler'); | 273 | MochiKit.Signal.connect(this.getElement('credentialsSubmitButton'), 'onclick', this, 'submitCredentialsHandler'); |
277 | 274 | ||
278 | MochiKit.Signal.connect(this.getElement('pinForm'), 'onsubmit', this, 'submitPinHandler'); | 275 | MochiKit.Signal.connect(this.getElement('pinForm'), 'onsubmit', this, 'submitPinHandler'); |
279 | MochiKit.Signal.connect(this.getElement('pinSubmitButton'), 'onclick', this, 'submitPinHandler'); | 276 | MochiKit.Signal.connect(this.getElement('pinSubmitButton'), 'onclick', this, 'submitPinHandler'); |
280 | 277 | ||
281 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); | 278 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'initProgress', this, 'initProgressHandle'); |
282 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); | 279 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'updateProgress',this, 'updateProgressHandle'); |
283 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); | 280 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'advanceProgress',this, 'advanceProgressHandle'); |
284 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); | 281 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'progressDone', this, 'progressDoneHandle'); |
285 | }, | 282 | }, |
286 | 283 | ||
287 | //------------------------------------------------------------------------- | 284 | //------------------------------------------------------------------------- |
288 | 285 | ||
289 | 'submitPinHandler': function (anEvent) { | 286 | 'submitPinHandler': function (anEvent) { |
290 | varpin; | 287 | varpin; |
291 | 288 | ||
292 | this.setMessage(null); | 289 | this.setMessage(null); |
293 | pin = this.getElement('PIN').value; | 290 | pin = this.getElement('PIN').value; |
294 | // $(this.getAnchor('PIN')).blur(); | 291 | // $(this.getAnchor('PIN')).blur(); |
295 | this.getElement('PIN').blur(); | 292 | this.getElement('PIN').blur(); |
296 | 293 | ||
297 | credentials = Clipperz.PM.PIN.credentialsWithPIN(pin); | 294 | credentials = Clipperz.PM.PIN.credentialsWithPIN(pin); |
298 | this.loginWithCredentials(credentials); | 295 | this.loginWithCredentials(credentials); |
299 | }, | 296 | }, |
300 | 297 | ||
301 | 'submitCredentialsHandler': function (anEvent) { | 298 | 'submitCredentialsHandler': function (anEvent) { |
302 | //console.log("submitCredentialsHandler"); | ||
303 | varcredentials; | 299 | varcredentials; |
304 | 300 | ||
305 | this.setMessage(null); | 301 | this.setMessage(null); |
306 | 302 | ||
307 | credentials = {}; | 303 | credentials = {}; |
308 | credentials['username'] = this.getElement('usernameField').value; | 304 | credentials['username'] = this.getElement('usernameField').value; |
309 | credentials['passphrase'] = this.getElement('passphraseField').value; | 305 | credentials['passphrase'] = this.getElement('passphraseField').value; |
310 | // $(this.getAnchor('passphraseField')).blur(); | 306 | // $(this.getAnchor('passphraseField')).blur(); |
311 | this.getElement('passphraseField').blur(); | 307 | this.getElement('passphraseField').blur(); |
312 | 308 | ||
313 | this.loginWithCredentials(credentials); | 309 | this.loginWithCredentials(credentials); |
314 | }, | 310 | }, |
315 | 311 | ||
316 | //------------------------------------------------------------------------- | 312 | //------------------------------------------------------------------------- |
317 | 313 | ||
318 | 'loginWithCredentials': function (someCredentials) { | 314 | 'loginWithCredentials': function (someCredentials) { |
319 | varargs; | 315 | varargs; |
320 | 316 | ||
321 | args = {}; | 317 | args = {}; |
322 | args['credentials'] = someCredentials; | 318 | args['credentials'] = someCredentials; |
323 | args['errorCallback'] = this.errorCallback(); | 319 | args['errorCallback'] = this.errorCallback(); |
324 | 320 | ||
325 | MochiKit.Style.hideElement(this.getElement('credentialsBody')); | 321 | MochiKit.Style.hideElement(this.getElement('credentialsBody')); |
326 | MochiKit.Style.showElement(this.getElement('validating')); | 322 | MochiKit.Style.showElement(this.getElement('validating')); |
327 | 323 | ||
328 | MochiKit.Async.callLater(0.1, this.callback(), args); | 324 | MochiKit.Async.callLater(0.1, this.callback(), args); |
329 | }, | 325 | }, |
330 | 326 | ||
331 | //------------------------------------------------------------------------- | 327 | //------------------------------------------------------------------------- |
332 | 328 | ||
333 | 'initProgressHandle': function (anEvent) { | 329 | 'initProgressHandle': function (anEvent) { |
334 | //console.log("** initProgressHandle", anEvent); | ||
335 | this._steps = anEvent['steps']; | 330 | this._steps = anEvent['steps']; |
336 | this._actualSteps = 0; | 331 | this._actualSteps = 0; |
337 | }, | 332 | }, |
338 | 333 | ||
339 | 'updateProgressHandle': function (anEvent) { | 334 | 'updateProgressHandle': function (anEvent) { |
340 | //console.log("** updateProgressHandle", anEvent); | ||
341 | this._steps += anEvent['extraSteps']; | 335 | this._steps += anEvent['extraSteps']; |
342 | }, | 336 | }, |
343 | 337 | ||
344 | 'advanceProgressHandle': function (anEvent) { | 338 | 'advanceProgressHandle': function (anEvent) { |
345 | //console.log("** advanceProgressHandle", anEvent); | ||
346 | this._actualSteps ++; | 339 | this._actualSteps ++; |
347 | //console.log("STEPS: " + this._actualSteps + "/" + this._steps); | ||
348 | }, | 340 | }, |
349 | 341 | ||
350 | 'progressDoneHandle': function (anEvent) { | 342 | 'progressDoneHandle': function (anEvent) { |
351 | //console.log("** progressDoneHandle", anEvent); | ||
352 | }, | 343 | }, |
353 | 344 | ||
354 | //------------------------------------------------------------------------- | 345 | //------------------------------------------------------------------------- |
355 | __syntaxFix__: "syntax fix" | 346 | __syntaxFix__: "syntax fix" |
356 | }); | 347 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js index 12a61f7..9951f44 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js | |||
@@ -1,393 +1,381 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Mobile.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Mobile.Controllers.MainController = function() { | 26 | Clipperz.PM.UI.Mobile.Controllers.MainController = function() { |
29 | this._jQTouch = null; | 27 | // this._jQTouch = null; |
30 | this._user = null; | 28 | this._user = null; |
31 | this._proxy = null; | 29 | this._proxy = null; |
32 | this._loginForm = null; | 30 | this._loginForm = null; |
33 | this._cardList = null; | 31 | this._cardList = null; |
34 | this._cardDetail= null; | 32 | this._cardDetail= null; |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype, { | 37 | MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype, { |
40 | 38 | ||
41 | 'toString': function () { | 39 | 'toString': function () { |
42 | return "Clipperz.PM.UI.Mobile.Controllers.MainController"; | 40 | return "Clipperz.PM.UI.Mobile.Controllers.MainController"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
46 | 44 | ||
47 | 'user': function () { | 45 | 'user': function () { |
48 | return this._user; | 46 | return this._user; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | 'setUser': function (aValue) { | 49 | 'setUser': function (aValue) { |
52 | this._user = aValue; | 50 | this._user = aValue; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
56 | 54 | /* | |
57 | 'jQTouch': function () { | 55 | 'jQTouch': function () { |
58 | return this._jQTouch; | 56 | return this._jQTouch; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | 'setJQTouch': function (aValue) { | 59 | 'setJQTouch': function (aValue) { |
62 | this._jQTouch = aValue; | 60 | this._jQTouch = aValue; |
63 | }, | 61 | }, |
64 | 62 | */ | |
65 | //========================================================================= | 63 | //========================================================================= |
66 | 64 | ||
67 | 'run': function () { | 65 | 'run': function () { |
68 | console.log("MainController.run"); | ||
69 | |||
70 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin')); | 66 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin')); |
71 | Clipperz.DOM.Helper.overwrite(MochiKit.DOM.currentDocument().body, {tag:'div', id:'jqt', children:[ | 67 | Clipperz.DOM.Helper.overwrite(MochiKit.DOM.currentDocument().body, {tag:'div', id:'jqt', children:[ |
72 | {tag:'div', id:'loginForm'}, | 68 | {tag:'div', id:'loginForm'}, |
73 | {tag:'div', id:'cardList'}, | 69 | {tag:'div', id:'cardList'}, |
74 | {tag:'div', id:'cardDetail'}, | 70 | {tag:'div', id:'cardDetail'}, |
75 | {tag:'div', id:'preferences'} | 71 | {tag:'div', id:'preferences'} |
76 | ]}); | 72 | ]}); |
77 | 73 | ||
78 | this.showLoginForm(); | 74 | this.showLoginForm(); |
79 | 75 | ||
80 | this.initjQTouch(); | 76 | // this.initjQTouch(); |
81 | 77 | ||
82 | 78 | ||
83 | // this.showAddToHomeScreenBaloon(); | 79 | // this.showAddToHomeScreenBaloon(); |
84 | // this.selectInitialProxy(); | 80 | // this.selectInitialProxy(); |
85 | }, | 81 | }, |
86 | 82 | /* | |
87 | 'initjQTouch': function () { | 83 | 'initjQTouch': function () { |
88 | var jqt; | 84 | var jqt; |
89 | 85 | ||
90 | jqt = new $.jQTouch({ | 86 | jqt = new $.jQTouch({ |
91 | icon: 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAByCAIAAAAAvxIqAAAD8GlDQ1BJQ0MgUHJvZmlsZQAAKJGNVd1v21QUP4lvXKQWP6Cxjg4Vi69VU1u5GxqtxgZJk6XpQhq5zdgqpMl1bhpT1za2021Vn/YCbwz4A4CyBx6QeEIaDMT2su0BtElTQRXVJKQ9dNpAaJP2gqpwrq9Tu13GuJGvfznndz7v0TVAx1ea45hJGWDe8l01n5GPn5iWO1YhCc9BJ/RAp6Z7TrpcLgIuxoVH1sNfIcHeNwfa6/9zdVappwMknkJsVz19HvFpgJSpO64PIN5G+fAp30Hc8TziHS4miFhheJbjLMMzHB8POFPqKGKWi6TXtSriJcT9MzH5bAzzHIK1I08t6hq6zHpRdu2aYdJYuk9Q/881bzZa8Xrx6fLmJo/iu4/VXnfH1BB/rmu5ScQvI77m+BkmfxXxvcZcJY14L0DymZp7pML5yTcW61PvIN6JuGr4halQvmjNlCa4bXJ5zj6qhpxrujeKPYMXEd+q00KR5yNAlWZzrF+Ie+uNsdC/MO4tTOZafhbroyXuR3Df08bLiHsQf+ja6gTPWVimZl7l/oUrjl8OcxDWLbNU5D6JRL2gxkDu16fGuC054OMhclsyXTOOFEL+kmMGs4i5kfNuQ62EnBuam8tzP+Q+tSqhz9SuqpZlvR1EfBiOJTSgYMMM7jpYsAEyqJCHDL4dcFFTAwNMlFDUUpQYiadhDmXteeWAw3HEmA2s15k1RmnP4RHuhBybdBOF7MfnICmSQ2SYjIBM3iRvkcMki9IRcnDTthyLz2Ld2fTzPjTQK+Mdg8y5nkZfFO+se9LQr3/09xZr+5GcaSufeAfAww60mAPx+q8u/bAr8rFCLrx7s+vqEkw8qb+p26n11Aruq6m1iJH6PbWGv1VIY25mkNE8PkaQhxfLIF7DZXx80HD/A3l2jLclYs061xNpWCfoB6WHJTjbH0mV35Q/lRXlC+W8cndbl9t2SfhU+Fb4UfhO+F74GWThknBZ+Em4InwjXIyd1ePnY/Psg3pb1TJNu15TMKWMtFt6ScpKL0ivSMXIn9QtDUlj0h7U7N48t3i8eC0GnMC91dX2sTivgloDTgUVeEGHLTizbf5Da9JLhkhh29QOs1luMcScmBXTIIt7xRFxSBxnuJWfuAd1I7jntkyd/pgKaIwVr3MgmDo2q8x6IdB5QH162mcX7ajtnHGN2bov71OU1+U0fqqoXLD0wX5ZM005UHmySz3qLtDqILDvIL+iH6jB9y2x83ok898GOPQX3lk3Itl0A+BrD6D7tUjWh3fis58BXDigN9yF8M5PJH4B8Gr79/F/XRm8m241mw/wvur4BGDj42bzn+Vmc+NL9L8GcMn8F1kAcXjEKMJAAAAACXBIWXMAAAsTAAALEwEAmpwYAAABbmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNC40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrlPw1BAAAd7klEQVR4nO19eZQV13nn797a3tr7yg5ikxCIHRohkACBEFqsJY4z8T52nPHYPp74JJ54bMfOsRMf2Z44OZ7EJ16iDLIsS5ZlydJY+2Ii1haiAQFCNGvTNHS/9/pt9Wq93/xRb+9u6OU1wif9O3Wq6223bv3qu7/vu9+9txqYwAQmMIEJTGACE5jABCbwnxTs/a4AHnjggY0bNwohxl4U5/xnP/tZe3v72Iv6g8fDDz9MlcOHP/zh9/uCAEB+vysA27YBkHAh7KK3aSRlMIDAFcZl13UrW73R4f2nNQvXYGYMjANUROkVyWXZvbBIDcLXOH4VHBGuGVoBgAMMYGAAERhAeekfyC8r+svA3n8nUYxrilYXxAFkScz6sKENlgHkfc5AYmSyMc64dmglEOW4pOyOUSlZxS9Y4RVjIHeEcjy+uGZoJYBErmlTdk/5V0NQxnLkUgXiswrimqEVAIkcTQU685+BioJsyikAkDXbCVqHABWslcpopcJfopIuTIFZMSECQ0GAWBGJA2j13mQspw8MeRumayJczeNaorVMW7MxVqkUgIEox6Yo7CdEYAhQji+UuKxyWgcFA0SWWbompODaoRUD7K40Hri8dJIgIVjRt99fXEu0FhNKpWabbfulYJTthjGAXLqW5PVapRUYwGyuj1AcGGTBQAJiQgQGotDFQkFkBwkGcpZbiAK8nqsgEsC10te6FmglAESCeZFAltPiMGvQSAtALhYAsrSSmLDWLIg8Wt0iQgdoa7nXKupm5TuvwgW5NEFrFp6kilyEVGAWGERSvT0rsWgwkEtZeZ2g1YNnX1llRIHNYlq9Dy6Tc4EgciHcPzwRuP/++9Pp9KuvvuoNk1QKRAQIKjBSrABFx9l2P2jvgIFcCAFyxyNunTVj2h/dt82nad/8zg+G+ZPh0ur3+7/70HdnXTdrz54927dvf+qpp7q7u0dbzxJkaaVSESjYbFHbz3NKJSksIOuySFTSZQX8/lvWrPjQg3dvWr92UktTV/eFH/30kYu9fcP57XBpXbOmbebMGURi1apVq1at+upX/9czTz+9/ZGf79q1a8yjciKrjCgKPEvcF8o7tRggBiRIuCQqE2DNnjXjvrs2P3jvHTfMn6sosmmayWSiqaF2w/q2X/zqt8MpYbi0Pvjgg4xzYaXgpIhrLY31f/aZP//EJz6+e/fu7du3P/3Ms5cuXRrlRQjynHhRp55KDgbpdJUIQDbf6hnsGKw1FAysu3nlnzxw94Z1bfX1dY5tO44BV6gwDVcmId+7dWMlaa2urr5j8+0kXLgW4yoTJukpwSQu+2+5Ze0t69Z9/aunnvnts9t//os9e/aO/MIIwi2JBMqZ9YS1zGXlDgRlIwHhQjijE4F5c2Y9eM8dH7hr8/Vzr+MSt03TTPerkutTuCSrINW2kpaptK1YNG3KpLNdV1a/YdG6fv26GTNnuJbByQWTwRQmSZKwyYoLMya4Nqml4bOf+++f/PhHd+7c9cijjz373O96+4alQQCIBIQrhFuqrQNsVgwwWO/TbEfLJRJCjEyOqsKhDevaPnT/tnVrVtbVVlu27ZhpmVl+iWRNYpIMcIDAFZU5KcdsrK3efNuan2z/1RVLHhatD95/Hxgn12CMgbw0vgBjjKuMXC4M0pOOLklycMNt6zZsuPXUyZO/efq3jz72RPv+t69culegtxXKH0DrQB3wDgi5/quLgt+7AhbMn/PgvVvu2bpp7uyZnDPbNKx0ROW2ooBzCVwCGIQAIxCBQ1EVltZdV7l787qfPvLkFVvklWltbGzccNt6YWUYOeBK9pqLXQqXGeOycMiOuWZEcN/USY3/44uf+/QnP/YfO3c98ugvf/fiy9FobKjyCUTCpWy/s6jkkoNSqS3skR0vIEFCkHAvf7011VWb1q/54/vvXLt6WU11tW2ZrpngyAS5KyscXAI4iCBcMMpOWgBBEJd9CqKm6Vu2aP6cWdOOd54ZK60bb1s/eXKrldEVr7kVsZGj2LMRxrgqMUcSGaEnbV1SpNDmjetu33jric7Op37z7GNP/Lrj0DuD8SqyXU+IrHqW8VvSNSjrdCH7KYmsvA4RCSxaMO/Be7bcs3XDdTOnc8ZsM+2kuzVmKpwYl8A4gKx5gmXbfvYAAIFLqkyGaVZXBbfc2lYBWh+47wMggrCYoiBvU0DBlLIXKbLHTOIS4+SQExHxXof5Zk5p/PKXPv+ZT33s9zvefPTxJ198+fX+eKLAKuWttcxlDTDYEmXIcQoAjMj1rLXMZdXX1tx+25oPfmDrmpVLqsJh28oIIyKTHuK2JDEwzzxF1iVmzbOYU++MHIIpisYyumPL226/+V8efsK5bFh5BVqnTpmybm2bbegcAkzKznIgKr0wkXtHZAc/iAAwLktMSCIjMklHl/xSeNuWW7du3nj8vfd+/fRzv3zymSPHjgPw4k0ityhuHZTZPK2D9LgYuQRBJNyc11qy6Po/uueOu7asnzl9GgM5ZkKkzviZoXABzzwJIBdMADyXEfemKnnH3mwwBpY9KVc0hSVM01w0f9YN82YdPPLe6GndvOm2pqYGQ0+qipQjseiCy7qSVEqHRzTjXFI4OYrb5yZ6BfPNmd70lb/8/H/79Eff2LHz4UceD/h9wnUgRDmVA5kt7hqIXMo1a7ACwhWO01BX88cf2PpfHty2avnicDDgWDrpFxSk/MzmHGBSzr95I7gsSxwxMAbGQBxEYLl9Yd4CgUk+hWUyZtAf2Lph9eVpvdyMMMbYs089dsfmjbaR0nwhICthOZPMbdmXOUdMBLjZg8KnORUWthC2Q7LLw5K/1rJhGBlVVbmTCIme3J27jPvK39ocoV7YKpwENTtyfSaTqQqHOBPCjMsirrGMxAisaNJc9oCVHGT3vGjPAF7yDpfITvdG01wJH363c+uffskwraGou5y1zr5u1uoVSy0jI3MGzpF3CESFrcRsaWhNyHk2xjlXVHIh+pxkrwyfxqtclzMigmBe4UPSivLj3I6RICJBIqQJnjmnIqkwh/Gcz/ES5IUpiGzAxnPdNZ4z5LywMoDAOASYrGk8plvW/FlTFi+YvXv/kdHQeueWjbU11YaelNRAzsGW+qtyTUCRBytuy6LoHuQsl0myRDLpqptwhOxCAs9rqyj9eZk4oLQO3idCdmM+iqtM53nz9NpNfg4s5ayVsQK/xLPBMssJQj6uyjLLCxVgkk9T0knDFwjcuWHVaGiVJeneu7Y4tsVATFJzjRrZRsGkrBV4zV84gAPk55rJhebPvD6lneUUZVwzzmWVuSCzkJwelNlifoGi9gGAGEOIp4rUMN8pYIWDPJtULAI5YSWWlVTPeIlyFFPhJUHVfFKy3zLljWsWPxTwp/TMyGi94fp5S2+60TIzmqqAK1lCyYGdgHEJ+jlkeqB3I9MFMwonBWHBixaYDK5BqYIShlYPtR5qPbQGyAFwDRAQTqny5oKY7LG4HLNsqN6Bd0fzg4zFhKJgsN5Bll9WOChQyQr+iigXJOReCmKy6pPchG3Omtq84qZ5r+06MDJa7966KRTwZwxD0kIw+hB/B5G30H8QyfeQPgs7CVE6U7d4CmUxOMBlKGH4WhCYjPBchGbBPwVKFZgMYQFOSc+isC8S2WJmB0lxFZ14YAWGVFWAeM6JFcWqlJvmhXw8kL/xAJP9fiWRMWUlsO225SOjVVXVbXdstB3B4wfZwR8jfgiZbm9MpETlhwlyYMZgxNB/FHgZnEFrRGg2ahai5kb4WsEVCCvX0Sp2WZcV2QKzrNxy84QWuGalNpu3guIDzzsxEM/63oIs5E4toGh+hfWZlrxu5Q211aFYPDVcWpfedOON82dbtu07sx3nXoAMMEAaNo8DwQrXCBCMS8hcQu9OyBpCs1G/HLVL4WsGOMgqUl5RwmNJQrbIa5U4MZQ2HFa6L9PWHJvFzT8byeZdmWe2yPcLmKT6VYrp1pTm2jVL5z/32iDLwAan6rOf+si6taudZLev8/uM9MtGt6NC3mLIRaYXsQ707kD6JJgMrR5czWW1Sw22oLmicFDwhKUDt1lac28ylN+M4o0V3R42YI+8TXg/55ysVNqQZcVx3f/3+lsDr28Qaw0GA1s23mLarhTbzY3eETT20cEr30mjdw/69iA0E03rUbccchCuVS61JRRjQGCAIXWgzGAHD12pYLnFCpv3ltnvQPUFVClhWmbb4tnNDTUX+/rLrmkQa13btvxzn/pTx3H8p34o6acrb6qDIn91Vj+iB9D/NiDga4akFSVSS0W2kJbNezYxiCWiKH4o2CYKRoqylyh6M49SlyjJZCXTGVETDhzpPH/kRFfZ1Qxiivdu3SjLEqwos/rAclW9avDsJnMBpx7Fse8hsjuX3i7rK3sKkGfcBTyP5w6yCe99J7sXInec/0L+uLgXXlaOyKVmBFxTljiERcLdesvCgYvCyq21vq7277/2xYBPcUmyGjba1ctJDjA3ye1EiQ8Yb3iWaycQexv6afiaoNYOYrPFCuvZLyu24sGkEwXnM0iSM29BeYvOvvT8mG0Z6VS8Pxrpj6dcIsZITGqpf+a1t+NJvbj65dpaU1PTr4sWpgb8ZJrMrl5pVa9mdkxJHVajv1fi+ySjuxCNjDe8U/QfReokmtajcT0kDcIq19ZiOkRx+82FBPluqxdpZV96LTUfsRYrbD4lyMEIwrIsR8/YaUOYFhPEOGc+nyakQHfMfvPAKcMub86DcOMPBJctWXzX1k0bb1k5e3qzyoVlmrZgIMacmJI8rMb+Q020S2bP1eMXgABC0zH5bgSmQtil6RgM5rtQFJaiaPVmPmWFLI8exWVJLAYIsmxHN9y0CdOWXMEkiWmaRrK/O+buPnT2+df37W7viEUHGQy9HCWBYGjZ0sXbNm/YtG7ldVMbFeaYpukIBjBmx+TUEV//m2qyXTIvXSV+CZA0tNyO+lUA5TJqZfkt76v5lFXRz7MdqhyhJblBno1bGSCEabm6ibTJTVcWgnHONE2D7L8QFzs7zjz/RvvetzqikcsNLQ+LiVAovHz50js337rx5uUzJ9fJcEzTyPOrpo9o8Z1a8m3J6h13fj2aapegdQskX26tvCgIAkoNtpjZgoWiQKuXnQFBkGmLtMl1SzZdxSUmsSybPQnadfDM82+8tbu9IxrpHU41R0ZAuKp6xfKl225ff9vNS6a31Mhk5+2X21FFP+KL79bSHZLVN778CiA4FVPugVoHYZcSStkeUZmdUqm1slyClYRpU9qS05ZquqogLnFoqgol0JOgXYfOvfBG++72jkjfsNgsPuFoUFVds3LF0m2333rr6oXTmqs4WZZh2h6/TlRNH/Un92rpg5IdGdt5hgYBai0m3w3/lFzWsTgILRNZrw4sqwwgEmTZSFtK2tZMVxPEOSefpkEO9CRo9+FzL/x+/659HZG+Uc6AGuvlVtfUrlq5bNumdetWLpjaFOaukbNfcCem6cd8qX0+/bBkRytxtlIQIPsx6S6EZmXDg9IkbHZNYtZIyWPTdFjaUnXbbwgtZ5sKU4IXE9j9zrnn39i/u72jr3e088lyqNiF1tTWrV65bNumW25ZccOUBj9cwzQMhyQQSU5Myxzzp9p9maOSE6vkaT0n1roFoTmlNlv8DUFCmLaUtrW07TeFTxCXGGmaytTgxQT2HDn//Bv7d+07MHY286i8+NXW1betXHbnprVrl82bXOeHq5uG6RAHSLKjmvFuIH3AZxyR3HhlzkcAV9C6BaHZEFbuLQJAwjVsnra1tBOwXJ8LLjFomsKU4KUk9h7pfmHH2zv3Hui9dLEyNSnCOMZEdfUNa1Yvv3PjzTcvnt1aq1qZpG074DKE3dLzkM94r6I2q6J1CwLTiz2YcO2uRH1a1HLmSpxrgareFPYevfDCjgM79x64dLGnQqcfBFcjlG9oaFq9atmXPrF1drNmu7y2/8ma+PPjo7NboTVCONm3GExTnE22giu9Kf7dR/fs2nfgYs+Fip54cIx31g8A+vouvXfkQLWccYgH0vuqEy+NSwLXyaDnFVj9YJRPoGiq0+S7IFwnLOvxC+9eHU4xtoz/cFFbFfzJ331mxtRWlulqivxUEplxaSQMcE1YUQSn5YYLCUQ+2XZs02Hhm2+asWP/yUhcv3JRY8a408oY+9YXP7ipbaFppJqjD2t29zgKDwPsFIQF/6RszhAEICDrKZ35/eEFsxqf33ncssd90fG40/qRe9d+/sO3G5Zbl3gmnNk/7mLOACsCOQC1Nve4IcE480vpaEqZ3FRXHVJff+vUOFdinGldcv2M7//Vh7ikBvX2huSzjF2tfLjRC18zJBVwvTFwWRYK9IjuWzS7uTemHz5ZsRB1UIwjrXXVwX/+2kcmN9dzs6s18XNO5vidqxzChZNCYFJhDJHIp9iObacs36oFre3HLlzoG2QgulIYL1o5Y9/6wn23rZxvGqnW5KOqc+kqpWU9MMBOg6vQaiGc7AgCQ1DNJHXGJf+S2Y0vt59OG5VcDlmM8aL1o/e0ffZD6zOW25j+Xdg8dFU59cAAKw5/E7iUHxtnHAFFj6TkxprQpMbgK+1nhRgXXRoXWpfdMP2hv7iPMTlk7G/KvPg+cOpBuCAbvgbAzU/LlWWhwuhLaXOn1tiOaD82LiJbeVrra0I//OsPtjTUSGbXJP1JjiHn1g4fBObCx71JicOHJwVqFSStMEWDyKfZruP069ryufXHz/Wf7kmOvYZlqDCtnLNvf+6utUuvs8zU5MyTmohc+TfDQIJd183XVtNJjhGGnEQQJnz12bHu7KA3hTQjlWGuUJfNrdtxsKc/VYF7X4wK0/qxu1f+2QOrM6bbYr4Udt6tSJk2AmfZBh2NAAujfKLDFcAA14AczAVb3ui3YJyCqh5JKOGgOnty+OX9F2ynkg8oqyStyxdM/fvP30lMqrY7mqw3KlXsebQl0crI1NHoR9THRphRJIAs+Gqy8oqcyCpC40ZvXJveHPCr0puHRzascnlUjNaGmuA//dU9TXXVitU9xXp2xDo4BGI0s4dukmVFVv2upaepqYadldhIAiMGuBYUPyRvAVQu3iLh1yzhuNGUsmhWuCdqvNtVMZGtDK0SZ9/+7Ja2hdMcMznV+q1K5VO9RgcLwTNiraJoz3ck955yls/UdJMsBGt5F8NIAiMCIKAGQE7OYL2NQj4jpTPDkpbPDe873t8br4zIVobWT9y97JP3LDFMp9V5vYoq1eNmZ90VGTREDPVLP3jx1Z2Hbm5b0RpIJu2QDCvEoyMpCRA2VB84gRzABhwv6mJMhLRMJKFqsnTjjMArB6KGVQGRrQCtqxZM+daf3yZIqnEONou9Yy/QQ8Sd2ePMUzXtO788tq/juOvYh08n7ly3ULEjSVEX5n0qN0ZQHBE4QeagHKdwAAfkyIrjk81Lca2lRmmslt84FB84aDtSjJXWxtrgD/5iS311UHW6p4lXRhwADQGTQqesFYqqvPKO+Y+PvE4kAPT1RVJUs2Fxo5nRdVFdJ1/gbNiWxQC4UBhgAhZgASZgAzbI8fsM4VJfUp0/WdNN9+DpseZkx0SrJPFvf+bWlTe0OlZqOr2soTKST2Cn7SWGqIrZvr/84Y54vOD63zl+dsacBTe0WClDEiTVKMN9GAQACIJsg9s5g/U2G8wCOeFAOq3L6Yy89DrtaFemKzKmdMGYBl0+vm3hllXTM4bZSrsDGMkVXha99rSY1aCoyv95uvPc+ZJhEhLOd37y4ul0k8rNi2ZzxGoaQc+YADu3uqx4E4AQnNmzWroVnpK58+X7aifVjekJYaO31tU3TvrGJ9oEsTpxpIV1jKUSxciI0CljoSrLb7wn/uHnO2jAv9DJ6OnOXtq6ZiYykYRTXadEZD68YM67AXLpxKwiyIrwK+bFqFwToBmN/LXDpjta7zVKWptrg//7C+trw37N7ZkuvclRmS4KgZ/M3GC4wYQT/PKP9sX6B4/8z3f3SOFpa+aqum4YQmvwRYdrsjQ0rQQQ/D4HwrnUL2Y2urIk9p4Y5XWNhlZZ4t/6dNuyeQ2ulZol7VBZhQbdGHrMKT3GJJ9P/YdnL7751rHLfLfj3a6FixbPDEcSpswhqrT0cM/C8wsrSk6dR1XQSet2Im0vnCbOR9E5qrkZo9HWj985f9Oy1kzGnCy95WeVifwBpJ3QeX2KT3Z3nMCTLw6+Oi8P28x8+2c7+9gMmTLnUnVxMzBckXUGW7UhChtjmDtFaDKRiy9sYXNaRnMtI7bWpddP/btPLXcsUxAx2CEek1gF+qkC/ERytumqKVH11z85FIld+W4lEvGLRvj2pXVWui9l+xr8aWk4Y2UMkIdeZMIAwsUI+uLMcRFWae7U0IsdrjvCbPeIrTWq4534ZH+4hgkjYk9512hLuA0jLaQcDN16c9wMaKr845d6T545P8zfvfjavicO+INBLWWIU7HwsAw299C9QWyWwbJw5CSOnWa2RTKRG75+b3SRSyNmacTW2h9PPPf7w0r93KXzW5lx0XDkqNMCICTHR9ZPz4MhaQVPJqZqktjdFfrez9tH8pQw6jjeu2rFTc3y6f4MfLIb0obhZNhgXoujP4nDJ1kkwRmRX9N6fau/+ZT79ItvjfSpZRidy3Jsa+e+g8f7fCuWLq6VopZlxp26tBsKyYnhxjpFcIkf759qOUxntV95+L2+yJBPzBoUlmUcvcC2tE3imZP9GdQHSLlixMkHLIslnL2Io6eZYUEiClQ37+xf/pV/e+/YuydGejkeRh+3njp99qW3umdcv2JOM3P0vrQTiNl1Gjf88uBPLhgcDOcS9Zf0kN+n/vOr9ut7j4+iJn19EV2etm6+m0kldIs1hYfxT8nywQCHaeHoaZy5yEmQwsFqb/zZ/inff2RvMj6SbE4pxtR5TSbiz+84bIfmLF8wVTZ7TIeiVp0jpLCS5nxY3iNu+Dr76zXJab9Q/71fHBLuKL3fkc7emfOWzavp6U/ZnKE2dKWVj7k1WdF+HOpk0QTjRH6fv0dr+8avjedebSd3TJ3XsaZaSDhvdRw90MWXLl3WpMYsI5mwwgk7EFJ0VboCR47g70ZqLUeYvP6rj1y41Dey5l9aD/dAp75+9Y1V7tlomlX74fddllkJRDjTjSNnmGlBAgVqWndEl3714WMnOk+OvhqF4iuB890XXth7rmX2iuunqK7ek3HkSCascCekmkN6Z4bTsWBvSgoElH/dob2yp3OMdcjo6dPx6s3L6p1UbyLDmqsgDXVxHIaNd07iTA8jQSpnVLfox+0t//iLPelkZcLwig26ZPT0SzuP9MszVy6aqVldluVEjYDh8CrNlAYKAkNMlzojiipnDvRO/u5jJ12nAhNMzl/oleuuXzU1nUzoloOmmsG+xHEphoOdLJZgnCjgD5z3tf3Nr1Mv7dhPojIDRajwyCuJw0dP7OmkhUtWTQpGLD2SsNRYRgkqtk8pinsYbAdHLjLbMS25+euPGT2XRu8cynD4RN/Cm5ZNVbqiCfKpqCoWWQZBONHFjp1llg0Z5K+d/Fp0ydf+/cjp06crVQEPlZ9+0dvb+7td56qmrVw0Q6X0qYzt9qXBmQj7Csv4Tvay3hQF/P5/293y0q5KTot0Xftwl7tx1Vw10xVNsoYqaJq3bAO6gYOd7HwfANIkJuoX/6i98YeP7zbSiSsWO1KMy2Qh28rs2HOsy565csnsoHPaMs1omqUtVPkgK+hLoLOXaRIO9c9+6JdnnUo0/2Ik4vE+0brhBl8mEUtnWEs9uISLEXScYHEdEigYCp1V277+ZPy1nW+P07+FG7+JmPRe55nfH8W8m9ZPr07YeiJlskiKSRyne5ltk6O2fuMJ58LFykx7KcPJsxfrpy++qSHSnzCFYLEEjp5ljoDCyF8/7YWLi/7m3w+eO3duPE7tYXynDff3x17YdU5qWr1kTg1Lnzcs9CWY7SDg9/3f/a0v7By/WdHU0RlbvWJJI85GkoimGAP5ZG7XLf2nndU//tVu0xjHya24CpPcXcfae+D48cSU5cuWVotuy7RUiR1NXvfQ4+ccp8Izn4phW8a7vcqWldOYfoERgqGqTrnta4/3vrn3ICqUdL8MrsZKFwBnz51/9VBm+oL1cxuMjKt+8zfifE/Fxr6GQl8kmvHNXD9HSP7a57pv/NvtHd3dw82N/SGBy75P/cmW//rA6qv1xAwwSf2fn77z3ttXXBP/FGiccTXW2L1/p5vABCYwgQlMYAL/2fH/AdkCEQl+/Ar/AAAAAElFTkSuQmCCCg==', | 87 | icon: 'data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAByCAIAAAAAvxIqAAAD8GlDQ1BJQ0MgUHJvZmlsZQAAKJGNVd1v21QUP4lvXKQWP6Cxjg4Vi69VU1u5GxqtxgZJk6XpQhq5zdgqpMl1bhpT1za2021Vn/YCbwz4A4CyBx6QeEIaDMT2su0BtElTQRXVJKQ9dNpAaJP2gqpwrq9Tu13GuJGvfznndz7v0TVAx1ea45hJGWDe8l01n5GPn5iWO1YhCc9BJ/RAp6Z7TrpcLgIuxoVH1sNfIcHeNwfa6/9zdVappwMknkJsVz19HvFpgJSpO64PIN5G+fAp30Hc8TziHS4miFhheJbjLMMzHB8POFPqKGKWi6TXtSriJcT9MzH5bAzzHIK1I08t6hq6zHpRdu2aYdJYuk9Q/881bzZa8Xrx6fLmJo/iu4/VXnfH1BB/rmu5ScQvI77m+BkmfxXxvcZcJY14L0DymZp7pML5yTcW61PvIN6JuGr4halQvmjNlCa4bXJ5zj6qhpxrujeKPYMXEd+q00KR5yNAlWZzrF+Ie+uNsdC/MO4tTOZafhbroyXuR3Df08bLiHsQf+ja6gTPWVimZl7l/oUrjl8OcxDWLbNU5D6JRL2gxkDu16fGuC054OMhclsyXTOOFEL+kmMGs4i5kfNuQ62EnBuam8tzP+Q+tSqhz9SuqpZlvR1EfBiOJTSgYMMM7jpYsAEyqJCHDL4dcFFTAwNMlFDUUpQYiadhDmXteeWAw3HEmA2s15k1RmnP4RHuhBybdBOF7MfnICmSQ2SYjIBM3iRvkcMki9IRcnDTthyLz2Ld2fTzPjTQK+Mdg8y5nkZfFO+se9LQr3/09xZr+5GcaSufeAfAww60mAPx+q8u/bAr8rFCLrx7s+vqEkw8qb+p26n11Aruq6m1iJH6PbWGv1VIY25mkNE8PkaQhxfLIF7DZXx80HD/A3l2jLclYs061xNpWCfoB6WHJTjbH0mV35Q/lRXlC+W8cndbl9t2SfhU+Fb4UfhO+F74GWThknBZ+Em4InwjXIyd1ePnY/Psg3pb1TJNu15TMKWMtFt6ScpKL0ivSMXIn9QtDUlj0h7U7N48t3i8eC0GnMC91dX2sTivgloDTgUVeEGHLTizbf5Da9JLhkhh29QOs1luMcScmBXTIIt7xRFxSBxnuJWfuAd1I7jntkyd/pgKaIwVr3MgmDo2q8x6IdB5QH162mcX7ajtnHGN2bov71OU1+U0fqqoXLD0wX5ZM005UHmySz3qLtDqILDvIL+iH6jB9y2x83ok898GOPQX3lk3Itl0A+BrD6D7tUjWh3fis58BXDigN9yF8M5PJH4B8Gr79/F/XRm8m241mw/wvur4BGDj42bzn+Vmc+NL9L8GcMn8F1kAcXjEKMJAAAAACXBIWXMAAAsTAAALEwEAmpwYAAABbmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNC40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iPgogICAgICAgICA8ZGM6c3ViamVjdD4KICAgICAgICAgICAgPHJkZjpCYWcvPgogICAgICAgICA8L2RjOnN1YmplY3Q+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgrlPw1BAAAd7klEQVR4nO19eZQV13nn797a3tr7yg5ikxCIHRohkACBEFqsJY4z8T52nPHYPp74JJ54bMfOsRMf2Z44OZ7EJ16iDLIsS5ZlydJY+2Ii1haiAQFCNGvTNHS/9/pt9Wq93/xRb+9u6OU1wif9O3Wq6223bv3qu7/vu9+9txqYwAQmMIEJTGACE5jABCbwnxTs/a4AHnjggY0bNwohxl4U5/xnP/tZe3v72Iv6g8fDDz9MlcOHP/zh9/uCAEB+vysA27YBkHAh7KK3aSRlMIDAFcZl13UrW73R4f2nNQvXYGYMjANUROkVyWXZvbBIDcLXOH4VHBGuGVoBgAMMYGAAERhAeekfyC8r+svA3n8nUYxrilYXxAFkScz6sKENlgHkfc5AYmSyMc64dmglEOW4pOyOUSlZxS9Y4RVjIHeEcjy+uGZoJYBErmlTdk/5V0NQxnLkUgXiswrimqEVAIkcTQU685+BioJsyikAkDXbCVqHABWslcpopcJfopIuTIFZMSECQ0GAWBGJA2j13mQspw8MeRumayJczeNaorVMW7MxVqkUgIEox6Yo7CdEYAhQji+UuKxyWgcFA0SWWbompODaoRUD7K40Hri8dJIgIVjRt99fXEu0FhNKpWabbfulYJTthjGAXLqW5PVapRUYwGyuj1AcGGTBQAJiQgQGotDFQkFkBwkGcpZbiAK8nqsgEsC10te6FmglAESCeZFAltPiMGvQSAtALhYAsrSSmLDWLIg8Wt0iQgdoa7nXKupm5TuvwgW5NEFrFp6kilyEVGAWGERSvT0rsWgwkEtZeZ2g1YNnX1llRIHNYlq9Dy6Tc4EgciHcPzwRuP/++9Pp9KuvvuoNk1QKRAQIKjBSrABFx9l2P2jvgIFcCAFyxyNunTVj2h/dt82nad/8zg+G+ZPh0ur3+7/70HdnXTdrz54927dvf+qpp7q7u0dbzxJkaaVSESjYbFHbz3NKJSksIOuySFTSZQX8/lvWrPjQg3dvWr92UktTV/eFH/30kYu9fcP57XBpXbOmbebMGURi1apVq1at+upX/9czTz+9/ZGf79q1a8yjciKrjCgKPEvcF8o7tRggBiRIuCQqE2DNnjXjvrs2P3jvHTfMn6sosmmayWSiqaF2w/q2X/zqt8MpYbi0Pvjgg4xzYaXgpIhrLY31f/aZP//EJz6+e/fu7du3P/3Ms5cuXRrlRQjynHhRp55KDgbpdJUIQDbf6hnsGKw1FAysu3nlnzxw94Z1bfX1dY5tO44BV6gwDVcmId+7dWMlaa2urr5j8+0kXLgW4yoTJukpwSQu+2+5Ze0t69Z9/aunnvnts9t//os9e/aO/MIIwi2JBMqZ9YS1zGXlDgRlIwHhQjijE4F5c2Y9eM8dH7hr8/Vzr+MSt03TTPerkutTuCSrINW2kpaptK1YNG3KpLNdV1a/YdG6fv26GTNnuJbByQWTwRQmSZKwyYoLMya4Nqml4bOf+++f/PhHd+7c9cijjz373O96+4alQQCIBIQrhFuqrQNsVgwwWO/TbEfLJRJCjEyOqsKhDevaPnT/tnVrVtbVVlu27ZhpmVl+iWRNYpIMcIDAFZU5KcdsrK3efNuan2z/1RVLHhatD95/Hxgn12CMgbw0vgBjjKuMXC4M0pOOLklycMNt6zZsuPXUyZO/efq3jz72RPv+t69culegtxXKH0DrQB3wDgi5/quLgt+7AhbMn/PgvVvu2bpp7uyZnDPbNKx0ROW2ooBzCVwCGIQAIxCBQ1EVltZdV7l787qfPvLkFVvklWltbGzccNt6YWUYOeBK9pqLXQqXGeOycMiOuWZEcN/USY3/44uf+/QnP/YfO3c98ugvf/fiy9FobKjyCUTCpWy/s6jkkoNSqS3skR0vIEFCkHAvf7011VWb1q/54/vvXLt6WU11tW2ZrpngyAS5KyscXAI4iCBcMMpOWgBBEJd9CqKm6Vu2aP6cWdOOd54ZK60bb1s/eXKrldEVr7kVsZGj2LMRxrgqMUcSGaEnbV1SpNDmjetu33jric7Op37z7GNP/Lrj0DuD8SqyXU+IrHqW8VvSNSjrdCH7KYmsvA4RCSxaMO/Be7bcs3XDdTOnc8ZsM+2kuzVmKpwYl8A4gKx5gmXbfvYAAIFLqkyGaVZXBbfc2lYBWh+47wMggrCYoiBvU0DBlLIXKbLHTOIS4+SQExHxXof5Zk5p/PKXPv+ZT33s9zvefPTxJ198+fX+eKLAKuWttcxlDTDYEmXIcQoAjMj1rLXMZdXX1tx+25oPfmDrmpVLqsJh28oIIyKTHuK2JDEwzzxF1iVmzbOYU++MHIIpisYyumPL226/+V8efsK5bFh5BVqnTpmybm2bbegcAkzKznIgKr0wkXtHZAc/iAAwLktMSCIjMklHl/xSeNuWW7du3nj8vfd+/fRzv3zymSPHjgPw4k0ityhuHZTZPK2D9LgYuQRBJNyc11qy6Po/uueOu7asnzl9GgM5ZkKkzviZoXABzzwJIBdMADyXEfemKnnH3mwwBpY9KVc0hSVM01w0f9YN82YdPPLe6GndvOm2pqYGQ0+qipQjseiCy7qSVEqHRzTjXFI4OYrb5yZ6BfPNmd70lb/8/H/79Eff2LHz4UceD/h9wnUgRDmVA5kt7hqIXMo1a7ACwhWO01BX88cf2PpfHty2avnicDDgWDrpFxSk/MzmHGBSzr95I7gsSxwxMAbGQBxEYLl9Yd4CgUk+hWUyZtAf2Lph9eVpvdyMMMbYs089dsfmjbaR0nwhICthOZPMbdmXOUdMBLjZg8KnORUWthC2Q7LLw5K/1rJhGBlVVbmTCIme3J27jPvK39ocoV7YKpwENTtyfSaTqQqHOBPCjMsirrGMxAisaNJc9oCVHGT3vGjPAF7yDpfITvdG01wJH363c+uffskwraGou5y1zr5u1uoVSy0jI3MGzpF3CESFrcRsaWhNyHk2xjlXVHIh+pxkrwyfxqtclzMigmBe4UPSivLj3I6RICJBIqQJnjmnIqkwh/Gcz/ES5IUpiGzAxnPdNZ4z5LywMoDAOASYrGk8plvW/FlTFi+YvXv/kdHQeueWjbU11YaelNRAzsGW+qtyTUCRBytuy6LoHuQsl0myRDLpqptwhOxCAs9rqyj9eZk4oLQO3idCdmM+iqtM53nz9NpNfg4s5ayVsQK/xLPBMssJQj6uyjLLCxVgkk9T0knDFwjcuWHVaGiVJeneu7Y4tsVATFJzjRrZRsGkrBV4zV84gAPk55rJhebPvD6lneUUZVwzzmWVuSCzkJwelNlifoGi9gGAGEOIp4rUMN8pYIWDPJtULAI5YSWWlVTPeIlyFFPhJUHVfFKy3zLljWsWPxTwp/TMyGi94fp5S2+60TIzmqqAK1lCyYGdgHEJ+jlkeqB3I9MFMwonBWHBixaYDK5BqYIShlYPtR5qPbQGyAFwDRAQTqny5oKY7LG4HLNsqN6Bd0fzg4zFhKJgsN5Bll9WOChQyQr+iigXJOReCmKy6pPchG3Omtq84qZ5r+06MDJa7966KRTwZwxD0kIw+hB/B5G30H8QyfeQPgs7CVE6U7d4CmUxOMBlKGH4WhCYjPBchGbBPwVKFZgMYQFOSc+isC8S2WJmB0lxFZ14YAWGVFWAeM6JFcWqlJvmhXw8kL/xAJP9fiWRMWUlsO225SOjVVXVbXdstB3B4wfZwR8jfgiZbm9MpETlhwlyYMZgxNB/FHgZnEFrRGg2ahai5kb4WsEVCCvX0Sp2WZcV2QKzrNxy84QWuGalNpu3guIDzzsxEM/63oIs5E4toGh+hfWZlrxu5Q211aFYPDVcWpfedOON82dbtu07sx3nXoAMMEAaNo8DwQrXCBCMS8hcQu9OyBpCs1G/HLVL4WsGOMgqUl5RwmNJQrbIa5U4MZQ2HFa6L9PWHJvFzT8byeZdmWe2yPcLmKT6VYrp1pTm2jVL5z/32iDLwAan6rOf+si6taudZLev8/uM9MtGt6NC3mLIRaYXsQ707kD6JJgMrR5czWW1Sw22oLmicFDwhKUDt1lac28ylN+M4o0V3R42YI+8TXg/55ysVNqQZcVx3f/3+lsDr28Qaw0GA1s23mLarhTbzY3eETT20cEr30mjdw/69iA0E03rUbccchCuVS61JRRjQGCAIXWgzGAHD12pYLnFCpv3ltnvQPUFVClhWmbb4tnNDTUX+/rLrmkQa13btvxzn/pTx3H8p34o6acrb6qDIn91Vj+iB9D/NiDga4akFSVSS0W2kJbNezYxiCWiKH4o2CYKRoqylyh6M49SlyjJZCXTGVETDhzpPH/kRFfZ1Qxiivdu3SjLEqwos/rAclW9avDsJnMBpx7Fse8hsjuX3i7rK3sKkGfcBTyP5w6yCe99J7sXInec/0L+uLgXXlaOyKVmBFxTljiERcLdesvCgYvCyq21vq7277/2xYBPcUmyGjba1ctJDjA3ye1EiQ8Yb3iWaycQexv6afiaoNYOYrPFCuvZLyu24sGkEwXnM0iSM29BeYvOvvT8mG0Z6VS8Pxrpj6dcIsZITGqpf+a1t+NJvbj65dpaU1PTr4sWpgb8ZJrMrl5pVa9mdkxJHVajv1fi+ySjuxCNjDe8U/QfReokmtajcT0kDcIq19ZiOkRx+82FBPluqxdpZV96LTUfsRYrbD4lyMEIwrIsR8/YaUOYFhPEOGc+nyakQHfMfvPAKcMub86DcOMPBJctWXzX1k0bb1k5e3qzyoVlmrZgIMacmJI8rMb+Q020S2bP1eMXgABC0zH5bgSmQtil6RgM5rtQFJaiaPVmPmWFLI8exWVJLAYIsmxHN9y0CdOWXMEkiWmaRrK/O+buPnT2+df37W7viEUHGQy9HCWBYGjZ0sXbNm/YtG7ldVMbFeaYpukIBjBmx+TUEV//m2qyXTIvXSV+CZA0tNyO+lUA5TJqZfkt76v5lFXRz7MdqhyhJblBno1bGSCEabm6ibTJTVcWgnHONE2D7L8QFzs7zjz/RvvetzqikcsNLQ+LiVAovHz50js337rx5uUzJ9fJcEzTyPOrpo9o8Z1a8m3J6h13fj2aapegdQskX26tvCgIAkoNtpjZgoWiQKuXnQFBkGmLtMl1SzZdxSUmsSybPQnadfDM82+8tbu9IxrpHU41R0ZAuKp6xfKl225ff9vNS6a31Mhk5+2X21FFP+KL79bSHZLVN778CiA4FVPugVoHYZcSStkeUZmdUqm1slyClYRpU9qS05ZquqogLnFoqgol0JOgXYfOvfBG++72jkjfsNgsPuFoUFVds3LF0m2333rr6oXTmqs4WZZh2h6/TlRNH/Un92rpg5IdGdt5hgYBai0m3w3/lFzWsTgILRNZrw4sqwwgEmTZSFtK2tZMVxPEOSefpkEO9CRo9+FzL/x+/659HZG+Uc6AGuvlVtfUrlq5bNumdetWLpjaFOaukbNfcCem6cd8qX0+/bBkRytxtlIQIPsx6S6EZmXDg9IkbHZNYtZIyWPTdFjaUnXbbwgtZ5sKU4IXE9j9zrnn39i/u72jr3e088lyqNiF1tTWrV65bNumW25ZccOUBj9cwzQMhyQQSU5Myxzzp9p9maOSE6vkaT0n1roFoTmlNlv8DUFCmLaUtrW07TeFTxCXGGmaytTgxQT2HDn//Bv7d+07MHY286i8+NXW1betXHbnprVrl82bXOeHq5uG6RAHSLKjmvFuIH3AZxyR3HhlzkcAV9C6BaHZEFbuLQJAwjVsnra1tBOwXJ8LLjFomsKU4KUk9h7pfmHH2zv3Hui9dLEyNSnCOMZEdfUNa1Yvv3PjzTcvnt1aq1qZpG074DKE3dLzkM94r6I2q6J1CwLTiz2YcO2uRH1a1HLmSpxrgareFPYevfDCjgM79x64dLGnQqcfBFcjlG9oaFq9atmXPrF1drNmu7y2/8ma+PPjo7NboTVCONm3GExTnE22giu9Kf7dR/fs2nfgYs+Fip54cIx31g8A+vouvXfkQLWccYgH0vuqEy+NSwLXyaDnFVj9YJRPoGiq0+S7IFwnLOvxC+9eHU4xtoz/cFFbFfzJ331mxtRWlulqivxUEplxaSQMcE1YUQSn5YYLCUQ+2XZs02Hhm2+asWP/yUhcv3JRY8a408oY+9YXP7ipbaFppJqjD2t29zgKDwPsFIQF/6RszhAEICDrKZ35/eEFsxqf33ncssd90fG40/qRe9d+/sO3G5Zbl3gmnNk/7mLOACsCOQC1Nve4IcE480vpaEqZ3FRXHVJff+vUOFdinGldcv2M7//Vh7ikBvX2huSzjF2tfLjRC18zJBVwvTFwWRYK9IjuWzS7uTemHz5ZsRB1UIwjrXXVwX/+2kcmN9dzs6s18XNO5vidqxzChZNCYFJhDJHIp9iObacs36oFre3HLlzoG2QgulIYL1o5Y9/6wn23rZxvGqnW5KOqc+kqpWU9MMBOg6vQaiGc7AgCQ1DNJHXGJf+S2Y0vt59OG5VcDlmM8aL1o/e0ffZD6zOW25j+Xdg8dFU59cAAKw5/E7iUHxtnHAFFj6TkxprQpMbgK+1nhRgXXRoXWpfdMP2hv7iPMTlk7G/KvPg+cOpBuCAbvgbAzU/LlWWhwuhLaXOn1tiOaD82LiJbeVrra0I//OsPtjTUSGbXJP1JjiHn1g4fBObCx71JicOHJwVqFSStMEWDyKfZruP069ryufXHz/Wf7kmOvYZlqDCtnLNvf+6utUuvs8zU5MyTmohc+TfDQIJd183XVtNJjhGGnEQQJnz12bHu7KA3hTQjlWGuUJfNrdtxsKc/VYF7X4wK0/qxu1f+2QOrM6bbYr4Udt6tSJk2AmfZBh2NAAujfKLDFcAA14AczAVb3ui3YJyCqh5JKOGgOnty+OX9F2ynkg8oqyStyxdM/fvP30lMqrY7mqw3KlXsebQl0crI1NHoR9THRphRJIAs+Gqy8oqcyCpC40ZvXJveHPCr0puHRzascnlUjNaGmuA//dU9TXXVitU9xXp2xDo4BGI0s4dukmVFVv2upaepqYadldhIAiMGuBYUPyRvAVQu3iLh1yzhuNGUsmhWuCdqvNtVMZGtDK0SZ9/+7Ja2hdMcMznV+q1K5VO9RgcLwTNiraJoz3ck955yls/UdJMsBGt5F8NIAiMCIKAGQE7OYL2NQj4jpTPDkpbPDe873t8br4zIVobWT9y97JP3LDFMp9V5vYoq1eNmZ90VGTREDPVLP3jx1Z2Hbm5b0RpIJu2QDCvEoyMpCRA2VB84gRzABhwv6mJMhLRMJKFqsnTjjMArB6KGVQGRrQCtqxZM+daf3yZIqnEONou9Yy/QQ8Sd2ePMUzXtO788tq/juOvYh08n7ly3ULEjSVEX5n0qN0ZQHBE4QeagHKdwAAfkyIrjk81Lca2lRmmslt84FB84aDtSjJXWxtrgD/5iS311UHW6p4lXRhwADQGTQqesFYqqvPKO+Y+PvE4kAPT1RVJUs2Fxo5nRdVFdJ1/gbNiWxQC4UBhgAhZgASZgAzbI8fsM4VJfUp0/WdNN9+DpseZkx0SrJPFvf+bWlTe0OlZqOr2soTKST2Cn7SWGqIrZvr/84Y54vOD63zl+dsacBTe0WClDEiTVKMN9GAQACIJsg9s5g/U2G8wCOeFAOq3L6Yy89DrtaFemKzKmdMGYBl0+vm3hllXTM4bZSrsDGMkVXha99rSY1aCoyv95uvPc+ZJhEhLOd37y4ul0k8rNi2ZzxGoaQc+YADu3uqx4E4AQnNmzWroVnpK58+X7aifVjekJYaO31tU3TvrGJ9oEsTpxpIV1jKUSxciI0CljoSrLb7wn/uHnO2jAv9DJ6OnOXtq6ZiYykYRTXadEZD68YM67AXLpxKwiyIrwK+bFqFwToBmN/LXDpjta7zVKWptrg//7C+trw37N7ZkuvclRmS4KgZ/M3GC4wYQT/PKP9sX6B4/8z3f3SOFpa+aqum4YQmvwRYdrsjQ0rQQQ/D4HwrnUL2Y2urIk9p4Y5XWNhlZZ4t/6dNuyeQ2ulZol7VBZhQbdGHrMKT3GJJ9P/YdnL7751rHLfLfj3a6FixbPDEcSpswhqrT0cM/C8wsrSk6dR1XQSet2Im0vnCbOR9E5qrkZo9HWj985f9Oy1kzGnCy95WeVifwBpJ3QeX2KT3Z3nMCTLw6+Oi8P28x8+2c7+9gMmTLnUnVxMzBckXUGW7UhChtjmDtFaDKRiy9sYXNaRnMtI7bWpddP/btPLXcsUxAx2CEek1gF+qkC/ERytumqKVH11z85FIld+W4lEvGLRvj2pXVWui9l+xr8aWk4Y2UMkIdeZMIAwsUI+uLMcRFWae7U0IsdrjvCbPeIrTWq4534ZH+4hgkjYk9512hLuA0jLaQcDN16c9wMaKr845d6T545P8zfvfjavicO+INBLWWIU7HwsAw299C9QWyWwbJw5CSOnWa2RTKRG75+b3SRSyNmacTW2h9PPPf7w0r93KXzW5lx0XDkqNMCICTHR9ZPz4MhaQVPJqZqktjdFfrez9tH8pQw6jjeu2rFTc3y6f4MfLIb0obhZNhgXoujP4nDJ1kkwRmRX9N6fau/+ZT79ItvjfSpZRidy3Jsa+e+g8f7fCuWLq6VopZlxp26tBsKyYnhxjpFcIkf759qOUxntV95+L2+yJBPzBoUlmUcvcC2tE3imZP9GdQHSLlixMkHLIslnL2Io6eZYUEiClQ37+xf/pV/e+/YuydGejkeRh+3njp99qW3umdcv2JOM3P0vrQTiNl1Gjf88uBPLhgcDOcS9Zf0kN+n/vOr9ut7j4+iJn19EV2etm6+m0kldIs1hYfxT8nywQCHaeHoaZy5yEmQwsFqb/zZ/inff2RvMj6SbE4pxtR5TSbiz+84bIfmLF8wVTZ7TIeiVp0jpLCS5nxY3iNu+Dr76zXJab9Q/71fHBLuKL3fkc7emfOWzavp6U/ZnKE2dKWVj7k1WdF+HOpk0QTjRH6fv0dr+8avjedebSd3TJ3XsaZaSDhvdRw90MWXLl3WpMYsI5mwwgk7EFJ0VboCR47g70ZqLUeYvP6rj1y41Dey5l9aD/dAp75+9Y1V7tlomlX74fddllkJRDjTjSNnmGlBAgVqWndEl3714WMnOk+OvhqF4iuB890XXth7rmX2iuunqK7ek3HkSCascCekmkN6Z4bTsWBvSgoElH/dob2yp3OMdcjo6dPx6s3L6p1UbyLDmqsgDXVxHIaNd07iTA8jQSpnVLfox+0t//iLPelkZcLwig26ZPT0SzuP9MszVy6aqVldluVEjYDh8CrNlAYKAkNMlzojiipnDvRO/u5jJ12nAhNMzl/oleuuXzU1nUzoloOmmsG+xHEphoOdLJZgnCjgD5z3tf3Nr1Mv7dhPojIDRajwyCuJw0dP7OmkhUtWTQpGLD2SsNRYRgkqtk8pinsYbAdHLjLbMS25+euPGT2XRu8cynD4RN/Cm5ZNVbqiCfKpqCoWWQZBONHFjp1llg0Z5K+d/Fp0ydf+/cjp06crVQEPlZ9+0dvb+7td56qmrVw0Q6X0qYzt9qXBmQj7Csv4Tvay3hQF/P5/293y0q5KTot0Xftwl7tx1Vw10xVNsoYqaJq3bAO6gYOd7HwfANIkJuoX/6i98YeP7zbSiSsWO1KMy2Qh28rs2HOsy565csnsoHPaMs1omqUtVPkgK+hLoLOXaRIO9c9+6JdnnUo0/2Ik4vE+0brhBl8mEUtnWEs9uISLEXScYHEdEigYCp1V277+ZPy1nW+P07+FG7+JmPRe55nfH8W8m9ZPr07YeiJlskiKSRyne5ltk6O2fuMJ58LFykx7KcPJsxfrpy++qSHSnzCFYLEEjp5ljoDCyF8/7YWLi/7m3w+eO3duPE7tYXynDff3x17YdU5qWr1kTg1Lnzcs9CWY7SDg9/3f/a0v7By/WdHU0RlbvWJJI85GkoimGAP5ZG7XLf2nndU//tVu0xjHya24CpPcXcfae+D48cSU5cuWVotuy7RUiR1NXvfQ4+ccp8Izn4phW8a7vcqWldOYfoERgqGqTrnta4/3vrn3ICqUdL8MrsZKFwBnz51/9VBm+oL1cxuMjKt+8zfifE/Fxr6GQl8kmvHNXD9HSP7a57pv/NvtHd3dw82N/SGBy75P/cmW//rA6qv1xAwwSf2fn77z3ttXXBP/FGiccTXW2L1/p5vABCYwgQlMYAL/2fH/AdkCEQl+/Ar/AAAAAElFTkSuQmCCCg==', |
92 | // icon4: 'jqtouch4.png', | 88 | // icon4: 'jqtouch4.png', |
93 | // startupScreen: null, //Pass a string path to a 320px x 460px startup screen for full screen apps. | 89 | // startupScreen: null, //Pass a string path to a 320px x 460px startup screen for full screen apps. |
94 | statusBar: 'black-translucent', //Styles the status bar when running as a fullscreen app. Other options are `default`, `black`, and `black-translucent`. | 90 | statusBar: 'black-translucent', //Styles the status bar when running as a fullscreen app. Other options are `default`, `black`, and `black-translucent`. |
95 | // addGlossToIcon: true, //Set to 'false' to prevent automatic glossy button effect on icon. | 91 | // addGlossToIcon: true, //Set to 'false' to prevent automatic glossy button effect on icon. |
96 | preloadImages: false, //Pass an array of image paths to load them before page loads. Ex: `['images/link_over.png', 'images/link_select.png']` | 92 | preloadImages: false, //Pass an array of image paths to load them before page loads. Ex: `['images/link_over.png', 'images/link_select.png']` |
97 | fixedViewport: true, //Removes the user's ability to scale the page. Ensures the site behaves more like an application. | 93 | fixedViewport: true, //Removes the user's ability to scale the page. Ensures the site behaves more like an application. |
98 | // fullScreen: true, //The website will become a fullscreen application when saved to a user's home screen. Set to `false` to disable. | 94 | // fullScreen: true, //The website will become a fullscreen application when saved to a user's home screen. Set to `false` to disable. |
99 | // fullScreenClass: 'fullscreen' //Adds a class to the `<body>` when running in full-screen mode, to allow for easy detection and styling. Set to `false` to disable. | 95 | // fullScreenClass: 'fullscreen' //Adds a class to the `<body>` when running in full-screen mode, to allow for easy detection and styling. Set to `false` to disable. |
100 | // themeSelectionSelector: '#jqt #themes ul', //??? | 96 | // themeSelectionSelector: '#jqt #themes ul', //??? |
101 | 97 | ||
102 | // useAnimations: true, //Set to `false` to disable all animations. | 98 | // useAnimations: true, //Set to `false` to disable all animations. |
103 | // useFastTouch: true, //Removes ~350ms onClick delay when tapping a link (use in conjunction with the .tap() event) **Experimental** | 99 | // useFastTouch: true, //Removes ~350ms onClick delay when tapping a link (use in conjunction with the .tap() event) **Experimental** |
104 | // useTouchScroll: true, //Adds support for iOS5 scrolling. Set to false to disable. **Experimental** | 100 | // useTouchScroll: true, //Adds support for iOS5 scrolling. Set to false to disable. **Experimental** |
105 | 101 | ||
106 | cacheGetRequests: false, //Automatically caches GET requests, so subsequent taps reference the pre-loaded views. (default: true) | 102 | cacheGetRequests: false, //Automatically caches GET requests, so subsequent taps reference the pre-loaded views. (default: true) |
107 | 103 | ||
108 | // backSelector: '.back, .cancel, .goback', //A CSS selector for back links/buttons. When clicked, the page history goes back one, automatically reversing whichever entrance animation was used. | 104 | // backSelector: '.back, .cancel, .goback', //A CSS selector for back links/buttons. When clicked, the page history goes back one, automatically reversing whichever entrance animation was used. |
109 | 105 | ||
110 | // cubeSelector: '.cube', //Link selector for a cube animation. | 106 | // cubeSelector: '.cube', //Link selector for a cube animation. |
111 | // dissolveSelector: '.dissolve', //Link selector for a dissolve animation. | 107 | // dissolveSelector: '.dissolve', //Link selector for a dissolve animation. |
112 | // fadeSelector: '.fade', //Link selector for a fade animation. | 108 | // fadeSelector: '.fade', //Link selector for a fade animation. |
113 | // flipSelector: '.flip', //Link selector for a 3d flip animation. | 109 | // flipSelector: '.flip', //Link selector for a 3d flip animation. |
114 | formSelector: null, //Sets which forms are automatically submitted via Ajax. (default: 'form') | 110 | formSelector: null, //Sets which forms are automatically submitted via Ajax. (default: 'form') |
115 | // popSelector: '.pop', //Link selector for a pop animation. (default: '.pop') | 111 | // popSelector: '.pop', //Link selector for a pop animation. (default: '.pop') |
116 | // slideSelector: 'body > * > ul li a', //Link selector for the default slide-left transition. By default applies to all links within an unordered list. Accepts any jQuery-capable selector `'li > a, a:not(.dontslide)'`, etc. (default: 'body > * > ul li a') | 112 | // slideSelector: 'body > * > ul li a', //Link selector for the default slide-left transition. By default applies to all links within an unordered list. Accepts any jQuery-capable selector `'li > a, a:not(.dontslide)'`, etc. (default: 'body > * > ul li a') |
117 | // slideupSelector: '.slideup', //Link selector for a slide up animation. (default: '.slideup') | 113 | // slideupSelector: '.slideup', //Link selector for a slide up animation. (default: '.slideup') |
118 | // submitSelector: '.submit', //Selector which, when clicked, will submit its parent form (and close keyboard if open). (default: '.submit') | 114 | // submitSelector: '.submit', //Selector which, when clicked, will submit its parent form (and close keyboard if open). (default: '.submit') |
119 | // swapSelector: '.swap', //Link selector for 3d swap animation. (default: '.swap') | 115 | // swapSelector: '.swap', //Link selector for 3d swap animation. (default: '.swap') |
120 | // touchSelector: 'a, .touch', //Selector for items which are automatically given expanded touch events. This makes ordinary links more responsive and provides trigger events like `swipe` (default: 'a, .touch') | 116 | // touchSelector: 'a, .touch', //Selector for items which are automatically given expanded touch events. This makes ordinary links more responsive and provides trigger events like `swipe` (default: 'a, .touch') |
121 | 117 | ||
122 | debug: false | 118 | debug: false |
123 | }); | 119 | }); |
124 | 120 | ||
125 | this.setJQTouch(jqt); | 121 | this.setJQTouch(jqt); |
126 | }, | 122 | }, |
127 | 123 | */ | |
128 | //========================================================================= | 124 | //========================================================================= |
129 | 125 | ||
130 | 'showAddToHomeScreenBaloon': function () { | 126 | 'showAddToHomeScreenBaloon': function () { |
131 | console.log(">>> showAddToHomeScreenBaloon"); | ||
132 | }, | 127 | }, |
133 | 128 | ||
134 | //------------------------------------------------------------------------- | 129 | //------------------------------------------------------------------------- |
135 | 130 | ||
136 | 'selectInitialProxy': function () { | 131 | 'selectInitialProxy': function () { |
137 | //console.log(">>> selectInitialProxy"); | ||
138 | if (this.isOnline()) { | 132 | if (this.isOnline()) { |
139 | //console.log("--- selectInitialProxy: using default proxy"); | ||
140 | this._proxy = Clipperz.PM.Proxy.defaultProxy; | 133 | this._proxy = Clipperz.PM.Proxy.defaultProxy; |
141 | } else { | 134 | } else { |
142 | if (this.hasLocalData()) { | 135 | if (this.hasLocalData()) { |
143 | //console.log("--- selectInitialProxy: using local cache proxy"); | ||
144 | this._proxy = new Clipperz.PM.Proxy.OfflineCache({'shouldPayTolls':false}); | 136 | this._proxy = new Clipperz.PM.Proxy.OfflineCache({'shouldPayTolls':false}); |
145 | } else { | 137 | } else { |
146 | this.showOfflineError(); | 138 | this.showOfflineError(); |
147 | } | 139 | } |
148 | } | 140 | } |
149 | }, | 141 | }, |
150 | 142 | ||
151 | //------------------------------------------------------------------------- | 143 | //------------------------------------------------------------------------- |
152 | 144 | ||
153 | 'showLoginForm': function (args) { | 145 | 'showLoginForm': function (args) { |
154 | args = args || {}; | 146 | args = args || {}; |
155 | 147 | ||
156 | args['callback'] = MochiKit.Base.method(this, 'doLogin'); | 148 | args['callback'] = MochiKit.Base.method(this, 'doLogin'); |
157 | 149 | ||
158 | if (Clipperz.PM.PIN.isSet()) { | 150 | if (Clipperz.PM.PIN.isSet()) { |
159 | args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedPinLogin'); | 151 | args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedPinLogin'); |
160 | this.loginForm().showPinLogin(args); | 152 | this.loginForm().showPinLogin(args); |
161 | } else { | 153 | } else { |
162 | args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedCredentialsLogin'); | 154 | args['errorCallback'] = MochiKit.Base.method(this, 'handleFailedCredentialsLogin'); |
163 | this.loginForm().showCredentialsLogin(args); | 155 | this.loginForm().showCredentialsLogin(args); |
164 | } | 156 | } |
165 | }, | 157 | }, |
166 | 158 | ||
167 | //......................................................................... | 159 | //......................................................................... |
168 | 160 | ||
169 | 'handleFailedCredentialsLogin': function () { | 161 | 'handleFailedCredentialsLogin': function () { |
170 | console.log("LOGIN FAILED"); | ||
171 | this.showLoginForm({'previousFailedAttempt':'LOGIN'}); | 162 | this.showLoginForm({'previousFailedAttempt':'LOGIN'}); |
172 | }, | 163 | }, |
173 | 164 | ||
174 | //......................................................................... | 165 | //......................................................................... |
175 | 166 | ||
176 | 'handleFailedPinLogin': function () { | 167 | 'handleFailedPinLogin': function () { |
177 | varfailedAttempts; | 168 | varfailedAttempts; |
178 | varstatus; | 169 | varstatus; |
179 | 170 | ||
180 | failedAttempts = Clipperz.PM.PIN.recordFailedAttempt(); | 171 | failedAttempts = Clipperz.PM.PIN.recordFailedAttempt(); |
181 | this.showLoginForm({'previousFailedAttempt':'PIN', 'failedAttempts': failedAttempts}); | 172 | this.showLoginForm({'previousFailedAttempt':'PIN', 'failedAttempts': failedAttempts}); |
182 | }, | 173 | }, |
183 | 174 | ||
184 | //------------------------------------------------------------------------- | 175 | //------------------------------------------------------------------------- |
185 | 176 | ||
186 | 'doLogin': function (someArgs) { | 177 | 'doLogin': function (someArgs) { |
187 | var deferredResult; | 178 | var deferredResult; |
188 | var credentials; | 179 | var credentials; |
189 | var errorCallback; | 180 | var errorCallback; |
190 | var user; | 181 | var user; |
191 | var getPassphraseDelegate; | 182 | var getPassphraseDelegate; |
192 | 183 | ||
193 | //console.log(">>> MainController.doLogin", someArgs); | ||
194 | credentials = someArgs['credentials']; | 184 | credentials = someArgs['credentials']; |
195 | errorCallback = someArgs['errorCallback'] || MochiKit.Base.noop; | 185 | errorCallback = someArgs['errorCallback'] || MochiKit.Base.noop; |
196 | 186 | ||
197 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, credentials.passphrase); | 187 | getPassphraseDelegate = MochiKit.Base.partial(MochiKit.Async.succeed, credentials.passphrase); |
198 | user = new Clipperz.PM.DataModel.User({'username':credentials.username, 'getPassphraseFunction':getPassphraseDelegate}); | 188 | user = new Clipperz.PM.DataModel.User({'username':credentials.username, 'getPassphraseFunction':getPassphraseDelegate}); |
199 | 189 | ||
200 | deferredResult = new Clipperz.Async.Deferred('MainController.doLogin', {trace:false}); | 190 | deferredResult = new Clipperz.Async.Deferred('MainController.doLogin', {trace:false}); |
201 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); | 191 | deferredResult.addCallbackPass(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress', {'steps':4}); |
202 | deferredResult.addCallback(MochiKit.Async.wait, 0.1); | 192 | deferredResult.addCallback(MochiKit.Async.wait, 0.1); |
203 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); | 193 | deferredResult.addMethod(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'); |
204 | deferredResult.addMethod(user, 'login'); | 194 | deferredResult.addMethod(user, 'login'); |
205 | deferredResult.addCallbacks( | 195 | deferredResult.addCallbacks( |
206 | MochiKit.Base.method(this, 'processSuccessfulLogin', user), | 196 | MochiKit.Base.method(this, 'processSuccessfulLogin', user), |
207 | errorCallback | 197 | errorCallback |
208 | ); | 198 | ); |
209 | deferredResult.callback(); | 199 | deferredResult.callback(); |
210 | 200 | ||
211 | return deferredResult; | 201 | return deferredResult; |
212 | }, | 202 | }, |
213 | 203 | ||
214 | //.......................................................................... | 204 | //.......................................................................... |
215 | 205 | ||
216 | 'processSuccessfulLogin': function (aUser) { | 206 | 'processSuccessfulLogin': function (aUser) { |
217 | var deferredResult; | 207 | var deferredResult; |
218 | 208 | ||
219 | deferredResult = new Clipperz.Async.Deferred('MainController.processSuccessfulLogin', {trace:false}); | 209 | deferredResult = new Clipperz.Async.Deferred('MainController.processSuccessfulLogin', {trace:false}); |
220 | deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount'); | 210 | deferredResult.addMethod(Clipperz.PM.PIN, 'resetFailedAttemptCount'); |
221 | // deferredResult.addMethod(this, 'removeLoginForm'); | 211 | // deferredResult.addMethod(this, 'removeLoginForm'); |
222 | deferredResult.addMethod(this, 'setUser', aUser); | 212 | deferredResult.addMethod(this, 'setUser', aUser); |
223 | deferredResult.addMethod(this, 'setupApplication'); | 213 | deferredResult.addMethod(this, 'setupApplication'); |
224 | deferredResult.addMethod(this, 'runApplication'); | 214 | deferredResult.addMethod(this, 'runApplication'); |
225 | deferredResult.callback(); | 215 | deferredResult.callback(); |
226 | 216 | ||
227 | return deferredResult; | 217 | return deferredResult; |
228 | }, | 218 | }, |
229 | 219 | ||
230 | //------------------------------------------------------------------------- | 220 | //------------------------------------------------------------------------- |
231 | 221 | ||
232 | 'setupApplication': function () { | 222 | 'setupApplication': function () { |
233 | vardeferredResult; | 223 | vardeferredResult; |
234 | 224 | ||
235 | console.log(">>> setupApplication"); | ||
236 | deferredResult = new Clipperz.Async.Deferred("MainController.setupApplication", {trace:false}); | 225 | deferredResult = new Clipperz.Async.Deferred("MainController.setupApplication", {trace:false}); |
237 | deferredResult.addMethod(this, 'welcomeFirstTimeUser'); | 226 | deferredResult.addMethod(this, 'welcomeFirstTimeUser'); |
238 | deferredResult.addMethod(this, 'showPaymentReminder'); | 227 | deferredResult.addMethod(this, 'showPaymentReminder'); |
239 | deferredResult.addMethod(this, 'copyDataLocally'); | 228 | deferredResult.addMethod(this, 'copyDataLocally'); |
240 | deferredResult.callback(arguments); | 229 | deferredResult.callback(arguments); |
241 | 230 | ||
242 | return deferredResult; | 231 | return deferredResult; |
243 | }, | 232 | }, |
244 | 233 | ||
245 | 234 | ||
246 | //.......................................................................... | 235 | //.......................................................................... |
247 | 236 | ||
248 | 'isFirstTimeUser': function () { | 237 | 'isFirstTimeUser': function () { |
249 | return false; | 238 | return false; |
250 | }, | 239 | }, |
251 | 240 | ||
252 | 'welcomeFirstTimeUser': function () { | 241 | 'welcomeFirstTimeUser': function () { |
253 | vardeferredResult; | 242 | vardeferredResult; |
254 | 243 | ||
255 | deferredResult = new Clipperz.Async.Deferred('MainController.welcomeFirstTimeUser', {trace:false}); | 244 | deferredResult = new Clipperz.Async.Deferred('MainController.welcomeFirstTimeUser', {trace:false}); |
256 | 245 | ||
257 | if (this.isFirstTimeUser()) { | 246 | if (this.isFirstTimeUser()) { |
258 | deferredResult.addCallback(function () { console.log("--> welcome"); }); | 247 | deferredResult.addCallback(function () { Clipperz.log("--> welcome"); }); |
259 | } | 248 | } |
260 | deferredResult.callback(); | 249 | deferredResult.callback(); |
261 | 250 | ||
262 | return deferredResult; | 251 | return deferredResult; |
263 | }, | 252 | }, |
264 | 253 | ||
265 | //.......................................................................... | 254 | //.......................................................................... |
266 | 255 | ||
267 | 'shouldShowPaymentReminder': function () { | 256 | 'shouldShowPaymentReminder': function () { |
268 | return true; | 257 | return true; |
269 | }, | 258 | }, |
270 | 259 | ||
271 | 'showPaymentReminder': function () { | 260 | 'showPaymentReminder': function () { |
272 | vardeferredResult; | 261 | vardeferredResult; |
273 | 262 | ||
274 | deferredResult = new Clipperz.Async.Deferred('MainController.showPaymentReminder', {trace:false}); | 263 | deferredResult = new Clipperz.Async.Deferred('MainController.showPaymentReminder', {trace:false}); |
275 | 264 | ||
276 | if (this.shouldShowPaymentReminder()) { | 265 | if (this.shouldShowPaymentReminder()) { |
277 | deferredResult.addCallback(function () { console.log("--> payment reminder"); }); | 266 | deferredResult.addCallback(function () { Clipperz.log("--> payment reminder"); }); |
278 | } | 267 | } |
279 | deferredResult.callback(); | 268 | deferredResult.callback(); |
280 | 269 | ||
281 | return deferredResult; | 270 | return deferredResult; |
282 | }, | 271 | }, |
283 | 272 | ||
284 | //.......................................................................... | 273 | //.......................................................................... |
285 | 274 | ||
286 | 'canCopyDataLocally': function () { | 275 | 'canCopyDataLocally': function () { |
287 | return false; | 276 | return false; |
288 | }, | 277 | }, |
289 | 278 | ||
290 | 'copyDataLocally': function () { | 279 | 'copyDataLocally': function () { |
291 | vardeferredResult; | 280 | vardeferredResult; |
292 | 281 | ||
293 | deferredResult = new Clipperz.Async.Deferred('MainController.copyDataLocally', {trace:false}); | 282 | deferredResult = new Clipperz.Async.Deferred('MainController.copyDataLocally', {trace:false}); |
294 | 283 | ||
295 | if (this.canCopyDataLocally()) { | 284 | if (this.canCopyDataLocally()) { |
296 | deferredResult.addCallback(function () { console.log("--> copy data locally"); }); | 285 | deferredResult.addCallback(function () { Clipperz.log("--> copy data locally"); }); |
297 | } | 286 | } |
298 | deferredResult.callback(); | 287 | deferredResult.callback(); |
299 | 288 | ||
300 | return deferredResult; | 289 | return deferredResult; |
301 | 290 | ||
302 | }, | 291 | }, |
303 | 292 | ||
304 | //------------------------------------------------------------------------- | 293 | //------------------------------------------------------------------------- |
305 | 294 | ||
306 | 'runApplication': function () { | 295 | 'runApplication': function () { |
307 | var deferredResult; | 296 | var deferredResult; |
308 | 297 | ||
309 | //console.log(">>> runApplication"); | ||
310 | deferredResult = new Clipperz.Async.Deferred('MainController.runApplication', {trace:true}); | 298 | deferredResult = new Clipperz.Async.Deferred('MainController.runApplication', {trace:true}); |
311 | deferredResult.addMethod(this.user(), 'getRecords'); | 299 | deferredResult.addMethod(this.user(), 'getRecords'); |
312 | deferredResult.addMethod(this, 'showCards'); | 300 | deferredResult.addMethod(this, 'showCards'); |
313 | deferredResult.callback(); | 301 | deferredResult.callback(); |
314 | 302 | ||
315 | return deferredResult; | 303 | return deferredResult; |
316 | }, | 304 | }, |
317 | 305 | ||
318 | //========================================================================= | 306 | //========================================================================= |
319 | 307 | ||
320 | 'showOfflineError': function (anException) { | 308 | 'showOfflineError': function (anException) { |
321 | alert("Error: " + anException); | 309 | alert("Error: " + anException); |
322 | throw anException; | 310 | throw anException; |
323 | }, | 311 | }, |
324 | 312 | ||
325 | //========================================================================= | 313 | //========================================================================= |
326 | 314 | ||
327 | 'isOnline': function() { | 315 | 'isOnline': function() { |
328 | return navigator.onLine; | 316 | return navigator.onLine; |
329 | }, | 317 | }, |
330 | 318 | ||
331 | 'hasLocalData': function() { | 319 | 'hasLocalData': function() { |
332 | return false; | 320 | return false; |
333 | }, | 321 | }, |
334 | 322 | ||
335 | //========================================================================= | 323 | //========================================================================= |
336 | 324 | ||
337 | 'loginForm': function() { | 325 | 'loginForm': function() { |
338 | if (this._loginForm == null) { | 326 | if (this._loginForm == null) { |
339 | this._loginForm = new Clipperz.PM.UI.Mobile.Components.LoginForm({element:MochiKit.DOM.getElement('loginForm')}); | 327 | this._loginForm = new Clipperz.PM.UI.Mobile.Components.LoginForm({element:MochiKit.DOM.getElement('loginForm')}); |
340 | } | 328 | } |
341 | 329 | ||
342 | return this._loginForm; | 330 | return this._loginForm; |
343 | }, | 331 | }, |
344 | 332 | ||
345 | 'removeLoginForm': function () { | 333 | 'removeLoginForm': function () { |
346 | if (this._loginForm != null) { | 334 | if (this._loginForm != null) { |
347 | this._loginForm.remove(); | 335 | this._loginForm.remove(); |
348 | this._loginForm = null; | 336 | this._loginForm = null; |
349 | } | 337 | } |
350 | }, | 338 | }, |
351 | 339 | ||
352 | //------------------------------------------------------------------------- | 340 | //------------------------------------------------------------------------- |
353 | 341 | ||
354 | 'cardList': function () { | 342 | 'cardList': function () { |
355 | if (this._cardList == null) { | 343 | if (this._cardList == null) { |
356 | this._cardList = new Clipperz.PM.UI.Mobile.Components.CardList({element:MochiKit.DOM.getElement('cardList')}); | 344 | this._cardList = new Clipperz.PM.UI.Mobile.Components.CardList({element:MochiKit.DOM.getElement('cardList')}); |
357 | MochiKit.Signal.connect(this._cardList, 'selectedCard', this, 'selectCardHandler'); | 345 | MochiKit.Signal.connect(this._cardList, 'selectedCard', this, 'selectCardHandler'); |
358 | } | 346 | } |
359 | 347 | ||
360 | return this._cardList; | 348 | return this._cardList; |
361 | }, | 349 | }, |
362 | 350 | ||
363 | 'showCards': function (someCards) { | 351 | 'showCards': function (someCards) { |
364 | this.cardList().showCards(someCards); | 352 | this.cardList().showCards(someCards); |
365 | this.jQTouch().goTo('#cardList', 'slideleft'); | 353 | // this.jQTouch().goTo('#cardList', 'slideleft'); |
366 | }, | 354 | }, |
367 | 355 | ||
368 | //------------------------------------------------------------------------- | 356 | //------------------------------------------------------------------------- |
369 | 357 | ||
370 | 'cardDetail': function () { | 358 | 'cardDetail': function () { |
371 | if (this._cardDetail == null) { | 359 | if (this._cardDetail == null) { |
372 | this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:MochiKit.DOM.getElement('cardDetail')}); | 360 | this._cardDetail = new Clipperz.PM.UI.Mobile.Components.CardDetail({element:MochiKit.DOM.getElement('cardDetail')}); |
373 | } | 361 | } |
374 | 362 | ||
375 | return this._cardDetail; | 363 | return this._cardDetail; |
376 | }, | 364 | }, |
377 | 365 | ||
378 | 'selectCardHandler': function (aCardReference) { | 366 | 'selectCardHandler': function (aCardReference) { |
379 | var deferredResult; | 367 | var deferredResult; |
380 | 368 | ||
381 | deferredResult = new Clipperz.Async.Deferred("MainController.selectCardHandler", {trace:true}); | 369 | deferredResult = new Clipperz.Async.Deferred("MainController.selectCardHandler", {trace:true}); |
382 | deferredResult.addMethod(this.cardDetail(), 'render'); | 370 | deferredResult.addMethod(this.cardDetail(), 'render'); |
383 | deferredResult.addMethod(this.jQTouch(), 'goTo', '#cardDetail', 'slideleft'); | 371 | // deferredResult.addMethod(this.jQTouch(), 'goTo', '#cardDetail', 'slideleft'); |
384 | deferredResult.addMethod(this.user(), 'getRecord', aCardReference); | 372 | deferredResult.addMethod(this.user(), 'getRecord', aCardReference); |
385 | deferredResult.addMethod(this.cardDetail(), 'showCard'); | 373 | deferredResult.addMethod(this.cardDetail(), 'showCard'); |
386 | deferredResult.callback(); | 374 | deferredResult.callback(); |
387 | 375 | ||
388 | return deferredResult; | 376 | return deferredResult; |
389 | }, | 377 | }, |
390 | 378 | ||
391 | //========================================================================= | 379 | //========================================================================= |
392 | __syntaxFix__: "syntax fix" | 380 | __syntaxFix__: "syntax fix" |
393 | }); | 381 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js index d6b0574..82c8dfd 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { | 26 | Clipperz.PM.UI.Web.Components.AccountPanel = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.AccountPanel.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | //this._initiallySelectedTab = args.selected || 'ACCOUNT'; | 31 | //this._initiallySelectedTab = args.selected || 'ACCOUNT'; |
34 | this._initiallySelectedTab = args.selected || 'PASSPHRASE'; | 32 | this._initiallySelectedTab = args.selected || 'PASSPHRASE'; |
35 | this._tabPanelControllerConfiguration = { | 33 | this._tabPanelControllerConfiguration = { |
36 | // 'ACCOUNT': { | 34 | // 'ACCOUNT': { |
37 | // tab:'accountTab', | 35 | // tab:'accountTab', |
38 | // panel:'accountPanel' | 36 | // panel:'accountPanel' |
39 | // }, | 37 | // }, |
40 | 'PASSPHRASE': { | 38 | 'PASSPHRASE': { |
41 | tab:'passphraseTab', | 39 | tab:'passphraseTab', |
42 | panel:'passphrasePanel' | 40 | panel:'passphrasePanel' |
43 | }, | 41 | }, |
44 | 'OTP': { | 42 | 'OTP': { |
45 | tab:'OTPTab', | 43 | tab:'OTPTab', |
46 | panel:'OTPPanel' | 44 | panel:'OTPPanel' |
47 | }, | 45 | }, |
48 | 'PREFERENCES': { | 46 | 'PREFERENCES': { |
49 | tab:'preferencesTab', | 47 | tab:'preferencesTab', |
50 | panel:'preferencesPanel' | 48 | panel:'preferencesPanel' |
51 | }, | 49 | }, |
52 | 'LOGIN_HISTORY': { | 50 | 'LOGIN_HISTORY': { |
53 | tab:'loginHistoryTab', | 51 | tab:'loginHistoryTab', |
54 | panel:'loginHistoryPanel' | 52 | panel:'loginHistoryPanel' |
55 | } | 53 | } |
56 | }; | 54 | }; |
57 | 55 | ||
58 | return this; | 56 | return this; |
59 | } | 57 | } |
60 | 58 | ||
61 | //============================================================================= | 59 | //============================================================================= |
62 | 60 | ||
63 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 61 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AccountPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | 'toString': function () { | 65 | 'toString': function () { |
68 | return "Clipperz.PM.UI.Web.Components.AccountPanel component"; | 66 | return "Clipperz.PM.UI.Web.Components.AccountPanel component"; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | //------------------------------------------------------------------------- | 69 | //------------------------------------------------------------------------- |
72 | 70 | ||
73 | 'renderSelf': function(/*aContainer, aPosition*/) { | 71 | 'renderSelf': function(/*aContainer, aPosition*/) { |
74 | //Clipperz.log("AccountPanel.renderSelf element", this.element()); | 72 | //Clipperz.log("AccountPanel.renderSelf element", this.element()); |
75 | this.append(this.element(), [ | 73 | this.append(this.element(), [ |
76 | {tag:'div', cls:'header', children:[ | 74 | {tag:'div', cls:'header', children:[ |
77 | {tag:'div', cls:'subPanelTabs', children:[ | 75 | {tag:'div', cls:'subPanelTabs', children:[ |
78 | {tag:'ul', children:[ | 76 | {tag:'ul', children:[ |
79 | // {tag:'li', id:this.getId('accountTab'), children:[{tag:'a', href:'#', html:'Account'}], cls:'first'}, | 77 | // {tag:'li', id:this.getId('accountTab'), children:[{tag:'a', href:'#', html:'Account'}], cls:'first'}, |
80 | {tag:'li', id:this.getId('passphraseTab'), children:[{tag:'a', href:'#', html:'Passphrase'}], cls:'first'}, | 78 | {tag:'li', id:this.getId('passphraseTab'), children:[{tag:'a', href:'#', html:'Passphrase'}], cls:'first'}, |
81 | {tag:'li', id:this.getId('OTPTab'), children:[{tag:'a', href:'#', html:'One Time Passwords'}]}, | 79 | {tag:'li', id:this.getId('OTPTab'), children:[{tag:'a', href:'#', html:'One Time Passwords'}]}, |
82 | {tag:'li', id:this.getId('preferencesTab'), children:[{tag:'a', href:'#', html:'Preferences'}]}, | 80 | {tag:'li', id:this.getId('preferencesTab'), children:[{tag:'a', href:'#', html:'Preferences'}]}, |
83 | {tag:'li', id:this.getId('loginHistoryTab'),children:[{tag:'a', href:'#', html:'Login history'}]} | 81 | {tag:'li', id:this.getId('loginHistoryTab'),children:[{tag:'a', href:'#', html:'Login history'}]} |
84 | ]} | 82 | ]} |
85 | ]} | 83 | ]} |
86 | ]}, | 84 | ]}, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js index 3b3c8b4..da5fd76 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js | |||
@@ -1,75 +1,73 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.AppPage = function(args) { | 26 | Clipperz.PM.UI.Web.Components.AppPage = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | Clipperz.PM.UI.Web.Components.AppPage.superclass.constructor.call(this, args); | 28 | Clipperz.PM.UI.Web.Components.AppPage.superclass.constructor.call(this, args); |
31 | 29 | ||
32 | this._element = args.element || null; | 30 | this._element = args.element || null; |
33 | 31 | ||
34 | this._slots = { | 32 | this._slots = { |
35 | 'cardGrid' : this.getId('cardGrid'), | 33 | 'cardGrid' : this.getId('cardGrid'), |
36 | // 'directLoginGrid' : this.getId('directLoginGrid'), | 34 | // 'directLoginGrid' : this.getId('directLoginGrid'), |
37 | 'accountPanel': this.getId('accountPanel'), | 35 | 'accountPanel': this.getId('accountPanel'), |
38 | 'dataPanel': this.getId('dataPanel'), | 36 | 'dataPanel': this.getId('dataPanel'), |
39 | 'toolsPanel': this.getId('toolsPanel'), | 37 | 'toolsPanel': this.getId('toolsPanel'), |
40 | 'userInfoBox': this.getId('userInfoBox'), | 38 | 'userInfoBox': this.getId('userInfoBox'), |
41 | 'tabSidePanel': this.getId('tabSidePanel') | 39 | 'tabSidePanel': this.getId('tabSidePanel') |
42 | }; | 40 | }; |
43 | 41 | ||
44 | return this; | 42 | return this; |
45 | } | 43 | } |
46 | 44 | ||
47 | //============================================================================= | 45 | //============================================================================= |
48 | 46 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AppPage, Clipperz.PM.UI.Common.Components.BaseComponent, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.AppPage, Clipperz.PM.UI.Common.Components.BaseComponent, { |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'toString': function () { | 51 | 'toString': function () { |
54 | return "Clipperz.PM.UI.Web.Components.AppPage component"; | 52 | return "Clipperz.PM.UI.Web.Components.AppPage component"; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'renderSelf': function(/*aContainer, aPosition*/) { | 57 | 'renderSelf': function(/*aContainer, aPosition*/) { |
60 | this.append(this.element(), {tag:'div', id:this.getId('userInfoBox'), cls:'userInfoBox'}); | 58 | this.append(this.element(), {tag:'div', id:this.getId('userInfoBox'), cls:'userInfoBox'}); |
61 | this.append(this.element(), {tag:'div', id:this.getId('sidePanels'), cls:'sidePanels'}); | 59 | this.append(this.element(), {tag:'div', id:this.getId('sidePanels'), cls:'sidePanels'}); |
62 | this.append(this.getId('sidePanels'),{tag:'div', id:this.getId('tabSidePanel'), cls:'tabSidePanel', children:[]}); | 60 | this.append(this.getId('sidePanels'),{tag:'div', id:this.getId('tabSidePanel'), cls:'tabSidePanel', children:[]}); |
63 | 61 | ||
64 | this.append(this.element(), {tag:'div', id:this.getId('mainPanels'), cls:'mainPanels'}); | 62 | this.append(this.element(), {tag:'div', id:this.getId('mainPanels'), cls:'mainPanels'}); |
65 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('cardGrid'), cls:'gridComponent cardGrid'}); | 63 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('cardGrid'), cls:'gridComponent cardGrid'}); |
66 | // this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('directLoginGrid'), cls:'gridComponent directLoginGrid'}); | 64 | // this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('directLoginGrid'), cls:'gridComponent directLoginGrid'}); |
67 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('accountPanel'), cls:'otherPanel'}); | 65 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('accountPanel'), cls:'otherPanel'}); |
68 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('dataPanel'), cls:'otherPanel'}); | 66 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('dataPanel'), cls:'otherPanel'}); |
69 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('toolsPanel'), cls:'otherPanel'}); | 67 | this.append(this.getId('mainPanels'), {tag:'div', id:this.getId('toolsPanel'), cls:'otherPanel'}); |
70 | }, | 68 | }, |
71 | 69 | ||
72 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
73 | 71 | ||
74 | __syntaxFix__: "syntax fix" | 72 | __syntaxFix__: "syntax fix" |
75 | }); | 73 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js index 1835ca9..4cfca32 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.BookmarkletComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.BookmarkletComponent.superclass.constructor.apply(this, arguments); |
32 | MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); | 30 | MochiKit.Signal.connect(Clipperz.PM.Strings.Languages, 'switchLanguage', this, 'updateBookmarkletURLs'); |
33 | 31 | ||
34 | return this; | 32 | return this; |
35 | } | 33 | } |
36 | 34 | ||
37 | //============================================================================= | 35 | //============================================================================= |
38 | 36 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 37 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.BookmarkletComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
40 | 38 | ||
41 | //------------------------------------------------------------------------- | 39 | //------------------------------------------------------------------------- |
42 | 40 | ||
43 | 'toString': function () { | 41 | 'toString': function () { |
44 | return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; | 42 | return "Clipperz.PM.UI.Web.Components.BookmarkletComponent component"; |
45 | }, | 43 | }, |
46 | 44 | ||
47 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
48 | 46 | ||
49 | 'renderSelf': function() { | 47 | 'renderSelf': function() { |
50 | // var bookmarkletUrl; | 48 | // var bookmarkletUrl; |
51 | // | 49 | // |
52 | // if (Clipperz_IEisBroken == true) { | 50 | // if (Clipperz_IEisBroken == true) { |
53 | // bookmarkletUrl = bookmarklet_ie; | 51 | // bookmarkletUrl = bookmarklet_ie; |
54 | // } else { | 52 | // } else { |
55 | /// bookmarkletUrl = bookmarklet; | 53 | /// bookmarkletUrl = bookmarklet; |
56 | // bookmarkletUrl = Clipperz.PM.Strings['bookmarklet']; | 54 | // bookmarkletUrl = Clipperz.PM.Strings['bookmarklet']; |
57 | // } | 55 | // } |
58 | 56 | ||
59 | this.append(this.element(), {tag:'div', cls:'bookmarklet', children: [ | 57 | this.append(this.element(), {tag:'div', cls:'bookmarklet', children: [ |
60 | {tag:'div', id:this.getId('linkBlock'), cls:'bookmarklet_link', children:[ | 58 | {tag:'div', id:this.getId('linkBlock'), cls:'bookmarklet_link', children:[ |
61 | // {tag:'a', id:this.getId('link'), href:bookmarkletUrl, children:[ | 59 | // {tag:'a', id:this.getId('link'), href:bookmarkletUrl, children:[ |
62 | {tag:'a', id:this.getId('link'), href:'#', children:[ | 60 | {tag:'a', id:this.getId('link'), href:'#', children:[ |
63 | {tag:'div', cls:'icon'}, | 61 | {tag:'div', cls:'icon'}, |
64 | {tag:'div', cls:'text', children:[ | 62 | {tag:'div', cls:'text', children:[ |
65 | {tag:'span', html:"add to Clipperz"} | 63 | {tag:'span', html:"add to Clipperz"} |
66 | ]} | 64 | ]} |
67 | ]} | 65 | ]} |
68 | ]} | 66 | ]} |
69 | ]}); | 67 | ]}); |
70 | 68 | ||
71 | new Clipperz.PM.UI.Common.Components.Tooltip({ | 69 | new Clipperz.PM.UI.Common.Components.Tooltip({ |
72 | element:this.getElement('linkBlock'), | 70 | element:this.getElement('linkBlock'), |
73 | text: "Drag and drop the \"add to Clipperz\" link above to the bookmark bar.", | 71 | text: "Drag and drop the \"add to Clipperz\" link above to the bookmark bar.", |
74 | position:'BELOW' | 72 | position:'BELOW' |
75 | }); | 73 | }); |
76 | 74 | ||
77 | MochiKit.Signal.connect(this.getId('link'), 'onclick', this, 'handleOnclick'); | 75 | MochiKit.Signal.connect(this.getId('link'), 'onclick', this, 'handleOnclick'); |
78 | this.updateBookmarkletURLs(); | 76 | this.updateBookmarkletURLs(); |
79 | }, | 77 | }, |
80 | 78 | ||
81 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
82 | 80 | ||
83 | 'handleOnclick': function (anEvent) { | 81 | 'handleOnclick': function (anEvent) { |
84 | anEvent.preventDefault(); | 82 | anEvent.preventDefault(); |
85 | 83 | ||
86 | Clipperz.log("BOOKMARKLET CLICK"); | 84 | Clipperz.log("BOOKMARKLET CLICK"); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js index af33d85..8bb64f5 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.CardDialogComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.CardDialogComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.CardDialogComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.CardDialogComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._tabPanelController = null; | 31 | this._tabPanelController = null; |
34 | 32 | ||
35 | this._tabPanelControllerConfiguration = { | 33 | this._tabPanelControllerConfiguration = { |
36 | 'DETAILS': { | 34 | 'DETAILS': { |
37 | tab:'detailTab', | 35 | tab:'detailTab', |
38 | panel:'detailTabpanel' | 36 | panel:'detailTabpanel' |
39 | }, | 37 | }, |
40 | 'DIRECT_LOGINS': { | 38 | 'DIRECT_LOGINS': { |
41 | tab:'directLoginTab', | 39 | tab:'directLoginTab', |
42 | panel:'directLoginTabpanel' | 40 | panel:'directLoginTabpanel' |
43 | }, | 41 | }, |
44 | 'SHARING': { | 42 | 'SHARING': { |
45 | tab:'sharingTab', | 43 | tab:'sharingTab', |
46 | panel:'sharingTabpanel' | 44 | panel:'sharingTabpanel' |
47 | } | 45 | } |
48 | }; | 46 | }; |
49 | 47 | ||
50 | this._tooltips = null; | 48 | this._tooltips = null; |
51 | 49 | ||
52 | this._isSavingEnabled = false; | 50 | this._isSavingEnabled = false; |
53 | this._hintMode = 'OFF'; //'ON' | 51 | this._hintMode = 'OFF'; //'ON' |
54 | 52 | ||
55 | this._fieldComponents = {}; | 53 | this._fieldComponents = {}; |
56 | this._directLoginComponents = {}; | 54 | this._directLoginComponents = {}; |
57 | 55 | ||
58 | this._displayMode = 'fixed'; //'scrollable'; | 56 | this._displayMode = 'fixed'; //'scrollable'; |
59 | 57 | ||
60 | return this; | 58 | return this; |
61 | } | 59 | } |
62 | 60 | ||
63 | //============================================================================= | 61 | //============================================================================= |
64 | 62 | ||
65 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 63 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
66 | 64 | ||
67 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
68 | 66 | ||
69 | 'toString': function () { | 67 | 'toString': function () { |
70 | return "Clipperz.PM.UI.Web.Components.CardDialogComponent component"; | 68 | return "Clipperz.PM.UI.Web.Components.CardDialogComponent component"; |
71 | }, | 69 | }, |
72 | 70 | ||
73 | //------------------------------------------------------------------------- | 71 | //------------------------------------------------------------------------- |
74 | 72 | ||
75 | 'tabPanelController': function () { | 73 | 'tabPanelController': function () { |
76 | if (this._tabPanelController == null) { | 74 | if (this._tabPanelController == null) { |
77 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ | 75 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ |
78 | component:this, | 76 | component:this, |
79 | configuration:this._tabPanelControllerConfiguration | 77 | configuration:this._tabPanelControllerConfiguration |
80 | }); | 78 | }); |
81 | 79 | ||
82 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') | 80 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') |
83 | } | 81 | } |
84 | 82 | ||
85 | return this._tabPanelController; | 83 | return this._tabPanelController; |
86 | }, | 84 | }, |
@@ -621,246 +619,242 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz | |||
621 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'fixRendering')); | 619 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'fixRendering')); |
622 | } | 620 | } |
623 | }, | 621 | }, |
624 | 622 | ||
625 | //------------------------------------------------------------------------- | 623 | //------------------------------------------------------------------------- |
626 | 624 | ||
627 | 'fixRendering': function () { | 625 | 'fixRendering': function () { |
628 | // varheight; | 626 | // varheight; |
629 | var y; | 627 | var y; |
630 | varscrollHeight; | 628 | varscrollHeight; |
631 | var viewportHeight; | 629 | var viewportHeight; |
632 | var viewportY; | 630 | var viewportY; |
633 | var footerElement; | 631 | var footerElement; |
634 | var footerElementPosition; | 632 | var footerElementPosition; |
635 | var footerElementDimensions; | 633 | var footerElementDimensions; |
636 | var footerComputedHeight; | 634 | var footerComputedHeight; |
637 | 635 | ||
638 | // height = MochiKit.Style.getElementDimensions(this.displayElement())['h']; | 636 | // height = MochiKit.Style.getElementDimensions(this.displayElement())['h']; |
639 | y = MochiKit.Style.getElementPosition(this.displayElement())['y']; | 637 | y = MochiKit.Style.getElementPosition(this.displayElement())['y']; |
640 | 638 | ||
641 | footerElement = MochiKit.Selector.findChildElements(this.displayElement(), ['div.footer'])[0]; | 639 | footerElement = MochiKit.Selector.findChildElements(this.displayElement(), ['div.footer'])[0]; |
642 | footerElementPosition = MochiKit.Style.getElementPosition(footerElement); | 640 | footerElementPosition = MochiKit.Style.getElementPosition(footerElement); |
643 | footerElementDimensions = MochiKit.Style.getElementDimensions(footerElement); | 641 | footerElementDimensions = MochiKit.Style.getElementDimensions(footerElement); |
644 | footerComputedHeight = footerElementPosition['y'] + footerElementDimensions['h'] - y; | 642 | footerComputedHeight = footerElementPosition['y'] + footerElementDimensions['h'] - y; |
645 | 643 | ||
646 | // scrollHeight = this.displayElement().scrollHeight; | 644 | // scrollHeight = this.displayElement().scrollHeight; |
647 | scrollHeight = footerComputedHeight; | 645 | scrollHeight = footerComputedHeight; |
648 | 646 | ||
649 | viewportHeight = MochiKit.Style.getViewportDimensions()['h']; | 647 | viewportHeight = MochiKit.Style.getViewportDimensions()['h']; |
650 | viewportY = MochiKit.Style.getViewportPosition()['y']; | 648 | viewportY = MochiKit.Style.getViewportPosition()['y']; |
651 | 649 | ||
652 | if ((y + scrollHeight) > (viewportY + viewportHeight)) { | 650 | if ((y + scrollHeight) > (viewportY + viewportHeight)) { |
653 | this.setDisplayMode('scrollable'); | 651 | this.setDisplayMode('scrollable'); |
654 | MochiKit.DOM.addElementClass(this.element(), 'scrollable'); | 652 | MochiKit.DOM.addElementClass(this.element(), 'scrollable'); |
655 | MochiKit.DOM.removeElementClass(this.element(), 'fixed'); | 653 | MochiKit.DOM.removeElementClass(this.element(), 'fixed'); |
656 | MochiKit.Style.setElementPosition(this.displayElement(), {y:Math.max(0, Math.min(y, (viewportY + viewportHeight) - scrollHeight))}, 'px'); | 654 | MochiKit.Style.setElementPosition(this.displayElement(), {y:Math.max(0, Math.min(y, (viewportY + viewportHeight) - scrollHeight))}, 'px'); |
657 | MochiKit.Visual.ScrollTo(this.displayElement(), {duration:0.5}); | 655 | MochiKit.Visual.ScrollTo(this.displayElement(), {duration:0.5}); |
658 | } else { | 656 | } else { |
659 | this.setDisplayMode('fixed'); | 657 | this.setDisplayMode('fixed'); |
660 | MochiKit.DOM.removeElementClass(this.element(), 'scrollable'); | 658 | MochiKit.DOM.removeElementClass(this.element(), 'scrollable'); |
661 | MochiKit.DOM.addElementClass(this.element(), 'fixed'); | 659 | MochiKit.DOM.addElementClass(this.element(), 'fixed'); |
662 | } | 660 | } |
663 | }, | 661 | }, |
664 | 662 | ||
665 | //========================================================================= | 663 | //========================================================================= |
666 | 664 | ||
667 | 'unselectCurrentSelectedItems': function () { | 665 | 'unselectCurrentSelectedItems': function () { |
668 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.displayElement(), ['.selectedField']), function (anElement) { | 666 | MochiKit.Iter.forEach(MochiKit.Selector.findChildElements(this.displayElement(), ['.selectedField']), function (anElement) { |
669 | MochiKit.DOM.removeElementClass(anElement, 'selectedField'); | 667 | MochiKit.DOM.removeElementClass(anElement, 'selectedField'); |
670 | }); | 668 | }); |
671 | }, | 669 | }, |
672 | 670 | ||
673 | //========================================================================= | 671 | //========================================================================= |
674 | 672 | ||
675 | 'hideProgressMask': function () { | 673 | 'hideProgressMask': function () { |
676 | MochiKit.DOM.removeElementClass(this.getId('panel'), 'loading'); | 674 | MochiKit.DOM.removeElementClass(this.getId('panel'), 'loading'); |
677 | }, | 675 | }, |
678 | 676 | ||
679 | 'showProgressMask': function () { | 677 | 'showProgressMask': function () { |
680 | this.getElement('progressDescription').innerHTML = "Saving"; | 678 | this.getElement('progressDescription').innerHTML = "Saving"; |
681 | MochiKit.DOM.addElementClass(this.getId('panel'), 'loading'); | 679 | MochiKit.DOM.addElementClass(this.getId('panel'), 'loading'); |
682 | }, | 680 | }, |
683 | 681 | ||
684 | 'showError': function (anError) { | 682 | 'showError': function (anError) { |
685 | //console.log(">>> showError", anError); | ||
686 | MochiKit.Style.hideElement(this.getId('progress')); | 683 | MochiKit.Style.hideElement(this.getId('progress')); |
687 | this.getElement('errorMessage').innerHTML = Clipperz.PM.Strings.errorDescriptionForException(anError['message']); | 684 | this.getElement('errorMessage').innerHTML = Clipperz.PM.Strings.errorDescriptionForException(anError['message']); |
688 | MochiKit.Style.showElement(this.getId('error')); | 685 | MochiKit.Style.showElement(this.getId('error')); |
689 | }, | 686 | }, |
690 | 687 | ||
691 | //------------------------------------------------------------------------- | 688 | //------------------------------------------------------------------------- |
692 | 689 | ||
693 | 'cancel': function () { | 690 | 'cancel': function () { |
694 | /* | 691 | /* |
695 | var deferredResult; | 692 | var deferredResult; |
696 | 693 | ||
697 | deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.cancel", {trace:false}); | 694 | deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.cancel", {trace:false}); |
698 | deferredResult.addCallback(MochiKit.Base.method(this, 'isSavingEnabled')); | 695 | deferredResult.addCallback(MochiKit.Base.method(this, 'isSavingEnabled')); |
699 | deferredResult.addIf([ | 696 | deferredResult.addIf([ |
700 | MochiKit.Base.method(this, 'askConfirmationForLoosingPendingChanges') | 697 | MochiKit.Base.method(this, 'askConfirmationForLoosingPendingChanges') |
701 | ], []); | 698 | ], []); |
702 | deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Signal.signal, this, 'cancel')); | 699 | deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Signal.signal, this, 'cancel')); |
703 | deferredResult.callback(); | 700 | deferredResult.callback(); |
704 | 701 | ||
705 | return deferredResult; | 702 | return deferredResult; |
706 | */ | 703 | */ |
707 | MochiKit.Signal.signal(this, 'cancel'); | 704 | MochiKit.Signal.signal(this, 'cancel'); |
708 | }, | 705 | }, |
709 | 706 | ||
710 | 'handleCancelEvent': function (anEvent) { | 707 | 'handleCancelEvent': function (anEvent) { |
711 | anEvent.preventDefault(); | 708 | anEvent.preventDefault(); |
712 | this.cancel(); | 709 | this.cancel(); |
713 | }, | 710 | }, |
714 | 711 | ||
715 | //------------------------------------------------------------------------- | 712 | //------------------------------------------------------------------------- |
716 | 713 | ||
717 | 'handleSaveEvent': function (anEvent) { | 714 | 'handleSaveEvent': function (anEvent) { |
718 | anEvent.preventDefault(); | 715 | anEvent.preventDefault(); |
719 | 716 | ||
720 | if (! MochiKit.DOM.hasElementClass(anEvent.src(), 'disabled')) { | 717 | if (! MochiKit.DOM.hasElementClass(anEvent.src(), 'disabled')) { |
721 | MochiKit.Signal.signal(this, 'save'); | 718 | MochiKit.Signal.signal(this, 'save'); |
722 | } | 719 | } |
723 | }, | 720 | }, |
724 | 721 | ||
725 | //------------------------------------------------------------------------- | 722 | //------------------------------------------------------------------------- |
726 | 723 | ||
727 | 'handleAddDirectLogin': function (anEvent) { | 724 | 'handleAddDirectLogin': function (anEvent) { |
728 | anEvent.preventDefault(); | 725 | anEvent.preventDefault(); |
729 | 726 | ||
730 | MochiKit.Signal.signal(this, 'addDirectLogin'); | 727 | MochiKit.Signal.signal(this, 'addDirectLogin'); |
731 | }, | 728 | }, |
732 | 729 | ||
733 | //------------------------------------------------------------------------- | 730 | //------------------------------------------------------------------------- |
734 | 731 | ||
735 | 'handleOnFocusEvent': function (anElement, anEvent) { | 732 | 'handleOnFocusEvent': function (anElement, anEvent) { |
736 | this.unselectCurrentSelectedItems(); | 733 | this.unselectCurrentSelectedItems(); |
737 | MochiKit.DOM.addElementClass(anElement, 'selectedField'); | 734 | MochiKit.DOM.addElementClass(anElement, 'selectedField'); |
738 | }, | 735 | }, |
739 | 736 | ||
740 | 'handleLooseFocusEvent': function (anElement, anEvent) { | 737 | 'handleLooseFocusEvent': function (anElement, anEvent) { |
741 | this.unselectCurrentSelectedItems(); | 738 | this.unselectCurrentSelectedItems(); |
742 | }, | 739 | }, |
743 | 740 | ||
744 | //------------------------------------------------------------------------- | 741 | //------------------------------------------------------------------------- |
745 | 742 | ||
746 | 'handleTabSelected': function (aSelectedTab) { | 743 | 'handleTabSelected': function (aSelectedTab) { |
747 | this.unselectCurrentSelectedItems(); | 744 | this.unselectCurrentSelectedItems(); |
748 | 745 | ||
749 | switch (aSelectedTab) { | 746 | switch (aSelectedTab) { |
750 | case 'DETAILS': | 747 | case 'DETAILS': |
751 | // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); | 748 | // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); |
752 | break; | 749 | break; |
753 | case 'DIRECT_LOGINS': | 750 | case 'DIRECT_LOGINS': |
754 | // MochiKit.Style.showElement(this.getElement('addDirectLoginButton')); | 751 | // MochiKit.Style.showElement(this.getElement('addDirectLoginButton')); |
755 | break; | 752 | break; |
756 | case 'SHARING': | 753 | case 'SHARING': |
757 | // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); | 754 | // MochiKit.Style.hideElement(this.getElement('addDirectLoginButton')); |
758 | break; | 755 | break; |
759 | } | 756 | } |
760 | }, | 757 | }, |
761 | 758 | ||
762 | //------------------------------------------------------------------------- | 759 | //------------------------------------------------------------------------- |
763 | 760 | ||
764 | 'handleKeyEvent': function (anEvent) { | 761 | 'handleKeyEvent': function (anEvent) { |
765 | //console.log("####", anEvent.key().string); | ||
766 | if (anEvent.key().string == 'KEY_ESCAPE') { | 762 | if (anEvent.key().string == 'KEY_ESCAPE') { |
767 | MochiKit.Signal.signal(this, 'changedValue'); | 763 | MochiKit.Signal.signal(this, 'changedValue'); |
768 | this.cancel(); | 764 | this.cancel(); |
769 | } else if (anEvent.key().string == 'KEY_ENTER') { | 765 | } else if (anEvent.key().string == 'KEY_ENTER') { |
770 | if (anEvent.target().nodeName == 'TEXTAREA') { | 766 | if (anEvent.target().nodeName == 'TEXTAREA') { |
771 | 767 | ||
772 | } else { | 768 | } else { |
773 | anEvent.preventDefault(); | 769 | anEvent.preventDefault(); |
774 | } | 770 | } |
775 | } | 771 | } |
776 | }, | 772 | }, |
777 | 773 | ||
778 | //========================================================================= | 774 | //========================================================================= |
779 | 775 | ||
780 | 'askConfirmationForLoosingPendingChanges': function () { | 776 | 'askConfirmationForLoosingPendingChanges': function () { |
781 | var deferredResult; | 777 | var deferredResult; |
782 | var confirmationDialog; | 778 | var confirmationDialog; |
783 | 779 | ||
784 | confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ | 780 | confirmationDialog = new Clipperz.PM.UI.Common.Components.SimpleMessagePanel({ |
785 | title:"Alert", | 781 | title:"Alert", |
786 | text:"Should lost pending changes?", | 782 | text:"Should lost pending changes?", |
787 | type:'ALERT', | 783 | type:'ALERT', |
788 | buttons: [ | 784 | buttons: [ |
789 | {text:"Cancel",result:'CANCEL', isDefault:true}, | 785 | {text:"Cancel",result:'CANCEL', isDefault:true}, |
790 | {text:"Ok", result:'OK'} | 786 | {text:"Ok", result:'OK'} |
791 | ] | 787 | ] |
792 | }); | 788 | }); |
793 | 789 | ||
794 | deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.askConfirmationForLoosingPendingChanges", {trace:false}); | 790 | deferredResult = new Clipperz.Async.Deferred("CardDialogComponent.askConfirmationForLoosingPendingChanges", {trace:false}); |
795 | // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()}); | 791 | // deferredResult = confirmationDialog.deferredShow({openFromElement:anEvent.src(), onOkCloseToElement:MochiKit.DOM.currentDocument().body, onCancelCloseToElement:anEvent.src()}); |
796 | deferredResult.addMethod(confirmationDialog, 'deferredShow', { | 792 | deferredResult.addMethod(confirmationDialog, 'deferredShow', { |
797 | 'openFromElement': this.getElement('cancelButton'), | 793 | 'openFromElement': this.getElement('cancelButton'), |
798 | 'onOkCloseToElement': null, //this.getElement('cancelButton'), | 794 | 'onOkCloseToElement': null, //this.getElement('cancelButton'), |
799 | 'onCancelCloseToElement':this.getElement('cancelButton') | 795 | 'onCancelCloseToElement':this.getElement('cancelButton') |
800 | }); | 796 | }); |
801 | // deferredResult.addCallback(function () { console.log("DELETE: " + anObject.toString(), anObject); }); | ||
802 | // deferredResult.addErrbackPass(function () { console.log("skip deletion: " + anObject.toString(), anObject); }); | ||
803 | deferredResult.callback(); | 797 | deferredResult.callback(); |
804 | 798 | ||
805 | return deferredResult; | 799 | return deferredResult; |
806 | }, | 800 | }, |
807 | 801 | ||
808 | //========================================================================= | 802 | //========================================================================= |
809 | 803 | ||
810 | 'showDirectLoginEditingComponent': function () { | 804 | 'showDirectLoginEditingComponent': function () { |
811 | varwidth; | 805 | varwidth; |
812 | var transition; | 806 | var transition; |
813 | var duration; | 807 | var duration; |
814 | 808 | ||
815 | width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; | 809 | width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; |
816 | transition = MochiKit.Visual.Transitions.sinoidal; | 810 | transition = MochiKit.Visual.Transitions.sinoidal; |
817 | duration = 1; | 811 | duration = 1; |
818 | 812 | ||
819 | return Clipperz.Async.callbacks("CardDialogComponent.showDirectLoginEditingComponent", [ | 813 | return Clipperz.Async.callbacks("CardDialogComponent.showDirectLoginEditingComponent", [ |
820 | MochiKit.Base.method(this, 'disableCardTitleEditing'), | 814 | MochiKit.Base.method(this, 'disableCardTitleEditing'), |
821 | MochiKit.Base.method(this.tabPanelController(), 'disable'), | 815 | MochiKit.Base.method(this.tabPanelController(), 'disable'), |
822 | 816 | ||
823 | MochiKit.Base.bind(function () { | 817 | MochiKit.Base.bind(function () { |
824 | MochiKit.Style.setElementPosition (this.getElement('directLoginEditDetail'), {x:width, y:-MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); | 818 | MochiKit.Style.setElementPosition (this.getElement('directLoginEditDetail'), {x:width, y:-MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); |
825 | MochiKit.Style.setElementDimensions(this.getElement('directLoginEditDetail'), {w:width}); | 819 | MochiKit.Style.setElementDimensions(this.getElement('directLoginEditDetail'), {w:width}); |
826 | MochiKit.Style.showElement(this.getElement('directLoginEditDetail')); | 820 | MochiKit.Style.showElement(this.getElement('directLoginEditDetail')); |
827 | MochiKit.Style.setOpacity(this.getElement('directLoginEditDetail'), 0); | 821 | MochiKit.Style.setOpacity(this.getElement('directLoginEditDetail'), 0); |
828 | MochiKit.Style.setElementDimensions(this.getElement('directLoginsComponentContainer'), { | 822 | MochiKit.Style.setElementDimensions(this.getElement('directLoginsComponentContainer'), { |
829 | h:Math.max( | 823 | h:Math.max( |
830 | MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h'], | 824 | MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h'], |
831 | MochiKit.Style.getElementDimensions(this.getElement('directLoginEditDetail'))['h'] | 825 | MochiKit.Style.getElementDimensions(this.getElement('directLoginEditDetail'))['h'] |
832 | ) | 826 | ) |
833 | }); | 827 | }); |
834 | // MochiKit.Style.setElementDimensions(this.getElement('directLoginsComponentContainer'), {h:MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); | 828 | // MochiKit.Style.setElementDimensions(this.getElement('directLoginsComponentContainer'), {h:MochiKit.Style.getElementDimensions(this.getElement('directLogins'))['h']}); |
835 | }, this), | 829 | }, this), |
836 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimations,MochiKit.Visual.Parallel, [ | 830 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimations,MochiKit.Visual.Parallel, [ |
837 | new MochiKit.Visual.Move(this.getElement('directLogins'), {x:-width, y:0, mode:'relative', transition:transition, sync:true}), | 831 | new MochiKit.Visual.Move(this.getElement('directLogins'), {x:-width, y:0, mode:'relative', transition:transition, sync:true}), |
838 | new MochiKit.Visual.Opacity(this.getElement('directLogins'), {from:1.0, to:0.0, transition:transition, sync:true}), | 832 | new MochiKit.Visual.Opacity(this.getElement('directLogins'), {from:1.0, to:0.0, transition:transition, sync:true}), |
839 | new MochiKit.Visual.Move(this.getElement('directLoginEditDetail'), {x:-width, y:0, mode:'relative', transition:transition, sync:true}), | 833 | new MochiKit.Visual.Move(this.getElement('directLoginEditDetail'), {x:-width, y:0, mode:'relative', transition:transition, sync:true}), |
840 | new MochiKit.Visual.Opacity(this.getElement('directLoginEditDetail'),{from:0.0, to:1.0, transition:transition, sync:true}) | 834 | new MochiKit.Visual.Opacity(this.getElement('directLoginEditDetail'),{from:0.0, to:1.0, transition:transition, sync:true}) |
841 | ], {duration:duration}), | 835 | ], {duration:duration}), |
842 | 836 | ||
843 | MochiKit.Base.noop | 837 | MochiKit.Base.noop |
844 | ], {trace:false}); | 838 | ], {trace:false}); |
845 | }, | 839 | }, |
846 | 840 | ||
847 | //------------------------------------------------------------------------- | 841 | //------------------------------------------------------------------------- |
848 | 842 | ||
849 | 'hideDirectLoginEditingComponent': function () { | 843 | 'hideDirectLoginEditingComponent': function () { |
850 | varwidth; | 844 | varwidth; |
851 | var transition; | 845 | var transition; |
852 | var duration; | 846 | var duration; |
853 | 847 | ||
854 | width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; | 848 | width = MochiKit.Style.getElementDimensions(this.getElement('directLoginsComponentContainer'))['w']; |
855 | transition = MochiKit.Visual.Transitions.sinoidal; | 849 | transition = MochiKit.Visual.Transitions.sinoidal; |
856 | duration = 1; | 850 | duration = 1; |
857 | 851 | ||
858 | return Clipperz.Async.callbacks("CardDialogComponent.hideDirectLoginEditingComponent", [ | 852 | return Clipperz.Async.callbacks("CardDialogComponent.hideDirectLoginEditingComponent", [ |
859 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimations,MochiKit.Visual.Parallel, [ | 853 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimations,MochiKit.Visual.Parallel, [ |
860 | new MochiKit.Visual.Move(this.getElement('directLogins'), {x:width, y:0, mode:'relative', transition:transition, sync:true}), | 854 | new MochiKit.Visual.Move(this.getElement('directLogins'), {x:width, y:0, mode:'relative', transition:transition, sync:true}), |
861 | new MochiKit.Visual.Opacity(this.getElement('directLogins'), {from:0.0, to:1.0, transition:transition, sync:true}), | 855 | new MochiKit.Visual.Opacity(this.getElement('directLogins'), {from:0.0, to:1.0, transition:transition, sync:true}), |
862 | new MochiKit.Visual.Move(this.getElement('directLoginEditDetail'), {x:width, y:0, mode:'relative', transition:transition, sync:true}), | 856 | new MochiKit.Visual.Move(this.getElement('directLoginEditDetail'), {x:width, y:0, mode:'relative', transition:transition, sync:true}), |
863 | new MochiKit.Visual.Opacity(this.getElement('directLoginEditDetail'),{from:1.0, to:0.0, transition:transition, sync:true}) | 857 | new MochiKit.Visual.Opacity(this.getElement('directLoginEditDetail'),{from:1.0, to:0.0, transition:transition, sync:true}) |
864 | ], {duration:duration}), | 858 | ], {duration:duration}), |
865 | // MochiKit.Base.partial(MochiKit.Visual.appear, this.getElement('addDirectLoginButton'), {duration:0.3}), | 859 | // MochiKit.Base.partial(MochiKit.Visual.appear, this.getElement('addDirectLoginButton'), {duration:0.3}), |
866 | Clipperz.Async.clearResult, | 860 | Clipperz.Async.clearResult, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js index 2e61f5f..0cee650 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js | |||
@@ -1,179 +1,173 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._faviconComponent = null; | 32 | this._faviconComponent = null; |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | //============================================================================= | 37 | //============================================================================= |
40 | 38 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
42 | 40 | ||
43 | //------------------------------------------------------------------------- | 41 | //------------------------------------------------------------------------- |
44 | 42 | ||
45 | 'toString': function () { | 43 | 'toString': function () { |
46 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component"; | 44 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginComponent component"; |
47 | }, | 45 | }, |
48 | 46 | ||
49 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
50 | 48 | ||
51 | 'reference': function () { | 49 | 'reference': function () { |
52 | return this._reference; | 50 | return this._reference; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
56 | 54 | ||
57 | 'renderSelf': function() { | 55 | 'renderSelf': function() { |
58 | //console.log(">>> CardDialogRecordDirectLoginComponent.renderSelf"); | ||
59 | this.append(this.element(), [ | 56 | this.append(this.element(), [ |
60 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[ | 57 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[ |
61 | {tag:'img', cls:'favicon', id:this.getId('favicon')} | 58 | {tag:'img', cls:'favicon', id:this.getId('favicon')} |
62 | ]}, | 59 | ]}, |
63 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[ | 60 | {tag:'div', cls:'cardDialogRecordDirectLoginComponent_label', children:[ |
64 | {tag:'input', id:this.getId('label'), type:'text'} | 61 | {tag:'input', id:this.getId('label'), type:'text'} |
65 | ]}, | 62 | ]}, |
66 | {tag:'div', cls:'open', children:[ | 63 | {tag:'div', cls:'open', children:[ |
67 | {tag:'span', children:[ | 64 | {tag:'span', children:[ |
68 | {tag:'a', href:'open', id:this.getId('open'), html:' '} | 65 | {tag:'a', href:'open', id:this.getId('open'), html:' '} |
69 | ]} | 66 | ]} |
70 | ]}, | 67 | ]}, |
71 | {tag:'div', cls:'edit', children:[ | 68 | {tag:'div', cls:'edit', children:[ |
72 | {tag:'span', children:[ | 69 | {tag:'span', children:[ |
73 | {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"} | 70 | {tag:'a', href:'edit', id:this.getId('edit'), html:"edit"} |
74 | ]} | 71 | ]} |
75 | ]}, | 72 | ]}, |
76 | {tag:'div', cls:'delete', children:[ | 73 | {tag:'div', cls:'delete', children:[ |
77 | {tag:'span', children:[ | 74 | {tag:'span', children:[ |
78 | {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"} | 75 | {tag:'a', href:'delete', id:this.getId('delete'), html:"delete"} |
79 | ]} | 76 | ]} |
80 | ]} | 77 | ]} |
81 | /* | 78 | /* |
82 | {tag:'td', cls:'fieldState'}, | 79 | {tag:'td', cls:'fieldState'}, |
83 | {tag:'td', cls:'fieldLabel', children:[ | 80 | {tag:'td', cls:'fieldLabel', children:[ |
84 | {tag:'input', cls:'label', id:this.getId('label')} | 81 | {tag:'input', cls:'label', id:this.getId('label')} |
85 | ]}, | 82 | ]}, |
86 | {tag:'td', cls:'fieldLock', children:[ | 83 | {tag:'td', cls:'fieldLock', children:[ |
87 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | 84 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} |
88 | ]}, | 85 | ]}, |
89 | {tag:'td', cls:'fieldValue', children:[ | 86 | {tag:'td', cls:'fieldValue', children:[ |
90 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | 87 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ |
91 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | 88 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} |
92 | ]} | 89 | ]} |
93 | ]}, | 90 | ]}, |
94 | {tag:'td', cls:'fieldAddDelete', children:[ | 91 | {tag:'td', cls:'fieldAddDelete', children:[ |
95 | {tag:'div', cls:'delete', children:[ | 92 | {tag:'div', cls:'delete', children:[ |
96 | {tag:'span', children:[ | 93 | {tag:'span', children:[ |
97 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | 94 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} |
98 | ]} | 95 | ]} |
99 | ]} | 96 | ]} |
100 | ]} | 97 | ]} |
101 | */ | 98 | */ |
102 | ]); | 99 | ]); |
103 | 100 | ||
104 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 101 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
105 | MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin'); | 102 | MochiKit.Signal.connect(this.getId('open'), 'onclick',this, 'openDirectLogin'); |
106 | MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin'); | 103 | MochiKit.Signal.connect(this.getId('edit'), 'onclick',this, 'editDirectLogin'); |
107 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin'); | 104 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteDirectLogin'); |
108 | }, | 105 | }, |
109 | 106 | ||
110 | //------------------------------------------------------------------------- | 107 | //------------------------------------------------------------------------- |
111 | 108 | ||
112 | 'shouldShowElementWhileRendering': function () { | 109 | 'shouldShowElementWhileRendering': function () { |
113 | return false; | 110 | return false; |
114 | }, | 111 | }, |
115 | 112 | ||
116 | //------------------------------------------------------------------------- | 113 | //------------------------------------------------------------------------- |
117 | 114 | ||
118 | 'faviconComponent': function () { | 115 | 'faviconComponent': function () { |
119 | if (this._faviconComponent == null) { | 116 | if (this._faviconComponent == null) { |
120 | //console.log("created the FAVICON component"); | ||
121 | this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); | 117 | this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')}); |
122 | } | 118 | } |
123 | 119 | ||
124 | return this._faviconComponent; | 120 | return this._faviconComponent; |
125 | }, | 121 | }, |
126 | 122 | ||
127 | //========================================================================= | 123 | //========================================================================= |
128 | 124 | ||
129 | 'label': function () { | 125 | 'label': function () { |
130 | return this.getElement('label').value; | 126 | return this.getElement('label').value; |
131 | }, | 127 | }, |
132 | 128 | ||
133 | 'setLabel': function (aValue) { | 129 | 'setLabel': function (aValue) { |
134 | this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); | 130 | this.getElement('label').value = Clipperz.Base.sanitizeString(aValue); |
135 | }, | 131 | }, |
136 | 132 | ||
137 | //------------------------------------------------------------------------- | 133 | //------------------------------------------------------------------------- |
138 | 134 | ||
139 | 'favicon': function () { | 135 | 'favicon': function () { |
140 | // return this.getElement('favicon').src; | 136 | // return this.getElement('favicon').src; |
141 | return this.faviconComponent().src(); | 137 | return this.faviconComponent().src(); |
142 | }, | 138 | }, |
143 | 139 | ||
144 | 'setFavicon': function (aValue) { | 140 | 'setFavicon': function (aValue) { |
145 | // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue); | 141 | // this.getElement('favicon').src = Clipperz.Base.sanitizeString(aValue); |
146 | this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue)); | 142 | this.faviconComponent().setSrc(Clipperz.Base.sanitizeString(aValue)); |
147 | }, | 143 | }, |
148 | 144 | ||
149 | //========================================================================= | 145 | //========================================================================= |
150 | 146 | ||
151 | 'openDirectLogin': function (anEvent) { | 147 | 'openDirectLogin': function (anEvent) { |
152 | anEvent.preventDefault(); | 148 | anEvent.preventDefault(); |
153 | 149 | ||
154 | MochiKit.Signal.signal(this, 'openDirectLogin', this.reference()); | 150 | MochiKit.Signal.signal(this, 'openDirectLogin', this.reference()); |
155 | }, | 151 | }, |
156 | 152 | ||
157 | //------------------------------------------------------------------------- | 153 | //------------------------------------------------------------------------- |
158 | 154 | ||
159 | 'editDirectLogin': function (anEvent) { | 155 | 'editDirectLogin': function (anEvent) { |
160 | anEvent.preventDefault(); | 156 | anEvent.preventDefault(); |
161 | 157 | ||
162 | MochiKit.Signal.signal(this, 'editDirectLogin', this.reference()); | 158 | MochiKit.Signal.signal(this, 'editDirectLogin', this.reference()); |
163 | //console.log("EDIT DIRECT LOGIN"); | ||
164 | }, | 159 | }, |
165 | 160 | ||
166 | //------------------------------------------------------------------------- | 161 | //------------------------------------------------------------------------- |
167 | 162 | ||
168 | 'deleteDirectLogin': function (anEvent) { | 163 | 'deleteDirectLogin': function (anEvent) { |
169 | anEvent.preventDefault(); | 164 | anEvent.preventDefault(); |
170 | 165 | ||
171 | MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference()); | 166 | MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference()); |
172 | //console.log("DELETE DIRECT LOGIN"); | ||
173 | }, | 167 | }, |
174 | 168 | ||
175 | 169 | ||
176 | 170 | ||
177 | //========================================================================= | 171 | //========================================================================= |
178 | __syntaxFix__: "syntax fix" | 172 | __syntaxFix__: "syntax fix" |
179 | }); | 173 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js index b58062c..689406a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._reference = args.reference|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._actionType = null; | 32 | this._actionType = null; |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | //============================================================================= | 37 | //============================================================================= |
40 | 38 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
42 | 40 | ||
43 | //------------------------------------------------------------------------- | 41 | //------------------------------------------------------------------------- |
44 | 42 | ||
45 | 'toString': function () { | 43 | 'toString': function () { |
46 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; | 44 | return "Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponent component"; |
47 | }, | 45 | }, |
48 | 46 | ||
49 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
50 | 48 | ||
51 | 'renderSelf': function() { | 49 | 'renderSelf': function() { |
52 | this.append(this.element(), [ | 50 | this.append(this.element(), [ |
53 | {tag:'td', cls:'fieldState'}, | 51 | {tag:'td', cls:'fieldState'}, |
54 | {tag:'td', cls:'fieldLabel', children:[ | 52 | {tag:'td', cls:'fieldLabel', children:[ |
55 | {tag:'input', cls:'label', id:this.getId('label')} | 53 | {tag:'input', cls:'label', id:this.getId('label')} |
56 | ]}, | 54 | ]}, |
57 | {tag:'td', cls:'fieldLock', children:[ | 55 | {tag:'td', cls:'fieldLock', children:[ |
58 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} | 56 | {tag:'div', cls:'unlocked', id:this.getId('isHidden')} |
59 | ]}, | 57 | ]}, |
60 | {tag:'td', cls:'fieldValue', children:[ | 58 | {tag:'td', cls:'fieldValue', children:[ |
61 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ | 59 | {tag:'div', cls:'unlocked', id:this.getId('valueWrapper'), children:[ |
62 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} | 60 | {tag:'input', type:'text', cls:'value', id:this.getId('value')} |
63 | ]} | 61 | ]} |
64 | ]}, | 62 | ]}, |
65 | {tag:'td', cls:'fieldAction', children:[ | 63 | {tag:'td', cls:'fieldAction', children:[ |
66 | {tag:'a', href:'#', id:this.getId('actionLink'), html:' '} | 64 | {tag:'a', href:'#', id:this.getId('actionLink'), html:' '} |
67 | ]}, | 65 | ]}, |
68 | {tag:'td', cls:'fieldAddDelete', children:[ | 66 | {tag:'td', cls:'fieldAddDelete', children:[ |
69 | {tag:'div', cls:'delete', children:[ | 67 | {tag:'div', cls:'delete', children:[ |
70 | {tag:'span', children:[ | 68 | {tag:'span', children:[ |
71 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} | 69 | {tag:'a', href:'#', id:this.getId('delete'), html:"delete"} |
72 | ]} | 70 | ]} |
73 | ]} | 71 | ]} |
74 | ]} | 72 | ]} |
75 | ]); | 73 | ]); |
76 | 74 | ||
77 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 75 | MochiKit.Signal.connect(this.getId('label'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
78 | MochiKit.Signal.connect(this.getId('isHidden'), 'onclick',this, 'toggleIsHidden'); | 76 | MochiKit.Signal.connect(this.getId('isHidden'), 'onclick',this, 'toggleIsHidden'); |
79 | MochiKit.Signal.connect(this.getId('value'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); | 77 | MochiKit.Signal.connect(this.getId('value'), 'onkeyup',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'changedValue')); |
80 | MochiKit.Signal.connect(this.getId('actionLink'), 'onclick',this, 'handleActionLink'); | 78 | MochiKit.Signal.connect(this.getId('actionLink'), 'onclick',this, 'handleActionLink'); |
81 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteField'); | 79 | MochiKit.Signal.connect(this.getId('delete'), 'onclick',this, 'deleteField'); |
82 | // MochiKit.Signal.connect(this.getId('delete'), 'onclick',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'deleteField', this.reference())); | 80 | // MochiKit.Signal.connect(this.getId('delete'), 'onclick',MochiKit.Base.partial(MochiKit.Signal.signal, this, 'deleteField', this.reference())); |
83 | }, | 81 | }, |
84 | 82 | ||
85 | //------------------------------------------------------------------------- | 83 | //------------------------------------------------------------------------- |
86 | 84 | ||
@@ -108,80 +106,78 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponen | |||
108 | //========================================================================= | 106 | //========================================================================= |
109 | 107 | ||
110 | 'value': function () { | 108 | 'value': function () { |
111 | return this.getElement('value').value; | 109 | return this.getElement('value').value; |
112 | }, | 110 | }, |
113 | 111 | ||
114 | 'setValue': function (aValue) { | 112 | 'setValue': function (aValue) { |
115 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); | 113 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); |
116 | this.getElement('value').value = aValue; | 114 | this.getElement('value').value = aValue; |
117 | }, | 115 | }, |
118 | 116 | ||
119 | //------------------------------------------------------------------------- | 117 | //------------------------------------------------------------------------- |
120 | 118 | ||
121 | 'actionType': function () { | 119 | 'actionType': function () { |
122 | return this._actionType; | 120 | return this._actionType; |
123 | }, | 121 | }, |
124 | 122 | ||
125 | 'setActionType': function (anActionType) { | 123 | 'setActionType': function (anActionType) { |
126 | this._actionType = anActionType; | 124 | this._actionType = anActionType; |
127 | 125 | ||
128 | switch (this._actionType) { | 126 | switch (this._actionType) { |
129 | case 'NONE': | 127 | case 'NONE': |
130 | MochiKit.Style.hideElement(this.getId('actionLink')); | 128 | MochiKit.Style.hideElement(this.getId('actionLink')); |
131 | MochiKit.DOM.setElementClass(this.getId('actionLink'), ''); | 129 | MochiKit.DOM.setElementClass(this.getId('actionLink'), ''); |
132 | break; | 130 | break; |
133 | case 'URL': | 131 | case 'URL': |
134 | MochiKit.Style.showElement(this.getId('actionLink')); | 132 | MochiKit.Style.showElement(this.getId('actionLink')); |
135 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'url'); | 133 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'url'); |
136 | break; | 134 | break; |
137 | case 'EMAIL': | 135 | case 'EMAIL': |
138 | MochiKit.Style.showElement(this.getId('actionLink')); | 136 | MochiKit.Style.showElement(this.getId('actionLink')); |
139 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'email'); | 137 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'email'); |
140 | break; | 138 | break; |
141 | case 'PASSWORD': | 139 | case 'PASSWORD': |
142 | MochiKit.Style.showElement(this.getId('actionLink')); | 140 | MochiKit.Style.showElement(this.getId('actionLink')); |
143 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'password'); | 141 | MochiKit.DOM.setElementClass(this.getId('actionLink'), 'password'); |
144 | break; | 142 | break; |
145 | } | 143 | } |
146 | }, | 144 | }, |
147 | 145 | ||
148 | //========================================================================= | 146 | //========================================================================= |
149 | 147 | ||
150 | 'isHidden': function () { | 148 | 'isHidden': function () { |
151 | // return this.getElement('value').value; | 149 | // return this.getElement('value').value; |
152 | return MochiKit.DOM.hasElementClass(this.getElement('isHidden'), 'locked'); | 150 | return MochiKit.DOM.hasElementClass(this.getElement('isHidden'), 'locked'); |
153 | }, | 151 | }, |
154 | 152 | ||
155 | 'setIsHidden': function (aValue) { | 153 | 'setIsHidden': function (aValue) { |
156 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); | 154 | // this.getElement('value').value = Clipperz.Base.sanitizeString(aValue); |
157 | MochiKit.DOM.setElementClass(this.getElement('isHidden'), (aValue ? 'locked': 'unlocked')); | 155 | MochiKit.DOM.setElementClass(this.getElement('isHidden'), (aValue ? 'locked': 'unlocked')); |
158 | MochiKit.DOM.setElementClass(this.getElement('valueWrapper'), (aValue ? 'locked': 'unlocked')); | 156 | MochiKit.DOM.setElementClass(this.getElement('valueWrapper'), (aValue ? 'locked': 'unlocked')); |
159 | }, | 157 | }, |
160 | 158 | ||
161 | 'toggleIsHidden': function (anEvent) { | 159 | 'toggleIsHidden': function (anEvent) { |
162 | anEvent.preventDefault(); | 160 | anEvent.preventDefault(); |
163 | 161 | ||
164 | this.setIsHidden(! this.isHidden()); | 162 | this.setIsHidden(! this.isHidden()); |
165 | MochiKit.Signal.signal(this, 'changedValue'); | 163 | MochiKit.Signal.signal(this, 'changedValue'); |
166 | }, | 164 | }, |
167 | 165 | ||
168 | //========================================================================= | 166 | //========================================================================= |
169 | 167 | ||
170 | 'handleActionLink': function (anEvent) { | 168 | 'handleActionLink': function (anEvent) { |
171 | anEvent.preventDefault(); | 169 | anEvent.preventDefault(); |
172 | |||
173 | //console.log("ACTION LINK - " + this.actionType()); | ||
174 | MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target()); | 170 | MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target()); |
175 | }, | 171 | }, |
176 | 172 | ||
177 | //========================================================================= | 173 | //========================================================================= |
178 | 174 | ||
179 | 'deleteField': function (anEvent) { | 175 | 'deleteField': function (anEvent) { |
180 | anEvent.preventDefault(); | 176 | anEvent.preventDefault(); |
181 | 177 | ||
182 | MochiKit.Signal.signal(this, 'deleteField', this.reference()); | 178 | MochiKit.Signal.signal(this, 'deleteField', this.reference()); |
183 | }, | 179 | }, |
184 | 180 | ||
185 | //========================================================================= | 181 | //========================================================================= |
186 | __syntaxFix__: "syntax fix" | 182 | __syntaxFix__: "syntax fix" |
187 | }); | 183 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js index 391c379..41e32a0 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.ColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.ColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.ColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.ColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | this._name = args.name || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._name = args.name || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | this._selector = args.selector|| Clipperz.Base.exception.raise('MandatoryParameter');; | 33 | this._selector = args.selector|| Clipperz.Base.exception.raise('MandatoryParameter');; |
36 | this._label = args.label || null; | 34 | this._label = args.label || null; |
37 | this._isSortable = args.sortable|| false; | 35 | this._isSortable = args.sortable|| false; |
38 | this._comparator = args.comparator|| null; | 36 | this._comparator = args.comparator|| null; |
39 | this._sorted = args.sorted || 'UNSORTED'; //'ASCENDING' | 'DESCENDING' | 'UNSORTED' | 37 | this._sorted = args.sorted || 'UNSORTED'; //'ASCENDING' | 'DESCENDING' | 'UNSORTED' |
40 | this._cssClass = args.cssClass|| ''; | 38 | this._cssClass = args.cssClass|| ''; |
41 | 39 | ||
42 | this._signalIdentifiers = []; | 40 | this._signalIdentifiers = []; |
43 | 41 | ||
44 | return this; | 42 | return this; |
45 | } | 43 | } |
46 | 44 | ||
47 | //============================================================================= | 45 | //============================================================================= |
48 | 46 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ColumnManager, Clipperz.PM.UI.Common.Components.BaseComponent, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ColumnManager, Clipperz.PM.UI.Common.Components.BaseComponent, { |
50 | 48 | ||
51 | 'toString': function () { | 49 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Web.Components.ColumnManager - " + this._name; | 50 | return "Clipperz.PM.UI.Web.Components.ColumnManager - " + this._name; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | 'name': function () { | 53 | 'name': function () { |
56 | return this._name; | 54 | return this._name; |
57 | }, | 55 | }, |
58 | 56 | ||
59 | 'label': function () { | 57 | 'label': function () { |
60 | return this._label; | 58 | return this._label; |
61 | }, | 59 | }, |
62 | 60 | ||
63 | 'selector': function () { | 61 | 'selector': function () { |
64 | return this._selector; | 62 | return this._selector; |
65 | }, | 63 | }, |
66 | 64 | ||
67 | 'comparator': function() { | 65 | 'comparator': function() { |
68 | return this._comparator; | 66 | return this._comparator; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | 'cssClass': function() { | 69 | 'cssClass': function() { |
72 | return this._cssClass; | 70 | return this._cssClass; |
73 | }, | 71 | }, |
74 | 72 | ||
75 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
76 | 74 | ||
77 | 'isSortable': function () { | 75 | 'isSortable': function () { |
78 | return this._isSortable; | 76 | return this._isSortable; |
79 | }, | 77 | }, |
80 | 78 | ||
81 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
82 | 80 | ||
83 | 'sorted': function () { | 81 | 'sorted': function () { |
84 | return this._sorted; | 82 | return this._sorted; |
85 | }, | 83 | }, |
86 | 84 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js index d3aa175..3d0ba76 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js | |||
@@ -1,68 +1,66 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | return this; | 31 | return this; |
34 | } | 32 | } |
35 | 33 | ||
36 | //============================================================================= | 34 | //============================================================================= |
37 | 35 | ||
38 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 36 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
39 | 37 | ||
40 | //------------------------------------------------------------------------- | 38 | //------------------------------------------------------------------------- |
41 | 39 | ||
42 | 'toString': function () { | 40 | 'toString': function () { |
43 | return "Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent component"; | 41 | return "Clipperz.PM.UI.Web.Components.CreateNewCardSplashComponent component"; |
44 | }, | 42 | }, |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'renderSelf': function() { | 46 | 'renderSelf': function() { |
49 | this.append(this.element(), [ | 47 | this.append(this.element(), [ |
50 | {tag:'div', cls:'createNewCardSplash', id:this.getId('button'), children:[ | 48 | {tag:'div', cls:'createNewCardSplash', id:this.getId('button'), children:[ |
51 | {tag:'span', html:"Create New Card"} | 49 | {tag:'span', html:"Create New Card"} |
52 | ]} | 50 | ]} |
53 | ]); | 51 | ]); |
54 | 52 | ||
55 | MochiKit.Signal.connect(this.getElement('button'), 'onclick', this, 'handleClick'); | 53 | MochiKit.Signal.connect(this.getElement('button'), 'onclick', this, 'handleClick'); |
56 | }, | 54 | }, |
57 | 55 | ||
58 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
59 | 57 | ||
60 | 'handleClick': function (anEvent) { | 58 | 'handleClick': function (anEvent) { |
61 | anEvent.preventDefault(); | 59 | anEvent.preventDefault(); |
62 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'addCard', this.element()); | 60 | MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'addCard', this.element()); |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | __syntaxFix__: "syntax fix" | 65 | __syntaxFix__: "syntax fix" |
68 | }); | 66 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js index 462d864..23f6710 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.DataPanel = function(args) { | 26 | Clipperz.PM.UI.Web.Components.DataPanel = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.DataPanel.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.DataPanel.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._initiallySelectedTab = args.selected || 'OFFLINE_COPY'; | 31 | this._initiallySelectedTab = args.selected || 'OFFLINE_COPY'; |
34 | this._tabPanelControllerConfiguration = { | 32 | this._tabPanelControllerConfiguration = { |
35 | 'OFFLINE_COPY': { | 33 | 'OFFLINE_COPY': { |
36 | tab:'offlineCopyTab', | 34 | tab:'offlineCopyTab', |
37 | panel:'offlineCopyPanel' | 35 | panel:'offlineCopyPanel' |
38 | }, | 36 | }, |
39 | 'SHARING': { | 37 | 'SHARING': { |
40 | tab:'sharingTab', | 38 | tab:'sharingTab', |
41 | panel:'sharingPanel' | 39 | panel:'sharingPanel' |
42 | }, | 40 | }, |
43 | 'IMPORT': { | 41 | 'IMPORT': { |
44 | tab:'importTab', | 42 | tab:'importTab', |
45 | panel:'importPanel' | 43 | panel:'importPanel' |
46 | }, | 44 | }, |
47 | 'EXPORT': { | 45 | 'EXPORT': { |
48 | tab:'exportTab', | 46 | tab:'exportTab', |
49 | panel:'exportPanel' | 47 | panel:'exportPanel' |
50 | } | 48 | } |
51 | }; | 49 | }; |
52 | 50 | ||
53 | return this; | 51 | return this; |
54 | } | 52 | } |
55 | 53 | ||
56 | //============================================================================= | 54 | //============================================================================= |
57 | 55 | ||
58 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DataPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 56 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DataPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'toString': function () { | 60 | 'toString': function () { |
63 | return "Clipperz.PM.UI.Web.Components.DataPanel component"; | 61 | return "Clipperz.PM.UI.Web.Components.DataPanel component"; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'renderSelf': function(/*aContainer, aPosition*/) { | 66 | 'renderSelf': function(/*aContainer, aPosition*/) { |
69 | this.append(this.element(), [ | 67 | this.append(this.element(), [ |
70 | {tag:'div', cls:'header', children:[ | 68 | {tag:'div', cls:'header', children:[ |
71 | {tag:'div', cls:'subPanelTabs', children:[ | 69 | {tag:'div', cls:'subPanelTabs', children:[ |
72 | {tag:'ul', children:[ | 70 | {tag:'ul', children:[ |
73 | {tag:'li', id:this.getId('offlineCopyTab'),children:[{tag:'a', href:'#', html:'Offline copy'}], cls:'first'}, | 71 | {tag:'li', id:this.getId('offlineCopyTab'),children:[{tag:'a', href:'#', html:'Offline copy'}], cls:'first'}, |
74 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'a', href:'#', html:'Sharing'}]}, | 72 | {tag:'li', id:this.getId('sharingTab'), children:[{tag:'a', href:'#', html:'Sharing'}]}, |
75 | {tag:'li', id:this.getId('importTab'), children:[{tag:'a', href:'#', html:'Import'}]}, | 73 | {tag:'li', id:this.getId('importTab'), children:[{tag:'a', href:'#', html:'Import'}]}, |
76 | {tag:'li', id:this.getId('exportTab'), children:[{tag:'a', href:'#', html:'Export'}]} | 74 | {tag:'li', id:this.getId('exportTab'), children:[{tag:'a', href:'#', html:'Export'}]} |
77 | ]} | 75 | ]} |
78 | ]} | 76 | ]} |
79 | ]}, | 77 | ]}, |
80 | {tag:'div', cls:'body', children:[ | 78 | {tag:'div', cls:'body', children:[ |
81 | {tag:'div', cls:'accountPanel', children:[ | 79 | {tag:'div', cls:'accountPanel', children:[ |
82 | {tag:'div', cls:'subPanelContent', children:[ | 80 | {tag:'div', cls:'subPanelContent', children:[ |
83 | {tag:'ul', children:[ | 81 | {tag:'ul', children:[ |
84 | {tag:'li', id:this.getId('offlineCopyPanel'),children:[ | 82 | {tag:'li', id:this.getId('offlineCopyPanel'),children:[ |
85 | // {tag:'h3', html:"Offline copy"}, | 83 | // {tag:'h3', html:"Offline copy"}, |
86 | {tag:'p', html:"With just one click you can dump all your encrypted data from Clipperz servers to your hard disk and create a read-only offline version of Clipperz to be used when you are not connected to the Internet."}, | 84 | {tag:'p', html:"With just one click you can dump all your encrypted data from Clipperz servers to your hard disk and create a read-only offline version of Clipperz to be used when you are not connected to the Internet."}, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js index ea55ba4..b305045 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js | |||
@@ -1,69 +1,67 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.DateColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.DateColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.DateColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.DateColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | this._format = args.format|| Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._format = args.format|| Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | //============================================================================= | 37 | //============================================================================= |
40 | 38 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DateColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DateColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
42 | 40 | ||
43 | 'toString': function () { | 41 | 'toString': function () { |
44 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | 42 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; |
45 | }, | 43 | }, |
46 | 44 | ||
47 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
48 | 46 | ||
49 | 'format': function () { | 47 | 'format': function () { |
50 | return this._format; | 48 | return this._format; |
51 | }, | 49 | }, |
52 | 50 | ||
53 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
54 | 52 | ||
55 | 'renderCell': function(aRowElement, anObject) { | 53 | 'renderCell': function(aRowElement, anObject) { |
56 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 54 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
57 | { | 55 | { |
58 | tag:'span', | 56 | tag:'span', |
59 | title:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], "D, d M Y H:i:s"), | 57 | title:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], "D, d M Y H:i:s"), |
60 | html:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], this.format()) | 58 | html:Clipperz.PM.Date.formatDateWithTemplate(anObject[this.name()], this.format()) |
61 | } | 59 | } |
62 | ]}); | 60 | ]}); |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //----------------------------------------------------- | 63 | //----------------------------------------------------- |
66 | 64 | ||
67 | '__syntax_fix__' : 'syntax fix' | 65 | '__syntax_fix__' : 'syntax fix' |
68 | }); | 66 | }); |
69 | 67 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js index fe59494..6efe4c6 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js | |||
@@ -1,67 +1,65 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | return this; | 32 | return this; |
35 | } | 33 | } |
36 | 34 | ||
37 | //============================================================================= | 35 | //============================================================================= |
38 | 36 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager, Clipperz.PM.UI.Web.Components.LinkColumnManager, { | 37 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager, Clipperz.PM.UI.Web.Components.LinkColumnManager, { |
40 | 38 | ||
41 | 'toString': function () { | 39 | 'toString': function () { |
42 | return "Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager component"; | 40 | return "Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager component"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
46 | 44 | ||
47 | 'renderCell': function(aRowElement, anObject) { | 45 | 'renderCell': function(aRowElement, anObject) { |
48 | var tdElement; | 46 | var tdElement; |
49 | var linkElement; | 47 | var linkElement; |
50 | 48 | ||
51 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 49 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
52 | {tag:'div', cls:'delete', children:[ | 50 | {tag:'div', cls:'delete', children:[ |
53 | {tag:'span', children:[ | 51 | {tag:'span', children:[ |
54 | {tag:'a', href:'delete', html:"delete"} | 52 | {tag:'a', href:'delete', html:"delete"} |
55 | ]} | 53 | ]} |
56 | ]} | 54 | ]} |
57 | ]}); | 55 | ]}); |
58 | 56 | ||
59 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | 57 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); |
60 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 58 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
61 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 59 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
62 | }, | 60 | }, |
63 | 61 | ||
64 | //----------------------------------------------------- | 62 | //----------------------------------------------------- |
65 | '__syntax_fix__' : 'syntax fix' | 63 | '__syntax_fix__' : 'syntax fix' |
66 | }); | 64 | }); |
67 | 65 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js index a1f0f9f..2dad703 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | /* | 24 | /* |
27 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 25 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
28 | 26 | ||
29 | //############################################################################# | 27 | //############################################################################# |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager = function(args) { | 29 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager = function(args) { |
32 | args = args || {}; | 30 | args = args || {}; |
33 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager.superclass.constructor.call(this, args); | 31 | Clipperz.PM.UI.Web.Components.DirectLoginColumnManager.superclass.constructor.call(this, args); |
34 | 32 | ||
35 | this._actionMethod = args.actionMethod || null; | 33 | this._actionMethod = args.actionMethod || null; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
43 | 41 | ||
44 | 'toString': function () { | 42 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | 43 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'actionMethod': function () { | 48 | 'actionMethod': function () { |
51 | return this._actionMethod; | 49 | return this._actionMethod; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
55 | 53 | ||
56 | 'renderCell': function(aRowElement, anObject) { | 54 | 'renderCell': function(aRowElement, anObject) { |
57 | vartdElement; | 55 | vartdElement; |
58 | varlinkElement; | 56 | varlinkElement; |
59 | 57 | ||
60 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 58 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
61 | {tag:'div', cls:'directLogin_directLogin', children:[ | 59 | {tag:'div', cls:'directLogin_directLogin', children:[ |
62 | {tag:'div', cls:'directLogin_directLogin_body', children:[ | 60 | {tag:'div', cls:'directLogin_directLogin_body', children:[ |
63 | {tag:'a', href:'#', html:anObject[this.name()]} | 61 | {tag:'a', href:'#', html:anObject[this.name()]} |
64 | ]} | 62 | ]} |
65 | ]} | 63 | ]} |
66 | ]}); | 64 | ]}); |
67 | 65 | ||
68 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | 66 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); |
69 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 67 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
70 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 68 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
71 | }, | 69 | }, |
72 | 70 | ||
73 | //----------------------------------------------------- | 71 | //----------------------------------------------------- |
74 | 72 | ||
75 | 'handleLinkClick': function (anObject, anEvent) { | 73 | 'handleLinkClick': function (anObject, anEvent) { |
76 | anEvent.preventDefault(); | 74 | anEvent.preventDefault(); |
77 | 75 | ||
78 | if (this.actionMethod() != null) { | 76 | if (this.actionMethod() != null) { |
79 | this.actionMethod()(anObject, anEvent); | 77 | this.actionMethod()(anObject, anEvent); |
80 | } | 78 | } |
81 | }, | 79 | }, |
82 | 80 | ||
83 | //----------------------------------------------------- | 81 | //----------------------------------------------------- |
84 | '__syntax_fix__' : 'syntax fix' | 82 | '__syntax_fix__' : 'syntax fix' |
85 | }); | 83 | }); |
86 | 84 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js index 1a76b0c..f5f99d4 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._fields = args.fields || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._fields = args.fields || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | this._initiallySelectedFieldKey = args.selectedFieldKey|| null; | 33 | this._initiallySelectedFieldKey = args.selectedFieldKey|| null; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'toString': function () { | 44 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent component"; | 45 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingBindingComponent component"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'formFieldName': function () { | 50 | 'formFieldName': function () { |
53 | return this._formFieldName; | 51 | return this._formFieldName; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
57 | 55 | ||
58 | 'fields': function () { | 56 | 'fields': function () { |
59 | return this._fields; | 57 | return this._fields; |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'selectedValue': function () { | 62 | 'selectedValue': function () { |
65 | var result; | 63 | var result; |
66 | 64 | ||
67 | result = this.getElement('select').value; | 65 | result = this.getElement('select').value; |
68 | 66 | ||
69 | if (result == '---') { | 67 | if (result == '---') { |
70 | result = null; | 68 | result = null; |
71 | } | 69 | } |
72 | 70 | ||
73 | return result; | 71 | return result; |
74 | }, | 72 | }, |
75 | 73 | ||
76 | 'initiallySelectedFieldKey': function () { | 74 | 'initiallySelectedFieldKey': function () { |
77 | return this._initiallySelectedFieldKey; | 75 | return this._initiallySelectedFieldKey; |
78 | }, | 76 | }, |
79 | 77 | ||
80 | //========================================================================= | 78 | //========================================================================= |
81 | 79 | ||
82 | 'renderSelf': function() { | 80 | 'renderSelf': function() { |
83 | var initiallySelectedOptions; | 81 | var initiallySelectedOptions; |
84 | 82 | ||
85 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'binding', children:[ | 83 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'binding', children:[ |
86 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, | 84 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js index 5114b1d..55d2c01 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js | |||
@@ -1,172 +1,169 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._tabPanelController = null; | 31 | this._tabPanelController = null; |
34 | 32 | ||
35 | this._initiallySelectedTab = args.selected || 'TYPE'; | 33 | this._initiallySelectedTab = args.selected || 'TYPE'; |
36 | this._tabPanelControllerConfiguration = { | 34 | this._tabPanelControllerConfiguration = { |
37 | 'LABEL': { | 35 | 'LABEL': { |
38 | tab:'labelTab', | 36 | tab:'labelTab', |
39 | panel:'labelTabpanel' | 37 | panel:'labelTabpanel' |
40 | }, | 38 | }, |
41 | 'TYPE': { | 39 | 'TYPE': { |
42 | tab:'typeTab', | 40 | tab:'typeTab', |
43 | panel:'typeTabpanel' | 41 | panel:'typeTabpanel' |
44 | }, | 42 | }, |
45 | 'CONFIGURATION': { | 43 | 'CONFIGURATION': { |
46 | tab:'configurationTab', | 44 | tab:'configurationTab', |
47 | panel:'configurationTabpanel' | 45 | panel:'configurationTabpanel' |
48 | }, | 46 | }, |
49 | 'BINDINGS': { | 47 | 'BINDINGS': { |
50 | tab:'bindingsTab', | 48 | tab:'bindingsTab', |
51 | panel:'bindingsTabpanel' | 49 | panel:'bindingsTabpanel' |
52 | }, | 50 | }, |
53 | 'FAVICON': { | 51 | 'FAVICON': { |
54 | tab:'faviconTab', | 52 | tab:'faviconTab', |
55 | panel:'faviconTabpanel' | 53 | panel:'faviconTabpanel' |
56 | }, | 54 | }, |
57 | 'DONE': { | 55 | 'DONE': { |
58 | tab:'doneTab', | 56 | tab:'doneTab', |
59 | panel:'doneTabpanel' | 57 | panel:'doneTabpanel' |
60 | } | 58 | } |
61 | }; | 59 | }; |
62 | 60 | ||
63 | this._directLoginReference = null; | 61 | this._directLoginReference = null; |
64 | 62 | ||
65 | this._directLoginFavicon = null; | 63 | this._directLoginFavicon = null; |
66 | 64 | ||
67 | this._updateFaviconCounter = 0; | 65 | this._updateFaviconCounter = 0; |
68 | this._faviconComponent = null; | 66 | this._faviconComponent = null; |
69 | 67 | ||
70 | this._bindingComponents= []; | 68 | this._bindingComponents= []; |
71 | this._formValueComponents = []; | 69 | this._formValueComponents = []; |
72 | 70 | ||
73 | return this; | 71 | return this; |
74 | } | 72 | } |
75 | 73 | ||
76 | //============================================================================= | 74 | //============================================================================= |
77 | 75 | ||
78 | //Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 76 | //Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
79 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 77 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
80 | 78 | ||
81 | //------------------------------------------------------------------------- | 79 | //------------------------------------------------------------------------- |
82 | 80 | ||
83 | 'toString': function () { | 81 | 'toString': function () { |
84 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component"; | 82 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent component"; |
85 | }, | 83 | }, |
86 | 84 | ||
87 | //========================================================================= | 85 | //========================================================================= |
88 | 86 | ||
89 | 'directLoginReference': function () { | 87 | 'directLoginReference': function () { |
90 | return this._directLoginReference; | 88 | return this._directLoginReference; |
91 | }, | 89 | }, |
92 | 90 | ||
93 | //------------------------------------------------------------------------- | 91 | //------------------------------------------------------------------------- |
94 | 92 | ||
95 | 'setDirectLoginReference': function (aDirectLoginReference) { | 93 | 'setDirectLoginReference': function (aDirectLoginReference) { |
96 | this._directLoginReference = aDirectLoginReference; | 94 | this._directLoginReference = aDirectLoginReference; |
97 | 95 | ||
98 | return this._directLoginReference; | 96 | return this._directLoginReference; |
99 | }, | 97 | }, |
100 | 98 | ||
101 | //========================================================================= | 99 | //========================================================================= |
102 | 100 | ||
103 | 'label': function () { | 101 | 'label': function () { |
104 | return this.getElement('label').value | 102 | return this.getElement('label').value |
105 | }, | 103 | }, |
106 | 104 | ||
107 | 'setLabel': function (aValue) { | 105 | 'setLabel': function (aValue) { |
108 | //console.log("##> LABEL: " + aValue); | ||
109 | this.getElement('label').value = (aValue ? aValue : ''); | 106 | this.getElement('label').value = (aValue ? aValue : ''); |
110 | }, | 107 | }, |
111 | 108 | ||
112 | //------------------------------------------------------------------------- | 109 | //------------------------------------------------------------------------- |
113 | 110 | ||
114 | 'favicon': function () { | 111 | 'favicon': function () { |
115 | return this.getElement('faviconURL').value; | 112 | return this.getElement('faviconURL').value; |
116 | }, | 113 | }, |
117 | 114 | ||
118 | 'setFavicon': function (aValue) { | 115 | 'setFavicon': function (aValue) { |
119 | var regexp; | 116 | var regexp; |
120 | var displayValue; | 117 | var displayValue; |
121 | 118 | ||
122 | regexp = new RegExp('^data\:\/\/.*', 'i'); | 119 | regexp = new RegExp('^data\:\/\/.*', 'i'); |
123 | if (regexp.test(aValue)) { | 120 | if (regexp.test(aValue)) { |
124 | displayValue = '' | 121 | displayValue = '' |
125 | } else { | 122 | } else { |
126 | displayValue = (aValue ? aValue : ''); | 123 | displayValue = (aValue ? aValue : ''); |
127 | } | 124 | } |
128 | 125 | ||
129 | this.getElement('faviconURL').value = displayValue; | 126 | this.getElement('faviconURL').value = displayValue; |
130 | this.faviconComponent().setSrc(aValue); | 127 | this.faviconComponent().setSrc(aValue); |
131 | }, | 128 | }, |
132 | 129 | ||
133 | //'setFaviconData': function (aValue) { | 130 | //'setFaviconData': function (aValue) { |
134 | // this.getElement('faviconIcon').src = aValue; | 131 | // this.getElement('faviconIcon').src = aValue; |
135 | //}, | 132 | //}, |
136 | 133 | ||
137 | 'directLoginFavicon': function () { | 134 | 'directLoginFavicon': function () { |
138 | return this._directLoginFavicon; | 135 | return this._directLoginFavicon; |
139 | }, | 136 | }, |
140 | 137 | ||
141 | 'setDirectLoginFavicon': function (aValue) { | 138 | 'setDirectLoginFavicon': function (aValue) { |
142 | this._directLoginFavicon = aValue; | 139 | this._directLoginFavicon = aValue; |
143 | this.setFavicon(aValue); | 140 | this.setFavicon(aValue); |
144 | }, | 141 | }, |
145 | 142 | ||
146 | //------------------------------------------------------------------------- | 143 | //------------------------------------------------------------------------- |
147 | 144 | ||
148 | 'bookmarkletConfiguration': function () { | 145 | 'bookmarkletConfiguration': function () { |
149 | return this.getElement('bookmarkletConfiguration').value | 146 | return this.getElement('bookmarkletConfiguration').value |
150 | }, | 147 | }, |
151 | 148 | ||
152 | 'setBookmarkletConfiguration': function (aValue) { | 149 | 'setBookmarkletConfiguration': function (aValue) { |
153 | this.getElement('bookmarkletConfiguration').value = aValue; | 150 | this.getElement('bookmarkletConfiguration').value = aValue; |
154 | }, | 151 | }, |
155 | 152 | ||
156 | 'highlightConfigurationSyntaxError': function () { | 153 | 'highlightConfigurationSyntaxError': function () { |
157 | MochiKit.DOM.addElementClass(this.getElement('bookmarkletConfiguration'), 'error'); | 154 | MochiKit.DOM.addElementClass(this.getElement('bookmarkletConfiguration'), 'error'); |
158 | }, | 155 | }, |
159 | 156 | ||
160 | 'removeHighlightConfigurationSyntaxError': function () { | 157 | 'removeHighlightConfigurationSyntaxError': function () { |
161 | MochiKit.DOM.removeElementClass(this.getElement('bookmarkletConfiguration'), 'error'); | 158 | MochiKit.DOM.removeElementClass(this.getElement('bookmarkletConfiguration'), 'error'); |
162 | }, | 159 | }, |
163 | 160 | ||
164 | //========================================================================= | 161 | //========================================================================= |
165 | 162 | ||
166 | 'disableAllPanels': function () { | 163 | 'disableAllPanels': function () { |
167 | this.getElement('label').disabled = true; | 164 | this.getElement('label').disabled = true; |
168 | MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); | 165 | MochiKit.DOM.addElementClass(this.getElement('label').parentNode, 'disabled'); |
169 | 166 | ||
170 | this.tabPanelController().selectTab(null); | 167 | this.tabPanelController().selectTab(null); |
171 | }, | 168 | }, |
172 | 169 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js index fa57233..58b5b26 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js | |||
@@ -1,176 +1,169 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._formFieldName = args.formFieldName|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._fieldOptions = args.fieldOptions || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._fieldOptions = args.fieldOptions || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | this._initialValue = args.initialValue || null; | 33 | this._initialValue = args.initialValue || null; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'toString': function () { | 44 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent component"; | 45 | return "Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueComponent component"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'formFieldName': function () { | 50 | 'formFieldName': function () { |
53 | return this._formFieldName; | 51 | return this._formFieldName; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
57 | 55 | ||
58 | 'fieldOptions': function () { | 56 | 'fieldOptions': function () { |
59 | return this._fieldOptions; | 57 | return this._fieldOptions; |
60 | }, | 58 | }, |
61 | 59 | ||
62 | 'fieldType': function () { | 60 | 'fieldType': function () { |
63 | return this.fieldOptions()['type']; | 61 | return this.fieldOptions()['type']; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | 'optionValues': function () { | 64 | 'optionValues': function () { |
67 | return MochiKit.Base.map(function (anOptionValue) { | 65 | return MochiKit.Base.map(function (anOptionValue) { |
68 | return { | 66 | return { |
69 | 'label': anOptionValue['label'] || anOptionValue['value'], | 67 | 'label': anOptionValue['label'] || anOptionValue['value'], |
70 | 'value': anOptionValue['value'] | 68 | 'value': anOptionValue['value'] |
71 | } | 69 | } |
72 | }, this.fieldOptions()['options']); | 70 | }, this.fieldOptions()['options']); |
73 | }, | 71 | }, |
74 | 72 | ||
75 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
76 | 74 | ||
77 | 'selectedValue': function () { | 75 | 'selectedValue': function () { |
78 | var result; | 76 | var result; |
79 | 77 | ||
80 | result = this.getElement('select').value; | 78 | result = this.getElement('select').value; |
81 | 79 | ||
82 | if (result == '---') { | 80 | if (result == '---') { |
83 | result = null; | 81 | result = null; |
84 | } | 82 | } |
85 | 83 | ||
86 | return result; | 84 | return result; |
87 | }, | 85 | }, |
88 | 86 | ||
89 | 'initialValue': function () { | 87 | 'initialValue': function () { |
90 | return this._initialValue; | 88 | return this._initialValue; |
91 | }, | 89 | }, |
92 | 90 | ||
93 | //========================================================================= | 91 | //========================================================================= |
94 | 92 | ||
95 | 'renderSelf': function() { | 93 | 'renderSelf': function() { |
96 | //console.log(">>> DirectLoginEditingFormValueComponent.renderSelf"); | ||
97 | //console.log("FIELD OPTIONS", this.fieldOptions()); | ||
98 | //console.log("OPTION VALUES", this.optionValues()); | ||
99 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[ | 94 | this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[ |
100 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, | 95 | {tag:'span', cls:'formFieldName', html:this.formFieldName()}, |
101 | {tag:'div', id:this.getId('values')} | 96 | {tag:'div', id:this.getId('values')} |
102 | ]}); | 97 | ]}); |
103 | 98 | ||
104 | if ((this.fieldType() == 'radio') || (this.fieldType() == 'select')) { | 99 | if ((this.fieldType() == 'radio') || (this.fieldType() == 'select')) { |
105 | this.append(this.getElement('values'), | 100 | this.append(this.getElement('values'), |
106 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: | 101 | {tag:'select', name:this.formFieldName(), id:this.getId('select'), cls:'formFieldMatchinCardField', children: |
107 | MochiKit.Base.flattenArguments( | 102 | MochiKit.Base.flattenArguments( |
108 | // {tag:'option', value:'---', html:"---"}, | 103 | // {tag:'option', value:'---', html:"---"}, |
109 | MochiKit.Base.map( | 104 | MochiKit.Base.map( |
110 | MochiKit.Base.bind(function (aValue) { return {tag:'option', value:aValue['value'], html:aValue['label']}; }, this), | 105 | MochiKit.Base.bind(function (aValue) { return {tag:'option', value:aValue['value'], html:aValue['label']}; }, this), |
111 | this.optionValues() | 106 | this.optionValues() |
112 | ) | 107 | ) |
113 | ) | 108 | ) |
114 | } | 109 | } |
115 | ); | 110 | ); |
116 | 111 | ||
117 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); | 112 | MochiKit.Signal.connect(this.getElement('select'), 'onchange', this, 'handleSelectChange'); |
118 | 113 | ||
119 | if (! MochiKit.Base.isUndefinedOrNull(this.initialValue())) { | 114 | if (! MochiKit.Base.isUndefinedOrNull(this.initialValue())) { |
120 | var initiallySelectedOptions; | 115 | var initiallySelectedOptions; |
121 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initialValue() + ']']); | 116 | initiallySelectedOptions = MochiKit.Selector.findChildElements(this.element(), ['option[value=' + this.initialValue() + ']']); |
122 | if (initiallySelectedOptions.length == 1) { | 117 | if (initiallySelectedOptions.length == 1) { |
123 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); | 118 | MochiKit.DOM.updateNodeAttributes(initiallySelectedOptions[0], {selected:true}); |
124 | this.handleSelectChange(); | 119 | this.handleSelectChange(); |
125 | } else { | 120 | } else { |
126 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); | 121 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); |
127 | } | 122 | } |
128 | } else { | 123 | } else { |
129 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); | 124 | Clipperz.DOM.Helper.insertBefore(this.getElement('select').childNodes[0], {tag:'option', value:'---', html:"", selected:true}); |
130 | } | 125 | } |
131 | } else if (this.fieldType() == 'checkbox') { | 126 | } else if (this.fieldType() == 'checkbox') { |
132 | this.append(this.getElement('values'), | 127 | this.append(this.getElement('values'), |
133 | {tag:'input', type:'checkbox', name:this.formFieldName(), id:this.getId('checkbox'), cls:'formFieldMatchinCardField'} | 128 | {tag:'input', type:'checkbox', name:this.formFieldName(), id:this.getId('checkbox'), cls:'formFieldMatchinCardField'} |
134 | ); | 129 | ); |
135 | 130 | ||
136 | MochiKit.Signal.connect(this.getElement('checkbox'), 'onchange', this, 'handleSelectChange'); | 131 | MochiKit.Signal.connect(this.getElement('checkbox'), 'onchange', this, 'handleSelectChange'); |
137 | 132 | ||
138 | if (this.initialValue()) { | 133 | if (this.initialValue()) { |
139 | MochiKit.DOM.updateNodeAttributes(this.getElement('checkbox'), {checked:true}); | 134 | MochiKit.DOM.updateNodeAttributes(this.getElement('checkbox'), {checked:true}); |
140 | } | 135 | } |
141 | } else { | 136 | } else { |
142 | WTF = TODO; | 137 | WTF = TODO; |
143 | } | 138 | } |
144 | //console.log("<<< DirectLoginEditingFormValueComponent.renderSelf"); | ||
145 | }, | 139 | }, |
146 | 140 | ||
147 | //========================================================================= | 141 | //========================================================================= |
148 | 142 | ||
149 | 'handleSelectChange': function (anEvent) { | 143 | 'handleSelectChange': function (anEvent) { |
150 | //console.log("handleSelectChange", anEvent, anEvent.src(), anEvent.src().value); | ||
151 | var options; | 144 | var options; |
152 | 145 | ||
153 | options = {}; | 146 | options = {}; |
154 | 147 | ||
155 | options['fieldName'] = this.formFieldName(); | 148 | options['fieldName'] = this.formFieldName(); |
156 | 149 | ||
157 | if (this.fieldType() == 'checkbox') { | 150 | if (this.fieldType() == 'checkbox') { |
158 | options['selectedValue'] = (this.getElement('checkbox').checked ? 1 : null); | 151 | options['selectedValue'] = (this.getElement('checkbox').checked ? 1 : null); |
159 | } else { | 152 | } else { |
160 | options['selectedValue'] = this.selectedValue(); | 153 | options['selectedValue'] = this.selectedValue(); |
161 | } | 154 | } |
162 | 155 | ||
163 | MochiKit.Signal.signal(this, 'formValueChange', options); | 156 | MochiKit.Signal.signal(this, 'formValueChange', options); |
164 | }, | 157 | }, |
165 | 158 | ||
166 | //========================================================================= | 159 | //========================================================================= |
167 | __syntaxFix__: "syntax fix" | 160 | __syntaxFix__: "syntax fix" |
168 | }); | 161 | }); |
169 | 162 | ||
170 | 163 | ||
171 | 164 | ||
172 | 165 | ||
173 | 166 | ||
174 | 167 | ||
175 | 168 | ||
176 | 169 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js index d8dc941..b4fc24e 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | this._enterLeaveCounter = 0; | 32 | this._enterLeaveCounter = 0; |
35 | this._selectedRowObject = null; | 33 | this._selectedRowObject = null; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
43 | 41 | ||
44 | 'toString': function () { | 42 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; | 43 | return "Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager component"; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'renderHeader': function(aTRElement) { | 48 | 'renderHeader': function(aTRElement) { |
51 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.renderHeader.call(this, aTRElement); | 49 | Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager.superclass.renderHeader.call(this, aTRElement); |
52 | 50 | ||
53 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, {tag:'div', cls:'DirectLoginListPopup', id:this.getId('DirectLoginListPopup'), children:[ | 51 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, {tag:'div', cls:'DirectLoginListPopup', id:this.getId('DirectLoginListPopup'), children:[ |
54 | {tag:'div', cls:'DirectLoginListPopup_body', children:[ | 52 | {tag:'div', cls:'DirectLoginListPopup_body', children:[ |
55 | {tag:'ul', id:this.getId('DirectLoginListPopup_list'), children:[ | 53 | {tag:'ul', id:this.getId('DirectLoginListPopup_list'), children:[ |
56 | // {tag:'li', children:[ | 54 | // {tag:'li', children:[ |
57 | // {tag:'img', cls:'favicon', src:'http://www.microsoft.com/favicon.ico'}, | 55 | // {tag:'img', cls:'favicon', src:'http://www.microsoft.com/favicon.ico'}, |
58 | // {tag:'a', href:'#', html:"Google Mail"} | 56 | // {tag:'a', href:'#', html:"Google Mail"} |
59 | // ]}, | 57 | // ]}, |
60 | // ... | 58 | // ... |
61 | ]} | 59 | ]} |
62 | ]}, | 60 | ]}, |
63 | {tag:'div', cls:'DirectLoginListPopup_footer'} | 61 | {tag:'div', cls:'DirectLoginListPopup_footer'} |
64 | ]}); | 62 | ]}); |
65 | 63 | ||
66 | MochiKit.Style.hideElement(this.getId('DirectLoginListPopup')); | 64 | MochiKit.Style.hideElement(this.getId('DirectLoginListPopup')); |
67 | 65 | ||
68 | //BEWARE: use MochiKit.Signal.connect instead of this.connectEvent, as the HEADER is NOT redrawn after each refresh | 66 | //BEWARE: use MochiKit.Signal.connect instead of this.connectEvent, as the HEADER is NOT redrawn after each refresh |
69 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseenter', this, 'handleDirectLoginListPopupEnter'); | 67 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseenter', this, 'handleDirectLoginListPopupEnter'); |
70 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseleave', this, 'handleDirectLoginListPopupLeave'); | 68 | MochiKit.Signal.connect(this.getId('DirectLoginListPopup'), 'onmouseleave', this, 'handleDirectLoginListPopupLeave'); |
71 | }, | 69 | }, |
72 | 70 | ||
73 | //------------------------------------------------------------------------- | 71 | //------------------------------------------------------------------------- |
74 | 72 | ||
75 | 'renderCell': function(aRowElement, anObject) { | 73 | 'renderCell': function(aRowElement, anObject) { |
76 | var i,c; | 74 | var i,c; |
77 | var directLoginsInfo; | 75 | var directLoginsInfo; |
78 | 76 | ||
79 | directLoginsInfo = anObject[this.name()]; | 77 | directLoginsInfo = anObject[this.name()]; |
80 | 78 | ||
81 | TDElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:'card_directLogins'}); | 79 | TDElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:'card_directLogins'}); |
82 | 80 | ||
83 | c = Math.min(2, directLoginsInfo.length); | 81 | c = Math.min(2, directLoginsInfo.length); |
84 | for (i=0; i<c; i++) { | 82 | for (i=0; i<c; i++) { |
85 | var elementID; | 83 | var elementID; |
86 | 84 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js index 6297002..bdb044a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.FaviconColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.FaviconColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.FaviconColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.FaviconColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | return this; | 32 | return this; |
35 | } | 33 | } |
36 | 34 | ||
37 | //============================================================================= | 35 | //============================================================================= |
38 | 36 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.FaviconColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 37 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.FaviconColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
40 | 38 | ||
41 | 'toString': function () { | 39 | 'toString': function () { |
42 | return "Clipperz.PM.UI.Web.Components.FaviconColumnManager component"; | 40 | return "Clipperz.PM.UI.Web.Components.FaviconColumnManager component"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
46 | 44 | ||
47 | 'renderCell': function(aRowElement, anObject) { | 45 | 'renderCell': function(aRowElement, anObject) { |
48 | varfaviconImageElement; | 46 | varfaviconImageElement; |
49 | var faviconUrl; | 47 | var faviconUrl; |
50 | 48 | ||
51 | faviconImageElement = this.getId('favicon'); | 49 | faviconImageElement = this.getId('favicon'); |
52 | faviconUrl = anObject[this.name()]; | 50 | faviconUrl = anObject[this.name()]; |
53 | 51 | ||
54 | if (faviconUrl == null) { | 52 | if (faviconUrl == null) { |
55 | faviconUrl = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | 53 | faviconUrl = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); |
56 | } | 54 | } |
57 | 55 | ||
58 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 56 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
59 | {tag:'img', id:faviconImageElement, src:faviconUrl} | 57 | {tag:'img', id:faviconImageElement, src:faviconUrl} |
60 | ]}); | 58 | ]}); |
61 | 59 | ||
62 | MochiKit.Signal.connect(faviconImageElement, 'onload', this, 'handleLoadedFaviconImage'); | 60 | MochiKit.Signal.connect(faviconImageElement, 'onload', this, 'handleLoadedFaviconImage'); |
63 | MochiKit.Signal.connect(faviconImageElement, 'onerror', this, 'handleMissingFaviconImage'); | 61 | MochiKit.Signal.connect(faviconImageElement, 'onerror', this, 'handleMissingFaviconImage'); |
64 | MochiKit.Signal.connect(faviconImageElement, 'onabort', this, 'handleMissingFaviconImage'); | 62 | MochiKit.Signal.connect(faviconImageElement, 'onabort', this, 'handleMissingFaviconImage'); |
65 | }, | 63 | }, |
66 | 64 | ||
67 | //----------------------------------------------------- | 65 | //----------------------------------------------------- |
68 | 66 | ||
69 | 'handleLoadedFaviconImage': function(anEvent) { | 67 | 'handleLoadedFaviconImage': function(anEvent) { |
70 | MochiKit.Signal.disconnectAllTo(anEvent.src()); | 68 | MochiKit.Signal.disconnectAllTo(anEvent.src()); |
71 | if (anEvent.src().complete == false) { | 69 | if (anEvent.src().complete == false) { |
72 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | 70 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); |
73 | } | 71 | } |
74 | }, | 72 | }, |
75 | 73 | ||
76 | //----------------------------------------------------- | 74 | //----------------------------------------------------- |
77 | 75 | ||
78 | 'handleMissingFaviconImage': function(anEvent) { | 76 | 'handleMissingFaviconImage': function(anEvent) { |
79 | MochiKit.Signal.disconnectAllTo(anEvent.src()); | 77 | MochiKit.Signal.disconnectAllTo(anEvent.src()); |
80 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); | 78 | anEvent.src().src = Clipperz.PM.Strings.getValue('defaultFaviconUrl'); |
81 | }, | 79 | }, |
82 | 80 | ||
83 | //----------------------------------------------------- | 81 | //----------------------------------------------------- |
84 | '__syntax_fix__' : 'syntax fix' | 82 | '__syntax_fix__' : 'syntax fix' |
85 | }); | 83 | }); |
86 | 84 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js index 51d55f4..21dddc9 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js | |||
@@ -1,198 +1,194 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.GridComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.GridComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.GridComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._columnsManagers = args.columnsManagers; | 31 | this._columnsManagers = args.columnsManagers; |
34 | 32 | ||
35 | this._rowsObjects = []; | 33 | this._rowsObjects = []; |
36 | this._noRowsGridComponent = null; | 34 | this._noRowsGridComponent = null; |
37 | 35 | ||
38 | this._slots = { | 36 | this._slots = { |
39 | 'headerSlot':this.getId('headerSlot') | 37 | 'headerSlot':this.getId('headerSlot') |
40 | }; | 38 | }; |
41 | 39 | ||
42 | return this; | 40 | return this; |
43 | } | 41 | } |
44 | 42 | ||
45 | //============================================================================= | 43 | //============================================================================= |
46 | 44 | ||
47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 45 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
48 | 46 | ||
49 | //------------------------------------------------------------------------- | 47 | //------------------------------------------------------------------------- |
50 | 48 | ||
51 | 'toString': function () { | 49 | 'toString': function () { |
52 | return "Clipperz.PM.UI.Web.Components.GridComponent component"; | 50 | return "Clipperz.PM.UI.Web.Components.GridComponent component"; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
56 | 54 | ||
57 | 'rows': function () { | 55 | 'rows': function () { |
58 | throw Clipperz.Base.exception.AbstractMethod; | 56 | throw Clipperz.Base.exception.AbstractMethod; |
59 | // return this._rows; | 57 | // return this._rows; |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //------------------------------------------------------------------------- | 60 | //------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'columnsManagers': function () { | 62 | 'columnsManagers': function () { |
65 | return this._columnsManagers; | 63 | return this._columnsManagers; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
69 | 67 | ||
70 | 'renderSelf': function(/*aContainer, aPosition*/) { | 68 | 'renderSelf': function(/*aContainer, aPosition*/) { |
71 | this.append(this.element(), [ | 69 | this.append(this.element(), [ |
72 | {tag:'div', cls:'header', children:[ | 70 | {tag:'div', cls:'header', children:[ |
73 | {tag:'form', id:this.getId('searchForm'), cls:'search', children:[ | 71 | {tag:'form', id:this.getId('searchForm'), cls:'search', children:[ |
74 | {tag:'div', cls:'search', children:[ | 72 | {tag:'div', cls:'search', children:[ |
75 | {tag:'input', type:'text', id:this.getId('search'), cls:'search', placeholder:"search", name:'textToSearch'/*, value:"clipperz"*/} | 73 | {tag:'input', type:'text', id:this.getId('search'), cls:'search', placeholder:"search", name:'textToSearch'/*, value:"clipperz"*/} |
76 | ]}, | 74 | ]}, |
77 | {tag:'div', cls:'clearSearchButton', id:this.getId('clearSearch')}, | 75 | {tag:'div', cls:'clearSearchButton', id:this.getId('clearSearch')}, |
78 | // {tag:'input', type:'button', cls:'searchButton', name:'searchButton', value:"search"}, | 76 | // {tag:'input', type:'button', cls:'searchButton', name:'searchButton', value:"search"}, |
79 | {tag:'div', cls:'headerSlot', id:this.getId('headerSlot')} | 77 | {tag:'div', cls:'headerSlot', id:this.getId('headerSlot')} |
80 | ]} | 78 | ]} |
81 | ]}, | 79 | ]}, |
82 | {tag:'div', cls:'body', children:[ | 80 | {tag:'div', cls:'body', children:[ |
83 | {tag:'div', cls:'rows', id:this.getId('rows'), children:[ | 81 | {tag:'div', cls:'rows', id:this.getId('rows'), children:[ |
84 | {tag:'table', cellpadding:'0', cellspacing:'0', cls:'rows', children:[ | 82 | {tag:'table', cellpadding:'0', cellspacing:'0', cls:'rows', children:[ |
85 | {tag:'thead', children:[ | 83 | {tag:'thead', children:[ |
86 | {tag:'tr', id:this.getId('thead_tr'), children:[]} | 84 | {tag:'tr', id:this.getId('thead_tr'), children:[]} |
87 | ]}, | 85 | ]}, |
88 | {tag:'tbody', id:this.getId('gridRows'), children:[]} | 86 | {tag:'tbody', id:this.getId('gridRows'), children:[]} |
89 | ]} | 87 | ]} |
90 | ]}, | 88 | ]}, |
91 | {tag:'div', cls:'noRowsBlock', id:this.getId('noRowsBlock'), children:[]} | 89 | {tag:'div', cls:'noRowsBlock', id:this.getId('noRowsBlock'), children:[]} |
92 | ]}, | 90 | ]}, |
93 | {tag:'div', cls:'footer'} | 91 | {tag:'div', cls:'footer'} |
94 | ]); | 92 | ]); |
95 | 93 | ||
96 | this.renderHeader(); | 94 | this.renderHeader(); |
97 | MochiKit.Signal.connect(this.getId('clearSearch'), 'onclick', this, 'clearSearchHandler'); | 95 | MochiKit.Signal.connect(this.getId('clearSearch'), 'onclick', this, 'clearSearchHandler'); |
98 | }, | 96 | }, |
99 | 97 | ||
100 | //------------------------------------------------------------------------- | 98 | //------------------------------------------------------------------------- |
101 | 99 | ||
102 | 'renderHeader': function () { | 100 | 'renderHeader': function () { |
103 | var headerElement; | 101 | var headerElement; |
104 | 102 | ||
105 | headerElement = this.getElement('thead_tr'); | 103 | headerElement = this.getElement('thead_tr'); |
106 | headerElement.innerHTML = ""; | 104 | headerElement.innerHTML = ""; |
107 | 105 | ||
108 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 106 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
109 | aColumnManager.renderHeader(headerElement); | 107 | aColumnManager.renderHeader(headerElement); |
110 | }); | 108 | }); |
111 | }, | 109 | }, |
112 | 110 | ||
113 | //------------------------------------------------------------------------- | 111 | //------------------------------------------------------------------------- |
114 | 112 | ||
115 | 'update': function (someObjects) { | 113 | 'update': function (someObjects) { |
116 | this._rowsObjects = someObjects | 114 | this._rowsObjects = someObjects |
117 | this.refresh(); | 115 | this.refresh(); |
118 | this.focus(); | 116 | this.focus(); |
119 | }, | 117 | }, |
120 | 118 | ||
121 | 'focus': function () { | 119 | 'focus': function () { |
122 | this.getElement('search').focus(); | 120 | this.getElement('search').focus(); |
123 | }, | 121 | }, |
124 | 122 | ||
125 | //------------------------------------------------------------------------- | 123 | //------------------------------------------------------------------------- |
126 | 124 | ||
127 | 'startSearch': function () { | 125 | 'startSearch': function () { |
128 | //console.log("--> startSearch"); | ||
129 | MochiKit.DOM.addElementClass(this.getElement('search'), 'running'); | 126 | MochiKit.DOM.addElementClass(this.getElement('search'), 'running'); |
130 | }, | 127 | }, |
131 | 128 | ||
132 | 'endSearch': function () { | 129 | 'endSearch': function () { |
133 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'running'); | 130 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'running'); |
134 | //console.log("<-- startSearch"); | ||
135 | }, | 131 | }, |
136 | 132 | ||
137 | //------------------------------------------------------------------------- | 133 | //------------------------------------------------------------------------- |
138 | 134 | ||
139 | 'disconnectColumnManagersRowsSignals': function () { | 135 | 'disconnectColumnManagersRowsSignals': function () { |
140 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 136 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
141 | aColumnManager.disconnectRowsSignals(); | 137 | aColumnManager.disconnectRowsSignals(); |
142 | }); | 138 | }); |
143 | }, | 139 | }, |
144 | 140 | ||
145 | //------------------------------------------------------------------------- | 141 | //------------------------------------------------------------------------- |
146 | 142 | ||
147 | 'refresh': function () { | 143 | 'refresh': function () { |
148 | var gridRowsElement; | 144 | var gridRowsElement; |
149 | var rowClass; | 145 | var rowClass; |
150 | 146 | ||
151 | this.disconnectColumnManagersRowsSignals(); | 147 | this.disconnectColumnManagersRowsSignals(); |
152 | 148 | ||
153 | { | 149 | { |
154 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'disabled'); | 150 | MochiKit.DOM.removeElementClass(this.getElement('search'), 'disabled'); |
155 | // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', null); | 151 | // MochiKit.DOM.setNodeAttribute(this.getElement('search'), 'disabled', null); |
156 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); | 152 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); |
157 | MochiKit.DOM.removeElementClass(this.element(), 'noRows'); | 153 | MochiKit.DOM.removeElementClass(this.element(), 'noRows'); |
158 | } | 154 | } |
159 | 155 | ||
160 | 156 | ||
161 | gridRowsElement = this.getElement('gridRows'); | 157 | gridRowsElement = this.getElement('gridRows'); |
162 | gridRowsElement.innerHTML = ""; | 158 | gridRowsElement.innerHTML = ""; |
163 | 159 | ||
164 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); | 160 | MochiKit.DOM.removeElementClass(this.element(), 'empty'); |
165 | 161 | ||
166 | rowClass = 'odd'; | 162 | rowClass = 'odd'; |
167 | MochiKit.Iter.forEach(this._rowsObjects, MochiKit.Base.bind(function (aRowObject) { | 163 | MochiKit.Iter.forEach(this._rowsObjects, MochiKit.Base.bind(function (aRowObject) { |
168 | var cardRowElement; | 164 | var cardRowElement; |
169 | 165 | ||
170 | cardRowElement = this.append(gridRowsElement, {tag:'tr', id:this.getId(aRowObject['_reference']), cls:rowClass}); | 166 | cardRowElement = this.append(gridRowsElement, {tag:'tr', id:this.getId(aRowObject['_reference']), cls:rowClass}); |
171 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 167 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
172 | aColumnManager.renderCell(cardRowElement, aRowObject); | 168 | aColumnManager.renderCell(cardRowElement, aRowObject); |
173 | }); | 169 | }); |
174 | 170 | ||
175 | rowClass = (rowClass == 'odd') ? 'even' : 'odd'; | 171 | rowClass = (rowClass == 'odd') ? 'even' : 'odd'; |
176 | }, this)); | 172 | }, this)); |
177 | }, | 173 | }, |
178 | 174 | ||
179 | //----------------------------------------------------------------------------- | 175 | //----------------------------------------------------------------------------- |
180 | 176 | ||
181 | 'filterElement': function () { | 177 | 'filterElement': function () { |
182 | return this.getElement('search'); | 178 | return this.getElement('search'); |
183 | }, | 179 | }, |
184 | 180 | ||
185 | //------------------------------------------------------------------------- | 181 | //------------------------------------------------------------------------- |
186 | 182 | ||
187 | 'shouldShowElementWhileRendering': function () { | 183 | 'shouldShowElementWhileRendering': function () { |
188 | return false; | 184 | return false; |
189 | }, | 185 | }, |
190 | 186 | ||
191 | //------------------------------------------------------------------------- | 187 | //------------------------------------------------------------------------- |
192 | 188 | ||
193 | 'selectRow': function (aRowObject) { | 189 | 'selectRow': function (aRowObject) { |
194 | MochiKit.DOM.addElementClass(this.getId(aRowObject['_reference']), 'selected'); | 190 | MochiKit.DOM.addElementClass(this.getId(aRowObject['_reference']), 'selected'); |
195 | }, | 191 | }, |
196 | 192 | ||
197 | 'unselectRow': function (aRowObject) { | 193 | 'unselectRow': function (aRowObject) { |
198 | MochiKit.DOM.removeElementClass(this.getId(aRowObject['_reference']), 'selected'); | 194 | MochiKit.DOM.removeElementClass(this.getId(aRowObject['_reference']), 'selected'); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js index 3e03fcf..d1d9d7f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js | |||
@@ -1,65 +1,63 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.ImageColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.ImageColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.ImageColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.ImageColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | return this; | 32 | return this; |
35 | } | 33 | } |
36 | 34 | ||
37 | //============================================================================= | 35 | //============================================================================= |
38 | 36 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ImageColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 37 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ImageColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
40 | 38 | ||
41 | 'toString': function () { | 39 | 'toString': function () { |
42 | return "Clipperz.PM.UI.Web.Components.ImageColumnManager component"; | 40 | return "Clipperz.PM.UI.Web.Components.ImageColumnManager component"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
46 | 44 | ||
47 | 'renderCell': function(aRowElement, anObject) { | 45 | 'renderCell': function(aRowElement, anObject) { |
48 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 46 | Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
49 | {tag:'img', src:anObject[this.name()]} | 47 | {tag:'img', src:anObject[this.name()]} |
50 | ]}); | 48 | ]}); |
51 | 49 | ||
52 | // return Clipperz.Async.callbacks("ImageColumnManager.renderCell", [ | 50 | // return Clipperz.Async.callbacks("ImageColumnManager.renderCell", [ |
53 | // this.selector(), | 51 | // this.selector(), |
54 | // MochiKit.Base.bind(function (aValue) { | 52 | // MochiKit.Base.bind(function (aValue) { |
55 | // Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 53 | // Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
56 | // {tag:'img', src:aValue} | 54 | // {tag:'img', src:aValue} |
57 | // ]}); | 55 | // ]}); |
58 | // }, this) | 56 | // }, this) |
59 | // ], {trace:false}, anObject); | 57 | // ], {trace:false}, anObject); |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //----------------------------------------------------- | 60 | //----------------------------------------------------- |
63 | '__syntax_fix__' : 'syntax fix' | 61 | '__syntax_fix__' : 'syntax fix' |
64 | }); | 62 | }); |
65 | 63 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js index f3f9cd5..69f735b 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.LinkColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.LinkColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.LinkColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.LinkColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | this._actionMethod = args.actionMethod || null; | 32 | this._actionMethod = args.actionMethod || null; |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | //============================================================================= | 37 | //============================================================================= |
40 | 38 | ||
41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LinkColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LinkColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
42 | 40 | ||
43 | 'toString': function () { | 41 | 'toString': function () { |
44 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; | 42 | return "Clipperz.PM.UI.Web.Components.DateColumnManager component"; |
45 | }, | 43 | }, |
46 | 44 | ||
47 | //------------------------------------------------------------------------- | 45 | //------------------------------------------------------------------------- |
48 | 46 | ||
49 | 'actionMethod': function () { | 47 | 'actionMethod': function () { |
50 | return this._actionMethod; | 48 | return this._actionMethod; |
51 | }, | 49 | }, |
52 | 50 | ||
53 | //------------------------------------------------------------------------- | 51 | //------------------------------------------------------------------------- |
54 | 52 | ||
55 | 'renderCell': function(aRowElement, anObject) { | 53 | 'renderCell': function(aRowElement, anObject) { |
56 | vartdElement; | 54 | vartdElement; |
57 | varlinkElement; | 55 | varlinkElement; |
58 | 56 | ||
59 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ | 57 | tdElement = Clipperz.DOM.Helper.append(aRowElement, {tag:'td', cls:this.cssClass(), children:[ |
60 | {tag:'span', children:[ | 58 | {tag:'span', children:[ |
61 | {tag:'a', href:'#', html:anObject[this.name()]} | 59 | {tag:'a', href:'#', html:anObject[this.name()]} |
62 | ]} | 60 | ]} |
63 | ]}); | 61 | ]}); |
64 | 62 | ||
65 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); | 63 | linkElement = MochiKit.DOM.getFirstElementByTagAndClassName('a', null, tdElement); |
66 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 64 | // MochiKit.Signal.connect(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
67 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); | 65 | this.connectEvent(linkElement, 'onclick', MochiKit.Base.method(this, 'handleLinkClick', anObject['_rowObject'])); |
68 | }, | 66 | }, |
69 | 67 | ||
70 | //----------------------------------------------------- | 68 | //----------------------------------------------------- |
71 | 69 | ||
72 | 'handleLinkClick': function (anObject, anEvent) { | 70 | 'handleLinkClick': function (anObject, anEvent) { |
73 | anEvent.preventDefault(); | 71 | anEvent.preventDefault(); |
74 | 72 | ||
75 | if (this.actionMethod() != null) { | 73 | if (this.actionMethod() != null) { |
76 | var deferredResult; | 74 | var deferredResult; |
77 | 75 | ||
78 | deferredResult = new Clipperz.Async.Deferred("LinkColumnManager.handleLinkClick", {trace:false}); | 76 | deferredResult = new Clipperz.Async.Deferred("LinkColumnManager.handleLinkClick", {trace:false}); |
79 | // deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'selectRow', anObject); | 77 | // deferredResult.addCallbackPass(MochiKit.Signal.signal, this, 'selectRow', anObject); |
80 | deferredResult.addCallback(this.actionMethod(), anObject, anEvent); | 78 | deferredResult.addCallback(this.actionMethod(), anObject, anEvent); |
81 | // deferredResult.addBothPass(MochiKit.Signal.signal, this, 'unselectRow', anObject); | 79 | // deferredResult.addBothPass(MochiKit.Signal.signal, this, 'unselectRow', anObject); |
82 | deferredResult.callback(); | 80 | deferredResult.callback(); |
83 | } | 81 | } |
84 | }, | 82 | }, |
85 | 83 | ||
86 | //----------------------------------------------------- | 84 | //----------------------------------------------------- |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js index a10ba4f..38a9421 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.LoginForm = function(args) { | 26 | Clipperz.PM.UI.Web.Components.LoginForm = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | this._autocomplete = args.autocomplete || 'off'; | 29 | this._autocomplete = args.autocomplete || 'off'; |
32 | 30 | ||
33 | Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); | 31 | Clipperz.PM.UI.Web.Components.LoginForm.superclass.constructor.apply(this, arguments); |
34 | 32 | ||
35 | this._slots = { | 33 | this._slots = { |
36 | 'passphraseEntropy':this.getId('passphraseEntropy') | 34 | 'passphraseEntropy':this.getId('passphraseEntropy') |
37 | }; | 35 | }; |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | //============================================================================= | 40 | //============================================================================= |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginForm, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'toString': function () { | 46 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Web.Components.LoginForm component"; | 47 | return "Clipperz.PM.UI.Web.Components.LoginForm component"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | 'autocomplete': function () { | 50 | 'autocomplete': function () { |
53 | return this._autocomplete; | 51 | return this._autocomplete; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
57 | 55 | ||
58 | 'renderSelf': function() { | 56 | 'renderSelf': function() { |
59 | this.append(this.element(), {tag:'div', id:'loginBox', children:[ | 57 | this.append(this.element(), {tag:'div', id:'loginBox', children:[ |
60 | {tag:'div', cls:'header'}, | 58 | {tag:'div', cls:'header'}, |
61 | {tag:'div', cls:'body', id:this.getId('body'), children:[ | 59 | {tag:'div', cls:'body', id:this.getId('body'), children:[ |
62 | {tag:'div', id:this.getId('loginForm'), children:[ | 60 | {tag:'div', id:this.getId('loginForm'), children:[ |
63 | {tag:'div', children:[ | 61 | {tag:'div', children:[ |
64 | {tag:'h4', html:'Login'}, | 62 | {tag:'h4', html:'Login'}, |
65 | // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ | 63 | // {tag:'form', cls:'loginForm', autocomplete:this.autocomplete(), children:[ |
66 | {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ | 64 | {tag:'form', id:this.getId('form'), cls:'loginForm', children:[ |
67 | {tag:'label', html:'username', 'for':this.getId('usernameField')}, | 65 | {tag:'label', html:'username', 'for':this.getId('usernameField')}, |
68 | {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'}, | 66 | {tag:'input', id:this.getId('usernameField'), type:'text', cls:'username'}, |
69 | {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, | 67 | {tag:'label', html:'passphrase / OTP', 'for':this.getId('passphraseField')}, |
70 | {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'}, | 68 | {tag:'input', id:this.getId('passphraseField'), type:'password', cls:'password'}, |
71 | 69 | ||
72 | {tag:'div', cls:'translations', children:[ | 70 | {tag:'div', cls:'translations', children:[ |
73 | {tag:'h4', html:'choose your language'}, | 71 | {tag:'h4', html:'choose your language'}, |
74 | {tag:'ul', children:[ | 72 | {tag:'ul', children:[ |
75 | {tag:'li', cls:'selected', html:'english'}, | 73 | {tag:'li', cls:'selected', html:'english'}, |
76 | {tag:'li', html:'italiano'}, | 74 | {tag:'li', html:'italiano'}, |
77 | {tag:'li', html:'dutch'}, | 75 | {tag:'li', html:'dutch'}, |
78 | {tag:'li', html:'french'}, | 76 | {tag:'li', html:'french'}, |
79 | {tag:'li', html:'spanish'}, | 77 | {tag:'li', html:'spanish'}, |
80 | {tag:'li', html:'chinese'}, | 78 | {tag:'li', html:'chinese'}, |
81 | {tag:'li', html:'japanese'}, | 79 | {tag:'li', html:'japanese'}, |
82 | {tag:'li', html:'portugal'}, | 80 | {tag:'li', html:'portugal'}, |
83 | {tag:'li', html:'arabic'} | 81 | {tag:'li', html:'arabic'} |
84 | ]} | 82 | ]} |
85 | ]}, | 83 | ]}, |
86 | 84 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js index 2894af8..3498e3f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.LoginPage = function(args) { | 26 | Clipperz.PM.UI.Web.Components.LoginPage = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.LoginPage.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.LoginPage.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._slots = { | 31 | this._slots = { |
34 | 'loginForm':this.getId('loginBoxSlot') | 32 | 'loginForm':this.getId('loginBoxSlot') |
35 | }; | 33 | }; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginPage, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginPage, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'toString': function () { | 44 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.LoginPage component"; | 45 | return "Clipperz.PM.UI.Web.Components.LoginPage component"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'renderSelf': function(/*aContainer, aPosition*/) { | 50 | 'renderSelf': function(/*aContainer, aPosition*/) { |
53 | this.append(this.element(), [ | 51 | this.append(this.element(), [ |
54 | {tag:'div', id:this.getId('loginBoxSlot')}, | 52 | {tag:'div', id:this.getId('loginBoxSlot')}, |
55 | {tag:'div', id:'main', children:[ | 53 | {tag:'div', id:'main', children:[ |
56 | {tag:'div', id:'featurePoints', children:[ | 54 | {tag:'div', id:'featurePoints', children:[ |
57 | {tag:'table', children:[ | 55 | {tag:'table', children:[ |
58 | {tag:'tr', children:[ | 56 | {tag:'tr', children:[ |
59 | {tag:'td', children:[ | 57 | {tag:'td', children:[ |
60 | {tag:'div', cls:'block', children:[ | 58 | {tag:'div', cls:'block', children:[ |
61 | {tag:'h3', html:'Clipperz is:'}, | 59 | {tag:'h3', html:'Clipperz is:'}, |
62 | {tag:'ul', children:[ | 60 | {tag:'ul', children:[ |
63 | {tag:'li', html:'a secure and simple password manager'}, | 61 | {tag:'li', html:'a secure and simple password manager'}, |
64 | {tag:'li', html:'an effective single sign-on solution'}, | 62 | {tag:'li', html:'an effective single sign-on solution'}, |
65 | {tag:'li', html:'a digital vault for your personal data'} | 63 | {tag:'li', html:'a digital vault for your personal data'} |
66 | ]} | 64 | ]} |
67 | ]}, | 65 | ]}, |
68 | {tag:'div', cls:'block', children:[ | 66 | {tag:'div', cls:'block', children:[ |
69 | {tag:'h3', html:'Clipperz benefits:'}, | 67 | {tag:'h3', html:'Clipperz benefits:'}, |
70 | {tag:'ul', children:[ | 68 | {tag:'ul', children:[ |
71 | {tag:'li', html:'free and completely anonymous'}, | 69 | {tag:'li', html:'free and completely anonymous'}, |
72 | {tag:'li', html:'access it any time from any computer'}, | 70 | {tag:'li', html:'access it any time from any computer'}, |
73 | {tag:'li', html:'no software to download and nothing to install'}, | 71 | {tag:'li', html:'no software to download and nothing to install'}, |
74 | {tag:'li', html:'avoid keeping secrets on your PC or on paper'} | 72 | {tag:'li', html:'avoid keeping secrets on your PC or on paper'} |
75 | ]} | 73 | ]} |
76 | ]} | 74 | ]} |
77 | ]}, {tag:'td', children:[ | 75 | ]}, {tag:'td', children:[ |
78 | {tag:'div', cls:'block', children:[ | 76 | {tag:'div', cls:'block', children:[ |
79 | {tag:'h3', html:'Clipperz security:'}, | 77 | {tag:'h3', html:'Clipperz security:'}, |
80 | {tag:'ul', children:[ | 78 | {tag:'ul', children:[ |
81 | {tag:'li', html:'your secretes are locally encrypted by your browser before being uploaded to Clipperz'}, | 79 | {tag:'li', html:'your secretes are locally encrypted by your browser before being uploaded to Clipperz'}, |
82 | {tag:'li', html:'the encryption key is a passphrase known only to you'}, | 80 | {tag:'li', html:'the encryption key is a passphrase known only to you'}, |
83 | {tag:'li', html:'Clipperz hosts your sensitive data in an encrypted form and could never access the data in its plain form'}, | 81 | {tag:'li', html:'Clipperz hosts your sensitive data in an encrypted form and could never access the data in its plain form'}, |
84 | {tag:'li', html:'Clipperz is built upon standard encryption schemes, nothing fancies of homemade'}, | 82 | {tag:'li', html:'Clipperz is built upon standard encryption schemes, nothing fancies of homemade'}, |
85 | {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!'} | 83 | {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!'} |
86 | ]} | 84 | ]} |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js index 26506e7..3fef6c5 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js | |||
@@ -1,133 +1,130 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.LoginProgress = function(args) { | 26 | Clipperz.PM.UI.Web.Components.LoginProgress = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.LoginProgress.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._deferred = null; | 31 | this._deferred = null; |
34 | 32 | ||
35 | return this; | 33 | return this; |
36 | } | 34 | } |
37 | 35 | ||
38 | //============================================================================= | 36 | //============================================================================= |
39 | 37 | ||
40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, { | 38 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI.Common.Components.BaseComponent, { |
41 | 39 | ||
42 | //------------------------------------------------------------------------- | 40 | //------------------------------------------------------------------------- |
43 | 41 | ||
44 | 'toString': function () { | 42 | 'toString': function () { |
45 | return "Clipperz.PM.UI.Web.Components.LoginProgress component"; | 43 | return "Clipperz.PM.UI.Web.Components.LoginProgress component"; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'deferred': function() { | 48 | 'deferred': function() { |
51 | return this._deferred; | 49 | return this._deferred; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | 'setDeferred': function(aValue) { | 52 | 'setDeferred': function(aValue) { |
55 | this._deferred = aValue; | 53 | this._deferred = aValue; |
56 | }, | 54 | }, |
57 | 55 | ||
58 | //------------------------------------------------------------------------- | 56 | //------------------------------------------------------------------------- |
59 | 57 | ||
60 | 'renderSelf': function() { | 58 | 'renderSelf': function() { |
61 | // var loginProgressElement; | 59 | // var loginProgressElement; |
62 | // | 60 | // |
63 | // loginProgressElement = MochiKit.DOM.getElement('loginProgress'); | 61 | // loginProgressElement = MochiKit.DOM.getElement('loginProgress'); |
64 | // | 62 | // |
65 | // if (loginProgressElement == null) { | 63 | // if (loginProgressElement == null) { |
66 | // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true); | 64 | // loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true); |
67 | // } | 65 | // } |
68 | 66 | ||
69 | //console.log(">> LoginProgress.renderSelf", this.element()); | ||
70 | this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [ | 67 | this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [ |
71 | // this.append(loginProgressElement, [ | 68 | // this.append(loginProgressElement, [ |
72 | {tag:'div', cls:'header', children:[ | 69 | {tag:'div', cls:'header', children:[ |
73 | {tag:'h3', id:this.getId('title'), html:"login progress"} | 70 | {tag:'h3', id:this.getId('title'), html:"login progress"} |
74 | ]}, | 71 | ]}, |
75 | {tag:'div', cls:'body', children:[ | 72 | {tag:'div', cls:'body', children:[ |
76 | {tag:'div', id:this.getId('progressBar')}, | 73 | {tag:'div', id:this.getId('progressBar')}, |
77 | {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[ | 74 | {tag:'div', id:this.getId('errorBox'), cls:'errorBox', children:[ |
78 | // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]}, | 75 | // {tag:'div',cls:'img ALERT', children:[{tag:'div'}]}, |
79 | {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]}, | 76 | {tag:'div',cls:'img ALERT', children:[{tag:'canvas', id:this.getId('canvas')}]}, |
80 | {tag:'p', html:"Login failed"} | 77 | {tag:'p', html:"Login failed"} |
81 | ]} | 78 | ]} |
82 | ]}, | 79 | ]}, |
83 | {tag:'div', cls:'footer', children:[ | 80 | {tag:'div', cls:'footer', children:[ |
84 | {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[ | 81 | {tag:'div', cls:'buttonArea', id:this.getId('buttonArea'), children:[ |
85 | // {tag:'div', cls:'button', id:this.getId('button'), children:[ | 82 | // {tag:'div', cls:'button', id:this.getId('button'), children:[ |
86 | // {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} | 83 | // {tag:'a', href:'#', id:this.getId('buttonLink'), html:"cancel"} |
87 | // ]} | 84 | // ]} |
88 | {tag:'a', cls:'button', id:this.getId('button'), html:"cancel"} | 85 | {tag:'a', cls:'button', id:this.getId('button'), html:"cancel"} |
89 | ]} | 86 | ]} |
90 | ]} | 87 | ]} |
91 | ]}); | 88 | ]}); |
92 | // ]); | 89 | // ]); |
93 | 90 | ||
94 | Clipperz.PM.UI.Canvas.marks['!'](this.getElement('canvas'), "#ffffff"); | 91 | Clipperz.PM.UI.Canvas.marks['!'](this.getElement('canvas'), "#ffffff"); |
95 | 92 | ||
96 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); | 93 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':this.getElement('progressBar')})); |
97 | MochiKit.Style.hideElement(this.getElement('errorBox')); | 94 | MochiKit.Style.hideElement(this.getElement('errorBox')); |
98 | 95 | ||
99 | // MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler'); | 96 | // MochiKit.Signal.connect(this.getId('buttonLink'), 'onclick', this, 'cancelEventHandler'); |
100 | MochiKit.Signal.connect(this.getId('button'), 'onclick', this, 'cancelEventHandler'); | 97 | MochiKit.Signal.connect(this.getId('button'), 'onclick', this, 'cancelEventHandler'); |
101 | }, | 98 | }, |
102 | 99 | ||
103 | //------------------------------------------------------------------------- | 100 | //------------------------------------------------------------------------- |
104 | 101 | ||
105 | 'displayElement': function() { | 102 | 'displayElement': function() { |
106 | return MochiKit.DOM.getElement('loginProgress'); | 103 | return MochiKit.DOM.getElement('loginProgress'); |
107 | }, | 104 | }, |
108 | 105 | ||
109 | //------------------------------------------------------------------------- | 106 | //------------------------------------------------------------------------- |
110 | 107 | ||
111 | 'cancelEventHandler': function(anEvent) { | 108 | 'cancelEventHandler': function(anEvent) { |
112 | anEvent.preventDefault(); | 109 | anEvent.preventDefault(); |
113 | 110 | ||
114 | MochiKit.Signal.signal(this, 'cancelEvent'); | 111 | MochiKit.Signal.signal(this, 'cancelEvent'); |
115 | }, | 112 | }, |
116 | 113 | ||
117 | //------------------------------------------------------------------------- | 114 | //------------------------------------------------------------------------- |
118 | 115 | ||
119 | 'disableCancel': function() { | 116 | 'disableCancel': function() { |
120 | MochiKit.Style.hideElement(this.getElement('buttonArea')); | 117 | MochiKit.Style.hideElement(this.getElement('buttonArea')); |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //------------------------------------------------------------------------- | 120 | //------------------------------------------------------------------------- |
124 | 121 | ||
125 | 'showErrorMessage': function() { | 122 | 'showErrorMessage': function() { |
126 | // this.getElement('buttonLink').innerHTML = "close"; | 123 | // this.getElement('buttonLink').innerHTML = "close"; |
127 | this.getElement('button').innerHTML = "close"; | 124 | this.getElement('button').innerHTML = "close"; |
128 | MochiKit.DOM.addElementClass(this.getElement('button'), 'default'); | 125 | MochiKit.DOM.addElementClass(this.getElement('button'), 'default'); |
129 | 126 | ||
130 | MochiKit.Style.hideElement(this.getElement('progressBar')); | 127 | MochiKit.Style.hideElement(this.getElement('progressBar')); |
131 | 128 | ||
132 | this.getElement('title').innerHTML = "Error"; | 129 | this.getElement('title').innerHTML = "Error"; |
133 | MochiKit.Style.showElement(this.getElement('errorBox')); | 130 | MochiKit.Style.showElement(this.getElement('errorBox')); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js index feb16ad..06746d1 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js | |||
@@ -1,191 +1,187 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.NewUserCreationComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._tabPanelController = null; | 31 | this._tabPanelController = null; |
34 | 32 | ||
35 | this._initiallySelectedTab = args.selected || 'CREDENTIALS'; | 33 | this._initiallySelectedTab = args.selected || 'CREDENTIALS'; |
36 | this._tabPanelControllerConfiguration = { | 34 | this._tabPanelControllerConfiguration = { |
37 | 'CREDENTIALS': { | 35 | 'CREDENTIALS': { |
38 | tab:'credentialsTab', | 36 | tab:'credentialsTab', |
39 | panel:'credentialsTabpanel' | 37 | panel:'credentialsTabpanel' |
40 | }, | 38 | }, |
41 | 'CHECK_CREDENTIALS': { | 39 | 'CHECK_CREDENTIALS': { |
42 | tab:'checkCredentialsTab', | 40 | tab:'checkCredentialsTab', |
43 | panel:'checkCredentialsTabpanel' | 41 | panel:'checkCredentialsTabpanel' |
44 | }, | 42 | }, |
45 | 'TERMS_OF_SERVICE': { | 43 | 'TERMS_OF_SERVICE': { |
46 | tab:'termsOfServiceTab', | 44 | tab:'termsOfServiceTab', |
47 | panel:'termsOfServiceTabpanel' | 45 | panel:'termsOfServiceTabpanel' |
48 | }, | 46 | }, |
49 | 'CREATE_USER': { | 47 | 'CREATE_USER': { |
50 | tab:'createUserTab', | 48 | tab:'createUserTab', |
51 | panel:'createUserTabpanel' | 49 | panel:'createUserTabpanel' |
52 | }//, | 50 | }//, |
53 | /* | 51 | /* |
54 | 'LOGIN': { | 52 | 'LOGIN': { |
55 | tab:'loginTab', | 53 | tab:'loginTab', |
56 | panel:'loginTabpanel' | 54 | panel:'loginTabpanel' |
57 | } | 55 | } |
58 | */ | 56 | */ |
59 | }; | 57 | }; |
60 | 58 | ||
61 | return this; | 59 | return this; |
62 | } | 60 | } |
63 | 61 | ||
64 | //============================================================================= | 62 | //============================================================================= |
65 | 63 | ||
66 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 64 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
67 | 65 | ||
68 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
69 | 67 | ||
70 | 'toString': function () { | 68 | 'toString': function () { |
71 | return "Clipperz.PM.UI.Web.Components.NewUserCreationComponent component"; | 69 | return "Clipperz.PM.UI.Web.Components.NewUserCreationComponent component"; |
72 | }, | 70 | }, |
73 | 71 | ||
74 | //========================================================================= | 72 | //========================================================================= |
75 | 73 | ||
76 | 'disableAllPanels': function () { | 74 | 'disableAllPanels': function () { |
77 | this.tabPanelController().selectTab(null); | 75 | this.tabPanelController().selectTab(null); |
78 | }, | 76 | }, |
79 | 77 | ||
80 | //------------------------------------------------------------------------- | 78 | //------------------------------------------------------------------------- |
81 | 79 | ||
82 | 'enableCredentialsPanel': function () { | 80 | 'enableCredentialsPanel': function () { |
83 | this.tabPanelController().selectTab('CREDENTIALS'); | 81 | this.tabPanelController().selectTab('CREDENTIALS'); |
84 | }, | 82 | }, |
85 | 83 | ||
86 | 'enableCheckCredentialsPanel': function () { | 84 | 'enableCheckCredentialsPanel': function () { |
87 | this.tabPanelController().selectTab('CHECK_CREDENTIALS'); | 85 | this.tabPanelController().selectTab('CHECK_CREDENTIALS'); |
88 | }, | 86 | }, |
89 | 87 | ||
90 | 'enableTermsOfServicePanel': function () { | 88 | 'enableTermsOfServicePanel': function () { |
91 | this.tabPanelController().selectTab('TERMS_OF_SERVICE'); | 89 | this.tabPanelController().selectTab('TERMS_OF_SERVICE'); |
92 | }, | 90 | }, |
93 | 91 | ||
94 | 'enableCreateUserPanel': function () { | 92 | 'enableCreateUserPanel': function () { |
95 | this.tabPanelController().selectTab('CREATE_USER'); | 93 | this.tabPanelController().selectTab('CREATE_USER'); |
96 | }, | 94 | }, |
97 | 95 | ||
98 | //'enableLoginPanel': function () { | 96 | //'enableLoginPanel': function () { |
99 | // this.tabPanelController().selectTab('LOGIN'); | 97 | // this.tabPanelController().selectTab('LOGIN'); |
100 | //}, | 98 | //}, |
101 | 99 | ||
102 | //========================================================================= | 100 | //========================================================================= |
103 | 101 | ||
104 | 'shouldShowElementWhileRendering': function() { | 102 | 'shouldShowElementWhileRendering': function() { |
105 | return false; | 103 | return false; |
106 | }, | 104 | }, |
107 | 105 | ||
108 | //========================================================================= | 106 | //========================================================================= |
109 | 107 | ||
110 | 'tabPanelController': function () { | 108 | 'tabPanelController': function () { |
111 | if (this._tabPanelController == null) { | 109 | if (this._tabPanelController == null) { |
112 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ | 110 | this._tabPanelController = new Clipperz.PM.UI.Common.Controllers.TabPanelController({ |
113 | component:this, | 111 | component:this, |
114 | configuration:this._tabPanelControllerConfiguration | 112 | configuration:this._tabPanelControllerConfiguration |
115 | }); | 113 | }); |
116 | 114 | ||
117 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') | 115 | MochiKit.Signal.connect(this._tabPanelController, 'tabSelected', this, 'handleTabSelected') |
118 | } | 116 | } |
119 | 117 | ||
120 | return this._tabPanelController; | 118 | return this._tabPanelController; |
121 | }, | 119 | }, |
122 | 120 | ||
123 | //------------------------------------------------------------------------- | 121 | //------------------------------------------------------------------------- |
124 | 122 | ||
125 | 'renderSelf': function() { | 123 | 'renderSelf': function() { |
126 | //console.log('** Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition)); | ||
127 | |||
128 | this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [ | 124 | this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [ |
129 | {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[ | 125 | {tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[ |
130 | {tag:'div', cls:'header', children:[ | 126 | {tag:'div', cls:'header', children:[ |
131 | {tag:'div', cls:'title', children:[ | 127 | {tag:'div', cls:'title', children:[ |
132 | {tag:'h3', id:this.getId('title'), html:"Create new user"} | 128 | {tag:'h3', id:this.getId('title'), html:"Create new user"} |
133 | ]} | 129 | ]} |
134 | ]}, | 130 | ]}, |
135 | {tag:'div', id:this.getId('body'), cls:'body', children:[ | 131 | {tag:'div', id:this.getId('body'), cls:'body', children:[ |
136 | {tag:'div', cls:'tabContainer', children:[ | 132 | {tag:'div', cls:'tabContainer', children:[ |
137 | {tag:'ul', cls:'tabs', children:[ | 133 | {tag:'ul', cls:'tabs', children:[ |
138 | {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]}, | 134 | {tag:'li', id:this.getId('credentialsTab'), children:[{tag:'span', html:"credentials"}]}, |
139 | {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]}, | 135 | {tag:'li', id:this.getId('checkCredentialsTab'),children:[{tag:'span', html:"credentials check"}]}, |
140 | {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]}, | 136 | {tag:'li', id:this.getId('termsOfServiceTab'), children:[{tag:'span', html:"terms of service"}]}, |
141 | {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//, | 137 | {tag:'li', id:this.getId('createUserTab'), children:[{tag:'span', html:"create user"}]}//, |
142 | // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]}, | 138 | // {tag:'li', id:this.getId('loginTab'), children:[{tag:'span', html:"login"}]}, |
143 | ]}, | 139 | ]}, |
144 | {tag:'ul', cls:'tabPanels', children:[ | 140 | {tag:'ul', cls:'tabPanels', children:[ |
145 | {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[ | 141 | {tag:'li', id:this.getId('credentialsTabpanel'), cls:'tabPanel credentials', children:[ |
146 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]}, | 142 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREDENTIALS.description')}]}, |
147 | {tag:'ul', cls:'credentials', children:[ | 143 | {tag:'ul', cls:'credentials', children:[ |
148 | {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]}, | 144 | {tag:'li', children:[{tag:'span', cls:'label', html:"username"},{tag:'input', type:'text', id:this.getId('username')/*, value:'test'*/}]}, |
149 | {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]} | 145 | {tag:'li', children:[{tag:'span', cls:'label', html:"passphrase"},{tag:'input', type:'password', id:this.getId('passphrase')/*, value:'test'*/}]} |
150 | ]} | 146 | ]} |
151 | ]}, | 147 | ]}, |
152 | {tag:'li', id:this.getId('checkCredentialsTabpanel'), cls:'tabPanel checkCredentials', children:[ | 148 | {tag:'li', id:this.getId('checkCredentialsTabpanel'), cls:'tabPanel checkCredentials', children:[ |
153 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CHECK_CREDENTIALS.description')}]}, | 149 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CHECK_CREDENTIALS.description')}]}, |
154 | {tag:'ul', cls:'credentials', children:[ | 150 | {tag:'ul', cls:'credentials', children:[ |
155 | {tag:'li', children:[{tag:'span', cls:'label', html:"re-passphrase"},{tag:'input', type:'password', id:this.getId('re-passphrase')/*, value:'test'*/}]} | 151 | {tag:'li', children:[{tag:'span', cls:'label', html:"re-passphrase"},{tag:'input', type:'password', id:this.getId('re-passphrase')/*, value:'test'*/}]} |
156 | ]} | 152 | ]} |
157 | ]}, | 153 | ]}, |
158 | {tag:'li', id:this.getId('termsOfServiceTabpanel'), cls:'tabPanel termsOfService', children:[ | 154 | {tag:'li', id:this.getId('termsOfServiceTabpanel'), cls:'tabPanel termsOfService', children:[ |
159 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.TERMS_OF_SERVICE.description')}]}, | 155 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.TERMS_OF_SERVICE.description')}]}, |
160 | {tag:'ul', cls:'termsOfService', children:[ | 156 | {tag:'ul', cls:'termsOfService', children:[ |
161 | {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."}]}, | 157 | {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."}]}, |
162 | {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>."}]} | 158 | {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>."}]} |
163 | ]} | 159 | ]} |
164 | ]}, | 160 | ]}, |
165 | {tag:'li', id:this.getId('createUserTabpanel'), cls:'tabPanel createUser', children:[ | 161 | {tag:'li', id:this.getId('createUserTabpanel'), cls:'tabPanel createUser', children:[ |
166 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREATE_USER.description')}]}, | 162 | {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.CREATE_USER.description')}]}, |
167 | {tag:'ul', cls:'createUserStates', children:[ | 163 | {tag:'ul', cls:'createUserStates', children:[ |
168 | {tag:'li', cls:'creating', id:this.getId('creatingRegistering'), children:[{tag:'span', html:"registering user"}]}, | 164 | {tag:'li', cls:'creating', id:this.getId('creatingRegistering'), children:[{tag:'span', html:"registering user"}]}, |
169 | {tag:'li', cls:'done', id:this.getId('creatingDone'), children:[{tag:'span', html:"done"}]}, | 165 | {tag:'li', cls:'done', id:this.getId('creatingDone'), children:[{tag:'span', html:"done"}]}, |
170 | {tag:'li', cls:'fail', id:this.getId('creatingFailed'), children:[{tag:'span', html:"fail"}]} | 166 | {tag:'li', cls:'fail', id:this.getId('creatingFailed'), children:[{tag:'span', html:"fail"}]} |
171 | ]} | 167 | ]} |
172 | ]}//, | 168 | ]}//, |
173 | // {tag:'li', id:this.getId('loginTabpanel'), cls:'tabPanel login', children:[ | 169 | // {tag:'li', id:this.getId('loginTabpanel'), cls:'tabPanel login', children:[ |
174 | // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.LOGIN.description')}]}, | 170 | // {tag:'div', cls:'wizardStepDescription', children:[{tag:'span', html:Clipperz.PM.Strings.getValue('Wizards.NewUserWizard.LOGIN.description')}]}, |
175 | // ]} | 171 | // ]} |
176 | ]} | 172 | ]} |
177 | ]} | 173 | ]} |
178 | ]}, | 174 | ]}, |
179 | {tag:'div', id:this.getId('footer'), cls:'footer', children:[ | 175 | {tag:'div', id:this.getId('footer'), cls:'footer', children:[ |
180 | {tag:'div', cls:'buttonArea', children:[ | 176 | {tag:'div', cls:'buttonArea', children:[ |
181 | // {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, | 177 | // {tag:'div', cls:'cancel', id:this.getId('cancelButton'), html:"cancel"}, |
182 | // {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} | 178 | // {tag:'div', cls:'save disabled', id:this.getId('saveButton'), html:"save"} |
183 | ]} | 179 | ]} |
184 | ]} | 180 | ]} |
185 | ]}, | 181 | ]}, |
186 | {tag:'div', cls:'clear'} | 182 | {tag:'div', cls:'clear'} |
187 | ]}); | 183 | ]}); |
188 | 184 | ||
189 | this.tabPanelController().setup(); | 185 | this.tabPanelController().setup(); |
190 | // MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'handleKeyEvent'); | 186 | // MochiKit.Signal.connect(this.getId('panel'), 'onkeydown', this, 'handleKeyEvent'); |
191 | MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown', this, 'handleKeyEvent'); | 187 | MochiKit.Signal.connect(MochiKit.DOM.currentDocument().body, 'onkeydown', this, 'handleKeyEvent'); |
@@ -272,132 +268,128 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Cli | |||
272 | } | 268 | } |
273 | }, | 269 | }, |
274 | */ | 270 | */ |
275 | //========================================================================= | 271 | //========================================================================= |
276 | /* | 272 | /* |
277 | 'bindingComponents': function () { | 273 | 'bindingComponents': function () { |
278 | return this._bindingComponents; | 274 | return this._bindingComponents; |
279 | }, | 275 | }, |
280 | 276 | ||
281 | 'clearAllBindingsComponents': function () { | 277 | 'clearAllBindingsComponents': function () { |
282 | MochiKit.Iter.forEach(this.bindingComponents(), MochiKit.Base.methodcaller('remove')); | 278 | MochiKit.Iter.forEach(this.bindingComponents(), MochiKit.Base.methodcaller('remove')); |
283 | this._bindingComponents = []; | 279 | this._bindingComponents = []; |
284 | this.getElement('bindings').innerHTML = ''; | 280 | this.getElement('bindings').innerHTML = ''; |
285 | }, | 281 | }, |
286 | 282 | ||
287 | 'addBindingComponent': function (aBindingComponent) { | 283 | 'addBindingComponent': function (aBindingComponent) { |
288 | this.bindingComponents().push(aBindingComponent); | 284 | this.bindingComponents().push(aBindingComponent); |
289 | aBindingComponent.renderInNode(this.append(this.getElement('bindings'), {tag:'div'})); | 285 | aBindingComponent.renderInNode(this.append(this.getElement('bindings'), {tag:'div'})); |
290 | }, | 286 | }, |
291 | */ | 287 | */ |
292 | //========================================================================= | 288 | //========================================================================= |
293 | /* | 289 | /* |
294 | 'formValueComponents': function () { | 290 | 'formValueComponents': function () { |
295 | return this._formValueComponents; | 291 | return this._formValueComponents; |
296 | }, | 292 | }, |
297 | 293 | ||
298 | 'clearAllFormValueComponents': function () { | 294 | 'clearAllFormValueComponents': function () { |
299 | MochiKit.Iter.forEach(this.formValueComponents(), MochiKit.Base.methodcaller('remove')); | 295 | MochiKit.Iter.forEach(this.formValueComponents(), MochiKit.Base.methodcaller('remove')); |
300 | this._formValueComponents = []; | 296 | this._formValueComponents = []; |
301 | this.getElement('formValues').innerHTML = ''; | 297 | this.getElement('formValues').innerHTML = ''; |
302 | }, | 298 | }, |
303 | 299 | ||
304 | 'addFormValueComponent': function (aFormValueComponent) { | 300 | 'addFormValueComponent': function (aFormValueComponent) { |
305 | this.formValueComponents().push(aFormValueComponent); | 301 | this.formValueComponents().push(aFormValueComponent); |
306 | aFormValueComponent.renderInNode(this.append(this.getElement('formValues'), {tag:'div'})); | 302 | aFormValueComponent.renderInNode(this.append(this.getElement('formValues'), {tag:'div'})); |
307 | }, | 303 | }, |
308 | */ | 304 | */ |
309 | //========================================================================= | 305 | //========================================================================= |
310 | 306 | ||
311 | 'changedValue': function (anEvent) { | 307 | 'changedValue': function (anEvent) { |
312 | MochiKit.Signal.signal(this, 'changedValue', anEvent); | 308 | MochiKit.Signal.signal(this, 'changedValue', anEvent); |
313 | 309 | ||
314 | this.incrementUpdateFaviconCounter(); | 310 | this.incrementUpdateFaviconCounter(); |
315 | MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon')); | 311 | MochiKit.Async.callLater(1, MochiKit.Base.method(this, 'updateFavicon')); |
316 | }, | 312 | }, |
317 | 313 | ||
318 | //------------------------------------------------------------------------- | 314 | //------------------------------------------------------------------------- |
319 | 315 | ||
320 | 'handleBackClick': function (anEvent) { | 316 | 'handleBackClick': function (anEvent) { |
321 | anEvent.preventDefault(); | 317 | anEvent.preventDefault(); |
322 | 318 | ||
323 | MochiKit.Signal.signal(this, 'back'); | 319 | MochiKit.Signal.signal(this, 'back'); |
324 | }, | 320 | }, |
325 | 321 | ||
326 | //========================================================================= | 322 | //========================================================================= |
327 | 323 | ||
328 | 'bottomMargin': function () { | 324 | 'bottomMargin': function () { |
329 | var result; | 325 | var result; |
330 | 326 | ||
331 | //TODO: WTF!!! | 327 | //TODO: WTF!!! |
332 | // result =MochiKit.Style.getElementPosition(this.element())['y'] + | 328 | // result =MochiKit.Style.getElementPosition(this.element())['y'] + |
333 | // MochiKit.Style.getElementDimensions(this.element())['h']; | 329 | // MochiKit.Style.getElementDimensions(this.element())['h']; |
334 | 330 | ||
335 | // result =MochiKit.Style.getElementPosition(this.getElement('footer'))['y']; | 331 | // result =MochiKit.Style.getElementPosition(this.getElement('footer'))['y']; |
336 | //console.log("### bottomMargin"); | ||
337 | //console.log('displayElement', this.displayElement()); | ||
338 | //console.log('-- Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition)); | ||
339 | //console.log('element', MochiKit.Style.getElementPosition('modalDialog') ['y'], MochiKit.Style.getElementDimensions('modalDialog')['h']); | ||
340 | // result = 450; | 332 | // result = 450; |
341 | 333 | ||
342 | result =Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] + | 334 | result =Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] + |
343 | Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['dimensions']['h'] - | 335 | Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['dimensions']['h'] - |
344 | 60; | 336 | 60; |
345 | 337 | ||
346 | return result; | 338 | return result; |
347 | }, | 339 | }, |
348 | 340 | ||
349 | //========================================================================= | 341 | //========================================================================= |
350 | 342 | ||
351 | 'focusOnUsernameElement': function () { | 343 | 'focusOnUsernameElement': function () { |
352 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('username'), 'focus')); | 344 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('username'), 'focus')); |
353 | }, | 345 | }, |
354 | 346 | ||
355 | 'focusOnRePassphraseElement': function () { | 347 | 'focusOnRePassphraseElement': function () { |
356 | this.getElement('re-passphrase').focus(); | 348 | this.getElement('re-passphrase').focus(); |
357 | }, | 349 | }, |
358 | /* | 350 | /* |
359 | 'focusOnBookmarkletConfigurationElement': function () { | 351 | 'focusOnBookmarkletConfigurationElement': function () { |
360 | this.getElement('bookmarkletConfiguration').focus(); | 352 | this.getElement('bookmarkletConfiguration').focus(); |
361 | }, | 353 | }, |
362 | 354 | ||
363 | 'focusOnFaviconElement': function () { | 355 | 'focusOnFaviconElement': function () { |
364 | this.getElement('faviconURL').focus(); | 356 | this.getElement('faviconURL').focus(); |
365 | }, | 357 | }, |
366 | */ | 358 | */ |
367 | 359 | ||
368 | //========================================================================= | 360 | //========================================================================= |
369 | 361 | ||
370 | 'hideAllProgeressStates': function () { | 362 | 'hideAllProgeressStates': function () { |
371 | MochiKit.Style.hideElement(this.getElement('creatingRegistering')); | 363 | MochiKit.Style.hideElement(this.getElement('creatingRegistering')); |
372 | MochiKit.Style.hideElement(this.getElement('creatingDone')); | 364 | MochiKit.Style.hideElement(this.getElement('creatingDone')); |
373 | MochiKit.Style.hideElement(this.getElement('creatingFailed')); | 365 | MochiKit.Style.hideElement(this.getElement('creatingFailed')); |
374 | }, | 366 | }, |
375 | 367 | ||
376 | 'showProgressOnUserCreation': function () { | 368 | 'showProgressOnUserCreation': function () { |
377 | //Clipperz.log(">>> NewUserCreationComponent.showProgressOnUserCreation"); | 369 | //Clipperz.log(">>> NewUserCreationComponent.showProgressOnUserCreation"); |
378 | this.hideAllProgeressStates(); | 370 | this.hideAllProgeressStates(); |
379 | MochiKit.Style.showElement(this.getElement('creatingRegistering')); | 371 | MochiKit.Style.showElement(this.getElement('creatingRegistering')); |
380 | }, | 372 | }, |
381 | 373 | ||
382 | 'showUserCreationDone': function () { | 374 | 'showUserCreationDone': function () { |
383 | //Clipperz.log(">>> NewUserCreationComponent.showUserCreationDone"); | 375 | //Clipperz.log(">>> NewUserCreationComponent.showUserCreationDone"); |
384 | this.hideAllProgeressStates(); | 376 | this.hideAllProgeressStates(); |
385 | MochiKit.Style.showElement(this.getElement('creatingDone')); | 377 | MochiKit.Style.showElement(this.getElement('creatingDone')); |
386 | //Clipperz.log("<<< NewUserCreationComponent.showUserCreationDone"); | 378 | //Clipperz.log("<<< NewUserCreationComponent.showUserCreationDone"); |
387 | }, | 379 | }, |
388 | 380 | ||
389 | 'showUserCreationFailed': function () { | 381 | 'showUserCreationFailed': function () { |
390 | //Clipperz.log(">>> NewUserCreationComponent.showUserCreationFailed"); | 382 | //Clipperz.log(">>> NewUserCreationComponent.showUserCreationFailed"); |
391 | this.hideAllProgeressStates(); | 383 | this.hideAllProgeressStates(); |
392 | MochiKit.Style.showElement(this.getElement('creatingFailed')); | 384 | MochiKit.Style.showElement(this.getElement('creatingFailed')); |
393 | }, | 385 | }, |
394 | 386 | ||
395 | //========================================================================= | 387 | //========================================================================= |
396 | 388 | ||
397 | 'handleKeyEvent': function (anEvent) { | 389 | 'handleKeyEvent': function (anEvent) { |
398 | MochiKit.Signal.signal(this, 'keyPressed', anEvent); | 390 | MochiKit.Signal.signal(this, 'keyPressed', anEvent); |
399 | /* | 391 | /* |
400 | if (anEvent.key().string == 'KEY_ENTER') { | 392 | if (anEvent.key().string == 'KEY_ENTER') { |
401 | if (anEvent.target().nodeName != 'TEXTAREA') { | 393 | if (anEvent.target().nodeName != 'TEXTAREA') { |
402 | MochiKit.Signal.signal(this, 'moveForward'); | 394 | MochiKit.Signal.signal(this, 'moveForward'); |
403 | anEvent.preventDefault(); | 395 | anEvent.preventDefault(); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js index 3cc5a37..30cbeb2 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js | |||
@@ -1,68 +1,66 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.Page = function(args) { | 26 | Clipperz.PM.UI.Web.Components.Page = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.Page.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.Page.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._slots = { | 31 | this._slots = { |
34 | 'header':'pageHeader', | 32 | 'header':'pageHeader', |
35 | 'body': 'pageBody', | 33 | 'body': 'pageBody', |
36 | 'footer':'pageFooter' | 34 | 'footer':'pageFooter' |
37 | }; | 35 | }; |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | //============================================================================= | 40 | //============================================================================= |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.Page, Clipperz.PM.UI.Common.Components.BaseComponent, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.Page, Clipperz.PM.UI.Common.Components.BaseComponent, { |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'toString': function () { | 46 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Web.Components.Page component"; | 47 | return "Clipperz.PM.UI.Web.Components.Page component"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'renderSelf': function(/*aContainer, aPosition*/) { | 52 | 'renderSelf': function(/*aContainer, aPosition*/) { |
55 | this.append(this.element(), [ | 53 | this.append(this.element(), [ |
56 | {tag:'div', id:'pageHeaderAndBody', cls:'pageHeaderAndBody', children:[ | 54 | {tag:'div', id:'pageHeaderAndBody', cls:'pageHeaderAndBody', children:[ |
57 | {tag:'div', id:'pageHeader', cls:'pageHeader'}, | 55 | {tag:'div', id:'pageHeader', cls:'pageHeader'}, |
58 | {tag:'div', id:'pageBody', cls:'pageBody'} | 56 | {tag:'div', id:'pageBody', cls:'pageBody'} |
59 | ]}, | 57 | ]}, |
60 | {tag:'div', id:'pageFooter', cls:'pageFooter'} | 58 | {tag:'div', id:'pageFooter', cls:'pageFooter'} |
61 | ]); | 59 | ]); |
62 | 60 | ||
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | __syntaxFix__: "syntax fix" | 65 | __syntaxFix__: "syntax fix" |
68 | }); | 66 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js index dcf506f..df3ca0c 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js | |||
@@ -1,67 +1,65 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.PageFooter = function(args) { | 26 | Clipperz.PM.UI.Web.Components.PageFooter = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.PageFooter.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.PageFooter.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | return this; | 31 | return this; |
34 | } | 32 | } |
35 | 33 | ||
36 | //============================================================================= | 34 | //============================================================================= |
37 | 35 | ||
38 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageFooter, Clipperz.PM.UI.Common.Components.BaseComponent, { | 36 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageFooter, Clipperz.PM.UI.Common.Components.BaseComponent, { |
39 | 37 | ||
40 | //------------------------------------------------------------------------- | 38 | //------------------------------------------------------------------------- |
41 | 39 | ||
42 | 'toString': function () { | 40 | 'toString': function () { |
43 | return "Clipperz.PM.UI.Web.Components.PageFooter component"; | 41 | return "Clipperz.PM.UI.Web.Components.PageFooter component"; |
44 | }, | 42 | }, |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'renderSelf': function(/*aContainer, aPosition*/) { | 46 | 'renderSelf': function(/*aContainer, aPosition*/) { |
49 | this.append(this.element(), [ | 47 | this.append(this.element(), [ |
50 | {tag:'div', cls:'footerWrapper', children:[ | 48 | {tag:'div', cls:'footerWrapper', children:[ |
51 | {tag:'div', cls:'footerContent', children:[ | 49 | {tag:'div', cls:'footerContent', children:[ |
52 | {tag:'canvas', id:this.getId('footerStarIcon'), cls:'footerStarIcon'}, | 50 | {tag:'canvas', id:this.getId('footerStarIcon'), cls:'footerStarIcon'}, |
53 | {tag:'span', cls:'copyright', html:'Copyright © 2009-2013 Clipperz Srl'}, | 51 | {tag:'span', cls:'copyright', html:'Copyright © 2009-2013 Clipperz Srl'}, |
54 | {tag:'a', href:'http://www.clipperz.com/terms_of_service',target:'_blank', html:'terms of service'}, | 52 | {tag:'a', href:'http://www.clipperz.com/terms_of_service',target:'_blank', html:'terms of service'}, |
55 | {tag:'a', href:'http://www.clipperz.com/privacy_policy',target:'_blank', html:'privacy policy'}, | 53 | {tag:'a', href:'http://www.clipperz.com/privacy_policy',target:'_blank', html:'privacy policy'}, |
56 | {tag:'div', cls:'applicationVersion', htmlString:'application version: <a href="https://github.com/clipperz/password-manager/tree/' + Clipperz_version + '" target="github">' + Clipperz_version + '</a>'} | 54 | {tag:'div', cls:'applicationVersion', htmlString:'application version: <a href="https://github.com/clipperz/password-manager/tree/' + Clipperz_version + '" target="github">' + Clipperz_version + '</a>'} |
57 | ]} | 55 | ]} |
58 | ]} | 56 | ]} |
59 | ]); | 57 | ]); |
60 | 58 | ||
61 | Clipperz.PM.UI.Canvas.star.normal(this.getElement('footerStarIcon'), "#7e7e7e"); | 59 | Clipperz.PM.UI.Canvas.star.normal(this.getElement('footerStarIcon'), "#7e7e7e"); |
62 | }, | 60 | }, |
63 | 61 | ||
64 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
65 | 63 | ||
66 | __syntaxFix__: "syntax fix" | 64 | __syntaxFix__: "syntax fix" |
67 | }); | 65 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js index b8f3b05..5e49fb5 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { | 26 | Clipperz.PM.UI.Web.Components.PageHeader = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.PageHeader.superclass.constructor.apply(this, arguments); |
32 | this._newsIsOpen = args.newsIsOpen || false; | 30 | this._newsIsOpen = args.newsIsOpen || false; |
33 | this._animationDuration = args.animationDuration || 0.5; | 31 | this._animationDuration = args.animationDuration || 0.5; |
34 | 32 | ||
35 | this._offset = 82; | 33 | this._offset = 82; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PageHeader, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'toString': function () { | 44 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; | 45 | return "Clipperz.PM.UI.Web.Components.PageHeader component"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'iframeURL': function () { | 50 | 'iframeURL': function () { |
53 | // return './rss_view.html'; | 51 | // return './rss_view.html'; |
54 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; | 52 | return 'http://www.clipperz.com/files/clipperz.com/appTips/index.html'; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'renderSelf': function(/*aContainer, aPosition*/) { | 57 | 'renderSelf': function(/*aContainer, aPosition*/) { |
60 | this.append(this.element(), [ | 58 | this.append(this.element(), [ |
61 | {tag:'div', id:'miscLinks', children:[ | 59 | {tag:'div', id:'miscLinks', children:[ |
62 | {tag:'ul', children:[ | 60 | {tag:'ul', children:[ |
63 | {tag:'li', children:[{tag:'a', id:'donateHeaderLink', stringID:'pageHeader.donation', href:'http://www.clipperz.com/donations', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.donation')}]}, | 61 | {tag:'li', children:[{tag:'a', id:'donateHeaderLink', stringID:'pageHeader.donation', href:'http://www.clipperz.com/donations', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.donation')}]}, |
64 | {tag:'li', children:[{tag:'a', id:'forumHeaderLink', stringID:'pageHeader.forum', href:'http://www.clipperz.com/forum', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.forum')}]}, | 62 | {tag:'li', children:[{tag:'a', id:'forumHeaderLink', stringID:'pageHeader.forum', href:'http://www.clipperz.com/forum', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.forum')}]}, |
65 | {tag:'li', children:[{tag:'a', id:'creditsHeaderLink', stringID:'pageHeader.credits', href:'http://www.clipperz.com/credits', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.credits')}]}, | 63 | {tag:'li', children:[{tag:'a', id:'creditsHeaderLink', stringID:'pageHeader.credits', href:'http://www.clipperz.com/credits', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.credits')}]}, |
66 | {tag:'li', children:[{tag:'a', id:'feedbackHeaderLink', stringID:'pageHeader.feedback', href:'http://www.clipperz.com/contact', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.feedback')}]}, | 64 | {tag:'li', children:[{tag:'a', id:'feedbackHeaderLink', stringID:'pageHeader.feedback', href:'http://www.clipperz.com/contact', target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.feedback')}]}, |
67 | {tag:'li', children:[{tag:'a', id:'helpHeaderLink', stringID:'pageHeader.help', href:'http://www.clipperz.com/support/user_guide',target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.help')}]} | 65 | {tag:'li', children:[{tag:'a', id:'helpHeaderLink', stringID:'pageHeader.help', href:'http://www.clipperz.com/support/user_guide',target:'_blank', html:Clipperz.PM.Strings.getValue('pageHeader.help')}]} |
68 | ]} | 66 | ]} |
69 | ]}, | 67 | ]}, |
70 | {tag:'div', id:'logoFrame', children:[ | 68 | {tag:'div', id:'logoFrame', children:[ |
71 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[ | 69 | {tag:'a', href:'http://www.clipperz.com', target:'_blank', children:[ |
72 | // {tag:'h1', cls:'logo', html:"clipperz"}, | 70 | // {tag:'h1', cls:'logo', html:"clipperz"}, |
73 | {tag:'canvas', id:this.getId('logo'), cls:'logo'}, | 71 | {tag:'canvas', id:this.getId('logo'), cls:'logo'}, |
74 | {tag:'h5', cls:'clipperzPayoff', html:"keep it to yourself!"} | 72 | {tag:'h5', cls:'clipperzPayoff', html:"keep it to yourself!"} |
75 | ]} | 73 | ]} |
76 | ]}, | 74 | ]}, |
77 | {tag:'div', id:'news', cls:'hidden', children:[ | 75 | {tag:'div', id:'news', cls:'hidden', children:[ |
78 | // {tag:'div', cls:'close', children:[ | 76 | // {tag:'div', cls:'close', children:[ |
79 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} | 77 | // {tag:'a', href:'#', id:this.getId('closeTips'), html:'x'} |
80 | // ]}, | 78 | // ]}, |
81 | {tag:'div', id:'newsframe', children:[ | 79 | {tag:'div', id:'newsframe', children:[ |
82 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} | 80 | {tag:'iframe', id:this.getId('iframe'), src:this.iframeURL()} |
83 | ]}, | 81 | ]}, |
84 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[ | 82 | {tag:'div', id:this.getId('newsGrip'), cls:'grip', children:[ |
85 | {tag:'div', cls:'gripHandler', children:[]} | 83 | {tag:'div', cls:'gripHandler', children:[]} |
86 | ]} | 84 | ]} |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js index 987e51e..5eb0c1f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Common.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { | 26 | Clipperz.PM.UI.Web.Components.PasswordTooltip = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.PasswordTooltip.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._referenceElement = args.referenceElement|| Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._text = args.text || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | 33 | ||
36 | this._boxDimensions = null; | 34 | this._boxDimensions = null; |
37 | this._isVisible = false; | 35 | this._isVisible = false; |
38 | 36 | ||
39 | this.renderSelf(); | 37 | this.renderSelf(); |
40 | 38 | ||
41 | return this; | 39 | return this; |
42 | } | 40 | } |
43 | 41 | ||
44 | //============================================================================= | 42 | //============================================================================= |
45 | 43 | ||
46 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { | 44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.PasswordTooltip, Clipperz.PM.UI.Common.Components.BaseComponent, { |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'toString': function () { | 48 | 'toString': function () { |
51 | return "Clipperz.PM.UI.Web.Components.PasswordTooltip component"; | 49 | return "Clipperz.PM.UI.Web.Components.PasswordTooltip component"; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
55 | 53 | ||
56 | 'referenceElement': function () { | 54 | 'referenceElement': function () { |
57 | return this._referenceElement; | 55 | return this._referenceElement; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'text': function () { | 60 | 'text': function () { |
63 | return this._text; | 61 | return this._text; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | 'setText': function (aValue) { | 64 | 'setText': function (aValue) { |
67 | this._text = aValue; | 65 | this._text = aValue; |
68 | }, | 66 | }, |
69 | 67 | ||
70 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
71 | 69 | ||
72 | 'isVisible': function () { | 70 | 'isVisible': function () { |
73 | return this._isVisible; | 71 | return this._isVisible; |
74 | }, | 72 | }, |
75 | 73 | ||
76 | 'setIsVisible': function (aValue) { | 74 | 'setIsVisible': function (aValue) { |
77 | this._isVisible = aValue; | 75 | this._isVisible = aValue; |
78 | }, | 76 | }, |
79 | 77 | ||
80 | //------------------------------------------------------------------------- | 78 | //------------------------------------------------------------------------- |
81 | 79 | ||
82 | 'renderSelf': function() { | 80 | 'renderSelf': function() { |
83 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'passwordTooltip', children:[ | 81 | this.append(MochiKit.DOM.getElement('Clipperz_PM_UI_Common_Components_Tooltip_wrapperNode'), {tag:'div', id:this.getId('tooltip'), cls:'passwordTooltip', children:[ |
84 | {tag:'div', id:this.getId('body'), cls:'passwordTooltip_body', children:[ | 82 | {tag:'div', id:this.getId('body'), cls:'passwordTooltip_body', children:[ |
85 | {tag:'div', cls:'passwordTooltip_text', children:[ | 83 | {tag:'div', cls:'passwordTooltip_text', children:[ |
86 | {tag:'span', html:this.text()} | 84 | {tag:'span', html:this.text()} |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js index 69c1ede..ad8d677 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js | |||
@@ -1,179 +1,176 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.RulerComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); | 28 | Clipperz.PM.UI.Web.Components.RulerComponent.superclass.constructor.apply(this, arguments); |
31 | 29 | ||
32 | this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); | 30 | this._translationContext = args.translationContext|| Clipperz.Base.exception.raise('MandatoryParameter'); |
33 | // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | // this._steps = args.steps || Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._steps = args.steps; | 32 | this._steps = args.steps; |
35 | 33 | ||
36 | this._currentStep = -1; | 34 | this._currentStep = -1; |
37 | 35 | ||
38 | return this; | 36 | return this; |
39 | } | 37 | } |
40 | 38 | ||
41 | //============================================================================= | 39 | //============================================================================= |
42 | 40 | ||
43 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { | 41 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.UI.Common.Components.BaseComponent, { |
44 | 42 | ||
45 | //------------------------------------------------------------------------- | 43 | //------------------------------------------------------------------------- |
46 | 44 | ||
47 | 'toString': function () { | 45 | 'toString': function () { |
48 | return "Clipperz.PM.UI.Web.Components.RulerComponent component"; | 46 | return "Clipperz.PM.UI.Web.Components.RulerComponent component"; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'resetStatus': function (args) { | 51 | 'resetStatus': function (args) { |
54 | args = args || {}; | 52 | args = args || {}; |
55 | 53 | ||
56 | if (this.currentStep() != 0) { | 54 | if (this.currentStep() != 0) { |
57 | var shouldAnimateTransition; | 55 | var shouldAnimateTransition; |
58 | 56 | ||
59 | shouldAnimateTransition = args.animateTransition || false; | 57 | shouldAnimateTransition = args.animateTransition || false; |
60 | 58 | ||
61 | if (shouldAnimateTransition) { | 59 | if (shouldAnimateTransition) { |
62 | this.moveToFirstStep(MochiKit.Base.method(this, 'cursorMoved')); | 60 | this.moveToFirstStep(MochiKit.Base.method(this, 'cursorMoved')); |
63 | } else { | 61 | } else { |
64 | this._currentStep = 0; | 62 | this._currentStep = 0; |
65 | this.cursorMoved(); | 63 | this.cursorMoved(); |
66 | } | 64 | } |
67 | } | 65 | } |
68 | }, | 66 | }, |
69 | 67 | ||
70 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
71 | 69 | ||
72 | 'translationContext': function () { | 70 | 'translationContext': function () { |
73 | return this._translationContext; | 71 | return this._translationContext; |
74 | }, | 72 | }, |
75 | 73 | ||
76 | 'steps': function () { | 74 | 'steps': function () { |
77 | return this._steps; | 75 | return this._steps; |
78 | }, | 76 | }, |
79 | 77 | ||
80 | 'setSteps': function (aValue) { | 78 | 'setSteps': function (aValue) { |
81 | this._steps = aValue; | 79 | this._steps = aValue; |
82 | this.renderStepsComponents(); | 80 | this.renderStepsComponents(); |
83 | this.resetStatus(); | 81 | this.resetStatus(); |
84 | }, | 82 | }, |
85 | 83 | ||
86 | 'translatedStepDescription': function (aStep) { | 84 | 'translatedStepDescription': function (aStep) { |
87 | return Clipperz.PM.Strings.getValue(this.translationContext() + '.' + aStep + '.' + 'name'); | 85 | return Clipperz.PM.Strings.getValue(this.translationContext() + '.' + aStep + '.' + 'name'); |
88 | }, | 86 | }, |
89 | 87 | ||
90 | //------------------------------------------------------------------------- | 88 | //------------------------------------------------------------------------- |
91 | 89 | ||
92 | 'renderSelf': function(/*aContainer, aPosition*/) { | 90 | 'renderSelf': function(/*aContainer, aPosition*/) { |
93 | this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ | 91 | this.setElement(this.append(MochiKit.DOM.currentDocument().body, [ |
94 | {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ | 92 | {tag:'div', id:this.getId('rulerWrapper'), cls:'rulerWrapper fixed', children:[ |
95 | {tag:'div', cls:'ruler', children:[ | 93 | {tag:'div', cls:'ruler', children:[ |
96 | {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:' '}, | 94 | {tag:'a', href:'#', id:this.getId('exit'), cls:'exit', html:' '}, |
97 | {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:' '}, | 95 | {tag:'a', href:'#', id:this.getId('smallPreviousButton'),cls:'smallButton previous', html:' '}, |
98 | {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:' '}, | 96 | {tag:'a', href:'#', id:this.getId('smallNextButton'), cls:'smallButton next', html:' '}, |
99 | {tag:'div', cls:'marker', id:this.getId('marker'), children:[ | 97 | {tag:'div', cls:'marker', id:this.getId('marker'), children:[ |
100 | {tag:'div', cls:'previous', id:this.getId('previousButton')}, | 98 | {tag:'div', cls:'previous', id:this.getId('previousButton')}, |
101 | {tag:'div', cls:'markerBody'}, | 99 | {tag:'div', cls:'markerBody'}, |
102 | {tag:'div', cls:'next', id:this.getId('nextButton')} | 100 | {tag:'div', cls:'next', id:this.getId('nextButton')} |
103 | ]}, | 101 | ]}, |
104 | {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, | 102 | {tag:'div', cls:'steps', id:this.getId('stepsFrame')}, |
105 | // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ | 103 | // {tag:'div', cls:'steps' + ' ' + 'steps_' + this.steps().length, children:[ |
106 | // {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())} | 104 | // {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())} |
107 | // ]}, | 105 | // ]}, |
108 | {tag:'div', cls:'dots', id:this.getId('dotsFrame')} | 106 | {tag:'div', cls:'dots', id:this.getId('dotsFrame')} |
109 | // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ | 107 | // {tag:'div', cls:'dots' + ' ' + 'steps_' + this.steps().length, children:[ |
110 | // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} | 108 | // {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map(function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}}, this.steps())} |
111 | // ]} | 109 | // ]} |
112 | ]} | 110 | ]} |
113 | ]} | 111 | ]} |
114 | ])); | 112 | ])); |
115 | //console.log("ELEMENT", this.element()); | ||
116 | 113 | ||
117 | MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); | 114 | MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit'); |
118 | 115 | ||
119 | MochiKit.Signal.connect(this.getElement('previousButton'), 'onclick', this, 'handlePrevious'); | 116 | MochiKit.Signal.connect(this.getElement('previousButton'), 'onclick', this, 'handlePrevious'); |
120 | MochiKit.Signal.connect(this.getElement('smallPreviousButton'),'onclick', this, 'handlePrevious'); | 117 | MochiKit.Signal.connect(this.getElement('smallPreviousButton'),'onclick', this, 'handlePrevious'); |
121 | 118 | ||
122 | MochiKit.Signal.connect(this.getElement('nextButton'), 'onclick', this, 'handleNext'); | 119 | MochiKit.Signal.connect(this.getElement('nextButton'), 'onclick', this, 'handleNext'); |
123 | MochiKit.Signal.connect(this.getElement('smallNextButton'), 'onclick', this, 'handleNext'); | 120 | MochiKit.Signal.connect(this.getElement('smallNextButton'), 'onclick', this, 'handleNext'); |
124 | 121 | ||
125 | this.enablePrevious(false); | 122 | this.enablePrevious(false); |
126 | this.enableNext(false); | 123 | this.enableNext(false); |
127 | 124 | ||
128 | // this.cursorMoved(); | 125 | // this.cursorMoved(); |
129 | }, | 126 | }, |
130 | 127 | ||
131 | //......................................................................... | 128 | //......................................................................... |
132 | 129 | ||
133 | 'renderStepsComponents': function () { | 130 | 'renderStepsComponents': function () { |
134 | varstepsFrame; | 131 | varstepsFrame; |
135 | var dotsFrame; | 132 | var dotsFrame; |
136 | 133 | ||
137 | stepsFrames = this.getElement('stepsFrame'); | 134 | stepsFrames = this.getElement('stepsFrame'); |
138 | MochiKit.DOM.setElementClass(stepsFrames, 'steps'); | 135 | MochiKit.DOM.setElementClass(stepsFrames, 'steps'); |
139 | MochiKit.DOM.addElementClass(stepsFrames, 'steps_' + this.steps().length); | 136 | MochiKit.DOM.addElementClass(stepsFrames, 'steps_' + this.steps().length); |
140 | 137 | ||
141 | stepsFrames.innerHTML = ""; | 138 | stepsFrames.innerHTML = ""; |
142 | this.append(stepsFrames, {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map( | 139 | this.append(stepsFrames, {tag:'ul', id:this.getId('steps'), children:MochiKit.Base.map( |
143 | MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), | 140 | MochiKit.Base.bind(function (aStep) { return {tag:'li', children:[{tag:'span', html:this.translatedStepDescription(aStep)}]}}, this), |
144 | this.steps())} | 141 | this.steps())} |
145 | ); | 142 | ); |
146 | 143 | ||
147 | dotsFrames = this.getElement('dotsFrame'); | 144 | dotsFrames = this.getElement('dotsFrame'); |
148 | MochiKit.DOM.setElementClass(dotsFrames, 'dots'); | 145 | MochiKit.DOM.setElementClass(dotsFrames, 'dots'); |
149 | MochiKit.DOM.addElementClass(dotsFrames, 'steps_' + this.steps().length); | 146 | MochiKit.DOM.addElementClass(dotsFrames, 'steps_' + this.steps().length); |
150 | 147 | ||
151 | dotsFrames.innerHTML = ""; | 148 | dotsFrames.innerHTML = ""; |
152 | this.append(dotsFrames, {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map( | 149 | this.append(dotsFrames, {tag:'ul', id:this.getId('dots'), children:MochiKit.Base.map( |
153 | function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}; }, | 150 | function (aStep) { return {tag:'li', children:[{tag:'span', html:'*'}]}; }, |
154 | this.steps())} | 151 | this.steps())} |
155 | ); | 152 | ); |
156 | }, | 153 | }, |
157 | 154 | ||
158 | //------------------------------------------------------------------------- | 155 | //------------------------------------------------------------------------- |
159 | 156 | ||
160 | 'handleExit': function (anEvent) { | 157 | 'handleExit': function (anEvent) { |
161 | anEvent.preventDefault(); | 158 | anEvent.preventDefault(); |
162 | 159 | ||
163 | MochiKit.Signal.signal(this, 'exit'); | 160 | MochiKit.Signal.signal(this, 'exit'); |
164 | }, | 161 | }, |
165 | 162 | ||
166 | //------------------------------------------------------------------------- | 163 | //------------------------------------------------------------------------- |
167 | 164 | ||
168 | 'handlePrevious': function (anEvent) { | 165 | 'handlePrevious': function (anEvent) { |
169 | anEvent.preventDefault(); | 166 | anEvent.preventDefault(); |
170 | 167 | ||
171 | // if (!MochiKit.DOM.hasElementClass(this.getElement('previousButton'), 'disabled')) { | 168 | // if (!MochiKit.DOM.hasElementClass(this.getElement('previousButton'), 'disabled')) { |
172 | // this.moveBackward(); | 169 | // this.moveBackward(); |
173 | // } | 170 | // } |
174 | 171 | ||
175 | MochiKit.Signal.signal(this, 'moveBackward'); | 172 | MochiKit.Signal.signal(this, 'moveBackward'); |
176 | }, | 173 | }, |
177 | 174 | ||
178 | 'handleNext': function (anEvent) { | 175 | 'handleNext': function (anEvent) { |
179 | anEvent.preventDefault(); | 176 | anEvent.preventDefault(); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js index 666afe9..edcdb62 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.TabSidePanel = function(args) { | 26 | Clipperz.PM.UI.Web.Components.TabSidePanel = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | Clipperz.PM.UI.Web.Components.TabSidePanel.superclass.constructor.call(this, args); | 28 | Clipperz.PM.UI.Web.Components.TabSidePanel.superclass.constructor.call(this, args); |
31 | 29 | ||
32 | this._element = args.element || null; | 30 | this._element = args.element || null; |
33 | 31 | ||
34 | this._slots = { | 32 | this._slots = { |
35 | }; | 33 | }; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TabSidePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TabSidePanel, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'toString': function () { | 44 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.TabSidePanel component"; | 45 | return "Clipperz.PM.UI.Web.Components.TabSidePanel component"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'deselectAllTabs': function() { | 50 | 'deselectAllTabs': function() { |
53 | var tabListItems; | 51 | var tabListItems; |
54 | 52 | ||
55 | tabListItems = [ | 53 | tabListItems = [ |
56 | 'cardsLI', | 54 | 'cardsLI', |
57 | // 'directLoginLI', | 55 | // 'directLoginLI', |
58 | 'accountLI', | 56 | 'accountLI', |
59 | 'dataLI', | 57 | 'dataLI', |
60 | 'toolsLI' | 58 | 'toolsLI' |
61 | ]; | 59 | ]; |
62 | 60 | ||
63 | //Clipperz.log("=== TabSidePanel.tabSelected anEvent.src().id", anEvent.src().id); | 61 | //Clipperz.log("=== TabSidePanel.tabSelected anEvent.src().id", anEvent.src().id); |
64 | for (var i in tabListItems) { | 62 | for (var i in tabListItems) { |
65 | //Clipperz.log("=== TabSidePanel.tabSelected aTabListItem", tabListItems[i]); | 63 | //Clipperz.log("=== TabSidePanel.tabSelected aTabListItem", tabListItems[i]); |
66 | MochiKit.DOM.removeElementClass(this.getId(tabListItems[i]), 'selected'); | 64 | MochiKit.DOM.removeElementClass(this.getId(tabListItems[i]), 'selected'); |
67 | } | 65 | } |
68 | }, | 66 | }, |
69 | 67 | ||
70 | 'selectTab': function(aTabName) { | 68 | 'selectTab': function(aTabName) { |
71 | this.deselectAllTabs(); | 69 | this.deselectAllTabs(); |
72 | MochiKit.DOM.addElementClass(this.getId(this.listItemIdForTabNamed(aTabName)), 'selected'); | 70 | MochiKit.DOM.addElementClass(this.getId(this.listItemIdForTabNamed(aTabName)), 'selected'); |
73 | MochiKit.Signal.signal(this, 'tabSelected', aTabName); | 71 | MochiKit.Signal.signal(this, 'tabSelected', aTabName); |
74 | }, | 72 | }, |
75 | 73 | ||
76 | 'tabNameForAnchorId': function(anId) { | 74 | 'tabNameForAnchorId': function(anId) { |
77 | var result; | 75 | var result; |
78 | 76 | ||
79 | switch(anId) { | 77 | switch(anId) { |
80 | case 'cards_tabSidePanel': | 78 | case 'cards_tabSidePanel': |
81 | result = 'cards'; | 79 | result = 'cards'; |
82 | break; | 80 | break; |
83 | // case 'directLogins_tabSidePanel': | 81 | // case 'directLogins_tabSidePanel': |
84 | // result = 'directLogins'; | 82 | // result = 'directLogins'; |
85 | // break; | 83 | // break; |
86 | case 'account_tabSidePanel': | 84 | case 'account_tabSidePanel': |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js index 3dc9ce9..9b1796a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js | |||
@@ -1,50 +1,48 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | //############################################################################# | 26 | //############################################################################# |
29 | 27 | ||
30 | Clipperz.PM.UI.Web.Components.TextColumnManager = function(args) { | 28 | Clipperz.PM.UI.Web.Components.TextColumnManager = function(args) { |
31 | args = args || {}; | 29 | args = args || {}; |
32 | Clipperz.PM.UI.Web.Components.TextColumnManager.superclass.constructor.call(this, args); | 30 | Clipperz.PM.UI.Web.Components.TextColumnManager.superclass.constructor.call(this, args); |
33 | 31 | ||
34 | return this; | 32 | return this; |
35 | } | 33 | } |
36 | 34 | ||
37 | //============================================================================= | 35 | //============================================================================= |
38 | 36 | ||
39 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TextColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { | 37 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.TextColumnManager, Clipperz.PM.UI.Web.Components.ColumnManager, { |
40 | 38 | ||
41 | 'toString': function () { | 39 | 'toString': function () { |
42 | return "Clipperz.PM.UI.Web.Components.TextColumnManager component"; | 40 | return "Clipperz.PM.UI.Web.Components.TextColumnManager component"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | //----------------------------------------------------- | 43 | //----------------------------------------------------- |
46 | 44 | ||
47 | '__syntax_fix__' : 'syntax fix' | 45 | '__syntax_fix__' : 'syntax fix' |
48 | 46 | ||
49 | }); | 47 | }); |
50 | 48 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js index 0fa369f..034ed91 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.ToolsPanel = function(args) { | 26 | Clipperz.PM.UI.Web.Components.ToolsPanel = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.ToolsPanel.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.ToolsPanel.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._initiallySelectedTab = args.selected || 'PASSWORD_GENERATOR'; | 31 | this._initiallySelectedTab = args.selected || 'PASSWORD_GENERATOR'; |
34 | this._tabPanelControllerConfiguration = { | 32 | this._tabPanelControllerConfiguration = { |
35 | 'PASSWORD_GENERATOR': { | 33 | 'PASSWORD_GENERATOR': { |
36 | tab:'passwordGeneratorTab', | 34 | tab:'passwordGeneratorTab', |
37 | panel:'passwordGeneratorPanel' | 35 | panel:'passwordGeneratorPanel' |
38 | }, | 36 | }, |
39 | 'BOOKMARKLET': { | 37 | 'BOOKMARKLET': { |
40 | tab:'bookmarkletTab', | 38 | tab:'bookmarkletTab', |
41 | panel:'bookmarkletPanel' | 39 | panel:'bookmarkletPanel' |
42 | }, | 40 | }, |
43 | 'COMPACT_EDITION': { | 41 | 'COMPACT_EDITION': { |
44 | tab:'compactEditionTab', | 42 | tab:'compactEditionTab', |
45 | panel:'compactEditionPanel' | 43 | panel:'compactEditionPanel' |
46 | }, | 44 | }, |
47 | 'HTTP_AUTH': { | 45 | 'HTTP_AUTH': { |
48 | tab:'httpAuthTab', | 46 | tab:'httpAuthTab', |
49 | panel:'httpAuthPanel' | 47 | panel:'httpAuthPanel' |
50 | } | 48 | } |
51 | }; | 49 | }; |
52 | 50 | ||
53 | return this; | 51 | return this; |
54 | } | 52 | } |
55 | 53 | ||
56 | //============================================================================= | 54 | //============================================================================= |
57 | 55 | ||
58 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ToolsPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { | 56 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.ToolsPanel, Clipperz.PM.UI.Common.Components.TabPanelComponent, { |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'toString': function () { | 60 | 'toString': function () { |
63 | return "Clipperz.PM.UI.Web.Components.ToolsPanel component"; | 61 | return "Clipperz.PM.UI.Web.Components.ToolsPanel component"; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'renderSelf': function(/*aContainer, aPosition*/) { | 66 | 'renderSelf': function(/*aContainer, aPosition*/) { |
69 | this.append(this.element(), [ | 67 | this.append(this.element(), [ |
70 | {tag:'div', cls:'header', children:[ | 68 | {tag:'div', cls:'header', children:[ |
71 | {tag:'div', cls:'subPanelTabs', children:[ | 69 | {tag:'div', cls:'subPanelTabs', children:[ |
72 | {tag:'ul', children:[ | 70 | {tag:'ul', children:[ |
73 | {tag:'li', id:this.getId('passwordGeneratorTab'),children:[{tag:'a', href:'#', html:'Password generator'}], cls:'first'}, | 71 | {tag:'li', id:this.getId('passwordGeneratorTab'),children:[{tag:'a', href:'#', html:'Password generator'}], cls:'first'}, |
74 | {tag:'li', id:this.getId('bookmarkletTab'), children:[{tag:'a', href:'#', html:'Bookmarklet'}]}, | 72 | {tag:'li', id:this.getId('bookmarkletTab'), children:[{tag:'a', href:'#', html:'Bookmarklet'}]}, |
75 | {tag:'li', id:this.getId('compactEditionTab'), children:[{tag:'a', href:'#', html:'Compact edition'}]}, | 73 | {tag:'li', id:this.getId('compactEditionTab'), children:[{tag:'a', href:'#', html:'Compact edition'}]}, |
76 | {tag:'li', id:this.getId('httpAuthTab'), children:[{tag:'a', href:'#', html:'HTTP Auth'}]} | 74 | {tag:'li', id:this.getId('httpAuthTab'), children:[{tag:'a', href:'#', html:'HTTP Auth'}]} |
77 | ]} | 75 | ]} |
78 | ]} | 76 | ]} |
79 | ]}, | 77 | ]}, |
80 | {tag:'div', cls:'body', children:[ | 78 | {tag:'div', cls:'body', children:[ |
81 | {tag:'div', cls:'accountPanel', children:[ | 79 | {tag:'div', cls:'accountPanel', children:[ |
82 | {tag:'div', cls:'subPanelContent', children:[ | 80 | {tag:'div', cls:'subPanelContent', children:[ |
83 | {tag:'ul', children:[ | 81 | {tag:'ul', children:[ |
84 | {tag:'li', id:this.getId('passwordGeneratorPanel'),children:[ | 82 | {tag:'li', id:this.getId('passwordGeneratorPanel'),children:[ |
85 | // {tag:'h3', html:"Password generator"} | 83 | // {tag:'h3', html:"Password generator"} |
86 | ]}, | 84 | ]}, |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js index 21ccf2a..fe46729 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { | 26 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._openFromElement = args.openFromElement || null; | 31 | this._openFromElement = args.openFromElement || null; |
34 | this._onOkCloseToElement = args.onOkCloseToElement || null; | 32 | this._onOkCloseToElement = args.onOkCloseToElement || null; |
35 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; | 33 | this._onCancelCloseToElement = args.onCancelCloseToElement|| null; |
36 | 34 | ||
37 | this._progressBarComponent = null; | 35 | this._progressBarComponent = null; |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | //============================================================================= | 40 | //============================================================================= |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clipperz.PM.UI.Common.Components.SimpleMessagePanel, { |
45 | 43 | ||
46 | //------------------------------------------------------------------------- | 44 | //------------------------------------------------------------------------- |
47 | 45 | ||
48 | 'toString': function () { | 46 | 'toString': function () { |
49 | return "Clipperz.PM.UI.Web.Components.UnlockPasswordComponent component"; | 47 | return "Clipperz.PM.UI.Web.Components.UnlockPasswordComponent component"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'getPassphrase': function () { | 52 | 'getPassphrase': function () { |
55 | /* var deferredResult; | 53 | /* var deferredResult; |
56 | 54 | ||
57 | if (this.passphrase() == null) { | 55 | if (this.passphrase() == null) { |
58 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | 56 | this.deferredShowModal({'openFromElement': this.openFromElement()}); |
59 | deferredResult = this.deferred(); | 57 | deferredResult = this.deferred(); |
60 | } else { | 58 | } else { |
61 | deferredResult = MochiKit.Async.succeed(this.passphrase()); | 59 | deferredResult = MochiKit.Async.succeed(this.passphrase()); |
62 | } | 60 | } |
63 | 61 | ||
64 | return deferredResult; | 62 | return deferredResult; |
65 | */ | 63 | */ |
66 | 64 | ||
67 | this.deferredShowModal({'openFromElement': this.openFromElement()}); | 65 | this.deferredShowModal({'openFromElement': this.openFromElement()}); |
68 | 66 | ||
69 | return this.deferred(); | 67 | return this.deferred(); |
70 | }, | 68 | }, |
71 | 69 | ||
72 | //------------------------------------------------------------------------- | 70 | //------------------------------------------------------------------------- |
73 | 71 | ||
74 | 'deferredShowModal': function (someParameters) { | 72 | 'deferredShowModal': function (someParameters) { |
75 | return Clipperz.Async.callbacks("UnlockPasswordComponent.deferredShowModal", [ | 73 | return Clipperz.Async.callbacks("UnlockPasswordComponent.deferredShowModal", [ |
76 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.deferredShowModal, this, someParameters), | 74 | MochiKit.Base.bind(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.deferredShowModal, this, someParameters), |
77 | MochiKit.Base.method(this, 'getElement', 'passphrase'), | 75 | MochiKit.Base.method(this, 'getElement', 'passphrase'), |
78 | MochiKit.Base.methodcaller('focus') | 76 | MochiKit.Base.methodcaller('focus') |
79 | ], {trace:false}) | 77 | ], {trace:false}) |
80 | }, | 78 | }, |
81 | 79 | ||
82 | //------------------------------------------------------------------------- | 80 | //------------------------------------------------------------------------- |
83 | 81 | ||
84 | 'openFromElement': function () { | 82 | 'openFromElement': function () { |
85 | return this._openFromElement; | 83 | return this._openFromElement; |
86 | }, | 84 | }, |
@@ -99,83 +97,82 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clip | |||
99 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.renderSelf.apply(this, arguments); | 97 | Clipperz.PM.UI.Web.Components.UnlockPasswordComponent.superclass.renderSelf.apply(this, arguments); |
100 | 98 | ||
101 | this.append(this.getElement('container'), {tag:'div', cls:'passphrase', children: [ | 99 | this.append(this.getElement('container'), {tag:'div', cls:'passphrase', children: [ |
102 | // {tag:'form', id:this.getId('passphraseForm'), children:[ | 100 | // {tag:'form', id:this.getId('passphraseForm'), children:[ |
103 | {tag:'input', id:this.getId('passphrase'), type:'password', name:'passphrase', value:''} | 101 | {tag:'input', id:this.getId('passphrase'), type:'password', name:'passphrase', value:''} |
104 | // ]} | 102 | // ]} |
105 | ]}); | 103 | ]}); |
106 | 104 | ||
107 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userSuccessfullyLoggedIn', this, 'userSuccessfullyLoggedInHandler'); | 105 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userSuccessfullyLoggedIn', this, 'userSuccessfullyLoggedInHandler'); |
108 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userLoginFailed', this, 'userLoginFailedHandler'); | 106 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userLoginFailed', this, 'userLoginFailedHandler'); |
109 | 107 | ||
110 | 108 | ||
111 | // MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('passphrase'), 'focus')); | 109 | // MochiKit.Async.callLater(0.1, MochiKit.Base.method(this.getElement('passphrase'), 'focus')); |
112 | // this.getElement('passphrase').select(); | 110 | // this.getElement('passphrase').select(); |
113 | }, | 111 | }, |
114 | 112 | ||
115 | //------------------------------------------------------------------------- | 113 | //------------------------------------------------------------------------- |
116 | 114 | ||
117 | 'showProgressBar': function () { | 115 | 'showProgressBar': function () { |
118 | varprogressBarElement; | 116 | varprogressBarElement; |
119 | 117 | ||
120 | this.getElement('container').innerHTML = ''; | 118 | this.getElement('container').innerHTML = ''; |
121 | 119 | ||
122 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); | 120 | progressBarElement = this.append(this.getElement('container'), {tag:'div', cls:'progressBarWrapper'}); |
123 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); | 121 | this.addComponent(new Clipperz.PM.UI.Common.Components.ProgressBar({'element':progressBarElement})); |
124 | 122 | ||
125 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); | 123 | this.setButtons([{text:"Cancel", result:'CANCEL'}]); |
126 | }, | 124 | }, |
127 | 125 | ||
128 | //------------------------------------------------------------------------- | 126 | //------------------------------------------------------------------------- |
129 | 127 | ||
130 | 'showFailure': function () { | 128 | 'showFailure': function () { |
131 | this.setType('ALERT'); | 129 | this.setType('ALERT'); |
132 | this.setTitle("Login failed"); | 130 | this.setTitle("Login failed"); |
133 | this.setText("Wrong passphrase; the unlock has failed."); | 131 | this.setText("Wrong passphrase; the unlock has failed."); |
134 | this.getElement('container').innerHTML = ''; | 132 | this.getElement('container').innerHTML = ''; |
135 | this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); | 133 | this.setButtons([{text:"Close", result:'CANCEL', isDefault:true}]); |
136 | }, | 134 | }, |
137 | 135 | ||
138 | //------------------------------------------------------------------------- | 136 | //------------------------------------------------------------------------- |
139 | 137 | ||
140 | 'closeOk': function () { | 138 | 'closeOk': function () { |
141 | var passphrase; | 139 | var passphrase; |
142 | 140 | ||
143 | passphrase = this.getElement('passphrase').value; | 141 | passphrase = this.getElement('passphrase').value; |
144 | this.showProgressBar(); | 142 | this.showProgressBar(); |
145 | // this.deferred().callback(passphrase); | 143 | // this.deferred().callback(passphrase); |
146 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback', passphrase)); | 144 | MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback', passphrase)); |
147 | this._deferred = null; | 145 | this._deferred = null; |
148 | }, | 146 | }, |
149 | 147 | ||
150 | 'closeCancel': function () { | 148 | 'closeCancel': function () { |
151 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); | 149 | this.deferredHideModal({closeToElement:this.onCancelCloseToElement()}); |
152 | this.deferred().cancel(); | 150 | this.deferred().cancel(); |
153 | this._deferred = null; | 151 | this._deferred = null; |
154 | }, | 152 | }, |
155 | 153 | ||
156 | //------------------------------------------------------------------------- | 154 | //------------------------------------------------------------------------- |
157 | 155 | ||
158 | 'userSuccessfullyLoggedInHandler': function (anEvent) { | 156 | 'userSuccessfullyLoggedInHandler': function (anEvent) { |
159 | this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); | 157 | this.deferredHideModal({closeToElement:this.onOkCloseToElement()}); |
160 | }, | 158 | }, |
161 | 159 | ||
162 | 'userLoginFailedHandler': function (anEvent) { | 160 | 'userLoginFailedHandler': function (anEvent) { |
163 | //console.log("############### FAILED LOGIN ################"); | ||
164 | this.showFailure(); | 161 | this.showFailure(); |
165 | }, | 162 | }, |
166 | 163 | ||
167 | //------------------------------------------------------------------------- | 164 | //------------------------------------------------------------------------- |
168 | /* | 165 | /* |
169 | 'deferredShow': function (someArgs, aResult) { | 166 | 'deferredShow': function (someArgs, aResult) { |
170 | this.deferredShowModal(someArgs); | 167 | this.deferredShowModal(someArgs); |
171 | 168 | ||
172 | // this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); | 169 | // this.deferred().addMethod(this, 'deferredHideModal', {closeToElement:someArgs.onOkCloseToElement }); |
173 | // this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); | 170 | // this.deferred().addErrback (MochiKit.Base.method(this, 'deferredHideModal', {closeToElement:someArgs.onCancelCloseToElement })); |
174 | // this.deferred().addCallback(MochiKit.Async.succeed, aResult); | 171 | // this.deferred().addCallback(MochiKit.Async.succeed, aResult); |
175 | 172 | ||
176 | return this.deferred(); | 173 | return this.deferred(); |
177 | }, | 174 | }, |
178 | */ | 175 | */ |
179 | //------------------------------------------------------------------------- | 176 | //------------------------------------------------------------------------- |
180 | __syntaxFix__: "syntax fix" | 177 | __syntaxFix__: "syntax fix" |
181 | }); | 178 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js index d699dc6..fbf58e0 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js | |||
@@ -1,213 +1,207 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Components'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) { | 26 | Clipperz.PM.UI.Web.Components.UserInfoBox = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); | 29 | Clipperz.PM.UI.Web.Components.UserInfoBox.superclass.constructor.apply(this, arguments); |
32 | 30 | ||
33 | this._slots = {}; | 31 | this._slots = {}; |
34 | this._isLocked = false; | 32 | this._isLocked = false; |
35 | this._lockTooltip = null; | 33 | this._lockTooltip = null; |
36 | 34 | ||
37 | return this; | 35 | return this; |
38 | } | 36 | } |
39 | 37 | ||
40 | //============================================================================= | 38 | //============================================================================= |
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.Common.Components.BaseComponent, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'toString': function () { | 44 | 'toString': function () { |
47 | return "Clipperz.PM.UI.Web.Components.UserInfoBox component"; | 45 | return "Clipperz.PM.UI.Web.Components.UserInfoBox component"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'handleLogout': function(anEvent) { | 50 | 'handleLogout': function(anEvent) { |
53 | //Clipperz.log(">>> UserInfoBox.handleLogout"); | 51 | //Clipperz.log(">>> UserInfoBox.handleLogout"); |
54 | anEvent.preventDefault(); | 52 | anEvent.preventDefault(); |
55 | MochiKit.Signal.signal(this, 'logout'); | 53 | MochiKit.Signal.signal(this, 'logout'); |
56 | //Clipperz.log("<<< UserInfoBox.handleLogout"); | 54 | //Clipperz.log("<<< UserInfoBox.handleLogout"); |
57 | }, | 55 | }, |
58 | 56 | ||
59 | //------------------------------------------------------------------------- | 57 | //------------------------------------------------------------------------- |
60 | 58 | ||
61 | 'lockTooltip': function () { | 59 | 'lockTooltip': function () { |
62 | return this._lockTooltip; | 60 | return this._lockTooltip; |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | 'isLocked': function () { | 65 | 'isLocked': function () { |
68 | return this._isLocked; | 66 | return this._isLocked; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | 'setIsLocked': function (aValue) { | 69 | 'setIsLocked': function (aValue) { |
72 | this._isLocked = aValue; | 70 | this._isLocked = aValue; |
73 | }, | 71 | }, |
74 | 72 | ||
75 | 'toggleLock': function(anEvent) { | 73 | 'toggleLock': function(anEvent) { |
76 | var deferredResult; | 74 | var deferredResult; |
77 | var shouldLock; | 75 | var shouldLock; |
78 | 76 | ||
79 | //console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]"); | ||
80 | anEvent.preventDefault(); | 77 | anEvent.preventDefault(); |
81 | this.lockTooltip().hide(); | 78 | this.lockTooltip().hide(); |
82 | 79 | ||
83 | shouldLock = (this.isLocked() == false); | 80 | shouldLock = (this.isLocked() == false); |
84 | 81 | ||
85 | if (shouldLock) { | 82 | if (shouldLock) { |
86 | var maskElement; | 83 | var maskElement; |
87 | 84 | ||
88 | this.setIsLocked(true); | 85 | this.setIsLocked(true); |
89 | maskElement = this.getId('modalDialogMask'); | 86 | maskElement = this.getId('modalDialogMask'); |
90 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ | 87 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [lock]", [ |
91 | MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), | 88 | MochiKit.Base.partial(MochiKit.DOM.addElementClass, this.element(), 'locked'), |
92 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), | 89 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.appear, maskElement, {from:0.0, to:0.75, duration:0.5}), |
93 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), | 90 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this, 'askForPassphrase')), |
94 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') | 91 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'lock') |
95 | ], {trace:false}); | 92 | ], {trace:false}); |
96 | } else { | 93 | } else { |
97 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ | 94 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.toggleLock [unlock]", [ |
98 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') | 95 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock') |
99 | ], {trace:false}); | 96 | ], {trace:false}); |
100 | } | 97 | } |
101 | //console.log("<<< UserInfoBox.toggleLock"); | ||
102 | 98 | ||
103 | return deferredResult; | 99 | return deferredResult; |
104 | }, | 100 | }, |
105 | 101 | ||
106 | //------------------------------------------------------------------------- | 102 | //------------------------------------------------------------------------- |
107 | 103 | ||
108 | 'unlock': function () { | 104 | 'unlock': function () { |
109 | var deferredResult; | 105 | var deferredResult; |
110 | var maskElement; | 106 | var maskElement; |
111 | 107 | ||
112 | this.setIsLocked(false); | 108 | this.setIsLocked(false); |
113 | maskElement = this.getId('modalDialogMask'); | 109 | maskElement = this.getId('modalDialogMask'); |
114 | 110 | ||
115 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ | 111 | deferredResult = Clipperz.Async.callbacks("UserInfoBox.unlock", [ |
116 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | 112 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), |
117 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), | 113 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, maskElement, {from:0.75, to:0.0, duration:0.5}), |
118 | MochiKit.Base.partial(MochiKit.DOM.removeElementClass, this.element(), 'locked') | 114 | MochiKit.Base.partial(MochiKit.DOM.removeElementClass, this.element(), 'locked') |
119 | ], {trace:false}); | 115 | ], {trace:false}); |
120 | }, | 116 | }, |
121 | 117 | ||
122 | //------------------------------------------------------------------------- | 118 | //------------------------------------------------------------------------- |
123 | 119 | ||
124 | 'askForPassphrase': function () { | 120 | 'askForPassphrase': function () { |
125 | varunlockPasswordComponent; | 121 | varunlockPasswordComponent; |
126 | /* | 122 | /* |
127 | vardeferredResult; | 123 | vardeferredResult; |
128 | 124 | ||
129 | deferredResult = new Clipperz.Async.Deferred("UserInfoBox.askForPassphrase", {trace:false}); | 125 | deferredResult = new Clipperz.Async.Deferred("UserInfoBox.askForPassphrase", {trace:false}); |
130 | deferredResult.addCallback(MochiKit.Async.succeed, 'test'); | 126 | deferredResult.addCallback(MochiKit.Async.succeed, 'test'); |
131 | 127 | ||
132 | deferredResult.callback(); | 128 | deferredResult.callback(); |
133 | 129 | ||
134 | return deferredResult; | 130 | return deferredResult; |
135 | */ | 131 | */ |
136 | //console.log(">>> UserInfoBox.askForPassphrase"); | ||
137 | unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({ | 132 | unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({ |
138 | 'title':"Unlock account", | 133 | 'title':"Unlock account", |
139 | 'text': "Insert the passprase to unlock the account", | 134 | 'text': "Insert the passprase to unlock the account", |
140 | 'type': 'INFO', | 135 | 'type': 'INFO', |
141 | 'buttons': [ | 136 | 'buttons': [ |
142 | {text:"Cancel",result:'CANCEL'}, | 137 | {text:"Cancel",result:'CANCEL'}, |
143 | {text:"Unlock", result:'OK',isDefault:true} | 138 | {text:"Unlock", result:'OK',isDefault:true} |
144 | ], | 139 | ], |
145 | 'openFromElement': this.getElement('lock'), | 140 | 'openFromElement': this.getElement('lock'), |
146 | 'onOkCloseToElement': null, | 141 | 'onOkCloseToElement': null, |
147 | 'onCancelCloseToElement':this.getId('lock') | 142 | 'onCancelCloseToElement':this.getId('lock') |
148 | }); | 143 | }); |
149 | //console.log("<<< UserInfoBox.askForPassphrase"); | ||
150 | 144 | ||
151 | return unlockPasswordComponent.getPassphrase(); | 145 | return unlockPasswordComponent.getPassphrase(); |
152 | }, | 146 | }, |
153 | 147 | ||
154 | //========================================================================= | 148 | //========================================================================= |
155 | 149 | ||
156 | 'renderSelf': function(/*aContainer, aPosition*/) { | 150 | 'renderSelf': function(/*aContainer, aPosition*/) { |
157 | this.append(this.element(), [ | 151 | this.append(this.element(), [ |
158 | // {tag:'canvas', id:this.getId('canvas'), cls:'canvas', width:'188', height:'154'}, | 152 | // {tag:'canvas', id:this.getId('canvas'), cls:'canvas', width:'188', height:'154'}, |
159 | {tag:'div', cls:'header', children:[ | 153 | {tag:'div', cls:'header', children:[ |
160 | {tag:'h1', html:"Welcome"}, | 154 | {tag:'h1', html:"Welcome"}, |
161 | {tag:'a', cls:'lockButton', href:'#', id:this.getId('lock'), html:' '} | 155 | {tag:'a', cls:'lockButton', href:'#', id:this.getId('lock'), html:' '} |
162 | ]}, | 156 | ]}, |
163 | {tag:'div', cls:'body', children:[ | 157 | {tag:'div', cls:'body', children:[ |
164 | {tag:'h3', id:this.getId('username'), html:""}, | 158 | {tag:'h3', id:this.getId('username'), html:""}, |
165 | {tag:'ul', children:[ | 159 | {tag:'ul', children:[ |
166 | {tag:'li', id:this.getId('cards'), children:[ | 160 | {tag:'li', id:this.getId('cards'), children:[ |
167 | {tag:'span', id:this.getId('cardsNumber'), cls:'number', html:"-"}, | 161 | {tag:'span', id:this.getId('cardsNumber'), cls:'number', html:"-"}, |
168 | {tag:'span', id:this.getId('cardsLabel'), html:"cards"} | 162 | {tag:'span', id:this.getId('cardsLabel'), html:"cards"} |
169 | ]}, | 163 | ]}, |
170 | {tag:'li', id:this.getId('directLogins'), children:[ | 164 | {tag:'li', id:this.getId('directLogins'), children:[ |
171 | {tag:'span', id:this.getId('directLoginsNumber'), cls:'number', html:"-"}, | 165 | {tag:'span', id:this.getId('directLoginsNumber'), cls:'number', html:"-"}, |
172 | {tag:'span', id:this.getId('directLoginsLabel'), html:"direct logins"} | 166 | {tag:'span', id:this.getId('directLoginsLabel'), html:"direct logins"} |
173 | ]} | 167 | ]} |
174 | ]}, | 168 | ]}, |
175 | {tag:'a', href:'#', id:this.getId('logout'), html:"logout >"} | 169 | {tag:'a', href:'#', id:this.getId('logout'), html:"logout >"} |
176 | ]}, | 170 | ]}, |
177 | {tag:'div', cls:'footer'} | 171 | {tag:'div', cls:'footer'} |
178 | ]); | 172 | ]); |
179 | 173 | ||
180 | MochiKit.Signal.connect(this.getElement('logout'), 'onclick', this, 'handleLogout'); | 174 | MochiKit.Signal.connect(this.getElement('logout'), 'onclick', this, 'handleLogout'); |
181 | MochiKit.Signal.connect(this.getElement('lock'), 'onclick', this, 'toggleLock'); | 175 | MochiKit.Signal.connect(this.getElement('lock'), 'onclick', this, 'toggleLock'); |
182 | 176 | ||
183 | this._lockTooltip = new Clipperz.PM.UI.Common.Components.Tooltip({ | 177 | this._lockTooltip = new Clipperz.PM.UI.Common.Components.Tooltip({ |
184 | element:this.getElement('lock'), | 178 | element:this.getElement('lock'), |
185 | text: "Click here to lock/unlock your account.", | 179 | text: "Click here to lock/unlock your account.", |
186 | position:'RIGHT' | 180 | position:'RIGHT' |
187 | }); | 181 | }); |
188 | 182 | ||
189 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, | 183 | Clipperz.DOM.Helper.append(MochiKit.DOM.currentDocument().body, |
190 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper', children:[ | 184 | {tag:'div', id:this.getId('modalDialogWrapper'), cls:'modalDialogWrapper', children:[ |
191 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask userInfoBoxMask'} | 185 | {tag:'div', id:this.getId('modalDialogMask'), cls:'modalDialogMask userInfoBoxMask'} |
192 | ]} | 186 | ]} |
193 | ); | 187 | ); |
194 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); | 188 | MochiKit.Style.hideElement(this.getId('modalDialogMask')); |
195 | 189 | ||
196 | // this.drawUserInfoBackground(this.getElement('canvas')); | 190 | // this.drawUserInfoBackground(this.getElement('canvas')); |
197 | }, | 191 | }, |
198 | 192 | ||
199 | //------------------------------------------------------------------------- | 193 | //------------------------------------------------------------------------- |
200 | /* | 194 | /* |
201 | 'drawUserInfoBackground': function (canvas) { | 195 | 'drawUserInfoBackground': function (canvas) { |
202 | var kMyDrawingFunctionWidth = 188.0; | 196 | var kMyDrawingFunctionWidth = 188.0; |
203 | var kMyDrawingFunctionHeight = 154.0; | 197 | var kMyDrawingFunctionHeight = 154.0; |
204 | 198 | ||
205 | var context = canvas.getContext("2d"); | 199 | var context = canvas.getContext("2d"); |
206 | var color; | 200 | var color; |
207 | var resolution; | 201 | var resolution; |
208 | var alignStroke; | 202 | var alignStroke; |
209 | var path; | 203 | var path; |
210 | var pointX; | 204 | var pointX; |
211 | var pointY; | 205 | var pointY; |
212 | var controlPoint1X; | 206 | var controlPoint1X; |
213 | var controlPoint1Y; | 207 | var controlPoint1Y; |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js index 1ab2e69..3d9d6d3 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.AppController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.AppController = function(args) { |
29 | 27 | ||
30 | this._user = null; | 28 | this._user = null; |
31 | this._tabSlotNames = { | 29 | this._tabSlotNames = { |
32 | //tabName: slotName | 30 | //tabName: slotName |
33 | 'cards': 'cardGrid', | 31 | 'cards': 'cardGrid', |
34 | // 'directLogins':'directLoginGrid', | 32 | // 'directLogins':'directLoginGrid', |
35 | 'account': 'accountPanel', | 33 | 'account': 'accountPanel', |
36 | 'data': 'dataPanel', | 34 | 'data': 'dataPanel', |
37 | 'tools': 'toolsPanel' | 35 | 'tools': 'toolsPanel' |
38 | }; | 36 | }; |
39 | 37 | ||
40 | //controllers | 38 | //controllers |
41 | this._cardsController= null; | 39 | this._cardsController= null; |
42 | //this._directLoginsController = null; | 40 | //this._directLoginsController = null; |
43 | this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController(); | 41 | this._filterController = null; //new Clipperz.PM.UI.Web.Controllers.FilterController(); |
44 | 42 | ||
45 | //components | 43 | //components |
46 | this._appPage = null; | 44 | this._appPage = null; |
47 | this._userInfoBox = null; | 45 | this._userInfoBox = null; |
48 | this._tabSidePanel = null; | 46 | this._tabSidePanel = null; |
49 | 47 | ||
50 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'editCard', this, 'handleEditCard'); | 48 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'editCard', this, 'handleEditCard'); |
51 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'deleteCard',this, 'handleDeleteCard'); | 49 | // MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'deleteCard',this, 'handleDeleteCard'); |
52 | 50 | ||
53 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userDataSuccessfullySaved',this, 'userDataSuccessfullySavedHandler'); | 51 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'userDataSuccessfullySaved',this, 'userDataSuccessfullySavedHandler'); |
54 | 52 | ||
55 | return this; | 53 | return this; |
56 | } | 54 | } |
57 | 55 | ||
58 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | 56 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { |
59 | 57 | ||
60 | 'toString': function() { | 58 | 'toString': function() { |
61 | return "Clipperz.PM.UI.Web.Controllers.AppController"; | 59 | return "Clipperz.PM.UI.Web.Controllers.AppController"; |
62 | }, | 60 | }, |
63 | 61 | ||
64 | //----------------------------------------------------------------------------- | 62 | //----------------------------------------------------------------------------- |
65 | 63 | ||
66 | 'setUser': function(anUser) { | 64 | 'setUser': function(anUser) { |
67 | this._user = anUser; | 65 | this._user = anUser; |
68 | }, | 66 | }, |
69 | 67 | ||
70 | 'user': function() { | 68 | 'user': function() { |
71 | return this._user; | 69 | return this._user; |
72 | }, | 70 | }, |
73 | 71 | ||
74 | //----------------------------------------------------------------------------- | 72 | //----------------------------------------------------------------------------- |
75 | /* | 73 | /* |
76 | 'tabSlotNames': function() { | 74 | 'tabSlotNames': function() { |
77 | return this._tabSlotNames; | 75 | return this._tabSlotNames; |
78 | }, | 76 | }, |
79 | */ | 77 | */ |
80 | 'slotNameForTab': function(aTabName) { | 78 | 'slotNameForTab': function(aTabName) { |
81 | return this._tabSlotNames[aTabName]; | 79 | return this._tabSlotNames[aTabName]; |
82 | }, | 80 | }, |
83 | 81 | ||
84 | 'hideAllAppPageTabSlots': function() { | 82 | 'hideAllAppPageTabSlots': function() { |
85 | var aTabName; | 83 | var aTabName; |
86 | 84 | ||
@@ -263,89 +261,88 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, { | |||
263 | case 'cards': | 261 | case 'cards': |
264 | this.cardsController().focus(); | 262 | this.cardsController().focus(); |
265 | break; | 263 | break; |
266 | // case 'directLogins': | 264 | // case 'directLogins': |
267 | // this.directLoginsController().focus(); | 265 | // this.directLoginsController().focus(); |
268 | // break; | 266 | // break; |
269 | case 'data': | 267 | case 'data': |
270 | break; | 268 | break; |
271 | case 'account': | 269 | case 'account': |
272 | break; | 270 | break; |
273 | case 'tools': | 271 | case 'tools': |
274 | break; | 272 | break; |
275 | } | 273 | } |
276 | //Clipperz.log("<-- AppController.handleTabSelected", aTabName); | 274 | //Clipperz.log("<-- AppController.handleTabSelected", aTabName); |
277 | }, | 275 | }, |
278 | 276 | ||
279 | //============================================================================= | 277 | //============================================================================= |
280 | 278 | ||
281 | 'handleAddCard': function (aSourceElement) { | 279 | 'handleAddCard': function (aSourceElement) { |
282 | //Clipperz.log("=== AppController.addCard", aSourceElement); | 280 | //Clipperz.log("=== AppController.addCard", aSourceElement); |
283 | this.cardsController().addCard(aSourceElement); | 281 | this.cardsController().addCard(aSourceElement); |
284 | }, | 282 | }, |
285 | 283 | ||
286 | //============================================================================= | 284 | //============================================================================= |
287 | 285 | ||
288 | 'userDataSuccessfullySavedHandler': function (anEvent) { | 286 | 'userDataSuccessfullySavedHandler': function (anEvent) { |
289 | this.populateUserInfo(); | 287 | this.populateUserInfo(); |
290 | }, | 288 | }, |
291 | 289 | ||
292 | //============================================================================= | 290 | //============================================================================= |
293 | 291 | ||
294 | 'handleLogout': function(anEvent) { | 292 | 'handleLogout': function(anEvent) { |
295 | var deferredResult; | 293 | var deferredResult; |
296 | 294 | ||
297 | deferredResult = new Clipperz.Async.Deferred("AppController.handleLogout", {trace:false}); | 295 | deferredResult = new Clipperz.Async.Deferred("AppController.handleLogout", {trace:false}); |
298 | deferredResult.addMethod(this.user(), 'logout'); | 296 | deferredResult.addMethod(this.user(), 'logout'); |
299 | deferredResult.addCallback(MochiKit.Signal.signal, this, 'logout'); | 297 | deferredResult.addCallback(MochiKit.Signal.signal, this, 'logout'); |
300 | deferredResult.callback(); | 298 | deferredResult.callback(); |
301 | 299 | ||
302 | return deferredResult; | 300 | return deferredResult; |
303 | }, | 301 | }, |
304 | 302 | ||
305 | //----------------------------------------------------------------------------- | 303 | //----------------------------------------------------------------------------- |
306 | 304 | ||
307 | 'handleLock': function (anEvent) { | 305 | 'handleLock': function (anEvent) { |
308 | return Clipperz.Async.callbacks("AppController.handleLock", [ | 306 | return Clipperz.Async.callbacks("AppController.handleLock", [ |
309 | MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'), | 307 | MochiKit.Base.method(this.cardsController(), 'deleteAllCleanTextData'), |
310 | MochiKit.Base.method(this.user(), 'lock') | 308 | MochiKit.Base.method(this.user(), 'lock') |
311 | ], {trace:false}); | 309 | ], {trace:false}); |
312 | }, | 310 | }, |
313 | 311 | ||
314 | //............................................................................. | 312 | //............................................................................. |
315 | 313 | ||
316 | 'handleUnlock': function (anEvent) { | 314 | 'handleUnlock': function (anEvent) { |
317 | return Clipperz.Async.callbacks("AppController.handleUnock", [ | 315 | return Clipperz.Async.callbacks("AppController.handleUnock", [ |
318 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'), | 316 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'initProgress'), |
319 | MochiKit.Base.method(this.user(), 'login'), | 317 | MochiKit.Base.method(this.user(), 'login'), |
320 | MochiKit.Base.method(this.cardsController(), 'focus'), | 318 | MochiKit.Base.method(this.cardsController(), 'focus'), |
321 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'), | 319 | MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'progressDone'), |
322 | MochiKit.Base.method(this.userInfoBox(), 'unlock') | 320 | MochiKit.Base.method(this.userInfoBox(), 'unlock') |
323 | ], {trace:false}); | 321 | ], {trace:false}); |
324 | }, | 322 | }, |
325 | 323 | ||
326 | 'handleDownloadOfflineCopy': function (anEvent) { | 324 | 'handleDownloadOfflineCopy': function (anEvent) { |
327 | console.log("AppController.handleDownloadOfflineCopy"); | ||
328 | var downloadHref; | 325 | var downloadHref; |
329 | 326 | ||
330 | downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl; | 327 | downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl; |
331 | 328 | ||
332 | if (Clipperz_IEisBroken == true) { | 329 | if (Clipperz_IEisBroken == true) { |
333 | window.open(downloadHref, ""); | 330 | window.open(downloadHref, ""); |
334 | } else { | 331 | } else { |
335 | vardeferredResult; | 332 | vardeferredResult; |
336 | var newWindow; | 333 | var newWindow; |
337 | 334 | ||
338 | newWindow = window.open("", ""); | 335 | newWindow = window.open("", ""); |
339 | 336 | ||
340 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true}); | 337 | deferredResult = new Clipperz.Async.Deferred("AppController.handleDownloadOfflineCopy", {trace:true}); |
341 | deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); | 338 | deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'echo', {'echo':"echo"}); |
342 | deferredResult.addCallback(function(aWindow) { | 339 | deferredResult.addCallback(function(aWindow) { |
343 | aWindow.location.href = downloadHref; | 340 | aWindow.location.href = downloadHref; |
344 | }, newWindow); | 341 | }, newWindow); |
345 | deferredResult.callback(); | 342 | deferredResult.callback(); |
346 | } | 343 | } |
347 | }, | 344 | }, |
348 | 345 | ||
349 | //============================================================================= | 346 | //============================================================================= |
350 | __syntaxFix__: "syntax fix" | 347 | __syntaxFix__: "syntax fix" |
351 | }); | 348 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js index effde31..b1ff81f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.CardDialogController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); | 29 | Clipperz.PM.UI.Web.Controllers.CardDialogController.superclass.constructor.call(this, args); |
32 | 30 | ||
33 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); | 31 | this._record = args.record || Clipperz.Base.exception.raise('MandatoryParameter'); |
34 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); | 32 | this._delegate = args.delegate || Clipperz.Base.exception.raise('MandatoryParameter'); |
35 | 33 | ||
36 | this._referenceElement = null; | 34 | this._referenceElement = null; |
37 | this._cardDialogComponent = null; | 35 | this._cardDialogComponent = null; |
38 | 36 | ||
39 | this._fieldsReferences = {}; | 37 | this._fieldsReferences = {}; |
40 | this._directLoginReferences = {}; | 38 | this._directLoginReferences = {}; |
41 | 39 | ||
42 | this._directLoginWizardController = null; | 40 | this._directLoginWizardController = null; |
43 | this._directLoginEditingComponent = null; | 41 | this._directLoginEditingComponent = null; |
44 | this._isDirectLoginEditingComponentVisible = false; | 42 | this._isDirectLoginEditingComponentVisible = false; |
45 | 43 | ||
46 | return this; | 44 | return this; |
47 | }; | 45 | }; |
48 | 46 | ||
49 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { | 47 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object, { |
50 | 48 | ||
51 | 'toString': function() { | 49 | 'toString': function() { |
52 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; | 50 | return "Clipperz.PM.UI.Web.Controllers.CardDialogController"; |
53 | }, | 51 | }, |
54 | 52 | ||
55 | //------------------------------------------------------------------------- | 53 | //------------------------------------------------------------------------- |
56 | 54 | ||
57 | 'record': function () { | 55 | 'record': function () { |
58 | return this._record; | 56 | return this._record; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | 'delegate': function () { | 59 | 'delegate': function () { |
62 | return this._delegate; | 60 | return this._delegate; |
63 | }, | 61 | }, |
64 | 62 | ||
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | 64 | ||
67 | 'fieldsReferences': function () { | 65 | 'fieldsReferences': function () { |
68 | return this._fieldsReferences; | 66 | return this._fieldsReferences; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | 'directLoginReferences': function () { | 69 | 'directLoginReferences': function () { |
72 | return this._directLoginReferences; | 70 | return this._directLoginReferences; |
73 | }, | 71 | }, |
74 | 72 | ||
75 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
76 | 74 | ||
77 | 'referenceElement': function () { | 75 | 'referenceElement': function () { |
78 | return this._referenceElement; | 76 | return this._referenceElement; |
79 | }, | 77 | }, |
80 | 78 | ||
81 | 'setReferenceElement': function (anElement) { | 79 | 'setReferenceElement': function (anElement) { |
82 | this._referenceElement = anElement; | 80 | this._referenceElement = anElement; |
83 | }, | 81 | }, |
84 | 82 | ||
85 | //------------------------------------------------------------------------- | 83 | //------------------------------------------------------------------------- |
86 | 84 | ||
@@ -313,129 +311,128 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object | |||
313 | MochiKit.Base.method(aFieldReference['field'], 'actionType'), | 311 | MochiKit.Base.method(aFieldReference['field'], 'actionType'), |
314 | MochiKit.Base.method(aFieldReference['component'],'setActionType') | 312 | MochiKit.Base.method(aFieldReference['component'],'setActionType') |
315 | ], {trace:false}); | 313 | ], {trace:false}); |
316 | 314 | ||
317 | return deferredResult; | 315 | return deferredResult; |
318 | }, | 316 | }, |
319 | 317 | ||
320 | //------------------------------------------------------------------------- | 318 | //------------------------------------------------------------------------- |
321 | 319 | ||
322 | 'updateRecordDirectLoginValues': function (aDirectLoginReference) { | 320 | 'updateRecordDirectLoginValues': function (aDirectLoginReference) { |
323 | var deferredResult; | 321 | var deferredResult; |
324 | 322 | ||
325 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordDirectLoginValues', [ | 323 | deferredResult = Clipperz.Async.callbacks('CardDialogController.updateRecordDirectLoginValues', [ |
326 | MochiKit.Base.method(aDirectLoginReference['component'], 'label'), | 324 | MochiKit.Base.method(aDirectLoginReference['component'], 'label'), |
327 | MochiKit.Base.method(aDirectLoginReference['directLogin'], 'setLabel') | 325 | MochiKit.Base.method(aDirectLoginReference['directLogin'], 'setLabel') |
328 | ], {trace:false}); | 326 | ], {trace:false}); |
329 | 327 | ||
330 | return deferredResult; | 328 | return deferredResult; |
331 | }, | 329 | }, |
332 | 330 | ||
333 | //------------------------------------------------------------------------- | 331 | //------------------------------------------------------------------------- |
334 | 332 | ||
335 | 'updateRecordDirectLoginDetails': function (aDirectLogin) { | 333 | 'updateRecordDirectLoginDetails': function (aDirectLogin) { |
336 | var result; | 334 | var result; |
337 | 335 | ||
338 | if (MochiKit.Base.isUndefinedOrNull(aDirectLogin)) { | 336 | if (MochiKit.Base.isUndefinedOrNull(aDirectLogin)) { |
339 | result = MochiKit.Async.succeed(); | 337 | result = MochiKit.Async.succeed(); |
340 | } else { | 338 | } else { |
341 | result = Clipperz.Async.callbacks("CardDialogController.updateRecordDirectLoginDetails", [ | 339 | result = Clipperz.Async.callbacks("CardDialogController.updateRecordDirectLoginDetails", [ |
342 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), | 340 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), |
343 | MochiKit.Base.method(aDirectLogin, 'setLabel'), | 341 | MochiKit.Base.method(aDirectLogin, 'setLabel'), |
344 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), | 342 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), |
345 | MochiKit.Base.method(aDirectLogin, 'setFavicon') | 343 | MochiKit.Base.method(aDirectLogin, 'setFavicon') |
346 | ], {trace:false}); | 344 | ], {trace:false}); |
347 | } | 345 | } |
348 | 346 | ||
349 | return result; | 347 | return result; |
350 | }, | 348 | }, |
351 | 349 | ||
352 | //========================================================================= | 350 | //========================================================================= |
353 | 351 | ||
354 | 'addField': function () { | 352 | 'addField': function () { |
355 | return this.record().addField({ | 353 | return this.record().addField({ |
356 | 'label':this.cardDialogComponent().newFieldLabel(), | 354 | 'label':this.cardDialogComponent().newFieldLabel(), |
357 | 'value':this.cardDialogComponent().newFieldValue(), | 355 | 'value':this.cardDialogComponent().newFieldValue(), |
358 | 'isHidden':this.cardDialogComponent().newFieldIsHidden() | 356 | 'isHidden':this.cardDialogComponent().newFieldIsHidden() |
359 | }); | 357 | }); |
360 | }, | 358 | }, |
361 | 359 | ||
362 | 'handleAddField': function () { | 360 | 'handleAddField': function () { |
363 | return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ | 361 | return Clipperz.Async.callbacks("CardDialogController.handleAddField", [ |
364 | MochiKit.Base.method(this, 'addField'), | 362 | MochiKit.Base.method(this, 'addField'), |
365 | 363 | ||
366 | MochiKit.Base.method(this, 'addCardDialogComponentWithField'), | 364 | MochiKit.Base.method(this, 'addCardDialogComponentWithField'), |
367 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), | 365 | MochiKit.Base.method(this.cardDialogComponent(), 'resetNewFieldInputs'), |
368 | 366 | ||
369 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | 367 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), |
370 | MochiKit.Base.method(this, 'handleChangedValue') | 368 | MochiKit.Base.method(this, 'handleChangedValue') |
371 | ], {trace:false}) | 369 | ], {trace:false}) |
372 | }, | 370 | }, |
373 | 371 | ||
374 | //------------------------------------------------------------------------- | 372 | //------------------------------------------------------------------------- |
375 | 373 | ||
376 | 'handlePerformFieldAction': function (aFieldID, aTargetElement) { | 374 | 'handlePerformFieldAction': function (aFieldID, aTargetElement) { |
377 | //console.log("### targetElement", aTargetElement); | ||
378 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | 375 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ |
379 | MochiKit.Base.method(this.record(), 'fields'), | 376 | MochiKit.Base.method(this.record(), 'fields'), |
380 | MochiKit.Base.itemgetter(aFieldID), | 377 | MochiKit.Base.itemgetter(aFieldID), |
381 | Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { | 378 | Clipperz.Async.collectResults("CardDialogController.handleDeleteField <collect results>", { |
382 | 'value':MochiKit.Base.methodcaller('value'), | 379 | 'value':MochiKit.Base.methodcaller('value'), |
383 | 'type': MochiKit.Base.methodcaller('actionType') | 380 | 'type': MochiKit.Base.methodcaller('actionType') |
384 | }, {trace:false}), | 381 | }, {trace:false}), |
385 | MochiKit.Base.bind(function (someValues) { | 382 | MochiKit.Base.bind(function (someValues) { |
386 | switch (someValues['type']) { | 383 | switch (someValues['type']) { |
387 | case 'NONE': | 384 | case 'NONE': |
388 | throw "this event handler should not be triggered for fields with type 'NONE'"; | 385 | throw "this event handler should not be triggered for fields with type 'NONE'"; |
389 | break; | 386 | break; |
390 | case 'URL': | 387 | case 'URL': |
391 | var url; | 388 | var url; |
392 | 389 | ||
393 | url = someValues['value']; | 390 | url = someValues['value']; |
394 | if (/^https?\:\/\//.test(url) == false) { | 391 | if (/^https?\:\/\//.test(url) == false) { |
395 | url = 'http://' + url; | 392 | url = 'http://' + url; |
396 | } | 393 | } |
397 | 394 | ||
398 | window.open(url); | 395 | window.open(url); |
399 | break; | 396 | break; |
400 | case 'EMAIL': | 397 | case 'EMAIL': |
401 | var url; | 398 | var url; |
402 | 399 | ||
403 | url = 'mailto:' + someValues['value']; | 400 | url = 'mailto:' + someValues['value']; |
404 | 401 | ||
405 | MochiKit.DOM.currentWindow().location = url; | 402 | MochiKit.DOM.currentWindow().location = url; |
406 | break; | 403 | break; |
407 | case 'PASSWORD': | 404 | case 'PASSWORD': |
408 | //Clipperz.log("SHOW PASSWORD " + someValues['value']); | 405 | //Clipperz.log("SHOW PASSWORD " + someValues['value']); |
409 | this.showPasswordTooltip(someValues['value'], aTargetElement); | 406 | this.showPasswordTooltip(someValues['value'], aTargetElement); |
410 | break; | 407 | break; |
411 | } | 408 | } |
412 | }, this) | 409 | }, this) |
413 | ], {trace:false}); | 410 | ], {trace:false}); |
414 | }, | 411 | }, |
415 | 412 | ||
416 | //------------------------------------------------------------------------- | 413 | //------------------------------------------------------------------------- |
417 | 414 | ||
418 | 'handleDeleteField': function (aFieldID) { | 415 | 'handleDeleteField': function (aFieldID) { |
419 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ | 416 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [ |
420 | MochiKit.Base.method(this.record(), 'fields'), | 417 | MochiKit.Base.method(this.record(), 'fields'), |
421 | MochiKit.Base.itemgetter(aFieldID), | 418 | MochiKit.Base.itemgetter(aFieldID), |
422 | MochiKit.Base.method(this.record(), 'removeField'), | 419 | MochiKit.Base.method(this.record(), 'removeField'), |
423 | 420 | ||
424 | MochiKit.Base.method(this, 'fieldsReferences'), | 421 | MochiKit.Base.method(this, 'fieldsReferences'), |
425 | MochiKit.Base.itemgetter(aFieldID), | 422 | MochiKit.Base.itemgetter(aFieldID), |
426 | MochiKit.Base.itemgetter('component'), | 423 | MochiKit.Base.itemgetter('component'), |
427 | 424 | ||
428 | function (aComponent) { | 425 | function (aComponent) { |
429 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField [fade and remove]", [ | 426 | return Clipperz.Async.callbacks("CardDialogController.handleDeleteField [fade and remove]", [ |
430 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | 427 | MochiKit.Base.partial(Clipperz.Visual.deferredAnimation, MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), |
431 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), | 428 | // Clipperz.Visual.deferredAnimation(MochiKit.Visual.fade, aComponent.element(), {from:1.0, to:0.0, duration:0.5}), |
432 | MochiKit.Base.method(aComponent, 'remove') | 429 | MochiKit.Base.method(aComponent, 'remove') |
433 | ], {trace:false}); | 430 | ], {trace:false}); |
434 | }, | 431 | }, |
435 | 432 | ||
436 | MochiKit.Base.bind(function () { | 433 | MochiKit.Base.bind(function () { |
437 | delete this.fieldsReferences()[aFieldID]; | 434 | delete this.fieldsReferences()[aFieldID]; |
438 | }, this), | 435 | }, this), |
439 | 436 | ||
440 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), | 437 | MochiKit.Base.method(this.cardDialogComponent(), 'fixRendering'), |
441 | MochiKit.Base.method(this, 'handleChangedValue') | 438 | MochiKit.Base.method(this, 'handleChangedValue') |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js index f58f0b8..68b5b9f 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.CardsController = function() { | 26 | Clipperz.PM.UI.Web.Controllers.CardsController = function() { |
29 | Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); | 27 | Clipperz.PM.UI.Web.Controllers.CardsController.superclass.constructor.apply(this, arguments); |
30 | 28 | ||
31 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); | 29 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'cardDialogComponentClosed', this, 'handleHideCard'); |
32 | 30 | ||
33 | return this; | 31 | return this; |
34 | } | 32 | } |
35 | 33 | ||
36 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { | 34 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardsController, Clipperz.PM.UI.Web.Controllers.GridController, { |
37 | 35 | ||
38 | 'toString': function() { | 36 | 'toString': function() { |
39 | return "Clipperz.PM.UI.Web.Controllers.CardsController"; | 37 | return "Clipperz.PM.UI.Web.Controllers.CardsController"; |
40 | }, | 38 | }, |
41 | 39 | ||
42 | 'createGrid': function () { | 40 | 'createGrid': function () { |
43 | var grid; | 41 | var grid; |
44 | 42 | ||
45 | grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | 43 | grid = new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ |
46 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | 44 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ |
47 | 'name': 'Cards.favicon', | 45 | 'name': 'Cards.favicon', |
48 | 'selector': MochiKit.Base.methodcaller('favicon'), | 46 | 'selector': MochiKit.Base.methodcaller('favicon'), |
49 | 'cssClass': 'favicon' | 47 | 'cssClass': 'favicon' |
50 | }), | 48 | }), |
51 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 49 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
52 | 'name': 'Cards.title', | 50 | 'name': 'Cards.title', |
53 | 'selector': MochiKit.Base.methodcaller('label'), | 51 | 'selector': MochiKit.Base.methodcaller('label'), |
54 | 'label': 'title', | 52 | 'label': 'title', |
55 | 'cssClass': 'title', | 53 | 'cssClass': 'title', |
56 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 54 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
57 | 'sortable': true, | 55 | 'sortable': true, |
58 | 'sorted': 'ASCENDING', | 56 | 'sorted': 'ASCENDING', |
59 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'editCard', {objectData:anObject, element:anEvent.src()})} | 57 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'editCard', {objectData:anObject, element:anEvent.src()})} |
60 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | 58 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') |
61 | }), | 59 | }), |
62 | new Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager({ | 60 | new Clipperz.PM.UI.Web.Components.DirectLoginsColumnManager({ |
63 | 'name': 'Cards.directLogins', | 61 | 'name': 'Cards.directLogins', |
64 | 'selector': MochiKit.Base.methodcaller('directLoginReferences'), | 62 | 'selector': MochiKit.Base.methodcaller('directLoginReferences'), |
65 | 'label': 'direct logins', | 63 | 'label': 'direct logins', |
66 | 'cssClass': 'directLogin' | 64 | 'cssClass': 'directLogin' |
67 | }), | 65 | }), |
68 | new Clipperz.PM.UI.Web.Components.DateColumnManager({ | 66 | new Clipperz.PM.UI.Web.Components.DateColumnManager({ |
69 | 'name': 'Cards.latestUpdate', | 67 | 'name': 'Cards.latestUpdate', |
70 | 'selector': MochiKit.Base.methodcaller('updateDate'), | 68 | 'selector': MochiKit.Base.methodcaller('updateDate'), |
71 | 'label': 'latest update', | 69 | 'label': 'latest update', |
72 | 'cssClass': 'latestUpdate', | 70 | 'cssClass': 'latestUpdate', |
73 | 'format': 'd-m-Y', | 71 | 'format': 'd-m-Y', |
74 | 'comparator': MochiKit.Base.compare, | 72 | 'comparator': MochiKit.Base.compare, |
75 | 'sortable': true, | 73 | 'sortable': true, |
76 | 'sorted': 'UNSORTED' | 74 | 'sorted': 'UNSORTED' |
77 | }), | 75 | }), |
78 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ | 76 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ |
79 | 'name': 'Cards.delete', | 77 | 'name': 'Cards.delete', |
80 | 'selector': MochiKit.Base.noop, | 78 | 'selector': MochiKit.Base.noop, |
81 | 'cssClass': 'delete', | 79 | 'cssClass': 'delete', |
82 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteCard', {objectData:anObject, element:anEvent.src()})} | 80 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteCard', {objectData:anObject, element:anEvent.src()})} |
83 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteCard') | 81 | 'actionMethod': MochiKit.Base.method(this, 'handleDeleteCard') |
84 | }) | 82 | }) |
85 | ]}); | 83 | ]}); |
86 | 84 | ||
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js index c025a51..92ed6e3 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController = function(args) { |
29 | this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | 27 | this._directLoginEditingComponent = args.directLoginEditingComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); |
30 | this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); | 28 | this._cardLabel = args.cardLabel || Clipperz.Base.exception.raise('MandatoryParameter'); |
31 | 29 | ||
32 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); | 30 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'changedValue',this, 'handleChangedValue'); |
33 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); | 31 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'moveForward',this, 'handleMoveForward'); |
34 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); | 32 | MochiKit.Signal.connect(this._directLoginEditingComponent, 'keyPressed',this, 'handleDirectLoginEditingComponentKeyPressed'); |
35 | 33 | ||
36 | this._directLogin = null; | 34 | this._directLogin = null; |
37 | this._directLoginHasJustBeenAdded = false; | 35 | this._directLoginHasJustBeenAdded = false; |
38 | 36 | ||
39 | this._rulerComponent = null; | 37 | this._rulerComponent = null; |
40 | 38 | ||
41 | this._steps = null; | 39 | this._steps = null; |
42 | this._currentStepIndex = 0; | 40 | this._currentStepIndex = 0; |
43 | this._isNextEnabled = false; | 41 | this._isNextEnabled = false; |
44 | 42 | ||
45 | this._recordFields = null; | 43 | this._recordFields = null; |
46 | this._originalBindings = null; | 44 | this._originalBindings = null; |
47 | 45 | ||
48 | this._bindingComponents = []; | 46 | this._bindingComponents = []; |
49 | this._formValueComponents = []; | 47 | this._formValueComponents = []; |
50 | 48 | ||
51 | return this; | 49 | return this; |
52 | } | 50 | } |
53 | 51 | ||
54 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.prototype, { | 52 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.prototype, { |
55 | 53 | ||
56 | 'toString': function() { | 54 | 'toString': function() { |
57 | return "Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController"; | 55 | return "Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController"; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'directLogin': function () { | 60 | 'directLogin': function () { |
63 | return this._directLogin; | 61 | return this._directLogin; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'directLoginHasJustBeenAdded': function () { | 66 | 'directLoginHasJustBeenAdded': function () { |
69 | return this._directLoginHasJustBeenAdded; | 67 | return this._directLoginHasJustBeenAdded; |
70 | }, | 68 | }, |
71 | 69 | ||
72 | 'setDirectLoginHasJustBeenAdded': function (aValue) { | 70 | 'setDirectLoginHasJustBeenAdded': function (aValue) { |
73 | this._directLoginHasJustBeenAdded = aValue; | 71 | this._directLoginHasJustBeenAdded = aValue; |
74 | }, | 72 | }, |
75 | 73 | ||
76 | //------------------------------------------------------------------------- | 74 | //------------------------------------------------------------------------- |
77 | 75 | ||
78 | 'directLoginEditingComponent': function () { | 76 | 'directLoginEditingComponent': function () { |
79 | return this._directLoginEditingComponent; | 77 | return this._directLoginEditingComponent; |
80 | }, | 78 | }, |
81 | 79 | ||
82 | //============================================================================= | 80 | //============================================================================= |
83 | 81 | ||
84 | 'cardLabel': function () { | 82 | 'cardLabel': function () { |
85 | return this._cardLabel; | 83 | return this._cardLabel; |
86 | }, | 84 | }, |
@@ -102,129 +100,128 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController. | |||
102 | 'isNextEnabled': function () { | 100 | 'isNextEnabled': function () { |
103 | return this._isNextEnabled; | 101 | return this._isNextEnabled; |
104 | }, | 102 | }, |
105 | 103 | ||
106 | //----------------------------------------------------------------------------- | 104 | //----------------------------------------------------------------------------- |
107 | 105 | ||
108 | 'enablePrevious': function (aValue) { | 106 | 'enablePrevious': function (aValue) { |
109 | this.rulerComponent().enablePrevious(aValue); | 107 | this.rulerComponent().enablePrevious(aValue); |
110 | }, | 108 | }, |
111 | 109 | ||
112 | //============================================================================= | 110 | //============================================================================= |
113 | 111 | ||
114 | 'bindingComponents': function () { | 112 | 'bindingComponents': function () { |
115 | return this._bindingComponents; | 113 | return this._bindingComponents; |
116 | }, | 114 | }, |
117 | 115 | ||
118 | 'resetBindingComponents': function () { | 116 | 'resetBindingComponents': function () { |
119 | this.directLoginEditingComponent().clearAllBindingsComponents(); | 117 | this.directLoginEditingComponent().clearAllBindingsComponents(); |
120 | this._bindingComponents = []; | 118 | this._bindingComponents = []; |
121 | }, | 119 | }, |
122 | 120 | ||
123 | //============================================================================= | 121 | //============================================================================= |
124 | 122 | ||
125 | 'formValueComponents': function () { | 123 | 'formValueComponents': function () { |
126 | return this._formValueComponents; | 124 | return this._formValueComponents; |
127 | }, | 125 | }, |
128 | 126 | ||
129 | 'resetFormValueComponents': function () { | 127 | 'resetFormValueComponents': function () { |
130 | this.directLoginEditingComponent().clearAllFormValueComponents(); | 128 | this.directLoginEditingComponent().clearAllFormValueComponents(); |
131 | this._formValueComponents = []; | 129 | this._formValueComponents = []; |
132 | }, | 130 | }, |
133 | 131 | ||
134 | //============================================================================= | 132 | //============================================================================= |
135 | 133 | ||
136 | 'recordFields': function () { | 134 | 'recordFields': function () { |
137 | return this._recordFields; | 135 | return this._recordFields; |
138 | }, | 136 | }, |
139 | 137 | ||
140 | 'setRecordFields': function (aValue) { | 138 | 'setRecordFields': function (aValue) { |
141 | this._recordFields = aValue; | 139 | this._recordFields = aValue; |
142 | }, | 140 | }, |
143 | 141 | ||
144 | 'recordFieldWithReference': function (aReference) { | 142 | 'recordFieldWithReference': function (aReference) { |
145 | var matchingValues; | 143 | var matchingValues; |
146 | var result; | 144 | var result; |
147 | 145 | ||
148 | matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); | 146 | matchingValues = MochiKit.Base.filter(function (aField) { return aField['reference'] == aReference; }, this.recordFields()); |
149 | 147 | ||
150 | if (matchingValues.length == 0) { | 148 | if (matchingValues.length == 0) { |
151 | result = null; | 149 | result = null; |
152 | } else { | 150 | } else { |
153 | result = matchingValues[0]; | 151 | result = matchingValues[0]; |
154 | } | 152 | } |
155 | 153 | ||
156 | return result; | 154 | return result; |
157 | }, | 155 | }, |
158 | 156 | ||
159 | //----------------------------------------------------------------------------- | 157 | //----------------------------------------------------------------------------- |
160 | 158 | ||
161 | 'originalBindings': function () { | 159 | 'originalBindings': function () { |
162 | return this._originalBindings; | 160 | return this._originalBindings; |
163 | }, | 161 | }, |
164 | 162 | ||
165 | 'setOriginalBindings': function (aValue) { | 163 | 'setOriginalBindings': function (aValue) { |
166 | //console.log("BINDINGS", aValue); | ||
167 | this._originalBindings = aValue; | 164 | this._originalBindings = aValue; |
168 | }, | 165 | }, |
169 | 166 | ||
170 | //============================================================================= | 167 | //============================================================================= |
171 | 168 | ||
172 | 'rulerComponent': function () { | 169 | 'rulerComponent': function () { |
173 | if (this._rulerComponent == null) { | 170 | if (this._rulerComponent == null) { |
174 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | 171 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ |
175 | translationContext:'Wizards.DirectLoginWizard' | 172 | translationContext:'Wizards.DirectLoginWizard' |
176 | }); | 173 | }); |
177 | this._rulerComponent.render(); | 174 | this._rulerComponent.render(); |
178 | 175 | ||
179 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | 176 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); |
180 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | 177 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); |
181 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | 178 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); |
182 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | 179 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); |
183 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | 180 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); |
184 | } | 181 | } |
185 | 182 | ||
186 | return this._rulerComponent; | 183 | return this._rulerComponent; |
187 | }, | 184 | }, |
188 | 185 | ||
189 | //----------------------------------------------------------------------------- | 186 | //----------------------------------------------------------------------------- |
190 | 187 | ||
191 | 'showRuler': function (someSteps) { | 188 | 'showRuler': function (someSteps) { |
192 | var rulerElement; | 189 | var rulerElement; |
193 | 190 | ||
194 | this.setSteps(someSteps); | 191 | this.setSteps(someSteps); |
195 | 192 | ||
196 | rulerElement = this.rulerComponent().element(); | 193 | rulerElement = this.rulerComponent().element(); |
197 | this.directLoginEditingComponent().disableAllPanels(); | 194 | this.directLoginEditingComponent().disableAllPanels(); |
198 | 195 | ||
199 | MochiKit.Style.showElement(rulerElement); | 196 | MochiKit.Style.showElement(rulerElement); |
200 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.directLoginEditingComponent().bottomMargin()}); | 197 | MochiKit.Style.setElementPosition(rulerElement, {x:-1000, y:this.directLoginEditingComponent().bottomMargin()}); |
201 | new MochiKit.Visual.Move(rulerElement, { | 198 | new MochiKit.Visual.Move(rulerElement, { |
202 | x:0, y:this.directLoginEditingComponent().bottomMargin(), | 199 | x:0, y:this.directLoginEditingComponent().bottomMargin(), |
203 | mode:'absolute', | 200 | mode:'absolute', |
204 | duration:1, | 201 | duration:1, |
205 | afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') | 202 | afterFinish:MochiKit.Base.method(this, 'handleCursorMoved') |
206 | }); | 203 | }); |
207 | }, | 204 | }, |
208 | 205 | ||
209 | 'fixRulerRendering': function (aValue) { | 206 | 'fixRulerRendering': function (aValue) { |
210 | this.rulerComponent().setDisplayMode(aValue); | 207 | this.rulerComponent().setDisplayMode(aValue); |
211 | }, | 208 | }, |
212 | 209 | ||
213 | //----------------------------------------------------------------------------- | 210 | //----------------------------------------------------------------------------- |
214 | 211 | ||
215 | 'hideRuler': function () { | 212 | 'hideRuler': function () { |
216 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:1}); | 213 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:1}); |
217 | }, | 214 | }, |
218 | 215 | ||
219 | 'doneWithRuler': function () { | 216 | 'doneWithRuler': function () { |
220 | var rulerComponentElement; | 217 | var rulerComponentElement; |
221 | 218 | ||
222 | rulerComponentElement = this.rulerComponent().element(); | 219 | rulerComponentElement = this.rulerComponent().element(); |
223 | new MochiKit.Visual.Move(this.rulerComponent().element(), { | 220 | new MochiKit.Visual.Move(this.rulerComponent().element(), { |
224 | x:1000, | 221 | x:1000, |
225 | mode:'relative', | 222 | mode:'relative', |
226 | duration:1, | 223 | duration:1, |
227 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) | 224 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) |
228 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } | 225 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } |
229 | }); | 226 | }); |
230 | }, | 227 | }, |
@@ -346,130 +343,128 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController. | |||
346 | //----------------------------------------------------------------------------- | 343 | //----------------------------------------------------------------------------- |
347 | 344 | ||
348 | 'setFocus': function () { | 345 | 'setFocus': function () { |
349 | switch(this.currentStep()) { | 346 | switch(this.currentStep()) { |
350 | case 'LABEL': | 347 | case 'LABEL': |
351 | this.directLoginEditingComponent().focusOnLabelElement(); | 348 | this.directLoginEditingComponent().focusOnLabelElement(); |
352 | break; | 349 | break; |
353 | case 'TYPE': | 350 | case 'TYPE': |
354 | break; | 351 | break; |
355 | case 'CONFIGURATION': | 352 | case 'CONFIGURATION': |
356 | this.directLoginEditingComponent().focusOnBookmarkletConfigurationElement(); | 353 | this.directLoginEditingComponent().focusOnBookmarkletConfigurationElement(); |
357 | break; | 354 | break; |
358 | case 'BINDINGS': | 355 | case 'BINDINGS': |
359 | // this.directLoginEditingComponent().getElement('???').focus(); | 356 | // this.directLoginEditingComponent().getElement('???').focus(); |
360 | break; | 357 | break; |
361 | case 'FAVICON': | 358 | case 'FAVICON': |
362 | this.directLoginEditingComponent().focusOnFaviconElement(); | 359 | this.directLoginEditingComponent().focusOnFaviconElement(); |
363 | break; | 360 | break; |
364 | case 'DONE': | 361 | case 'DONE': |
365 | break; | 362 | break; |
366 | } | 363 | } |
367 | }, | 364 | }, |
368 | 365 | ||
369 | //============================================================================= | 366 | //============================================================================= |
370 | 367 | ||
371 | 'steps': function () { | 368 | 'steps': function () { |
372 | return this._steps; | 369 | return this._steps; |
373 | }, | 370 | }, |
374 | 371 | ||
375 | 'setSteps': function (aValue) { | 372 | 'setSteps': function (aValue) { |
376 | this._steps = aValue; | 373 | this._steps = aValue; |
377 | 374 | ||
378 | this.rulerComponent().setSteps(aValue); | 375 | this.rulerComponent().setSteps(aValue); |
379 | this.resetCurrentStepIndex(); | 376 | this.resetCurrentStepIndex(); |
380 | }, | 377 | }, |
381 | 378 | ||
382 | 'currentStepIndex': function () { | 379 | 'currentStepIndex': function () { |
383 | return this._currentStepIndex; | 380 | return this._currentStepIndex; |
384 | }, | 381 | }, |
385 | 382 | ||
386 | 'currentStep': function () { | 383 | 'currentStep': function () { |
387 | return this.steps()[this.currentStepIndex()]; | 384 | return this.steps()[this.currentStepIndex()]; |
388 | }, | 385 | }, |
389 | 386 | ||
390 | //============================================================================= | 387 | //============================================================================= |
391 | 388 | ||
392 | 'handleExit': function () { | 389 | 'handleExit': function () { |
393 | MochiKit.Signal.signal(this, 'exit'); | 390 | MochiKit.Signal.signal(this, 'exit'); |
394 | }, | 391 | }, |
395 | 392 | ||
396 | 'done': function () { | 393 | 'done': function () { |
397 | this.doneWithRuler(); | 394 | this.doneWithRuler(); |
398 | 395 | ||
399 | Clipperz.Async.callbacks("DirectLoginWizardController.done", [ | 396 | Clipperz.Async.callbacks("DirectLoginWizardController.done", [ |
400 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), | 397 | MochiKit.Base.method(this.directLoginEditingComponent(), 'label'), |
401 | MochiKit.Base.method(this.directLogin(), 'setLabel'), | 398 | MochiKit.Base.method(this.directLogin(), 'setLabel'), |
402 | 399 | ||
403 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bookmarkletConfiguration'), | 400 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bookmarkletConfiguration'), |
404 | MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration'), | 401 | MochiKit.Base.method(this.directLogin(), 'setBookmarkletConfiguration'), |
405 | 402 | ||
406 | //Bindings | 403 | //Bindings |
407 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'), | 404 | MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'), |
408 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) { | 405 | // MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) { |
409 | Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) { | 406 | Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) { |
410 | //console.log("aBindingComponent", aBindingComponent); | ||
411 | // this.directLogin(). | ||
412 | return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [ | 407 | return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [ |
413 | MochiKit.Base.method(this.directLogin(), 'bindings'), | 408 | MochiKit.Base.method(this.directLogin(), 'bindings'), |
414 | MochiKit.Base.itemgetter(aBindingComponent.formFieldName()), | 409 | MochiKit.Base.itemgetter(aBindingComponent.formFieldName()), |
415 | MochiKit.Base.methodcaller('setFieldKey', aBindingComponent.selectedValue()) | 410 | MochiKit.Base.methodcaller('setFieldKey', aBindingComponent.selectedValue()) |
416 | ], {trace:false}); | 411 | ], {trace:false}); |
417 | }, this)), | 412 | }, this)), |
418 | 413 | ||
419 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), | 414 | MochiKit.Base.method(this.directLoginEditingComponent(), 'favicon'), |
420 | MochiKit.Base.method(this.directLogin(), 'setFavicon'), | 415 | MochiKit.Base.method(this.directLogin(), 'setFavicon'), |
421 | 416 | ||
422 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'done', { | 417 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'done', { |
423 | 'directLogin': this.directLogin(), | 418 | 'directLogin': this.directLogin(), |
424 | 'hasJustBeenAdded':this.directLoginHasJustBeenAdded() | 419 | 'hasJustBeenAdded':this.directLoginHasJustBeenAdded() |
425 | }) | 420 | }) |
426 | ], {trace:false}); | 421 | ], {trace:false}); |
427 | }, | 422 | }, |
428 | 423 | ||
429 | //============================================================================= | 424 | //============================================================================= |
430 | 425 | ||
431 | 'handleMoveBackward': function () { | 426 | 'handleMoveBackward': function () { |
432 | if (this._currentStepIndex > 0) { | 427 | if (this._currentStepIndex > 0) { |
433 | varafterMoveAction; | 428 | varafterMoveAction; |
434 | 429 | ||
435 | this._currentStepIndex --; | 430 | this._currentStepIndex --; |
436 | afterMoveAction = MochiKit.Base.noop; | 431 | afterMoveAction = MochiKit.Base.noop; |
437 | 432 | ||
438 | switch(this.currentStep()) { | 433 | switch(this.currentStep()) { |
439 | case 'LABEL': | 434 | case 'LABEL': |
440 | break; | 435 | break; |
441 | case 'TYPE': | 436 | case 'TYPE': |
442 | break; | 437 | break; |
443 | case 'CONFIGURATION': | 438 | case 'CONFIGURATION': |
444 | break; | 439 | break; |
445 | case 'BINDINGS': | 440 | case 'BINDINGS': |
446 | break; | 441 | break; |
447 | case 'FAVICON': | 442 | case 'FAVICON': |
448 | break; | 443 | break; |
449 | case 'DONE': | 444 | case 'DONE': |
450 | break; | 445 | break; |
451 | }; | 446 | }; |
452 | 447 | ||
453 | this.rulerComponent().moveBackward(afterMoveAction); | 448 | this.rulerComponent().moveBackward(afterMoveAction); |
454 | } | 449 | } |
455 | 450 | ||
456 | if (this._currentStepIndex == 0) { | 451 | if (this._currentStepIndex == 0) { |
457 | this.enablePrevious(false); | 452 | this.enablePrevious(false); |
458 | } | 453 | } |
459 | }, | 454 | }, |
460 | 455 | ||
461 | 'handleMoveForward': function () { | 456 | 'handleMoveForward': function () { |
462 | if (this.isNextEnabled()) { | 457 | if (this.isNextEnabled()) { |
463 | varafterMoveAction; | 458 | varafterMoveAction; |
464 | 459 | ||
465 | this._currentStepIndex ++; | 460 | this._currentStepIndex ++; |
466 | afterMoveAction = MochiKit.Base.noop; | 461 | afterMoveAction = MochiKit.Base.noop; |
467 | 462 | ||
468 | switch(this.currentStep()) { | 463 | switch(this.currentStep()) { |
469 | case 'LABEL': | 464 | case 'LABEL': |
470 | break; | 465 | break; |
471 | case 'TYPE': | 466 | case 'TYPE': |
472 | break; | 467 | break; |
473 | case 'CONFIGURATION': | 468 | case 'CONFIGURATION': |
474 | break; | 469 | break; |
475 | case 'BINDINGS': | 470 | case 'BINDINGS': |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js index 6ca3be4..7ab512a 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | /* | 24 | /* |
27 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 25 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
28 | 26 | ||
29 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { | 27 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController = function() { |
30 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); | 28 | Clipperz.PM.UI.Web.Controllers.DirectLoginsController.superclass.constructor.apply(this, arguments); |
31 | 29 | ||
32 | return this; | 30 | return this; |
33 | }; | 31 | }; |
34 | 32 | ||
35 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { | 33 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.DirectLoginsController, Clipperz.PM.UI.Web.Controllers.GridController, { |
36 | 34 | ||
37 | 'createGrid': function () { | 35 | 'createGrid': function () { |
38 | return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ | 36 | return new Clipperz.PM.UI.Web.Components.GridComponent({columnsManagers: [ |
39 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ | 37 | new Clipperz.PM.UI.Web.Components.FaviconColumnManager({ |
40 | 'name': 'DirectLogins.favicon', | 38 | 'name': 'DirectLogins.favicon', |
41 | 'selector': MochiKit.Base.methodcaller('favicon'), | 39 | 'selector': MochiKit.Base.methodcaller('favicon'), |
42 | 'cssClass': 'favicon' | 40 | 'cssClass': 'favicon' |
43 | }), | 41 | }), |
44 | // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 42 | // new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
45 | new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ | 43 | new Clipperz.PM.UI.Web.Components.DirectLoginColumnManager({ |
46 | 'name': 'DirectLogins.title', | 44 | 'name': 'DirectLogins.title', |
47 | 'selector': MochiKit.Base.methodcaller('label'), | 45 | 'selector': MochiKit.Base.methodcaller('label'), |
48 | 'label': 'title', | 46 | 'label': 'title', |
49 | 'cssClass': 'title', | 47 | 'cssClass': 'title', |
50 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 48 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
51 | 'sortable': true, | 49 | 'sortable': true, |
52 | 'sorted': 'ASCENDING', | 50 | 'sorted': 'ASCENDING', |
53 | 'actionMethod': MochiKit.Base.methodcaller('runDirectLogin') | 51 | 'actionMethod': MochiKit.Base.methodcaller('runDirectLogin') |
54 | }), | 52 | }), |
55 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | 53 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager |
56 | // 'label':'strength', | 54 | // 'label':'strength', |
57 | // 'cssClass':'title', | 55 | // 'cssClass':'title', |
58 | // 'selector': MochiKit.Base.methodcaller('label') //should be 'strength' or a strenght evaluation function | 56 | // 'selector': MochiKit.Base.methodcaller('label') //should be 'strength' or a strenght evaluation function |
59 | // }), | 57 | // }), |
60 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ | 58 | new Clipperz.PM.UI.Web.Components.LinkColumnManager({ |
61 | 'name': 'DirectLogins.cardTitle', | 59 | 'name': 'DirectLogins.cardTitle', |
62 | 'selector': MochiKit.Base.compose(MochiKit.Base.methodcaller('label'), MochiKit.Base.methodcaller('record')), | 60 | 'selector': MochiKit.Base.compose(MochiKit.Base.methodcaller('label'), MochiKit.Base.methodcaller('record')), |
63 | 'label': 'card', | 61 | 'label': 'card', |
64 | 'cssClass': 'cardTitle', | 62 | 'cssClass': 'cardTitle', |
65 | 'comparator': Clipperz.Base.caseInsensitiveCompare, | 63 | 'comparator': Clipperz.Base.caseInsensitiveCompare, |
66 | 'sortable': true, | 64 | 'sortable': true, |
67 | 'sorted': 'UNSORTED', | 65 | 'sorted': 'UNSORTED', |
68 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') | 66 | 'actionMethod': MochiKit.Base.method(this, 'handleShowCard') |
69 | }), | 67 | }), |
70 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager | 68 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ //should be StrengthColumnManager |
71 | // 'label':'last access', | 69 | // 'label':'last access', |
72 | // 'cssClass':'title', | 70 | // 'cssClass':'title', |
73 | // 'selector': MochiKit.Base.methodcaller('label') | 71 | // 'selector': MochiKit.Base.methodcaller('label') |
74 | // // 'sortable': true, | 72 | // // 'sortable': true, |
75 | // // 'sorted': 'UNSORTED' | 73 | // // 'sorted': 'UNSORTED' |
76 | // }), | 74 | // }), |
77 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ | 75 | // new Clipperz.PM.UI.Web.Components.TextColumnManager({ |
78 | // 'label':'commands', | 76 | // 'label':'commands', |
79 | // 'cssClass':'title', | 77 | // 'cssClass':'title', |
80 | // 'selector': MochiKit.Base.methodcaller('label'), //should be a function for commands display | 78 | // 'selector': MochiKit.Base.methodcaller('label'), //should be a function for commands display |
81 | // }), | 79 | // }), |
82 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ | 80 | new Clipperz.PM.UI.Web.Components.DeleteObjectColumnManager({ |
83 | 'name': 'DirectLogins.delete', | 81 | 'name': 'DirectLogins.delete', |
84 | 'selector': MochiKit.Base.noop, | 82 | 'selector': MochiKit.Base.noop, |
85 | 'cssClass': 'delete', | 83 | 'cssClass': 'delete', |
86 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteDirectLogin', {objectData:anObject, element:anEvent.src()})} | 84 | // 'actionMethod': function(anObject, anEvent) { MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'deleteDirectLogin', {objectData:anObject, element:anEvent.src()})} |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js index bfc093a..de59ec3 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.FilterController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.FilterController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); | 29 | Clipperz.PM.UI.Web.Controllers.FilterController.superclass.constructor.call(this, args); |
32 | 30 | ||
33 | this._filterElements = []; | 31 | this._filterElements = []; |
34 | this._filter = ""; | 32 | this._filter = ""; |
35 | 33 | ||
36 | this._pendingSearchClicks = 0; | 34 | this._pendingSearchClicks = 0; |
37 | 35 | ||
38 | return this; | 36 | return this; |
39 | }; | 37 | }; |
40 | 38 | ||
41 | 39 | ||
42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { | 40 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.FilterController, Object, { |
43 | 41 | ||
44 | //----------------------------------------------------------------------------- | 42 | //----------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'getFilter': function () { | 44 | 'getFilter': function () { |
47 | return this._filter; | 45 | return this._filter; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | '_setFilter': function (aFilterElement, aFilter) { | 48 | '_setFilter': function (aFilterElement, aFilter) { |
51 | if (aFilter != this._filter) { | 49 | if (aFilter != this._filter) { |
52 | this._filter = aFilter; | 50 | this._filter = aFilter; |
53 | MochiKit.Signal.signal(this, 'filterUpdated', aFilter); | 51 | MochiKit.Signal.signal(this, 'filterUpdated', aFilter); |
54 | this.updateFilterElements(aFilterElement, aFilter); | 52 | this.updateFilterElements(aFilterElement, aFilter); |
55 | } | 53 | } |
56 | }, | 54 | }, |
57 | 55 | ||
58 | 'setFilter': function (aFilter) { | 56 | 'setFilter': function (aFilter) { |
59 | this._setFilter(null, aFilter); | 57 | this._setFilter(null, aFilter); |
60 | }, | 58 | }, |
61 | 59 | ||
62 | //----------------------------------------------------------------------------- | 60 | //----------------------------------------------------------------------------- |
63 | 61 | ||
64 | 'filterElements': function () { | 62 | 'filterElements': function () { |
65 | return this._filterElements; | 63 | return this._filterElements; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | 'registerFilterElement': function (aFilterElement) { | 66 | 'registerFilterElement': function (aFilterElement) { |
69 | //Clipperz.log("=== FilterController.registerFilterElement", aFilterElement); | 67 | //Clipperz.log("=== FilterController.registerFilterElement", aFilterElement); |
70 | this._filterElements.push(aFilterElement); | 68 | this._filterElements.push(aFilterElement); |
71 | MochiKit.Signal.connect(aFilterElement, 'onkeydown', this, 'searchClickHandler'); | 69 | MochiKit.Signal.connect(aFilterElement, 'onkeydown', this, 'searchClickHandler'); |
72 | MochiKit.Signal.connect(aFilterElement, 'onfocus', this, 'searchClickHandler'); | 70 | MochiKit.Signal.connect(aFilterElement, 'onfocus', this, 'searchClickHandler'); |
73 | }, | 71 | }, |
74 | 72 | ||
75 | 'removeFilterElement': function (aFilterElement) { | 73 | 'removeFilterElement': function (aFilterElement) { |
76 | var i; | 74 | var i; |
77 | var filterElements; | 75 | var filterElements; |
78 | for (i=0; i < filterElements; i++) { | 76 | for (i=0; i < filterElements; i++) { |
79 | if (filterElements[i] == aFilterElement); | 77 | if (filterElements[i] == aFilterElement); |
80 | filterElements.splice(i, 1); | 78 | filterElements.splice(i, 1); |
81 | // TODO unregister/disconnect filterElement ??MochiKit.Signal.disconnect(this.grid().filterElement(), 'updateFilter', this.filterController(), 'handleUpdateFilter'); | 79 | // TODO unregister/disconnect filterElement ??MochiKit.Signal.disconnect(this.grid().filterElement(), 'updateFilter', this.filterController(), 'handleUpdateFilter'); |
82 | } | 80 | } |
83 | }, | 81 | }, |
84 | 82 | ||
85 | 'updateFilterElements': function (aSourceElement, aFilterString) { | 83 | 'updateFilterElements': function (aSourceElement, aFilterString) { |
86 | MochiKit.Iter.forEach(this.filterElements(), | 84 | MochiKit.Iter.forEach(this.filterElements(), |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js index 8bb3016..44fbdef 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.GridController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.GridController = function(args) { |
29 | args = args || {}; | 27 | args = args || {}; |
30 | 28 | ||
31 | Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); | 29 | Clipperz.PM.UI.Web.Controllers.GridController.superclass.constructor.call(this, args); |
32 | 30 | ||
33 | this._grid = null; | 31 | this._grid = null; |
34 | this._user = null; | 32 | this._user = null; |
35 | this._sortedColumnManager = null; | 33 | this._sortedColumnManager = null; |
36 | this._cachedObjects = null; | 34 | this._cachedObjects = null; |
37 | this._filterController = args.filterController || null; | 35 | this._filterController = args.filterController || null; |
38 | 36 | ||
39 | this._deferredDisplaySelectedRowsInvocation = null; | 37 | this._deferredDisplaySelectedRowsInvocation = null; |
40 | 38 | ||
41 | return this; | 39 | return this; |
42 | }; | 40 | }; |
43 | 41 | ||
44 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { | 42 | Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.GridController, Object, { |
45 | 43 | ||
46 | 'toString': function() { | 44 | 'toString': function() { |
47 | return "Clipperz.PM.UI.Web.Controllers.GridController"; | 45 | return "Clipperz.PM.UI.Web.Controllers.GridController"; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //----------------------------------------------------------------------------- | 48 | //----------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'createGrid': function () { | 50 | 'createGrid': function () { |
53 | throw Clipperz.Base.exception.AbstractMethod; | 51 | throw Clipperz.Base.exception.AbstractMethod; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | 'setupWithGrid': function (aGrid) { | 54 | 'setupWithGrid': function (aGrid) { |
57 | this._grid = aGrid; | 55 | this._grid = aGrid; |
58 | 56 | ||
59 | if (this._grid != null) { | 57 | if (this._grid != null) { |
60 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { | 58 | MochiKit.Iter.forEach(this.columnsManagers(), function (aColumnManager) { |
61 | if (aColumnManager.isSortable()) { | 59 | if (aColumnManager.isSortable()) { |
62 | if (aColumnManager.isSorted()) { | 60 | if (aColumnManager.isSorted()) { |
63 | this.setSortedColumnManager(aColumnManager); | 61 | this.setSortedColumnManager(aColumnManager); |
64 | } | 62 | } |
65 | MochiKit.Signal.connect(aColumnManager, 'sort', this, 'handleColumnManagerSort'); | 63 | MochiKit.Signal.connect(aColumnManager, 'sort', this, 'handleColumnManagerSort'); |
66 | } | 64 | } |
67 | MochiKit.Signal.connect(aColumnManager, 'selectRow', this, 'handleColumnManagerSelectRow'); | 65 | MochiKit.Signal.connect(aColumnManager, 'selectRow', this, 'handleColumnManagerSelectRow'); |
68 | MochiKit.Signal.connect(aColumnManager, 'unselectRow', this, 'handleColumnManagerUnselectRow'); | 66 | MochiKit.Signal.connect(aColumnManager, 'unselectRow', this, 'handleColumnManagerUnselectRow'); |
69 | }, this); | 67 | }, this); |
70 | } | 68 | } |
71 | }, | 69 | }, |
72 | 70 | ||
73 | 'grid': function() { | 71 | 'grid': function() { |
74 | if (this._grid == null) { | 72 | if (this._grid == null) { |
75 | this.setupWithGrid(this.createGrid()); | 73 | this.setupWithGrid(this.createGrid()); |
76 | } | 74 | } |
77 | 75 | ||
78 | return this._grid; | 76 | return this._grid; |
79 | }, | 77 | }, |
80 | 78 | ||
81 | 'filterController': function () { | 79 | 'filterController': function () { |
82 | //Clipperz.log('GridController.filterController >>>', this._filterController); | 80 | //Clipperz.log('GridController.filterController >>>', this._filterController); |
83 | if (this._filterController == null) { | 81 | if (this._filterController == null) { |
84 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); | 82 | this._filterController = new Clipperz.PM.UI.Web.Controllers.FilterController(); |
85 | } | 83 | } |
86 | //Clipperz.log('GridController.filterController <<<', this._filterController); | 84 | //Clipperz.log('GridController.filterController <<<', this._filterController); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js index a57152d..ac85d36 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.LoginController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.LoginController = function(args) { |
29 | this._args = args || {}; | 27 | this._args = args || {}; |
30 | 28 | ||
31 | this._loginPage = null; | 29 | this._loginPage = null; |
32 | 30 | ||
33 | this._newUserWizardController = null; | 31 | this._newUserWizardController = null; |
34 | this._newUserCreationComponent = null; | 32 | this._newUserCreationComponent = null; |
35 | 33 | ||
36 | return this; | 34 | return this; |
37 | } | 35 | } |
38 | 36 | ||
39 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { | 37 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { |
40 | 38 | ||
41 | 'toString': function() { | 39 | 'toString': function() { |
42 | return "Clipperz.PM.UI.Web.Controllers.LoginController"; | 40 | return "Clipperz.PM.UI.Web.Controllers.LoginController"; |
43 | }, | 41 | }, |
44 | 42 | ||
45 | 'args': function () { | 43 | 'args': function () { |
46 | return this._args; | 44 | return this._args; |
47 | }, | 45 | }, |
48 | 46 | ||
49 | //----------------------------------------------------------------------------- | 47 | //----------------------------------------------------------------------------- |
50 | 48 | ||
51 | 'loginPage': function() { | 49 | 'loginPage': function() { |
52 | if (this._loginPage == null) { | 50 | if (this._loginPage == null) { |
53 | this._loginPage = new Clipperz.PM.UI.Web.Components.LoginPage(); | 51 | this._loginPage = new Clipperz.PM.UI.Web.Components.LoginPage(); |
54 | 52 | ||
55 | MochiKit.Signal.connect(this._loginPage, 'createNewAccountClick', this, 'handleCreateNewAccountClick') | 53 | MochiKit.Signal.connect(this._loginPage, 'createNewAccountClick', this, 'handleCreateNewAccountClick') |
56 | } | 54 | } |
57 | 55 | ||
58 | return this._loginPage; | 56 | return this._loginPage; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | //----------------------------------------------------------------------------- | 59 | //----------------------------------------------------------------------------- |
62 | 60 | ||
63 | 'run': function(args) { | 61 | 'run': function(args) { |
64 | varslot; | 62 | varslot; |
65 | varloginPage; | 63 | varloginPage; |
66 | varloginForm; | 64 | varloginForm; |
67 | 65 | ||
68 | slot = args.slot; | 66 | slot = args.slot; |
69 | 67 | ||
70 | loginForm =new Clipperz.PM.UI.Web.Components.LoginForm({'autocomplete': this.args()['autocomplete']}); | 68 | loginForm =new Clipperz.PM.UI.Web.Components.LoginForm({'autocomplete': this.args()['autocomplete']}); |
71 | 69 | ||
72 | slot.setContent(this.loginPage()); | 70 | slot.setContent(this.loginPage()); |
73 | this.loginPage().slotNamed('loginForm').setContent(loginForm); | 71 | this.loginPage().slotNamed('loginForm').setContent(loginForm); |
74 | 72 | ||
75 | MochiKit.Signal.connect(loginForm, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); | 73 | MochiKit.Signal.connect(loginForm, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); |
76 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); | 74 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin', loginForm)); |
77 | }, | 75 | }, |
78 | 76 | ||
79 | //----------------------------------------------------------------------------- | 77 | //----------------------------------------------------------------------------- |
80 | 78 | ||
81 | 'doLogin': function(aLoginForm, anEvent) { | 79 | 'doLogin': function(aLoginForm, anEvent) { |
82 | var deferredResult; | 80 | var deferredResult; |
83 | varparameters; | 81 | varparameters; |
84 | var loginProgress; | 82 | var loginProgress; |
85 | varuser; | 83 | varuser; |
86 | var getPassphraseDelegate; | 84 | var getPassphraseDelegate; |
@@ -151,100 +149,98 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, { | |||
151 | if (this._newUserWizardController == null) { | 149 | if (this._newUserWizardController == null) { |
152 | this._newUserWizardController = new Clipperz.PM.UI.Web.Controllers.NewUserWizardController({ | 150 | this._newUserWizardController = new Clipperz.PM.UI.Web.Controllers.NewUserWizardController({ |
153 | 'newUserCreationComponent': this.newUserCreationComponent() | 151 | 'newUserCreationComponent': this.newUserCreationComponent() |
154 | }) | 152 | }) |
155 | 153 | ||
156 | // MochiKit.Signal.connect(this._newUserWizardController, 'exit',this, 'handleHideNewUserCreationComponent'); | 154 | // MochiKit.Signal.connect(this._newUserWizardController, 'exit',this, 'handleHideNewUserCreationComponent'); |
157 | MochiKit.Signal.connect(this._newUserWizardController, 'done',this, 'handleCompleteNewUserCreationComponent'); | 155 | MochiKit.Signal.connect(this._newUserWizardController, 'done',this, 'handleCompleteNewUserCreationComponent'); |
158 | } | 156 | } |
159 | 157 | ||
160 | return this._newUserWizardController; | 158 | return this._newUserWizardController; |
161 | }, | 159 | }, |
162 | 160 | ||
163 | //------------------------------------------------------------------------- | 161 | //------------------------------------------------------------------------- |
164 | 162 | ||
165 | 'newUserCreationComponent': function () { | 163 | 'newUserCreationComponent': function () { |
166 | if (this._newUserCreationComponent == null) { | 164 | if (this._newUserCreationComponent == null) { |
167 | this._newUserCreationComponent = new Clipperz.PM.UI.Web.Components.NewUserCreationComponent(); | 165 | this._newUserCreationComponent = new Clipperz.PM.UI.Web.Components.NewUserCreationComponent(); |
168 | } | 166 | } |
169 | 167 | ||
170 | return this._newUserCreationComponent; | 168 | return this._newUserCreationComponent; |
171 | }, | 169 | }, |
172 | 170 | ||
173 | 'clearNewUserCreationComponent': function () { | 171 | 'clearNewUserCreationComponent': function () { |
174 | if (this._newUserCreationComponent != null) { | 172 | if (this._newUserCreationComponent != null) { |
175 | this._newUserCreationComponent.clear(); | 173 | this._newUserCreationComponent.clear(); |
176 | } | 174 | } |
177 | this._newUserCreationComponent = null; | 175 | this._newUserCreationComponent = null; |
178 | }, | 176 | }, |
179 | 177 | ||
180 | //------------------------------------------------------------------------- | 178 | //------------------------------------------------------------------------- |
181 | 179 | ||
182 | 'handleHideNewUserCreationComponent': function () { | 180 | 'handleHideNewUserCreationComponent': function () { |
183 | this.clearNewUserCreationComponent(); | 181 | this.clearNewUserCreationComponent(); |
184 | }, | 182 | }, |
185 | 183 | ||
186 | 'handleCompleteNewUserCreationComponent': function (someParameters) { | 184 | 'handleCompleteNewUserCreationComponent': function (someParameters) { |
187 | vardeferredResult; | 185 | vardeferredResult; |
188 | varuser; | 186 | varuser; |
189 | varnewUserCreationComponent; | 187 | varnewUserCreationComponent; |
190 | 188 | ||
191 | user = someParameters.user; | 189 | user = someParameters.user; |
192 | newUserCreationComponent = this.newUserCreationComponent(); | 190 | newUserCreationComponent = this.newUserCreationComponent(); |
193 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), | 191 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'CARDS_CONTROLLER_DID_RUN',MochiKit.Base.method(newUserCreationComponent, 'deferredHideModal', {closeToElement:MochiKit.DOM.currentDocument().body})), |
194 | 192 | ||
195 | deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); | 193 | deferredResult = new Clipperz.Async.Deferred("LoginController.handleCompleteNewUserCreationComponent", {trace:false}); |
196 | 194 | ||
197 | deferredResult.addCallbackList([ | 195 | deferredResult.addCallbackList([ |
198 | MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), | 196 | MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'deferredEntropyCollection'), |
199 | MochiKit.Base.method(user, 'login'), | 197 | MochiKit.Base.method(user, 'login'), |
200 | MochiKit.Base.method(this, 'userLoggedIn', user), | 198 | MochiKit.Base.method(this, 'userLoggedIn', user), |
201 | MochiKit.Base.method(this, 'clearNewUserCreationComponent') | 199 | MochiKit.Base.method(this, 'clearNewUserCreationComponent') |
202 | ]); | 200 | ]); |
203 | deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); | 201 | deferredResult.addErrback(function (aValue) { Clipperz.log("WTF!! Error doing the login after creating a new user" + aValue)}); |
204 | deferredResult.callback(); | 202 | deferredResult.callback(); |
205 | 203 | ||
206 | return deferredResult; | 204 | return deferredResult; |
207 | }, | 205 | }, |
208 | 206 | ||
209 | 207 | ||
210 | //========================================================================= | 208 | //========================================================================= |
211 | 209 | ||
212 | 'handleFailedLogin': function(aLoginProgress, anError) { | 210 | 'handleFailedLogin': function(aLoginProgress, anError) { |
213 | var result; | 211 | var result; |
214 | 212 | ||
215 | //console.log("anError", anError); | ||
216 | if (anError instanceof MochiKit.Async.CancelledError) { | 213 | if (anError instanceof MochiKit.Async.CancelledError) { |
217 | result = anError; | 214 | result = anError; |
218 | } else { | 215 | } else { |
219 | var deferredResult; | 216 | var deferredResult; |
220 | 217 | ||
221 | MochiKit.Logging.logError("## MainController - FAILED LOGIN: " + anError); | 218 | Clipperz.logError("## MainController - FAILED LOGIN: " + anError); |
222 | deferredResult = new MochiKit.Async.Deferred(); | 219 | deferredResult = new MochiKit.Async.Deferred(); |
223 | 220 | ||
224 | aLoginProgress.showErrorMessage("failed login"); | 221 | aLoginProgress.showErrorMessage("failed login"); |
225 | // Clipperz.NotificationCenter.register(loginProgress, 'cancelEvent', deferredResult, 'callback'); | 222 | // Clipperz.NotificationCenter.register(loginProgress, 'cancelEvent', deferredResult, 'callback'); |
226 | MochiKit.Signal.connect(aLoginProgress, 'cancelEvent', deferredResult, 'callback'); | 223 | MochiKit.Signal.connect(aLoginProgress, 'cancelEvent', deferredResult, 'callback'); |
227 | deferredResult.addCallback(MochiKit.Async.fail, anError) | 224 | deferredResult.addCallback(MochiKit.Async.fail, anError) |
228 | result = deferredResult; | 225 | result = deferredResult; |
229 | } | 226 | } |
230 | 227 | ||
231 | return result; | 228 | return result; |
232 | }, | 229 | }, |
233 | 230 | ||
234 | 'handleGenericError': function(anError) { | 231 | 'handleGenericError': function(anError) { |
235 | var result; | 232 | var result; |
236 | 233 | ||
237 | if (anError instanceof MochiKit.Async.CancelledError) { | 234 | if (anError instanceof MochiKit.Async.CancelledError) { |
238 | result = anError; | 235 | result = anError; |
239 | } else { | 236 | } else { |
240 | MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); | 237 | Clipperz.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack); |
241 | //console.log(anError); | ||
242 | result = new MochiKit.Async.CancelledError(anError); | 238 | result = new MochiKit.Async.CancelledError(anError); |
243 | } | 239 | } |
244 | 240 | ||
245 | return result; | 241 | return result; |
246 | }, | 242 | }, |
247 | 243 | ||
248 | //----------------------------------------------------------------------------- | 244 | //----------------------------------------------------------------------------- |
249 | __syntaxFix__: "syntax fix" | 245 | __syntaxFix__: "syntax fix" |
250 | }); | 246 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js index c83e3c0..9194125 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js | |||
@@ -1,86 +1,84 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.MainController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.MainController = function(args) { |
29 | this._args = args; | 27 | this._args = args; |
30 | 28 | ||
31 | //controllers | 29 | //controllers |
32 | this._loginController =null; | 30 | this._loginController =null; |
33 | this._appController =null; | 31 | this._appController =null; |
34 | 32 | ||
35 | //components | 33 | //components |
36 | this._headerComponent = null; | 34 | this._headerComponent = null; |
37 | this._pageComponent =null; | 35 | this._pageComponent =null; |
38 | this._footerComponent = null; | 36 | this._footerComponent = null; |
39 | 37 | ||
40 | this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); | 38 | this._passphraseDelegateLock = new MochiKit.Async.DeferredLock(); |
41 | this._passphraseDelegateLock.acquire(); | 39 | this._passphraseDelegateLock.acquire(); |
42 | //Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); | 40 | //Clipperz.log('MainController init _passphraseDelegateLock', this._passphraseDelegateLock); |
43 | this._passphraseDelegate = null; | 41 | this._passphraseDelegate = null; |
44 | 42 | ||
45 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); | 43 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestSent', this, 'handleRemoteRequestSent'); |
46 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); | 44 | MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'remoteRequestReceived',this, 'handleRemoteRequestReceived'); |
47 | 45 | ||
48 | return this; | 46 | return this; |
49 | } | 47 | } |
50 | 48 | ||
51 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { | 49 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { |
52 | 50 | ||
53 | 'toString': function() { | 51 | 'toString': function() { |
54 | return "Clipperz.PM.UI.Web.Controllers.MainController"; | 52 | return "Clipperz.PM.UI.Web.Controllers.MainController"; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | 'args': function () { | 55 | 'args': function () { |
58 | return this._args; | 56 | return this._args; |
59 | }, | 57 | }, |
60 | 58 | ||
61 | //----------------------------------------------------------------------------- | 59 | //----------------------------------------------------------------------------- |
62 | 60 | ||
63 | 'headerComponent': function() { | 61 | 'headerComponent': function() { |
64 | if (this._headerComponent == null) { | 62 | if (this._headerComponent == null) { |
65 | this._headerComponent = new Clipperz.PM.UI.Web.Components.PageHeader(); | 63 | this._headerComponent = new Clipperz.PM.UI.Web.Components.PageHeader(); |
66 | } | 64 | } |
67 | 65 | ||
68 | return this._headerComponent; | 66 | return this._headerComponent; |
69 | }, | 67 | }, |
70 | 68 | ||
71 | 'footerComponent': function() { | 69 | 'footerComponent': function() { |
72 | if (this._footerComponent == null) { | 70 | if (this._footerComponent == null) { |
73 | this._footerComponent = new Clipperz.PM.UI.Web.Components.PageFooter(); | 71 | this._footerComponent = new Clipperz.PM.UI.Web.Components.PageFooter(); |
74 | } | 72 | } |
75 | 73 | ||
76 | return this._footerComponent; | 74 | return this._footerComponent; |
77 | }, | 75 | }, |
78 | 76 | ||
79 | //----------------------------------------------------------------------------- | 77 | //----------------------------------------------------------------------------- |
80 | 78 | ||
81 | 'pageComponent': function() { | 79 | 'pageComponent': function() { |
82 | if (this._pageComponent == null) { | 80 | if (this._pageComponent == null) { |
83 | this._pageComponent = new Clipperz.PM.UI.Web.Components.Page({element:MochiKit.DOM.getElement('mainDiv')}); | 81 | this._pageComponent = new Clipperz.PM.UI.Web.Components.Page({element:MochiKit.DOM.getElement('mainDiv')}); |
84 | } | 82 | } |
85 | 83 | ||
86 | return this._pageComponent; | 84 | return this._pageComponent; |
@@ -114,102 +112,96 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, { | |||
114 | this.pageComponent().slotNamed('header').setContent(this.headerComponent()); | 112 | this.pageComponent().slotNamed('header').setContent(this.headerComponent()); |
115 | this.pageComponent().slotNamed('footer').setContent(this.footerComponent()); | 113 | this.pageComponent().slotNamed('footer').setContent(this.footerComponent()); |
116 | 114 | ||
117 | this.pageComponent().render(); | 115 | this.pageComponent().render(); |
118 | 116 | ||
119 | this.loginController().run({slot:this.pageComponent().slotNamed('body')}); | 117 | this.loginController().run({slot:this.pageComponent().slotNamed('body')}); |
120 | 118 | ||
121 | if (shoudShowRegistrationForm) { | 119 | if (shoudShowRegistrationForm) { |
122 | MochiKit.Signal.signal(this.loginController().loginPage(), 'createNewAccountClick'); | 120 | MochiKit.Signal.signal(this.loginController().loginPage(), 'createNewAccountClick'); |
123 | // this.loginController().handleCreateNewAccountClick(); | 121 | // this.loginController().handleCreateNewAccountClick(); |
124 | } | 122 | } |
125 | }, | 123 | }, |
126 | 124 | ||
127 | //----------------------------------------------------------------------------- | 125 | //----------------------------------------------------------------------------- |
128 | 126 | ||
129 | 'getPassphrase': function () { | 127 | 'getPassphrase': function () { |
130 | var deferredResult; | 128 | var deferredResult; |
131 | 129 | ||
132 | deferredResult = new Clipperz.Async.Deferred("MainController.getPassphrase", {trace:false}); | 130 | deferredResult = new Clipperz.Async.Deferred("MainController.getPassphrase", {trace:false}); |
133 | 131 | ||
134 | deferredResult.acquireLock(this._passphraseDelegateLock); | 132 | deferredResult.acquireLock(this._passphraseDelegateLock); |
135 | deferredResult.addMethod(this, 'invokePassphraseDelegate'); | 133 | deferredResult.addMethod(this, 'invokePassphraseDelegate'); |
136 | deferredResult.releaseLock(this._passphraseDelegateLock); | 134 | deferredResult.releaseLock(this._passphraseDelegateLock); |
137 | deferredResult.callback(); | 135 | deferredResult.callback(); |
138 | 136 | ||
139 | return deferredResult; | 137 | return deferredResult; |
140 | }, | 138 | }, |
141 | 139 | ||
142 | //......................................................................... | 140 | //......................................................................... |
143 | 141 | ||
144 | 'invokePassphraseDelegate': function () { | 142 | 'invokePassphraseDelegate': function () { |
145 | return this._passphraseDelegate(); | 143 | return this._passphraseDelegate(); |
146 | }, | 144 | }, |
147 | 145 | ||
148 | 'passphraseDelegateLock': function () { | 146 | 'passphraseDelegateLock': function () { |
149 | return this._passphraseDelegateLock; | 147 | return this._passphraseDelegateLock; |
150 | }, | 148 | }, |
151 | 149 | ||
152 | //......................................................................... | 150 | //......................................................................... |
153 | 151 | ||
154 | 'setPassphraseDelegate': function (aDelegate) { | 152 | 'setPassphraseDelegate': function (aDelegate) { |
155 | var shouldReleaseLock; | 153 | var shouldReleaseLock; |
156 | 154 | ||
157 | shouldReleaseLock = (this._passphraseDelegate == null); | 155 | shouldReleaseLock = (this._passphraseDelegate == null); |
158 | 156 | ||
159 | this._passphraseDelegate = aDelegate; | 157 | this._passphraseDelegate = aDelegate; |
160 | 158 | ||
161 | if (shouldReleaseLock) { | 159 | if (shouldReleaseLock) { |
162 | this._passphraseDelegateLock.release(); | 160 | this._passphraseDelegateLock.release(); |
163 | } | 161 | } |
164 | }, | 162 | }, |
165 | 163 | ||
166 | //......................................................................... | 164 | //......................................................................... |
167 | 165 | ||
168 | 'removePassphraseDelegate': function (aDelegate) { | 166 | 'removePassphraseDelegate': function (aDelegate) { |
169 | if (this._passphraseDelegate == aDelegate) { | 167 | if (this._passphraseDelegate == aDelegate) { |
170 | this._passphraseDelegate = null; | 168 | this._passphraseDelegate = null; |
171 | this._passphraseDelegateLock.acquire(); | 169 | this._passphraseDelegateLock.acquire(); |
172 | } | 170 | } |
173 | }, | 171 | }, |
174 | 172 | ||
175 | //------------------------------------------------------------------------- | 173 | //------------------------------------------------------------------------- |
176 | 174 | ||
177 | 'loginControllerUserLoggedInCallback': function(anEvent) { | 175 | 'loginControllerUserLoggedInCallback': function(anEvent) { |
178 | //Clipperz.log(">>> loginControllerUserLoggedInCallback", anEvent); | ||
179 | // this.setUser(anEvent.parameters()['user']); | ||
180 | //console.log("--- loginControllerUserLoggedInCallback - 1"); | ||
181 | |||
182 | //console.log("--- loginControllerUserLoggedInCallback - 2"); | ||
183 | this.headerComponent().switchToLoggedMode(); | 176 | this.headerComponent().switchToLoggedMode(); |
184 | this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); | 177 | this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']}); |
185 | //Clipperz.log("<<< loginControllerUserLoggedInCallback"); | ||
186 | }, | 178 | }, |
187 | 179 | ||
188 | //----------------------------------------------------------------------------- | 180 | //----------------------------------------------------------------------------- |
189 | 181 | ||
190 | 'handleRemoteRequestSent': function () { | 182 | 'handleRemoteRequestSent': function () { |
191 | //Clipperz.log("REMOTE REQUEST sent >>>"); | 183 | //Clipperz.log("REMOTE REQUEST sent >>>"); |
192 | }, | 184 | }, |
193 | 185 | ||
194 | 'handleRemoteRequestReceived': function () { | 186 | 'handleRemoteRequestReceived': function () { |
195 | //Clipperz.log("REMOTE REQUEST received <<<"); | 187 | //Clipperz.log("REMOTE REQUEST received <<<"); |
196 | }, | 188 | }, |
197 | 189 | ||
198 | //----------------------------------------------------------------------------- | 190 | //----------------------------------------------------------------------------- |
199 | 191 | ||
200 | 'handleLogout': function(anEvent) { | 192 | 'handleLogout': function(anEvent) { |
201 | this.exit('logout.html'); | 193 | this.exit('logout.html'); |
202 | }, | 194 | }, |
203 | 195 | ||
204 | //----------------------------------------------------------------------------- | 196 | //----------------------------------------------------------------------------- |
205 | 197 | ||
206 | 'exit': function(aPageName) { | 198 | 'exit': function(aPageName) { |
207 | //Clipperz.log("### exit " + aPageName); | 199 | //Clipperz.log("### exit " + aPageName); |
208 | MochiKit.Async.wait(0).addCallback(function() { | 200 | MochiKit.Async.wait(0).addCallback(function() { |
209 | window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; | 201 | window.location.href = "./" + aPageName + "?ln=" + Clipperz.PM.Strings.selectedLanguage; |
210 | }); | 202 | }); |
211 | }, | 203 | }, |
212 | 204 | ||
213 | //----------------------------------------------------------------------------- | 205 | //----------------------------------------------------------------------------- |
214 | __syntaxFix__: "syntax fix" | 206 | __syntaxFix__: "syntax fix" |
215 | }); | 207 | }); |
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js index 7db6888..b70aa17 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js | |||
@@ -1,139 +1,136 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); | 24 | Clipperz.Base.module('Clipperz.PM.UI.Web.Controllers'); |
27 | 25 | ||
28 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { | 26 | Clipperz.PM.UI.Web.Controllers.NewUserWizardController = function(args) { |
29 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); | 27 | this._newUserCreationComponent = args.newUserCreationComponent|| Clipperz.Base.exception.raise('MandatoryParameter'); |
30 | 28 | ||
31 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); | 29 | MochiKit.Signal.connect(this._newUserCreationComponent, 'changedValue',this, 'handleChangedValue'); |
32 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); | 30 | MochiKit.Signal.connect(this._newUserCreationComponent, 'moveForward',this, 'handleMoveForward'); |
33 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); | 31 | MochiKit.Signal.connect(this._newUserCreationComponent, 'keyPressed',this, 'handleNewUserCreationComponentKeyPressed'); |
34 | 32 | ||
35 | this._rulerComponent = null; | 33 | this._rulerComponent = null; |
36 | 34 | ||
37 | this._steps = null; | 35 | this._steps = null; |
38 | this._currentStepIndex = 0; | 36 | this._currentStepIndex = 0; |
39 | this._isNextEnabled = false; | 37 | this._isNextEnabled = false; |
40 | 38 | ||
41 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' | 39 | this._userCreationState = 'IDLE'; //'IN PROGRESS', 'DONE', 'FAILED' |
42 | this._user = null; | 40 | this._user = null; |
43 | return this; | 41 | return this; |
44 | } | 42 | } |
45 | 43 | ||
46 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { | 44 | MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prototype, { |
47 | 45 | ||
48 | 'toString': function() { | 46 | 'toString': function() { |
49 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; | 47 | return "Clipperz.PM.UI.Web.Controllers.NewUserWizardController"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'newUserCreationComponent': function () { | 52 | 'newUserCreationComponent': function () { |
55 | return this._newUserCreationComponent; | 53 | return this._newUserCreationComponent; |
56 | }, | 54 | }, |
57 | 55 | ||
58 | //============================================================================= | 56 | //============================================================================= |
59 | 57 | ||
60 | 'user': function () { | 58 | 'user': function () { |
61 | return this._user; | 59 | return this._user; |
62 | }, | 60 | }, |
63 | 61 | ||
64 | 'setUser': function (aValue) { | 62 | 'setUser': function (aValue) { |
65 | this._user = aValue; | 63 | this._user = aValue; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | //----------------------------------------------------------------------------- | 66 | //----------------------------------------------------------------------------- |
69 | 67 | ||
70 | 'userCreationState': function () { | 68 | 'userCreationState': function () { |
71 | return this._userCreationState; | 69 | return this._userCreationState; |
72 | }, | 70 | }, |
73 | 71 | ||
74 | 'setUserCreationState': function (aValue) { | 72 | 'setUserCreationState': function (aValue) { |
75 | //console.log("+++ NewUserWizardController.setUserCreationState", aValue); | ||
76 | this._userCreationState = aValue; | 73 | this._userCreationState = aValue; |
77 | this.checkState(); | 74 | this.checkState(); |
78 | }, | 75 | }, |
79 | 76 | ||
80 | //============================================================================= | 77 | //============================================================================= |
81 | 78 | ||
82 | 'resetCurrentStepIndex': function () { | 79 | 'resetCurrentStepIndex': function () { |
83 | this._currentStepIndex = 0; | 80 | this._currentStepIndex = 0; |
84 | this.rulerComponent().resetStatus({animateTransition:true}); | 81 | this.rulerComponent().resetStatus({animateTransition:true}); |
85 | }, | 82 | }, |
86 | 83 | ||
87 | //----------------------------------------------------------------------------- | 84 | //----------------------------------------------------------------------------- |
88 | 85 | ||
89 | 'enableNext': function (aValue) { | 86 | 'enableNext': function (aValue) { |
90 | this.rulerComponent().enableNext(aValue); | 87 | this.rulerComponent().enableNext(aValue); |
91 | this._isNextEnabled = aValue; | 88 | this._isNextEnabled = aValue; |
92 | }, | 89 | }, |
93 | 90 | ||
94 | 'isNextEnabled': function () { | 91 | 'isNextEnabled': function () { |
95 | return this._isNextEnabled; | 92 | return this._isNextEnabled; |
96 | }, | 93 | }, |
97 | 94 | ||
98 | //----------------------------------------------------------------------------- | 95 | //----------------------------------------------------------------------------- |
99 | 96 | ||
100 | 'enablePrevious': function (aValue) { | 97 | 'enablePrevious': function (aValue) { |
101 | this.rulerComponent().enablePrevious(aValue); | 98 | this.rulerComponent().enablePrevious(aValue); |
102 | }, | 99 | }, |
103 | 100 | ||
104 | //============================================================================= | 101 | //============================================================================= |
105 | 102 | ||
106 | 'rulerComponent': function () { | 103 | 'rulerComponent': function () { |
107 | if (this._rulerComponent == null) { | 104 | if (this._rulerComponent == null) { |
108 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ | 105 | this._rulerComponent = new Clipperz.PM.UI.Web.Components.RulerComponent({ |
109 | translationContext:'Wizards.NewUserWizard' | 106 | translationContext:'Wizards.NewUserWizard' |
110 | }); | 107 | }); |
111 | this._rulerComponent.render(); | 108 | this._rulerComponent.render(); |
112 | 109 | ||
113 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); | 110 | MochiKit.Signal.connect(this._rulerComponent, 'exit', this, 'handleExit'); |
114 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); | 111 | MochiKit.Signal.connect(this._rulerComponent, 'done', this, 'done'); |
115 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); | 112 | MochiKit.Signal.connect(this._rulerComponent, 'moveForward',this, 'handleMoveForward'); |
116 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); | 113 | MochiKit.Signal.connect(this._rulerComponent, 'moveBackward',this, 'handleMoveBackward'); |
117 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); | 114 | MochiKit.Signal.connect(this._rulerComponent, 'cursorMoved',this, 'handleCursorMoved'); |
118 | } | 115 | } |
119 | 116 | ||
120 | return this._rulerComponent; | 117 | return this._rulerComponent; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | 'resetRuler': function () { | 120 | 'resetRuler': function () { |
124 | // if (this._rulerComponent != null) { | 121 | // if (this._rulerComponent != null) { |
125 | // this._rulerComponent.clear(); | 122 | // this._rulerComponent.clear(); |
126 | // } | 123 | // } |
127 | // this._rulerComponent = null; | 124 | // this._rulerComponent = null; |
128 | }, | 125 | }, |
129 | 126 | ||
130 | //----------------------------------------------------------------------------- | 127 | //----------------------------------------------------------------------------- |
131 | 128 | ||
132 | 'showRuler': function (someSteps) { | 129 | 'showRuler': function (someSteps) { |
133 | var rulerElement; | 130 | var rulerElement; |
134 | 131 | ||
135 | this.setSteps(someSteps); | 132 | this.setSteps(someSteps); |
136 | 133 | ||
137 | rulerElement = this.rulerComponent().element(); | 134 | rulerElement = this.rulerComponent().element(); |
138 | this.newUserCreationComponent().disableAllPanels(); | 135 | this.newUserCreationComponent().disableAllPanels(); |
139 | 136 | ||
@@ -161,306 +158,301 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot | |||
161 | 158 | ||
162 | 'hideRuler': function () { | 159 | 'hideRuler': function () { |
163 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:0.5}); | 160 | new MochiKit.Visual.Move(this.rulerComponent().element(), {x:-1000, mode:'relative', duration:0.5}); |
164 | }, | 161 | }, |
165 | 162 | ||
166 | 'doneWithRuler': function () { | 163 | 'doneWithRuler': function () { |
167 | var rulerComponentElement; | 164 | var rulerComponentElement; |
168 | 165 | ||
169 | rulerComponentElement = this.rulerComponent().element(); | 166 | rulerComponentElement = this.rulerComponent().element(); |
170 | new MochiKit.Visual.Move(this.rulerComponent().element(), { | 167 | new MochiKit.Visual.Move(this.rulerComponent().element(), { |
171 | x:1000, | 168 | x:1000, |
172 | mode:'relative', | 169 | mode:'relative', |
173 | duration:1, | 170 | duration:1, |
174 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) | 171 | // afterFinish:MochiKit.Base.partial(MochiKit.Style.hideElement, rulerComponentElement) |
175 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } | 172 | afterFinish:function () { MochiKit.Style.hideElement(rulerComponentElement); } |
176 | }); | 173 | }); |
177 | }, | 174 | }, |
178 | 175 | ||
179 | //============================================================================= | 176 | //============================================================================= |
180 | 177 | ||
181 | 'createNewUserRulerSteps': function () { | 178 | 'createNewUserRulerSteps': function () { |
182 | return [ 'CREDENTIALS', 'CHECK_CREDENTIALS', 'TERMS_OF_SERVICE', 'CREATE_USER'/*, 'LOGIN' */]; | 179 | return [ 'CREDENTIALS', 'CHECK_CREDENTIALS', 'TERMS_OF_SERVICE', 'CREATE_USER'/*, 'LOGIN' */]; |
183 | }, | 180 | }, |
184 | 181 | ||
185 | //------------------------------------------------------------------------- | 182 | //------------------------------------------------------------------------- |
186 | 183 | ||
187 | 'run': function () { | 184 | 'run': function () { |
188 | return Clipperz.Async.callbacks("NewUserWizardController.run", [ | 185 | return Clipperz.Async.callbacks("NewUserWizardController.run", [ |
189 | MochiKit.Base.method(this, 'createNewUserRulerSteps'), | 186 | MochiKit.Base.method(this, 'createNewUserRulerSteps'), |
190 | MochiKit.Base.method(this, 'showRuler') | 187 | MochiKit.Base.method(this, 'showRuler') |
191 | ], {trace:false}); | 188 | ], {trace:false}); |
192 | }, | 189 | }, |
193 | 190 | ||
194 | //----------------------------------------------------------------------------- | 191 | //----------------------------------------------------------------------------- |
195 | 192 | ||
196 | 'checkState': function () { | 193 | 'checkState': function () { |
197 | var enablePrevious; | 194 | var enablePrevious; |
198 | var enableNext; | 195 | var enableNext; |
199 | 196 | ||
200 | enablePrevious = true; | 197 | enablePrevious = true; |
201 | enableNext = false; | 198 | enableNext = false; |
202 | 199 | ||
203 | this.newUserCreationComponent().disableAllPanels(); | 200 | this.newUserCreationComponent().disableAllPanels(); |
204 | 201 | ||
205 | switch(this.currentStep()) { | 202 | switch(this.currentStep()) { |
206 | case 'CREDENTIALS': | 203 | case 'CREDENTIALS': |
207 | this.newUserCreationComponent().enableCredentialsPanel(); | 204 | this.newUserCreationComponent().enableCredentialsPanel(); |
208 | 205 | ||
209 | enableNext = ( | 206 | enableNext = ( |
210 | (this.newUserCreationComponent().username() != '') | 207 | (this.newUserCreationComponent().username() != '') |
211 | && | 208 | && |
212 | (this.newUserCreationComponent().passphrase() != '') | 209 | (this.newUserCreationComponent().passphrase() != '') |
213 | ); | 210 | ); |
214 | // enablePrevious = false; | 211 | // enablePrevious = false; |
215 | break; | 212 | break; |
216 | case 'CHECK_CREDENTIALS': | 213 | case 'CHECK_CREDENTIALS': |
217 | this.newUserCreationComponent().enableCheckCredentialsPanel(); | 214 | this.newUserCreationComponent().enableCheckCredentialsPanel(); |
218 | 215 | ||
219 | enableNext = (this.newUserCreationComponent().passphrase() == this.newUserCreationComponent().rePassphrase()); | 216 | enableNext = (this.newUserCreationComponent().passphrase() == this.newUserCreationComponent().rePassphrase()); |
220 | // enablePrevious = true; | 217 | // enablePrevious = true; |
221 | break | 218 | break |
222 | case 'TERMS_OF_SERVICE': | 219 | case 'TERMS_OF_SERVICE': |
223 | this.newUserCreationComponent().enableTermsOfServicePanel(); | 220 | this.newUserCreationComponent().enableTermsOfServicePanel(); |
224 | 221 | ||
225 | //console.log("awareOfUnrecoverablePassphrase", this.newUserCreationComponent().awareOfUnrecoverablePassphrase()); | ||
226 | //console.log("readTermsOfService", this.newUserCreationComponent().readTermsOfService()); | ||
227 | enableNext = ( | 222 | enableNext = ( |
228 | (this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on') | 223 | (this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on') |
229 | && | 224 | && |
230 | (this.newUserCreationComponent().readTermsOfService() == 'on') | 225 | (this.newUserCreationComponent().readTermsOfService() == 'on') |
231 | ) | 226 | ) |
232 | break; | 227 | break; |
233 | case 'CREATE_USER': | 228 | case 'CREATE_USER': |
234 | //console.log(">>> CREATE_USER", this.userCreationState()); | ||
235 | this.newUserCreationComponent().enableCreateUserPanel(); | 229 | this.newUserCreationComponent().enableCreateUserPanel(); |
236 | 230 | ||
237 | switch (this.userCreationState()) { | 231 | switch (this.userCreationState()) { |
238 | case 'IDLE': | 232 | case 'IDLE': |
239 | this.setUserCreationState('IN PROGRESS'); | 233 | this.setUserCreationState('IN PROGRESS'); |
240 | this.preformActualUserRegistration(); | 234 | this.preformActualUserRegistration(); |
241 | 235 | ||
242 | enablePrevious = false; | 236 | enablePrevious = false; |
243 | enableNext = false; | 237 | enableNext = false; |
244 | break; | 238 | break; |
245 | case 'IN PROGRESS': | 239 | case 'IN PROGRESS': |
246 | enablePrevious = false; | 240 | enablePrevious = false; |
247 | enableNext = false; | 241 | enableNext = false; |
248 | break; | 242 | break; |
249 | case 'DONE': | 243 | case 'DONE': |
250 | enablePrevious = false; | 244 | enablePrevious = false; |
251 | enableNext = true; | 245 | enableNext = true; |
252 | break; | 246 | break; |
253 | case 'FAILED': | 247 | case 'FAILED': |
254 | enablePrevious = true; | 248 | enablePrevious = true; |
255 | enableNext = false; | 249 | enableNext = false; |
256 | break; | 250 | break; |
257 | }; | 251 | }; |
258 | break; | 252 | break; |
259 | // case 'LOGIN': | 253 | // case 'LOGIN': |
260 | // this.newUserCreationComponent().enableLoginPanel(); | 254 | // this.newUserCreationComponent().enableLoginPanel(); |
261 | // break; | 255 | // break; |
262 | } | 256 | } |
263 | 257 | ||
264 | if (this.currentStepIndex() > 0) { | 258 | if (this.currentStepIndex() > 0) { |
265 | this.enablePrevious(enablePrevious); | 259 | this.enablePrevious(enablePrevious); |
266 | } else { | 260 | } else { |
267 | this.enablePrevious(false); | 261 | this.enablePrevious(false); |
268 | } | 262 | } |
269 | this.enableNext(enableNext); | 263 | this.enableNext(enableNext); |
270 | }, | 264 | }, |
271 | 265 | ||
272 | //----------------------------------------------------------------------------- | 266 | //----------------------------------------------------------------------------- |
273 | 267 | ||
274 | 'setFocus': function () { | 268 | 'setFocus': function () { |
275 | switch(this.currentStep()) { | 269 | switch(this.currentStep()) { |
276 | case 'CREDENTIALS': | 270 | case 'CREDENTIALS': |
277 | this.newUserCreationComponent().focusOnUsernameElement(); | 271 | this.newUserCreationComponent().focusOnUsernameElement(); |
278 | break; | 272 | break; |
279 | case 'CHECK_CREDENTIALS': | 273 | case 'CHECK_CREDENTIALS': |
280 | this.newUserCreationComponent().focusOnRePassphraseElement(); | 274 | this.newUserCreationComponent().focusOnRePassphraseElement(); |
281 | break | 275 | break |
282 | case 'TERMS_OF_SERVICE': | 276 | case 'TERMS_OF_SERVICE': |
283 | break; | 277 | break; |
284 | case 'CREATE_USER': | 278 | case 'CREATE_USER': |
285 | break; | 279 | break; |
286 | // case 'LOGIN': | 280 | // case 'LOGIN': |
287 | // break; | 281 | // break; |
288 | } | 282 | } |
289 | }, | 283 | }, |
290 | 284 | ||
291 | //============================================================================= | 285 | //============================================================================= |
292 | 286 | ||
293 | 'steps': function () { | 287 | 'steps': function () { |
294 | return this._steps; | 288 | return this._steps; |
295 | }, | 289 | }, |
296 | 290 | ||
297 | 'setSteps': function (aValue) { | 291 | 'setSteps': function (aValue) { |
298 | this._steps = aValue; | 292 | this._steps = aValue; |
299 | 293 | ||
300 | this.rulerComponent().setSteps(aValue); | 294 | this.rulerComponent().setSteps(aValue); |
301 | this.resetCurrentStepIndex(); | 295 | this.resetCurrentStepIndex(); |
302 | }, | 296 | }, |
303 | 297 | ||
304 | 'currentStepIndex': function () { | 298 | 'currentStepIndex': function () { |
305 | return this._currentStepIndex; | 299 | return this._currentStepIndex; |
306 | }, | 300 | }, |
307 | 301 | ||
308 | 'currentStep': function () { | 302 | 'currentStep': function () { |
309 | return this.steps()[this.currentStepIndex()]; | 303 | return this.steps()[this.currentStepIndex()]; |
310 | }, | 304 | }, |
311 | 305 | ||
312 | //============================================================================= | 306 | //============================================================================= |
313 | 307 | ||
314 | 'handleExit': function () { | 308 | 'handleExit': function () { |
315 | return Clipperz.Async.callbacks("NewUserWizardController.handleExit", [ | 309 | return Clipperz.Async.callbacks("NewUserWizardController.handleExit", [ |
316 | // MochiKit.Base.method(this.newUserCreationComponent(), 'resetContent'), | 310 | // MochiKit.Base.method(this.newUserCreationComponent(), 'resetContent'), |
317 | Clipperz.Async.forkAndJoin("NewUserWizardController.handleExit - fork and join", [ | 311 | Clipperz.Async.forkAndJoin("NewUserWizardController.handleExit - fork and join", [ |
318 | MochiKit.Base.method(this, 'hideRuler'), | 312 | MochiKit.Base.method(this, 'hideRuler'), |
319 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredHideModal') | 313 | MochiKit.Base.method(this.newUserCreationComponent(), 'deferredHideModal') |
320 | ], {trace:false}), | 314 | ], {trace:false}), |
321 | MochiKit.Base.method(this, 'resetRuler'), | 315 | MochiKit.Base.method(this, 'resetRuler'), |
322 | // MochiKit.Base.method(this.newUserCreationComponent(), 'reset'), | 316 | // MochiKit.Base.method(this.newUserCreationComponent(), 'reset'), |
323 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'exit') | 317 | MochiKit.Base.partial(MochiKit.Signal.signal, this, 'exit') |
324 | ], {trace:false}) | 318 | ], {trace:false}) |
325 | }, | 319 | }, |
326 | 320 | ||
327 | 'done': function () { | 321 | 'done': function () { |
328 | this.doneWithRuler(); | 322 | this.doneWithRuler(); |
329 | MochiKit.Signal.signal(this, 'done', {'user': this.user()}); | 323 | MochiKit.Signal.signal(this, 'done', {'user': this.user()}); |
330 | }, | 324 | }, |
331 | 325 | ||
332 | //============================================================================= | 326 | //============================================================================= |
333 | 327 | ||
334 | 'handleMoveBackward': function () { | 328 | 'handleMoveBackward': function () { |
335 | if (this._currentStepIndex > 0) { | 329 | if (this._currentStepIndex > 0) { |
336 | varafterMoveAction; | 330 | varafterMoveAction; |
337 | 331 | ||
338 | afterMoveAction = MochiKit.Base.noop; | 332 | afterMoveAction = MochiKit.Base.noop; |
339 | 333 | ||
340 | //console.log("<-- backward", this.currentStep()); | ||
341 | switch(this.currentStep()) { | 334 | switch(this.currentStep()) { |
342 | case 'CREDENTIALS': | 335 | case 'CREDENTIALS': |
343 | case 'CHECK_CREDENTIALS': | 336 | case 'CHECK_CREDENTIALS': |
344 | case 'TERMS_OF_SERVICE': | 337 | case 'TERMS_OF_SERVICE': |
345 | this._currentStepIndex --; | 338 | this._currentStepIndex --; |
346 | this.rulerComponent().moveBackward(afterMoveAction); | 339 | this.rulerComponent().moveBackward(afterMoveAction); |
347 | break; | 340 | break; |
348 | case 'CREATE_USER': | 341 | case 'CREATE_USER': |
349 | this.setUser(null); | 342 | this.setUser(null); |
350 | this.newUserCreationComponent().hideAllProgeressStates(); | 343 | this.newUserCreationComponent().hideAllProgeressStates(); |
351 | this.resetCurrentStepIndex(); | 344 | this.resetCurrentStepIndex(); |
352 | this.setUserCreationState('IDLE'); | 345 | this.setUserCreationState('IDLE'); |
353 | break; | 346 | break; |
354 | // case 'LOGIN': | 347 | // case 'LOGIN': |
355 | // break; | 348 | // break; |
356 | }; | 349 | }; |
357 | 350 | ||
358 | } | 351 | } |
359 | 352 | ||
360 | if (this._currentStepIndex == 0) { | 353 | if (this._currentStepIndex == 0) { |
361 | this.enablePrevious(false); | 354 | this.enablePrevious(false); |
362 | } | 355 | } |
363 | }, | 356 | }, |
364 | 357 | ||
365 | 'handleMoveForward': function () { | 358 | 'handleMoveForward': function () { |
366 | if (this.isNextEnabled()) { | 359 | if (this.isNextEnabled()) { |
367 | varafterMoveAction; | 360 | varafterMoveAction; |
368 | 361 | ||
369 | this._currentStepIndex ++; | 362 | this._currentStepIndex ++; |
370 | afterMoveAction = MochiKit.Base.noop; | 363 | afterMoveAction = MochiKit.Base.noop; |
371 | 364 | ||
372 | switch(this.currentStep()) { | 365 | switch(this.currentStep()) { |
373 | case 'CREDENTIALS': | 366 | case 'CREDENTIALS': |
374 | break; | 367 | break; |
375 | case 'CHECK_CREDENTIALS': | 368 | case 'CHECK_CREDENTIALS': |
376 | break | 369 | break |
377 | case 'TERMS_OF_SERVICE': | 370 | case 'TERMS_OF_SERVICE': |
378 | break; | 371 | break; |
379 | case 'CREATE_USER': | 372 | case 'CREATE_USER': |
380 | break; | 373 | break; |
381 | // case 'LOGIN': | 374 | // case 'LOGIN': |
382 | // break; | 375 | // break; |
383 | }; | 376 | }; |
384 | 377 | ||
385 | this.rulerComponent().moveForward(afterMoveAction); | 378 | this.rulerComponent().moveForward(afterMoveAction); |
386 | }; | 379 | }; |
387 | }, | 380 | }, |
388 | 381 | ||
389 | 'handleCursorMoved': function () { | 382 | 'handleCursorMoved': function () { |
390 | // this.checkState(); | 383 | // this.checkState(); |
391 | // this.setFocus(); | 384 | // this.setFocus(); |
392 | 385 | ||
393 | return Clipperz.Async.callbacks("NewUserWizardController.handleCursorMoved", [ | 386 | return Clipperz.Async.callbacks("NewUserWizardController.handleCursorMoved", [ |
394 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), | 387 | MochiKit.Base.method(this.newUserCreationComponent(), 'waitUntilFullyRendered'), |
395 | MochiKit.Base.method(this, 'checkState'), | 388 | MochiKit.Base.method(this, 'checkState'), |
396 | MochiKit.Base.method(this, 'setFocus') | 389 | MochiKit.Base.method(this, 'setFocus') |
397 | ], {trace:false}); | 390 | ], {trace:false}); |
398 | }, | 391 | }, |
399 | 392 | ||
400 | //------------------------------------------------------------------------- | 393 | //------------------------------------------------------------------------- |
401 | 394 | ||
402 | 'handleChangedValue': function (anEvent) { | 395 | 'handleChangedValue': function (anEvent) { |
403 | this.checkState(); | 396 | this.checkState(); |
404 | }, | 397 | }, |
405 | 398 | ||
406 | //------------------------------------------------------------------------- | 399 | //------------------------------------------------------------------------- |
407 | 400 | ||
408 | 'handleNewUserCreationComponentKeyPressed': function (anEvent) { | 401 | 'handleNewUserCreationComponentKeyPressed': function (anEvent) { |
409 | //console.log(">>> handleNewUserCreationComponentKeyPressed", anEvent.key().string); | ||
410 | if (anEvent.key().string == 'KEY_ENTER') { | 402 | if (anEvent.key().string == 'KEY_ENTER') { |
411 | if (anEvent.target().nodeName != 'TEXTAREA') { | 403 | if (anEvent.target().nodeName != 'TEXTAREA') { |
412 | anEvent.preventDefault(); | 404 | anEvent.preventDefault(); |
413 | this.handleMoveForward(); | 405 | this.handleMoveForward(); |
414 | } | 406 | } |
415 | } else if (anEvent.key().string == 'KEY_TAB') { | 407 | } else if (anEvent.key().string == 'KEY_TAB') { |
416 | if (anEvent.target() == this.newUserCreationComponent().usernameElement()) { | 408 | if (anEvent.target() == this.newUserCreationComponent().usernameElement()) { |
417 | } else { | 409 | } else { |
418 | this.handleMoveForward(); | 410 | this.handleMoveForward(); |
419 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { | 411 | if ((anEvent.target().nodeName == 'INPUT') || (anEvent.target().nodeName == 'TEXTAREA')) { |
420 | anEvent.preventDefault(); | 412 | anEvent.preventDefault(); |
421 | } | 413 | } |
422 | } | 414 | } |
423 | } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) { | 415 | } else if ((anEvent.key().string == 'KEY_ARROW_RIGHT') && (anEvent.modifier().meta == true)) { |
424 | this.handleMoveForward(); | 416 | this.handleMoveForward(); |
425 | } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) { | 417 | } else if ((anEvent.key().string == 'KEY_ARROW_LEFT') && (anEvent.modifier().meta == true)) { |
426 | this.handleMoveBackward(); | 418 | this.handleMoveBackward(); |
427 | } else if (anEvent.key().string == 'KEY_ESCAPE') { | 419 | } else if (anEvent.key().string == 'KEY_ESCAPE') { |
428 | anEvent.stop(); | 420 | anEvent.stop(); |
429 | this.handleExit(); | 421 | this.handleExit(); |
430 | } else { | 422 | } else { |
431 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'checkState')); | 423 | MochiKit.Async.callLater(0.1, MochiKit.Base.method(this, 'checkState')); |
432 | } | 424 | } |
433 | }, | 425 | }, |
434 | 426 | ||
435 | //============================================================================= | 427 | //============================================================================= |
436 | 428 | ||
437 | 'preformActualUserRegistration': function () { | 429 | 'preformActualUserRegistration': function () { |
438 | vardeferredResult; | 430 | vardeferredResult; |
439 | 431 | ||
440 | deferredResult = new Clipperz.Async.Deferred("NewUSerWizardController.preformActualUserRegistration", {trace:false}); | 432 | deferredResult = new Clipperz.Async.Deferred("NewUSerWizardController.preformActualUserRegistration", {trace:false}); |
441 | deferredResult.addMethod(this.newUserCreationComponent(), 'showProgressOnUserCreation'); | 433 | deferredResult.addMethod(this.newUserCreationComponent(), 'showProgressOnUserCreation'); |
442 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this.newUserCreationComponent(), 'passphrase')); | 434 | deferredResult.addMethod(Clipperz.PM.RunTime.mainController, 'setPassphraseDelegate', MochiKit.Base.method(this.newUserCreationComponent(), 'passphrase')); |
443 | deferredResult.addCallback(Clipperz.PM.DataModel.User.registerNewAccount, | 435 | deferredResult.addCallback(Clipperz.PM.DataModel.User.registerNewAccount, |
444 | this.newUserCreationComponent().username(), | 436 | this.newUserCreationComponent().username(), |
445 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase') | 437 | MochiKit.Base.method(Clipperz.PM.RunTime.mainController, 'getPassphrase') |
446 | ); | 438 | ); |
447 | deferredResult.addMethod(this, 'setUser'); | 439 | deferredResult.addMethod(this, 'setUser'); |
448 | deferredResult.addMethod(this.newUserCreationComponent(), 'showUserCreationDone'); | 440 | deferredResult.addMethod(this.newUserCreationComponent(), 'showUserCreationDone'); |
449 | deferredResult.addMethod(this, 'setUserCreationState', 'DONE'); | 441 | deferredResult.addMethod(this, 'setUserCreationState', 'DONE'); |
450 | 442 | ||
451 | // deferredResult.addErrback(MochiKit.Base.method(this.newUserCreationComponent(), 'showUserCreationFailed')); | 443 | // deferredResult.addErrback(MochiKit.Base.method(this.newUserCreationComponent(), 'showUserCreationFailed')); |
452 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUser', null)); | 444 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUser', null)); |
453 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUserCreationState', 'FAILED')); | 445 | // deferredResult.addErrback(MochiKit.Base.method(this, 'setUserCreationState', 'FAILED')); |
454 | deferredResult.addErrback(MochiKit.Base.bind(function (aValue) { | 446 | deferredResult.addErrback(MochiKit.Base.bind(function (aValue) { |
455 | this.newUserCreationComponent().showUserCreationFailed(); | 447 | this.newUserCreationComponent().showUserCreationFailed(); |
456 | this.setUser(null); | 448 | this.setUser(null); |
457 | this.setUserCreationState('FAILED'); | 449 | this.setUserCreationState('FAILED'); |
458 | }, this)); | 450 | }, this)); |
459 | deferredResult.callback(); | 451 | deferredResult.callback(); |
460 | 452 | ||
461 | return deferredResult; | 453 | return deferredResult; |
462 | }, | 454 | }, |
463 | 455 | ||
464 | //============================================================================= | 456 | //============================================================================= |
465 | __syntaxFix__: "syntax fix" | 457 | __syntaxFix__: "syntax fix" |
466 | }); | 458 | }); |