Commit a0d19b08 authored by Dries's avatar Dries
Browse files

- Patch #482636 by quicksketch: further clean-up of the form IDs/classes.

parent 2e0a4d26
...@@ -2610,11 +2610,7 @@ function theme_form_element($element) { ...@@ -2610,11 +2610,7 @@ function theme_form_element($element) {
$class[] = strtr($element['#name'], array('_' => '-', '[' => '-', ']' => '')) . '-wrapper'; $class[] = strtr($element['#name'], array('_' => '-', '[' => '-', ']' => '')) . '-wrapper';
} }
$output = '<div class="' . implode(' ', $class) . '"'; $output = '<div class="' . implode(' ', $class) . '">' . "\n";
if (!empty($element['#id'])) {
$output .= ' id="' . $element['#id'] . '-wrapper"';
}
$output .= ">\n";
$required = !empty($element['#required']) ? '<span class="form-required" title="' . $t('This field is required.') . '">*</span>' : ''; $required = !empty($element['#required']) ? '<span class="form-required" title="' . $t('This field is required.') . '">*</span>' : '';
if (!empty($element['#title']) && empty($element['#form_element_skip_title'])) { if (!empty($element['#title']) && empty($element['#form_element_skip_title'])) {
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
html.js #edit-book-pick-book { html.js #edit-book-pick-book {
display: none; display: none;
} }
#edit-book-bid-wrapper .description { .form-item-book-bid-wrapper .description {
clear: both; clear: both;
} }
#book-admin-edit select { #book-admin-edit select {
......
/* $Id$ */ /* $Id$ */
#edit-type-wrapper, #edit-severity-wrapper { .form-item-type-wrapper, .form-item-severity-wrapper {
float: right; float: right;
padding-right: 0; padding-right: 0;
padding-left: .8em; padding-left: .8em;
......
/* $Id$ */ /* $Id$ */
#edit-type-wrapper, #edit-severity-wrapper { .form-item-type-wrapper, .form-item-severity-wrapper {
float: left; /* LTR */ float: left; /* LTR */
padding-right: .8em; /* LTR */ padding-right: .8em; /* LTR */
margin: 0.1em; margin: 0.1em;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
text-decoration: line-through; text-decoration: line-through;
} }
#edit-language-wrapper, #edit-translation-wrapper, #edit-group-wrapper { .form-item-language-wrapper, .form-item-translation-wrapper, .form-item-group-wrapper {
float: left; /* LTR */ float: left; /* LTR */
padding-right: .8em; /* LTR */ padding-right: .8em; /* LTR */
margin: 0.1em; margin: 0.1em;
......
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
Drupal.behaviors.contentTypes = { Drupal.behaviors.contentTypes = {
attach: function () { attach: function () {
if ($('#edit-type').val() == $('#edit-name').val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_') || $('#edit-type').val() == '') { if ($('#edit-type').val() == $('#edit-name').val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_') || $('#edit-type').val() == '') {
$('#edit-type-wrapper').hide(); $('.form-item-type-wrapper').hide();
$('#edit-name').keyup(function () { $('#edit-name').keyup(function () {
var machine = $(this).val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_'); var machine = $(this).val().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/_+/g, '_');
if (machine != '_' && machine != '') { if (machine != '_' && machine != '') {
$('#edit-type').val(machine); $('#edit-type').val(machine);
$('#node-type-name-suffix').empty().append(' Machine name: ' + machine + ' [').append($('<a href="#">' + Drupal.t('Edit') + '</a>').click(function () { $('#node-type-name-suffix').empty().append(' Machine name: ' + machine + ' [').append($('<a href="#">' + Drupal.t('Edit') + '</a>').click(function () {
$('#edit-type-wrapper').show(); $('.form-item-type-wrapper').show();
$('#node-type-name-suffix').hide(); $('#node-type-name-suffix').hide();
$('#edit-name').unbind('keyup'); $('#edit-name').unbind('keyup');
return false; return false;
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
background-repeat: no-repeat; background-repeat: no-repeat;
padding-left: 20px; padding-left: 20px;
} }
div#edit-openid-identifier-wrapper { div.form-item-openid-identifier-wrapper {
display: block; display: block;
} }
html.js #user-login-form div#edit-openid-identifier-wrapper, html.js #user-login-form div.form-item-openid-identifier-wrapper,
html.js #user-login div#edit-openid-identifier-wrapper { html.js #user-login div.form-item-openid-identifier-wrapper {
display: none; display: none;
} }
html.js #user-login-form li.openid-link, html.js #user-login-form li.openid-link,
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
Drupal.behaviors.openid = { Drupal.behaviors.openid = {
attach: function (context) { attach: function (context) {
var loginElements = $('#edit-name-wrapper, #edit-pass-wrapper, li.openid-link'); var loginElements = $('.form-item-name-wrapper, .form-item-pass-wrapper, li.openid-link');
var openidElements = $('#edit-openid-identifier-wrapper, li.user-link'); var openidElements = $('.form-item-openid-identifier-wrapper, li.user-link');
// This behavior attaches by ID, so is only valid once on a page. // This behavior attaches by ID, so is only valid once on a page.
if (!$('#edit-openid-identifier.openid-processed').size() && $('#edit-openid-identifier').val()) { if (!$('#edit-openid-identifier.openid-processed').size() && $('#edit-openid-identifier').val()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment