Show
Ignore:
Timestamp:
11/28/08 00:37:37 (6 weeks ago)
Author:
teramako
Message:

follow CVS HEAD (fix: command argument and completer) and use util.htmlEscape

Files:
1 modified

Legend:

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

    r24351 r25155  
    1919    return result; 
    2020} 
    21 function htmlEscape(str){ 
    22     return str.replace("&","&","g") 
    23               .replace("<","&lt;","g") 
    24               .replace(">","&gt;","g"); 
    25 } 
    2621 
    2722commands.addUserCommand(['bufferecho','becho'],'Display results of JavaScript to a buffer(browser)', 
    28     function(args, special){ 
    29         liberator.plugins.buffer_echo.open(args.string, special); 
     23    function(args){ 
     24        liberator.plugins.buffer_echo.open(args.string, args.bang); 
    3025    },{ 
    31         completer: function(filter) completion.javascript(filter) 
     26        completer: function(context) completion.javascript(context) 
    3227    },true 
    3328); 
     
    4035        var result = execute(str); 
    4136        if (typeof(result) == "object") result = util.objectToString(result,true); 
    42         var data = '<div><h1>' + htmlEscape(str) + '</h1><pre>' + result + '</pre></div>'; 
     37        var data = '<div><h1>' + util.escapeHTML(str) + '</h1><pre>' + result + '</pre></div>'; 
    4338        if (buffer.title == title && !forceNewTab){ 
    4439            this.append(data);