From d9279da369d34a804f9e1af6b5b88ae0c3864854 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Thu, 9 Aug 2012 21:17:11 -0600 Subject: [PATCH] - Frost Mobile: redo CSS to adjust automatically to the screen width - Frost Mobile: various tweaks and fixes - Allow themes to limit number of items on the Network page --- boot.php | 1 + mod/network.php | 15 ++- view/theme/frost-mobile/TODO | 8 +- view/theme/frost-mobile/head.tpl | 7 +- view/theme/frost-mobile/js/main.js | 18 ++-- view/theme/frost-mobile/js/main.min.js | 2 +- view/theme/frost-mobile/js/theme.js | 6 +- view/theme/frost-mobile/mail_conv.tpl | 18 ++++ view/theme/frost-mobile/style.css | 121 +++++++++++++++++-------- view/theme/frost-mobile/theme.php | 2 +- 10 files changed, 137 insertions(+), 61 deletions(-) create mode 100644 view/theme/frost-mobile/mail_conv.tpl diff --git a/boot.php b/boot.php index c50dbb582f..647f779e81 100644 --- a/boot.php +++ b/boot.php @@ -364,6 +364,7 @@ if(! class_exists('App')) { public $sourcename = ''; public $videowidth = 425; public $videoheight = 350; + public $force_max_items = 0; private $scheme; private $hostname; diff --git a/mod/network.php b/mod/network.php index 17368ab92d..97f00eeda9 100644 --- a/mod/network.php +++ b/mod/network.php @@ -563,7 +563,7 @@ function network_content(&$a, $update = 0) { } else { - if(! get_pconfig(local_user(),'system','alt_pager')) { + if(! get_pconfig(local_user(),'system','alt_pager')) { $r = q("SELECT COUNT(*) AS `total` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 @@ -576,10 +576,15 @@ function network_content(&$a, $update = 0) { if(count($r)) { $a->set_pager_total($r[0]['total']); } - } - $itemspage_network = get_pconfig(local_user(),'system','itemspage_network'); - $a->set_pager_itemspage(((intval($itemspage_network)) ? $itemspage_network : 40)); - $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); + } + + $itemspage_network = get_pconfig(local_user(),'system','itemspage_network'); + $itemspage_network = ((intval($itemspage_network)) ? $itemspage_network : 40); + if(($a->force_max_items > 0) && ($a->force_max_items < $itemspage_network)) + $itemspage_network = $a->force_max_items; + + $a->set_pager_itemspage($itemspage_network); + $pager_sql = sprintf(" LIMIT %d, %d ",intval($a->pager['start']), intval($a->pager['itemspage'])); } $simple_update = (($update) ? " and `item`.`unseen` = 1 " : ''); diff --git a/view/theme/frost-mobile/TODO b/view/theme/frost-mobile/TODO index 940d9e588b..05e32cb47f 100644 --- a/view/theme/frost-mobile/TODO +++ b/view/theme/frost-mobile/TODO @@ -12,11 +12,15 @@ Photo album display? - Admin: access to more pages than summary? -- Embedded video playback is way too big +- Find a way to show embedded videos at the normal size for tablets that can handle it + +- Need to find a way to deal with freakin annoying elements that don't respect screen width limits. Specifically, need to find a way to keep them from forcing a horizontal scroll bar to show up and making the rest of the body text overflow the item's borders that is screen-width sensitive (it's annoying to have a 300px truncated code block on a 1024px wide screen). At least the following cause problems: + - code blocks + - blockquote blocks + - #reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongtags - Needs to be faster! - Reduce DOM elements (~2400 for 10 items, ~8400 for 40 items) - - Automatically set limit of 10 items for Network and Profile? diff --git a/view/theme/frost-mobile/head.tpl b/view/theme/frost-mobile/head.tpl index 8496667e13..a849f44593 100644 --- a/view/theme/frost-mobile/head.tpl +++ b/view/theme/frost-mobile/head.tpl @@ -1,7 +1,10 @@ - + + + +