]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/url.js
Add Q click whois thingies.
[irc/quakenet/qwebirc.git] / js / ui / url.js
index dd4f5b0d89fd1f62b77b9db2a3c35741c0e303c5..81cbae738a6beb9a1f56d14ddcc2f2142941a6c1 100644 (file)
@@ -1,5 +1,5 @@
-function urlificate(element, text, execfn, cmdfn) {
-  var punct_re = /(\.*|\,|;)$/;
+qwebirc.ui.urlificate = function(element, text, execfn, cmdfn, window) {
+  var punct_re = /(\.*|\,|;|\])$/;
 
   var txtprocess = function(text, regex, appendfn, matchfn) {
     for(;;) {
@@ -23,7 +23,7 @@ function urlificate(element, text, execfn, cmdfn) {
   };
   
   var appendText = function(text) {
-    element.appendChild(document.createTextNode(text));  
+    qwebirc.util.NBSPCreate(text, element);
   };
   
   var appendChan = function(text) {
@@ -59,7 +59,7 @@ function urlificate(element, text, execfn, cmdfn) {
         return; 
       }
       
-      var cmd = cmdfn(m[1]);
+      var cmd = cmdfn(m[1], window);
       if(cmd) {
         url = "#";
         fn = cmd;