diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index 31c099e..d837e76 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -1107,28 +1107,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 e59615c..8f0a4c2 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -1014,14 +1014,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 4c0e580..b8ae33f 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1147,11 +1147,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); @@ -1770,22 +1770,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'])) { @@ -2080,6 +2068,7 @@ function drupal_pre_render_table(array $element) { * 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; defaults to strip. * - empty: The message to display in an extra row if table does not have any * rows. */ @@ -2091,6 +2080,7 @@ function theme_table($variables) { $colgroups = $variables['colgroups']; $sticky = $variables['sticky']; $responsive = $variables['responsive']; + $zebra = isset($variables['zebra']) ? $variables['zebra'] : TRUE; $empty = $variables['empty']; // Add sticky headers, if applicable. @@ -2100,6 +2090,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. @@ -2118,7 +2113,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 @@ -2139,7 +2134,6 @@ function theme_table($variables) { // Build colgroup if (is_array($cols) && count($cols)) { $output .= ' '; - $i = 0; foreach ($cols as $col) { $output .= ' '; } @@ -2200,9 +2194,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 @@ -2220,10 +2212,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 @@ -2363,10 +2355,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'])) { @@ -2374,13 +2363,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 .= ""; @@ -2616,13 +2598,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(); @@ -3181,7 +3156,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 1b5d0ca..cbf32c0 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -648,19 +648,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..7ed4d8a 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 { +table.zebra tr:nth-child(odd) { background-color: #ddd; } -tr.even { +table.zebra tr:nth-child(even) { background-color: #fff; } td { diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index f578d4a..6eb6875 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/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 00b554a..27222ca 100644 --- a/core/modules/block/templates/block.tpl.php +++ b/core/modules/block/templates/block.tpl.php @@ -27,8 +27,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 f851cbc..a1844dd 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigEntityListTest.php @@ -128,7 +128,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 ea95f60..e241584 100644 --- a/core/modules/field/field.module +++ b/core/modules/field/field.module @@ -1258,8 +1258,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 16eadd8..cea6f46 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -1039,16 +1039,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; @@ -1097,11 +1094,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..6f2d5d3 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. @@ -33,7 +32,7 @@ * @ingroup themeable */ ?> -
    block_title; ?> region_select; ?> weight_select; ?>
    +
    @@ -44,7 +43,7 @@ $forum): ?> - +
    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..397f6e3 100644 --- a/core/modules/system/system.admin-rtl.css +++ b/core/modules/system/system.admin-rtl.css @@ -53,16 +53,13 @@ table.screenshot { padding: 20px 0 20px 20px; } .theme-selector .operations li { - border-right: none; - border-left: 1px solid #cdcdcd; - float: right; -} -.theme-selector .operations li.last { border-left: none; - padding: 0 0.7em 0 0; + border-right: 1px solid #cdcdcd; + float: right; } -.theme-selector .operations li.first { +.theme-selector .operations li:first-child { padding: 0 0 0 0.7em; + border-right: none; } /** diff --git a/core/modules/system/system.admin.css b/core/modules/system/system.admin.css index a7f2cbd..216a879 100644 --- a/core/modules/system/system.admin.css +++ b/core/modules/system/system.admin.css @@ -289,14 +289,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 680d15e..8655250 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 3e66bdc..b7a1f6b 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 8b37456..6896a40 100644 --- a/core/modules/image/image.admin.css +++ b/core/modules/image/image.admin.css @@ -70,8 +70,7 @@ .image-anchor { width: auto; } -.image-anchor .even, -.image-anchor .odd { +.image-anchor .zebra tr { 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/Theme/FunctionsTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FunctionsTest.php index 1faf6d8..ad38bd5 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. @@ -392,15 +377,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..3806e5f 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 .zebra tr { border: none; } diff --git a/core/modules/user/user.css b/core/modules/user/user.css index 2c88121..5b0bd71 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 .zebra tr .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 dc7c2a4..ccfcaf8 100644 --- a/core/themes/bartik/css/style-rtl.css +++ b/core/themes/bartik/css/style-rtl.css @@ -54,11 +54,14 @@ 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 { padding-left: 0; padding-right: 0.5em; } -.region-header #block-user-login ul.openid-links li.last { +.region-header #block-user-login .item-list li:first-child { + padding-right: 0; +} +.region-header #block-user-login ul.openid-links li:last-child { padding-right: 0; } .region-header #user-login-form li.openid-link a, @@ -163,18 +166,18 @@ ul.tips { } #footer li a { float: right; - border-left: 1px solid #555; + border-right: 1px solid #555; border-color: rgba(255, 255, 255, 0.15); - border-right: none; + border-left: none; } -#footer li.first a { +#footer li:first-child a { padding-right: 0; padding-left: 12px; + border-right: none; } -#footer li.last a { +#footer li:last-child a { padding-left: 0; padding-right: 12px; - border-left: none; } /* --------------- System Tabs --------------- */ diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 7a6a376..5ff05a0 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); } @@ -380,9 +375,9 @@ h1#site-name { } .region-header .block-menu li a { display: block; - border-bottom: 1px solid; - border-bottom-color: #eee; - border-bottom-color: rgba(255, 255, 255, 0.2); + border-top: 1px solid; + border-top-color: #eee; + border-top-color: rgba(255, 255, 255, 0.2); padding: 3px 7px; } .region-header .block-menu li a:hover, @@ -391,8 +386,8 @@ h1#site-name { text-decoration: none; background: rgba(255, 255, 255, 0.15); } -.region-header .block-menu li.last a { - border-bottom: 0; +.region-header .block-menu li:first-child a { + border-top: 0; } /* User Login block in the header region */ .region-header #block-user-login { @@ -424,12 +419,12 @@ h1#site-name { .region-header #block-user-login .item-list li { list-style: none; float: left; /* LTR */ - padding: 3px 0 1px; + padding: 3px 0 1px 0.5em; /* LTR */ } -.region-header #block-user-login .item-list li.last { - padding-left: 0.5em; /* LTR */ +.region-header #block-user-login .item-list li:first-child { + padding-left: 0; /* 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, @@ -774,9 +769,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; } @@ -801,7 +797,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, @@ -935,20 +931,20 @@ ul.links { float: left; /* LTR */ padding: 0 12px; display: block; - border-right: 1px solid #555; /* LTR */ + border-left: 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 */ + border-left: none; /* LTR */ } -#footer li.last a { +#footer li:last-child a { padding-right: 0; /* LTR */ - border-right: none; /* LTR */ } -#footer-wrapper tr.odd { +#footer-wrapper .zebra tr { background-color: transparent; } -#footer-wrapper tr.even { +#footer-wrapper .zebra tr: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 d32f9ac..0246007 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 abf975e..a34f3a0 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -440,14 +440,13 @@ 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 {