From: Jordan Lee Date: Tue, 15 Apr 2014 21:30:38 +0000 (+0000) Subject: (trunk, web) #5620 'Inspector - Clickable urls in Comment field' -- added with patch... X-Git-Tag: 2.83~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=157bbe73f6e6792c21f27c32cb841081ca8a16c1;p=transmission (trunk, web) #5620 'Inspector - Clickable urls in Comment field' -- added with patch by e-moe, thanks also to cfpp2p for testing --- diff --git a/web/javascript/inspector.js b/web/javascript/inspector.js index d53b53400..ab226f843 100644 --- a/web/javascript/inspector.js +++ b/web/javascript/inspector.js @@ -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, '' + str + ''); + } + else + setTextContent(e.comment_lb, str); // // origin