diff --git a/includes/form.inc b/includes/form.inc index c2495e222de832b472d69940befec9b8a9f0ff9e..23636d038ee1f4786be51f14b29ea2bf5a923888 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -3916,7 +3916,7 @@ function theme_form_required_marker($variables) { 'class' => 'form-required', 'title' => $t('This field is required.'), ); - return '*'; + return '*'; } /** diff --git a/misc/ajax.js b/misc/ajax.js index 830c8aa1c98e0baeeff8385fbe9e486594e2f75f..92eefea952df735121cc25a7e8775e4fe297a839 100644 --- a/misc/ajax.js +++ b/misc/ajax.js @@ -202,16 +202,16 @@ Drupal.ajax = function (base, element, element_settings) { * will test to see if the key press is valid to trigger this event and * if it is, trigger it for us and prevent other keypresses from triggering. * In this case we're handling RETURN and SPACEBAR keypresses (event codes 13 - * and 32. RETURN is often used to submit a form when in a textfield, and - * SPACE is often used to activate an element without submitting. + * and 32. RETURN is often used to submit a form when in a textfield, and + * SPACE is often used to activate an element without submitting. */ Drupal.ajax.prototype.keypressResponse = function (element, event) { // Create a synonym for this to reduce code confusion. var ajax = this; // Detect enter key and space bar and allow the standard response for them, - // except for form elements of type 'text' and 'textarea', where the - // spacebar activation causes inappropriate activation if #ajax['keypress'] is + // except for form elements of type 'text' and 'textarea', where the + // spacebar activation causes inappropriate activation if #ajax['keypress'] is // TRUE. On a text-type widget a space should always be a space. if (event.which == 13 || (event.which == 32 && element.type != 'text' && element.type != 'textarea')) { $(ajax.element_settings.element).trigger(ajax.element_settings.event); @@ -559,7 +559,7 @@ Drupal.ajax.prototype.commands = { if (!$(response.selector).hasClass('ajax-changed')) { $(response.selector).addClass('ajax-changed'); if (response.asterisk) { - $(response.selector).find(response.asterisk).append(' * '); + $(response.selector).find(response.asterisk).append(' * '); } } }, diff --git a/misc/states.js b/misc/states.js index ec070c9a676a79f26a17833e74dae7501e1c031d..b01bc2b6892651d717d70b0033dac8ba1f622a2a 100644 --- a/misc/states.js +++ b/misc/states.js @@ -363,7 +363,7 @@ states.State.prototype = { $(document).bind('state:required', function(e) { if (e.trigger) { if (e.value) { - $(e.target).closest('.form-item, .form-wrapper').find('label').append('*'); + $(e.target).closest('.form-item, .form-wrapper').find('label').append('*'); } else { $(e.target).closest('.form-item, .form-wrapper').find('label .form-required').remove(); diff --git a/misc/tabledrag.js b/misc/tabledrag.js index b566168c354d786b96135d0c20e95b0b0d27dbec..95fe713b802aca5db0a33afaf3a36b571175c6d3 100644 --- a/misc/tabledrag.js +++ b/misc/tabledrag.js @@ -1141,7 +1141,7 @@ Drupal.tableDrag.prototype.row.prototype.removeIndentClasses = function () { Drupal.tableDrag.prototype.row.prototype.markChanged = function () { var marker = Drupal.theme('tableDragChangedMarker'); var cell = $('td:first', this.element); - if ($('span.tabledrag-changed', cell).length == 0) { + if ($('abbr.tabledrag-changed', cell).length == 0) { cell.append(marker); } }; @@ -1161,7 +1161,7 @@ Drupal.tableDrag.prototype.row.prototype.onSwap = function (swappedRow) { }; Drupal.theme.prototype.tableDragChangedMarker = function () { - return '*'; + return '*'; }; Drupal.theme.prototype.tableDragIndentation = function () { diff --git a/modules/field/field.form.inc b/modules/field/field.form.inc index 66d93e96320d31a2305c8dac55e433b21fc0b495..9250a51c43430cad7d1230131d9d5cb083742a39 100644 --- a/modules/field/field.form.inc +++ b/modules/field/field.form.inc @@ -250,7 +250,7 @@ function theme_field_multiple_value_form($variables) { if ($element['#cardinality'] > 1 || $element['#cardinality'] == FIELD_CARDINALITY_UNLIMITED) { $table_id = drupal_html_id($element['#field_name'] . '_values'); $order_class = $element['#field_name'] . '-delta-order'; - $required = !empty($element['#required']) ? '*' : ''; + $required = !empty($element['#required']) ? '*' : ''; $header = array( array( diff --git a/modules/simpletest/tests/form.test b/modules/simpletest/tests/form.test index e7ae9de3f9e058065d3272a1ce9d4cb1335b1b70..4d9692906156e391b3c77bc2f826d2402c8a4d32 100644 --- a/modules/simpletest/tests/form.test +++ b/modules/simpletest/tests/form.test @@ -65,7 +65,7 @@ class FormsTestCase extends DrupalWebTestCase { $elements['file']['empty_values'] = $empty_strings; // Regular expression to find the expected marker on required elements. - $required_marker_preg = '@\*@'; + $required_marker_preg = '@\*@'; // Go through all the elements and all the empty values for them. foreach ($elements as $type => $data) { @@ -598,16 +598,16 @@ class FormsElementsLabelsTestCase extends DrupalWebTestCase { // Exercise various defaults for textboxes and modifications to ensure // appropriate override and correct behaviour. - $elements = $this->xpath('//label[@for="edit-form-textfield-test-title-and-required"]/child::span[@class="form-required"]/parent::*/following-sibling::input[@id="edit-form-textfield-test-title-and-required"]'); + $elements = $this->xpath('//label[@for="edit-form-textfield-test-title-and-required"]/child::abbr[@class="form-required"]/parent::*/following-sibling::input[@id="edit-form-textfield-test-title-and-required"]'); $this->assertTrue(isset($elements[0]), t("Label preceeds textfield, with required marker inside label.")); - $elements = $this->xpath('//input[@id="edit-form-textfield-test-no-title-required"]/preceding-sibling::label[@for="edit-form-textfield-test-no-title-required"]/span[@class="form-required"]'); + $elements = $this->xpath('//input[@id="edit-form-textfield-test-no-title-required"]/preceding-sibling::label[@for="edit-form-textfield-test-no-title-required"]/abbr[@class="form-required"]'); $this->assertTrue(isset($elements[0]), t("Label tag with required marker preceeds required textfield with no title.")); $elements = $this->xpath('//input[@id="edit-form-textfield-test-title-invisible"]/preceding-sibling::label[@for="edit-form-textfield-test-title-invisible" and @class="element-invisible"]'); $this->assertTrue(isset($elements[0]), t("Label preceeding field and label class is element-invisible.")); - $elements = $this->xpath('//input[@id="edit-form-textfield-test-title"]/preceding-sibling::span[@class="form-required"]'); + $elements = $this->xpath('//input[@id="edit-form-textfield-test-title"]/preceding-sibling::abbr[@class="form-required"]'); $this->assertFalse(isset($elements[0]), t("No required marker on non-required field.")); $elements = $this->xpath('//input[@id="edit-form-textfield-test-title-after"]/following-sibling::label[@for="edit-form-textfield-test-title-after" and @class="option"]'); diff --git a/modules/system/system.theme.css b/modules/system/system.theme.css index d8dbc513b5a3196ad1a6e4090f9d59dd0d8ec6a1..f34a965ec99f63a1c511077768fbd2425855f33f 100644 --- a/modules/system/system.theme.css +++ b/modules/system/system.theme.css @@ -104,6 +104,9 @@ input.form-radio { .form-required { color: #f00; } +abbr.form-required, abbr.tabledrag-changed, abbr.ajax-changed { + border-bottom: none; +} .form-item input.error, .form-item textarea.error, .form-item select.error { diff --git a/themes/garland/style.css b/themes/garland/style.css index f36fa96549fe5c581b03feaaf8ccda9908a97534..4a5961c61996c90fa85881d6de108848fae1a577 100644 --- a/themes/garland/style.css +++ b/themes/garland/style.css @@ -264,7 +264,7 @@ tr:first-child td.category { border-top-width: 0; } -span.form-required { +abbr.form-required { color: #ffae00; }