rlm@29: rlm@29: rlm@29: rlm@42: function defaults() rlm@42: { rlm@42: alias = "Robert Mac"; rlm@42: email = "rlm@mit.edu"; rlm@42: occupation = ""; rlm@42: company = ""; rlm@42: phone = ""; rlm@42: website = ""; rlm@42: lineArt = ""; rlm@42: } rlm@29: rlm@29: rlm@42: function drawElement(obj) rlm@42: { rlm@42: rlm@42: } rlm@42: rlm@42: function redraw(style) rlm@42: { rlm@42: rlm@42: if (style == "bold") rlm@42: { rlm@42: rlm@42: rlm@42: rlm@42: if(typeof d_alias != 'undefined' ){d_alias.remove();} rlm@42: if(typeof d_email != 'undefined' ){d_email.remove();} rlm@42: if(typeof d_occupation != 'undefined' ){d_occupation.remove();} rlm@42: if(typeof d_company != 'undefined' ){d_company.remove();} rlm@42: if(typeof d_phone != 'undefined' ){d_phone.remove();} rlm@42: if(typeof d_website != 'undefined' ){d_website.remove();} rlm@42: if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} rlm@42: rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Name'); rlm@42: var text_val = oText.value; rlm@42: d_alias = raphe.print(10, 160, text_val, raphe.getFont('HelveticaNeue', 700), 60); rlm@42: d_alias.attr('stroke', '#6a6a6a'); rlm@42: d_alias.attr('fill', 'none') rlm@42: var c = d_alias.getBBox().width; rlm@42: d_alias.translate((485 - c)/2,0); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Email'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); rlm@42: d_email.attr('stroke', '#6a6a6a'); rlm@42: d_email.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: rlm@42: rlm@42: } rlm@42: rlm@42: rlm@42: if (style == "arrow") rlm@42: { rlm@42: rlm@42: if(typeof d_alias != 'undefined' ){d_alias.remove();} rlm@42: if(typeof d_email != 'undefined' ){d_email.remove();} rlm@42: if(typeof d_occupation != 'undefined' ){d_occupation.remove();} rlm@42: if(typeof d_company != 'undefined' ){d_company.remove();} rlm@42: if(typeof d_phone != 'undefined' ){d_phone.remove();} rlm@42: if(typeof d_website != 'undefined' ){d_website.remove();} rlm@42: if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Name'); rlm@42: var text_val = oText.value; rlm@42: d_alias = raphe.print(40, 110, text_val, raphe.getFont('HelveticaNeue', 700), 55); rlm@42: d_alias.attr('stroke', '#6a6a6a'); rlm@42: d_alias.attr('fill', 'none') rlm@42: rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Company'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_company = raphe.print(40, 155, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_company.attr('stroke', '#6a6a6a'); rlm@42: d_company.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Occupation'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_occupation = raphe.print(40, 190, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_occupation.attr('stroke', '#6a6a6a'); rlm@42: d_occupation.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Email'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); rlm@42: d_email.attr('stroke', '#6a6a6a'); rlm@42: d_email.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: d_lineArt = raphe.path("M 2 272 L 258 272"); rlm@42: d_lineArt.attr('stroke', '#6a6a6a'); rlm@42: rlm@42: } rlm@42: rlm@42: rlm@42: if (style == "classic") rlm@42: { rlm@42: rlm@42: if(typeof d_alias != 'undefined' ){d_alias.remove();} rlm@42: if(typeof d_email != 'undefined' ){d_email.remove();} rlm@42: if(typeof d_occupation != 'undefined' ){d_occupation.remove();} rlm@42: if(typeof d_company != 'undefined' ){d_company.remove();} rlm@42: if(typeof d_phone != 'undefined' ){d_phone.remove();} rlm@42: if(typeof d_website != 'undefined' ){d_website.remove();} rlm@42: if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Email'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_email = raphe.print(0, 42, text_val, raphe.getFont("HelveticaNeue", 700), 29); rlm@42: d_email.attr('stroke', '#6a6a6a'); rlm@42: d_email.attr('fill', 'TRANSPARENT'); rlm@42: var c = d_email.getBBox().width; rlm@42: d_email.translate((510 - c)/2,0); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Phone'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_phone = raphe.print(0, 75, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_phone.attr('stroke', '#6a6a6a'); rlm@42: d_phone.attr('fill', 'TRANSPARENT'); rlm@42: var c = d_phone.getBBox().width; rlm@42: d_phone.translate((510 - c)/2,0); rlm@42: rlm@42: rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Name'); rlm@42: var text_val = oText.value; rlm@42: d_alias = raphe.print(0, 164, text_val, raphe.getFont('HelveticaNeue', 800), 47); rlm@42: d_alias.attr('stroke', '#6a6a6a'); rlm@42: d_alias.attr('fill', 'none') rlm@42: var c = d_alias.getBBox().width; rlm@42: d_alias.translate((510 - c)/2,0); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Company'); rlm@42: var text_val = oText.value; rlm@42: d_company = raphe.print(0, 247, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_company.attr('stroke', '#6a6a6a'); rlm@42: d_company.attr('fill', 'TRANSPARENT'); rlm@42: var c = d_company.getBBox().width; rlm@42: d_company.translate((510 - c)/2,0); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Occupation'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_occupation = raphe.print(0, 278, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_occupation.attr('stroke', '#6a6a6a'); rlm@42: d_occupation.attr('fill', 'TRANSPARENT'); rlm@42: var c = d_occupation.getBBox().width; rlm@42: d_occupation.translate((510 - c)/2,0); rlm@42: rlm@42: rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Website'); rlm@42: var text_val = oText.value; rlm@42: rlm@42: d_website = raphe.print(0, 0, text_val, raphe.getFont("HelveticaNeue", 700), 21); rlm@42: d_website.attr('stroke', '#6a6a6a'); rlm@42: d_website.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: var c = d_website.getBBox().width; rlm@42: d_website.translate((317 - c)/2,0); rlm@42: rlm@42: d_website.translate(0, -490); rlm@42: d_website.rotate(90,0,0); rlm@42: } rlm@42: rlm@42: rlm@42: if (style == "direct") rlm@42: { rlm@42: rlm@42: if(typeof d_alias != 'undefined' ){d_alias.remove();} rlm@42: if(typeof d_email != 'undefined' ){d_email.remove();} rlm@42: if(typeof d_occupation != 'undefined' ){d_occupation.remove();} rlm@42: if(typeof d_company != 'undefined' ){d_company.remove();} rlm@42: if(typeof d_phone != 'undefined' ){d_phone.remove();} rlm@42: if(typeof d_website != 'undefined' ){d_website.remove();} rlm@42: if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} rlm@42: rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Name'); rlm@42: var text_val = oText.value; rlm@42: d_alias = raphe.print(37, 70, text_val, raphe.getFont('HelveticaNeue', 700), 55); rlm@42: d_alias.attr('stroke', '#6a6a6a'); rlm@42: d_alias.attr('fill', 'none') rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Occupation'); rlm@42: var text_val = oText.value; rlm@42: d_occupation = raphe.print(37, 120, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_occupation.attr('stroke', '#6a6a6a'); rlm@42: d_occupation.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Company'); rlm@42: var text_val = oText.value; rlm@42: d_company = raphe.print(37, 178, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_company.attr('stroke', '#6a6a6a'); rlm@42: d_company.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Phone'); rlm@42: var text_val = oText.value; rlm@42: d_phone = raphe.print(37, 210, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_phone.attr('stroke', '#6a6a6a'); rlm@42: d_phone.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Email'); rlm@42: var text_val = oText.value; rlm@42: d_email = raphe.print(37, 240, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_email.attr('stroke', '#6a6a6a'); rlm@42: d_email.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: rlm@42: var oText = document.getElementById('Website'); rlm@42: var text_val = oText.value; rlm@42: d_website = raphe.print(37, 270, text_val, raphe.getFont("HelveticaNeue", 700), 27); rlm@42: d_website.attr('stroke', '#6a6a6a'); rlm@42: d_website.attr('fill', 'TRANSPARENT'); rlm@42: rlm@42: 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: d_lineArt.attr('stroke', '#6a6a6a'); rlm@42: rlm@42: rlm@42: rlm@42: } rlm@42: rlm@42: rlm@42: rlm@42: rlm@42: rlm@42: } rlm@42: rlm@42: