Author: frojo56
(2009/02/17 15:05) Almost 3 years ago
Embedded reply working on single-tweet page
317
function modify_reply_button(tweet,json_tweet)
318
{
319
//log("Modifying reply button for " + json_tweet.id);
320
tweet.find(".actions a.repl").remove();
321
tweet.find(".actions div a.repl").remove();
tweet.find(".actions a.reply").remove();
322
tweet.find(".actions div a.reply").remove();
if(tweet.find(".actions div").length>0)
323
jq_reply_link = j("<a class='reply' href='#reply'></a>").appendTo(tweet.find(".actions div"));
324
else
325
jq_reply_link = j("<a class='reply' href='#reply'></a>").appendTo(tweet.find(".actions"));
jq_reply_link.css({"height":"16px","background-image":"url(http://static.twitter.com/images/icon_reply.gif)"});
326
jq_reply_link.data('json_tweet',json_tweet);
327
if(json_tweet.user.screen_name == current_username)
328
...
339
}
341
340
function show_embedded_reply(json_tweet)
342
343
if(j("li#status_"+json_tweet.id+" span.status-body div.embedded-reply").length==0)
344
if(j("#status_"+json_tweet.id).length>0)
345
jq_tweet = j("#status_"+json_tweet.id);
346
347
jq_tweet = j("#permalink");
348
if(jq_tweet.find(".status-body .embedded-reply").length==0)
349
jq_embedded_reply = j("<div id='reply_"+json_tweet.id+"' class='embedded-reply'><span class='counter'>140</span><br/><textarea class='reply-text'>@"+json_tweet.user.screen_name+"</textarea><br/><a class='reply-submit' href='#'>Reply</a><a class='reply-cancel' href='#'>Cancel</a></div>");
350
jq_embedded_reply.appendTo("li#status_"+json_tweet.id+" span.status-body").effect('scale',{from:{height:0},percent:100,scale:'box',direction:'vertical'},300);
351
jq_embedded_reply.appendTo(jq_tweet.find(".status-body")).effect('scale',{from:{height:0},percent:100,scale:'box',direction:'vertical'},300);
jq_textarea = jq_embedded_reply.find("textarea.reply-text");
352
//jq_textarea.focus(function(){
353
// counter_span = j(this).parent().find("span.counter");
354
567
}\
573
568
.to_me, .to_me .entry-content\
574
569
{\
575
570
background-color:#FFCC77;\
576
background-color:#FFDD99;\
571
background: #FFCC77 none repeat scroll 0 0 !important;\
577
background: #FFDD99 none repeat scroll 0 0 !important;\
572
578
.mine\
579
580
{{//log("Modifying reply button for " + json_tweet.id);//log("Modifying reply button for " + json_tweet.id);tweet.find(".actions a.repl").remove();tweet.find(".actions div a.repl").remove();tweet.find(".actions a.reply").remove();tweet.find(".actions div a.reply").remove();if(tweet.find(".actions div").length>0)jq_reply_link = j("<a class='reply' href='#reply'></a>").appendTo(tweet.find(".actions div"));jq_reply_link = j("<a class='reply' href='#reply'></a>").appendTo(tweet.find(".actions div"));elsejq_reply_link = j("<a class='reply' href='#reply'></a>").appendTo(tweet.find(".actions"));jq_reply_link.css({"height":"16px","background-image":"url(http://static.twitter.com/images/icon_reply.gif)"});jq_reply_link.css({"height":"16px","background-image":"url(http://static.twitter.com/images/icon_reply.gif)"});jq_reply_link.data('json_tweet',json_tweet);jq_reply_link.data('json_tweet',json_tweet);{{if(j("li#status_"+json_tweet.id+" span.status-body div.embedded-reply").length==0)if(j("#status_"+json_tweet.id).length>0)jq_tweet = j("#status_"+json_tweet.id);elsejq_tweet = j("#permalink");if(jq_tweet.find(".status-body .embedded-reply").length==0){{jq_embedded_reply = j("<div id='reply_"+json_tweet.id+"' class='embedded-reply'><span class='counter'>140</span><br/><textarea class='reply-text'>@"+json_tweet.user.screen_name+"</textarea><br/><a class='reply-submit' href='#'>Reply</a><a class='reply-cancel' href='#'>Cancel</a></div>");jq_embedded_reply = j("<div id='reply_"+json_tweet.id+"' class='embedded-reply'><span class='counter'>140</span><br/><textarea class='reply-text'>@"+json_tweet.user.screen_name+"</textarea><br/><a class='reply-submit' href='#'>Reply</a><a class='reply-cancel' href='#'>Cancel</a></div>");jq_embedded_reply.appendTo("li#status_"+json_tweet.id+" span.status-body").effect('scale',{from:{height:0},percent:100,scale:'box',direction:'vertical'},300);jq_embedded_reply.appendTo(jq_tweet.find(".status-body")).effect('scale',{from:{height:0},percent:100,scale:'box',direction:'vertical'},300);jq_textarea = jq_embedded_reply.find("textarea.reply-text");jq_textarea = jq_embedded_reply.find("textarea.reply-text");//jq_textarea.focus(function(){//jq_textarea.focus(function(){// counter_span = j(this).parent().find("span.counter");// counter_span = j(this).parent().find("span.counter");{\{\background-color:#FFCC77;\background-color:#FFDD99;\background: #FFCC77 none repeat scroll 0 0 !important;\background: #FFDD99 none repeat scroll 0 0 !important;\{\{\