Mailing List Archive

svn commit: r1461437 - in /perl/embperl/trunk/Embperl/Form: Control.pm Control/checkboxes.pm Control/info.pm Control/radio.pm
Author: richter
Date: Wed Mar 27 08:00:11 2013
New Revision: 1461437

URL: http://svn.apache.org/r1461437
Log:
Embperl::Form: Formatting checkboxes control, fix trigger for radio control

Modified:
perl/embperl/trunk/Embperl/Form/Control.pm
perl/embperl/trunk/Embperl/Form/Control/checkboxes.pm
perl/embperl/trunk/Embperl/Form/Control/info.pm
perl/embperl/trunk/Embperl/Form/Control/radio.pm

Modified: perl/embperl/trunk/Embperl/Form/Control.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control.pm?rev=1461437&r1=1461436&r2=1461437&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control.pm Wed Mar 27 08:00:11 2013
@@ -354,6 +354,7 @@ sub get_std_control_attr
my $events = $self -> {eventattrs} ;
$type ||= $self -> {type} ;
my $state = $self -> {state} ;
+ $state =~ s/[^-a-zA-Z0-9_]/_/g ;

my $attrs = qq{class="ef-control ef-control-width-$width ef-control-$type ef-control-$type-width-$width $addclass $class $state" id="$ctrlid" $events} ;
return wantarray?($attrs, $ctrlid, $name):$attrs ;

Modified: perl/embperl/trunk/Embperl/Form/Control/checkboxes.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/checkboxes.pm?rev=1461437&r1=1461436&r2=1461437&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/checkboxes.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/checkboxes.pm Wed Mar 27 08:00:11 2013
@@ -82,14 +82,14 @@ __EMBPERL__
my $tab = $self -> {tab} ;

$]
-[$if $tab $]<[# #]table>[$ endif $]
+[$if $tab $]<[# #]table style="width: 100%">[$ endif $]
[* $i = 0 ; *]
[$ foreach $val (@$values) $]
[$if !defined ($filter) || ($val =~ /$filter/i) $]
- [$ if $tab $][$ if $colcnt == 0 $]<[# #]tr>[- $colcnt = $tab -][$endif$]<td>[$endif$]
+ [$ if $tab $][$ if $colcnt == 0 $]<[# #]tr>[- $colcnt = $tab -][$endif$]<td style="width: 3%">[$endif$]
<input type="checkbox" name="[+ $name +]" value="[+ $val +]" [.+ do { local $escmode = 0 ; $ctlattrs } +]
[$if ($self -> {trigger}) $]_ef_attach="ef_checkbox"[$endif$] >
- [$ if $tab $]</td><td>[$endif$]
+ [$ if $tab $]</td><td style="width: [+ int((100 - ($tab * 3)) / $tab) +]%">[$endif$]
[+ $options ->[$i] || $val +]
[- $vert = $self -> {vert} -][$while $vert-- > 0 $]<br/>[$endwhile$]
[$ if $tab $]</td>[$ if $colcnt-- < 1 $]<[# #]/tr>[$endif$][$endif$]
@@ -116,7 +116,7 @@ $]
my $val ;
my $i = 0 ;
$]
-[$if $tab $]<[# #]table>[$ endif $]
+[$if $tab $]<[# #]table width=100% style="width: 100%" >[$ endif $]
[$ foreach $val (@$addtop) $]
[$if !defined ($filter) || ($val->[0] =~ /$filter/i) $]
[$ if $tab $][$ if $colcnt == 0 $]<[# #]tr>[- $colcnt = $tab -][$endif$]<td>[$endif$]

Modified: perl/embperl/trunk/Embperl/Form/Control/info.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/info.pm?rev=1461437&r1=1461436&r2=1461437&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/info.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/info.pm Wed Mar 27 08:00:11 2013
@@ -34,12 +34,11 @@ __EMBPERL__
[.$ sub show ($self, $req)

my $span = ($self->{width_percent});
-my $section = $self->{section};
-my $class = $self -> {class} ;
my $state = $self -> {state} ;
+$state =~ s/[^-a-zA-Z0-9_]/_/g ;
$]<table class="ef-element ef-element-width-[+ $self -> {width_percent} +][+ ' '+][+ $state +]">
<tr>
-<td class="[.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +]">[$ if $section $]<b>[$ endif $][$ if $self -> {image} $]<img class="cControlButtonSymbol" src="[+ $self -> {image} +]">[$endif$][+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self) +]&nbsp;[$ if $section $]</b>[$ endif $]</td>
+<td [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, '', 'readonly') } +] >[$ if $self -> {image} $]<img class="cControlButtonSymbol" src="[+ $self -> {image} +]">[$endif$][+ $self -> {showtext}?($self->{text}):$self -> form -> convert_text ($self) +]&nbsp;</td>
</tr>
</table>[$endsub$]


Modified: perl/embperl/trunk/Embperl/Form/Control/radio.pm
URL: http://svn.apache.org/viewvc/perl/embperl/trunk/Embperl/Form/Control/radio.pm?rev=1461437&r1=1461436&r2=1461437&view=diff
==============================================================================
--- perl/embperl/trunk/Embperl/Form/Control/radio.pm (original)
+++ perl/embperl/trunk/Embperl/Form/Control/radio.pm Wed Mar 27 08:00:11 2013
@@ -69,14 +69,14 @@ else
}

$]
-<table class="ef-control-radiotab [+ $self -> {state} +]">[+ do { local $escmode = 0 ; $trglob }+]
+<table class="ef-control-radiotab [+ $self -> {state} +]"
+[$if ($self -> {trigger}) $]_ef_attach="ef_radio" name="[+ $self -> {force_name} || $self -> {name} +]"[$endif$]
+>[+ do { local $escmode = 0 ; $trglob }+]
[$ foreach $val (@$values) $][- $x = ($val =~ /$filter/i) -]
[.- $fdat{$name} = $val, $set = 0 if ($set) ;
$fdat{$name} = $val if ($ignorecase && lc($fdat{$name}) eq lc($val)) ; -]
[+ do { local $escmode = 0 ; $tr }+]<td><input type="radio" name="[+ $self -> {force_name} || $self -> {name} +]" [.+ do { local $escmode = 0 ; $self -> get_std_control_attr($req, "$ctlid-_-$val") } +] value="[+ $val +]"
- [$if ($self -> {sublines} || $self -> {subobjects}) $] OnClick="[+ $nsprefix +]show_radio_checked(document, this,[+ $i +],[+ $max +])" [$endif$]
></td><td>[+ $options ->[$i] || $val +]</td>[+ do { local $escmode = 0 ; $trend }+]
- [$if ($self -> {trigger}) $]<script >$('#[+ "$ctlid-_-$val" +]').ef_radio ()</script>[$endif$]
[* $i++ ; *]
[$endforeach$]
[+ do { local $escmode = 0 ; $trendglob }+]</table>



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org