Remove alternate and add link color setting

This commit is contained in:
Brian Miyaji
2014-05-10 22:44:07 +10:00
parent 39a2bcffb1
commit bbf851eb94
4 changed files with 16 additions and 9 deletions

View File

@@ -151,12 +151,19 @@
margin-bottom: 4em;
}
/* Templates */
/* View all */
.sp-view-all-link {
display: block;
margin-top: 0.5em;
}
/* Alternate */
.sp-data-table tbody tr.odd,
.sp-data-table tbody tr.alternate,
.sp-calendar tbody td#today {
background: rgba(0, 0, 0, 0.02);
}
@media only screen and (max-width: 40em) {
.sp-responsive-table {
margin-bottom: 0;

View File

@@ -126,15 +126,15 @@ class SP_Settings_General extends SP_Settings_Page {
$primary = ( ! empty( $_POST['sportspress_frontend_css_primary'] ) ) ? sp_format_hex( $_POST['sportspress_frontend_css_primary'] ) : '';
$heading = ( ! empty( $_POST['sportspress_frontend_css_heading'] ) ) ? sp_format_hex( $_POST['sportspress_frontend_css_heading'] ) : '';
$text = ( ! empty( $_POST['sportspress_frontend_css_text'] ) ) ? sp_format_hex( $_POST['sportspress_frontend_css_text'] ) : '';
$link = ( ! empty( $_POST['sportspress_frontend_css_link'] ) ) ? sp_format_hex( $_POST['sportspress_frontend_css_link'] ) : '';
$background = ( ! empty( $_POST['sportspress_frontend_css_background'] ) ) ? sp_format_hex( $_POST['sportspress_frontend_css_background'] ) : '';
$alternate = ( ! empty( $_POST['sportspress_frontend_css_alternate'] ) ) ? sp_format_hex( $_POST['sportspress_frontend_css_alternate'] ) : '';
$colors = array(
'primary' => $primary,
'heading' => $heading,
'text' => $text,
'background' => $background,
'alternate' => $alternate
'link' => $link
);
update_option( 'sportspress_frontend_css_colors', $colors );
@@ -186,14 +186,14 @@ class SP_Settings_General extends SP_Settings_Page {
if ( empty( $colors['heading'] ) ) $colors['heading'] = '#ffffff';
if ( empty( $colors['text'] ) ) $colors['text'] = '#222222';
if ( empty( $colors['background'] ) ) $colors['background'] = '#f5f5f5';
if ( empty( $colors['alternate'] ) ) $colors['alternate'] = '#f0f0f0';
if ( empty( $colors['link'] ) ) $colors['link'] = '#00a69c';
// Show inputs
$this->color_picker( __( 'Primary', 'sportspress' ), 'sportspress_frontend_css_primary', $colors['primary'] );
$this->color_picker( __( 'Heading', 'sportspress' ), 'sportspress_frontend_css_heading', $colors['heading'] );
$this->color_picker( __( 'Text', 'sportspress' ), 'sportspress_frontend_css_text', $colors['text'] );
$this->color_picker( __( 'Link', 'sportspress' ), 'sportspress_frontend_css_link', $colors['link'] );
$this->color_picker( __( 'Background', 'sportspress' ), 'sportspress_frontend_css_background', $colors['background'] );
$this->color_picker( __( 'Alternate', 'sportspress' ), 'sportspress_frontend_css_alternate', $colors['alternate'] );
?><br>
<label for="sportspress_enable_frontend_css">

View File

@@ -108,11 +108,11 @@ class SP_Frontend_Scripts {
if ( isset( $colors['text'] ) )
echo '.sp-data-table tbody,.sp-calendar tbody{color: ' . $colors['text'] . ' !important}';
if ( isset( $colors['link'] ) )
echo '.sp-data-table tbody a,.sp-data-table tbody a:hover,.sp-calendar tbody a:focus{color: ' . $colors['link'] . ' !important}';
if ( isset( $colors['background'] ) )
echo '.sp-data-table tbody,.sp-calendar tbody{background: ' . $colors['background'] . ' !important}';
if ( isset( $colors['alternate'] ) )
echo '.sp-data-table tbody tr.odd,.sp-data-table tbody tr.alternate,.sp-calendar tbody td#today{background: ' . $colors['alternate'] . ' !important}';
}
if ( ! empty( $custom ) )

View File

@@ -129,8 +129,8 @@ class SP_Install {
add_option( 'sportspress_frontend_css_primary', '#00a69c' );
add_option( 'sportspress_frontend_css_heading', '#ffffff' );
add_option( 'sportspress_frontend_css_text', '#222222' );
add_option( 'sportspress_frontend_css_link', '#00a69c' );
add_option( 'sportspress_frontend_css_background', '#f5f5f5' );
add_option( 'sportspress_frontend_css_alternate', '#f0f0f0' );
if ( ! get_option( 'sportspress_installed' ) ) {
// Configure default sport