Changeset 16425 for lang/actionscript
- Timestamp:
- 07/25/08 20:51:33 (4 months ago)
- Location:
- lang/actionscript/todoshare
- Files:
-
- 3 modified
-
index.cgi (modified) (1 diff)
-
nohada.cgi (modified) (3 diffs)
-
perl/Obj.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/todoshare/index.cgi
r16061 r16425 16 16 [h1,"メニュー"], 17 17 link("todo.cgi","Todo"), 18 link("nohada.cgi","のはだ"), 18 19 link("swkText.cgi","SWK(Text Mode)"), 19 20 link("DBConsoleFlash.html","SWK(Flash Mode)"), -
lang/actionscript/todoshare/nohada.cgi
r16259 r16425 26 26 27 27 $("test").innerHTML=Object.toJSON(list); 28 get(list,function(data) {28 db(list,function(data) { 29 29 var cand=data.map(function (e) { 30 30 return e[tName]; 31 31 }).sort().uniq(); 32 $("test").innerHTML=cand.length;32 print(cand.join(", ")); 33 33 if (cand.length==1) {$(tName).value=cand[0];} 34 34 else {sugs[tName].candidateList=cand;} 35 35 }); 36 36 } 37 function get(cmd,onComplete) {37 function db(cmd,onComplete) { 38 38 new Ajax.Request("db.cgi", { 39 39 method: "put", 40 40 parameters: 'cmd='+encodeURI(Object.toJSON(cmd)) , 41 41 onSuccess:function(httpObj){ 42 //alert(httpObj);43 //alert(httpObj.responseText);44 42 try { 45 43 onComplete( httpObj.responseText.evalJSON() ); 46 } catch(e) {$("test").innerHTML=e;} 47 //$("test").innerHTML=httpObj.responseText; 48 44 } catch(e) {print(e);} 49 45 }, 50 46 onFailure:function(httpObj) { 51 $("test").innerHTML=httpObj.responseText;47 print (httpObj.responseText); 52 48 } 53 49 }); 50 } 51 function print(c) { 52 $("test").innerHTML=c; 54 53 } 55 54 … … 65 64 init("val"); 66 65 }; 67 function () { 68 var suggest = new Suggest.LocalMulti("obj", "suggest", 69 list[0/*document.getElementById('select').selectedIndex*/], {dispAllKey: true}); 70 /*var select = document.getElementById('select') 71 var change = function(){ 72 suggest.candidateList = list[select.selectedIndex]; 73 }; 74 select.addEventListener ? 75 select.addEventListener('change', change, false) : 76 select.attachEvent('onchange', change);*/ 77 }; 66 function exe() { 67 db(["MAKEREL", 68 $("obj").value, 69 $("name").value, 70 $("val").value],function (res) { 71 print (Object.toJSON(res)); 72 clearForm(); 73 }); 74 } 75 function clearForm(target) { 76 $("obj").value=""; 77 $("name").value=""; 78 $("val").value=""; 79 } 80 78 81 window.addEventListener ? 79 82 window.addEventListener('load', start, false) : … … 114 117 &area("val","だ"),"\n", 115 118 ],"\n", 116 [button(onClick=>"test()"),"OK"],[div(id=>"test"),"test"] 119 [button(onClick=>"exe(this)"),"OK"], 120 [button(onClick=>"clearForm(this)"),"Clear"], 121 [div(id=>"test"),"test"] 117 122 ]] 118 123 ] -
lang/actionscript/todoshare/perl/Obj.pm
r16259 r16425 318 318 return array($res); 319 319 } elsif ($cmd->[0] eq 'MAKEREL') { 320 my $res=&exe( ["FINDREL",$cmd->[1],$cmd->[2],$cmd->[3]] ); 321 if (@$res>0) { 322 return ["EXISTS"]; 323 } 320 324 return &exe(["INSERT",$relName, { 321 325 obj => $cmd->[1], … … 326 330 # ["FINDREL", obj , name ] 327 331 my $where={}; 328 $where->{obj} = $cmd->[1] if ($cmd->[1] and $cmd->[1] ne &any);329 $where->{name}= $cmd->[2] if ($cmd->[2] and $cmd->[2] ne &any);330 $where->{val} = $cmd->[3] if ($cmd->[3] and $cmd->[3] ne &any);332 $where->{obj} = $cmd->[1] if ($cmd->[1] and not &isAny($cmd->[1])); 333 $where->{name}= $cmd->[2] if ($cmd->[2] and not &isAny($cmd->[2])); 334 $where->{val} = $cmd->[3] if ($cmd->[3] and not &isAny($cmd->[3])); 331 335 return &exe(["GET", { 332 336 from=> $relName,
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)