From 9da422e00831d1f31f807e6546e9b6eac528f289 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Sun, 8 Jan 2012 11:58:57 -0700 Subject: [PATCH] fixes #166, #196 and #197 - adding full width option and applying in full width template, thx @johnnypeck! --- inc/js/theme-options.js | 15 ++++++++----- inc/roots-options.php | 50 +++++++++++++++++++++++++++++++---------- page-full.php | 2 +- 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/inc/js/theme-options.js b/inc/js/theme-options.js index cb57521..33865bc 100644 --- a/inc/js/theme-options.js +++ b/inc/js/theme-options.js @@ -1,28 +1,33 @@ jQuery.noConflict(); - -jQuery(document).ready(function(){ +jQuery(document).ready(function(){ var $main = jQuery('#main_class'); var $sidebar = jQuery('#sidebar_class'); + var $fullwidth = jQuery('#fullwidth_class'); var framework = jQuery('.roots_css_frameworks select option:selected').val(); var user_main_class = $main.val(); var user_sidebar_class = $sidebar.val(); + var user_fullwidth_class = $fullwidth.val(); jQuery('.roots_css_frameworks select').change(function (e) { var main_class = roots_css_frameworks[this.value].classes.main; var sidebar_class = roots_css_frameworks[this.value].classes.sidebar; + var fullwidth_class = roots_css_frameworks[this.value].classes.fullwidth; // if the selected framework was the one originally set, load the original classes instead of the defaults if (this.value === framework) { $main.val(user_main_class); $sidebar.val(user_sidebar_class); + $fullwidth.val(user_fullwidth_class); } else { $main.val(main_class); $sidebar.val(sidebar_class); + $fullwidth.val(fullwidth_class); } - + $main.siblings('small').children().text(main_class); $sidebar.siblings('small').children().text(sidebar_class); + $fullwidth.siblings('small').children().text(fullwidth_class); }); - -}); + +}); \ No newline at end of file diff --git a/inc/roots-options.php b/inc/roots-options.php index 4573a53..0433327 100644 --- a/inc/roots-options.php +++ b/inc/roots-options.php @@ -63,7 +63,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'span-24', 'main' => 'span-14 append-1', - 'sidebar' => 'span-8 prepend-1 last' + 'sidebar' => 'span-8 prepend-1 last', + 'fullwidth' => 'span-24' ) ), '960gs_12' => array( @@ -72,7 +73,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'container_12', 'main' => 'grid_7 suffix_1', - 'sidebar' => 'grid_4' + 'sidebar' => 'grid_4', + 'fullwidth' => 'grid_12' ) ), '960gs_16' => array( @@ -81,7 +83,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'container_16', 'main' => 'grid_9 suffix_1', - 'sidebar' => 'grid_6' + 'sidebar' => 'grid_6', + 'fullwidth' => 'grid_16' ) ), '960gs_24' => array( @@ -90,16 +93,18 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'container_24', 'main' => 'grid_15 suffix_1', - 'sidebar' => 'grid_8' + 'sidebar' => 'grid_8', + 'fullwidth' => 'grid_24' ) ), '1140' => array( 'name' => '1140', 'label' => __('1140', 'roots'), 'classes' => array( - 'container' => '', + 'container' => 'row', 'main' => 'eightcol', - 'sidebar' => 'fourcol last' + 'sidebar' => 'fourcol last', + 'fullwidth' => 'twelvecol' ) ), 'adapt' => array( @@ -108,7 +113,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'container_12 clearfix', 'main' => 'grid_7 suffix_1', - 'sidebar' => 'grid_4' + 'sidebar' => 'grid_4', + 'fullwidth' => 'grid_12' ) ), 'less' => array( @@ -117,7 +123,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'container', 'main' => '', - 'sidebar' => '' + 'sidebar' => '', + 'fullwidth' => '' ) ), 'foundation' => array( @@ -126,7 +133,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'row', 'main' => 'eight columns', - 'sidebar' => 'four columns' + 'sidebar' => 'four columns', + 'fullwidth' => 'twelve columns' ) ), 'bootstrap' => array( @@ -135,7 +143,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'row', 'main' => 'span11', - 'sidebar' => 'span5' + 'sidebar' => 'span5', + 'fullwidth' => 'span16' ) ), 'bootstrap_less' => array( @@ -144,7 +153,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => 'row', 'main' => 'span11', - 'sidebar' => 'span5' + 'sidebar' => 'span5', + 'fullwidth' => 'span16' ) ), 'none' => array( @@ -153,7 +163,8 @@ $roots_css_frameworks = array( 'classes' => array( 'container' => '', 'main' => '', - 'sidebar' => '' + 'sidebar' => '', + 'fullwidth' => '' ) ) ); @@ -179,6 +190,7 @@ function roots_get_default_theme_options($default_framework = '') { 'container_class' => $default_framework_settings['classes']['container'], 'main_class' => $default_framework_settings['classes']['main'], 'sidebar_class' => $default_framework_settings['classes']['sidebar'], + 'fullwidth_class' => $default_framework_settings['classes']['fullwidth'], 'google_analytics_id' => '', 'root_relative_urls' => true, 'clean_menu' => true, @@ -243,6 +255,16 @@ function roots_theme_options_render_page() { + + +
+ +
+ +
+ + + @@ -328,6 +350,10 @@ function roots_theme_options_validate($input) { $output['sidebar_class'] = wp_filter_nohtml_kses($input['sidebar_class']); } + if (isset($input['fullwidth_class'])) { + $output['fullwidth_class'] = wp_filter_nohtml_kses($input['fullwidth_class']); + } + if (isset($input['google_analytics_id'])) { if (preg_match('/^ua-\d{4,9}-\d{1,4}$/i', $input['google_analytics_id'])) { $output['google_analytics_id'] = $input['google_analytics_id']; diff --git a/page-full.php b/page-full.php index 25dc6a5..cd153c4 100644 --- a/page-full.php +++ b/page-full.php @@ -6,7 +6,7 @@ get_header(); ?>
-
+