]> granicus.if.org Git - transmission/commitdiff
(trunk, web) #5620 'Inspector - Clickable urls in Comment field' -- added with patch...
authorJordan Lee <jordan@transmissionbt.com>
Tue, 15 Apr 2014 21:30:38 +0000 (21:30 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Tue, 15 Apr 2014 21:30:38 +0000 (21:30 +0000)
web/javascript/inspector.js

index d53b53400f7a7e6e6a1cfab99004f18ba396f259..ab226f843a7bf0b274557ef469ecb86046b7eced 100644 (file)
@@ -106,6 +106,7 @@ function Inspector(controller) {
             creator, mixed_creator,
             date, mixed_date,
             v, u, f, d, pct,
+            uri,
             now = Date.now();
 
         //
@@ -396,7 +397,13 @@ function Inspector(controller) {
         }
         if(!str)
             str = none;  
-        setTextContent(e.comment_lb, str);
+        uri = parseUri(str);
+        if (uri.protocol == 'http' || uri.parseUri == 'https') {
+            str = encodeURI(str);
+            setInnerHTML(e.comment_lb, '<a href="' + str + '" target="_blank" >' + str + '</a>');
+        }
+        else
+            setTextContent(e.comment_lb, str);
 
         //
         //  origin