]> dev.renevier.net Git - syj.git/blob - public/js/login.js
js strict mode in development files
[syj.git] / public / js / login.js
1 /*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
2     and is published under the AGPL license. */
3
4 "use strict";
5
6 document.observe("dom:loaded", function() {
7     var form = $("loginform");
8     form.setfocus();
9
10     form.observe("submit", function(evt) {
11         var loginput = $("login_user");
12         $$('.error').invoke('remove');
13
14         if (!loginput.check(function() { return !this.value.strip().empty(); }, SyjStrings.userEmptyWarn)) {
15             loginput.highlight('#F08080').activate();
16             evt.stop();
17             return;
18         }
19     });
20 });