Single click URLs to open - 29/01/11 05:08 AM
It would be really nice if there were an option to open URLs with one click rather than two. Perhaps even coloring them similar to how they are on websites.
; Detects single clicks on URLs. ; Holding shift or ctrl will have them open in a new window, if your browser permits. ; on ^*:hotlink:*:*:{ if ($mouse.key & 1) && ($regex($1, $urlre)) { url -a $+ $iif($mouse.key & 6, n) $regml(1) } halt } ; $urlre ; Returns a regular expression that matches URLs in a string and captures them in \1. ; alias urlre { return /(*UTF8) (?:^|[\x20\x09]) [\Q '<([{" \E]* \K ( $& (?: (?:irc|gopher|https?|ftps?|telnet):// | (?:www|ftp)\. ) $& [^\x20\x09]+\.[^\x20\x09]+? ) (?= [\Q ')]}>"., \E]* (?:[\x20\x09]|$) ) /giSx }
on &^*:text:*:*:{ echo -mbflirt $iif(#, #, $nick) $+(<, $left($nick(#, $nick, a, r).pnick, 1), $nick, >) $urlcolour($1-) haltdef } ; $urlcolour(text) ; Returns 'text' with URLs appropriately coloured and underlined. ; alias urlcolour { return $regsubex($1, $urlre, $+($chr(31), $chr(3), 12\1, $chr(3), $chr(31))) } ; American-friendly version! ; alias urlcolor return $urlcolour($1)
$+(<,,$nick($chan,$nick).color,$iif($left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,>)
$+(<,$chr(3),$nick(#,$nick).color,$nick(#,$nick).pnick,$chr(3),>)
$+(<,$chr(3),$nick(#,$nick).color,$nick(#,$nick).pnick,$chr(3),>)