diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index c67e981..a7e327e 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -1114,28 +1114,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 6492b10..d6d5917 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -998,14 +998,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 8a35b6e..3f1f803 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1101,11 +1101,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); @@ -1715,22 +1715,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'])) { @@ -1932,6 +1920,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. */ @@ -1943,6 +1932,7 @@ function theme_table($variables) { $colgroups = $variables['colgroups']; $sticky = $variables['sticky']; $responsive = $variables['responsive']; + $zebra = $variables['zebra']; $empty = $variables['empty']; // Add sticky headers, if applicable. @@ -1952,6 +1942,11 @@ function theme_table($variables) { // This is needed to target tables constructed by this function. $attributes['class'][] = 'sticky-enabled'; } + + // Add striped rows, if applicable. + if ($zebra) { + $attributes['class'][] = 'zebra'; + } // If the table has headers and it should react responsively to columns hidden // with the classes represented by the constants RESPONSIVE_PRIORITY_MEDIUM // and RESPONSIVE_PRIORITY_LOW, add the tableresponsive behaviors. @@ -1970,7 +1965,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 @@ -1991,7 +1986,6 @@ function theme_table($variables) { // Build colgroup if (is_array($cols) && count($cols)) { $output .= ' '; - $i = 0; foreach ($cols as $col) { $output .= ' '; } @@ -2052,9 +2046,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 @@ -2072,10 +2064,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 @@ -2214,10 +2206,7 @@ function theme_item_list($variables) { if ($items) { $output .= '<' . $type . new Attribute($list_attributes) . '>'; - $num_items = count($items); - $i = 0; foreach ($items as &$item) { - $i++; $attributes = array(); if (is_array($item)) { if (isset($item['#wrapper_attributes'])) { @@ -2225,13 +2214,6 @@ function theme_item_list($variables) { } $item = drupal_render($item); } - $attributes['class'][] = ($i % 2 ? 'odd' : 'even'); - if ($i == 1) { - $attributes['class'][] = 'first'; - } - if ($i == $num_items) { - $attributes['class'][] = 'last'; - } $output .= '' . $item . '
  • '; } $output .= ""; @@ -2466,12 +2448,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(); @@ -3028,7 +3004,7 @@ function drupal_common_theme() { 'variables' => array(), ), 'table' => array( - 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'responsive' => TRUE, 'empty' => ''), + 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'zebra' => TRUE, 'sticky' => TRUE, 'responsive' => 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 4a1e327..fba19ad 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -659,19 +659,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..c4ca9d8 100644 --- a/core/misc/print.css +++ b/core/misc/print.css @@ -8,10 +8,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 230f588..49956a6 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -486,7 +486,6 @@ Drupal.tableDrag.prototype.makeDraggable = function (item) { $(self.oldRowElement).removeClass('drag-previous'); } self.oldRowElement = item; - self.restripeTable(); self.onDrag(); } @@ -534,7 +533,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') { @@ -543,7 +542,6 @@ Drupal.tableDrag.prototype.dragRow = function (event, self) { else { self.rowObject.swap('before', currentRow, self); } - self.restripeTable(); } } @@ -912,16 +910,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.module b/core/modules/block/block.module index 26bcb25..dc685e9 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -988,15 +988,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/templates/block-admin-display-form.tpl.php b/core/modules/block/templates/block-admin-display-form.tpl.php index 4fa3e70..47fa610 100644 --- a/core/modules/block/templates/block-admin-display-form.tpl.php +++ b/core/modules/block/templates/block-admin-display-form.tpl.php @@ -24,7 +24,7 @@ * @ingroup themeable */ ?> - +
    @@ -43,7 +43,7 @@ $data): ?> - + diff --git a/core/modules/block/templates/block.tpl.php b/core/modules/block/templates/block.tpl.php index 895b49f..de6bed6 100644 --- a/core/modules/block/templates/block.tpl.php +++ b/core/modules/block/templates/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/config/lib/Drupal/config/Tests/ConfigEntityListTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php index 13f5a76..588c6f6 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -118,7 +118,7 @@ function testListUI() { } // Check the number of table row cells. - $elements = $this->xpath('//div[@id="content"]//table/tbody/tr[@class="odd"]/td'); + $elements = $this->xpath('//div[@id="content"]//table/tbody/tr/td'); $this->assertEqual(count($elements), 3, 'Correct number of table row cells found.'); // Check the contents of each row cell. The first cell contains the label, diff --git a/core/modules/field/field.module b/core/modules/field/field.module index 686e3f5..bf3c0a4 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -1254,8 +1254,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/templates/field.tpl.php b/core/modules/field/templates/field.tpl.php index a8ffe32..bbc2399 100644 --- a/core/modules/field/templates/field.tpl.php +++ b/core/modules/field/templates/field.tpl.php @@ -53,7 +53,7 @@
    > $item): ?> -
    >
    +
    >
    diff --git a/core/modules/filter/filter.admin.js b/core/modules/filter/filter.admin.js index f55159a..e01d69e 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.module b/core/modules/forum/forum.module index 9ec3ec6..89fb40c 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/forum/templates/forum-list.tpl.php b/core/modules/forum/templates/forum-list.tpl.php index b169493..d598866 100644 --- a/core/modules/forum/templates/forum-list.tpl.php +++ b/core/modules/forum/templates/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 */ ?> - +
    - + ', 'Correct colspan was set on empty message.'); + $this->assertRaw('', 'Correct colspan was set on empty message.'); $this->assertRaw('', '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 a7f2cbd..4016298 100644 --- a/core/modules/system/system.admin.css +++ b/core/modules/system/system.admin.css @@ -291,12 +291,9 @@ table.screenshot { list-style-type: none; border-right: 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 0bbeaf6..0720325 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. 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 96288f9..856e0f2 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 @@ -210,21 +210,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/image/image.admin.css b/core/modules/image/image.admin.css index 338a007..ceaf50c 100644 --- a/core/modules/image/image.admin.css +++ b/core/modules/image/image.admin.css @@ -57,8 +57,7 @@ .image-anchor { width: auto; } -.image-anchor .even, -.image-anchor .odd { +.image-anchor .zebra { background: none; } .image-anchor td { diff --git a/core/modules/node/templates/node.tpl.php b/core/modules/node/templates/node.tpl.php index 196d26f..671e083 100644 --- a/core/modules/node/templates/node.tpl.php +++ b/core/modules/node/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/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 5a455b7..6e45495 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 @@ function testAjaxCommands() { ); $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 d3a090f..bf271a3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php @@ -95,30 +95,30 @@ function testItemList() { ); $inner_b = '
      '; - $inner_b .= '
    1. ba
    2. '; - $inner_b .= '
    3. bb
    4. '; + $inner_b .= '
    5. ba
    6. '; + $inner_b .= '
    7. bb
    8. '; $inner_b .= '
    '; $inner_cb = '
      '; - $inner_cb .= '
    • cba
    • '; - $inner_cb .= '
    • cbb
    • '; + $inner_cb .= '
    • cba
    • '; + $inner_cb .= '
    • cbb
    • '; $inner_cb .= '
    '; $inner_c = '
      '; - $inner_c .= '
    • ca
    • '; - $inner_c .= '
    • cb' . $inner_cb . '
    • '; - $inner_c .= '
    • cc
    • '; + $inner_c .= '
    • ca
    • '; + $inner_c .= '
    • cb' . $inner_cb . '
    • '; + $inner_c .= '
    • cc
    • '; $inner_c .= '
    '; $expected = '
    '; $expected .= '

    Some title

    '; $expected .= '
      '; - $expected .= '
    • a
    • '; - $expected .= '
    • b' . $inner_b . '
    • '; - $expected .= '
    • c' . $inner_c . '
    • '; - $expected .= '
    • d
    • '; - $expected .= '
    • '; - $expected .= '
    • f
    • '; + $expected .= '
    • a
    • '; + $expected .= '
    • b' . $inner_b . '
    • '; + $expected .= '
    • c' . $inner_c . '
    • '; + $expected .= '
    • d
    • '; + $expected .= '
    • '; + $expected .= '
    • f
    • '; $expected .= '
    '; $this->assertThemeOutput('item_list', $variables, $expected); @@ -163,9 +163,9 @@ function testLinks() { $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 392959d..8c121d1 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 @@ function testThemeTableWithEmptyMessage() { ), ); $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. @@ -380,15 +365,6 @@ function ajax_forms_test_advanced_commands_remove_callback($form, $form_state) { } /** - * Ajax form callback: Selects '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 form callback: Selects 'settings'. */ function ajax_forms_test_advanced_commands_settings_callback($form, $form_state) { diff --git a/core/modules/taxonomy/templates/taxonomy-term.tpl.php b/core/modules/taxonomy/templates/taxonomy-term.tpl.php index 712e83c..87307a7 100644 --- a/core/modules/taxonomy/templates/taxonomy-term.tpl.php +++ b/core/modules/taxonomy/templates/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 8513db4..fc98d0c 100644 --- a/core/modules/user/user.css +++ b/core/modules/user/user.css @@ -4,8 +4,7 @@ #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 .details-description { diff --git a/core/themes/bartik/css/style-rtl.css b/core/themes/bartik/css/style-rtl.css index cdd3f1d..0ba48b4 100644 --- a/core/themes/bartik/css/style-rtl.css +++ b/core/themes/bartik/css/style-rtl.css @@ -54,11 +54,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, @@ -175,11 +175,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 a748fd4..4af4597 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -40,9 +40,6 @@ p { del { text-decoration: line-through; } -tr.odd { - background-color: #dddddd; -} img { outline: 0; } @@ -210,12 +207,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); } @@ -391,7 +386,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 */ @@ -426,10 +421,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, @@ -775,9 +770,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; } @@ -802,7 +798,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, @@ -939,17 +935,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 0038e92..d39b887 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/style.css b/core/themes/seven/style.css index d74f502..acd1c5f 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -395,21 +395,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;