Skip to content

Instantly share code, notes, and snippets.

@funkatron
Created September 24, 2010 21:29
Show Gist options
  • Save funkatron/596086 to your computer and use it in GitHub Desktop.
Save funkatron/596086 to your computer and use it in GitHub Desktop.
Spaz.TimelineFilters.defaultEntryFilters = [
{
'label':'nl2br',
'func':function(d) {
d.text = sch.nl2br(d.text);
if (d.SC_is_retweet) {
d.retweeted_status.text = sch.nl2br(d.retweeted_status.text);
}
return d;
}
},
{
'label':'autolink',
'func':function(d) {
d.text = sch.makeClickable(d.text, SPAZ_MAKECLICKABLE_OPTS);
if (d.SC_is_retweet) {
d.retweeted_status.text = sch.makeClickable(d.retweeted_status.text, SPAZ_MAKECLICKABLE_OPTS);
}
return d;
}
},
{
'label':'emoticons',
'func':function(d) {
d.text = Emoticons.SimpleSmileys.convertEmoticons(d.text);
if (d.SC_is_retweet) {
d.retweeted_status.text = Emoticons.SimpleSmileys.convertEmoticons(d.retweeted_status.text);
}
return d;
}
},
{
'label':'markdown',
'func':function(d) {
var md = new Showdown.converter();
d.text = md.makeHtml(d.text);
d.text = d.text.replace(/href="([^"]+)"/gi, 'href="$1" title="Open link in a browser window" class="inline-link"');
return d;
}
},
{
'label':'getImageURLs',
'func':function(d) {
var sui = new SpazImageURL();
if (d.SC_is_retweet) {
d.SC_thumbnail_urls = sui.getThumbsForUrls(d.retweeted_status.text);
} else {
d.SC_thumbnail_urls = sui.getThumbsForUrls(d.SC_text_raw||d.text);
}
return d
}
},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment