[Rt-commit] rt branch, 4.0/toggle-off-cf-input-size, created. rt-4.0.18-136-gec3c5cc

? sunnavy sunnavy at bestpractical.com
Thu Jan 2 08:56:23 EST 2014


The branch, 4.0/toggle-off-cf-input-size has been created
        at  ec3c5cc5d2bb6936e6dbf8c5b4c2364359ea69fd (commit)

- Log -----------------------------------------------------------------
commit ec3c5cc5d2bb6936e6dbf8c5b4c2364359ea69fd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Jan 2 20:55:19 2014 +0800

    allow to toggle off cf's textarea and input sizes if $Cols/$Rows are set to undef
    
    we have default $Cols/$Rows in /Element/EditCustomFields, so it doesn't help
    much in core for now, but this gives customers the flexibility to toggle off
    the size/cols/rows html attributes for some custom fields, e.g.
    
        <& /Elements/EditCustomField, ..., Cols => undef &>

diff --git a/share/html/Elements/EditCustomFieldAutocomplete b/share/html/Elements/EditCustomFieldAutocomplete
index 32a3b9f..33fcae1 100644
--- a/share/html/Elements/EditCustomFieldAutocomplete
+++ b/share/html/Elements/EditCustomFieldAutocomplete
@@ -46,7 +46,7 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % if ( $Multiple ) {
-<textarea cols="<% $Cols %>" rows="<% $Rows %>" name="<% $name %>-Values" id="<% $name %>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default || '' %></textarea>
+<textarea <% defined $Cols ? qq{cols="$Cols"} : '' %> <% defined $Rows ?  qq{rows="$Rows"} : '' %> name="<% $name %>-Values" id="<% $name %>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default || '' %></textarea>
 
 <script type="text/javascript">
 var id = <% "$name-Values" |n,j%>;
diff --git a/share/html/Elements/EditCustomFieldFreeform b/share/html/Elements/EditCustomFieldFreeform
index b6810b6..b7dae0e 100644
--- a/share/html/Elements/EditCustomFieldFreeform
+++ b/share/html/Elements/EditCustomFieldFreeform
@@ -47,9 +47,9 @@
 %# END BPS TAGGED BLOCK }}}
 % my $name = $NamePrefix . $CustomField->Id . '-Value';
 % if ($Multiple) {
-<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$name%>s" id="<%$name%>s" wrap="off" class="CF-<%$CustomField->id%>-Edit"><% defined($Default) ? $Default : '' %></textarea>
+<textarea <% defined $Cols ? qq{cols="$Cols"} : '' %> <% defined $Rows ?  qq{rows="$Rows"} : '' %> name="<%$name%>s" id="<%$name%>s" wrap="off" class="CF-<%$CustomField->id%>-Edit"><% defined($Default) ? $Default : '' %></textarea>
 % } else {
-<input name="<%$name%>" id="<%$name%>" size="<%$Cols%>" class="CF-<%$CustomField->id%>-Edit" value="<% defined($Default) ? $Default : ''%>" />
+<input name="<%$name%>" id="<%$name%>" <% defined $Cols ? qq{size="$Cols"} : '' %> class="CF-<%$CustomField->id%>-Edit" value="<% defined($Default) ? $Default : ''%>" />
 % }
 <%INIT>
 if ( $Multiple and $Values ) {
diff --git a/share/html/Elements/EditCustomFieldText b/share/html/Elements/EditCustomFieldText
index c169740..c31a2fd 100644
--- a/share/html/Elements/EditCustomFieldText
+++ b/share/html/Elements/EditCustomFieldText
@@ -46,10 +46,10 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % while ($Values and my $value = $Values->Next ) {
-<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% $value->Content %></textarea><br />
+<textarea <% defined $Cols ? qq{cols="$Cols"} : '' %> <% defined $Rows ?  qq{rows="$Rows"} : '' %> name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% $value->Content %></textarea><br />
 % }
 % if (!$MaxValues or !$Values or $Values->Count < $MaxValues) {
-<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% defined($Default) ? $Default : '' %></textarea>
+<textarea <% defined $Cols ? qq{cols="$Cols"} : '' %> <% defined $Rows ?  qq{rows="$Rows"} : '' %> name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% defined($Default) ? $Default : '' %></textarea>
 % }
 <%INIT>
 # XXX - MultiValue textarea is for now outlawed.
diff --git a/share/html/Elements/EditCustomFieldWikitext b/share/html/Elements/EditCustomFieldWikitext
index ac2de26..41dfab7 100644
--- a/share/html/Elements/EditCustomFieldWikitext
+++ b/share/html/Elements/EditCustomFieldWikitext
@@ -46,10 +46,10 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % while ($Values and my $value = $Values->Next ) {
-<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% $value->Content %></textarea><br />
+<textarea <% defined $Cols ? qq{cols="$Cols"} : '' %> <% defined $Rows ?  qq{rows="$Rows"} : '' %> name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% $value->Content %></textarea><br />
 % }
 % if (!$MaxValues or !$Values or $Values->Count < $MaxValues) {
-<textarea cols="<%$Cols%>" rows="<%$Rows%>" name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default %></textarea>
+<textarea <% defined $Cols ? qq{cols="$Cols"} : '' %> <% defined $Rows ?  qq{rows="$Rows"} : '' %> name="<%$NamePrefix%><%$CustomField->Id%>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default %></textarea>
 % }
 <%INIT>
 # XXX - MultiValue textarea is for now outlawed.

-----------------------------------------------------------------------


More information about the rt-commit mailing list