Fix broken correctUserName.
[platal.git] / htdocs / javascript / xorg.js
1 /***************************************************************************
2 * Copyright (C) 2003-2011 Polytechnique.org *
3 * http://opensource.polytechnique.org/ *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., *
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
19 ***************************************************************************/
20
21 var is_IE = $.browser.msie;
22
23 // {{{ function getNow()
24 var days = ['Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'];
25 var months = ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet',
26 'août', 'septembre', 'octobre', 'novembre', 'décembre'];
27
28 function getNow() {
29 var dt = new Date();
30 var dy = dt.getDay();
31 var mh = dt.getMonth();
32 var wd = dt.getDate();
33 var yr = dt.getYear();
34 var hr = dt.getHours();
35 var mi = dt.getMinutes();
36 var se = dt.getSeconds();
37
38 if (yr<1000) {
39 yr += 1900;
40 }
41 if (mi < 10) {
42 mi = '0' + mi;
43 }
44 if (se < 10) {
45 se = '0' + se;
46 }
47
48 $(".date-heure").html(days[dy] + ' ' + wd + ' ' + months[mh] + ' ' + yr + '<br />'
49 + hr + ':' + mi + ':' + se);
50 }
51
52 // }}}
53 // {{{ Search Engine
54
55 function canAddSearchEngine()
56 {
57 if (((typeof window.sidebar === "object") && $.isFunction(window.sidebar.addSearchEngine))
58 || ((typeof window.external === "object") && $.isFunction(window.external.AddSearchProvider))) {
59 return true;
60 }
61 return false;
62 }
63
64 function addSearchEngine()
65 {
66 var searchURI = "http://www.polytechnique.org/xorg.opensearch.xml";
67 if ((typeof window.sidebar === "object") && $.isFunction(window.sidebar.addSearchEngine)) {
68 window.sidebar.addSearchEngine(
69 searchURI,
70 "http://www.polytechnique.org/images/xorg.png",
71 "Annuaire Polytechnique.org",
72 "Academic");
73 } else {
74 try {
75 window.external.AddSearchProvider(searchURI);
76 } catch(e) {
77 alert("Impossible d'installer la barre de recherche");
78 }
79 }
80 }
81
82 // }}}
83
84 /***************************************************************************
85 * POPUP THINGS
86 */
87
88 // {{{ function goodiesPopup()
89
90 (function($) {
91 var goodies = {
92 ical: {
93 default_title: 'Calendrier iCal',
94 sites: [
95 {url_prefix: '',
96 img: 'images/icons/calendar_view_day.gif',
97 title: 'Calendrier iCal'},
98 {url_prefix: 'http://www.google.com/calendar/render?cid=',
99 img: 'images/goodies/add-google-calendar.gif',
100 title: 'Ajouter à Google Calendar'},
101 {url_prefix: 'https://www.google.com/calendar/hosted/polytechnique.org/render?cid=',
102 img: 'images/goodies/add-google-calendar.gif',
103 title: 'Ajouter à Google Apps / Calendar'}
104 ]
105 },
106
107 rss: {
108 default_title: 'Fils RSS',
109 sites: [
110 {url_prefix: '',
111 img: 'images/icons/feed.gif',
112 title: 'Fil rss'},
113 {url_prefix: 'http://fusion.google.com/add?feedurl=',
114 img: 'images/goodies/add-google.gif',
115 alt: 'Add to Google',
116 title: 'Ajouter à iGoogle/Google Reader'},
117 {url_prefix: 'http://www.netvibes.com/subscribe.php?url=',
118 img: 'images/goodies/add-netvibes.gif',
119 title: 'Ajouter à Netvibes'},
120 {url_prefix: 'http://add.my.yahoo.com/content?.intl=fr&url=',
121 img: 'images/goodies/add-yahoo.gif',
122 alt: 'Add to My Yahoo!',
123 title: 'Ajouter à My Yahoo!'}
124 ]
125 }
126 };
127
128 $.fn.extend({
129 goodiesPopup: function goodiesPopup(type) {
130 var text = '<div style="text-align: center; line-height: 2.2">';
131 var site;
132 var entry;
133 var s_alt;
134 var s_img;
135 var s_title;
136 var s_url;
137
138 for (site in goodies[type].sites) {
139 entry = goodies[type].sites[site];
140 s_alt = entry.alt || "";
141 s_img = entry.img;
142 s_title = entry.title || "";
143 s_url = entry.url_prefix.length > 0 ? entry.url_prefix + escape(this.href) : this.href;
144
145 text += '<a href="' + s_url + '"><img src="' + s_img + '" title="' + s_title + '" alt="' + s_alt + '"></a><br />';
146 }
147 text += '<a href="https://www.polytechnique.org/Xorg/Goodies">Plus de bonus</a> ...</div>';
148
149 return this.overlib({
150 text: text,
151 caption: this.attr('title') || goodies.default_title,
152 close_text: 'Fermer',
153 delay: 800,
154 sticky: true,
155 width: 150
156 });
157 }
158 });
159 }(jQuery));
160
161 // }}}
162 // {{{ function auto_links()
163
164 function auto_links() {
165 var url = document.URL;
166 var fqdn = url.replace(/^https?:\/\/([^\/]*)\/.*$/,'$1');
167 var light = url.indexOf('display=light') > url.indexOf('?');
168 var resource_page = url.contains('rss') || url.contains('ical');
169
170 $("a,link").each(function(i) {
171 var node = $(this);
172 var href = this.href;
173 var matches;
174 var rss;
175 var ical;
176
177 if(!href || node.hasClass('xdx')
178 || href.startsWith('mailto:') || href.startsWith('javascript:')) {
179 return;
180 }
181 if ((!href.contains(fqdn) && !this.className.contains('popup')) || node.hasClass('popup')) {
182 node.click(function () {
183 window.open(href);
184 return false;
185 });
186 }
187 if (href.contains(fqdn) && light) {
188 href = href.replace(/([^\#\?]*)\??([^\#]*)(\#.*)?/, "$1?display=light&$2$3");
189 this.href = href;
190 }
191 rss = href.contains('rss');
192 ical = href.contains('ical');
193 if (rss || ical) {
194 if (!href.startsWith('http')) {
195 href = 'http://' + fqdn + '/' + href;
196 }
197 }
198 if (this.nodeName.toLowerCase() === 'a' && !resource_page) {
199 if (rss && !href.contains('prefs/rss') && (href.contains('xml') || href.contains('hash'))) {
200 node.goodiesPopup('rss');
201 } else if (ical) {
202 node.goodiesPopup('ical');
203 }
204 }
205 matches = /^popup_([0-9]*)x([0-9]*)$/.exec(this.className);
206 if (matches) {
207 node.popWin(matches[1], matches[2]);
208 }
209 });
210 $('.popup2').popWin(840, 600);
211 $('.popup3').popWin(640, 800);
212 }
213
214
215 // }}}
216
217 /***************************************************************************
218 * Password check
219 */
220
221 // {{{ function checkPassword
222
223 /* {{{ SHA1 Implementation */
224
225 /*
226 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
227 * in FIPS PUB 180-1
228 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
229 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
230 * Distributed under the BSD License
231 * See http://pajhome.org.uk/crypt/md5 for details.
232 */
233
234 /*
235 * Configurable variables. You may need to tweak these to be compatible with
236 * the server-side, but the defaults work in most cases.
237 */
238 var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
239 var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
240 var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
241
242 /*
243 * These are the functions you'll usually want to call
244 * They take string arguments and return either hex or base-64 encoded strings
245 */
246 function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
247 function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
248 function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
249 function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
250 function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
251 function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
252
253 /*
254 * Perform a simple self-test to see if the VM is working
255 */
256 function sha1_vm_test()
257 {
258 return hex_sha1("abc") === "a9993e364706816aba3e25717850c26c9cd0d89d";
259 }
260
261 /*
262 * Calculate the SHA-1 of an array of big-endian words, and a bit length
263 */
264 function core_sha1(x, len)
265 {
266 var w, a, b, c, d, e;
267 var olda, oldb, oldc, oldd, olde;
268 var i, j, t;
269
270 /* append padding */
271 x[len >> 5] |= 0x80 << (24 - len % 32);
272 x[((len + 64 >> 9) << 4) + 15] = len;
273
274 w = Array(80);
275 a = 1732584193;
276 b = -271733879;
277 c = -1732584194;
278 d = 271733878;
279 e = -1009589776;
280
281 for(i = 0; i < x.length; i += 16)
282 {
283 olda = a;
284 oldb = b;
285 oldc = c;
286 oldd = d;
287 olde = e;
288
289 for(j = 0; j < 80; j++)
290 {
291 if(j < 16) w[j] = x[i + j];
292 else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
293 t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
294 safe_add(safe_add(e, w[j]), sha1_kt(j)));
295 e = d;
296 d = c;
297 c = rol(b, 30);
298 b = a;
299 a = t;
300 }
301
302 a = safe_add(a, olda);
303 b = safe_add(b, oldb);
304 c = safe_add(c, oldc);
305 d = safe_add(d, oldd);
306 e = safe_add(e, olde);
307 }
308 return Array(a, b, c, d, e);
309
310 }
311
312 /*
313 * Perform the appropriate triplet combination function for the current
314 * iteration
315 */
316 function sha1_ft(t, b, c, d)
317 {
318 if(t < 20) return (b & c) | ((~b) & d);
319 if(t < 40) return b ^ c ^ d;
320 if(t < 60) return (b & c) | (b & d) | (c & d);
321 return b ^ c ^ d;
322 }
323
324 /*
325 * Determine the appropriate additive constant for the current iteration
326 */
327 function sha1_kt(t)
328 {
329 return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
330 (t < 60) ? -1894007588 : -899497514;
331 }
332
333 /*
334 * Calculate the HMAC-SHA1 of a key and some data
335 */
336 function core_hmac_sha1(key, data)
337 {
338 var bkey = str2binb(key);
339 var i, ipad, opad;
340 var hash;
341
342 if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
343
344 ipad = Array(16);
345 opad = Array(16);
346 for(i = 0; i < 16; i++)
347 {
348 ipad[i] = bkey[i] ^ 0x36363636;
349 opad[i] = bkey[i] ^ 0x5C5C5C5C;
350 }
351
352 hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
353 return core_sha1(opad.concat(hash), 512 + 160);
354 }
355
356 /*
357 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
358 * to work around bugs in some JS interpreters.
359 */
360 function safe_add(x, y)
361 {
362 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
363 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
364 return (msw << 16) | (lsw & 0xFFFF);
365 }
366
367 /*
368 * Bitwise rotate a 32-bit number to the left.
369 */
370 function rol(num, cnt)
371 {
372 return (num << cnt) | (num >>> (32 - cnt));
373 }
374
375 /*
376 * Convert an 8-bit or 16-bit string to an array of big-endian words
377 * In 8-bit function, characters >255 have their hi-byte silently ignored.
378 */
379 function str2binb(str)
380 {
381 var bin = Array();
382 var mask = (1 << chrsz) - 1;
383 var i;
384 for(i = 0; i < str.length * chrsz; i += chrsz)
385 bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
386 return bin;
387 }
388
389 /*
390 * Convert an array of big-endian words to a string
391 */
392 function binb2str(bin)
393 {
394 var str = "";
395 var mask = (1 << chrsz) - 1;
396 var i;
397 for(i = 0; i < bin.length * 32; i += chrsz)
398 str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
399 return str;
400 }
401
402 /*
403 * Convert an array of big-endian words to a hex string.
404 */
405 function binb2hex(binarray)
406 {
407 var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
408 var str = "";
409 var i;
410 for(i = 0; i < binarray.length * 4; i++)
411 {
412 str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
413 hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
414 }
415 return str;
416 }
417
418 /*
419 * Convert an array of big-endian words to a base-64 string
420 */
421 function binb2b64(binarray)
422 {
423 var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
424 var str = "";
425 var i, j, triplet;
426 for(i = 0; i < binarray.length * 4; i += 3)
427 {
428 triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
429 | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
430 | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
431 for(j = 0; j < 4; j++)
432 {
433 if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
434 else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
435 }
436 }
437 return str;
438 }
439
440 /* }}} */
441
442 function hash_encrypt(a) {
443 return hex_sha1(a);
444 }
445
446 var hexa_h = "0123456789abcdef";
447
448 function dechex(a) {
449 return hexa_h.charAt(a);
450 }
451
452 function hexdec(a) {
453 return hexa_h.indexOf(a);
454 }
455
456 function hash_xor(a, b) {
457 var c,i,j,k,d;
458 c = "";
459 i = a.length;
460 j = b.length;
461 if (i < j) {
462 d = a; a = b; b = d;
463 k = i; i = j; j = k;
464 }
465 for (k = 0; k < j; k++) {
466 c += dechex(hexdec(a.charAt(k)) ^ hexdec(b.charAt(k)));
467 }
468 for (; k < i; k++) {
469 c += a.charAt(k);
470 }
471 return c;
472 }
473
474
475 function getType(c) {
476 if (c >= 'a' && c <= 'z') {
477 return 1;
478 } else if (c >= 'A' && c <= 'Z') {
479 return 2;
480 } else if (c >= '0' && c <= '9') {
481 return 3;
482 } else {
483 return 4;
484 }
485 }
486
487 function differentTypes(password) {
488 var prev = 0;
489 var type;
490
491 for (i = 0 ; i < password.length ; ++i) {
492 type = getType(password.charAt(i));
493 if (prev !== 0 && prev !== type) {
494 return true;
495 }
496 prev = type;
497 }
498 return false;
499 }
500
501 function passwordStrength(password) {
502 var prop = 0;
503 var prev = 0;
504 var firstType = true;
505 var types = Array(0, 0, 0, 0, 0);
506 var type;
507
508 for (i = 0 ; i < password.length ; ++i) {
509 type = getType(password.charAt(i));
510 if (prev !== 0 && prev !== type) {
511 prop += 5;
512 firstType = false;
513 }
514 prop += i;
515 if (types[type] === 0 && !firstType) {
516 prop += 15;
517 }
518 types[type]++;
519 prev = type;
520 }
521 if (password.length < 6) {
522 prop *= 0.75;
523 }
524 if (firstType) {
525 prop *= 0.75;
526 }
527 if (prop > 100) {
528 prop = 100;
529 } else if (prop < 0) {
530 prop = 0;
531 }
532
533 return prop;
534 }
535
536 function checkPassword(box, okLabel) {
537 var password = box.value;
538 var prop = passwordStrength(password);
539 var submitButton;
540
541 if (prop >= 60) {
542 color = "#4f4";
543 bgcolor = "#050";
544 ok = true;
545 } else if (prop >= 35) {
546 color = "#ff4";
547 bgcolor = "#750";
548 ok = true;
549 } else {
550 color = "#f20";
551 bgcolor = "#700";
552 ok = false;
553 }
554 $("#passwords_measure")
555 .stop()
556 .animate({ width: prop + "%",
557 backgroundColor: color
558 }, 750)
559 .parent().stop()
560 .animate({ backgroundColor: bgcolor }, 750);
561 submitButton = $(":submit[name='" + passwordprompt_submit + "']");
562 if (ok && password.length >= 6 && differentTypes(password)) {
563 submitButton.attr("value", okLabel);
564 submitButton.removeAttr("disabled");
565 } else {
566 submitButton.attr("value", "Mot de passe trop faible");
567 submitButton.attr("disabled", "disabled");
568 }
569 }
570
571 function hashResponse(password1, password2, hasConfirmation) {
572 var pw1 = $('[name=' + password1 + ']').val();
573 var pw2;
574
575 if (hasConfirmation) {
576 pw2 = $('[name=' + password2 + ']').val();
577 if (pw1 !== pw2) {
578 alert("\nErreur : les deux champs ne sont pas identiques !");
579 return false;
580 }
581 $('[name=' + password2 + ']').val('');
582 } else if (pw1 === '********') {
583 return true;
584 }
585
586 if (pw1.length < 6) {
587 alert("\nErreur : le nouveau mot de passe doit faire au moins 6 caractères !");
588 return false;
589 }
590 if (!differentTypes(pw1)) {
591 alert ("\nErreur : le nouveau mot de passe doit comporter au moins deux types de caractères parmi les suivants : lettres minuscules, lettres majuscules, chiffres, caractères spéciaux.");
592 return false;
593 }
594
595 alert("Le mot de passe que tu as rentré va être chiffré avant de nous parvenir par Internet ! Ainsi il ne circulera pas en clair.");
596 $('[name=' + password1 + ']').val('');
597 $('[name=pwhash]').val(hash_encrypt(pw1));
598 return true;
599 }
600
601 function correctUserName() {
602 var u = document.forms.login.username;
603 var mots;
604
605 // login with no space
606 if (!u.value.contains(' ')) {
607 return true;
608 }
609 mots = u.value.split(' ');
610 // jean paul.du pont -> jean-paul.du-pont
611 if (u.value.contains('.')) {
612 u.value = mots.join('-');
613 return true;
614 }
615 // jean dupont -> jean.dupont
616 if (mots.length === 2) {
617 u.value = mots[0] + "." + mots[1];
618 return true;
619 }
620 // jean dupont 2001 -> jean.dupont.2001
621 if (mots.length === 3 && mots[2] > 1920 && mots[2] < 3000) {
622 u.value = mots.join('.');
623 return true;
624 }
625 // jean de la vallee -> jean.de-la-vallee
626 if (mots[1].toUpperCase() === 'DE') {
627 u.value = mots[0] + "." + mots.join('-').substr(mots[0].length+1);
628 return true;
629 }
630 // jean paul dupont -> jean-paul.dupont
631 if (mots.length === 3 && mots[0].toUpperCase() === 'JEAN') {
632 u.value = mots[0] + "-" + mots[1] + "." + mots[2];
633 return true;
634 }
635
636 alert('Ton email ne doit pas contenir de blanc.\nLe format standard est\n\nprenom.nom.promotion\n\nSi ton nom ou ton prenom est composé,\nsépare les mots par des -');
637
638 return false;
639 }
640
641 function doChallengeResponse() {
642 var new_pass, old_pass, str;
643
644 if (!correctUserName()) {
645 return false;
646 }
647
648 new_pass = hash_encrypt(document.forms.login.password.value);
649 old_pass = hash_encrypt(document.forms.login.password.value.substr(0, 10));
650
651 str = document.forms.login.username.value + ":" +
652 new_pass + ":" +
653 document.forms.loginsub.challenge.value;
654
655 document.forms.loginsub.response.value = hash_encrypt(str);
656 if (new_pass !== old_pass) {
657 document.forms.loginsub.xorpass.value = hash_xor(new_pass, old_pass);
658 }
659 document.forms.loginsub.username.value = document.forms.login.username.value;
660 document.forms.loginsub.remember.value = document.forms.login.remember.checked;
661 document.forms.loginsub.domain.value = document.forms.login.domain.value;
662 document.forms.login.password.value = "";
663 document.forms.loginsub.submit();
664 }
665
666 function doChallengeResponseLogged() {
667 var str = document.forms.loginsub.username.value + ":" +
668 hash_encrypt(document.forms.login.password.value) + ":" +
669 document.forms.loginsub.challenge.value;
670
671 document.forms.loginsub.response.value = hash_encrypt(str);
672 document.forms.loginsub.remember.value = document.forms.login.remember.checked;
673 document.forms.login.password.value = "";
674 document.forms.loginsub.submit();
675 }
676
677 // }}}
678 // {{{ send test email
679
680 function sendTestEmail(token, hruid)
681 {
682 var url = 'emails/test';
683 var msg = "Un email a été envoyé avec succès";
684 if (hruid) {
685 url += '/' + hruid;
686 msg += " sur l'adresse de " + hruid + ".";
687 } else {
688 msg += " sur ton addresse.";
689 }
690 $('#mail_sent').successMessage($url + '?token=' + token, msg);
691 return false;
692 }
693
694 // }}}
695
696
697 /***************************************************************************
698 * Overlib made simple
699 */
700
701 (function($) {
702 $.fn.extend({
703 overlib: function(text, width, height) {
704 var args = [ ];
705 var key;
706
707 if (typeof text === 'string') {
708 args.push(text);
709 if (width) {
710 args.push(width);
711 }
712 if (height) {
713 args.push(height);
714 }
715 } else {
716 for (key in text) {
717 switch (key) {
718 case 'text':
719 args.unshift(text[key]);
720 break;
721 case 'caption':
722 args.push(CAPTION, text[key]);
723 break;
724 case 'close_text':
725 args.push(CLOSETEXT, text[key]);
726 break;
727 case 'delay':
728 args.push(DELAY, text[key]);
729 break;
730 case 'sticky':
731 if (text[key]) {
732 args.push(STICKY);
733 }
734 break;
735 case 'width':
736 args.push(WIDTH, text[key]);
737 break;
738 case 'height':
739 args.push(HEIGHT, text[key]);
740 break;
741 }
742 }
743 }
744 return this
745 .mouseover(function () {
746 return overlib.apply(null, args);
747 })
748 .mouseout(nd);
749 }
750 });
751 }(jQuery));
752
753
754 /***************************************************************************
755 * The real OnLoad
756 */
757
758 $(function() {
759 auto_links();
760 getNow();
761 setInterval(getNow, 1000);
762 $("#quick")
763 .focus(function() {
764 if ($(this).val() === 'Recherche dans l\'annuaire') {
765 $(this).val('');
766 }
767 $("#quick_button").show();
768 })
769 .blur(function() {
770 $("#quick_button").hide();
771 });
772 $("#quick_button").click(function() {
773 if ($("#quick").val() === 'Recherche dans l\'annuaire'
774 || $("#quick").val() === '') {
775 return false;
776 }
777 return true;
778 });
779 });
780
781 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: