Code

Added caps proof of concept
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Apr 2010 16:27:45 +0000 (16:27 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Apr 2010 16:27:45 +0000 (16:27 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17891 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/images/caps.png [new file with mode: 0644]
gosa-core/html/include/gosa.js
gosa-core/html/themes/default/style.css
gosa-core/ihtml/themes/default/login.tpl

diff --git a/gosa-core/html/images/caps.png b/gosa-core/html/images/caps.png
new file mode 100644 (file)
index 0000000..c44694d
Binary files /dev/null and b/gosa-core/html/images/caps.png differ
index c3963b8eb2e3f04badc1b3d3e89398ec50763714..e7bef6e73406732afcc9ef118701821da7b19233 100644 (file)
@@ -531,6 +531,37 @@ function isVisible(obj)
 }
 
 
+/* Check if capslock is enabled */
+function capslock(e) {
+    e = (e) ? e : window.event;
+
+    var charCode = false;
+    if (e.which) {
+        charCode = e.which;
+    } else if (e.keyCode) {
+        charCode = e.keyCode;
+    }
+
+    var shifton = false;
+    if (e.shiftKey) {
+        shifton = e.shiftKey;
+    } else if (e.modifiers) {
+        shifton = !!(e.modifiers & 4);
+    }
+
+    if (charCode >= 97 && charCode <= 122 && shifton) {
+        return true;
+    }
+
+    if (charCode >= 65 && charCode <= 90 && !shifton) {
+        return true;
+    }
+
+    return false;
+}
+
+
+
 /* Scroll down the body frame */
 function scrollDown2()
 {
index cf4b4897abb6b2537327db9100bf536b270eb8e7..944babcd2cc898014eb206e8ec689022b27376d2 100644 (file)
@@ -58,6 +58,11 @@ input[type=text]:hover, input[type=password]:hover, textarea:hover, select:hover
   border-color:#777;
 }
 
+input[type=password]{
+  background-repeat:no-repeat;
+  background-position:right center;
+}
+
 textarea, select {
   border:1px solid #DDD;
   margin-bottom:2px;
index 569ca42506ad09d0a9d2540636f3ad02764351d3..1dc7ceacf5bef6ac2c82895e185112f244da5337 100644 (file)
        <div class='login-element-container'>
         <div class='login-label'><label for='password'>{t}Password{/t}</label></div>
         <div class='login-input'>
-         <input type='password' name='password' maxlength='40' value=''
-                title='{t}Password{/t}' onFocus="nextfield= 'login';" />
+         <input type='password' name='password' id='password' maxlength='40' value=''
+                title='{t}Password{/t}' onFocus="nextfield= 'login';" onKeyPress= "
+               if (capslock(event)){
+                 $('password').style.backgroundImage = 'url(images/caps.png)'
+              } else {
+                 $('password').style.backgroundImage= ''
+              }"/>
         </div>
         <div class="clear"></div>
        </div>