X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5e9aaf1c3e83467ed4f6550627f8c7e6ec6fa811..82053b457be3de2ee5285dc13633222f4d30802c:/SL/Template/Plugin/L.pm diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index fa1869215..3e157a366 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -2,6 +2,7 @@ package SL::Template::Plugin::L; use base qw( Template::Plugin ); use Template::Plugin; +use Data::Dumper; use List::MoreUtils qw(apply); use List::Util qw(max); use Scalar::Util qw(blessed); @@ -115,7 +116,7 @@ sub radio_button_tag { my ($self, $name, %attributes) = _hashify(2, @_); _set_id_attribute(\%attributes, $name); - $attributes{value} = 1 unless defined $attributes{value}; + $attributes{value} = 1 unless exists $attributes{value}; my $label = delete $attributes{label}; if ($attributes{checked}) { @@ -184,7 +185,7 @@ sub ajax_submit_tag { $url = _J($url); $form_selector = _J($form_selector); - my $onclick = qq|submit_ajax_form('${url}', '${form_selector}')|; + my $onclick = qq|kivi.submit_ajax_form('${url}', '${form_selector}')|; return $self->button_tag($onclick, $text, @slurp); } @@ -389,8 +390,10 @@ JAVASCRIPT my $filter = ".filter(function(idx) { return this.substr(0, " . length($params{with}) . ") == '$params{with}'; })"; $filter .= ".map(function(idx, str) { return str.replace('$params{with}_', ''); })"; + my $params_js = $params{params} ? qq| + ($params{params})| : ''; + $stop_event = <' . Data::Dumper::Dumper(@_) . ''; } @@ -580,8 +582,8 @@ clicks the dialog's ok/yes button. Creates a HTML 'input type="button"' tag with a very specific onclick handler that submits the form given by the jQuery selector C<$form_selector> to the URL C<$url> (the actual JavaScript function -called for that is C in C). The -button's label will be C<$text>. +called for that is C in +C). The button's label will be C<$text>. =item C @@ -733,6 +735,11 @@ If trueish then the children will not be recolored. The default is to recolor the children by setting the class C on odd and C on even entries. +=item C + +An optional JavaScript string that is evaluated before sending the +POST request. The result must be a string that is appended to the URL. + =back Example: