backport of functionality to mark messages as read when navigating with next/previous buttons in message-view

This commit is contained in:
Klaus Leithoff 2010-05-05 14:09:11 +00:00
parent b27b1e7b37
commit 9611d73062
5 changed files with 50 additions and 4 deletions

View File

@ -509,13 +509,17 @@
'mailbox' => base64_encode($this->mailbox)
);
$previousURL = $GLOBALS['egw']->link('/index.php',$linkData);
$previousURL = "window.location.href = '$previousURL'";
$previousURL = "goToMessage('$previousURL')";
$navbarImages['up.button'] = array(
'action' => $previousURL,
'tooltip' => lang('previous message'),
);
} else {
$previousURL = '';
$previousURL = '#';
$navbarImages['up.grey'] = array(
'action' => $previousURL,
'tooltip' => lang('previous message'),
);
}
if($nextMessage['next']) {
@ -526,13 +530,17 @@
'mailbox' => base64_encode($this->mailbox)
);
$nextURL = $GLOBALS['egw']->link('/index.php',$linkData);
$nextURL = "window.location.href = '$nextURL'";
$nextURL = "goToMessage('$nextURL')";
$navbarImages['down.button'] = array(
'action' => $nextURL,
'tooltip' => lang('next message'),
);
} else {
$nextURL = '';
$nextURL = '#';
$navbarImages['down.grey'] = array(
#'action' => $nextURL,
'tooltip' => lang('next message'),
);
}

View File

@ -1,3 +1,20 @@
function parentRefreshListRowStyle(oldID, newID)
{
var trElement;
var aElements;
trElement = document.getElementById('row_'+oldID);
trElement.style.fontWeight='normal';
aElements = trElement.getElementsByTagName("a");
aElements[0].style.fontWeight='normal';
aElements[1].style.fontWeight='normal';
trElement = document.getElementById('row_'+newID);
trElement.style.fontWeight='normal';
aElements = trElement.getElementsByTagName("a");
aElements[0].style.fontWeight='normal';
aElements[1].style.fontWeight='normal';
}
function setStatusMessage(_message) {
document.getElementById('messageCounter').innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td><img src="'+ activityImagePath +'"></td><td>&nbsp;' + _message + '</td></tr></table>';
}

View File

@ -8,11 +8,32 @@ var headerDIVHeight;
var bodyDIVTop;
function getUrlPart(url, name )
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( url );
if( results == null )
return "";
else
return results[1];
}
function sendNotify (uid) {
ret = confirm(lang_sendnotify)
xajax_doXMLHTTP("felamimail.ajaxfelamimail.sendNotify",uid,ret);
}
function goToMessage(url) {
//alert(getUrlPart(window.location.href,'uid'));
var oldUid = getUrlPart(window.location.href,'uid');
var newUid = getUrlPart(url,'uid');
window.opener.parentRefreshListRowStyle(oldUid, newUid);
window.location.href = url;
//opener.refresh();
}
function initAll()
{
//tab.init();

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B