41 |
my $codepress = 1; |
my $codepress = 1; |
42 |
$codepress = current_user->user_object->codepress if ( current_user->id ); |
$codepress = current_user->user_object->codepress if ( current_user->id ); |
43 |
return { render_as => 'Textarea' } unless ( $codepress ); |
return { render_as => 'Textarea' } unless ( $codepress ); |
44 |
|
return { render_as => 'Jifty::Plugin::CodePress::Textarea' }; |
|
return { |
|
|
render_as => 'Jifty::Plugin::CodePress::Textarea', |
|
|
submit => { |
|
|
onclick => [ |
|
|
{ beforeclick => 'CodePress.beforeSubmit();' }, |
|
|
], |
|
|
}, |
|
|
}; |
|
45 |
} |
} |
46 |
|
|
47 |
private template 'code_editor' => sub { |
private template 'code_editor' => sub { |
60 |
render_param( $action => 'name' ); |
render_param( $action => 'name' ); |
61 |
render_param( $action => 'source', cols => 80, rows => 25, language => 'perl', render_as => codepress->{render_as} ); |
render_param( $action => 'source', cols => 80, rows => 25, language => 'perl', render_as => codepress->{render_as} ); |
62 |
#render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] ); |
#render_action( $action => [ 'source' => { cols => 80, rows => 30 }, ] ); |
63 |
form_submit( label => _($op), %{ codepress->{submit} } ); |
form_submit( label => _($op) ); |
64 |
# IE problem http://support.microsoft.com/kb/281197 |
# IE problem http://support.microsoft.com/kb/281197 |
65 |
form_next_page( url => '/run/code=' . $action->argument_value('id') ); |
form_next_page( url => '/run/code=' . $action->argument_value('id') ); |
66 |
} |
} |