Hi,A simple refresh is pretty simple, fetch the full page again if there's no notice text;
function autoRefresh() {
var notice_data = $("#notice_data-text")
if (notice_data.length==0 || notice_data.val().length==0) {
window.location.reload(true);
}
}The JS part of a fetching only new message for the timeline you're watching and inserting in the page is pretty simple as well. In the PHP it's more complex since you have to store a marker for what timeline is shown and what the most recent message was, then keep that updated. For new messages you'll need to check and include new messages as well so you don't get it out of order. You should also add some JS code to keep the time a message was posted updated or you'll get a page full of "posted seconds ago" when running for a full day. (that would actually be cool even without auto-refresh)
It's not simple, but definitely doable. MvH, Kepler Ramanantsoa wrote:
Hello All!I just need some help, i want to add some functionnality to my laconica, as a Timeline Refresh (notice) after X second with Jquery. I want to exploit Utils.js but i can't find any issue. So how to create a separate files as notice_refresh.php with laconica to have the possibility of DIV Refresh (with jquery) ? Is it possible with a simple way ?Regards!Kepler------------------------------------------------------------------------ _______________________________________________ Laconica-dev mailing list [email protected] http://mail.laconi.ca/mailman/listinfo/laconica-dev
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Laconica-dev mailing list [email protected] http://mail.laconi.ca/mailman/listinfo/laconica-dev
