Changeset 14258


Ignore:
Timestamp:
Apr 15, 2014, 9:30:38 PM (8 years ago)
Author:
jordan
Message:

(trunk, web) #5620 'Inspector - Clickable urls in Comment field' -- added with patch by e-moe, thanks also to cfpp2p for testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/inspector.js

    r14004 r14258  
    107107            date, mixed_date,
    108108            v, u, f, d, pct,
     109            uri,
    109110            now = Date.now();
    110111
     
    397398        if(!str)
    398399            str = none; 
    399         setTextContent(e.comment_lb, str);
     400        uri = parseUri(str);
     401        if (uri.protocol == 'http' || uri.parseUri == 'https') {
     402            str = encodeURI(str);
     403            setInnerHTML(e.comment_lb, '<a href="' + str + '" target="_blank" >' + str + '</a>');
     404        }
     405        else
     406            setTextContent(e.comment_lb, str);
    400407
    401408        //
Note: See TracChangeset for help on using the changeset viewer.