Changeset 1433

Show
Ignore:
Timestamp:
11/14/07 09:15:34 (6 years ago)
Author:
charsbar
Message:

lang/perl/Jipotter: added Nowa/Frepa support; fixed duped action; appearance

Location:
lang/perl/Jipotter/trunk
Files:
2 added
9 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Jipotter/trunk/MANIFEST

    r1397 r1433  
    1212lib/Jipotter/Plugin/Timelines/Dispatcher.pm 
    1313lib/Jipotter/Plugin/Timelines/Service.pm 
     14lib/Jipotter/Plugin/Timelines/Service/Frepa.pm 
     15lib/Jipotter/Plugin/Timelines/Service/Nowa.pm 
    1416lib/Jipotter/Plugin/Timelines/Service/Twitter.pm 
    1517lib/Jipotter/Plugin/Timelines/Service/Wassr.pm 
  • lang/perl/Jipotter/trunk/META.yml

    r1397 r1433  
    1717  Net::Twitter: 0 
    1818  Net::Wassr: 0 
     19  Nowa::Nanishiteru: 0 
    1920  Win32::TestServerManager: 0 
    2021requires:  
  • lang/perl/Jipotter/trunk/Makefile.PL

    r1383 r1433  
    1717recommends  'Net::Twitter'; 
    1818recommends  'Net::Wassr'; 
     19recommends  'Nowa::Nanishiteru'; 
    1920 
    2021if ( $^O eq 'MSWin32' ) { 
  • lang/perl/Jipotter/trunk/etc/site_config.yml.sample

    r1398 r1433  
    66          password: your_password 
    77        Wassr: 
     8          username: your_name 
     9          password: your_password 
     10        Frepa: 
     11          username: your_name 
     12          password: your_password 
     13        Nowa: 
    814          username: your_name 
    915          password: your_password 
  • lang/perl/Jipotter/trunk/lib/Jipotter/Plugin/Timelines.pm

    r1397 r1433  
    55use base qw( Jifty::Plugin ); 
    66 
    7 my @available_services = qw( Twitter Wassr ); 
     7my @available_services = qw( Twitter Wassr Nowa Frepa ); 
    88 
    99sub init { 
     
    1515    unless ( $credential ) { 
    1616      Jifty->log->debug( "$service is skipped" ); 
     17      next; 
    1718    } 
    1819 
     
    2324    } 
    2425 
    25     Jifty->log->debug( "loaded $service" ); 
     26    Jifty->log->info( "loaded $service plugin" ); 
    2627 
    2728    push @services, $package->new( $credential ); 
     
    3233sub services { @{ shift->{services} || [] } } 
    3334 
     35sub available_services { @available_services } 
     36 
    34371; 
  • lang/perl/Jipotter/trunk/lib/Jipotter/Plugin/Timelines/Action/Post.pm

    r1400 r1433  
    1515    id is 'MessageTextarea', 
    1616    sticky is 0; 
     17 
     18  param All => 
     19    label is 'All', 
     20    type is 'checkbox', 
     21    value is 'All', 
     22    checked is 1, 
     23    sticky is 0; 
     24 
     25  param Twitter => 
     26    label is 'Twitter', 
     27    value is 'Twitter', 
     28    type is 'checkbox', 
     29    sticky is 0; 
     30 
     31  param Wassr => 
     32    label is 'Wassr', 
     33    value is 'Wassr', 
     34    type is 'checkbox', 
     35    sticky is 0; 
     36 
     37  param Frepa => 
     38    label is 'Frepa', 
     39    value is 'Frepa', 
     40    type is 'checkbox', 
     41    sticky is 0; 
     42 
     43  param Nowa => 
     44    label is 'Nowa', 
     45    value is 'Nowa', 
     46    type is 'checkbox', 
     47    sticky is 0; 
    1748}; 
    1849 
     
    2253  my $self = shift; 
    2354 
    24   my $message = $self->argument_values->{message}; 
     55  my $message = $self->argument_value('message'); 
    2556 
    26   return 1 unless $message; 
     57  return unless $message; 
    2758 
    2859  my $plugin = Jifty->find_plugin('Jipotter::Plugin::Timelines'); 
    2960 
     61  my $all = $self->argument_value('All'); 
    3062  foreach my $service ( $plugin->services ) { 
    31     $service->update( $message ); 
     63    if ( $all or $self->argument_value( $service->name ) ) { 
     64 
     65      Jifty->log->info( $service->name .' is updated' ); 
     66 
     67      $service->update( $message ); 
     68    } 
    3269  } 
    3370 
    34   return 1; 
     71  return; 
    3572} 
    3673 
  • lang/perl/Jipotter/trunk/lib/Jipotter/Plugin/Timelines/Dispatcher.pm

    r1366 r1433  
    66 
    77before qr{^/update} => run { 
    8   Jifty->web->new_action( class => 'Post' )->run; 
    98  redirect '/'; 
    109}; 
  • lang/perl/Jipotter/trunk/lib/Jipotter/Plugin/Timelines/View.pm

    r1400 r1433  
    1414  div { attr { class => 'PostBox' }; 
    1515    Jifty->web->form->start( submit_to => '/update' ); 
     16 
    1617    render_param( $action => 'message' ); 
     18 
    1719    form_submit( 
    18       label => 'Update', 
    19       onclick => { 
    20         submit => $action, 
    21       } 
     20      label => 'Update', onclick => { submit => $action, } 
    2221    ); 
     22 
     23    render_param( $action => 'All' ); 
     24    render_param( $action => 'Twitter' ); 
     25    render_param( $action => 'Wassr' ); 
     26    render_param( $action => 'Frepa' ); 
     27    render_param( $action => 'Nowa' ); 
     28 
    2329    Jifty->web->form->end; 
    2430  }; 
     
    3339     $entries->set_page_info( 
    3440       current_page => $page, 
    35        per_page     => 100, 
     41       per_page     => 10, 
    3642     ); 
    3743 
  • lang/perl/Jipotter/trunk/share/web/static/css/jipotter.css

    r1366 r1433  
    2121} 
    2222 
     23.BodyContainer .PostBox form div { 
     24    display: inline; 
     25    margin: auto; 
     26    text-align:right; 
     27} 
     28 
    2329.BodyContainer .SiteTitle { 
    2430    font-size: 240%; 
     
    3440 
    3541.BodyContainer .Status .LeftSide { 
    36     width: 140px; 
     42    width: 100px; 
    3743    float: left; 
     44    font-size:90%; 
    3845} 
    3946 
    4047.BodyContainer .Status .Center { 
    41     margin-right: 140px; 
     48    margin-right: 200px; 
     49    font-size:90%; 
     50    padding: 0 15px; 
    4251} 
    4352 
    4453.BodyContainer .Status .RightSide { 
    4554    float: right; 
    46     width: 140px; 
     55    width: 120px; 
     56    font-size:90%; 
    4757} 
     58