Changeset 17005 for lang/actionscript
- Timestamp:
- 08/03/08 08:50:56 (4 months ago)
- Location:
- lang/actionscript/todoshare
- Files:
-
- 4 modified
-
js/common.js (modified) (3 diffs)
-
js/tag.js (modified) (3 diffs)
-
netacho.html (modified) (3 diffs)
-
test/scriptTest.html (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/todoshare/js/common.js
r16972 r17005 6 6 onSuccess:function(httpObj){ 7 7 try { 8 onComplete.apply(env, httpObj.responseText.evalJSON() ); 9 } catch(e) {print(e);} 8 print ("Applying: "+onComplete); 9 onComplete.apply(env, [httpObj.responseText.evalJSON()] ); 10 print ("Applyed"); 11 } catch(e) {handleError(e);} 10 12 }, 11 13 onFailure:function(httpObj) { 12 print(httpObj.responseText);14 handleError(httpObj.responseText); 13 15 } 14 16 }); 15 17 } 16 18 function dbPut(query,after) { 17 db(["INSERT3",query],after); 19 db.apply(this,[["INSERT3",query],function (res) { 20 query.id=res[1]; 21 after.apply(this,arguments); 22 }]); 18 23 } 19 24 dbPut.async=true; 20 25 function dbGet(query,after) { 21 db (["GET3",query],after);26 db.apply(this,[["GET3",query],after]); 22 27 } 23 28 dbGet.async=true; 29 function dbDel(id,after) { 30 db.apply(this,[["DELETE2",id],after]); 31 } 32 dbDel.async=true; 24 33 25 34 Function.prototype.then=function (n) { … … 40 49 else app+=e; 41 50 } 51 app+=" "; 42 52 }); 43 53 var c=$("console"); … … 47 57 } else {alert(app);} 48 58 } 59 var handleError=print; 49 60 function link2obj(id) { 50 61 var href=encodeURI(id); -
lang/actionscript/todoshare/js/tag.js
r16713 r17005 14 14 return res; 15 15 } 16 elemObj(target, a);16 return elemObj(target, a); 17 17 } 18 18 19 19 function elemStr(target, s) { 20 20 //alert("Str : "+s); 21 target.appendChild (document.createTextNode(s)); 21 var res=document.createTextNode(s) 22 target.appendChild (res); 23 return res; 22 24 } 23 25 function elemArray(target, a) { … … 34 36 } 35 37 target.appendChild(e); 38 return e; 36 39 } 37 40 function elemObj(target,o) { … … 39 42 if (i.match(/^on/)) { 40 43 if (target.addEventListener) { 41 target.addEventListener(i.substring(2) ,o[i],false);44 target.addEventListener(i.substring(2).toLowerCase(),o[i],false); 42 45 } else { 43 46 target.attachEvent(i,o[i]); -
lang/actionscript/todoshare/netacho.html
r16972 r17005 1 <html> 1 <html> 2 <head> 3 <meta http-equiv="Content-type" content="text/html; charsrt=utf-8"> 2 4 <title>一行ネタ帳</title> 3 <script src="prototype.js"/> 4 <script src="js/common.js"/> 5 <script src="prototype.js"/> 5 <script src="prototype.js"></script> 6 <script src="js/common.js"></script> 7 <script src="js/jsonScr.js"></script> 8 <script src="js/tag.js"></script> 6 9 <script> 7 except=function(e) { print("Error - "); } 8 function add() { 10 except=function(e) { print("Error - ",e); }; 11 12 function addn() { 13 print ("Addn neta"); 9 14 var qo={class:"Neta", content:$("neta").value}; 10 15 var holder=printNeta(qo.content); … … 14 19 ); 15 20 } 16 function rmHodler(holder) { 17 $("list").removeElement(holder); 21 function rmHolder(holder) { 22 //print ("rming"); 23 $("list").removeChild(holder); 18 24 } 19 25 function neta1(holder,qo) { 26 //print ("Add neta ",qo,qo.content); 20 27 holder.innerHTML=""; 21 28 var del=compile( … … 25 32 elem(holder,[ 26 33 "span", 27 " id= ", qo.id ,28 " content =", qo.content ,34 " id= ", qo.id , 35 " content= ", qo.content , 29 36 ["button",{onClick: del},"削除"],["br"] 30 37 ]); 31 38 } 32 39 function each(func,ary) { 40 print ("Each"+func); 33 41 if(ary==null) ary=this._; 34 42 ary.each(func); 35 43 } 36 44 function listAll() { 45 alert("COMP");return; 37 46 var qo={class:"Neta", content:["*"]}; 38 progn(47 var c=compile( 39 48 [dbGet,qo], 40 49 [each,function (neta) { 41 var holder=printNeta(""); 42 neta1(holder,neta); 50 print (neta); 51 // var holder=printNeta(""); 52 // neta1(holder,neta); 43 53 }] 44 54 ); 55 print ("COMP2"); 56 // c(); 45 57 } 46 47 58 function printNeta(content) { 59 return elem($("list"),["span",content,["br"]]); 60 } 61 alert(listAll); 48 62 </script> 49 <body> 63 </head> 64 <body onload="">!? 50 65 <input type=text id=neta length=50> 51 <button onClick="add ()"><HR>66 <button onClick="addn()">Add</Button><HR> 52 67 <span id="list"></span><BR> 53 <span od="console"></span>68 <span id="console"></span> 54 69 </body> 55 70 </html> -
lang/actionscript/todoshare/test/scriptTest.html
r16972 r17005 3 3 <script src="../js/jsonScr.js"></script> 4 4 <script src="../js/common.js"></script> 5 <script src="../js/tag.js"></script> 5 6 <script> 6 7 /*function a() { … … 47 48 } 48 49 _=gv("_"); 50 function a() { 51 alert(32); 52 } 49 53 function start() { 50 54 //print ("Aho =",["baka",3]); 51 55 add5=compile( 52 [testa,3, 4],53 show 56 [testa,3,5], 57 show2 54 58 ); 59 var holder=$("holder"); 60 /*var del=compile( 61 [rmHolder,holder] 62 );*/ 63 var qo={}; 64 /*elem(holder,[ 65 "span", 66 " id= ", qo.id , 67 " content= ", qo.content , 68 ["button",{onClick: add5},"DEL"],["br"] 69 ]); 70 71 elem( holder, [ 72 "span","あいう", 73 ["font",{color:"green",size:10},"えおか"], 74 function (t) { 75 elem(t,2+3); 76 }, 77 ["button",{onclick:a},"G"] 78 ]);*/ 55 79 } 56 80 … … 58 82 </head> 59 83 <body id="b" onLoad="start()"> 60 <button onclick="add5()">+</button> 84 <button onclick="add5()">+</button><BR> 85 <span id="holder">-</span> 61 86 <HR> 62 87 <span id="console">X</span>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)