Changeset 17177

Show
Ignore:
Timestamp:
08/07/08 00:07:00 (5 years ago)
Author:
hoge1e3
Message:
 
Location:
lang/actionscript/todoshare
Files:
4 added
2 modified

Legend:

Unmodified
Added
Removed
  • lang/actionscript/todoshare/nohada.cgi

    r17117 r17177  
    3838var sugs=[]; 
    3939function 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    
    5040  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            }); 
    5757  }; 
    5858} 
     
    6060   sugs[id]= new Suggest.Local( 
    6161             id, id+"_suggest",[id,id+"!"], 
    62              {dispAllKey: true, ajaxAction: doSearch(id)});    
     62             {dispAllKey: true, ajaxAction: doSearch(id), prefix:true});    
    6363}  
    6464var start = function(){ 
     
    8181      $("val").value=""; 
    8282} 
    83  
     83var stat="red"; 
     84function debugFlash() { 
     85   if (stat=="red") stat="yellow"; else stat="red"; 
     86   $("flash").color=stat; 
     87} 
    8488window.addEventListener ? 
    8589  window.addEventListener('load', start, false) : 
     
    110114      [button(onClick=>"clearForm(this)"),"Clear"], 
    111115      [div(id=>"test"),"test"], 
    112       [span(id=>"console")] 
     116      [font(id=>"flash"),"●"], 
     117      [span(id=>"console"),""] 
    113118    ]] 
    114119  ] 
  • lang/actionscript/todoshare/suggest.js

    r17117 r17177  
    4646    this.suggestArea = this._getElement(suggestArea); 
    4747    this.candidateList = candidateList; 
    48     this.oldText = this.getInputText(); 
     48    this.oldText = "XXXXXX";//this.getInputText(); 
    4949 
    5050    if (arguments[3]) this.setOptions(arguments[3]); 
     
    9898    var text = this.getInputText(); 
    9999    var t=this; 
     100    //debugFlash(); 
    100101    var nextTimer=function () { 
    101102       if (t.timerId) clearTimeout(t.timerId); 
     
    104105    if (text != this.oldText) { 
    105106      this.oldText = text; 
    106       print ("starts? "+text.startsWith(this.ajaxArg)); 
     107      //print ("starts? "+text+" "+this.ajaxArg+" "+text.startsWith(this.ajaxArg)); 
    107108      if (this.ajaxAction==null || 
    108109          (this.ajaxArg!=null && text.startsWith(this.ajaxArg))  ) { 
     
    116117             t.candidateList=result; 
    117118             t.ajaxArg = text; 
    118              print ("Set ajaxArg = "+ t.ajaxArg); 
    119119             t.search(); 
    120120             if (result.length>t.dispMax) t.ajaxArg=null; 
     121             //print ("Set ajaxArg = "+ t.ajaxArg+" reslen="+result.length+" max="+t.dispMax); 
    121122             nextTimer.apply(t,[]); 
    122123           } catch(e) {print (e);} 
    123124         });   
    124125      } 
    125     } 
     126    } else {    nextTimer.apply(this,[]); } 
    126127  }, 
    127128 
     
    133134    var text = this.getInputText(); 
    134135 
    135     if (text == '' || text == null) return; 
     136    if (/*text == '' ||*/ text == null) return; 
    136137 
    137138    this.hookBeforeSearch(text);