Mercurial > laserkard
annotate 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 |
rev | line source |
---|---|
rlm@85 | 1 Buy = (function (){ |
rlm@85 | 2 var order = |
rlm@85 | 3 {color: "black", |
rlm@85 | 4 style: "bold", |
rlm@85 | 5 quantity: 30, |
rlm@85 | 6 content: undefined, |
rlm@85 | 7 info: undefined}; |
rlm@85 | 8 |
rlm@85 | 9 var display; |
rlm@85 | 10 var color; |
rlm@85 | 11 var style; |
rlm@85 | 12 |
rlm@85 | 13 |
rlm@85 | 14 var drawInit = (function (){ |
rlm@85 | 15 display.rect(1, 1, 338, 213, 20); |
rlm@85 | 16 color.rect(1, 1, 50, 50, 10); |
rlm@85 | 17 style.rect(1, 1, 10, 10, 5); |
rlm@85 | 18 |
rlm@85 | 19 display.print(40, 45, "Robert" , display.getFont('HelveticaNeue', 700), 30); |
rlm@85 | 20 display.print(40, 90, "McIntyre" , display.getFont('HelveticaNeue', 800), 30); |
rlm@85 | 21 |
rlm@85 | 22 }); |
rlm@85 | 23 |
rlm@85 | 24 var init = (function () { |
rlm@85 | 25 |
rlm@85 | 26 $("#debug").append("init called."); |
rlm@85 | 27 display = Raphael("card-display", 340 ,215); |
rlm@85 | 28 color = Raphael("color-select", 200, 70); |
rlm@85 | 29 style = Raphael("style-select", 200, 70); |
rlm@85 | 30 drawInit(); |
rlm@85 | 31 }); |
rlm@85 | 32 |
rlm@85 | 33 |
rlm@85 | 34 |
rlm@85 | 35 return {init : init |
rlm@85 | 36 }; |
rlm@85 | 37 })(); |
rlm@85 | 38 |
rlm@85 | 39 |
rlm@85 | 40 |
rlm@85 | 41 $(document).ready(function() { |
rlm@85 | 42 Buy.init(); |
rlm@85 | 43 |
rlm@85 | 44 |
rlm@85 | 45 |
rlm@85 | 46 |
rlm@85 | 47 }); |