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 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'))) {
+ } else if (node.href.indexOf('rss') > -1 && node.href.indexOf('prefs/rss') < 0 && (node.href.indexOf('xml') > -1 || node.href.indexOf('hash'))) {
__goodies_popup(node, __goodies_rss_sites, 'Fil rss');
}
}
// }}}
+
+/***************************************************************************
+ * 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);
+ var firstType = true;
+ for (i = 0 ; i < pass.length ; ++i) {
+ type = getType(pass.charAt(i));
+ if (prev != 0 && prev != type) {
+ prop += 5;
+ }
+ prop += i;
+ if (types[type] == 0 && !firstType) {
+ prop += 15;
+ } else {
+ firstType = false;
+ }
+ types[type]++;
+ prev = type;
+ }
+ if (pass.length < 6) {
+ prop *= 0.75;
+ }
+ if (prop > 100) {
+ prop = 100;
+ } else if (prop < 0) {
+ prop = 0;
+ }
+ if (prop >= 60) {
+ color = "#4f4";
+ bgcolor = "#050";
+ ok = true;
+ } else if (prop >= 40) {
+ color = "#ff4";
+ bgcolor = "#750";
+ ok = true;
+ } else {
+ color = "#f20";
+ bgcolor = "#700";
+ ok = false;
+ }
+ $("#passwords_measure")
+ .stop()
+ .animate({ width: prop + "%",
+ backgroundColor: color
+ }, 750)
+ .parent().stop()
+ .animate({ backgroundColor: bgcolor }, 750);
+ var submitButton = $(":submit[@name='" + passwordprompt_submit + "']");
+ if (ok && pass.length >= 6) {
+ submitButton.removeAttr("disabled");
+ } else {
+ submitButton.attr("disabled", "disabled");
+ }
+}
+
+// }}}
+
+
/***************************************************************************
* The real OnLoad
*/