Changeset 22891 for lang/perl/Moxy

Show
Ignore:
Timestamp:
11/07/08 08:24:11 (2 months ago)
Author:
tokuhirom
Message:

change control panel design

Location:
lang/perl/Moxy/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Moxy/trunk/assets/plugins/ControlPanel/panelcontainer.tt

    r10623 r22891  
     1<style> 
     2    #moxy_tab_group { 
     3        list-style: none; 
     4        margin: 1px 0 -1px 0; 
     5        padding: 0; 
     6    } 
     7 
     8    #moxy_tab_group li { 
     9        display: block; 
     10        float: left; 
     11        display: block; 
     12        height: 14px; 
     13        position: relative; 
     14        border-bottom: 1px solid #bbb8a9; 
     15        white-space: nowrap; 
     16        font-size: x-small; 
     17        cursor: pointer; 
     18    } 
     19    #moxy_tab_group .tab { 
     20        float: left; 
     21        list-style-type: none; 
     22        margin-right: 4px; 
     23        padding-left: 10px; 
     24        padding-right: 10px; 
     25        padding-top: 2px; 
     26        display: inline; 
     27    } 
     28    #moxy_tab_group .tab_open { background-color: gray; color: white; } 
     29    #moxy_tab_group .tab_close { background-color: #E0E0E0; } 
     30    .moxy_pane { 
     31        border: 2px solid gray; 
     32        height: 357px; 
     33        overflow: auto; 
     34        width: 600px; 
     35    } 
     36</style> 
     37<script> 
     38    var moxy_current_tab = 1; 
     39    function moxy_switch_tab(i) { 
     40        var current_pane = document.getElementById('moxypane' + moxy_current_tab); 
     41        current_pane.style.display = 'none'; 
     42        var current_tab = document.getElementById('moxytab' + moxy_current_tab); 
     43        current_tab.className = 'tab tab_close'; 
     44 
     45        var new_pane = document.getElementById('moxypane' + i); 
     46        new_pane.style.display = 'block'; 
     47        var new_tab = document.getElementById('moxytab' + i); 
     48        new_tab.className = 'tab tab_open'; 
     49 
     50        moxy_current_tab = i; 
     51    } 
     52</script> 
    153<div id="moxy-control-panel" style="margin-left: 10px;float: left; width: 500px;"> 
     54    <ul id="moxy_tab_group"> 
    255    [% FOR part IN parts %] 
    3         <div>[% part %]</div> 
     56        <li id="moxytab[% loop.count %]" onclick="moxy_switch_tab([% loop.count %])" class="tab tab_[% IF loop.count == 1 %]open[% ELSE %]close[% END %]">[% part.title %]</li> 
     57    [% END %] 
     58    </ul> 
     59    <div style="clear: both"></div> 
     60 
     61    [% FOR part IN parts %] 
     62        <div class="moxy_pane" id="moxypane[% loop.count %]" [% IF loop.count != 1 %]style="display: none"[% END %]>[% part.body %]</div> 
    463    [% END %] 
    564</div> 
  • lang/perl/Moxy/trunk/assets/plugins/ShowHTTPHeaders/panel.tt

    r2891 r22891  
    1 <a href="#" onclick="var x=document.getElementById('moxy_show_http_headers');x.style.display = (x.style.display=='none' ? '' : 'none');return false;">show http headers</a> 
    2 <div id="moxy_show_http_headers" style="display:none"> 
     1<div id="moxy_show_http_headers"> 
    32    <div> 
    43        <h2 id="moxy_request">Request</h2> 
  • lang/perl/Moxy/trunk/lib/Moxy/Plugin/ControlPanel.pm

    r10675 r22891  
    1212    $context->log("debug" => "generate ControlPanel"); 
    1313 
     14    my @parts = do { 
     15        my @r; 
     16        for my $hook (@{$context->class_component_hooks->{'control_panel'}}) { 
     17            my ($plugin, $method) = ($hook->{plugin}, $hook->{method}); 
     18            push @r, { title => sub { (my $x = ref $plugin) =~ s/.+:://; $x }->(), body => $plugin->$method($context, $args) }; 
     19        } 
     20        @r; 
     21    }; 
     22 
    1423    my $output = $self->render_template( 
    1524        $context, 
    1625        'panelcontainer.tt' => { 
    17             parts => $context->run_hook('control_panel' => $args),  
     26            parts => \@parts,  
    1827        } 
    1928    );