Changeset 16956

Show
Ignore:
Timestamp:
08/01/08 21:04:59 (5 years ago)
Author:
aerith
Message:

enabled to set the HTTP link target.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/mobirc/trunk/lib/App/Mobirc/Plugin/MessageBodyFilter/Clickable.pm

    r16926 r16956  
    1717    is  => 'ro', 
    1818    isa => 'Str', 
     19); 
     20 
     21has http_link_target => ( 
     22    is  => 'ro', 
     23    isa => 'Str', 
     24 
     25    default => '_blank', 
    1926); 
    2027 
     
    93100        $out = 
    94101        sprintf( 
    95             '<a href="%s%s" rel="nofollow" class="url" target="_blank">%s</a>', 
     102            '<a href="%s%s" rel="nofollow" class="url" target="%s">%s</a>', 
    96103            encode_entities($self->redirector, q(<>&")), 
    97104            $encoded_uri, 
     105            $self->http_link_target, 
    98106            $link_string ); 
    99107    } else { 
    100         $out = qq{<a href="$encoded_uri" rel="nofollow" class="url" target="_blank">$link_string</a>}; 
     108        $out = 
     109        sprintf( 
     110            '<a href="%s" rel="nofollow" class="url" target="%s">%s</a>', 
     111            $encoded_uri, 
     112            $self->http_link_target, 
     113            $link_string ); 
    101114    } 
     115 
    102116    if ( $self->au_pcsv ) { 
    103         $out .= qq{<a href="device:pcsiteviewer?url=$encoded_uri" rel="nofollow" class="au_pcsv" target="_blank">[PCSV]</a>}; 
     117        $out .= 
     118        sprintf( 
     119            '<a href="device:pcsiteviewer?url=%s" rel="nofollow" class="au_pcsv" target="%s">[PCSV]</a>', 
     120            $encoded_uri, 
     121            $self->http_link_target ); 
    104122    } 
     123 
    105124    if ( $self->pocket_hatena ) { 
    106125        $out .= 
    107126        sprintf( 
    108             '<a href="http://mgw.hatena.ne.jp/?url=%s;noimage=0;split=1" rel="nofollow" class="pocket_hatena" target="_blank">[ph]</a>', 
    109             uri_escape($uri) ); 
     127            '<a href="http://mgw.hatena.ne.jp/?url=%s;noimage=0;split=1" rel="nofollow" class="pocket_hatena" target="%s">[ph]</a>', 
     128            uri_escape($uri), 
     129            $self->http_link_target ); 
    110130    } 
    111131    if ( $self->google_gwt ) { 
    112132        $out .= 
    113133        sprintf( 
    114             '<a href="http://www.google.co.jp/gwt/n?u=%s;_gwt_noimg=0" rel="nofollow" class="google_gwt" target="_blank">[gwt]</a>', 
    115             uri_escape($uri) ); 
     134            '<a href="http://www.google.co.jp/gwt/n?u=%s;_gwt_noimg=0" rel="nofollow" class="google_gwt" target="%s">[gwt]</a>', 
     135            uri_escape($uri), 
     136            $self->http_link_target ); 
    116137    } 
    117138    return U $out; 
     
    126147    } 
    127148    return sprintf( 
    128         qq{<a href="%s" rel="nofollow" class="url" target="_blank">%s</a>}, 
     149        qq{<a href="%s" rel="nofollow" class="url" target="%s">%s</a>}, 
    129150        encode_entities($uri, q(<>&")), 
     151        $self->http_link_target, 
    130152        encode_entities($link_string, q(<>&")), 
    131153    );