Changeset 64

User picture

Author: frojo56

(2009/02/17 15:05) Almost 3 years ago

Embedded reply working on single-tweet page

Affected files

Updated twitter_fantastico.user.js Download diff

6364
317
function modify_reply_button(tweet,json_tweet)
317
function modify_reply_button(tweet,json_tweet)
318
{
318
{
319
	//log("Modifying reply button for " + json_tweet.id);
319
	//log("Modifying reply button for " + json_tweet.id);
320
	
320
	tweet.find(".actions a.repl").remove();
321
	tweet.find(".actions div a.repl").remove();
321
	tweet.find(".actions a.reply").remove();
322
	tweet.find(".actions div a.reply").remove();
322
	if(tweet.find(".actions div").length>0)
323
	jq_reply_link = j("<a class='reply' href='#reply'></a>").appendTo(tweet.find(".actions div"));
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"));
324
	jq_reply_link.css({"height":"16px","background-image":"url(http://static.twitter.com/images/icon_reply.gif)"});
326
	jq_reply_link.css({"height":"16px","background-image":"url(http://static.twitter.com/images/icon_reply.gif)"});
325
	jq_reply_link.data('json_tweet',json_tweet);
327
	jq_reply_link.data('json_tweet',json_tweet);
326
	if(json_tweet.user.screen_name == current_username)
328
	if(json_tweet.user.screen_name == current_username)
...
...
339
}
341
}
340
function show_embedded_reply(json_tweet)
342
function show_embedded_reply(json_tweet)
341
{
343
{
342
	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
	else
347
		jq_tweet = j("#permalink");
348
	if(jq_tweet.find(".status-body .embedded-reply").length==0)
343
	{
349
	{
344
		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 = 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>");
345
		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);
346
		jq_textarea = jq_embedded_reply.find("textarea.reply-text");
352
		jq_textarea = jq_embedded_reply.find("textarea.reply-text");
347
		//jq_textarea.focus(function(){
353
		//jq_textarea.focus(function(){
348
		//	counter_span = j(this).parent().find("span.counter");
354
		//	counter_span = j(this).parent().find("span.counter");
...
...
567
	}\
573
	}\
568
	.to_me, .to_me .entry-content\
574
	.to_me, .to_me .entry-content\
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
	}\
573
	.mine\
579
	.mine\
574
	{\
580
	{\