From a5693df07fdf6fdf31247bfe0700d4c8096d4fbf Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 30 Oct 2013 17:33:10 -0700 Subject: [PATCH] issue #189 - show post edited time on relative date hovertip --- include/ItemObject.php | 1 + include/conversation.php | 1 + js/main.js | 11 +++++++++++ view/tpl/conv_item.tpl | 2 +- view/tpl/search_item.tpl | 3 +-- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/ItemObject.php b/include/ItemObject.php index 59b4538df..818f8c0b2 100644 --- a/include/ItemObject.php +++ b/include/ItemObject.php @@ -216,6 +216,7 @@ class Item extends BaseObject { 'str_app' => sprintf( t(' from %s'), $item['app']), 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), + 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''), 'lock' => $lock, 'verified' => $verified, 'unverified' => $unverified, diff --git a/include/conversation.php b/include/conversation.php index 831a00519..e8b41e775 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -685,6 +685,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $ 'str_app' => sprintf( t(' from %s'), $item['app']), 'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'), 'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'), + 'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''), 'location' => $location, 'indent' => '', 'owner_name' => $owner_name, diff --git a/js/main.js b/js/main.js index f4599e20c..a9e670da5 100644 --- a/js/main.js +++ b/js/main.js @@ -580,6 +580,17 @@ function updateConvItems(mode,data) { updateConvItems(update_mode,data); $("#page-spinner").spin(false); $("#profile-jot-text-loading").spin(false); + + // FIXME - the following lines were added so that almost + // immediately after we update the posts on the page, we + // re-check and update the notification counts. + // As it turns out this causes a bit of an inefficiency + // as we're pinging twice for every update, once before + // and once after. A btter way to do this is to rewrite + // NavUpdate and perhpas LiveUpdate so that we check for + // post updates first and only call the notification ping + // once. + updateCountsOnly = true; if(timer) clearTimeout(timer); timer = setTimeout(NavUpdate,10); diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 095bd0df3..6927eb9e4 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -39,7 +39,7 @@
{{$item.name}}{{if $item.owner_url}} {{$item.via}} {{$item.owner_name}}{{/if}}
-
{{if $item.verified}} {{/if}}{{$item.localtime}}{{if $item.app}}{{$item.str_app}}{{/if}}
+
{{if $item.verified}} {{/if}}{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.app}}{{$item.str_app}}{{/if}}
{{$item.title}}
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl index 5953522dc..853bbfdcd 100755 --- a/view/tpl/search_item.tpl +++ b/view/tpl/search_item.tpl @@ -24,8 +24,7 @@
{{$item.name}}
-
{{if $item.verified}} {{/if}}{{$item.localtime}}{{if $item.app}}{{$item.str_app}}{{/if}}
- +
{{if $item.verified}} {{/if}}{{$item.localtime}}{{if $item.editedtime}} {{$item.editedtime}}{{/if}}{{if $item.app}}{{$item.str_app}}{{/if}}
{{$item.title}}