On Fri, Nov 27, 2009 at 8:06 PM, Rivotti <[email protected]> wrote: > Hi Meir, > > I didn't test it but it will probably work: > > str = str.replace( /(http:\S+)/ig, '<a href="$1" target="_blank">link</ > a>' ) >
You may also want to change 'http' to 'https?' (the question mark makes the 's' optional), eg: str = str.replace(/(https?:\S+)/ig, '<a href="$1" target="_blank">$1</a>'); > The "i" flag could be important to ignore case(HTTP or http). You > never know... > > Rivotti > > On Nov 27, 9:59 pm, meir <[email protected]> wrote: >> Hi Ouadi, >> >> Thanx. Great extension. I have a few suggestions, if you ever sit to >> improve it: >> >> 1. Convert the links in the ticker to hyperlinks (you do this with the >> user profile). I wrote a simple method that takes text and does it >> (selectively): >> >> function hyperlinkify( str ) { >> var s = str.match( /http:\S+/g ) ; >> var str1 = str ; >> if( s != null ) { >> var ss >> for ( ss in s ) { >> str1 = str1.replace( s[ss] , '<a href="' + s[ss] + '" >> target="_blank">link</a>' ) ; >> } >> } >> return ( str1 ) ; >> >> } >> >> I am sure there is a more elegant RegExp op to do this... >> >> 2. Enable, as an option, to do a steady text (not marquee) and have a >> next button. This way you turn to a "tweets buster", each tweet is >> waiting until you "next/prev" it. >> >> Thanx again >> >> Meir >> >> On Nov 12, 11:02 am, Ouadi <[email protected]> wrote: >> >> >> >> > Hey guys! I just coded am extension that displays tweets posted by >> > people you follow in an animated ticker, it uses jquery to retrieve >> > and parse information from twitter. >> >> >http://www.chromeextensions.org/social-communications/twitter-ticker-... >> >> > Feel free to post comments! Thank you > > -- > > You received this message because you are subscribed to the Google Groups > "Chromium-extensions" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/chromium-extensions?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "Chromium-extensions" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/chromium-extensions?hl=en.
