Added cancel button to interface; reverted animation to straight sweep effect instead of spread-from-center
authorDan
Tue, 04 Aug 2009 19:38:01 -0400
changeset 30 294bab0bb3e2
parent 29 7cd9707ed72f
child 31 e931602f9f2f
Added cancel button to interface; reverted animation to straight sweep effect instead of spread-from-center
plugins/Yubikey.php
plugins/yubikey/yubikey.css
plugins/yubikey/yubikey.js
--- a/plugins/Yubikey.php	Tue Aug 04 19:37:38 2009 -0400
+++ b/plugins/Yubikey.php	Tue Aug 04 19:38:01 2009 -0400
@@ -91,7 +91,7 @@
       },
       yubiauth: {
         msg_please_touch_key: 'Please touch your Yubikey',
-        msg_close_instructions: 'Press <tt>Esc</tt> to cancel',
+        msg_close_instructions: 'or press <tt>Esc</tt>',
         msg_invalid_chars: 'OTP contains invalid characters',
         msg_too_long: 'OTP is too long',
         msg_validating_otp: 'Validating OTP...',
--- a/plugins/yubikey/yubikey.css	Tue Aug 04 19:37:38 2009 -0400
+++ b/plugins/yubikey/yubikey.css	Tue Aug 04 19:38:01 2009 -0400
@@ -48,7 +48,7 @@
   height: 88px;
   background-image: url(./field.png);
   background-repeat: no-repeat;
-  background-position: -44px -88px;
+  background-position: 0px -88px;
 }
 
 div.yubikey_bar > img.yubikey_bar_error {
--- a/plugins/yubikey/yubikey.js	Tue Aug 04 19:37:38 2009 -0400
+++ b/plugins/yubikey/yubikey.js	Tue Aug 04 19:38:01 2009 -0400
@@ -34,7 +34,7 @@
   mp.style.textAlign = 'center';
   mp.innerHTML = '<h3>' + $lang.get('yubiauth_msg_please_touch_key') + '</h3>';
   var progress = document.createElement('div');
-  $(progress).addClass('yubikey_bar');
+  $(progress).addClass('yubikey_bar').css('text-align', 'left');
   var progimg = document.createElement('img');
   progimg.src = cdnPath + '/images/spacer.gif';
   progress.appendChild(progimg);
@@ -47,6 +47,7 @@
     .css('color', '#fff')
     .css('font-size', '1px')
     .css('padding', '0')
+    .css('opacity', '0')
     .attr('size', '1')
     .keyup(function(e)
       {
@@ -69,7 +70,7 @@
         {
           $('div.yubikey_bar > img', this.parentNode)
             .css('width', String(this.value.length * 2) + 'px')
-            .css('background-position', String((this.value.length > 44 ? 44 : this.value.length) - 44) + 'px -88px');
+            //.css('background-position', String((this.value.length > 44 ? 44 : this.value.length) - 44) + 'px -88px');
         }
         e.preventDefault();
         e.stopPropagation();
@@ -84,7 +85,10 @@
     }, 750);
   var info = document.createElement('p');
   $(info)
-    .html($lang.get('yubiauth_msg_close_instructions'))
+    .append('<span style="color: #ffffff; font-size: smaller;">' + $lang.get('yubiauth_msg_close_instructions') + '</span>&nbsp;&nbsp;')
+    .append('<a class="abutton abutton_green" href="#" onclick="miniPromptDestroy(this); return false;">' + $lang.get('etc_cancel') + '</a>&nbsp;&nbsp;')
+    //.append('<br />')
+    .append('<span style="color: #909090; font-size: smaller;">' + $lang.get('yubiauth_msg_close_instructions') + '</span>')
     .css('margin-top', '0');
   mp.appendChild(info);
 }