annotate 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
rev   line source
rlm@29 1
rlm@29 2
rlm@29 3
rlm@42 4 function defaults()
rlm@42 5 {
rlm@42 6 alias = "Robert Mac";
rlm@42 7 email = "rlm@mit.edu";
rlm@42 8 occupation = "";
rlm@42 9 company = "";
rlm@42 10 phone = "";
rlm@42 11 website = "";
rlm@42 12 lineArt = "";
rlm@42 13 }
rlm@29 14
rlm@29 15
rlm@42 16 function drawElement(obj)
rlm@42 17 {
rlm@42 18
rlm@42 19 }
rlm@42 20
rlm@42 21 function redraw(style)
rlm@42 22 {
rlm@42 23
rlm@42 24 if (style == "bold")
rlm@42 25 {
rlm@42 26
rlm@42 27
rlm@42 28
rlm@42 29 if(typeof d_alias != 'undefined' ){d_alias.remove();}
rlm@42 30 if(typeof d_email != 'undefined' ){d_email.remove();}
rlm@42 31 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
rlm@42 32 if(typeof d_company != 'undefined' ){d_company.remove();}
rlm@42 33 if(typeof d_phone != 'undefined' ){d_phone.remove();}
rlm@42 34 if(typeof d_website != 'undefined' ){d_website.remove();}
rlm@42 35 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
rlm@42 36
rlm@42 37
rlm@42 38
rlm@42 39 var oText = document.getElementById('Name');
rlm@42 40 var text_val = oText.value;
rlm@42 41 d_alias = raphe.print(10, 160, text_val, raphe.getFont('HelveticaNeue', 700), 60);
rlm@42 42 d_alias.attr('stroke', '#6a6a6a');
rlm@42 43 d_alias.attr('fill', 'none')
rlm@42 44 var c = d_alias.getBBox().width;
rlm@42 45 d_alias.translate((485 - c)/2,0);
rlm@42 46
rlm@42 47
rlm@42 48 var oText = document.getElementById('Email');
rlm@42 49 var text_val = oText.value;
rlm@42 50
rlm@42 51 d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25);
rlm@42 52 d_email.attr('stroke', '#6a6a6a');
rlm@42 53 d_email.attr('fill', 'TRANSPARENT');
rlm@42 54
rlm@42 55
rlm@42 56
rlm@42 57
rlm@42 58 }
rlm@42 59
rlm@42 60
rlm@42 61 if (style == "arrow")
rlm@42 62 {
rlm@42 63
rlm@42 64 if(typeof d_alias != 'undefined' ){d_alias.remove();}
rlm@42 65 if(typeof d_email != 'undefined' ){d_email.remove();}
rlm@42 66 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
rlm@42 67 if(typeof d_company != 'undefined' ){d_company.remove();}
rlm@42 68 if(typeof d_phone != 'undefined' ){d_phone.remove();}
rlm@42 69 if(typeof d_website != 'undefined' ){d_website.remove();}
rlm@42 70 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
rlm@42 71
rlm@42 72
rlm@42 73 var oText = document.getElementById('Name');
rlm@42 74 var text_val = oText.value;
rlm@42 75 d_alias = raphe.print(40, 110, text_val, raphe.getFont('HelveticaNeue', 700), 55);
rlm@42 76 d_alias.attr('stroke', '#6a6a6a');
rlm@42 77 d_alias.attr('fill', 'none')
rlm@42 78
rlm@42 79
rlm@42 80
rlm@42 81 var oText = document.getElementById('Company');
rlm@42 82 var text_val = oText.value;
rlm@42 83
rlm@42 84 d_company = raphe.print(40, 155, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 85 d_company.attr('stroke', '#6a6a6a');
rlm@42 86 d_company.attr('fill', 'TRANSPARENT');
rlm@42 87
rlm@42 88
rlm@42 89 var oText = document.getElementById('Occupation');
rlm@42 90 var text_val = oText.value;
rlm@42 91
rlm@42 92 d_occupation = raphe.print(40, 190, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 93 d_occupation.attr('stroke', '#6a6a6a');
rlm@42 94 d_occupation.attr('fill', 'TRANSPARENT');
rlm@42 95
rlm@42 96
rlm@42 97 var oText = document.getElementById('Email');
rlm@42 98 var text_val = oText.value;
rlm@42 99
rlm@42 100 d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25);
rlm@42 101 d_email.attr('stroke', '#6a6a6a');
rlm@42 102 d_email.attr('fill', 'TRANSPARENT');
rlm@42 103
rlm@42 104
rlm@42 105 d_lineArt = raphe.path("M 2 272 L 258 272");
rlm@42 106 d_lineArt.attr('stroke', '#6a6a6a');
rlm@42 107
rlm@42 108 }
rlm@42 109
rlm@42 110
rlm@42 111 if (style == "classic")
rlm@42 112 {
rlm@42 113
rlm@42 114 if(typeof d_alias != 'undefined' ){d_alias.remove();}
rlm@42 115 if(typeof d_email != 'undefined' ){d_email.remove();}
rlm@42 116 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
rlm@42 117 if(typeof d_company != 'undefined' ){d_company.remove();}
rlm@42 118 if(typeof d_phone != 'undefined' ){d_phone.remove();}
rlm@42 119 if(typeof d_website != 'undefined' ){d_website.remove();}
rlm@42 120 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
rlm@42 121
rlm@42 122
rlm@42 123 var oText = document.getElementById('Email');
rlm@42 124 var text_val = oText.value;
rlm@42 125
rlm@42 126 d_email = raphe.print(0, 42, text_val, raphe.getFont("HelveticaNeue", 700), 29);
rlm@42 127 d_email.attr('stroke', '#6a6a6a');
rlm@42 128 d_email.attr('fill', 'TRANSPARENT');
rlm@42 129 var c = d_email.getBBox().width;
rlm@42 130 d_email.translate((510 - c)/2,0);
rlm@42 131
rlm@42 132
rlm@42 133 var oText = document.getElementById('Phone');
rlm@42 134 var text_val = oText.value;
rlm@42 135
rlm@42 136 d_phone = raphe.print(0, 75, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 137 d_phone.attr('stroke', '#6a6a6a');
rlm@42 138 d_phone.attr('fill', 'TRANSPARENT');
rlm@42 139 var c = d_phone.getBBox().width;
rlm@42 140 d_phone.translate((510 - c)/2,0);
rlm@42 141
rlm@42 142
rlm@42 143
rlm@42 144
rlm@42 145 var oText = document.getElementById('Name');
rlm@42 146 var text_val = oText.value;
rlm@42 147 d_alias = raphe.print(0, 164, text_val, raphe.getFont('HelveticaNeue', 800), 47);
rlm@42 148 d_alias.attr('stroke', '#6a6a6a');
rlm@42 149 d_alias.attr('fill', 'none')
rlm@42 150 var c = d_alias.getBBox().width;
rlm@42 151 d_alias.translate((510 - c)/2,0);
rlm@42 152
rlm@42 153
rlm@42 154 var oText = document.getElementById('Company');
rlm@42 155 var text_val = oText.value;
rlm@42 156 d_company = raphe.print(0, 247, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 157 d_company.attr('stroke', '#6a6a6a');
rlm@42 158 d_company.attr('fill', 'TRANSPARENT');
rlm@42 159 var c = d_company.getBBox().width;
rlm@42 160 d_company.translate((510 - c)/2,0);
rlm@42 161
rlm@42 162
rlm@42 163 var oText = document.getElementById('Occupation');
rlm@42 164 var text_val = oText.value;
rlm@42 165
rlm@42 166 d_occupation = raphe.print(0, 278, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 167 d_occupation.attr('stroke', '#6a6a6a');
rlm@42 168 d_occupation.attr('fill', 'TRANSPARENT');
rlm@42 169 var c = d_occupation.getBBox().width;
rlm@42 170 d_occupation.translate((510 - c)/2,0);
rlm@42 171
rlm@42 172
rlm@42 173
rlm@42 174
rlm@42 175 var oText = document.getElementById('Website');
rlm@42 176 var text_val = oText.value;
rlm@42 177
rlm@42 178 d_website = raphe.print(0, 0, text_val, raphe.getFont("HelveticaNeue", 700), 21);
rlm@42 179 d_website.attr('stroke', '#6a6a6a');
rlm@42 180 d_website.attr('fill', 'TRANSPARENT');
rlm@42 181
rlm@42 182 var c = d_website.getBBox().width;
rlm@42 183 d_website.translate((317 - c)/2,0);
rlm@42 184
rlm@42 185 d_website.translate(0, -490);
rlm@42 186 d_website.rotate(90,0,0);
rlm@42 187 }
rlm@42 188
rlm@42 189
rlm@42 190 if (style == "direct")
rlm@42 191 {
rlm@42 192
rlm@42 193 if(typeof d_alias != 'undefined' ){d_alias.remove();}
rlm@42 194 if(typeof d_email != 'undefined' ){d_email.remove();}
rlm@42 195 if(typeof d_occupation != 'undefined' ){d_occupation.remove();}
rlm@42 196 if(typeof d_company != 'undefined' ){d_company.remove();}
rlm@42 197 if(typeof d_phone != 'undefined' ){d_phone.remove();}
rlm@42 198 if(typeof d_website != 'undefined' ){d_website.remove();}
rlm@42 199 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
rlm@42 200
rlm@42 201
rlm@42 202
rlm@42 203 var oText = document.getElementById('Name');
rlm@42 204 var text_val = oText.value;
rlm@42 205 d_alias = raphe.print(37, 70, text_val, raphe.getFont('HelveticaNeue', 700), 55);
rlm@42 206 d_alias.attr('stroke', '#6a6a6a');
rlm@42 207 d_alias.attr('fill', 'none')
rlm@42 208
rlm@42 209
rlm@42 210 var oText = document.getElementById('Occupation');
rlm@42 211 var text_val = oText.value;
rlm@42 212 d_occupation = raphe.print(37, 120, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 213 d_occupation.attr('stroke', '#6a6a6a');
rlm@42 214 d_occupation.attr('fill', 'TRANSPARENT');
rlm@42 215
rlm@42 216
rlm@42 217 var oText = document.getElementById('Company');
rlm@42 218 var text_val = oText.value;
rlm@42 219 d_company = raphe.print(37, 178, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 220 d_company.attr('stroke', '#6a6a6a');
rlm@42 221 d_company.attr('fill', 'TRANSPARENT');
rlm@42 222
rlm@42 223
rlm@42 224
rlm@42 225 var oText = document.getElementById('Phone');
rlm@42 226 var text_val = oText.value;
rlm@42 227 d_phone = raphe.print(37, 210, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 228 d_phone.attr('stroke', '#6a6a6a');
rlm@42 229 d_phone.attr('fill', 'TRANSPARENT');
rlm@42 230
rlm@42 231
rlm@42 232 var oText = document.getElementById('Email');
rlm@42 233 var text_val = oText.value;
rlm@42 234 d_email = raphe.print(37, 240, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 235 d_email.attr('stroke', '#6a6a6a');
rlm@42 236 d_email.attr('fill', 'TRANSPARENT');
rlm@42 237
rlm@42 238
rlm@42 239 var oText = document.getElementById('Website');
rlm@42 240 var text_val = oText.value;
rlm@42 241 d_website = raphe.print(37, 270, text_val, raphe.getFont("HelveticaNeue", 700), 27);
rlm@42 242 d_website.attr('stroke', '#6a6a6a');
rlm@42 243 d_website.attr('fill', 'TRANSPARENT');
rlm@42 244
rlm@42 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");
rlm@42 246 d_lineArt.attr('stroke', '#6a6a6a');
rlm@42 247
rlm@42 248
rlm@42 249
rlm@42 250 }
rlm@42 251
rlm@42 252
rlm@42 253
rlm@42 254
rlm@42 255
rlm@42 256 }
rlm@42 257
rlm@42 258