From a1ffcc52594b1e7240501aab0ea145f1da3edb5a Mon Sep 17 00:00:00 2001 From: Syed Hassan Raza Date: Tue, 13 Jan 2015 17:30:17 +0500 Subject: [PATCH] Disable referrer (TNL-1144) --- common/static/js/vendor/noreferrer.js | 10 ++++++++++ lms/templates/footer-edx-new.html | 14 ++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 common/static/js/vendor/noreferrer.js diff --git a/common/static/js/vendor/noreferrer.js b/common/static/js/vendor/noreferrer.js new file mode 100644 index 0000000000..d853a0bfb4 --- /dev/null +++ b/common/static/js/vendor/noreferrer.js @@ -0,0 +1,10 @@ +/* + jquery.noreferrer.js, version 0.1.3 + https://github.com/knu/noreferrer + + Copyright (c) 2011 Akinori MUSHA + Licensed under the 2-clause BSD license. +*/ +(function(){(function(){$.browser.webkit||$.event.add(window,"load",function(){$("a[href][rel~=noreferrer], area[href][rel~=noreferrer]").each(function(){var b,e,c,g,d,f,h;b=this;c=b.href;$.browser.opera?(b.href="http://www.google.com/url?q="+encodeURIComponent(c),b.title||(b.title="Go to "+c)):(d=!1,g=function(){b.href="javascript:void(0)"},f=function(){b.href=c},$(b).bind("mouseout mouseover focus blur",f).mousedown(function(a){a.which===2&&(d=!0)}).blur(function(){d=!1}).mouseup(function(a){if(!(a.which=== +2&&d))return!0;g();d=!1;setTimeout(function(){alert("Middle clicking on this link is disabled");f()},500);return!1}),e="",$.browser.msie?$(b).click(function(){var a;switch(a=this.target||"_self"){case "_self":case window.name:a=window;break;default:a=window.open(null,a)}a=a.document;a.clear();a.write(e);a.close();return!1}):(h="data:text/html;charset=utf-8,"+ +encodeURIComponent(e),$(b).click(function(){this.href=h;return!0})))})})})()}).call(this); \ No newline at end of file diff --git a/lms/templates/footer-edx-new.html b/lms/templates/footer-edx-new.html index 9f207bc276..b0a9d6f091 100644 --- a/lms/templates/footer-edx-new.html +++ b/lms/templates/footer-edx-new.html @@ -2,7 +2,6 @@ <%! from django.core.urlresolvers import reverse %> <%! from django.utils.translation import ugettext as _ %> <%namespace name='static' file='static_content.html'/> - ## WARNING: These files are specific to edx.org and are not used in installations outside of that domain. Open edX users will want to use the file "footer.html" for any changes or overrides. + + +