X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=htdocs%2Fjavascript%2Fxorg.js;h=c013d19e60b1d6ee71e1b12e7e4526b6eace9ca9;hb=ba34dc615f6511353ee079dcaa7dbc08e3873f3f;hp=db3a502d60a76bd3ae5af6e7d0f66a2939c96953;hpb=179afa7fa79902e11498314d37fe4dbf452b3617;p=platal.git diff --git a/htdocs/javascript/xorg.js b/htdocs/javascript/xorg.js index db3a502..c013d19 100644 --- a/htdocs/javascript/xorg.js +++ b/htdocs/javascript/xorg.js @@ -32,7 +32,7 @@ function getNow() { if (yr<1000) yr += 1900; hr = dt.getHours(); mi = dt.getMinutes(); - + time = (mi < 10) ? hr +':0'+mi : hr+':'+mi; days = ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi']; months = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', @@ -66,7 +66,7 @@ function addSearchEngine() try { window.external.AddSearchProvider(searchURI); } catch(e) { - alert("Impossible d'installer la barre de recherche"); + alert("Impossible d'installer la barre de recherche"); } } } @@ -89,7 +89,7 @@ function attachEvent(obj, evt, f, useCapture) { return true; } else if (obj.attachEvent) { return obj.attachEvent("on"+evt, f); - } + } return false; } @@ -155,6 +155,84 @@ 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'); + } +} + +function disableGoodiesPopups() { + __goodies_active = false; +} + +var __goodies_active = true; +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'}, + {'url_prefix': 'https://www.google.com/calendar/hosted/polytechnique.org/render?cid=', + 'img': 'images/goodies/add-google-calendar.gif', + 'title': 'Ajouter à Google Apps / 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!'}, + {'url_prefix': 'http://www.newsgator.com/ngs/subscriber/subext.aspx?url=', + 'img': 'images/goodies/add-newsgator.gif', + 'alt': 'Subscribe in NewsGator Online', + 'title': 'Ajouter à Newsgator'} +]; + +function __goodies_popupText(url, sites) { + var text = '