From: Vincent Zanotti Date: Tue, 19 May 2009 22:06:58 +0000 (+0200) Subject: Prevents the RSS/iCal popup to be displayed when the current url points to a resouce. X-Git-Tag: xorg/0.10.1~85 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=79b8b816945bb0c6fb25b13e5e117e155d04dd8d;p=platal.git 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 --- 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) {