Francois Gouget : testbot/web: Recognize 'textarea' properties and use the appropriate input type.
Alexandre Julliard
julliard at winehq.org
Mon Jun 16 04:17:04 CDT 2014
Module: tools
Branch: master
Commit: 197a4e91f94c36b02be16355355708bfd7626375
URL: http://source.winehq.org/git/tools.git/?a=commit;h=197a4e91f94c36b02be16355355708bfd7626375
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Fri Jun 13 18:22:17 2014 +0200
testbot/web: Recognize 'textarea' properties and use the appropriate input type.
This simplifies the code for web pages that have multiline input fields.
---
testbot/lib/ObjectModel/CGI/FormPage.pm | 15 ++++-----------
testbot/web/Feedback.pl | 14 +-------------
2 files changed, 5 insertions(+), 24 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm
index dc4a58a..77c02b3 100644
--- a/testbot/lib/ObjectModel/CGI/FormPage.pm
+++ b/testbot/lib/ObjectModel/CGI/FormPage.pm
@@ -221,17 +221,10 @@ sub GetInputType($$)
{
my ($self, $PropertyDescriptor) = @_;
- if ($PropertyDescriptor->GetClass() eq "Enum")
- {
- return "select";
- }
-
- if ($PropertyDescriptor->GetType() eq "B")
- {
- return "checkbox";
- }
-
- return "text";
+ return $PropertyDescriptor->GetClass() eq "Enum" ? "select" :
+ $PropertyDescriptor->GetType() eq "B" ? "checkbox" :
+ $PropertyDescriptor->GetType() eq "textarea" ? "textarea" :
+ "text";
}
sub GenerateField($$$)
diff --git a/testbot/web/Feedback.pl b/testbot/web/Feedback.pl
index 39558da..f0ae921 100644
--- a/testbot/web/Feedback.pl
+++ b/testbot/web/Feedback.pl
@@ -34,7 +34,7 @@ sub _initialize($$$)
my @PropertyDescriptors = (
CreateBasicPropertyDescriptor("Name", "Name", !1, !1, "A", 40),
CreateBasicPropertyDescriptor("EMail", "Email", !1, !1, "A", 40),
- CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, 1, "A", 1024),
+ CreateBasicPropertyDescriptor("Remarks", "Remarks", !1, 1, "textarea", 1024),
);
$self->SUPER::_initialize($Request, $RequiredRole, \@PropertyDescriptors);
@@ -79,18 +79,6 @@ sub GetHeaderText($)
"or email address.";
}
-sub GetInputType($$)
-{
- my ($self, $PropertyDescriptor) = @_;
-
- if (substr($PropertyDescriptor->GetName(), 0, 8) eq "Remarks")
- {
- return "textarea";
- }
-
- return $self->SUPER::GetInputType($PropertyDescriptor);
-}
-
sub GetActions($)
{
my ($self) = @_;
More information about the wine-cvs
mailing list