view awesome_js/robert.js @ 42:ef8615de8a9c laserkard

[svn r43] implemented form memory
author rlm
date Wed, 27 Jan 2010 22:04:43 -0500
parents 1ac1409ea68c
children 329638a361cc
line wrap: on
line source



4 function defaults()
5 {
6 alias = "Robert Mac";
7 email = "rlm@mit.edu";
8 occupation = "";
9 company = "";
10 phone = "";
11 website = "";
12 lineArt = "";
13 }
16 function drawElement(obj)
17 {
19 }
21 function redraw(style)
22 {
24 if (style == "bold")
25 {
29 if(typeof d_alias != 'undefined' ){d_alias.remove();}
30 if(typeof d_email != 'undefined' ){d_email.remove();}
31 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
32 if(typeof d_company != 'undefined' ){d_company.remove();}
33 if(typeof d_phone != 'undefined' ){d_phone.remove();}
34 if(typeof d_website != 'undefined' ){d_website.remove();}
35 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
39 var oText = document.getElementById('Name');
40 var text_val = oText.value;
41 d_alias = raphe.print(10, 160, text_val, raphe.getFont('HelveticaNeue', 700), 60);
42 d_alias.attr('stroke', '#6a6a6a');
43 d_alias.attr('fill', 'none')
44 var c = d_alias.getBBox().width;
45 d_alias.translate((485 - c)/2,0);
48 var oText = document.getElementById('Email');
49 var text_val = oText.value;
51 d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25);
52 d_email.attr('stroke', '#6a6a6a');
53 d_email.attr('fill', 'TRANSPARENT');
58 }
61 if (style == "arrow")
62 {
64 if(typeof d_alias != 'undefined' ){d_alias.remove();}
65 if(typeof d_email != 'undefined' ){d_email.remove();}
66 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
67 if(typeof d_company != 'undefined' ){d_company.remove();}
68 if(typeof d_phone != 'undefined' ){d_phone.remove();}
69 if(typeof d_website != 'undefined' ){d_website.remove();}
70 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
73 var oText = document.getElementById('Name');
74 var text_val = oText.value;
75 d_alias = raphe.print(40, 110, text_val, raphe.getFont('HelveticaNeue', 700), 55);
76 d_alias.attr('stroke', '#6a6a6a');
77 d_alias.attr('fill', 'none')
81 var oText = document.getElementById('Company');
82 var text_val = oText.value;
84 d_company = raphe.print(40, 155, text_val, raphe.getFont("HelveticaNeue", 700), 27);
85 d_company.attr('stroke', '#6a6a6a');
86 d_company.attr('fill', 'TRANSPARENT');
89 var oText = document.getElementById('Occupation');
90 var text_val = oText.value;
92 d_occupation = raphe.print(40, 190, text_val, raphe.getFont("HelveticaNeue", 700), 27);
93 d_occupation.attr('stroke', '#6a6a6a');
94 d_occupation.attr('fill', 'TRANSPARENT');
97 var oText = document.getElementById('Email');
98 var text_val = oText.value;
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');
105 d_lineArt = raphe.path("M 2 272 L 258 272");
106 d_lineArt.attr('stroke', '#6a6a6a');
108 }
111 if (style == "classic")
112 {
114 if(typeof d_alias != 'undefined' ){d_alias.remove();}
115 if(typeof d_email != 'undefined' ){d_email.remove();}
116 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
117 if(typeof d_company != 'undefined' ){d_company.remove();}
118 if(typeof d_phone != 'undefined' ){d_phone.remove();}
119 if(typeof d_website != 'undefined' ){d_website.remove();}
120 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
123 var oText = document.getElementById('Email');
124 var text_val = oText.value;
126 d_email = raphe.print(0, 42, text_val, raphe.getFont("HelveticaNeue", 700), 29);
127 d_email.attr('stroke', '#6a6a6a');
128 d_email.attr('fill', 'TRANSPARENT');
129 var c = d_email.getBBox().width;
130 d_email.translate((510 - c)/2,0);
133 var oText = document.getElementById('Phone');
134 var text_val = oText.value;
136 d_phone = raphe.print(0, 75, text_val, raphe.getFont("HelveticaNeue", 700), 27);
137 d_phone.attr('stroke', '#6a6a6a');
138 d_phone.attr('fill', 'TRANSPARENT');
139 var c = d_phone.getBBox().width;
140 d_phone.translate((510 - c)/2,0);
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');
149 d_alias.attr('fill', 'none')
150 var c = d_alias.getBBox().width;
151 d_alias.translate((510 - c)/2,0);
154 var oText = document.getElementById('Company');
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');
158 d_company.attr('fill', 'TRANSPARENT');
159 var c = d_company.getBBox().width;
160 d_company.translate((510 - c)/2,0);
163 var oText = document.getElementById('Occupation');
164 var text_val = oText.value;
166 d_occupation = raphe.print(0, 278, text_val, raphe.getFont("HelveticaNeue", 700), 27);
167 d_occupation.attr('stroke', '#6a6a6a');
168 d_occupation.attr('fill', 'TRANSPARENT');
169 var c = d_occupation.getBBox().width;
170 d_occupation.translate((510 - c)/2,0);
175 var oText = document.getElementById('Website');
176 var text_val = oText.value;
178 d_website = raphe.print(0, 0, text_val, raphe.getFont("HelveticaNeue", 700), 21);
179 d_website.attr('stroke', '#6a6a6a');
180 d_website.attr('fill', 'TRANSPARENT');
182 var c = d_website.getBBox().width;
183 d_website.translate((317 - c)/2,0);
185 d_website.translate(0, -490);
186 d_website.rotate(90,0,0);
187 }
190 if (style == "direct")
191 {
193 if(typeof d_alias != 'undefined' ){d_alias.remove();}
194 if(typeof d_email != 'undefined' ){d_email.remove();}
195 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
196 if(typeof d_company != 'undefined' ){d_company.remove();}
197 if(typeof d_phone != 'undefined' ){d_phone.remove();}
198 if(typeof d_website != 'undefined' ){d_website.remove();}
199 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
203 var oText = document.getElementById('Name');
204 var text_val = oText.value;
205 d_alias = raphe.print(37, 70, text_val, raphe.getFont('HelveticaNeue', 700), 55);
206 d_alias.attr('stroke', '#6a6a6a');
207 d_alias.attr('fill', 'none')
210 var oText = document.getElementById('Occupation');
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');
214 d_occupation.attr('fill', 'TRANSPARENT');
217 var oText = document.getElementById('Company');
218 var text_val = oText.value;
219 d_company = raphe.print(37, 178, text_val, raphe.getFont("HelveticaNeue", 700), 27);
220 d_company.attr('stroke', '#6a6a6a');
221 d_company.attr('fill', 'TRANSPARENT');
225 var oText = document.getElementById('Phone');
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');
229 d_phone.attr('fill', 'TRANSPARENT');
232 var oText = document.getElementById('Email');
233 var text_val = oText.value;
234 d_email = raphe.print(37, 240, text_val, raphe.getFont("HelveticaNeue", 700), 27);
235 d_email.attr('stroke', '#6a6a6a');
236 d_email.attr('fill', 'TRANSPARENT');
239 var oText = document.getElementById('Website');
240 var text_val = oText.value;
241 d_website = raphe.print(37, 270, text_val, raphe.getFont("HelveticaNeue", 700), 27);
242 d_website.attr('stroke', '#6a6a6a');
243 d_website.attr('fill', 'TRANSPARENT');
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");
246 d_lineArt.attr('stroke', '#6a6a6a');
250 }
256 }