diff js-lib/buy3.js @ 85:da4f4f91f8aa laserkard

got three separate Raphael instances
author Robert McIntyre <rlm@mit.edu>
date Sun, 25 Jul 2010 22:36:16 -0400
parents
children e48424b01e5f
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js-lib/buy3.js	Sun Jul 25 22:36:16 2010 -0400
     1.3 @@ -0,0 +1,47 @@
     1.4 +Buy = (function (){ 
     1.5 +    var order = 
     1.6 +    {color: "black",
     1.7 +     style: "bold",
     1.8 +     quantity: 30,
     1.9 +     content: undefined,
    1.10 +     info: undefined};
    1.11 +    
    1.12 +    var display;
    1.13 +    var color;
    1.14 +    var style;
    1.15 +    
    1.16 +
    1.17 +    var drawInit = (function (){
    1.18 +	    display.rect(1, 1, 338, 213, 20);
    1.19 +	    color.rect(1, 1, 50, 50, 10);
    1.20 +	    style.rect(1, 1, 10, 10, 5);
    1.21 +
    1.22 +	    display.print(40, 45, "Robert"  , display.getFont('HelveticaNeue', 700), 30);
    1.23 +	    display.print(40, 90, "McIntyre"  , display.getFont('HelveticaNeue', 800), 30);
    1.24 +
    1.25 +	});
    1.26 +    
    1.27 +    var init = (function () {
    1.28 +
    1.29 +	    $("#debug").append("init called.");
    1.30 +	    display = Raphael("card-display", 340 ,215);
    1.31 +	    color = Raphael("color-select", 200, 70);
    1.32 +	    style = Raphael("style-select", 200, 70);
    1.33 +	    drawInit();
    1.34 +	    });
    1.35 +    
    1.36 +  
    1.37 +	    
    1.38 +    return {init : init
    1.39 +	    };
    1.40 +})();
    1.41 +
    1.42 +
    1.43 +
    1.44 +$(document).ready(function() {
    1.45 +	Buy.init();
    1.46 +
    1.47 +
    1.48 +
    1.49 +	
    1.50 +    });