From 9d738570eef76f5f896898ba5f70a5149a20c1ce Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Mon, 1 Oct 2012 08:58:05 -0400 Subject: [PATCH] quattro: options for posts and textareas font size --- view/theme/quattro/config.php | 25 ++++++++++---- view/theme/quattro/dark/style.css | 47 +++++++++++++++++++++++++-- view/theme/quattro/green/style.css | 47 +++++++++++++++++++++++++-- view/theme/quattro/quattro.less | 45 +++++++++++++++++++++++++ view/theme/quattro/style.php | 19 ++++++++++- view/theme/quattro/theme_settings.tpl | 20 ++++++++++-- 6 files changed, 188 insertions(+), 15 deletions(-) diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index e3d5b78102..0f2fc53ca0 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -11,8 +11,10 @@ function theme_content(&$a){ $align = get_pconfig(local_user(), 'quattro', 'align' ); $color = get_pconfig(local_user(), 'quattro', 'color' ); - - return quattro_form($a,$align, $color); + $tfs = get_pconfig(local_user(),"quattro","tfs"); + $pfs = get_pconfig(local_user(),"quattro","pfs"); + + return quattro_form($a,$align, $color, $tfs, $pfs); } function theme_post(&$a){ @@ -22,6 +24,8 @@ function theme_post(&$a){ if (isset($_POST['quattro-settings-submit'])){ set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']); set_pconfig(local_user(), 'quattro', 'color', $_POST['quattro_color']); + set_pconfig(local_user(), 'quattro', 'tfs', $_POST['quattro_tfs']); + set_pconfig(local_user(), 'quattro', 'pfs', $_POST['quattro_pfs']); } } @@ -29,25 +33,32 @@ function theme_post(&$a){ function theme_admin(&$a){ $align = get_config('quattro', 'align' ); $color = get_config('quattro', 'color' ); - - return quattro_form($a,$align, $color); + $tfs = get_config("quattro","tfs"); + $pfs = get_config("quattro","pfs"); + + return quattro_form($a,$align, $color, $tfs, $pfs); } function theme_admin_post(&$a){ if (isset($_POST['quattro-settings-submit'])){ set_config('quattro', 'align', $_POST['quattro_align']); set_config('quattro', 'color', $_POST['quattro_color']); + set_config('quattro', 'tfs', $_POST['quattro_tfs']); + set_config('quattro', 'pfs', $_POST['quattro_pfs']); } } -function quattro_form(&$a, $align, $color){ +function quattro_form(&$a, $align, $color, $tfs, $pfs){ $colors = array( "dark"=>"Quattro", "lilac"=>"Lilac", "green"=>"Green" ); - + + if ($tfs===false) $tfs="20"; + if ($pfs===false) $pfs="12"; + $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" ); $o .= replace_macros($t, array( '$submit' => t('Submit'), @@ -55,6 +66,8 @@ function quattro_form(&$a, $align, $color){ '$title' => t("Theme settings"), '$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))), '$color' => array('quattro_color', t('Color scheme'), $color, '', $colors), + '$pfs' => array('quattro_pfs', t('Posts font size'), $pfs), + '$tfs' => array('quattro_tfs',t('Textareas font size'), $tfs), )); return $o; } diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index c2dd472afd..524edf4e3d 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -1152,9 +1152,6 @@ section { opacity: 0.5; } .wwto { - position: absolute !important; - width: 25px; - height: 25px; background: #FFFFFF; border: 2px solid #364e59; height: 25px; @@ -2140,3 +2137,47 @@ footer { .videobb:hover { background-position: -112px -16px; } +/** range input css **/ +/* slider root element */ +.slider { + height: 2px; + position: relative; + cursor: pointer; + border: 1px solid #333; + width: 200px; + margin: 10px 0px 10px 0px; + float: left; +} +/* progress bar (enabled with progress: true) */ +.progress { + height: 9px; + background-color: #C5FF00; + display: none; + opacity: 0.6; +} +/* drag handle */ +.handle { + background-color: #ccc; + height: 16px; + width: 8px; + top: -8px; + position: absolute; + display: block; + margin-top: 1px; + border: 1px solid #000; + cursor: move; + -moz-border-radius: 0 0 5px 5px; + -webkit-border-radius: 0 0 5px 5px; + border-radius: 0 0 5px 5px; + -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); + -moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); + box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); +} +/* the input field */ +.range { + width: 20px!important; + font-size: 8pt; + margin-left: 10px; + border: 0px; + color: #999999; +} diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index 47db715f92..a89277a128 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -1152,9 +1152,6 @@ section { opacity: 0.5; } .wwto { - position: absolute !important; - width: 25px; - height: 25px; background: #FFFFFF; border: 2px solid #364e59; height: 25px; @@ -2140,3 +2137,47 @@ footer { .videobb:hover { background-position: -112px -16px; } +/** range input css **/ +/* slider root element */ +.slider { + height: 2px; + position: relative; + cursor: pointer; + border: 1px solid #333; + width: 200px; + margin: 10px 0px 10px 0px; + float: left; +} +/* progress bar (enabled with progress: true) */ +.progress { + height: 9px; + background-color: #C5FF00; + display: none; + opacity: 0.6; +} +/* drag handle */ +.handle { + background-color: #ccc; + height: 16px; + width: 8px; + top: -8px; + position: absolute; + display: block; + margin-top: 1px; + border: 1px solid #000; + cursor: move; + -moz-border-radius: 0 0 5px 5px; + -webkit-border-radius: 0 0 5px 5px; + border-radius: 0 0 5px 5px; + -webkit-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); + -moz-box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); + box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7); +} +/* the input field */ +.range { + width: 20px!important; + font-size: 8pt; + margin-left: 10px; + border: 0px; + color: #999999; +} diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index e7325b7ccb..ca4ec2625d 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -1457,3 +1457,48 @@ footer { height: 100px; display: table-row; } .videobb:hover { background-position: -112px -16px; } +/** range input css **/ +/* slider root element */ +.slider { + height:2px; + position:relative; + cursor:pointer; + border:1px solid #333; + width:200px; + margin:10px 0px 10px 0px; + float: left; +} + +/* progress bar (enabled with progress: true) */ +.progress { + height:9px; + background-color:#C5FF00; + display:none; + opacity:0.6; +} + +/* drag handle */ +.handle { + background-color:#ccc; + height:16px; + width:8px; + top:-8px; + position:absolute; + display:block; + margin-top:1px; + border:1px solid #000; + cursor:move; + .roundbottom(); + .shadow(); + +} + +/* the input field */ +.range { + width: 20px!important; + font-size: 8pt; + margin-left: 10px; + border: 0px; + color: @FieldHelpColor; +} + diff --git a/view/theme/quattro/style.php b/view/theme/quattro/style.php index 33c8a246ef..c75091eb5b 100644 --- a/view/theme/quattro/style.php +++ b/view/theme/quattro/style.php @@ -29,10 +29,27 @@ "; } - $textarea_font_size = "20"; + + + $textarea_font_size = false; + $post_font_size = false; + + $site_textarea_font_size = get_config("quattro","tfs"); + $site_post_font_size = get_config("quattro","pfs"); + if ($site_textarea_font_size===false) $site_textarea_font_size="20"; + if ($site_post_font_size===false) $site_post_font_size="12"; + + if (local_user()) { + $textarea_font_size = get_pconfig(local_user(), "quattro","tfs"); + $post_font_size = get_pconfig(local_user(), "quattro","pfs"); + } + + if ($textarea_font_size===false) $textarea_font_size = $site_textarea_font_size; + if ($post_font_size===false) $post_font_size = $site_post_font_size; echo " textarea { font-size: ${textarea_font_size}px; } .wall-item-comment-wrapper .comment-edit-text-full { font-size: ${textarea_font_size}px; } #jot .profile-jot-text:focus { font-size: ${textarea_font_size}px; } + .wall-item-container .wall-item-content { font-size: ${post_font_size}px; } "; \ No newline at end of file diff --git a/view/theme/quattro/theme_settings.tpl b/view/theme/quattro/theme_settings.tpl index 54416cc16a..47105d7aa4 100644 --- a/view/theme/quattro/theme_settings.tpl +++ b/view/theme/quattro/theme_settings.tpl @@ -4,7 +4,22 @@ {{inc field_select.tpl with $field=$align}}{{endinc}} - + +
+ + + +
+ + +
+ + + +
+ + +
@@ -12,5 +27,6 @@
\ No newline at end of file