Changeset 16259 for lang/actionscript
- Timestamp:
- 07/24/08 22:55:25 (4 months ago)
- Location:
- lang/actionscript/todoshare
- Files:
-
- 1 added
- 4 modified
-
jsonDB.html (modified) (1 diff)
-
nohada.cgi (modified) (2 diffs)
-
perl/HtmlTag.pm (modified) (1 diff)
-
perl/Obj.pm (modified) (1 diff)
-
suggest.js (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/todoshare/jsonDB.html
r16061 r16259 13 13 //alert(httpObj); 14 14 //alert(httpObj.responseText); 15 // $("res").value=httpObj.responseText.evalJSON( ); 15 16 $("res").value=httpObj.responseText; 17 16 18 }, 17 19 onFailure:function(httpObj) { -
lang/actionscript/todoshare/nohada.cgi
r16147 r16259 13 13 my $scr=<<'EOF'; 14 14 15 function test() { 16 alert("aho"); 15 function doFocus(target) { 16 var tName=target.id; 17 var val=function (name) { 18 return (name==tName?["*"]:["like",$(name).value+"%"]); 19 } 20 var list=[ 21 "FINDREL" , 22 val("obj"), 23 val("name"), 24 val("val") 25 ]; 26 27 $("test").innerHTML=Object.toJSON(list); 28 get(list,function(data) { 29 var cand=data.map(function (e) { 30 return e[tName]; 31 }).sort().uniq(); 32 $("test").innerHTML=cand.length; 33 if (cand.length==1) {$(tName).value=cand[0];} 34 else {sugs[tName].candidateList=cand;} 35 }); 36 } 37 function get(cmd,onComplete) { 38 new Ajax.Request("db.cgi", { 39 method: "put", 40 parameters: 'cmd='+encodeURI(Object.toJSON(cmd)) , 41 onSuccess:function(httpObj){ 42 //alert(httpObj); 43 //alert(httpObj.responseText); 44 try { 45 onComplete( httpObj.responseText.evalJSON() ); 46 } catch(e) {$("test").innerHTML=e;} 47 //$("test").innerHTML=httpObj.responseText; 48 49 }, 50 onFailure:function(httpObj) { 51 $("test").innerHTML=httpObj.responseText; 52 } 53 }); 17 54 } 18 55 56 var sugs=[]; 57 function init(id) { 58 sugs[id]= new Suggest.Local( 59 id, id+"_suggest",[id,id+"!"], 60 {dispAllKey: true}); 61 } 62 var start = function(){ 63 init("obj"); 64 init("name"); 65 init("val"); 66 }; 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 }; 78 window.addEventListener ? 79 window.addEventListener('load', start, false) : 80 window.attachEvent('onload', start); 81 19 82 EOF 83 my $style=<<'EOF'; 84 div.suggest { 85 position: absolute; 86 background-color: #FFFFFF; 87 border: 1px solid #CCCCFF; 88 font-size: 90%; 89 width: 200px; 90 } 91 div.select{ /* キー上下で選択した場合のスタイル */ 92 color: #FFFFFF; 93 background-color: #3366FF; 94 } 95 div.over{ /* マウスオーバ時のスタイル */ 96 background-color: #99CCFF; 97 } 98 EOF 99 20 100 21 101 &Html::p( … … 23 103 [head, 24 104 [title,"のはだ"], 25 [script(src=>"prototype.js")], 105 script(src=>"prototype.js"), 106 script(src=>"suggest.js"), 26 107 [script,$scr], 108 [style,$style], 27 109 ], 28 110 [body,[center, 29 [table, 30 [&tr, 31 [td,input(type=>"text",name=>"obj",size=>50),"の"], 32 ],"\n", 33 [&tr, 34 [td,input(type=>"text",name=>"name",size=>50),"は"], 35 ],"\n", 36 [&tr, 37 [td,input(type=>"text",name=>"val",size=>50),"だ"], 38 ],"\n", 39 ], 40 [button(onClick=>"test()"),"OK"], 111 [table,"\n", 112 &area("obj","の"),"\n", 113 &area("name","は"),"\n", 114 &area("val","だ"),"\n", 115 ],"\n", 116 [button(onClick=>"test()"),"OK"],[div(id=>"test"),"test"] 41 117 ]] 42 118 ] 43 119 ); 120 121 sub area { 122 my ($id,$tail)=@_; 123 [&tr, 124 [td, 125 input(id=>$id,type=>"text",name=>$id,size=>50 126 ,onFocus=>"doFocus(this)", autocomplete=>"off" ), 127 $tail, 128 div(id=>"$id\_suggest",class=>"suggest")] 129 ]; 130 } 131 -
lang/actionscript/todoshare/perl/HtmlTag.pm
r16061 r16259 227 227 sub s { closure q(s),@_;} 228 228 sub samp { closure q(samp),@_;} 229 sub script { closure q(script),@_;} 229 sub script {my %params=@_; sub { 230 my $t=shift; 231 $t->out("<script "); 232 while (my ($k,$v)= each %params) { 233 $t->out(&stream::sym($k)."=".&stream::attr($v)." " ); 234 } 235 if (@_>0) { 236 $t->out(">\n//<!--\n"); 237 for (@_) { 238 $t->out($_); 239 } 240 $t->out("\n//-->\n</script>"); 241 } else { 242 $t->out("></script>"); 243 } 244 }; 245 } 230 246 sub select { closure q(select),@_;} 231 247 sub server { closure q(server),@_;} -
lang/actionscript/todoshare/perl/Obj.pm
r16091 r16259 372 372 my @res; 373 373 while (my ($k,$v)=each %{$w}) { 374 next if (&isAny($v)); 374 375 push @res, &whereElem($k,$v); 375 376 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)