Updated XHR return markup for Realtime plugin

This commit is contained in:
Sarven Capadisli 2009-09-15 13:53:16 +00:00
parent cf0d449fd8
commit a9cf185e69

View File

@ -1,8 +1,8 @@
// add a notice encoded as JSON into the current timeline // add a notice encoded as JSON into the current timeline
// //
// TODO: i18n
RealtimeUpdate = { RealtimeUpdate = {
_userid: 0, _userid: 0,
_replyurl: '', _replyurl: '',
_favorurl: '', _favorurl: '',
@ -50,26 +50,15 @@ RealtimeUpdate = {
"<p class=\"entry-content\">"+html+"</p>"+ "<p class=\"entry-content\">"+html+"</p>"+
"</div>"+ "</div>"+
"<div class=\"entry-content\">"+ "<div class=\"entry-content\">"+
"<dl class=\"timestamp\">"+ "<a class=\"timestamp\" rel=\"bookmark\" href=\""+data['url']+"\" >"+
"<dt>Published</dt>"+
"<dd>"+
"<a rel=\"bookmark\" href=\""+data['url']+"\" >"+
"<abbr class=\"published\" title=\""+data['created_at']+"\">a few seconds ago</abbr>"+ "<abbr class=\"published\" title=\""+data['created_at']+"\">a few seconds ago</abbr>"+
"</a> "+ "</a> "+
"</dd>"+ "<span class=\"source\">"+
"</dl>"+ "from "+
"<dl class=\"device\">"+ "<span class=\"device\">+source+</span>"++ // may have a link
"<dt>From</dt> "+ "</span>";
"<dd>"+source+"</dd>"+ // may have a link, I think
"</dl>";
if (data['in_reply_to_status_id']) { if (data['in_reply_to_status_id']) {
ni = ni+" <dl class=\"response\">"+ ni = ni+" <a class=\"response\" href=\""+data['in_reply_to_status_url']+"\">in context</a>";
"<dt>To</dt>"+
"<dd>"+
"<a href=\""+data['in_reply_to_status_url']+"\" rel=\"in-reply-to\">in reply to</a>"+
"</dd>"+
"</dl>";
} }
ni = ni+"</div>"+ ni = ni+"</div>"+
@ -96,7 +85,7 @@ RealtimeUpdate = {
ff = "<form id=\"favor-"+id+"\" class=\"form_favor\" method=\"post\" action=\""+RealtimeUpdate._favorurl+"\">"+ ff = "<form id=\"favor-"+id+"\" class=\"form_favor\" method=\"post\" action=\""+RealtimeUpdate._favorurl+"\">"+
"<fieldset>"+ "<fieldset>"+
"<legend>Favor this notice</legend>"+ // XXX: i18n "<legend>Favor this notice</legend>"+
"<input name=\"token-"+id+"\" type=\"hidden\" id=\"token-"+id+"\" value=\""+session_key+"\"/>"+ "<input name=\"token-"+id+"\" type=\"hidden\" id=\"token-"+id+"\" value=\""+session_key+"\"/>"+
"<input name=\"notice\" type=\"hidden\" id=\"notice-n"+id+"\" value=\""+id+"\"/>"+ "<input name=\"notice\" type=\"hidden\" id=\"notice-n"+id+"\" value=\""+id+"\"/>"+
"<input type=\"submit\" id=\"favor-submit-"+id+"\" name=\"favor-submit-"+id+"\" class=\"submit\" value=\"Favor\" title=\"Favor this notice\"/>"+ "<input type=\"submit\" id=\"favor-submit-"+id+"\" name=\"favor-submit-"+id+"\" class=\"submit\" value=\"Favor\" title=\"Favor this notice\"/>"+
@ -108,13 +97,7 @@ RealtimeUpdate = {
makeReplyLink: function(id, nickname) makeReplyLink: function(id, nickname)
{ {
var rl; var rl;
rl = "<dl class=\"notice_reply\">"+ rl = "<a class=\"notice_reply\" href=\""+RealtimeUpdate._replyurl+"?replyto="+nickname+"\" title=\"Reply to this notice\">Reply <span class=\"notice_id\">"+id+"</span></a>";
"<dt>Reply to this notice</dt>"+
"<dd>"+
"<a href=\""+RealtimeUpdate._replyurl+"?replyto="+nickname+"\" title=\"Reply to this notice\">Reply <span class=\"notice_id\">"+id+"</span>"+
"</a>"+
"</dd>"+
"</dl>";
return rl; return rl;
}, },
@ -123,12 +106,7 @@ RealtimeUpdate = {
var dl, delurl; var dl, delurl;
delurl = RealtimeUpdate._deleteurl.replace("0000000000", id); delurl = RealtimeUpdate._deleteurl.replace("0000000000", id);
dl = "<dl class=\"notice_delete\">"+ dl = "<a class=\"notice_delete\" href=\""+delurl+"\" title=\"Delete this notice\">Delete</a>";
"<dt>Delete this notice</dt>"+
"<dd>"+
"<a href=\""+delurl+"\" title=\"Delete this notice\">Delete</a>"+
"</dd>"+
"</dl>";
return dl; return dl;
}, },