Mercurial > laserkard
comparison awesome_js/robert.js @ 43:329638a361cc laserkard
[svn r44] implemented redraw memory.
author | rlm |
---|---|
date | Thu, 28 Jan 2010 00:32:54 -0500 |
parents | ef8615de8a9c |
children | 1045db9799e3 |
comparison
equal
deleted
inserted
replaced
42:ef8615de8a9c | 43:329638a361cc |
---|---|
19 } | 19 } |
20 | 20 |
21 function redraw(style) | 21 function redraw(style) |
22 { | 22 { |
23 | 23 |
24 | |
25 var JSONtext = document.getElementById('formValues').innerHTML; | |
26 var hash = new Object(); | |
27 hash = eval('(' + JSONtext + ')'); | |
28 | |
29 if(hash.Name){alias = hash.Name;} | |
30 if(hash.Email){email = hash.Email;} | |
31 if(hash.Occupation){occupation = hash.Occupation;} | |
32 if(hash.Company){company = hash.Company;} | |
33 if(hash.Phone){phone = hash.Phone;} | |
34 if(hash.website){website = Website;} | |
35 | |
24 if (style == "bold") | 36 if (style == "bold") |
25 { | 37 { |
26 | 38 |
27 | 39 |
28 | 40 |
34 if(typeof d_website != 'undefined' ){d_website.remove();} | 46 if(typeof d_website != 'undefined' ){d_website.remove();} |
35 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} | 47 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} |
36 | 48 |
37 | 49 |
38 | 50 |
39 var oText = document.getElementById('Name'); | 51 |
40 var text_val = oText.value; | 52 d_alias = raphe.print(10, 160, alias, raphe.getFont('HelveticaNeue', 700), 60); |
41 d_alias = raphe.print(10, 160, text_val, raphe.getFont('HelveticaNeue', 700), 60); | |
42 d_alias.attr('stroke', '#6a6a6a'); | 53 d_alias.attr('stroke', '#6a6a6a'); |
43 d_alias.attr('fill', 'none') | 54 d_alias.attr('fill', 'none') |
44 var c = d_alias.getBBox().width; | 55 var c = d_alias.getBBox().width; |
45 d_alias.translate((485 - c)/2,0); | 56 d_alias.translate((485 - c)/2,0); |
46 | 57 |
47 | 58 |
48 var oText = document.getElementById('Email'); | 59 |
49 var text_val = oText.value; | 60 |
50 | 61 d_email = raphe.print(280, 270, email, raphe.getFont("HelveticaNeue", 700), 25); |
51 d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); | |
52 d_email.attr('stroke', '#6a6a6a'); | 62 d_email.attr('stroke', '#6a6a6a'); |
53 d_email.attr('fill', 'TRANSPARENT'); | 63 d_email.attr('fill', 'TRANSPARENT'); |
54 | 64 |
55 | 65 |
56 | 66 |
68 if(typeof d_phone != 'undefined' ){d_phone.remove();} | 78 if(typeof d_phone != 'undefined' ){d_phone.remove();} |
69 if(typeof d_website != 'undefined' ){d_website.remove();} | 79 if(typeof d_website != 'undefined' ){d_website.remove();} |
70 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} | 80 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} |
71 | 81 |
72 | 82 |
73 var oText = document.getElementById('Name'); | 83 |
74 var text_val = oText.value; | 84 d_alias = raphe.print(40, 110, alias, raphe.getFont('HelveticaNeue', 700), 55); |
75 d_alias = raphe.print(40, 110, text_val, raphe.getFont('HelveticaNeue', 700), 55); | 85 d_alias.attr('stroke', '#6a6a6a'); |
76 d_alias.attr('stroke', '#6a6a6a'); | 86 d_alias.attr('fill', 'none') |
77 d_alias.attr('fill', 'none') | 87 |
78 | 88 d_company = raphe.print(40, 155, company, raphe.getFont("HelveticaNeue", 700), 27); |
79 | |
80 | |
81 var oText = document.getElementById('Company'); | |
82 var text_val = oText.value; | |
83 | |
84 d_company = raphe.print(40, 155, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
85 d_company.attr('stroke', '#6a6a6a'); | 89 d_company.attr('stroke', '#6a6a6a'); |
86 d_company.attr('fill', 'TRANSPARENT'); | 90 d_company.attr('fill', 'TRANSPARENT'); |
87 | 91 |
88 | 92 d_occupation = raphe.print(40, 190, occupation, raphe.getFont("HelveticaNeue", 700), 27); |
89 var oText = document.getElementById('Occupation'); | |
90 var text_val = oText.value; | |
91 | |
92 d_occupation = raphe.print(40, 190, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
93 d_occupation.attr('stroke', '#6a6a6a'); | 93 d_occupation.attr('stroke', '#6a6a6a'); |
94 d_occupation.attr('fill', 'TRANSPARENT'); | 94 d_occupation.attr('fill', 'TRANSPARENT'); |
95 | 95 |
96 | 96 d_email = raphe.print(280, 270, email, raphe.getFont("HelveticaNeue", 700), 25); |
97 var oText = document.getElementById('Email'); | 97 d_email.attr('stroke', '#6a6a6a'); |
98 var text_val = oText.value; | 98 d_email.attr('fill', 'TRANSPARENT'); |
99 | |
100 d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); | |
101 d_email.attr('stroke', '#6a6a6a'); | |
102 d_email.attr('fill', 'TRANSPARENT'); | |
103 | |
104 | 99 |
105 d_lineArt = raphe.path("M 2 272 L 258 272"); | 100 d_lineArt = raphe.path("M 2 272 L 258 272"); |
106 d_lineArt.attr('stroke', '#6a6a6a'); | 101 d_lineArt.attr('stroke', '#6a6a6a'); |
107 | 102 |
108 } | 103 } |
118 if(typeof d_phone != 'undefined' ){d_phone.remove();} | 113 if(typeof d_phone != 'undefined' ){d_phone.remove();} |
119 if(typeof d_website != 'undefined' ){d_website.remove();} | 114 if(typeof d_website != 'undefined' ){d_website.remove();} |
120 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} | 115 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} |
121 | 116 |
122 | 117 |
123 var oText = document.getElementById('Email'); | 118 d_email = raphe.print(0, 42, email, raphe.getFont("HelveticaNeue", 700), 29); |
124 var text_val = oText.value; | |
125 | |
126 d_email = raphe.print(0, 42, text_val, raphe.getFont("HelveticaNeue", 700), 29); | |
127 d_email.attr('stroke', '#6a6a6a'); | 119 d_email.attr('stroke', '#6a6a6a'); |
128 d_email.attr('fill', 'TRANSPARENT'); | 120 d_email.attr('fill', 'TRANSPARENT'); |
129 var c = d_email.getBBox().width; | 121 var c = d_email.getBBox().width; |
130 d_email.translate((510 - c)/2,0); | 122 d_email.translate((510 - c)/2,0); |
131 | 123 |
132 | 124 |
133 var oText = document.getElementById('Phone'); | 125 |
134 var text_val = oText.value; | 126 d_phone = raphe.print(0, 75, phone, raphe.getFont("HelveticaNeue", 700), 27); |
135 | |
136 d_phone = raphe.print(0, 75, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
137 d_phone.attr('stroke', '#6a6a6a'); | 127 d_phone.attr('stroke', '#6a6a6a'); |
138 d_phone.attr('fill', 'TRANSPARENT'); | 128 d_phone.attr('fill', 'TRANSPARENT'); |
139 var c = d_phone.getBBox().width; | 129 var c = d_phone.getBBox().width; |
140 d_phone.translate((510 - c)/2,0); | 130 d_phone.translate((510 - c)/2,0); |
141 | 131 |
142 | 132 |
143 | 133 d_alias = raphe.print(0, 164, alias, raphe.getFont('HelveticaNeue', 800), 47); |
144 | |
145 var oText = document.getElementById('Name'); | |
146 var text_val = oText.value; | |
147 d_alias = raphe.print(0, 164, text_val, raphe.getFont('HelveticaNeue', 800), 47); | |
148 d_alias.attr('stroke', '#6a6a6a'); | 134 d_alias.attr('stroke', '#6a6a6a'); |
149 d_alias.attr('fill', 'none') | 135 d_alias.attr('fill', 'none') |
150 var c = d_alias.getBBox().width; | 136 var c = d_alias.getBBox().width; |
151 d_alias.translate((510 - c)/2,0); | 137 d_alias.translate((510 - c)/2,0); |
152 | 138 |
153 | 139 |
154 var oText = document.getElementById('Company'); | 140 d_company = raphe.print(0, 247, company, raphe.getFont("HelveticaNeue", 700), 27); |
155 var text_val = oText.value; | |
156 d_company = raphe.print(0, 247, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
157 d_company.attr('stroke', '#6a6a6a'); | 141 d_company.attr('stroke', '#6a6a6a'); |
158 d_company.attr('fill', 'TRANSPARENT'); | 142 d_company.attr('fill', 'TRANSPARENT'); |
159 var c = d_company.getBBox().width; | 143 var c = d_company.getBBox().width; |
160 d_company.translate((510 - c)/2,0); | 144 d_company.translate((510 - c)/2,0); |
161 | 145 |
162 | 146 |
163 var oText = document.getElementById('Occupation'); | 147 |
164 var text_val = oText.value; | 148 d_occupation = raphe.print(0, 278, occupation, raphe.getFont("HelveticaNeue", 700), 27); |
165 | |
166 d_occupation = raphe.print(0, 278, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
167 d_occupation.attr('stroke', '#6a6a6a'); | 149 d_occupation.attr('stroke', '#6a6a6a'); |
168 d_occupation.attr('fill', 'TRANSPARENT'); | 150 d_occupation.attr('fill', 'TRANSPARENT'); |
169 var c = d_occupation.getBBox().width; | 151 var c = d_occupation.getBBox().width; |
170 d_occupation.translate((510 - c)/2,0); | 152 d_occupation.translate((510 - c)/2,0); |
171 | 153 |
172 | 154 |
173 | 155 d_website = raphe.print(0, 0, website, raphe.getFont("HelveticaNeue", 700), 21); |
174 | |
175 var oText = document.getElementById('Website'); | |
176 var text_val = oText.value; | |
177 | |
178 d_website = raphe.print(0, 0, text_val, raphe.getFont("HelveticaNeue", 700), 21); | |
179 d_website.attr('stroke', '#6a6a6a'); | 156 d_website.attr('stroke', '#6a6a6a'); |
180 d_website.attr('fill', 'TRANSPARENT'); | 157 d_website.attr('fill', 'TRANSPARENT'); |
181 | 158 |
182 var c = d_website.getBBox().width; | 159 var c = d_website.getBBox().width; |
183 d_website.translate((317 - c)/2,0); | 160 d_website.translate((317 - c)/2,0); |
198 if(typeof d_website != 'undefined' ){d_website.remove();} | 175 if(typeof d_website != 'undefined' ){d_website.remove();} |
199 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} | 176 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} |
200 | 177 |
201 | 178 |
202 | 179 |
203 var oText = document.getElementById('Name'); | 180 |
204 var text_val = oText.value; | 181 d_alias = raphe.print(37, 70, alias, raphe.getFont('HelveticaNeue', 700), 55); |
205 d_alias = raphe.print(37, 70, text_val, raphe.getFont('HelveticaNeue', 700), 55); | 182 d_alias.attr('stroke', '#6a6a6a'); |
206 d_alias.attr('stroke', '#6a6a6a'); | 183 d_alias.attr('fill', 'none') |
207 d_alias.attr('fill', 'none') | 184 |
208 | 185 |
209 | 186 |
210 var oText = document.getElementById('Occupation'); | 187 d_occupation = raphe.print(37, 120, occupation, raphe.getFont("HelveticaNeue", 700), 27); |
211 var text_val = oText.value; | |
212 d_occupation = raphe.print(37, 120, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
213 d_occupation.attr('stroke', '#6a6a6a'); | 188 d_occupation.attr('stroke', '#6a6a6a'); |
214 d_occupation.attr('fill', 'TRANSPARENT'); | 189 d_occupation.attr('fill', 'TRANSPARENT'); |
215 | 190 |
216 | 191 |
217 var oText = document.getElementById('Company'); | 192 |
218 var text_val = oText.value; | 193 d_company = raphe.print(37, 178, company, raphe.getFont("HelveticaNeue", 700), 27); |
219 d_company = raphe.print(37, 178, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
220 d_company.attr('stroke', '#6a6a6a'); | 194 d_company.attr('stroke', '#6a6a6a'); |
221 d_company.attr('fill', 'TRANSPARENT'); | 195 d_company.attr('fill', 'TRANSPARENT'); |
222 | 196 |
223 | 197 |
224 | 198 |
225 var oText = document.getElementById('Phone'); | 199 d_phone = raphe.print(37, 210, phone, raphe.getFont("HelveticaNeue", 700), 27); |
226 var text_val = oText.value; | |
227 d_phone = raphe.print(37, 210, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
228 d_phone.attr('stroke', '#6a6a6a'); | 200 d_phone.attr('stroke', '#6a6a6a'); |
229 d_phone.attr('fill', 'TRANSPARENT'); | 201 d_phone.attr('fill', 'TRANSPARENT'); |
230 | 202 |
231 | 203 |
232 var oText = document.getElementById('Email'); | 204 |
233 var text_val = oText.value; | 205 d_email = raphe.print(37, 240, email, raphe.getFont("HelveticaNeue", 700), 27); |
234 d_email = raphe.print(37, 240, text_val, raphe.getFont("HelveticaNeue", 700), 27); | 206 d_email.attr('stroke', '#6a6a6a'); |
235 d_email.attr('stroke', '#6a6a6a'); | 207 d_email.attr('fill', 'TRANSPARENT'); |
236 d_email.attr('fill', 'TRANSPARENT'); | 208 |
237 | 209 |
238 | 210 |
239 var oText = document.getElementById('Website'); | 211 |
240 var text_val = oText.value; | 212 d_website = raphe.print(37, 270, website, raphe.getFont("HelveticaNeue", 700), 27); |
241 d_website = raphe.print(37, 270, text_val, raphe.getFont("HelveticaNeue", 700), 27); | |
242 d_website.attr('stroke', '#6a6a6a'); | 213 d_website.attr('stroke', '#6a6a6a'); |
243 d_website.attr('fill', 'TRANSPARENT'); | 214 d_website.attr('fill', 'TRANSPARENT'); |
244 | 215 |
245 d_lineArt = raphe.path("M 350 165 L 512 165 M 350 173 L 512 173 M 350 181 L 512 181 M 350 189 L 512 189 M 350 197 L 512 197 M 350 213 L 512 213 M 350 205 L 512 205 M 350 221 L 512 221"); | 216 d_lineArt = raphe.path("M 350 165 L 512 165 M 350 173 L 512 173 M 350 181 L 512 181 M 350 189 L 512 189 M 350 197 L 512 197 M 350 213 L 512 213 M 350 205 L 512 205 M 350 221 L 512 221"); |
246 d_lineArt.attr('stroke', '#6a6a6a'); | 217 d_lineArt.attr('stroke', '#6a6a6a'); |