Show
Ignore:
Timestamp:
11/29/08 00:17:56 (6 weeks ago)
Author:
teramako
Message:

follow CVS HEAD

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/tombloo.js

    r22324 r25285  
    4444commands.addUserCommand(['tomblooAction'],'Execute Tombloo actions', 
    4545    function(arg){ 
    46         TomblooService.Tombloo.Service.actions[arg].execute(); 
     46        TomblooService.Tombloo.Service.actions[arg.string].execute(); 
    4747    },{ 
    48         completer: function(filter){ 
    49             var completionList = new Array(); 
    50             for(let name in TomblooService.Tombloo.Service.actions) 
    51                 if(name.indexOf(filter) > -1) 
    52                     completionList.push([name,name]); 
    53             return [0,completionList]; 
     48        completer: function(context){ 
     49                        context.title = ['Tombloo Actions']; 
     50                        context.completions = [[name,name] for(name in TomblooService.Tombloo.Service.actions)].filter(function($_){ 
     51                                return this.test($_[0]); 
     52                        }, new RegExp(context.filter, 'i')); 
    5453        } 
    5554    } 
     
    6160    },{ 
    6261        bang: true, 
    63         completer: function(filter){ 
     62        completer: function(context){ 
    6463            var completionList = new Array(); 
    6564            var exts = TomblooService.Tombloo.Service.check(getContext()); 
    66             for(let i=0,l=exts.length; i < l; i++) 
    67                 if(exts[i].name.indexOf(filter) > -1) 
    68                     completionList.push([exts[i].name,exts[i].name]); 
    69             return [0,completionList]; 
     65                        context.title = ['Tombloo']; 
     66                        context.completions = [[exts[i].name, exts[i].name] for(i in exts)].filter(function($_) this.test($_[0]), new RegExp(context.filter, 'i')) 
    7067        } 
    7168    }