From: Vincent Zanotti Date: Fri, 18 Jan 2008 18:00:08 +0000 (+0100) Subject: Integrates external readers to the rss feeds and the iCal calendars. X-Git-Tag: xorg/0.9.16~165 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=769dc7d5;p=platal.git Integrates external readers to the rss feeds and the iCal calendars. Signed-off-by: Vincent Zanotti --- diff --git a/ChangeLog b/ChangeLog index 78aa29a..c644723 100644 --- 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 index 0000000..ae70e85 --- /dev/null +++ b/htdocs/images/goodies/README @@ -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 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 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 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 index 0000000..b6f8047 Binary files /dev/null and b/htdocs/images/goodies/add-yahoo.gif differ diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index db3a502..0e5f5d0 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -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 = '
'; + 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 += '' + s_alt + '
'; + } + text += 'Plus de bonus ...
' + 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; }; diff --git a/templates/admin/wiki.tpl b/templates/admin/wiki.tpl index 592e38b..c8257f3 100644 --- a/templates/admin/wiki.tpl +++ b/templates/admin/wiki.tpl @@ -68,6 +68,7 @@ {/literal}

+ {icon name=feed title='fil rss'} {icon name=magnifier} Voir les changements récents

diff --git a/templates/carnet/index.tpl b/templates/carnet/index.tpl index 81efe67..b16445f 100644 --- a/templates/carnet/index.tpl +++ b/templates/carnet/index.tpl @@ -54,7 +54,7 @@ {if $smarty.session.core_rss_hash} - + {icon name=feed title='fil rss'} {else} diff --git a/templates/carnet/mescontacts.tpl b/templates/carnet/mescontacts.tpl index d722ac3..65c9ef9 100644 --- a/templates/carnet/mescontacts.tpl +++ b/templates/carnet/mescontacts.tpl @@ -72,7 +72,7 @@ Pour récupérer ta liste de contacts dans un PDF imprimable :