rlm@29:
rlm@47: descHash = new Object();
rlm@47:
rlm@48: prevVal = "";
rlm@47:
rlm@47:
rlm@47:
rlm@47: descHash.classic_acrylic_clear =
rlm@47: "
The Classic LaserKard.
Balanced and Complete. The original LaserKard. For those that wish to leave no stone unturned. It's all there.";
rlm@47:
rlm@47: descHash.big_acrylic_clear =
rlm@47: "The Bold Kard.
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:
rlm@47: descHash.basic_acrylic_clear =
rlm@47: "The Arrow Kard.
Precise and Straightforward. For those that seek to make a statement while being clear and concise. Straight as an arrow.";
rlm@47:
rlm@47: descHash.lines_acrylic_clear =
rlm@47: "The Direct Kard.
Thorough and Distinct. For those that aim to demonstrate their professionalism with style. Push the envelope. Be Direct.";
rlm@47:
rlm@51: color = 'fefefe';
rlm@47:
rlm@47:
rlm@47:
rlm@47:
rlm@47: function pokedex(target)
rlm@47: {
rlm@47:
rlm@47:
rlm@47: var description = eval ("descHash." + target);
rlm@47:
rlm@47: document.getElementById('pokedex').innerHTML = description;
rlm@47:
rlm@47: }
rlm@29:
rlm@29:
rlm@44:
rlm@44: function stabForm(ID)
rlm@42: {
rlm@44: var JSONtext = document.getElementById('formValues').innerHTML;
rlm@44: var hash = new Object();
rlm@44: hash = eval('(' + JSONtext + ')');
rlm@44:
rlm@44: propertyValue = document.getElementById(ID).value;
rlm@44: propertyName = ID;
rlm@44: propertyValue = escape(propertyValue);
rlm@44:
rlm@44: eval("hash."+propertyName+"='"+propertyValue+"'");
rlm@42:
rlm@44: var JSONtext = document.getElementById('formValues').innerHTML = JSON.stringify(hash);
rlm@44: }
rlm@44:
rlm@44:
rlm@44:
rlm@44: function getPosition(style, field)
rlm@44: {
rlm@44:
rlm@44: var cardType = eval ("laserkard." + style);
rlm@44:
rlm@44:
rlm@44: if ( eval("typeof cardType." + field + " != 'undefined'")) //shouldn't ever really matter
rlm@44: {
rlm@44: values = eval("cardType." + field);
rlm@44:
rlm@44: if (typeof values.posx != 'undefined'){posx = values.posx;}
rlm@44: if (typeof values.posy != 'undefined'){posy = values.posy;}
rlm@44: if (typeof values.center != 'undefined'){center = values.center;}
rlm@44: if (typeof values.font != 'undefined'){font = values.font;}
rlm@48: if (typeof values.face != 'undefined'){face = values.face;}
rlm@48: if (typeof values.width != 'undefined'){width = values.width;}
rlm@44: if (typeof values.weirdFlip != 'undefined'){weirdFlip = values.weirdFlip;}
rlm@48: if (typeof values.resize != 'undefined'){resize = values.resize;}
rlm@44: }
rlm@44:
rlm@44:
rlm@44: }
rlm@44:
rlm@51: //~ function smallRedraw(style,field)
rlm@51: //~ {
rlm@51: //~ //smallRedraw(style,field,"fefefe");
rlm@51: //~ sRedraw(style,field,'fefefe');
rlm@51: //~ }
rlm@44:
rlm@44:
rlm@44: function smallRedraw(style,field)
rlm@44: {
rlm@51:
rlm@44: var JSONtext = document.getElementById('formValues').innerHTML;
rlm@44: var hash = new Object();
rlm@44: hash = eval('(' + JSONtext + ')');
rlm@44:
rlm@44: var content = eval("hash."+field);
rlm@44:
rlm@44: content = unescape(content);
rlm@44:
rlm@51: //if (prevVal == content){return;}
rlm@51:
rlm@51: contentRedraw(style,field, content);
rlm@51:
rlm@51:
rlm@51: }
rlm@51:
rlm@51:
rlm@51:
rlm@51: function contentRedraw(style,field, content)
rlm@51: {
rlm@51:
rlm@51: //var color = color;
rlm@51:
rlm@51:
rlm@51:
rlm@48:
rlm@44: posx = 10;
rlm@44: posy = 10;
rlm@44: center = 0;
rlm@44: font = 10;
rlm@44: face = 700;
rlm@44: weirdFlip = 0;
rlm@48: resize = 1;
rlm@48: width = 450;
rlm@44:
rlm@44: getPosition(style, field);
rlm@44:
rlm@48:
rlm@48:
rlm@48:
rlm@44: target = "d_" + field;
rlm@44:
rlm@44:
rlm@44: var whatev = eval("typeof " + target + " != 'undefined'")
rlm@44:
rlm@44: if (whatev){eval ("{" + target + ".remove();}");}
rlm@44:
rlm@44: eval ( target + " = raphe.print(posx, posy, content , raphe.getFont('HelveticaNeue', face), font);" );
rlm@44:
rlm@48:
rlm@48: var sizzle = eval(target+".getBBox().width;");
rlm@48:
rlm@48: document.getElementById('output').innerHTML = sizzle;
rlm@48:
rlm@48:
rlm@48: if (resize == 1)
rlm@48:
rlm@48: {
rlm@48:
rlm@48:
rlm@48:
rlm@48:
rlm@48: //base case
rlm@48: if ((sizzle) > width)
rlm@48: {
rlm@48:
rlm@48: mul = .9;
rlm@48:
rlm@48:
rlm@48: mul = (width/sizzle);
rlm@48:
rlm@48:
rlm@48: font = font * mul;
rlm@48:
rlm@48: //eval( target + ".scale(mul,mul)" );
rlm@48:
rlm@48: eval ( target + ".remove();");
rlm@56: eval ( target + " = raphe.print(posx, posy, content , raphe.getFont('HelveticaNeue', face), font);" );
rlm@48:
rlm@48:
rlm@48: }
rlm@48:
rlm@48:
rlm@48:
rlm@48: }
rlm@61:
rlm@61:
rlm@61: var targetFont = 2.3 *font/385.16 + 2.3*0.311;
rlm@61:
rlm@61: if (font <25)
rlm@61: {
rlm@61:
rlm@61: targetFont = targetFont * 0.75;
rlm@61:
rlm@61: }
rlm@61:
rlm@61:
rlm@61: eval ( target +".attr('stroke-width', targetFont);");
rlm@56: //eval ( target +".attr('stroke-width', font/385.16 + 0.311);");
rlm@48:
rlm@48: var sizzle = eval(target+".getBBox().width;");
rlm@48:
rlm@48: document.getElementById('output').innerHTML = sizzle;
rlm@48:
rlm@51: eval ( target +".attr('stroke', '#" + color + "');");
rlm@48: //eval ( target +".attr('stroke', '#fbafcd');");
rlm@48:
rlm@44: eval ( target +".attr('fill', 'none');");
rlm@44:
rlm@44:
rlm@48:
rlm@48:
rlm@44: if (center == 1)
rlm@44: {
rlm@44: eval ("var c = " + target+".getBBox().width; " + target + ".translate((485 - c)/2,0);");
rlm@44: }
rlm@44:
rlm@44:
rlm@44: if (weirdFlip == 1)
rlm@44: {
rlm@44: eval("var c = "+target+".getBBox().width;");
rlm@44: eval(target+ ".translate((317 - c)/2,0);");
rlm@44: eval(target+".translate(0, -490);");
rlm@44: eval(target+".rotate(90,0,0);");
rlm@44: }
rlm@44:
rlm@44:
rlm@44:
rlm@48: prevVal = content;
rlm@48:
rlm@44:
rlm@44:
rlm@44: }
rlm@44:
rlm@44: function clearAll()
rlm@44: {
rlm@44: if(typeof d_Name != 'undefined' ){d_Name.remove();}
rlm@44: if(typeof d_Company != 'undefined' ){d_Company.remove();}
rlm@44: if(typeof d_Email != 'undefined' ){d_Email.remove();}
rlm@44: if(typeof d_Occupation != 'undefined' ){d_Occupation.remove();}
rlm@44: if(typeof d_Phone != 'undefined' ){d_Phone.remove();}
rlm@44: if(typeof d_Website != 'undefined' ){d_Website.remove();}
rlm@44:
rlm@44: if(typeof d_lineArt != 'undefined' ){d_lineArt.remove();}
rlm@42: }
rlm@42:
rlm@51:
rlm@51: function lineDraw(style, color)
rlm@51: {
rlm@51:
rlm@51:
rlm@51:
rlm@51:
rlm@51:
rlm@51: if (style == "bold")
rlm@51: {return;}
rlm@51:
rlm@51:
rlm@51:
rlm@51: if (style == "arrow")
rlm@51: {
rlm@51: d_lineArt = raphe.path("M 4 272 L 258 272");
rlm@51: d_lineArt.attr('stroke', "#" + color);
rlm@51: return;
rlm@51: }
rlm@51:
rlm@51:
rlm@51: if (style == "classic")
rlm@51: {return;}
rlm@51:
rlm@51:
rlm@51: if (style == "direct")
rlm@51: {
rlm@51: 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@51: d_lineArt.attr('stroke', "#" + color);
rlm@51: return;
rlm@51: }
rlm@51:
rlm@51: }
rlm@51:
rlm@51:
rlm@51:
rlm@42: function redraw(style)
rlm@42: {
rlm@42:
rlm@43:
rlm@43:
rlm@43:
rlm@42: if (style == "bold")
rlm@42: {
rlm@42:
rlm@44: clearAll();
rlm@44: smallRedraw("bold","Name");
rlm@44: smallRedraw("bold","Email");
rlm@42:
rlm@42:
rlm@42:
rlm@42: }
rlm@42:
rlm@42:
rlm@42: if (style == "arrow")
rlm@42: {
rlm@42:
rlm@44: clearAll();
rlm@42:
rlm@44: smallRedraw("arrow","Name");
rlm@44: smallRedraw("arrow","Email");
rlm@44: smallRedraw("arrow","Occupation");
rlm@44: smallRedraw("arrow","Company");
rlm@42:
rlm@43:
rlm@42: }
rlm@42:
rlm@42:
rlm@42: if (style == "classic")
rlm@42: {
rlm@42:
rlm@44: clearAll();
rlm@42:
rlm@44: smallRedraw("classic","Name");
rlm@44: smallRedraw("classic","Email");
rlm@44: smallRedraw("classic","Occupation");
rlm@44: smallRedraw("classic","Company");
rlm@44: smallRedraw("classic","Phone");
rlm@44: smallRedraw("classic","Website");
rlm@42: }
rlm@42:
rlm@42:
rlm@42: if (style == "direct")
rlm@42: {
rlm@42:
rlm@44: clearAll();
rlm@42:
rlm@44: smallRedraw("direct","Name");
rlm@44: smallRedraw("direct","Email");
rlm@44: smallRedraw("direct","Occupation");
rlm@44: smallRedraw("direct","Company");
rlm@44: smallRedraw("direct","Phone");
rlm@44: smallRedraw("direct","Website");
rlm@42:
rlm@42:
rlm@42: }
rlm@42:
rlm@51: lineDraw(style, "fefefe");
rlm@42:
rlm@42:
rlm@42:
rlm@42: }
rlm@42:
rlm@42: