Changeset 38804

Show
Ignore:
Timestamp:
01/24/11 23:15:55 (2 years ago)
Author:
NeoCat
Message:

shortcutkey.js: call link() before opening links

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • websites/twicli/plugins/shortcutkey.js

    r38793 r38804  
    192192                        case 79+lower: // o : リンクを開く(Open links) 
    193193                                if (!selected) return true; 
    194                                 tw.text.replace(/https?:\/\/[\w!#$%&'()*+,.\/:;=?@~-]+(?=&\w+;)|https?:\/\/[\w!#$%&'()*+,.\/:;=?@~-]+/g, function(url){ 
    195                                         window.open(url, '_blank'); 
    196                                 }); 
    197  
     194                                for (var i = 0; i < selected.childNodes.length; i++) { 
     195                                        var target = selected.childNodes[i] 
     196                                        if (target.id && target.id.substr(0,5) == 'text-') { 
     197                                                for (i = 0; target.childNodes.length; i++) { 
     198                                                        var target2 = target.childNodes[i]; 
     199                                                        if (target2.tagName == 'A') { 
     200                                                                if (link(target2)) window_open(target2.href, "_blank"); 
     201                                                        } 
     202                                                } 
     203                                                break; 
     204                                        } 
     205                                } 
    198206                                return false; 
    199207                        case 77+lower: // m : 発言欄へ移動(Move to textarea)