Mercurial > laserkard
view onlypaths/js/features_mini.js @ 76:781127893010 laserkard
made card text filled in
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Wed, 14 Jul 2010 13:44:42 -0400 |
parents | 26c2b3ad21c7 |
children |
line wrap: on
line source
1 var initialPage=[];2 var getPage = document.location.hash.replace("#","");3 if(getPage!=''){initialPage=getPage; }5 var myOPF, myOPF1;8 function loadDemo(){9 if(getPage!='')10 {11 document.getElementById("code").value= initialPage;12 load(Ext.util.JSON.decode(document.forms[0].code.value),c);14 }15 if(getPage=='')16 {18 chargeFile(initialFile);19 setTimeout("Draw()",2000);21 //load( [{type:"doc", left:0, top:0, width:160, height:160, viewBox:"0 0 160 160"}, {"id":"shape:567398b2-3763-cc53-678a-e74d1d5d7569","type":"rect","transform":"","fillColor":"#d5d4d4","lineColor":"none","fillOpac":1,"lineOpac":1,"lineWidth":1,"left":-8,"top":-4,"width":170,"height":169},{"id":"shape:0cc9fd3c-6518-31e7-1dd9-ac3f03f334f9","type":"ellipse","transform":"","fillColor":"#ff0000","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"width":17.5,"height":22,"left":18.5,"top":95},{"id":"shape:91592290-f1a8-8bb1-30b9-8a1856f29375","type":"path","transform":"","fillColor":"#555500","lineColor":"none","fillOpac":1,"lineOpac":1,"lineWidth":1,"points":"M5,112 L6,112 L11,112 L17,112 L25,112 L34,113 L38,113 L39,113 L40,113 L43,113 L47,113 L51,113 L52,113 L54,114 L59,114 L66,114 L73,113 L83,111 L85,111 L87,111 L92,111 L100,111 L107,111 L108,111 L111,111 L115,112 L116,112 L123,112 L131,113 L140,113 L146,113 L146,114 L146,115 L147,116 L149,118 L150,120 L150,122 L148,126 L145,128 L143,130 L143,131 L143,134 L141,136 L139,138 L135,140 L131,142 L127,144 L125,145 L121,145 L117,145 L115,145 L109,145 L102,145 L99,146 L96,147 L93,148 L89,149 L84,149 L80,150 L76,151 L73,151 L72,151 L71,151 L68,150 L66,148 L64,147 L58,146 L52,145 L46,145 L44,145 L43,145 L42,144 L41,143 L40,143 L37,143 L32,143 L29,143 L27,143 L25,143 L24,143 L23,143 L22,143 L21,143 L18,143 L16,143 L14,143 L13,143 L11,143 L10,143 L9,143 L8,143 L7,143 L6,143 L5,143 L4,143 L3,143 L4,143 L5,143 L6,143 z"},{"id":"shape:607f960c-6341-b01a-a000-692d153e6bc7","type":"text","transform":"","textFamily":"Arial","textSize":28,"top":137.922,"left":62,"text":"Robot 45","lineWidth":1,"fillColor":"#00daff","lineColor":"none","fillOpac":1,"lineOpac":1},{"id":"shape:aeb8f11c-5800-2feb-e3df-33139c1c070f","type":"rect","transform":"","fillColor":"#d5d4d4","lineColor":"none","fillOpac":1,"lineOpac":1,"lineWidth":1,"left":-2,"top":6,"width":6,"height":10},{"id":"shape:2b66c634-20de-49cc-501e-c2dd34ed072f","type":"ellipse","transform":"","fillColor":"#ff0000","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"width":39,"height":34.5586,"left":53,"top":83.58269999999999},{"id":"shape:72ac0941-f863-abd4-1859-0a90e75d9f86","type":"ellipse","transform":"","fillColor":"#aaaaaa","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"width":15,"height":12,"left":64,"top":94},{"id":"shape:8e937ef4-b625-9b54-a8d9-3f9db5391b29","type":"roundrect","transform":"rotate(-9.46232, 60, 85)","fillColor":"#808080","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"rx":20,"ry":20,"left":28,"top":71,"width":64,"height":28},{"id":"shape:03156a09-0646-b0cf-00d2-7a0dc4cb6300","type":"ellipse","transform":"","fillColor":"#ff0000","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"width":39,"height":35,"left":81,"top":83},{"id":"shape:fc34042d-ab37-df13-0405-dae6ec9bb3bb","type":"rect","transform":"","fillColor":"#aaaaaa","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"left":25.318,"top":85.7556,"width":16,"height":15},{"id":"shape:85289780-3df2-86f2-9aae-f189399120df","type":"rect","transform":"","fillColor":"#ff0000","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"left":16.318,"top":85.7556,"width":16,"height":15},{"id":"shape:e054d647-771a-5b58-4cd0-68514c515be7","type":"rect","transform":"","fillColor":"#ff0000","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"left":58.318,"top":59.7556,"width":16,"height":15},{"id":"shape:d9e5c336-4953-9ce5-9ecb-728c966350a4","type":"rect","transform":"","fillColor":"#aaaaaa","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"left":65.318,"top":59.7556,"width":16,"height":15},{"id":"shape:0dba98fe-95ad-b2df-5796-364664bf50fb","type":"line","transform":"","fillColor":"#ff0000","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"left":68,"top":59.7556,"width":0,"height":-25.7556},{"id":"shape:4f25051b-348d-82c6-3d3a-dc858d4671b9","type":"ellipse","transform":"","fillColor":"#aaaaaa","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"width":15,"height":12,"left":93,"top":95},{"id":"shape:6cc4981f-ed54-8300-7db2-f63b5e3efdb3","type":"ellipse","transform":"","fillColor":"#aaaaaa","lineColor":"#000000","fillOpac":1,"lineOpac":1,"lineWidth":1,"width":4,"height":3,"left":25,"top":105}]22 //,c);23 }else{25 }27 }29 function Draw()30 {31 load(myOPF,c);32 }34 function loadContent(source)35 {36 var myOPF;37 eval("myOPF="+source);38 return myOPF;39 }40 function chargeFile(fname)41 {42 var xhr=createXHR();43 xhr.open("GET", fname,true);44 xhr.onreadystatechange=function()45 {46 if (xhr.readyState == 4)47 {48 if (xhr.status != 404)49 {50 //myOPF=loadContent(xhr.responseText);51 myOPFstr=xhr.responseText;52 myOPF=loadContent(xhr.responseText);53 //document.getElementById("source").innerHTML =xhr.responseText;55 }56 else57 {58 //document.getElementById("source").innerHTML = fname + " not found";60 }61 }62 }63 xhr.send(null);64 }66 function createXHR()67 {68 var request = false;69 try {70 request = new ActiveXObject('Msxml2.XMLHTTP');71 }72 catch (err2) {73 try {74 request = new ActiveXObject('Microsoft.XMLHTTP');75 }76 catch (err3) {77 try {78 request = new XMLHttpRequest();79 }80 catch (err1)81 {82 request = false; alert('no no')83 }84 }85 }86 return request;87 }