Changeset 30391

Show
Ignore:
Timestamp:
02/21/09 00:39:27 (4 years ago)
Author:
arccosine
Message:

もう少しスマート(?)な方式でキーバインド。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/a_bit_bad_rtm_for_opera.user.js

    r30390 r30391  
    207207    }; 
    208208 
    209     var pressKey = ev.which; 
    210     pressKey = String.fromCharCode(pressKey); 
    211  
    212     if( typeof handler[pressKey] == "function" ){ 
    213         var t=ev.target; 
    214         var n=t.tagName.toLowerCase(); 
    215         if( t.nodeType != 1 || n == "input" || n == "textarea"  ){ 
    216             return true; 
    217         } 
    218         handler[pressKey].apply(); 
    219         return false; 
    220     } 
    221     return true; 
     209    var t=ev.target; 
     210    var n=t.tagName.toLowerCase(); 
     211    if( t.nodeType != 1 || n == "input" || n == "textarea" ){ 
     212        return true; 
     213    } 
     214 
     215    var pressKey = String.fromCharCode(ev.which); 
     216    if( typeof handler[pressKey] != "function" ){ 
     217        return true; 
     218    } 
     219 
     220    handler[pressKey].apply(); 
     221    return false; 
    222222} 
    223223