Changeset 61

User picture

Author: frojo56

(2009/02/14 15:47) Almost 3 years ago

More reorg. Fixed text js error

Affected files

Updated twitter_fantastico.user.js Download diff

6061
206
		{
206
		{
207
			for(i=0;i<tweets.length;i++)
207
			for(i=0;i<tweets.length;i++)
208
			{
208
			{
209
				jq_tweet = j("#timeline #status_"+tweets[i].id);
209
				if(appendTweets)
210
				if(appendTweets)
210
				{
211
				{
211
					convert_json_tweet_to_html_tweet(tweets[i]).appendTo("#timeline");;
212
					new_jq_tweet = convert_json_tweet_to_html_tweet(tweets[i]);//.appendTo("#timeline");
213
					add_retweet_button(new_jq_tweet,tweets[i]);
214
					modify_reply_button(new_jq_tweet,tweets[i]);
215
					if(tweets[i].user.screen_name == current_username)
216
					{
217
						new_jq_tweet.find("span.actions div").append("<a class='delete' title='delete this update' href='#delete'></a>");
218
						modify_delete_button(new_jq_tweet,tweets[i]);
219
					}
220
					find_reply_to_me_in_tweet_and_set_to_me_class(new_jq_tweet);
221
					new_jq_tweet.appendTo("#timeline");
212
				}
222
				}
213
				else
223
				else
214
				{
224
				{
215
					jq_tweet = j("#timeline #status_"+tweets[i].id);
216
					oldEntryContent = j("#timeline #status_"+tweets[i].id+" .status-body .entry-content").html();
225
					oldEntryContent = j("#timeline #status_"+tweets[i].id+" .status-body .entry-content").html();
217
					newEntryContent = link_up_status_text(oldEntryContent,false,false,true);
226
					newEntryContent = link_up_status_text(oldEntryContent,false,false,true);
218
					j("#timeline #status_"+tweets[i].id+" .status-body .entry-content").html(newEntryContent);
227
					j("#timeline #status_"+tweets[i].id+" .status-body .entry-content").html(newEntryContent);
219
					modify_reply_button(jq_tweet,tweets[i]);
228
					modify_reply_button(jq_tweet,tweets[i]);
220
					add_retweet_button(jq_tweet,tweets[i]);
229
					add_retweet_button(jq_tweet,tweets[i]);
221
					modify_delete_button(jq_tweet,tweets[i]);
230
					modify_delete_button(jq_tweet,tweets[i]);
231
					find_reply_to_me_in_tweet_and_set_to_me_class(jq_tweet);
222
				}
232
				}
223
				find_reply_to_me_in_tweet_and_set_to_me_class(jq_tweet);
233
				
224
			}
234
			}
225
		}
235
		}
226
	}
236
	}
...
...
233
	if(json_tweet.user.screen_name != current_username)
243
	if(json_tweet.user.screen_name != current_username)
234
	{
244
	{
235
		tweet.find("a.retweet-link").remove();
245
		tweet.find("a.retweet-link").remove();
236
237
		//log("Adding retweet button for "+ json_tweet.id);
246
		//log("Adding retweet button for "+ json_tweet.id);
238
		//log("Adding retweet button for " + json_tweet.id);
247
		//log("Adding retweet button for " + json_tweet.id);
239
		if(tweet.find(".actions div").length==0)
248
		if(tweet.find(".actions div").length==0)
...
...
246
			show_embedded_retweet(j(this).data('json_tweet'));
255
			show_embedded_retweet(j(this).data('json_tweet'));
247
			return false;
256
			return false;
248
		});
257
		});
258
		log("Done adding retweet");
249
	}
259
	}
260
	
250
}
261
}
251
function show_embedded_retweet(json_tweet)
262
function show_embedded_retweet(json_tweet)
252
{
263
{
...
...
316
		show_embedded_reply(j(this).data('json_tweet'));
327
		show_embedded_reply(j(this).data('json_tweet'));
317
		return false;
328
		return false;
318
	});
329
	});
330
	log("Done modifying reply");
319
}
331
}
320
function show_embedded_reply(json_tweet)
332
function show_embedded_reply(json_tweet)
321
{
333
{
...
...
423
	jq_tweet_li.find("span.actions div a[id^=status_star]").attr("id","status_star_"+json_tweet.id);
435
	jq_tweet_li.find("span.actions div a[id^=status_star]").attr("id","status_star_"+json_tweet.id);
424
	jq_tweet_li.find("span.actions div a[id^=status_star]").attr("class",(json_tweet.favorited?"fav":"non-fav"));
436
	jq_tweet_li.find("span.actions div a[id^=status_star]").attr("class",(json_tweet.favorited?"fav":"non-fav"));
425
	jq_tweet_li.find("span.actions div a[id^=status_star]").attr("title",(json_tweet.favorited?"favorite this
update":"un-favorite this tweet"));
437
	jq_tweet_li.find("span.actions div a[id^=status_star]").attr("title",(json_tweet.favorited?"favorite this
update":"un-favorite this tweet"));
426
	modify_reply_button(jq_tweet_li,json_tweet);
438
	
427
	//log("Adding retweet button, via convert_json method.");
439
	//log("Adding retweet button, via convert_json method.");
428
	add_retweet_button(jq_tweet_li,json_tweet);
429
	
440
	
441
	
430
	jq_tweet_li.find("span.actions div a.retweet-link").unbind();
442
	jq_tweet_li.find("span.actions div a.retweet-link").unbind();
431
	
443
	
432
	jq_tweet_li.find("div.embedded-reply").remove();
444
	jq_tweet_li.find("div.embedded-reply").remove();
433
	jq_tweet_li.find("div.embedded-retweet").remove();
445
	jq_tweet_li.find("div.embedded-retweet").remove();
434
	
446
	
435
	if(json_tweet.user.screen_name == current_username)
436
	{
437
		jq_tweet_li.find(".reply").remove();
438
		jq_tweet_li.find(".repl").remove();
439
		jq_tweet_li.find(".retweet-link").remove();
440
		//append trash button
441
		
442
		jq_tweet_li.find("span.actions div").append("<a class='delete' title='delete this update' href='#delete'></a>");
443
		modify_delete_button(jq_tweet_li,json_tweet);
444
	}
445
	if(json_tweet.in_reply_to_status_id != null)
447
	if(json_tweet.in_reply_to_status_id != null)
446
	{
448
	{
447
		jq_tweet_li.find("span.entry-meta").append("&nbsp;<a
href='http://twitter.com/"+json_tweet.in_reply_to_screen_name+"/status/"+json_tweet.in_reply_to_status_id+"'>in reply to
"+json_tweet.in_reply_to_screen_name+"</a>")
449
		jq_tweet_li.find("span.entry-meta").append("&nbsp;<a
href='http://twitter.com/"+json_tweet.in_reply_to_screen_name+"/status/"+json_tweet.in_reply_to_status_id+"'>in reply to
"+json_tweet.in_reply_to_screen_name+"</a>")
448
	}
450
	}
449
	find_reply_to_me_in_tweet_and_set_to_me_class(jq_tweet_li);
451
	//find_reply_to_me_in_tweet_and_set_to_me_class(jq_tweet_li);
450
	return jq_tweet_li;
452
	return jq_tweet_li;
451
}
453
}
452
function determine_what_page_user_is_on()
454
function determine_what_page_user_is_on()