]> dev.renevier.net Git - syj.git/blobdiff - public/js/login.js
js strict mode in development files
[syj.git] / public / js / login.js
index 44d8e080734c868b8a02137aed5658e94f105ed3..491bfad6d75455f01b5399d962880f5c8be601a4 100644 (file)
@@ -1,14 +1,18 @@
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
     and is published under the AGPL license. */
 
+"use strict";
+
 document.observe("dom:loaded", function() {
     var form = $("loginform");
-    form.focus();
+    form.setfocus();
 
     form.observe("submit", function(evt) {
+        var loginput = $("login_user");
         $$('.error').invoke('remove');
 
-        if (!$("login_user").check(function() { return !this.value.strip().empty(); }, SyjStrings.userEmptyWarn)) {
+        if (!loginput.check(function() { return !this.value.strip().empty(); }, SyjStrings.userEmptyWarn)) {
+            loginput.highlight('#F08080').activate();
             evt.stop();
             return;
         }