Integrates external readers to the rss feeds and the iCal calendars.
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Fri, 18 Jan 2008 18:00:08 +0000 (19:00 +0100)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Sat, 19 Jan 2008 16:33:08 +0000 (17:33 +0100)
Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
13 files changed:
ChangeLog
htdocs/images/goodies/README [new file with mode: 0644]
htdocs/images/goodies/add-google-calendar.gif [new file with mode: 0644]
htdocs/images/goodies/add-google.gif [new file with mode: 0644]
htdocs/images/goodies/add-netvibes.gif [new file with mode: 0644]
htdocs/images/goodies/add-yahoo.gif [new file with mode: 0644]
htdocs/javascript/xorg.js
templates/admin/wiki.tpl
templates/carnet/index.tpl
templates/carnet/mescontacts.tpl
templates/carnet/panel.tpl
templates/events/index.tpl
templates/platal/filrss.tpl

index 78aa29a..c644723 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@ New:
         - New PlProfiler tool                                              -FRU
 
     * Goodies:
+        - Integration of goodies/external tools with local rss/iCal        -VZA
         - iGoogle gadgets for latest events and directory search           -VZA
 
 Bug/Wish:
diff --git a/htdocs/images/goodies/README b/htdocs/images/goodies/README
new file mode 100644 (file)
index 0000000..ae70e85
--- /dev/null
@@ -0,0 +1,7 @@
+Those images have been fetched from external servers. They are *not* covered by Plat/al's GPL license.
+Please check with image owners for more information on copyrights and utilization limitations.
+
+add-google.gif:          http://gmodules.com/ig/images/plus_google.gif
+add-google-calendar.gif: http://www.google.com/calendar/images/ext/gc_button1.gif
+add-netvibes.gif:        http://www.netvibes.com/img/add2netvibes.gif
+add-yahoo:               http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif
diff --git a/htdocs/images/goodies/add-google-calendar.gif b/htdocs/images/goodies/add-google-calendar.gif
new file mode 100644 (file)
index 0000000..7884948
Binary files /dev/null and b/htdocs/images/goodies/add-google-calendar.gif differ
diff --git a/htdocs/images/goodies/add-google.gif b/htdocs/images/goodies/add-google.gif
new file mode 100644 (file)
index 0000000..43b7889
Binary files /dev/null and b/htdocs/images/goodies/add-google.gif differ
diff --git a/htdocs/images/goodies/add-netvibes.gif b/htdocs/images/goodies/add-netvibes.gif
new file mode 100644 (file)
index 0000000..6159586
Binary files /dev/null and b/htdocs/images/goodies/add-netvibes.gif differ
diff --git a/htdocs/images/goodies/add-yahoo.gif b/htdocs/images/goodies/add-yahoo.gif
new file mode 100644 (file)
index 0000000..b6f8047
Binary files /dev/null and b/htdocs/images/goodies/add-yahoo.gif differ
index db3a502..0e5f5d0 100644 (file)
@@ -155,6 +155,70 @@ function popWin(theNode,w,h) {
 }
 
 // }}}
+// {{{ function goodiesPopup()
+
+function goodiesPopup(node) {
+    if (node.href.indexOf('ical') > -1) {
+        __goodies_popup(node, __goodies_ical_sites, 'Calendrier iCal');
+    } else if (node.href.indexOf('rss') > -1 && (node.href.indexOf('xml') > -1 || node.href.indexOf('hash'))) {
+        __goodies_popup(node, __goodies_rss_sites, 'Fil rss');
+    }
+}
+
+var __goodies_ical_sites = [
+    {'url_prefix': '',
+     'img': 'images/icons/calendar_view_day.gif',
+     'title': 'Calendrier iCal'},
+    {'url_prefix': 'http://www.google.com/calendar/render?cid=',
+     'img': 'images/goodies/add-google-calendar.gif',
+     'title': 'Ajouter à Google Calendar'}
+];
+var __goodies_rss_sites = [
+    {'url_prefix': '',
+     'img': 'images/icons/feed.gif',
+     'title': 'Fil rss'},
+    {'url_prefix': 'http://fusion.google.com/add?feedurl=',
+     'img': 'images/goodies/add-google.gif',
+     'alt': 'Add to Google',
+     'title': 'Ajouter à iGoogle/Google Reader'},
+    {'url_prefix': 'http://www.netvibes.com/subscribe.php?url=',
+     'img': 'images/goodies/add-netvibes.gif',
+     'title': 'Ajouter à Netvibes'},
+    {'url_prefix': 'http://add.my.yahoo.com/content?.intl=fr&url=',
+     'img': 'images/goodies/add-yahoo.gif',
+     'alt': 'Add to My Yahoo!',
+     'title': 'Ajouter à My Yahoo!'}
+];
+
+function __goodies_popupText(url, sites) {
+    var text = '<div style="text-align: center; line-height: 2.2">';
+    for (var site in sites) {
+        var s_alt = (sites[site]["alt"] ? sites[site]["alt"] : "");
+        var s_img = sites[site]["img"];
+        var s_title = (sites[site]["title"] ? sites[site]["title"] : "");
+        var s_url = (sites[site]["url_prefix"].length > 0 ? sites[site]["url_prefix"] + escape(url) : url);
+
+        text += '<a href="' + s_url + '"><img src="' + s_img + '" title="' + s_title + '" alt="' + s_alt + '"></a><br />';
+    }
+    text += '<a href="https://www.polytechnique.org/Xorg/Goodies">Plus de bonus</a> ...</div>'
+    return text;
+}
+
+function __goodies_popup(node, sites, default_title) {
+    var mouseover_cb = function() {
+        var rss_text = __goodies_popupText(node.href, sites);
+        var rss_title = (node.title ? node.title : default_title);
+        return overlib(rss_text, CAPTION, rss_title, CLOSETEXT, 'Fermer', DELAY, 800, STICKY, WIDTH, 150);
+    }
+    var mouseout_cb = function() {
+        nd();
+    }
+
+    node.onmouseover = mouseover_cb;
+    node.onmouseout = mouseout_cb;
+}
+
+// }}}
 // {{{ function auto_links()
 
 function auto_links() {
@@ -183,6 +247,9 @@ function auto_links_nodes(nodes) {
             if (node.href.indexOf('http') < 0) {
                 node.href = 'http://' + fqdn + '/' + node.href;
             }
+            if (node.nodeName.toLowerCase() == 'a') {
+                goodiesPopup(node);
+            }
         }
         if(node.className == 'popup2') {
             node.onclick = function () { popWin(this,840,600); return false; };
index 592e38b..c8257f3 100644 (file)
@@ -68,6 +68,7 @@
 {/literal}
 
 <p class="center">
+   <a href="Site/AllRecentChanges?action=rss&user={$smarty.session.forlife}&hash={$smarty.session.core_rss_hash}" style="display:block;float:right" title="Changements">{icon name=feed title='fil rss'}</a>
    {icon name=magnifier} <a href="Site/AllRecentChanges">Voir les changements récents</a>
 </p>
 
index 81efe67..b16445f 100644 (file)
@@ -54,7 +54,7 @@
   <tr>
     <th colspan="2">
       {if $smarty.session.core_rss_hash}
-      <a href='carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml' style="display:block;float:right">
+      <a href="carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml" style="display:block;float:right" title="Notifications">
         {icon name=feed title='fil rss'}
       </a>
       {else}
index d722ac3..65c9ef9 100644 (file)
@@ -72,7 +72,7 @@ Pour récupérer ta liste de contacts dans un PDF imprimable&nbsp;:<br />
 <ul>
   <li>
     {icon name=calendar_view_day title='Anniversaires'} 
-    <a href="carnet/contacts/ical/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/anniv-x.ics">
+    <a href="carnet/contacts/ical/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/anniv-x.ics" title="Anniversaires">
       Le calendrier des anniversaires
     </a>
   </li>
index e0205cc..f7baa37 100644 (file)
@@ -39,7 +39,7 @@ Il faut pour cela se rendre sur la page de <a href='carnet/notifs'>configuration
 
 <div class="right">
 {if $smarty.session.core_rss_hash}
-<a href='carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml'>{icon name=feed title='fil rss'}</a>
+<a href="carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
 {/if}
 </div>
 
index 4cf7999..226a6a9 100644 (file)
@@ -93,7 +93,7 @@ Bienvenue {$smarty.session.prenom}{if $birthday}
       <td class="half titre" style="height: 18px; padding-top: 1px; padding-bottom: 1px;">
         {if $smarty.foreach.events.first}
         {if $smarty.session.core_rss_hash}
-        <a href='rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml' style="display:block;float:right">
+        <a href="rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml" style="display:block;float:right" title="Annonces">
           {icon name=feed title='fil rss'}
         </a>
         {else}
index 22df7f7..c7968ff 100644 (file)
@@ -52,11 +52,11 @@ En voici les adresses&nbsp;:
 <ul>
   <li>
   Anonces sur la page d'entrée&nbsp;:
-  <a href='rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml'>{icon name=feed title='fil rss'}</a>
+  <a href="rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml" title="Annonces">{icon name=feed title='fil rss'}</a>
   </li>
   <li>
   Ton carnet polytechnicien&nbsp;:
-  <a href='carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml'>{icon name=feed title='fil rss'}</a>
+  <a href="carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
   </li>
 </ul>
 <p>