diff --git a/media/js/zamboni/outgoing_links.js b/media/js/zamboni/outgoing_links.js new file mode 100644 index 0000000000..9ccb8257d7 --- /dev/null +++ b/media/js/zamboni/outgoing_links.js @@ -0,0 +1,25 @@ + +// Show the actual URL of outgoing links in the status bar. +// e.g. http://outgoing.mozilla.org/v1/b2d58f443178ce1de2ef80bb57dcc80211232c8b/http%3A//wvtc.net/ +// ...will display as http://wvtc.net/ +// +setTimeout(function() { + $(document).ready(function() { + $('a[href^="http://outgoing.mozilla.org"]').each(function(e) { + var $a = $(this), + outgoing = $a.attr('href'), + dest = unescape(outgoing.split('/').slice(5).join('/')); + // Change it to the real destination: + $a.attr('href', dest); + $a.click(function(e) { + // Change it to the outgoing URL: + $a.attr('href', outgoing); + setTimeout(function() { + // Put back the real destination: + $a.attr('href', dest); + }, 100); + return true; + }); + }); + }); +}, 50); diff --git a/settings.py b/settings.py index 8929cad839..74877100eb 100644 --- a/settings.py +++ b/settings.py @@ -393,6 +393,9 @@ MINIFY_BUNDLES = { # Users 'js/zamboni/users.js', + + # Fix-up outgoing links + 'js/zamboni/outgoing_links.js', ), 'zamboni/discovery-pane': ( 'js/zamboni/jquery-1.4.2.min.js',