Changeset 10016

Show
Ignore:
Timestamp:
04/20/08 22:15:10 (5 years ago)
Author:
tokuhirom
Message:

新スタイルの URL に対応漏れ。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Moxy/trunk/lib/Moxy/Plugin/LocationBar.pm

    r9973 r10016  
    1010    croak "invalid args" if ref $args ne 'HASH'; 
    1111 
    12     my $base = URI->new($args->{response}->request->uri); 
    13     $base->query_form({}); 
    14     return render_control_panel($base, $args->{response}->request->uri); 
     12    return render_control_panel($args->{response}->request->uri); 
    1513} 
    1614 
    1715sub render_control_panel { 
    18     my ($base, $current_url) = @_; 
     16    my $current_url = shift; 
    1917 
    2018    return sprintf(<<"...", encode_entities($current_url)); 
    21     <form method="get" action="$base"> 
    22         <input type="text" name="q" value="\%s" size="40" /> 
     19    <script> 
     20        var moxy_base = location.protocol + '://' + location.host; 
     21    </script> 
     22    <form method="get" onsubmit="location.href=moxy_base +'/'+encodeURIComponent(document.getElementById('moxy_url').value);return false;"> 
     23        <input type="text" value="\%s" size="40" id="moxy_url" /> 
    2324        <input type="submit" value="go" /> 
    2425    </form>