Mercurial > laserkard
diff 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 |
line wrap: on
line diff
1.1 --- a/awesome_js/robert.js Wed Jan 27 22:04:43 2010 -0500 1.2 +++ b/awesome_js/robert.js Thu Jan 28 00:32:54 2010 -0500 1.3 @@ -21,6 +21,18 @@ 1.4 function redraw(style) 1.5 { 1.6 1.7 + 1.8 +var JSONtext = document.getElementById('formValues').innerHTML; 1.9 +var hash = new Object(); 1.10 +hash = eval('(' + JSONtext + ')'); 1.11 + 1.12 +if(hash.Name){alias = hash.Name;} 1.13 +if(hash.Email){email = hash.Email;} 1.14 +if(hash.Occupation){occupation = hash.Occupation;} 1.15 +if(hash.Company){company = hash.Company;} 1.16 +if(hash.Phone){phone = hash.Phone;} 1.17 +if(hash.website){website = Website;} 1.18 + 1.19 if (style == "bold") 1.20 { 1.21 1.22 @@ -36,19 +48,17 @@ 1.23 1.24 1.25 1.26 -var oText = document.getElementById('Name'); 1.27 -var text_val = oText.value; 1.28 -d_alias = raphe.print(10, 160, text_val, raphe.getFont('HelveticaNeue', 700), 60); 1.29 + 1.30 +d_alias = raphe.print(10, 160, alias, raphe.getFont('HelveticaNeue', 700), 60); 1.31 d_alias.attr('stroke', '#6a6a6a'); 1.32 d_alias.attr('fill', 'none') 1.33 var c = d_alias.getBBox().width; 1.34 d_alias.translate((485 - c)/2,0); 1.35 1.36 1.37 -var oText = document.getElementById('Email'); 1.38 -var text_val = oText.value; 1.39 1.40 -d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); 1.41 + 1.42 +d_email = raphe.print(280, 270, email, raphe.getFont("HelveticaNeue", 700), 25); 1.43 d_email.attr('stroke', '#6a6a6a'); 1.44 d_email.attr('fill', 'TRANSPARENT'); 1.45 1.46 @@ -70,38 +80,23 @@ 1.47 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} 1.48 1.49 1.50 -var oText = document.getElementById('Name'); 1.51 -var text_val = oText.value; 1.52 -d_alias = raphe.print(40, 110, text_val, raphe.getFont('HelveticaNeue', 700), 55); 1.53 + 1.54 +d_alias = raphe.print(40, 110, alias, raphe.getFont('HelveticaNeue', 700), 55); 1.55 d_alias.attr('stroke', '#6a6a6a'); 1.56 d_alias.attr('fill', 'none') 1.57 1.58 - 1.59 - 1.60 -var oText = document.getElementById('Company'); 1.61 -var text_val = oText.value; 1.62 - 1.63 -d_company = raphe.print(40, 155, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.64 +d_company = raphe.print(40, 155, company, raphe.getFont("HelveticaNeue", 700), 27); 1.65 d_company.attr('stroke', '#6a6a6a'); 1.66 d_company.attr('fill', 'TRANSPARENT'); 1.67 1.68 - 1.69 -var oText = document.getElementById('Occupation'); 1.70 -var text_val = oText.value; 1.71 - 1.72 -d_occupation = raphe.print(40, 190, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.73 +d_occupation = raphe.print(40, 190, occupation, raphe.getFont("HelveticaNeue", 700), 27); 1.74 d_occupation.attr('stroke', '#6a6a6a'); 1.75 d_occupation.attr('fill', 'TRANSPARENT'); 1.76 1.77 - 1.78 -var oText = document.getElementById('Email'); 1.79 -var text_val = oText.value; 1.80 - 1.81 -d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); 1.82 +d_email = raphe.print(280, 270, email, raphe.getFont("HelveticaNeue", 700), 25); 1.83 d_email.attr('stroke', '#6a6a6a'); 1.84 d_email.attr('fill', 'TRANSPARENT'); 1.85 1.86 - 1.87 d_lineArt = raphe.path("M 2 272 L 258 272"); 1.88 d_lineArt.attr('stroke', '#6a6a6a'); 1.89 1.90 @@ -120,62 +115,44 @@ 1.91 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} 1.92 1.93 1.94 -var oText = document.getElementById('Email'); 1.95 -var text_val = oText.value; 1.96 - 1.97 -d_email = raphe.print(0, 42, text_val, raphe.getFont("HelveticaNeue", 700), 29); 1.98 +d_email = raphe.print(0, 42, email, raphe.getFont("HelveticaNeue", 700), 29); 1.99 d_email.attr('stroke', '#6a6a6a'); 1.100 d_email.attr('fill', 'TRANSPARENT'); 1.101 var c = d_email.getBBox().width; 1.102 d_email.translate((510 - c)/2,0); 1.103 1.104 1.105 -var oText = document.getElementById('Phone'); 1.106 -var text_val = oText.value; 1.107 1.108 -d_phone = raphe.print(0, 75, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.109 +d_phone = raphe.print(0, 75, phone, raphe.getFont("HelveticaNeue", 700), 27); 1.110 d_phone.attr('stroke', '#6a6a6a'); 1.111 d_phone.attr('fill', 'TRANSPARENT'); 1.112 var c = d_phone.getBBox().width; 1.113 d_phone.translate((510 - c)/2,0); 1.114 1.115 1.116 - 1.117 - 1.118 -var oText = document.getElementById('Name'); 1.119 -var text_val = oText.value; 1.120 -d_alias = raphe.print(0, 164, text_val, raphe.getFont('HelveticaNeue', 800), 47); 1.121 +d_alias = raphe.print(0, 164, alias, raphe.getFont('HelveticaNeue', 800), 47); 1.122 d_alias.attr('stroke', '#6a6a6a'); 1.123 d_alias.attr('fill', 'none') 1.124 var c = d_alias.getBBox().width; 1.125 d_alias.translate((510 - c)/2,0); 1.126 1.127 1.128 -var oText = document.getElementById('Company'); 1.129 -var text_val = oText.value; 1.130 -d_company = raphe.print(0, 247, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.131 +d_company = raphe.print(0, 247, company, raphe.getFont("HelveticaNeue", 700), 27); 1.132 d_company.attr('stroke', '#6a6a6a'); 1.133 d_company.attr('fill', 'TRANSPARENT'); 1.134 var c = d_company.getBBox().width; 1.135 d_company.translate((510 - c)/2,0); 1.136 1.137 1.138 -var oText = document.getElementById('Occupation'); 1.139 -var text_val = oText.value; 1.140 1.141 -d_occupation = raphe.print(0, 278, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.142 +d_occupation = raphe.print(0, 278, occupation, raphe.getFont("HelveticaNeue", 700), 27); 1.143 d_occupation.attr('stroke', '#6a6a6a'); 1.144 d_occupation.attr('fill', 'TRANSPARENT'); 1.145 var c = d_occupation.getBBox().width; 1.146 d_occupation.translate((510 - c)/2,0); 1.147 1.148 1.149 - 1.150 - 1.151 -var oText = document.getElementById('Website'); 1.152 -var text_val = oText.value; 1.153 - 1.154 -d_website = raphe.print(0, 0, text_val, raphe.getFont("HelveticaNeue", 700), 21); 1.155 +d_website = raphe.print(0, 0, website, raphe.getFont("HelveticaNeue", 700), 21); 1.156 d_website.attr('stroke', '#6a6a6a'); 1.157 d_website.attr('fill', 'TRANSPARENT'); 1.158 1.159 @@ -200,45 +177,39 @@ 1.160 1.161 1.162 1.163 -var oText = document.getElementById('Name'); 1.164 -var text_val = oText.value; 1.165 -d_alias = raphe.print(37, 70, text_val, raphe.getFont('HelveticaNeue', 700), 55); 1.166 + 1.167 +d_alias = raphe.print(37, 70, alias, raphe.getFont('HelveticaNeue', 700), 55); 1.168 d_alias.attr('stroke', '#6a6a6a'); 1.169 d_alias.attr('fill', 'none') 1.170 1.171 1.172 -var oText = document.getElementById('Occupation'); 1.173 -var text_val = oText.value; 1.174 -d_occupation = raphe.print(37, 120, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.175 + 1.176 +d_occupation = raphe.print(37, 120, occupation, raphe.getFont("HelveticaNeue", 700), 27); 1.177 d_occupation.attr('stroke', '#6a6a6a'); 1.178 d_occupation.attr('fill', 'TRANSPARENT'); 1.179 1.180 1.181 -var oText = document.getElementById('Company'); 1.182 -var text_val = oText.value; 1.183 -d_company = raphe.print(37, 178, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.184 + 1.185 +d_company = raphe.print(37, 178, company, raphe.getFont("HelveticaNeue", 700), 27); 1.186 d_company.attr('stroke', '#6a6a6a'); 1.187 d_company.attr('fill', 'TRANSPARENT'); 1.188 1.189 1.190 1.191 -var oText = document.getElementById('Phone'); 1.192 -var text_val = oText.value; 1.193 -d_phone = raphe.print(37, 210, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.194 +d_phone = raphe.print(37, 210, phone, raphe.getFont("HelveticaNeue", 700), 27); 1.195 d_phone.attr('stroke', '#6a6a6a'); 1.196 d_phone.attr('fill', 'TRANSPARENT'); 1.197 1.198 1.199 -var oText = document.getElementById('Email'); 1.200 -var text_val = oText.value; 1.201 -d_email = raphe.print(37, 240, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.202 + 1.203 +d_email = raphe.print(37, 240, email, raphe.getFont("HelveticaNeue", 700), 27); 1.204 d_email.attr('stroke', '#6a6a6a'); 1.205 d_email.attr('fill', 'TRANSPARENT'); 1.206 1.207 1.208 -var oText = document.getElementById('Website'); 1.209 -var text_val = oText.value; 1.210 -d_website = raphe.print(37, 270, text_val, raphe.getFont("HelveticaNeue", 700), 27); 1.211 + 1.212 + 1.213 +d_website = raphe.print(37, 270, website, raphe.getFont("HelveticaNeue", 700), 27); 1.214 d_website.attr('stroke', '#6a6a6a'); 1.215 d_website.attr('fill', 'TRANSPARENT'); 1.216