/[Perly]/lib/Perly/View.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Perly/View.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 34 by dpavlin, Wed Jun 6 22:07:12 2007 UTC revision 35 by dpavlin, Thu Jun 7 09:19:27 2007 UTC
# Line 37  private template 'code_list' => sub { Line 37  private template 'code_list' => sub {
37          }          }
38  };  };
39    
40    sub codepress {
41            return { render_as => 'Textarea' };
42            return {
43                    render_as => 'Jifty::Plugin::CodePress::Textarea',
44                    submit => {
45                            onclick => [
46                                    { beforeclick => 'CodePress.beforeSubmit();'  },
47                            ],
48                    },
49            };
50    }
51    
52  private template 'code_editor' => sub {  private template 'code_editor' => sub {
53          my $op = 'Create';          my $op = 'Create';
54          my $code = Perly::Model::Code->new();          my $code = Perly::Model::Code->new();
# Line 45  private template 'code_editor' => sub { Line 57  private template 'code_editor' => sub {
57                  warn "loaded ", length( $code->source ), " bytes";                  warn "loaded ", length( $code->source ), " bytes";
58                  $op = 'Update';                  $op = 'Update';
59          }          }
60    
61            warn "## editor: ", dump( codepress );
62    
63          form {          form {
64                  my $action = new_action( class => $op . 'Code', arguments => { $code ? $code->as_hash : undef } );                  my $action = new_action( class => $op . 'Code', arguments => { $code ? $code->as_hash : undef } );
65                  render_param( $action => 'name' );                  render_param( $action => 'name' );
66                  render_param( $action => 'source', cols => 80, rows => 25, language => 'perl', render_as => 'Jifty::Plugin::CodePress::Textarea' );                  render_param( $action => 'source', cols => 80, rows => 25, language => 'perl', render_as => codepress->{render_as} );
67                  #render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] );                  #render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] );
68                  form_submit(                  form_submit( label => _($op), %{ codepress->{submit} } );
                         label => _($op),  
                         onclick => [  
                                 { beforeclick => "CodePress.beforeSubmit();" },  
                         ],  
                 );  
69                  # IE problem http://support.microsoft.com/kb/281197                  # IE problem http://support.microsoft.com/kb/281197
70                  form_next_page( url => '/run/code=' . $action->argument_value('id') );                  form_next_page( url => '/run/code=' . $action->argument_value('id') );
71          }          }

Legend:
Removed from v.34  
changed lines
  Added in v.35

  ViewVC Help
Powered by ViewVC 1.1.26