Issue #908282 by jbrown, pillarsdotnet: add width and height attributes to increase front-end performance.

merge-requests/26/head
webchick 2011-04-24 01:38:16 -07:00
parent 4d3217b4db
commit ef5ef9efc7
7 changed files with 15 additions and 15 deletions

View File

@ -1760,10 +1760,10 @@ function theme_table($variables) {
*/ */
function theme_tablesort_indicator($variables) { function theme_tablesort_indicator($variables) {
if ($variables['style'] == "asc") { if ($variables['style'] == "asc") {
return theme('image', array('path' => 'misc/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending'))); return theme('image', array('path' => 'misc/arrow-asc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort ascending'), 'title' => t('sort ascending')));
} }
else { else {
return theme('image', array('path' => 'misc/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending'))); return theme('image', array('path' => 'misc/arrow-desc.png', 'width' => 13, 'height' => 13, 'alt' => t('sort descending'), 'title' => t('sort descending')));
} }
} }
@ -1876,7 +1876,7 @@ function theme_more_help_link($variables) {
*/ */
function theme_feed_icon($variables) { function theme_feed_icon($variables) {
$text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title'])); $text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title']));
if ($image = theme('image', array('path' => 'misc/feed.png', 'alt' => $text))) { if ($image = theme('image', array('path' => 'misc/feed.png', 'width' => 16, 'height' => 16, 'alt' => $text))) {
return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text))); return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text)));
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 775 B

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 318 B

View File

@ -82,8 +82,8 @@ function theme_simpletest_test_table($variables) {
// Define the images used to expand/collapse the test groups. // Define the images used to expand/collapse the test groups.
$js = array( $js = array(
'images' => array( 'images' => array(
theme('image', array('path' => 'misc/menu-collapsed.png', 'alt' => t('Expand'), 'title' => t('Expand'))) . ' <a href="#" class="simpletest-collapse">(' . t('Expand') . ')</a>', theme('image', array('path' => 'misc/menu-collapsed.png', 'width' => 7, 'height' => 7, 'alt' => t('Expand'), 'title' => t('Expand'))) . ' <a href="#" class="simpletest-collapse">(' . t('Expand') . ')</a>',
theme('image', array('path' => 'misc/menu-expanded.png', 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' <a href="#" class="simpletest-collapse">(' . t('Collapse') . ')</a>', theme('image', array('path' => 'misc/menu-expanded.png', 'width' => 7, 'height' => 7, 'alt' => t('Collapse'), 'title' => t('Collapse'))) . ' <a href="#" class="simpletest-collapse">(' . t('Collapse') . ')</a>',
), ),
); );
@ -426,10 +426,10 @@ function simpletest_result_status_image($status) {
if (!isset($map)) { if (!isset($map)) {
$map = array( $map = array(
'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('Pass'))), 'pass' => theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('Pass'))),
'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('Fail'))), 'fail' => theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('Fail'))),
'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Exception'))), 'exception' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Exception'))),
'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('Debug'))), 'debug' => theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('Debug'))),
); );
} }
if (isset($map[$status])) { if (isset($map[$status])) {

View File

@ -57,25 +57,25 @@ function theme_update_report($variables) {
switch ($project['status']) { switch ($project['status']) {
case UPDATE_CURRENT: case UPDATE_CURRENT:
$class = 'ok'; $class = 'ok';
$icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'alt' => t('ok'), 'title' => t('ok'))); $icon = theme('image', array('path' => 'misc/watchdog-ok.png', 'width' => 18, 'height' => 18, 'alt' => t('ok'), 'title' => t('ok')));
break; break;
case UPDATE_UNKNOWN: case UPDATE_UNKNOWN:
case UPDATE_FETCH_PENDING: case UPDATE_FETCH_PENDING:
case UPDATE_NOT_FETCHED: case UPDATE_NOT_FETCHED:
$class = 'unknown'; $class = 'unknown';
$icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning'))); $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning')));
break; break;
case UPDATE_NOT_SECURE: case UPDATE_NOT_SECURE:
case UPDATE_REVOKED: case UPDATE_REVOKED:
case UPDATE_NOT_SUPPORTED: case UPDATE_NOT_SUPPORTED:
$class = 'error'; $class = 'error';
$icon = theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => t('error'), 'title' => t('error'))); $icon = theme('image', array('path' => 'misc/watchdog-error.png', 'width' => 18, 'height' => 18, 'alt' => t('error'), 'title' => t('error')));
break; break;
case UPDATE_NOT_CHECKED: case UPDATE_NOT_CHECKED:
case UPDATE_NOT_CURRENT: case UPDATE_NOT_CURRENT:
default: default:
$class = 'warning'; $class = 'warning';
$icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'alt' => t('warning'), 'title' => t('warning'))); $icon = theme('image', array('path' => 'misc/watchdog-warning.png', 'width' => 18, 'height' => 18, 'alt' => t('warning'), 'title' => t('warning')));
break; break;
} }

View File

@ -88,10 +88,10 @@ function seven_tablesort_indicator($variables) {
$style = $variables['style']; $style = $variables['style'];
$theme_path = drupal_get_path('theme', 'seven'); $theme_path = drupal_get_path('theme', 'seven');
if ($style == 'asc') { if ($style == 'asc') {
return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending'))); return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'width' => 13, 'height' => 13, 'title' => t('sort ascending')));
} }
else { else {
return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending'))); return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'width' => 13, 'height' => 13, 'title' => t('sort descending')));
} }
} }