rlm@29
|
1
|
rlm@29
|
2
|
rlm@29
|
3
|
rlm@44
|
4
|
rlm@44
|
5 function stabForm(ID)
|
rlm@42
|
6 {
|
rlm@44
|
7 var JSONtext = document.getElementById('formValues').innerHTML;
|
rlm@44
|
8 var hash = new Object();
|
rlm@44
|
9 hash = eval('(' + JSONtext + ')');
|
rlm@44
|
10
|
rlm@44
|
11 propertyValue = document.getElementById(ID).value;
|
rlm@44
|
12 propertyName = ID;
|
rlm@44
|
13 propertyValue = escape(propertyValue);
|
rlm@44
|
14
|
rlm@44
|
15 eval("hash."+propertyName+"='"+propertyValue+"'");
|
rlm@42
|
16
|
rlm@44
|
17 var JSONtext = document.getElementById('formValues').innerHTML = JSON.stringify(hash);
|
rlm@44
|
18 }
|
rlm@44
|
19
|
rlm@44
|
20
|
rlm@44
|
21
|
rlm@44
|
22 function getPosition(style, field)
|
rlm@44
|
23 {
|
rlm@44
|
24
|
rlm@44
|
25 var cardType = eval ("laserkard." + style);
|
rlm@44
|
26
|
rlm@44
|
27
|
rlm@44
|
28 if ( eval("typeof cardType." + field + " != 'undefined'")) //shouldn't ever really matter
|
rlm@44
|
29 {
|
rlm@44
|
30 values = eval("cardType." + field);
|
rlm@44
|
31
|
rlm@44
|
32 if (typeof values.posx != 'undefined'){posx = values.posx;}
|
rlm@44
|
33 if (typeof values.posy != 'undefined'){posy = values.posy;}
|
rlm@44
|
34 if (typeof values.center != 'undefined'){center = values.center;}
|
rlm@44
|
35 if (typeof values.font != 'undefined'){font = values.font;}
|
rlm@44
|
36 if (typeof values.weirdFlip != 'undefined'){weirdFlip = values.weirdFlip;}
|
rlm@44
|
37 }
|
rlm@44
|
38
|
rlm@44
|
39
|
rlm@44
|
40 }
|
rlm@44
|
41
|
rlm@44
|
42
|
rlm@44
|
43
|
rlm@44
|
44
|
rlm@44
|
45 function smallRedraw(style,field)
|
rlm@44
|
46 {
|
rlm@44
|
47
|
rlm@44
|
48 var JSONtext = document.getElementById('formValues').innerHTML;
|
rlm@44
|
49 var hash = new Object();
|
rlm@44
|
50 hash = eval('(' + JSONtext + ')');
|
rlm@44
|
51
|
rlm@44
|
52 var content = eval("hash."+field);
|
rlm@44
|
53
|
rlm@44
|
54 content = unescape(content);
|
rlm@44
|
55
|
rlm@44
|
56 posx = 10;
|
rlm@44
|
57 posy = 10;
|
rlm@44
|
58 center = 0;
|
rlm@44
|
59 font = 10;
|
rlm@44
|
60 face = 700;
|
rlm@44
|
61 weirdFlip = 0;
|
rlm@44
|
62
|
rlm@44
|
63 getPosition(style, field);
|
rlm@44
|
64
|
rlm@44
|
65 target = "d_" + field;
|
rlm@44
|
66
|
rlm@44
|
67
|
rlm@44
|
68 var whatev = eval("typeof " + target + " != 'undefined'")
|
rlm@44
|
69
|
rlm@44
|
70 if (whatev){eval ("{" + target + ".remove();}");}
|
rlm@44
|
71
|
rlm@44
|
72 eval ( target + " = raphe.print(posx, posy, content , raphe.getFont('HelveticaNeue', face), font);" );
|
rlm@44
|
73
|
rlm@44
|
74
|
rlm@44
|
75 eval ( target +".attr('stroke', '#6a6a6a');");
|
rlm@44
|
76 eval ( target +".attr('fill', 'none');");
|
rlm@44
|
77
|
rlm@44
|
78
|
rlm@44
|
79 if (center == 1)
|
rlm@44
|
80 {
|
rlm@44
|
81 eval ("var c = " + target+".getBBox().width; " + target + ".translate((485 - c)/2,0);");
|
rlm@44
|
82 }
|
rlm@44
|
83
|
rlm@44
|
84
|
rlm@44
|
85 if (weirdFlip == 1)
|
rlm@44
|
86 {
|
rlm@44
|
87 eval("var c = "+target+".getBBox().width;");
|
rlm@44
|
88 eval(target+ ".translate((317 - c)/2,0);");
|
rlm@44
|
89 eval(target+".translate(0, -490);");
|
rlm@44
|
90 eval(target+".rotate(90,0,0);");
|
rlm@44
|
91 }
|
rlm@44
|
92
|
rlm@44
|
93
|
rlm@44
|
94
|
rlm@44
|
95
|
rlm@44
|
96
|
rlm@44
|
97 }
|
rlm@44
|
98
|
rlm@44
|
99 function clearAll()
|
rlm@44
|
100 {
|
rlm@44
|
101 if(typeof d_Name != 'undefined' ){d_Name.remove();}
|
rlm@44
|
102 if(typeof d_Company != 'undefined' ){d_Company.remove();}
|
rlm@44
|
103 if(typeof d_Email != 'undefined' ){d_Email.remove();}
|
rlm@44
|
104 if(typeof d_Occupation != 'undefined' ){d_Occupation.remove();}
|
rlm@44
|
105 if(typeof d_Phone != 'undefined' ){d_Phone.remove();}
|
rlm@44
|
106 if(typeof d_Website != 'undefined' ){d_Website.remove();}
|
rlm@44
|
107
|
rlm@44
|
108 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
|
rlm@42
|
109 }
|
rlm@42
|
110
|
rlm@42
|
111 function redraw(style)
|
rlm@42
|
112 {
|
rlm@42
|
113
|
rlm@43
|
114
|
rlm@43
|
115
|
rlm@43
|
116
|
rlm@42
|
117 if (style == "bold")
|
rlm@42
|
118 {
|
rlm@42
|
119
|
rlm@44
|
120 clearAll();
|
rlm@44
|
121 smallRedraw("bold","Name");
|
rlm@44
|
122 smallRedraw("bold","Email");
|
rlm@42
|
123
|
rlm@42
|
124
|
rlm@42
|
125
|
rlm@42
|
126 }
|
rlm@42
|
127
|
rlm@42
|
128
|
rlm@42
|
129 if (style == "arrow")
|
rlm@42
|
130 {
|
rlm@42
|
131
|
rlm@44
|
132 clearAll();
|
rlm@42
|
133
|
rlm@44
|
134 smallRedraw("arrow","Name");
|
rlm@44
|
135 smallRedraw("arrow","Email");
|
rlm@44
|
136 smallRedraw("arrow","Occupation");
|
rlm@44
|
137 smallRedraw("arrow","Company");
|
rlm@42
|
138
|
rlm@43
|
139
|
rlm@42
|
140 d_lineArt = raphe.path("M 2 272 L 258 272");
|
rlm@42
|
141 d_lineArt.attr('stroke', '#6a6a6a');
|
rlm@42
|
142
|
rlm@42
|
143 }
|
rlm@42
|
144
|
rlm@42
|
145
|
rlm@42
|
146 if (style == "classic")
|
rlm@42
|
147 {
|
rlm@42
|
148
|
rlm@44
|
149 clearAll();
|
rlm@42
|
150
|
rlm@44
|
151 smallRedraw("classic","Name");
|
rlm@44
|
152 smallRedraw("classic","Email");
|
rlm@44
|
153 smallRedraw("classic","Occupation");
|
rlm@44
|
154 smallRedraw("classic","Company");
|
rlm@44
|
155 smallRedraw("classic","Phone");
|
rlm@44
|
156 smallRedraw("classic","Website");
|
rlm@42
|
157 }
|
rlm@42
|
158
|
rlm@42
|
159
|
rlm@42
|
160 if (style == "direct")
|
rlm@42
|
161 {
|
rlm@42
|
162
|
rlm@44
|
163 clearAll();
|
rlm@42
|
164
|
rlm@44
|
165 smallRedraw("direct","Name");
|
rlm@44
|
166 smallRedraw("direct","Email");
|
rlm@44
|
167 smallRedraw("direct","Occupation");
|
rlm@44
|
168 smallRedraw("direct","Company");
|
rlm@44
|
169 smallRedraw("direct","Phone");
|
rlm@44
|
170 smallRedraw("direct","Website");
|
rlm@42
|
171
|
rlm@42
|
172 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
|
173 d_lineArt.attr('stroke', '#6a6a6a');
|
rlm@42
|
174
|
rlm@42
|
175
|
rlm@42
|
176
|
rlm@42
|
177 }
|
rlm@42
|
178
|
rlm@42
|
179
|
rlm@42
|
180
|
rlm@42
|
181
|
rlm@42
|
182
|
rlm@42
|
183 }
|
rlm@42
|
184
|
rlm@42
|
185
|