[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [pups/production] [#12625] Stops prodromus from eating http/https links



commit dff26ee81d74a11a40a39d7b57e942e2f9fdebb5
Author: Sherief <sheriefalaa.w@xxxxxxxxx>
Date:   Thu Oct 2 01:07:59 2014 +0200

    [#12625] Stops prodromus from eating http/https links
    
    The webchat UI previously ate http/https from links as a form of
    simplifying/beautifying urls but that proved bad when users copy/pasted
    logs so now it displays full links instead of simpler ones.
---
 static/js/prodromus.js |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/static/js/prodromus.js b/static/js/prodromus.js
index 7dbe826..29b2331 100644
--- a/static/js/prodromus.js
+++ b/static/js/prodromus.js
@@ -105,13 +105,7 @@ Prodromus.Util = {
         text = text.replace(
             /((https?\:\/\/|ftp\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/gi
           , function( url ) {
-                nice = url;
-                if( url.match( "^https?:\/\/" ) ) {
-                    nice = nice.replace( /^https?:\/\//i, "" )
-                } else {
-                    url = 'http://'+url;
-                }			
-                return '<a target="_blank" href="' + url + '">' + nice.replace( /^www./i, "" ) + '</a>';
+                return '<a target="_blank" href="' + url + '">' + url + '</a>';
 		    }
 		);
 		



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits