Changeset 17177 for lang/actionscript
- Timestamp:
- 08/07/08 00:07:00 (4 months ago)
- Location:
- lang/actionscript/todoshare
- Files:
-
- 4 added
- 2 modified
-
Copysuggest.js (added)
-
TodoJS.html (added)
-
nohada.cgi (modified) (4 diffs)
-
suggest.js (modified) (5 diffs)
-
test/bindTest.html (added)
-
test/tmpl.html (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/todoshare/nohada.cgi
r17117 r17177 38 38 var sugs=[]; 39 39 function doSearch(tName) { 40 var val=function (name) {41 return (name==tName?["*"]:["like",$(name).value+"%"]);42 }43 var list=[44 "FINDREL" ,45 val("obj"),46 val("name"),47 val("val")48 ];49 50 40 return function (str,max,onEnd) { 51 db(list,function (data) { 52 var cand=data.map(function (e) { 53 return e[tName]; 54 }).sort().uniq(); 55 onEnd(cand); 56 }); 41 var val=function (name) { 42 return (name!=tName?["like",$(name).value+"%"]:["like",str+"%"]); 43 } 44 var list=[ 45 "FINDREL" , 46 val("obj"), 47 val("name"), 48 val("val") 49 ]; 50 //print (Object.toJSON(list)); 51 db(list,function (data) { 52 var cand=data.map(function (e) { 53 return e[tName]; 54 }).sort().uniq(); 55 onEnd(cand); 56 }); 57 57 }; 58 58 } … … 60 60 sugs[id]= new Suggest.Local( 61 61 id, id+"_suggest",[id,id+"!"], 62 {dispAllKey: true, ajaxAction: doSearch(id) });62 {dispAllKey: true, ajaxAction: doSearch(id), prefix:true}); 63 63 } 64 64 var start = function(){ … … 81 81 $("val").value=""; 82 82 } 83 83 var stat="red"; 84 function debugFlash() { 85 if (stat=="red") stat="yellow"; else stat="red"; 86 $("flash").color=stat; 87 } 84 88 window.addEventListener ? 85 89 window.addEventListener('load', start, false) : … … 110 114 [button(onClick=>"clearForm(this)"),"Clear"], 111 115 [div(id=>"test"),"test"], 112 [span(id=>"console")] 116 [font(id=>"flash"),"●"], 117 [span(id=>"console"),""] 113 118 ]] 114 119 ] -
lang/actionscript/todoshare/suggest.js
r17117 r17177 46 46 this.suggestArea = this._getElement(suggestArea); 47 47 this.candidateList = candidateList; 48 this.oldText = this.getInputText();48 this.oldText = "XXXXXX";//this.getInputText(); 49 49 50 50 if (arguments[3]) this.setOptions(arguments[3]); … … 98 98 var text = this.getInputText(); 99 99 var t=this; 100 //debugFlash(); 100 101 var nextTimer=function () { 101 102 if (t.timerId) clearTimeout(t.timerId); … … 104 105 if (text != this.oldText) { 105 106 this.oldText = text; 106 print ("starts?"+text.startsWith(this.ajaxArg));107 //print ("starts? "+text+" "+this.ajaxArg+" "+text.startsWith(this.ajaxArg)); 107 108 if (this.ajaxAction==null || 108 109 (this.ajaxArg!=null && text.startsWith(this.ajaxArg)) ) { … … 116 117 t.candidateList=result; 117 118 t.ajaxArg = text; 118 print ("Set ajaxArg = "+ t.ajaxArg);119 119 t.search(); 120 120 if (result.length>t.dispMax) t.ajaxArg=null; 121 //print ("Set ajaxArg = "+ t.ajaxArg+" reslen="+result.length+" max="+t.dispMax); 121 122 nextTimer.apply(t,[]); 122 123 } catch(e) {print (e);} 123 124 }); 124 125 } 125 } 126 } else { nextTimer.apply(this,[]); } 126 127 }, 127 128 … … 133 134 var text = this.getInputText(); 134 135 135 if ( text == '' ||text == null) return;136 if (/*text == '' ||*/ text == null) return; 136 137 137 138 this.hookBeforeSearch(text);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)