From 79b8b816945bb0c6fb25b13e5e117e155d04dd8d Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Wed, 20 May 2009 00:06:58 +0200 Subject: [PATCH] Prevents the RSS/iCal popup to be displayed when the current url points to a resouce. When a user tries to access anonymously an rss/ics resource, it is offered the sign page; this contain several self-referential links, which, despite the fact they contain "rss" or "ics", are not resources. Signed-off-by: Vincent Zanotti --- htdocs/javascript/xorg.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index 89c35b2..3ea7bec 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -212,6 +212,7 @@ function auto_links() { url = document.URL; fqdn = url.replace(/^https?:\/\/([^\/]*)\/.*$/,'$1'); light = (url.indexOf('display=light') > url.indexOf('?')); + resource_page = (url.indexOf('rss') > -1 || url.indexOf('ical') > -1); $("a,link").each( function(i) { @@ -235,7 +236,7 @@ function auto_links() { href = 'http://' + fqdn + '/' + href; } } - if (this.nodeName.toLowerCase() == 'a') { + if (this.nodeName.toLowerCase() == 'a' && !resource_page) { if (rss && href.indexOf('prefs/rss') < 0 && (href.indexOf('xml') > -1 || href.indexOf('hash'))) { goodiesPopup(this, __goodies_rss); } else if (ical) { -- 2.1.4