? 223941-2.patch ? 223941.patch ? drupal_textfield_example-2.patch ? drupal_textfield_example.patch ? misc/jquery.example.js ? sites/all/modules ? sites/default/files ? sites/default/settings.php Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.267 diff -u -p -r1.267 form.inc --- includes/form.inc 12 Feb 2008 13:52:32 -0000 1.267 +++ includes/form.inc 19 Feb 2008 23:17:23 -0000 @@ -2002,6 +2002,16 @@ function theme_textfield($element) { if (isset($element['#field_suffix'])) { $output .= ' '. $element['#field_suffix'] .''; } + if (!empty($element['#example'])) { + $element['#description'] .= ' '. t('Example: ') . $element['#example']; + drupal_add_js('misc/jquery.example.js', 'module', 'footer'); + drupal_add_js("$(function() { + $('#{$element['#id']}').example('{$element['#example']}', { + class_name: 'example', + }); + $('#{$element['#id']}-wrapper .description .example').hide(); + });", 'inline', 'footer'); + } return theme('form_element', $element, $output) . $extra; } Index: modules/system/system.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v retrieving revision 1.63 diff -u -p -r1.63 system.admin.inc --- modules/system/system.admin.inc 4 Feb 2008 12:35:48 -0000 1.63 +++ modules/system/system.admin.inc 19 Feb 2008 23:17:24 -0000 @@ -1129,6 +1129,7 @@ function system_site_information_setting '#title' => t('Name'), '#default_value' => variable_get('site_name', 'Drupal'), '#description' => t('The name of this website.'), + '#example' => t('drupal.org'), '#required' => TRUE ); $form['site_mail'] = array( @@ -1136,13 +1137,15 @@ function system_site_information_setting '#title' => t('E-mail address'), '#default_value' => variable_get('site_mail', ini_get('sendmail_from')), '#description' => t("The From address in automated e-mails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this e-mail being flagged as spam.)"), + '#example' => t('emailaddress@example.com'), '#required' => TRUE, ); $form['site_slogan'] = array( '#type' => 'textfield', '#title' => t('Slogan'), '#default_value' => variable_get('site_slogan', ''), - '#description' => t("Your site's motto, tag line, or catchphrase (often displayed alongside the title of the site).") + '#description' => t("Your site's motto, tag line, or catchphrase (often displayed alongside the title of the site)."), + '#example' => t('community plumbing') ); $form['site_mission'] = array( '#type' => 'textarea', @@ -1161,6 +1164,7 @@ function system_site_information_setting '#title' => t('Anonymous user'), '#default_value' => variable_get('anonymous', t('Anonymous')), '#description' => t('The name used to indicate anonymous users.'), + '#example' => t('Anonymous'), '#required' => TRUE, ); $form['site_frontpage'] = array( @@ -1169,6 +1173,7 @@ function system_site_information_setting '#default_value' => variable_get('site_frontpage', 'node'), '#size' => 40, '#description' => t('The home page displays content from this relative URL. If unsure, specify "node".'), + '#example' => t('node'), '#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q='), '#required' => TRUE, ); Index: modules/system/system.css =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.css,v retrieving revision 1.48 diff -u -p -r1.48 system.css --- modules/system/system.css 9 Jan 2008 09:56:39 -0000 1.48 +++ modules/system/system.css 19 Feb 2008 23:17:24 -0000 @@ -150,6 +150,9 @@ tr.merge-up, tr.merge-up td, tr.merge-up margin-top: 0.4em; margin-bottom: 0.4em; } +.form-item .example { + color: #999; +} .marker, .form-required { color: #f00; } Index: modules/upload/upload.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.admin.inc,v retrieving revision 1.7 diff -u -p -r1.7 upload.admin.inc --- modules/upload/upload.admin.inc 10 Jan 2008 20:22:57 -0000 1.7 +++ modules/upload/upload.admin.inc 19 Feb 2008 23:17:24 -0000 @@ -70,7 +70,8 @@ function upload_admin_settings() { '#default_value' => variable_get('upload_max_resolution', 0), '#size' => 15, '#maxlength' => 10, - '#description' => t('The maximum allowed image size (e.g. 640x480). Set to 0 for no restriction. If an image toolkit is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))), + '#description' => t('The maximum allowed image size or 0 for no restriction. If an image toolkit is installed, files exceeding this value will be scaled down to fit.', array('!image-toolkit-link' => url('admin/settings/image-toolkit'))), + '#example' => t('640x480'), '#field_suffix' => ''. t('WIDTHxHEIGHT') .'' ); $form['settings_general']['upload_list_default'] = array( @@ -87,6 +88,7 @@ function upload_admin_settings() { '#default_value' => $upload_extensions_default, '#maxlength' => 255, '#description' => t('Default extensions that users can upload. Separate extensions with a space and do not include the leading dot.'), + '#example' => t('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'), ); $form['settings_general']['upload_uploadsize_default'] = array( '#type' => 'textfield', @@ -95,6 +97,7 @@ function upload_admin_settings() { '#size' => 5, '#maxlength' => 5, '#description' => t('The default maximum file size a user can upload. If an image is uploaded and a maximum resolution is set, the size will be checked after the file has been resized.'), + '#example' => 1, '#field_suffix' => t('MB'), ); $form['settings_general']['upload_usersize_default'] = array( @@ -104,6 +107,7 @@ function upload_admin_settings() { '#size' => 5, '#maxlength' => 5, '#description' => t('The default maximum size of all files a user can have on the site.'), + '#example' => 1, '#field_suffix' => t('MB'), );