From 2c843466a93a5083a8f27dee308d5b8514c756de Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Fri, 13 Apr 2012 21:34:21 +0200 Subject: [PATCH] diabook: theme-settings: users can set font-size and line-height for posts and comments --- view/theme/diabook/config.php | 71 +++++++++++++++ view/theme/diabook/style-network.css | 4 +- view/theme/diabook/style-profile.css | 4 +- view/theme/diabook/style.css | 8 +- view/theme/diabook/style.php | 120 ++++++++++++++++++++++++++ view/theme/diabook/theme.php | 4 +- view/theme/diabook/theme_settings.tpl | 8 ++ 7 files changed, 209 insertions(+), 10 deletions(-) create mode 100644 view/theme/diabook/config.php create mode 100644 view/theme/diabook/style.php create mode 100644 view/theme/diabook/theme_settings.tpl diff --git a/view/theme/diabook/config.php b/view/theme/diabook/config.php new file mode 100644 index 000000000..f4eb7aae5 --- /dev/null +++ b/view/theme/diabook/config.php @@ -0,0 +1,71 @@ +"1.4", + "1.3"=>"1.3", + "1.2"=>"1.2", + "1.1"=>"1.1", + ); + + $font_sizes = array( + '14'=>'14', + '13.5'=>'13.5', + '13'=>'13', + '12.5'=>'12.5', + '12'=>'12', + ); + + + + $t = file_get_contents( dirname(__file__). "/theme_settings.tpl" ); + $o .= replace_macros($t, array( + '$submit' => t('Submit'), + '$baseurl' => $a->get_baseurl(), + '$title' => t("Theme settings"), + '$font_size' => array('diabook_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes), + '$line_height' => array('diabook_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights), + )); + return $o; +} diff --git a/view/theme/diabook/style-network.css b/view/theme/diabook/style-network.css index e9fa9d8ba..1e57041e4 100644 --- a/view/theme/diabook/style-network.css +++ b/view/theme/diabook/style-network.css @@ -1318,10 +1318,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook/style-profile.css b/view/theme/diabook/style-profile.css index 31e1f056c..ff39a0456 100644 --- a/view/theme/diabook/style-profile.css +++ b/view/theme/diabook/style-profile.css @@ -1298,10 +1298,10 @@ transition: all 0.2s ease-in-out; } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 420px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } diff --git a/view/theme/diabook/style.css b/view/theme/diabook/style.css index 6edde2520..e73bd1f57 100644 --- a/view/theme/diabook/style.css +++ b/view/theme/diabook/style.css @@ -1435,17 +1435,17 @@ body .pageheader{ } .wall-item-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } .wall-item-photo-container .wall-item-content { - font-size: 12.5px; + max-width: 720px; word-wrap: break-word; - line-height: 1.2; + margin-bottom: 14px; } .wall-item-container .wall-item-content img { diff --git a/view/theme/diabook/style.php b/view/theme/diabook/style.php new file mode 100644 index 000000000..72e8899d4 --- /dev/null +++ b/view/theme/diabook/style.php @@ -0,0 +1,120 @@ +page['htmlhead'] .= sprintf('', $diabook_version); //change css on network and profilepages diff --git a/view/theme/diabook/theme_settings.tpl b/view/theme/diabook/theme_settings.tpl new file mode 100644 index 000000000..564ecc283 --- /dev/null +++ b/view/theme/diabook/theme_settings.tpl @@ -0,0 +1,8 @@ +{{inc field_select.tpl with $field=$font_size}}{{endinc}} + +{{inc field_select.tpl with $field=$line_height}}{{endinc}} + +
+ +
+