Active
Project:
Color.module: SoC 2008
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2008 at 16:22 UTC
Updated:
1 Oct 2008 at 17:17 UTC
The HTML for the input fields where the user enters a hexadecimal RGB-code is inadequate.
The following snippet is from color_edit_scheme_form() in the color.module file:
foreach ($palette as $name => $value) {
if (!$value) {
drupal_set_message('The colors set in the scheme in the color.inc file doesn\'t correspond with the number of fields.', 'status', FALSE);
}
$form['palette'][$name] = array(
'#type' => 'textfield',
'#title' => $names[$name],
'#default_value' => $value,
'#size' => 8,
);
}
The maxlength of the textfield is not set (should be 7) which increases the level of erroneous manual input from the user.
Also the size could be increased to allow the user to see more of the selected color without the text blocking the view.
Suggestion:
foreach ($palette as $name => $value) {
if (!$value) {
drupal_set_message('The colors set in the scheme in the color.inc file doesn\'t correspond with the number of fields.', 'status', FALSE);
}
$form['palette'][$name] = array(
'#type' => 'textfield',
'#title' => $names[$name],
'#default_value' => $value,
'#size' => 16,
'#maxlength' => 7,
);
}
Comments
Comment #1
Danial Namousi commentedAn issue for the corresponding CSS as been created:
http://drupal.org/node/315833
If the CSS is implemented, I suggest that also the #size is adjusted to 7 (to reflect #maxlength).