diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index 6d21c98..37c77e5 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -1097,28 +1097,6 @@ function ajax_command_invoke($selector, $method, array $args = array()) { } /** - * Creates a Drupal Ajax 'restripe' command. - * - * The 'restripe' command instructs the client to restripe a table. This is - * usually used after a table has been modified by a replace or append command. - * - * This command is implemented by Drupal.ajax.prototype.commands.restripe() - * defined in misc/ajax.js. - * - * @param $selector - * A jQuery selector string. - * - * @return - * An array suitable for use with the ajax_render() function. - */ -function ajax_command_restripe($selector) { - return array( - 'command' => 'restripe', - 'selector' => $selector, - ); -} - -/** * Creates a Drupal Ajax 'add_css' command. * * This method will add css via ajax in a cross-browser compatible way. diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 639e1cf..eb45bba 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -996,14 +996,8 @@ function menu_tree_output($tree) { $router_item = menu_get_item(); $num_items = count($items); - foreach ($items as $i => $data) { + foreach ($items as $data) { $class = array(); - if ($i == 0) { - $class[] = 'first'; - } - if ($i == $num_items - 1) { - $class[] = 'last'; - } // Set a class for the
  • -tag. Since $data['below'] may contain local // tasks, only set 'expanded' class if the link also has children within // the current menu. diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 7766952..57198ee 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1041,11 +1041,11 @@ function theme($hook, $variables = array()) { // a function, but a template overrides that default implementation). In // these cases, a template should still be able to expect to have access to // the variables provided by template_preprocess(), so we add them here if - // they don't already exist. We don't want to run template_preprocess() - // twice (it would be inefficient and mess up zebra striping), so we use the - // 'directory' variable to determine if it has already run, which while not - // completely intuitive, is reasonably safe, and allows us to save on the - // overhead of adding some new variable to track that. + // they don't already exist. We don't want the overhead of running + // template_preprocess() twice, so we use the 'directory' variable to + // determine if it has already run, which while not completely intuitive, + // is reasonably safe, and allows us to save on the overhead of adding some + // new variable to track that. if (!isset($variables['directory'])) { $default_template_variables = array(); template_preprocess($default_template_variables, $hook); @@ -1640,22 +1640,10 @@ function theme_links($variables) { $output .= ''; - $num_links = count($links); - $i = 0; foreach ($links as $key => $link) { - $i++; - $class = array(); // Use the array key as class name. $class[] = drupal_html_class($key); - // Add odd/even, first, and last classes. - $class[] = ($i % 2 ? 'odd' : 'even'); - if ($i == 1) { - $class[] = 'first'; - } - if ($i == $num_links) { - $class[] = 'last'; - } // Handle links. if (isset($link['href'])) { @@ -1819,6 +1807,7 @@ function theme_breadcrumb($variables) { * within a table. For example, one may easily group three columns and * apply same background style to all. * - sticky: Use a "sticky" table header. + * - zebra: Use striping on the table rows. * - empty: The message to display in an extra row if table does not have any * rows. */ @@ -1829,6 +1818,7 @@ function theme_table($variables) { $caption = $variables['caption']; $colgroups = $variables['colgroups']; $sticky = $variables['sticky']; + $zebra = $variables['zebra']; $empty = $variables['empty']; // Add sticky headers, if applicable. @@ -1839,6 +1829,11 @@ function theme_table($variables) { $attributes['class'][] = 'sticky-enabled'; } + // Add striped rows, if applicable. + if ($zebra) { + $attributes['class'][] = 'zebra'; + } + $output = '\n"; if (isset($caption)) { @@ -1847,7 +1842,7 @@ function theme_table($variables) { // Format the table columns: if (count($colgroups)) { - foreach ($colgroups as $number => $colgroup) { + foreach ($colgroups as $colgroup) { $attributes = array(); // Check if we're dealing with a simple or complex column @@ -1868,7 +1863,6 @@ function theme_table($variables) { // Build colgroup if (is_array($cols) && count($cols)) { $output .= ' '; - $i = 0; foreach ($cols as $col) { $output .= ' '; } @@ -1914,9 +1908,7 @@ function theme_table($variables) { // Format the table rows: if (count($rows)) { $output .= "\n"; - $flip = array('even' => 'odd', 'odd' => 'even'); - $class = 'even'; - foreach ($rows as $number => $row) { + foreach ($rows as $row) { $attributes = array(); // Check if we're dealing with a simple or complex row @@ -1934,10 +1926,10 @@ function theme_table($variables) { $cells = $row; } if (count($cells)) { - // Add odd/even class - if (empty($row['no_striping'])) { - $class = $flip[$class]; - $attributes['class'][] = $class; + // Remove odd/even class + if (!empty($row['no_striping'])) { + $attributes['class'][] = 'no-zebra'; + unset($attributes['no_striping']); } // Build row @@ -2021,10 +2013,7 @@ function theme_item_list($variables) { if ($items) { $output .= '<' . $type . new Attribute($list_attributes) . '>'; - $num_items = count($items); - $i = 0; foreach ($items as $key => $item) { - $i++; $attributes = array(); if (is_array($item)) { @@ -2057,14 +2046,6 @@ function theme_item_list($variables) { $value = $item; } - $attributes['class'][] = ($i % 2 ? 'odd' : 'even'); - if ($i == 1) { - $attributes['class'][] = 'first'; - } - if ($i == $num_items) { - $attributes['class'][] = 'last'; - } - $output .= '' . $value . '
  • '; } $output .= ""; @@ -2299,12 +2280,6 @@ function template_preprocess(&$variables, $hook) { global $user; static $count = array(), $default_attributes; - // Track run count for each hook to provide zebra striping. - // See "template_preprocess_block()" which provides the same feature specific to blocks. - $count[$hook] = isset($count[$hook]) && is_int($count[$hook]) ? $count[$hook] : 1; - $variables['zebra'] = ($count[$hook] % 2) ? 'odd' : 'even'; - $variables['id'] = $count[$hook]++; - // Tell all templates where they are located. $variables['directory'] = path_to_theme(); @@ -2865,7 +2840,7 @@ function drupal_common_theme() { 'variables' => array(), ), 'table' => array( - 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'empty' => ''), + 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'zebra' => TRUE, 'sticky' => TRUE, 'empty' => ''), ), 'meter' => array( 'variables' => array('display_value' => NULL, 'form' => NULL, 'high' => NULL, 'low' => NULL, 'max' => NULL, 'min' => NULL, 'optimum' => NULL, 'value' => NULL, 'percentage' => NULL, 'attributes' => array()), diff --git a/core/misc/ajax.js b/core/misc/ajax.js index 94bfb89..c46e9f9 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -604,19 +604,6 @@ Drupal.ajax.prototype.commands = { }, /** - * Command to restripe a table. - */ - restripe: function (ajax, response, status) { - // :even and :odd are reversed because jQuery counts from 0 and - // we count from 1, so we're out of sync. - // Match immediate children of the parent element to allow nesting. - $(response.selector).find('> tbody > tr:visible, > tr:visible') - .removeClass('odd even') - .filter(':even').addClass('odd').end() - .filter(':odd').addClass('even'); - }, - - /** * Command to add css. * * Uses the proprietary addImport method if available as browsers which diff --git a/core/misc/print.css b/core/misc/print.css index 0a56ef1..9f28e8f 100644 --- a/core/misc/print.css +++ b/core/misc/print.css @@ -1,4 +1,3 @@ - body { margin: 1em; background-color: #fff; @@ -8,10 +7,10 @@ th { color: #006; border-bottom: 1px solid #ccc; } -tr.odd { +tr.zebra { background-color: #ddd; } -tr.even { +tr.zebra:nth-child(even) { background-color: #fff; } td { diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index 07c50d5..b297637 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -484,7 +484,6 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { $(self.oldRowElement).removeClass('drag-previous'); } self.oldRowElement = item; - self.restripeTable(); self.onDrag(); } @@ -532,7 +531,7 @@ Drupal.tableDrag.prototype.dragRow = function (event, self) { self.setScroll(scrollAmount); } - // If we have a valid target, perform the swap and restripe the table. + // If we have a valid target, perform the swap. var currentRow = self.findDropTargetRow(x, y); if (currentRow) { if (self.rowObject.direction === 'down') { @@ -541,7 +540,6 @@ Drupal.tableDrag.prototype.dragRow = function (event, self) { else { self.rowObject.swap('before', currentRow, self); } - self.restripeTable(); } } @@ -910,16 +908,6 @@ Drupal.tableDrag.prototype.setScroll = function (scrollAmount) { }, this.scrollSettings.interval); }; -Drupal.tableDrag.prototype.restripeTable = function () { - // :even and :odd are reversed because jQuery counts from 0 and - // we count from 1, so we're out of sync. - // Match immediate children of the parent element to allow nesting. - $(this.table).find('> tbody > tr.draggable:visible, > tr.draggable:visible') - .removeClass('odd even') - .filter(':odd').addClass('even').end() - .filter(':even').addClass('odd'); -}; - /** * Stub function. Allows a custom handler when a row begins dragging. */ diff --git a/core/modules/block/block-admin-display-form.tpl.php b/core/modules/block/block-admin-display-form.tpl.php index 1728273..b3d18d8 100644 --- a/core/modules/block/block-admin-display-form.tpl.php +++ b/core/modules/block/block-admin-display-form.tpl.php @@ -25,7 +25,7 @@ * @ingroup themeable */ ?> - +
    @@ -44,7 +44,7 @@ $data): ?> - + diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 0626c08..10c31a1 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -985,15 +985,7 @@ function block_rebuild() { * @see block.tpl.php */ function template_preprocess_block(&$variables) { - $block_counter = &drupal_static(__FUNCTION__, array()); $variables['block'] = $variables['elements']['#block']; - // All blocks get an independent counter for each region. - if (!isset($block_counter[$variables['block']->region])) { - $block_counter[$variables['block']->region] = 1; - } - // Same with zebra striping. - $variables['block_zebra'] = ($block_counter[$variables['block']->region] % 2) ? 'odd' : 'even'; - $variables['block_id'] = $block_counter[$variables['block']->region]++; // Create the $content variable that templates expect. $variables['content'] = $variables['elements']['#children']; diff --git a/core/modules/block/block.tpl.php b/core/modules/block/block.tpl.php index 895b49f..de6bed6 100644 --- a/core/modules/block/block.tpl.php +++ b/core/modules/block/block.tpl.php @@ -25,8 +25,6 @@ * the template. * * Helper variables: - * - $block_zebra: Outputs 'odd' and 'even' dependent on each block region. - * - $zebra: Same output as $block_zebra but independent of any block region. * - $block_id: Counter dependent on each block region. * - $id: Same output as $block_id but independent of any block region. * - $is_front: Flags true when presented in the front page. diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 72b6d91..29a7980 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -1197,8 +1197,7 @@ function theme_field($variables) { // Render the items. $output .= '
    '; foreach ($variables['items'] as $delta => $item) { - $classes = 'field-item ' . ($delta % 2 ? 'odd' : 'even'); - $output .= '
    ' . drupal_render($item) . '
    '; + $output .= '
    ' . drupal_render($item) . '
    '; } $output .= '
    '; diff --git a/core/modules/field/theme/field.tpl.php b/core/modules/field/theme/field.tpl.php index a8ffe32..bbc2399 100644 --- a/core/modules/field/theme/field.tpl.php +++ b/core/modules/field/theme/field.tpl.php @@ -53,7 +53,7 @@ HTML comment.
    > $item): ?> -
    >
    +
    >
    diff --git a/core/modules/filter/filter.admin.js b/core/modules/filter/filter.admin.js index b2d7c6e..5939a98 100644 --- a/core/modules/filter/filter.admin.js +++ b/core/modules/filter/filter.admin.js @@ -32,8 +32,6 @@ Drupal.behaviors.filterStatus = { tab.tabHide().updateSummary(); } } - // Restripe table after toggling visibility of table row. - Drupal.tableDrag['filter-order'].restripeTable(); }); // Attach summary for configurable filters (only for screen-readers). diff --git a/core/modules/forum/forum-list.tpl.php b/core/modules/forum/forum-list.tpl.php index b169493..d598866 100644 --- a/core/modules/forum/forum-list.tpl.php +++ b/core/modules/forum/forum-list.tpl.php @@ -11,7 +11,6 @@ * - $forum->is_container: TRUE if the forum can contain other forums. FALSE * if the forum can contain only topics. * - $forum->depth: How deep the forum is in the current hierarchy. - * - $forum->zebra: 'even' or 'odd' string used for row class. * - $forum->icon_class: 'default' or 'new' string used for forum icon class. * - $forum->icon_title: Text alternative for the forum icon. * - $forum->name: The name of the forum. @@ -44,7 +43,7 @@ $forum): ?> - +
    block_title; ?> region_select; ?> weight_select; ?>
    is_container ? 'colspan="4" class="container"' : 'class="forum"'; ?>> title: The title of the topic. Safe to output. * - $topic->message: If the topic has been moved, this contains an * explanation and a link. - * - $topic->zebra: 'even' or 'odd' string used for row class. * - $topic->comment_count: The number of replies on this topic. * - $topic->new_replies: A flag to indicate whether there are unread * comments. @@ -37,13 +36,13 @@ * @ingroup themeable */ ?> - +
    - + ', t('Correct colspan was set on empty message.')); + $this->assertRaw('', t('Correct colspan was set on empty message.')); $this->assertRaw('', t('Table header was printed.')); } } diff --git a/core/modules/system/system.admin-rtl.css b/core/modules/system/system.admin-rtl.css index d7553b5..7c81f59 100644 --- a/core/modules/system/system.admin-rtl.css +++ b/core/modules/system/system.admin-rtl.css @@ -57,11 +57,11 @@ table.screenshot { border-left: 1px solid #cdcdcd; float: right; } -.theme-selector .operations li.last { +.theme-selector .operations li:last-child { border-left: none; padding: 0 0.7em 0 0; } -.theme-selector .operations li.first { +.theme-selector .operations li:first-child { padding: 0 0 0 0.7em; } diff --git a/core/modules/system/system.admin.css b/core/modules/system/system.admin.css index 957d3e0..c964caf 100644 --- a/core/modules/system/system.admin.css +++ b/core/modules/system/system.admin.css @@ -220,14 +220,11 @@ table.screenshot { margin: 0; padding: 0 0.7em; list-style-type: none; - border-right: 1px solid #cdcdcd; /* LTR */ + border-left: 1px solid #cdcdcd; /* LTR */ } -.theme-selector .operations li.last { - padding: 0 0 0 0.7em; /* LTR */ - border-right: none; /* LTR */ -} -.theme-selector .operations li.first { +.theme-selector .operations li:first-child { padding: 0 0.7em 0 0; /* LTR */ + border-left: none; /* LTR */ } #system-themes-admin-form { clear: left; diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css index 343a4f8..dcead4e 100644 --- a/core/modules/system/system.theme.css +++ b/core/modules/system/system.theme.css @@ -1,4 +1,3 @@ - /** * @file * Basic styling for common markup. @@ -30,8 +29,7 @@ th { padding-right: 1em; /* LTR */ text-align: left; /* LTR */ } -tr.even, -tr.odd { +tr.zebra { background-color: #eee; border-bottom: 1px solid #ccc; padding: 0.1em 0.6em; diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module index 260d911..3d019d3 100644 --- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module +++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module @@ -228,21 +228,6 @@ function ajax_forms_test_ajax_commands_form($form, &$form_state) { '#suffix' => '
    text to be removed
    ', ); - // Shows the Ajax 'restripe' command. - $form['restripe_command_example'] = array( - '#type' => 'submit', - '#value' => t("AJAX 'restripe' command"), - '#ajax' => array( - 'callback' => 'ajax_forms_test_advanced_commands_restripe_callback', - ), - '#suffix' => '
    -
    icon; ?>
    diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 61b018a..5151f40 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -1147,16 +1147,13 @@ function template_preprocess_forums(&$variables) { */ function template_preprocess_forum_list(&$variables) { global $user; - $row = 0; + // Sanitize each forum so that the template can safely print the data. foreach ($variables['forums'] as $id => $forum) { $variables['forums'][$id]->description = !empty($forum->description) ? filter_xss_admin($forum->description) : ''; $variables['forums'][$id]->link = url("forum/$forum->tid"); $variables['forums'][$id]->name = check_plain($forum->label()); $variables['forums'][$id]->is_container = !empty($forum->container); - $variables['forums'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even'; - $row++; - $variables['forums'][$id]->new_text = ''; $variables['forums'][$id]->new_url = ''; $variables['forums'][$id]->new_topics = 0; @@ -1205,11 +1202,8 @@ function template_preprocess_forum_topic_list(&$variables) { $variables['header'] = $header; if (!empty($variables['topics'])) { - $row = 0; foreach ($variables['topics'] as $id => $topic) { $variables['topics'][$id]->icon = theme('forum_icon', array('new_posts' => $topic->new, 'num_posts' => $topic->comment_count, 'comment_mode' => $topic->comment_mode, 'sticky' => $topic->sticky, 'first_new' => $topic->first_new)); - $variables['topics'][$id]->zebra = $row % 2 == 0 ? 'odd' : 'even'; - $row++; // We keep the actual tid in forum table, if it's different from the // current tid then it means the topic appears in two forums, one of diff --git a/core/modules/image/image.admin.css b/core/modules/image/image.admin.css index 2eb9b0d..4913246 100644 --- a/core/modules/image/image.admin.css +++ b/core/modules/image/image.admin.css @@ -1,4 +1,3 @@ - /** * Image style configuration pages. */ @@ -51,8 +50,7 @@ .image-anchor { width: auto; } -.image-anchor tr.even, -.image-anchor tr.odd { +.image-anchor tr.zebra { background: none; } .image-anchor td { diff --git a/core/modules/node/node.tpl.php b/core/modules/node/node.tpl.php index b1da4aa..5ffc6ac 100644 --- a/core/modules/node/node.tpl.php +++ b/core/modules/node/node.tpl.php @@ -46,8 +46,6 @@ * - $comment_count: Number of comments attached to the node. * - $uid: User ID of the node author. * - $created: Time the node was published formatted in Unix timestamp. - * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in - * teaser listings. * - $id: Position of the node. Increments each time it's output. * * Node status variables: diff --git a/core/modules/simpletest/simpletest.css b/core/modules/simpletest/simpletest.css index 86bd04b..81ae9f6 100644 --- a/core/modules/simpletest/simpletest.css +++ b/core/modules/simpletest/simpletest.css @@ -1,4 +1,3 @@ - /* Test Table */ #simpletest-form-table th.select-all { width: 1em; @@ -46,28 +45,28 @@ div.simpletest-pass { color: #981010; } -tr.simpletest-pass.odd { +tr.simpletest-pass { background-color: #b6ffb6; } -tr.simpletest-pass.even { +tr.simpletest-pass:nth-child(even) { background-color: #9bff9b; } -tr.simpletest-fail.odd { +tr.simpletest-fail { background-color: #ffc9c9; } -tr.simpletest-fail.even { +tr.simpletest-fail:nth-child(even) { background-color: #ffacac; } -tr.simpletest-exception.odd { +tr.simpletest-exception { background-color: #f4ea71; } -tr.simpletest-exception.even { +tr.simpletest-exception:nth-child(even) { background-color: #f5e742; } -tr.simpletest-debug.odd { +tr.simpletest-debug { background-color: #eee; } -tr.simpletest-debug.even { +tr.simpletest-debug:nth-child(even) { background-color: #fff; } diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/CommandsTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/CommandsTest.php index e7c8d7c..d21c43d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Ajax/CommandsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/CommandsTest.php @@ -142,14 +142,6 @@ class CommandsTest extends AjaxTestBase { ); $this->assertCommand($commands, $expected, "'remove' AJAX command issued with correct command and selector"); - // Tests the 'restripe' command. - $commands = $this->drupalPostAJAX($form_path, $edit, array('op' => t("AJAX 'restripe' command"))); - $expected = array( - 'command' => 'restripe', - 'selector' => '#restripe_table', - ); - $this->assertCommand($commands, $expected, "'restripe' AJAX command issued with correct selector"); - // Tests the 'settings' command. $commands = $this->drupalPostAJAX($form_path, $edit, array('op' => t("AJAX 'settings' command"))); $expected = array( diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php index 4e94e37..65e11de 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php @@ -65,16 +65,16 @@ class FunctionsTest extends WebTestBase { ), ); $inner = '
      '; - $inner .= '
    • c
    • '; - $inner .= '
    • d
    • '; + $inner .= '
    • c
    • '; + $inner .= '
    • d
    • '; $inner .= '
    '; $expected = '
    '; $expected .= '

    Some title

    '; $expected .= '
      '; - $expected .= '
    • a
    • '; - $expected .= '
    • b' . $inner . '
    • '; - $expected .= '
    • e
    • '; + $expected .= '
    • a
    • '; + $expected .= '
    • b' . $inner . '
    • '; + $expected .= '
    • e
    • '; $expected .= '
    '; $this->assertThemeOutput('item_list', $variables, $expected); @@ -119,9 +119,9 @@ class FunctionsTest extends WebTestBase { $expected_links = ''; $expected_links .= ''; // Verify that passing a string as heading works. diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php index ef51f4e..0c44129 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TableTest.php @@ -63,7 +63,7 @@ class TableTest extends WebTestBase { ), ); $this->content = theme('table', array('header' => $header, 'rows' => array(), 'empty' => t('No strings available.'))); - $this->assertRaw('
    No strings available.
    No strings available.
    Header 1
    - - -
    first row
    second row
    - ', - ); - // Demonstrates the Ajax 'settings' command. The 'settings' command has // nothing visual to "show", but it can be tested via SimpleTest and via // Firebug. @@ -397,15 +382,6 @@ function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) { } /** - * Ajax callback for 'restripe'. - */ -function ajax_forms_test_advanced_commands_restripe_callback($form, $form_state) { - $commands = array(); - $commands[] = ajax_command_restripe('#restripe_table'); - return array('#type' => 'ajax', '#commands' => $commands); -} - -/** * Ajax callback for 'settings'. */ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state) { diff --git a/core/modules/taxonomy/taxonomy-term.tpl.php b/core/modules/taxonomy/taxonomy-term.tpl.php index 712e83c..87307a7 100644 --- a/core/modules/taxonomy/taxonomy-term.tpl.php +++ b/core/modules/taxonomy/taxonomy-term.tpl.php @@ -23,8 +23,6 @@ * - $term: Full term object. Contains data that may not be safe. * - $view_mode: View mode, e.g. 'full', 'teaser'... * - $page: Flag for the full page state. - * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in - * teaser listings. * - $id: Position of the term. Increments each time it's output. * - $is_front: Flags true when presented in the front page. * - $logged_in: Flags true when the current user is a logged-in member. diff --git a/core/modules/update/update.css b/core/modules/update/update.css index cb20500..5206d8d 100644 --- a/core/modules/update/update.css +++ b/core/modules/update/update.css @@ -30,8 +30,7 @@ padding: 1em 1em .25em 1em; } -.update tr.even, -.update tr.odd { +.update tr.zebra { border: none; } diff --git a/core/modules/user/user.css b/core/modules/user/user.css index 866ee40..6e4e97f 100644 --- a/core/modules/user/user.css +++ b/core/modules/user/user.css @@ -1,12 +1,10 @@ - #permissions td.module { font-weight: bold; } #permissions td.permission { padding-left: 1.5em; /* LTR */ } -#permissions tr.odd .form-item, -#permissions tr.even .form-item { +#permissions tr.zebra .form-item { white-space: normal; } #user-admin-settings fieldset .fieldset-description { diff --git a/core/themes/bartik/css/style-rtl.css b/core/themes/bartik/css/style-rtl.css index 90638eb..e47f77e 100644 --- a/core/themes/bartik/css/style-rtl.css +++ b/core/themes/bartik/css/style-rtl.css @@ -55,11 +55,11 @@ ul.tips { margin-left: 2px; margin-right: 0; } -.region-header #block-user-login .item-list li.last { +.region-header #block-user-login .item-list li:last-child { padding-left: 0; padding-right: 0.5em; } -.region-header #block-user-login ul.openid-links li.last { +.region-header #block-user-login ul.openid-links li:last-child { padding-right: 0; } .region-header #user-login-form li.openid-link a, @@ -176,11 +176,11 @@ a.button { border-color: rgba(255, 255, 255, 0.15); border-right: none; } -#footer li.first a { +#footer li:first-child a { padding-right: 0; padding-left: 12px; } -#footer li.last a { +#footer li:last-child a { padding-left: 0; padding-right: 12px; border-left: none; diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 7532a4a..cb20d4a 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -1,4 +1,3 @@ - /* ---------- Overall Specifications ---------- */ body { @@ -41,9 +40,6 @@ p { del { text-decoration: line-through; } -tr.odd { - background-color: #dddddd; -} img { outline: 0; } @@ -214,12 +210,10 @@ tr th { border-color: #555; border-color: rgba(255, 255, 255, 0.18); } -tr.odd { - background: #e4e4e4; - background: rgba(0, 0, 0, 0.105); +table.zebra tbody tr:nth-of-type(odd) { + background-color: #dddddd; } -tr, -tr.even { +tr { background: #efefef; background: rgba(0, 0, 0, 0.063); } @@ -395,7 +389,7 @@ h1#site-name { text-decoration: none; background: rgba(255, 255, 255, 0.15); } -.region-header .block-menu li.last a { +.region-header .block-menu li:last-child a { border-bottom: 0; } /* User Login block in the header region */ @@ -430,10 +424,10 @@ h1#site-name { float: left; /* LTR */ padding: 3px 0 1px; } -.region-header #block-user-login .item-list li.last { +.region-header #block-user-login .item-list li:last-child { padding-left: 0.5em; /* LTR */ } -.region-header #block-user-login ul.openid-links li.last { +.region-header #block-user-login ul.openid-links li:last-child { padding-left: 0; /* LTR */ } .region-header #user-login-form li.openid-link a, @@ -780,9 +774,10 @@ ul.links { .sidebar tbody { border: none; } -.sidebar tr.even, -.sidebar tr.odd { +.sidebar table.zebra tbody tr { background: none; +} +.sidebar table.zebra tbody tr:nth-of-type(odd) { border-bottom: 1px solid #d6d6d6; } @@ -807,7 +802,7 @@ ul.links { border-bottom: 1px solid #dfdfdf; line-height: 1.3; } -#triptych .block.last { +#triptych .block:last-child { border-bottom: none; } #triptych .block ul li, @@ -944,17 +939,17 @@ ul.links { border-right: 1px solid #555; /* LTR */ border-color: rgba(255, 255, 255, 0.15); } -#footer li.first a { +#footer li:first-child a { padding-left: 0; /* LTR */ } -#footer li.last a { - padding-right: 0; /* LTR */ +#footer li:last-child a { border-right: none; /* LTR */ + padding-right: 0; /* LTR */ } -#footer-wrapper tr.odd { +#footer-wrapper tr.zebra { background-color: transparent; } -#footer-wrapper tr.even { +#footer-wrapper tr.zebra:nth-child(even) { background-color: #2c2c2c; background-color: rgba(0, 0, 0, 0.15); } diff --git a/core/themes/bartik/templates/node.tpl.php b/core/themes/bartik/templates/node.tpl.php index ce30175..abb2031 100644 --- a/core/themes/bartik/templates/node.tpl.php +++ b/core/themes/bartik/templates/node.tpl.php @@ -46,8 +46,6 @@ * - $comment_count: Number of comments attached to the node. * - $uid: User ID of the node author. * - $created: Time the node was published formatted in Unix timestamp. - * - $zebra: Outputs either "even" or "odd". Useful for zebra striping in - * teaser listings. * - $id: Position of the node. Increments each time it's output. * * Node status variables: diff --git a/core/themes/seven/reset.css b/core/themes/seven/reset.css index de53f28..9f3e6b1 100644 --- a/core/themes/seven/reset.css +++ b/core/themes/seven/reset.css @@ -1,4 +1,3 @@ - /** * Reset CSS styles. * @@ -80,8 +79,7 @@ ul.links li, /* Drupal: admin.css */ div.admin, /* Drupal: system.css */ -tr.even, -tr.odd, +tr.zebra, tr.drag, tbody, tbody th, @@ -93,8 +91,7 @@ thead th, .item-list ul li, ol.task-list li.active, .form-item, -tr.odd .form-item, -tr.even .form-item, +tr.zebra .form-item, .form-item .description, .form-item label, .form-item label.option, diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index ebaa86b..eac2601 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -1,4 +1,3 @@ - /** * Generic elements. */ @@ -393,21 +392,20 @@ table th { border: 0; color: #000; } -tr.even, -tr.odd { - border-width: 0 1px 0 1px; - border-style: solid; - border-color: #bebfb9; +table.zebra tbody tr { background: #f3f4ee; + border-color: #bebfb9; + border-style: solid; + border-width: 0 1px 0 1px; } -tr.odd { +table.zebra tbody tr:nth-of-type(odd) { background: #fff; } tr.drag { - background: #fe7; + background: #fe7 !important; } tr.drag-previous { - background: #ffb; + background: #ffb !important; } table th { text-transform: uppercase;