rlm@29
|
1
|
rlm@47
|
2 descHash = new Object();
|
rlm@47
|
3
|
rlm@48
|
4 prevVal = "";
|
rlm@47
|
5
|
rlm@47
|
6
|
rlm@47
|
7
|
rlm@47
|
8 descHash.classic_acrylic_clear =
|
rlm@47
|
9 "<h1>The Classic LaserKard.</h1>Balanced and Complete. The original LaserKard. For those that wish to leave no stone unturned. It's all there.";
|
rlm@47
|
10
|
rlm@47
|
11 descHash.big_acrylic_clear =
|
rlm@47
|
12 "<h1>The Bold Kard.</h1>Austere and Iconic. For those that wish to leave an impression with the power of their name accompanied only by their main method of contact. Bold, period.";
|
rlm@47
|
13
|
rlm@47
|
14 descHash.basic_acrylic_clear =
|
rlm@47
|
15 "<h1>The Arrow Kard.</h1>Precise and Straightforward. For those that seek to make a statement while being clear and concise. Straight as an arrow.";
|
rlm@47
|
16
|
rlm@47
|
17 descHash.lines_acrylic_clear =
|
rlm@47
|
18 "<h1>The Direct Kard.</h1>Thorough and Distinct. For those that aim to demonstrate their professionalism with style. Push the envelope. Be Direct.";
|
rlm@47
|
19
|
rlm@47
|
20
|
rlm@47
|
21
|
rlm@47
|
22
|
rlm@47
|
23
|
rlm@47
|
24
|
rlm@47
|
25 function pokedex(target)
|
rlm@47
|
26 {
|
rlm@47
|
27
|
rlm@47
|
28
|
rlm@47
|
29 var description = eval ("descHash." + target);
|
rlm@47
|
30
|
rlm@47
|
31 document.getElementById('pokedex').innerHTML = description;
|
rlm@47
|
32
|
rlm@47
|
33 }
|
rlm@29
|
34
|
rlm@29
|
35
|
rlm@44
|
36
|
rlm@44
|
37 function stabForm(ID)
|
rlm@42
|
38 {
|
rlm@44
|
39 var JSONtext = document.getElementById('formValues').innerHTML;
|
rlm@44
|
40 var hash = new Object();
|
rlm@44
|
41 hash = eval('(' + JSONtext + ')');
|
rlm@44
|
42
|
rlm@44
|
43 propertyValue = document.getElementById(ID).value;
|
rlm@44
|
44 propertyName = ID;
|
rlm@44
|
45 propertyValue = escape(propertyValue);
|
rlm@44
|
46
|
rlm@44
|
47 eval("hash."+propertyName+"='"+propertyValue+"'");
|
rlm@42
|
48
|
rlm@44
|
49 var JSONtext = document.getElementById('formValues').innerHTML = JSON.stringify(hash);
|
rlm@44
|
50 }
|
rlm@44
|
51
|
rlm@44
|
52
|
rlm@44
|
53
|
rlm@44
|
54 function getPosition(style, field)
|
rlm@44
|
55 {
|
rlm@44
|
56
|
rlm@44
|
57 var cardType = eval ("laserkard." + style);
|
rlm@44
|
58
|
rlm@44
|
59
|
rlm@44
|
60 if ( eval("typeof cardType." + field + " != 'undefined'")) //shouldn't ever really matter
|
rlm@44
|
61 {
|
rlm@44
|
62 values = eval("cardType." + field);
|
rlm@44
|
63
|
rlm@44
|
64 if (typeof values.posx != 'undefined'){posx = values.posx;}
|
rlm@44
|
65 if (typeof values.posy != 'undefined'){posy = values.posy;}
|
rlm@44
|
66 if (typeof values.center != 'undefined'){center = values.center;}
|
rlm@44
|
67 if (typeof values.font != 'undefined'){font = values.font;}
|
rlm@48
|
68 if (typeof values.face != 'undefined'){face = values.face;}
|
rlm@48
|
69 if (typeof values.width != 'undefined'){width = values.width;}
|
rlm@44
|
70 if (typeof values.weirdFlip != 'undefined'){weirdFlip = values.weirdFlip;}
|
rlm@48
|
71 if (typeof values.resize != 'undefined'){resize = values.resize;}
|
rlm@44
|
72 }
|
rlm@44
|
73
|
rlm@44
|
74
|
rlm@44
|
75 }
|
rlm@44
|
76
|
rlm@44
|
77
|
rlm@44
|
78
|
rlm@44
|
79
|
rlm@44
|
80 function smallRedraw(style,field)
|
rlm@44
|
81 {
|
rlm@44
|
82
|
rlm@48
|
83
|
rlm@48
|
84
|
rlm@44
|
85 var JSONtext = document.getElementById('formValues').innerHTML;
|
rlm@44
|
86 var hash = new Object();
|
rlm@44
|
87 hash = eval('(' + JSONtext + ')');
|
rlm@44
|
88
|
rlm@44
|
89 var content = eval("hash."+field);
|
rlm@44
|
90
|
rlm@44
|
91 content = unescape(content);
|
rlm@44
|
92
|
rlm@48
|
93 if (prevVal == content){return;}
|
rlm@48
|
94
|
rlm@44
|
95 posx = 10;
|
rlm@44
|
96 posy = 10;
|
rlm@44
|
97 center = 0;
|
rlm@44
|
98 font = 10;
|
rlm@44
|
99 face = 700;
|
rlm@44
|
100 weirdFlip = 0;
|
rlm@48
|
101 resize = 1;
|
rlm@48
|
102 width = 450;
|
rlm@44
|
103
|
rlm@44
|
104 getPosition(style, field);
|
rlm@44
|
105
|
rlm@48
|
106
|
rlm@48
|
107
|
rlm@48
|
108
|
rlm@44
|
109 target = "d_" + field;
|
rlm@44
|
110
|
rlm@44
|
111
|
rlm@44
|
112 var whatev = eval("typeof " + target + " != 'undefined'")
|
rlm@44
|
113
|
rlm@44
|
114 if (whatev){eval ("{" + target + ".remove();}");}
|
rlm@44
|
115
|
rlm@44
|
116 eval ( target + " = raphe.print(posx, posy, content , raphe.getFont('HelveticaNeue', face), font);" );
|
rlm@44
|
117
|
rlm@48
|
118
|
rlm@48
|
119 var sizzle = eval(target+".getBBox().width;");
|
rlm@48
|
120
|
rlm@48
|
121 document.getElementById('output').innerHTML = sizzle;
|
rlm@48
|
122
|
rlm@48
|
123
|
rlm@48
|
124 if (resize == 1)
|
rlm@48
|
125
|
rlm@48
|
126 {
|
rlm@48
|
127
|
rlm@48
|
128
|
rlm@48
|
129
|
rlm@48
|
130
|
rlm@48
|
131 //base case
|
rlm@48
|
132 if ((sizzle) > width)
|
rlm@48
|
133 {
|
rlm@48
|
134
|
rlm@48
|
135 mul = .9;
|
rlm@48
|
136
|
rlm@48
|
137
|
rlm@48
|
138 mul = (width/sizzle);
|
rlm@48
|
139
|
rlm@48
|
140
|
rlm@48
|
141 font = font * mul;
|
rlm@48
|
142
|
rlm@48
|
143 //eval( target + ".scale(mul,mul)" );
|
rlm@48
|
144
|
rlm@48
|
145 eval ( target + ".remove();");
|
rlm@48
|
146 eval ( target + " = raphe.print(posx, posy, content , raphe.getFont('HelveticaNeue', face), font);" );
|
rlm@48
|
147
|
rlm@48
|
148
|
rlm@48
|
149 }
|
rlm@48
|
150
|
rlm@48
|
151
|
rlm@48
|
152
|
rlm@48
|
153 }
|
rlm@48
|
154
|
rlm@48
|
155
|
rlm@48
|
156
|
rlm@48
|
157 var sizzle = eval(target+".getBBox().width;");
|
rlm@48
|
158
|
rlm@48
|
159 document.getElementById('output').innerHTML = sizzle;
|
rlm@48
|
160
|
rlm@48
|
161 eval ( target +".attr('stroke', '#fefefe');");
|
rlm@48
|
162 //eval ( target +".attr('stroke', '#fbafcd');");
|
rlm@48
|
163
|
rlm@44
|
164 eval ( target +".attr('fill', 'none');");
|
rlm@44
|
165
|
rlm@44
|
166
|
rlm@48
|
167
|
rlm@48
|
168
|
rlm@44
|
169 if (center == 1)
|
rlm@44
|
170 {
|
rlm@44
|
171 eval ("var c = " + target+".getBBox().width; " + target + ".translate((485 - c)/2,0);");
|
rlm@44
|
172 }
|
rlm@44
|
173
|
rlm@44
|
174
|
rlm@44
|
175 if (weirdFlip == 1)
|
rlm@44
|
176 {
|
rlm@44
|
177 eval("var c = "+target+".getBBox().width;");
|
rlm@44
|
178 eval(target+ ".translate((317 - c)/2,0);");
|
rlm@44
|
179 eval(target+".translate(0, -490);");
|
rlm@44
|
180 eval(target+".rotate(90,0,0);");
|
rlm@44
|
181 }
|
rlm@44
|
182
|
rlm@44
|
183
|
rlm@44
|
184
|
rlm@48
|
185 prevVal = content;
|
rlm@48
|
186
|
rlm@44
|
187
|
rlm@44
|
188
|
rlm@44
|
189 }
|
rlm@44
|
190
|
rlm@44
|
191 function clearAll()
|
rlm@44
|
192 {
|
rlm@44
|
193 if(typeof d_Name != 'undefined' ){d_Name.remove();}
|
rlm@44
|
194 if(typeof d_Company != 'undefined' ){d_Company.remove();}
|
rlm@44
|
195 if(typeof d_Email != 'undefined' ){d_Email.remove();}
|
rlm@44
|
196 if(typeof d_Occupation != 'undefined' ){d_Occupation.remove();}
|
rlm@44
|
197 if(typeof d_Phone != 'undefined' ){d_Phone.remove();}
|
rlm@44
|
198 if(typeof d_Website != 'undefined' ){d_Website.remove();}
|
rlm@44
|
199
|
rlm@44
|
200 if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
|
rlm@42
|
201 }
|
rlm@42
|
202
|
rlm@42
|
203 function redraw(style)
|
rlm@42
|
204 {
|
rlm@42
|
205
|
rlm@43
|
206
|
rlm@43
|
207
|
rlm@43
|
208
|
rlm@42
|
209 if (style == "bold")
|
rlm@42
|
210 {
|
rlm@42
|
211
|
rlm@44
|
212 clearAll();
|
rlm@44
|
213 smallRedraw("bold","Name");
|
rlm@44
|
214 smallRedraw("bold","Email");
|
rlm@42
|
215
|
rlm@42
|
216
|
rlm@42
|
217
|
rlm@42
|
218 }
|
rlm@42
|
219
|
rlm@42
|
220
|
rlm@42
|
221 if (style == "arrow")
|
rlm@42
|
222 {
|
rlm@42
|
223
|
rlm@44
|
224 clearAll();
|
rlm@42
|
225
|
rlm@44
|
226 smallRedraw("arrow","Name");
|
rlm@44
|
227 smallRedraw("arrow","Email");
|
rlm@44
|
228 smallRedraw("arrow","Occupation");
|
rlm@44
|
229 smallRedraw("arrow","Company");
|
rlm@42
|
230
|
rlm@43
|
231
|
rlm@42
|
232 d_lineArt = raphe.path("M 2 272 L 258 272");
|
rlm@48
|
233 d_lineArt.attr('stroke', '#fefefe');
|
rlm@48
|
234
|
rlm@42
|
235 }
|
rlm@42
|
236
|
rlm@42
|
237
|
rlm@42
|
238 if (style == "classic")
|
rlm@42
|
239 {
|
rlm@42
|
240
|
rlm@44
|
241 clearAll();
|
rlm@42
|
242
|
rlm@44
|
243 smallRedraw("classic","Name");
|
rlm@44
|
244 smallRedraw("classic","Email");
|
rlm@44
|
245 smallRedraw("classic","Occupation");
|
rlm@44
|
246 smallRedraw("classic","Company");
|
rlm@44
|
247 smallRedraw("classic","Phone");
|
rlm@44
|
248 smallRedraw("classic","Website");
|
rlm@42
|
249 }
|
rlm@42
|
250
|
rlm@42
|
251
|
rlm@42
|
252 if (style == "direct")
|
rlm@42
|
253 {
|
rlm@42
|
254
|
rlm@44
|
255 clearAll();
|
rlm@42
|
256
|
rlm@44
|
257 smallRedraw("direct","Name");
|
rlm@44
|
258 smallRedraw("direct","Email");
|
rlm@44
|
259 smallRedraw("direct","Occupation");
|
rlm@44
|
260 smallRedraw("direct","Company");
|
rlm@44
|
261 smallRedraw("direct","Phone");
|
rlm@44
|
262 smallRedraw("direct","Website");
|
rlm@42
|
263
|
rlm@42
|
264 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@48
|
265 d_lineArt.attr('stroke', '#fefefe');
|
rlm@42
|
266
|
rlm@42
|
267
|
rlm@42
|
268
|
rlm@42
|
269 }
|
rlm@42
|
270
|
rlm@42
|
271
|
rlm@42
|
272
|
rlm@42
|
273
|
rlm@42
|
274
|
rlm@42
|
275 }
|
rlm@42
|
276
|
rlm@42
|
277
|