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',
try {
window.external.AddSearchProvider(searchURI);
} catch(e) {
- alert("Impossible d'installer la barre de recherche");
+ alert("Impossible d'installer la barre de recherche");
}
}
}
return true;
} else if (obj.attachEvent) {
return obj.attachEvent("on"+evt, f);
- }
+ }
return false;
}
}
}
+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'}
+ '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': '',
{'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!'}
+ '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) {
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);
+ if (__goodies_active) {
+ 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();
// }}}
+
+/***************************************************************************
+ * Password check
+ */
+
+// {{{ function checkPassword
+
+function getType(char) {
+ if (char >= 'a' && char <= 'z') {
+ return 1;
+ } else if (char >= 'A' && char <= 'Z') {
+ return 2;
+ } else if (char >= '0' && char <= '9') {
+ return 3;
+ } else {
+ return 4;
+ }
+}
+
+function checkPassword(box) {
+ var prev = 0;
+ var prop = 0;
+ var pass = box.value;
+ var types = Array(0, 0, 0, 0, 0);
+ for (i = 0 ; i < pass.length ; ++i) {
+ type = getType(pass.charAt(i));
+ if (prev != 0 && prev != type) {
+ prop += 5;
+ }
+ if (i >= 5) {
+ prop += 5;
+ }
+ if (types[type] == 0) {
+ prop += 10;
+ }
+ types[type]++;
+ prev = type;
+ }
+ if (prop > 100) {
+ prop = 100;
+ } else if (prop < 0) {
+ prop = 0;
+ }
+ if (prop >= 60) {
+ if (prop == 100) {
+ color = "#47f";
+ } else {
+ color = "#4f4";
+ }
+ ok = true;
+ } else if (prop >= 40) {
+ color = "#ff4";
+ ok = false;
+ } else {
+ color = "#f20";
+ ok = false;
+ }
+ $("#passwords_measure")
+ .stop()
+ .animate({ width: prop + "%",
+ backgroundColor: color
+ }, 750);
+ var submitButton = $(":submit[@name='" + passwordprompt_submit + "']");
+ if (ok) {
+ submitButton.removeAttr("disabled");
+ } else {
+ submitButton.attr("disabled", "disabled");
+ }
+}
+
+// }}}
+
+
/***************************************************************************
* The real OnLoad
*/