- "+
"
- From "+ "
- "+source+" "+ // may have a link, I think "
- "+
"
- To "+ "
- "+ "in reply to"+ " "+ "
// update the local timeline from a Meteor server // var MeteorUpdater = function() { var _server; var _port; var _timeline; var _userid; var _replyurl; var _favorurl; var _deleteurl; return { init: function(server, port, timeline, userid, replyurl, favorurl, deleteurl) { _userid = userid; _replyurl = replyurl; _favorurl = favorurl; _deleteurl = deleteurl; Meteor.callbacks["process"] = function(data) { receive(JSON.parse(data)); }; Meteor.host = server; Meteor.port = port; Meteor.joinChannel(timeline, 0); Meteor.connect(); } } function receive(data) { id = data.id; // Don't add it if it already exists // if ($("#notice-"+id).length > 0) { return; } var noticeItem = makeNoticeItem(data); $("#notices_primary .notices").prepend(noticeItem, true); $("#notices_primary .notice:first").css({display:"none"}); $("#notices_primary .notice:first").fadeIn(1000); NoticeHover(); NoticeReply(); } function makeNoticeItem(data) { user = data['user']; html = data['html'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"'); source = data['source'].replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"'); ni = "
"+html+"
"+ "