diff awesome_js/robert.js @ 51:95fa4bcc5d67 laserkard

[svn r52] implemented SVG backend
author rlm
date Wed, 03 Feb 2010 03:14:09 -0500
parents 5eb11cf654de
children 2ca94aa58033
line wrap: on
line diff
     1.1 --- a/awesome_js/robert.js	Mon Feb 01 02:54:59 2010 -0500
     1.2 +++ b/awesome_js/robert.js	Wed Feb 03 03:14:09 2010 -0500
     1.3 @@ -17,7 +17,7 @@
     1.4  descHash.lines_acrylic_clear = 
     1.5  "<h1>The Direct Kard.</h1>Thorough and Distinct.  For those that aim to demonstrate their professionalism with style.  Push the envelope.  Be Direct.";
     1.6  
     1.7 -
     1.8 +color = 'fefefe';
     1.9  
    1.10  
    1.11  
    1.12 @@ -74,14 +74,16 @@
    1.13  
    1.14  }
    1.15  
    1.16 -
    1.17 +//~ function smallRedraw(style,field)
    1.18 +//~ {
    1.19 +//~ //smallRedraw(style,field,"fefefe");
    1.20 +//~ sRedraw(style,field,'fefefe');
    1.21 +//~ }
    1.22  
    1.23  
    1.24  function smallRedraw(style,field)
    1.25  {
    1.26 -
    1.27 -
    1.28 -
    1.29 +	
    1.30  var JSONtext = document.getElementById('formValues').innerHTML;
    1.31  var hash = new Object();
    1.32  hash = eval('(' + JSONtext + ')');
    1.33 @@ -90,7 +92,22 @@
    1.34  
    1.35   content = unescape(content);
    1.36  
    1.37 -if (prevVal == content){return;}
    1.38 +//if (prevVal == content){return;}
    1.39 +
    1.40 +contentRedraw(style,field, content);
    1.41 +
    1.42 +	
    1.43 +}
    1.44 +
    1.45 +
    1.46 +
    1.47 +function contentRedraw(style,field, content)
    1.48 +{
    1.49 +
    1.50 +//var color = color;
    1.51 +
    1.52 +
    1.53 +
    1.54  
    1.55  posx = 10;
    1.56  posy = 10;
    1.57 @@ -158,7 +175,7 @@
    1.58  
    1.59  document.getElementById('output').innerHTML = sizzle;
    1.60  
    1.61 -eval ( target +".attr('stroke', '#fefefe');");
    1.62 +eval ( target +".attr('stroke', '#" + color + "');");
    1.63  //eval ( target +".attr('stroke', '#fbafcd');");
    1.64  
    1.65  eval ( target +".attr('fill', 'none');");
    1.66 @@ -200,6 +217,42 @@
    1.67  if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}	
    1.68  }
    1.69  
    1.70 +
    1.71 +function lineDraw(style, color)
    1.72 +{
    1.73 +
    1.74 +
    1.75 +
    1.76 +
    1.77 +
    1.78 +if (style == "bold")
    1.79 +{return;}
    1.80 +
    1.81 +
    1.82 +
    1.83 +if (style == "arrow")
    1.84 +{
    1.85 +d_lineArt = raphe.path("M 4 272 L 258 272");
    1.86 +d_lineArt.attr('stroke', "#" + color);
    1.87 +return;
    1.88 +}
    1.89 +
    1.90 +
    1.91 +if (style == "classic")
    1.92 +{return;}
    1.93 +
    1.94 +
    1.95 +if (style == "direct")
    1.96 +{
    1.97 +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");
    1.98 +d_lineArt.attr('stroke', "#" + color);
    1.99 +return;
   1.100 +}
   1.101 +
   1.102 +}
   1.103 +
   1.104 +
   1.105 +
   1.106  function redraw(style)
   1.107  {
   1.108  
   1.109 @@ -229,9 +282,6 @@
   1.110  smallRedraw("arrow","Company");
   1.111  
   1.112  
   1.113 -d_lineArt = raphe.path("M 4 272 L 258 272");
   1.114 -d_lineArt.attr('stroke', '#fefefe');
   1.115 -
   1.116  }
   1.117  
   1.118  
   1.119 @@ -261,14 +311,10 @@
   1.120  smallRedraw("direct","Phone");
   1.121  smallRedraw("direct","Website");
   1.122  
   1.123 -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");
   1.124 -d_lineArt.attr('stroke', '#fefefe');
   1.125 -
   1.126 -
   1.127  
   1.128  }
   1.129  
   1.130 -
   1.131 +lineDraw(style, "fefefe");
   1.132  
   1.133  
   1.134