Adjust calling convention, do not include # in color

This commit is contained in:
Michal Čihař 2011-08-22 15:09:21 +02:00
parent a2485d0379
commit ccbefbb5ef
3 changed files with 25 additions and 16 deletions

View File

@ -9,16 +9,20 @@
/**
* Gradient filter for IE.
*
* @return string CSS code.
*/
function PMA_ieFilter($start_color, $end_color)
{
return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8
? 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="' . $start_color . '", endColorstr="' . $end_color . '");'
? 'filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#' . $start_color . '", endColorstr="#' . $end_color . '");'
: '';
}
/**
* Remove filter for IE.
*
* @return string CSS code.
*/
function PMA_ieClearFilter() {
return PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 6 && PMA_USR_BROWSER_VER <= 8
@ -28,15 +32,20 @@ function PMA_ieClearFilter() {
/**
* Generates code for CSS gradient using various browser extensions.
*
* @param string $start_color Color of gradient start, hex value without #
* @param string $end_color Color of gradient end, hex value without #
*
* @return string CSS code.
*/
function PMA_css_Gradied($start_color, $end_color)
{
$result = array();
$result[] = 'background-image: url(./themes/svg_gradient.php?from=' . $start_color . '&to=' . $end_color . ');';
$result[] = 'background-size: 100% 100%;';
$result[] = 'background: -webkit-gradient(linear, left top, left bottom, from(' . $start_color . '), to(' . $end_color . '));';
$result[] = 'background: -moz-linear-gradient(top, ' . $start_color . ', ' . $end_color . ');';
$result[] = 'background: -o-linear-gradient(top, ' . $start_color . ', ' . $end_color . ');';
$result[] = 'background: -webkit-gradient(linear, left top, left bottom, from(#' . $start_color . '), to(#' . $end_color . '));';
$result[] = 'background: -moz-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');';
$result[] = 'background: -o-linear-gradient(top, #' . $start_color . ', #' . $end_color . ');';
$result[] = PMA_ieFilter($start_color, $end_color);
return implode("\n", $result);
}

View File

@ -1671,7 +1671,7 @@ table#serverconnection_trg_local {
-moz-border-radius: 11px;
-webkit-border-radius: 11px;
border-radius: 11px;
<?php echo PMA_css_gradient('#ffffff', '#cccccc'); ?>
<?php echo PMA_css_gradient('ffffff', 'cccccc'); ?>
border: 1px solid #444444;
cursor: pointer;
}

View File

@ -105,7 +105,7 @@ a:hover {
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
<?php echo PMA_css_gradient('#ffffff', '#cccccc'); ?>
<?php echo PMA_css_gradient('ffffff', 'cccccc'); ?>
}
dfn {
@ -121,7 +121,7 @@ th {
font-weight: bold;
color: <?php echo $GLOBALS['cfg']['ThColor']; ?>;
background: #f3f3f3;
<?php echo PMA_css_gradient('#ffffff', '#cccccc'); ?>
<?php echo PMA_css_gradient('ffffff', 'cccccc'); ?>
}
a img {
@ -190,11 +190,11 @@ input[type=submit]{
text-shadow: 0 1px 0 #fff;
<?php echo PMA_css_gradient('#ffffff', '#cccccc'); ?>
<?php echo PMA_css_gradient('ffffff', 'cccccc'); ?>
}
input[type=submit]:hover{position: relative;
<?php echo PMA_css_gradient('#cccccc', '#dddddd'); ?>
<?php echo PMA_css_gradient('cccccc', 'dddddd'); ?>
cursor:pointer;
}
@ -289,7 +289,7 @@ select{
}
select[multiple] {
<?php echo PMA_css_gradient('#ffffff', '#f2f2f2'); ?>
<?php echo PMA_css_gradient('ffffff', 'f2f2f2'); ?>
}
/* Icon sprites */
@ -1598,10 +1598,10 @@ div#profilingchart {
-moz-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
text-shadow: #fff 0 1px 0;
*/
<?php echo PMA_css_gradient('#ffffff', '#cccccc'); ?>
<?php echo PMA_css_gradient('ffffff', 'cccccc'); ?>
}
#sectionlinks a:hover, .buttonlinks a:hover, a.button:hover {
<?php echo PMA_css_gradient('#cccccc', '#dddddd'); ?>
<?php echo PMA_css_gradient('cccccc', 'dddddd'); ?>
}
div#sqlquerycontainer {
@ -2018,11 +2018,11 @@ input[type=text].invalid_value,
text-shadow: 0 1px 0 #fff;
<?php echo PMA_css_gradient('#ffffff', '#cccccc'); ?>
<?php echo PMA_css_gradient('ffffff', 'cccccc'); ?>
cursor: pointer;
}
#buttonGo:hover{
<?php echo PMA_css_gradient('#cccccc', '#dddddd'); ?>
<?php echo PMA_css_gradient('cccccc', 'dddddd'); ?>
}
.format_specific_options h3 {
@ -2857,7 +2857,7 @@ span.cm-number {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
<?php echo PMA_css_gradient('#eeeeee', '#cccccc'); ?>
<?php echo PMA_css_gradient('eeeeee', 'cccccc'); ?>
}
.navigation td {
@ -2894,7 +2894,7 @@ span.cm-number {
cursor: pointer;
text-shadow: none;
<?php echo PMA_css_gradient('#333333', '#555555'); ?>
<?php echo PMA_css_gradient('333333', '555555'); ?>
}
.navigation select {