# HG changeset patch # User rlm # Date 1264647883 18000 # Node ID ef8615de8a9cc6e15a642daf1afde5fad99467cc # Parent c4747d955ac8ef36d30562d2009042178af79c82 [svn r43] implemented form memory diff -r c4747d955ac8 -r ef8615de8a9c awesome_js/robert.js --- a/awesome_js/robert.js Mon Jan 25 13:38:05 2010 -0500 +++ b/awesome_js/robert.js Wed Jan 27 22:04:43 2010 -0500 @@ -1,9 +1,258 @@ -window.Robert = (function () { +function defaults() +{ +alias = "Robert Mac"; +email = "rlm@mit.edu"; +occupation = ""; +company = ""; +phone = ""; +website = ""; +lineArt = ""; +} -var separator = /[, ]+/, - elements = /^(circle|rect|path|ellipse|text|image)$/, -Paper = function () {}, +function drawElement(obj) +{ + +} + +function redraw(style) +{ + +if (style == "bold") +{ + + + +if(typeof d_alias != 'undefined' ){d_alias.remove();} +if(typeof d_email != 'undefined' ){d_email.remove();} +if(typeof d_occupation != 'undefined' ){d_occupation.remove();} +if(typeof d_company != 'undefined' ){d_company.remove();} +if(typeof d_phone != 'undefined' ){d_phone.remove();} +if(typeof d_website != 'undefined' ){d_website.remove();} +if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} + + + +var oText = document.getElementById('Name'); +var text_val = oText.value; +d_alias = raphe.print(10, 160, text_val, raphe.getFont('HelveticaNeue', 700), 60); +d_alias.attr('stroke', '#6a6a6a'); +d_alias.attr('fill', 'none') +var c = d_alias.getBBox().width; +d_alias.translate((485 - c)/2,0); + + +var oText = document.getElementById('Email'); +var text_val = oText.value; + +d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); +d_email.attr('stroke', '#6a6a6a'); +d_email.attr('fill', 'TRANSPARENT'); + + + + +} + + +if (style == "arrow") +{ + +if(typeof d_alias != 'undefined' ){d_alias.remove();} +if(typeof d_email != 'undefined' ){d_email.remove();} +if(typeof d_occupation != 'undefined' ){d_occupation.remove();} +if(typeof d_company != 'undefined' ){d_company.remove();} +if(typeof d_phone != 'undefined' ){d_phone.remove();} +if(typeof d_website != 'undefined' ){d_website.remove();} +if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} + + +var oText = document.getElementById('Name'); +var text_val = oText.value; +d_alias = raphe.print(40, 110, text_val, raphe.getFont('HelveticaNeue', 700), 55); +d_alias.attr('stroke', '#6a6a6a'); +d_alias.attr('fill', 'none') + + + +var oText = document.getElementById('Company'); +var text_val = oText.value; + +d_company = raphe.print(40, 155, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_company.attr('stroke', '#6a6a6a'); +d_company.attr('fill', 'TRANSPARENT'); + + +var oText = document.getElementById('Occupation'); +var text_val = oText.value; + +d_occupation = raphe.print(40, 190, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_occupation.attr('stroke', '#6a6a6a'); +d_occupation.attr('fill', 'TRANSPARENT'); + + +var oText = document.getElementById('Email'); +var text_val = oText.value; + +d_email = raphe.print(280, 270, text_val, raphe.getFont("HelveticaNeue", 700), 25); +d_email.attr('stroke', '#6a6a6a'); +d_email.attr('fill', 'TRANSPARENT'); + + +d_lineArt = raphe.path("M 2 272 L 258 272"); +d_lineArt.attr('stroke', '#6a6a6a'); + +} + + +if (style == "classic") +{ + +if(typeof d_alias != 'undefined' ){d_alias.remove();} +if(typeof d_email != 'undefined' ){d_email.remove();} +if(typeof d_occupation != 'undefined' ){d_occupation.remove();} +if(typeof d_company != 'undefined' ){d_company.remove();} +if(typeof d_phone != 'undefined' ){d_phone.remove();} +if(typeof d_website != 'undefined' ){d_website.remove();} +if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} + + +var oText = document.getElementById('Email'); +var text_val = oText.value; + +d_email = raphe.print(0, 42, text_val, raphe.getFont("HelveticaNeue", 700), 29); +d_email.attr('stroke', '#6a6a6a'); +d_email.attr('fill', 'TRANSPARENT'); +var c = d_email.getBBox().width; +d_email.translate((510 - c)/2,0); + + +var oText = document.getElementById('Phone'); +var text_val = oText.value; + +d_phone = raphe.print(0, 75, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_phone.attr('stroke', '#6a6a6a'); +d_phone.attr('fill', 'TRANSPARENT'); +var c = d_phone.getBBox().width; +d_phone.translate((510 - c)/2,0); + + + + +var oText = document.getElementById('Name'); +var text_val = oText.value; +d_alias = raphe.print(0, 164, text_val, raphe.getFont('HelveticaNeue', 800), 47); +d_alias.attr('stroke', '#6a6a6a'); +d_alias.attr('fill', 'none') +var c = d_alias.getBBox().width; +d_alias.translate((510 - c)/2,0); + + +var oText = document.getElementById('Company'); +var text_val = oText.value; +d_company = raphe.print(0, 247, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_company.attr('stroke', '#6a6a6a'); +d_company.attr('fill', 'TRANSPARENT'); +var c = d_company.getBBox().width; +d_company.translate((510 - c)/2,0); + + +var oText = document.getElementById('Occupation'); +var text_val = oText.value; + +d_occupation = raphe.print(0, 278, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_occupation.attr('stroke', '#6a6a6a'); +d_occupation.attr('fill', 'TRANSPARENT'); +var c = d_occupation.getBBox().width; +d_occupation.translate((510 - c)/2,0); + + + + +var oText = document.getElementById('Website'); +var text_val = oText.value; + +d_website = raphe.print(0, 0, text_val, raphe.getFont("HelveticaNeue", 700), 21); +d_website.attr('stroke', '#6a6a6a'); +d_website.attr('fill', 'TRANSPARENT'); + +var c = d_website.getBBox().width; +d_website.translate((317 - c)/2,0); + +d_website.translate(0, -490); +d_website.rotate(90,0,0); +} + + +if (style == "direct") +{ + +if(typeof d_alias != 'undefined' ){d_alias.remove();} +if(typeof d_email != 'undefined' ){d_email.remove();} +if(typeof d_occupation != 'undefined' ){d_occupation.remove();} +if(typeof d_company != 'undefined' ){d_company.remove();} +if(typeof d_phone != 'undefined' ){d_phone.remove();} +if(typeof d_website != 'undefined' ){d_website.remove();} +if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();} + + + +var oText = document.getElementById('Name'); +var text_val = oText.value; +d_alias = raphe.print(37, 70, text_val, raphe.getFont('HelveticaNeue', 700), 55); +d_alias.attr('stroke', '#6a6a6a'); +d_alias.attr('fill', 'none') + + +var oText = document.getElementById('Occupation'); +var text_val = oText.value; +d_occupation = raphe.print(37, 120, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_occupation.attr('stroke', '#6a6a6a'); +d_occupation.attr('fill', 'TRANSPARENT'); + + +var oText = document.getElementById('Company'); +var text_val = oText.value; +d_company = raphe.print(37, 178, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_company.attr('stroke', '#6a6a6a'); +d_company.attr('fill', 'TRANSPARENT'); + + + +var oText = document.getElementById('Phone'); +var text_val = oText.value; +d_phone = raphe.print(37, 210, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_phone.attr('stroke', '#6a6a6a'); +d_phone.attr('fill', 'TRANSPARENT'); + + +var oText = document.getElementById('Email'); +var text_val = oText.value; +d_email = raphe.print(37, 240, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_email.attr('stroke', '#6a6a6a'); +d_email.attr('fill', 'TRANSPARENT'); + + +var oText = document.getElementById('Website'); +var text_val = oText.value; +d_website = raphe.print(37, 270, text_val, raphe.getFont("HelveticaNeue", 700), 27); +d_website.attr('stroke', '#6a6a6a'); +d_website.attr('fill', 'TRANSPARENT'); + +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"); +d_lineArt.attr('stroke', '#6a6a6a'); + + + +} + + + + + +} + + diff -r c4747d955ac8 -r ef8615de8a9c buy.html --- a/buy.html Mon Jan 25 13:38:05 2010 -0500 +++ b/buy.html Wed Jan 27 22:04:43 2010 -0500 @@ -81,270 +81,17 @@ +