Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js | 15 |
1 files changed, 6 insertions, 9 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 169946a..25e82ca 100644 --- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js +++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js | |||
@@ -1,88 +1,85 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | // | 26 | // |
30 | //download.js | 27 | //download.js |
31 | //Download | 28 | //Download |
32 | // | 29 | // |
33 | //Created by Giulio Cesare Solaroli on 3/15/10 | 30 | //Created by Giulio Cesare Solaroli on 3/15/10 |
34 | //Copyright 2010 Clipperz | 31 | //Copyright 2010 Clipperz |
35 | //This code was generated by Opacity. You may use or modify it in any way. | 32 | //This code was generated by Opacity. You may use or modify it in any way. |
36 | // | 33 | // |
37 | 34 | ||
38 | var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; | 35 | var kClipperz_PM_UI_Canvas_CoverActions_downloadWidth = 46.0; |
39 | var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; | 36 | var kClipperz_PM_UI_Canvas_CoverActions_downloadHeight = 46.0; |
40 | 37 | ||
41 | function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) | 38 | function Clipperz_PM_UI_Canvas_CoverActions_download(canvas, aColor, aFillColor, aThickness) |
42 | { | 39 | { |
43 | var context = canvas.getContext("2d"); | 40 | var context = canvas.getContext("2d"); |
44 | var alignStroke; | 41 | var alignStroke; |
45 | var resolution; | 42 | var resolution; |
46 | var stroke; | 43 | var stroke; |
47 | var path; | 44 | var path; |
48 | var pointX; | 45 | var pointX; |
49 | var pointY; | 46 | var pointY; |
50 | if (window.devicePixelRatio) | 47 | if (window.devicePixelRatio) |
51 | resolution = window.devicePixelRatio; | 48 | resolution = window.devicePixelRatio; |
52 | else | 49 | else |
53 | resolution = 1.0; | 50 | resolution = 1.0; |
54 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 51 | resolution *= 0.5 * (canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth + canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
55 | 52 | ||
56 | context.save(); | 53 | context.save(); |
57 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 54 | context.scale(canvas.width / kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, canvas.height / kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
58 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); | 55 | context.clearRect(0.0, 0.0, kClipperz_PM_UI_Canvas_CoverActions_downloadWidth, kClipperz_PM_UI_Canvas_CoverActions_downloadHeight); |
59 | 56 | ||
60 | // arrow | 57 | // arrow |
61 | 58 | ||
62 | stroke = aThickness; | 59 | stroke = aThickness; |
63 | stroke *= resolution; | 60 | stroke *= resolution; |
64 | if (stroke < 1.0) | 61 | if (stroke < 1.0) |
65 | stroke = Math.ceil(stroke); | 62 | stroke = Math.ceil(stroke); |
66 | else | 63 | else |
67 | stroke = Math.round(stroke); | 64 | stroke = Math.round(stroke); |
68 | stroke /= resolution; | 65 | stroke /= resolution; |
69 | alignStroke = (0.5 * stroke * resolution) % 1.0; | 66 | alignStroke = (0.5 * stroke * resolution) % 1.0; |
70 | context.beginPath(); | 67 | context.beginPath(); |
71 | pointX = 16.5; | 68 | pointX = 16.5; |
72 | pointY = 22.5; | 69 | pointY = 22.5; |
73 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 70 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
74 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 71 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
75 | context.moveTo(pointX, pointY); | 72 | context.moveTo(pointX, pointY); |
76 | pointX = 19.5; | 73 | pointX = 19.5; |
77 | pointY = 8.5; | 74 | pointY = 8.5; |
78 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 75 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
79 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 76 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
80 | context.lineTo(pointX, pointY); | 77 | context.lineTo(pointX, pointY); |
81 | pointX = 30.038; | 78 | pointX = 30.038; |
82 | pointY = 10.605; | 79 | pointY = 10.605; |
83 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 80 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |
84 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; | 81 | pointY = (Math.round(resolution * pointY + alignStroke) - alignStroke) / resolution; |
85 | context.lineTo(pointX, pointY); | 82 | context.lineTo(pointX, pointY); |
86 | pointX = 27.354; | 83 | pointX = 27.354; |
87 | pointY = 24.354; | 84 | pointY = 24.354; |
88 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; | 85 | pointX = (Math.round(resolution * pointX + alignStroke) - alignStroke) / resolution; |