recover existing conversation loading functionality for home,search,community,display,etc. whilst working on the ajax stuff in network

This commit is contained in:
friendica 2012-07-25 18:57:04 -07:00
parent 78b8684ab4
commit fc53a7a09e
6 changed files with 24 additions and 8 deletions

View File

@ -309,7 +309,7 @@ function localize_item(&$item){
*/
if(!function_exists('conversation')) {
function conversation(&$a, $items, $mode, $update, $preview = false) {
function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional') {
require_once('bbcode.php');
@ -319,6 +319,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$profile_owner = 0;
$page_writeable = false;
$preview = (($page_mode === 'preview') ? true : false);
$previewing = (($preview) ? ' preview ' : '');
if($mode === 'network') {
@ -441,6 +442,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$drop = array(
'pagedropping' => $page_dropping,
'dropping' => $dropping,
'select' => t('Select'),
'delete' => t('Delete'),
@ -732,6 +734,7 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$dropping = true;
$drop = array(
'pagedropping' => $page_dropping,
'dropping' => $dropping,
'select' => t('Select'),
'delete' => t('Delete'),
@ -873,9 +876,19 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
}
}
logger('threads: ' . count($threads) . ' update: ' . $update);
// logger('threads: ' . count($threads) . ' update: ' . $update);
if($update) {
if($page_mode === 'traditional' || $page_mode === 'preview') {
$page_template = get_markup_template("conversation.tpl");
$o = replace_macros($page_template, array(
'$baseurl' => $a->get_baseurl($ssl_state),
'$mode' => $mode,
'$user' => $a->user,
'$threads' => $threads,
'$dropping' => ($page_dropping?t('Delete Selected Items'):False),
));
}
elseif($update) {
$page_template = get_markup_template("conv.tpl");
$o = replace_macros($page_template, array(
'$baseurl' => $a->get_baseurl($ssl_state),

View File

@ -721,7 +721,7 @@ jQuery.timeago.settings.strings = {
$("abbr.wall-item-ago-time").timeago();
$("div.wall-item-body").divgrow({ initialHeight: 400 });
//$("div.wall-item-body").divgrow({ initialHeight: 400 });
});

View File

@ -604,8 +604,8 @@ function item_post(&$a) {
if($preview) {
require_once('include/conversation.php');
$o = conversation($a,array(array_merge($contact_record,$datarray)),'search',false,true);
logger('preview: ' . $o);
$o = conversation($a,array(array_merge($contact_record,$datarray)),'search',false,'preview');
logger('preview: ' . $o, LOGGER_DEBUG);
echo json_encode(array('preview' => $o));
killme();
}

View File

@ -712,7 +712,7 @@ logger('items: ' . count($items));
$mode = (($nouveau) ? 'network-new' : 'network');
$o .= conversation($a,$items,$mode,$update);
$o .= conversation($a,$items,$mode,$update,'client');
if(! $update) {
$o .= alt_pager($a,count($items));

View File

@ -15,6 +15,9 @@ body {
margin: 0px;
}
abbr {
border-bottom: none;
}
a, a:visited, a:link { color: #3465a4; text-decoration: none; }
a:hover {text-decoration: underline; }

View File

@ -62,7 +62,7 @@
<a href="#" id="filer-$item.id" onclick="itemFiler($item.id); return false;" class="filer-item filer-icon" title="$item.filer"></a>
{{ endif }}
<div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$item.id" >
{{ if $item.drop.dropping }}<a href="item/drop/$item.id" onclick="return confirmDelete();" class="icon drophide" title="$item.drop.delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a>{{ endif }}
{{ if $item.drop.pagedropping }}<a href="item/drop/$item.id" onclick="return confirmDelete();" class="icon drophide" title="$item.drop.delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a>{{ endif }}
</div>
{{ if $item.drop.dropping }}<input type="checkbox" onclick="checkboxhighlight(this);" title="$item.drop.select" class="item-select" name="itemselected[]" value="$item.id" />{{ endif }}
<div class="wall-item-delete-end"></div>