changing the radio inputs into select lists, code formatting cleanup
This commit is contained in:
@@ -4,11 +4,11 @@ jQuery(document).ready(function(){
|
|||||||
|
|
||||||
var $main = jQuery('#main_class');
|
var $main = jQuery('#main_class');
|
||||||
var $sidebar = jQuery('#sidebar_class');
|
var $sidebar = jQuery('#sidebar_class');
|
||||||
var framework = jQuery('.roots_css_frameworks input:checked').val();
|
var framework = jQuery('.roots_css_frameworks select option:selected').val();
|
||||||
var user_main_class = $main.val();
|
var user_main_class = $main.val();
|
||||||
var user_sidebar_class = $sidebar.val();
|
var user_sidebar_class = $sidebar.val();
|
||||||
|
|
||||||
jQuery('.roots_css_frameworks input').change(function (e) {
|
jQuery('.roots_css_frameworks select').change(function (e) {
|
||||||
var main_class = roots_css_frameworks[this.value].classes.main;
|
var main_class = roots_css_frameworks[this.value].classes.main;
|
||||||
var sidebar_class = roots_css_frameworks[this.value].classes.sidebar;
|
var sidebar_class = roots_css_frameworks[this.value].classes.sidebar;
|
||||||
|
|
||||||
@@ -23,7 +23,6 @@ jQuery(document).ready(function(){
|
|||||||
|
|
||||||
$main.siblings('small').children().text(main_class);
|
$main.siblings('small').children().text(main_class);
|
||||||
$sidebar.siblings('small').children().text(sidebar_class);
|
$sidebar.siblings('small').children().text(sidebar_class);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function roots_theme_options_add_page() {
|
|||||||
__('Theme Options', 'roots'),
|
__('Theme Options', 'roots'),
|
||||||
'edit_theme_options',
|
'edit_theme_options',
|
||||||
'theme_options',
|
'theme_options',
|
||||||
'theme_options_render_page'
|
'roots_theme_options_render_page'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$theme_page)
|
if (!$theme_page)
|
||||||
@@ -152,7 +152,7 @@ function roots_get_theme_options() {
|
|||||||
return get_option('roots_theme_options', roots_get_default_theme_options());
|
return get_option('roots_theme_options', roots_get_default_theme_options());
|
||||||
}
|
}
|
||||||
|
|
||||||
function theme_options_render_page() {
|
function roots_theme_options_render_page() {
|
||||||
global $roots_css_frameworks;
|
global $roots_css_frameworks;
|
||||||
?>
|
?>
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
@@ -172,20 +172,11 @@ function theme_options_render_page() {
|
|||||||
<tr valign="top" class="radio-option"><th scope="row"><?php _e('CSS Grid Framework', 'roots'); ?></th>
|
<tr valign="top" class="radio-option"><th scope="row"><?php _e('CSS Grid Framework', 'roots'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset class="roots_css_frameworks"><legend class="screen-reader-text"><span><?php _e('CSS Grid Framework', 'roots'); ?></span></legend>
|
<fieldset class="roots_css_frameworks"><legend class="screen-reader-text"><span><?php _e('CSS Grid Framework', 'roots'); ?></span></legend>
|
||||||
<?php
|
<select name="roots_theme_options[css_framework]" id="roots_theme_options[css_framework]">
|
||||||
foreach ($roots_css_frameworks as $css_framework) {
|
<?php foreach ($roots_css_frameworks as $css_framework) { ?>
|
||||||
?>
|
<option value="<?php echo esc_attr($css_framework['name']); ?>" <?php selected($roots_options['css_framework'], $css_framework['name']); ?>><?php echo $css_framework['label']; ?></option>
|
||||||
<div class="layout">
|
<?php } ?>
|
||||||
<label class="description">
|
</select>
|
||||||
<input type="radio" name="roots_theme_options[css_framework]" value="<?php echo esc_attr($css_framework['name']); ?>" <?php checked($roots_options['css_framework'], $css_framework['name']); ?> />
|
|
||||||
<span>
|
|
||||||
<?php echo $css_framework['label']; ?>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -223,18 +214,10 @@ function theme_options_render_page() {
|
|||||||
<tr valign="top"><th scope="row"><?php _e('Cleanup Menu Output', 'roots'); ?></th>
|
<tr valign="top"><th scope="row"><?php _e('Cleanup Menu Output', 'roots'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset><legend class="screen-reader-text"><span><?php _e('Cleanup Menu Output', 'roots'); ?></span></legend>
|
<fieldset><legend class="screen-reader-text"><span><?php _e('Cleanup Menu Output', 'roots'); ?></span></legend>
|
||||||
<div>
|
<select name="roots_theme_options[clean_menu]" id="roots_theme_options[clean_menu]">
|
||||||
<label class="description">
|
<option value="yes" <?php selected($roots_options['clean_menu'], true); ?>><?php echo _e('Yes', 'roots'); ?></option>
|
||||||
<input type="radio" name="roots_theme_options[clean_menu]" value="yes" <?php checked($roots_options['clean_menu'], true); ?> />
|
<option value="no" <?php selected($roots_options['clean_menu'], false); ?>><?php echo _e('No', 'roots'); ?></option>
|
||||||
<span><?php echo _e('Yes', 'roots'); ?></span>
|
</select>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label class="description">
|
|
||||||
<input type="radio" name="roots_theme_options[clean_menu]" value="no" <?php checked($roots_options['clean_menu'], false); ?> />
|
|
||||||
<span><?php echo _e('No', 'roots'); ?></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -242,18 +225,10 @@ function theme_options_render_page() {
|
|||||||
<tr valign="top"><th scope="row"><?php _e('Enable FOUT-B-Gone', 'roots'); ?></th>
|
<tr valign="top"><th scope="row"><?php _e('Enable FOUT-B-Gone', 'roots'); ?></th>
|
||||||
<td>
|
<td>
|
||||||
<fieldset><legend class="screen-reader-text"><span><?php _e('Enable FOUT-B-Gone', 'roots'); ?></span></legend>
|
<fieldset><legend class="screen-reader-text"><span><?php _e('Enable FOUT-B-Gone', 'roots'); ?></span></legend>
|
||||||
<div>
|
<select name="roots_theme_options[fout_b_gone]" id="roots_theme_options[fout_b_gone]">
|
||||||
<label class="description">
|
<option value="yes" <?php selected($roots_options['fout_b_gone'], true); ?>><?php echo _e('Yes', 'roots'); ?></option>
|
||||||
<input type="radio" name="roots_theme_options[fout_b_gone]" value="yes" <?php checked($roots_options['fout_b_gone'], true); ?> />
|
<option value="no" <?php selected($roots_options['fout_b_gone'], false); ?>><?php echo _e('No', 'roots'); ?></option>
|
||||||
<span><?php echo _e('Yes', 'roots'); ?></span>
|
</select>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label class="description">
|
|
||||||
<input type="radio" name="roots_theme_options[fout_b_gone]" value="no" <?php checked($roots_options['fout_b_gone'], false); ?> />
|
|
||||||
<span><?php echo _e('No', 'roots'); ?></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user