Permalink
Browse files

Clearing tweets

  • Loading branch information...
1 parent dafc907 commit 749b1da52ccec8e93e5e936b61ac11e21002063b @elektronaut elektronaut committed Jul 16, 2010
Showing with 18 additions and 4 deletions.
  1. +9 −1 README.rdoc
  2. +2 −0 example.html
  3. +6 −2 jquery.livetwitter.js
  4. +1 −1 jquery.livetwitter.min.js
View
@@ -33,12 +33,16 @@ You disable automatic refreshing by passing refresh: false
$("#twitterSearch").liveTwitter('bacon', {limit: 10, refresh: false});
-Stopping, starting and refreshing manually::
+Stopping, starting and refreshing manually:
$("#twitterSearch").each(function(){ this.twitter.stop(); });
$("#twitterSearch").each(function(){ this.twitter.start(); });
$("#twitterSearch").each(function(){ this.twitter.refresh(); });
+If you want to clear the tweets on changing query, you can do this:
+
+ $("#twitterSearch").each(function(){ this.twitter.clear(); }).liveTwitter('my new query');
+
== Search options
@@ -77,6 +81,10 @@ If you want to apply behavior when new tweets are loaded, you can pass a callbac
== Changelog
+=== 1.5.1
+
+* You can now clear the tweets (thanks to Ryan!).
+
=== 1.5.0
* Following lists is now supported.
View
@@ -76,6 +76,8 @@ <h2>User timeline for <a href="http://twitter.com/elektronaut">@elektronaut</a><
$('#searchLinks a').each(function(){
var query = $(this).text();
$(this).click(function(){
+ // Clear the tweets
+ $('#twitterSearch').each(function(){this.twitter.clear()});
// Update the search
$('#twitterSearch').liveTwitter(query);
// Update the header
View
@@ -1,11 +1,11 @@
/*
- * jQuery LiveTwitter 1.5.0
+ * jQuery LiveTwitter 1.5.1
* - Live updating Twitter plugin for jQuery
*
* Copyright (c) 2009-2010 Inge Jørgensen (elektronaut.no)
* Licensed under the MIT license (MIT-LICENSE.txt)
*
- * $Date: 2010/05/30$
+ * $Date: 2010/07/16$
*/
/*
@@ -218,6 +218,10 @@
clearInterval(this.interval);
this.interval = false;
}
+ },
+ clear: function(){
+ $(this.container).find('div.tweet').remove();
+ this.lastTimeStamp = null;
}
};
var twitter = this.twitter;

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 749b1da

Please sign in to comment.