Prevents the RSS/iCal popup to be displayed when the current url points to a resouce.
authorVincent Zanotti <vincent.zanotti@m4x.org>
Tue, 19 May 2009 22:06:58 +0000 (00:06 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Tue, 19 May 2009 22:11:37 +0000 (00:11 +0200)
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 <vincent.zanotti@m4x.org>
htdocs/javascript/xorg.js

index 89c35b2..3ea7bec 100644 (file)
@@ -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) {