]> andersk Git - test.git/commitdiff
Allow users to disable blinking cursor from context menu.
authorMarkus Gutschke <markus@shellinabox.com>
Fri, 6 Aug 2010 22:15:35 +0000 (22:15 +0000)
committerMarkus Gutschke <markus@shellinabox.com>
Fri, 6 Aug 2010 22:15:35 +0000 (22:15 +0000)
ChangeLog
config.h
configure
configure.ac
demo/vt100.js
shellinabox/shell_in_a_box.js
shellinabox/vt100.js
shellinabox/vt100.jspp

index fe29b31e354e15c77057d49ed7d84051889f43cb..3d476f05527cfcbba10733994a34b0c3bd1f4eb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-06  Markus Gutschke  <markus@shellinabox.com>
+
+       * Allow users to disable the blinking cursor from the context menu.
+
 2010-07-08  Markus Gutschke  <markus@shellinabox.com>
 
        * Added support for systems that have utmpx.h, but don't implement
index f7c56ee5e987d8ccfffd7250560104db726b1e02..950cb9965dfc75412c870fafda64c39bb0da4ada 100644 (file)
--- a/config.h
+++ b/config.h
 #define STDC_HEADERS 1
 
 /* Most recent revision number in the version control system */
-#define VCS_REVISION "210"
+#define VCS_REVISION "212"
 
 /* Version number of package */
 #define VERSION "2.10"
index e6341db6f9cb67b035ba3a074d2f1e33c4fd05d9..c1fa825fdf0caaec1a01dcd47b8859a7d2dac20f 100755 (executable)
--- a/configure
+++ b/configure
@@ -2328,7 +2328,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-VCS_REVISION=210
+VCS_REVISION=212
 
 
 cat >>confdefs.h <<_ACEOF
index c3c6cbfb918740d35f6ba73628bef1ce501a033d..9c745681a00d46001ff57b65ce48dcbaa1fb7aa8 100644 (file)
@@ -2,7 +2,7 @@ AC_PREREQ(2.57)
 
 dnl This is the one location where the authoritative version number is stored
 AC_INIT(shellinabox, 2.10, markus@shellinabox.com)
-VCS_REVISION=210
+VCS_REVISION=212
 AC_SUBST(VCS_REVISION)
 AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
                    [Most recent revision number in the version control system])
index 2d45b79821823381716bcc0f07be53bba7f9cd89..2aeb9f8e69c408c599166b61141a20aa1f59d059 100644 (file)
@@ -281,11 +281,12 @@ VT100.prototype.getUserSettings = function() {
   // Compute hash signature to identify the entries in the userCSS menu.
   // If the menu is unchanged from last time, default values can be
   // looked up in a cookie associated with this page.
-  this.signature            = 1;
+  this.signature            = 2;
   this.utfPreferred         = true;
   this.visualBell           = typeof suppressAllAudio != 'undefined' &&
                               suppressAllAudio;
   this.autoprint            = true;
+  this.blinkingCursor       = true;
   if (this.visualBell) {
     this.signature          = Math.floor(16807*this.signature + 1) %
                                          ((1 << 31) - 1);
@@ -315,6 +316,7 @@ VT100.prototype.getUserSettings = function() {
       this.utfPreferred     = settings.charAt(0) != '0';
       this.visualBell       = settings.charAt(1) != '0';
       this.autoprint        = settings.charAt(2) != '0';
+      this.blinkingCursor   = settings.charAt(3) != '0';
       if (typeof userCSSList != 'undefined') {
         for (var i = 0; i < userCSSList.length; ++i) {
           userCSSList[i][2] = settings.charAt(i + 3) != '0';
@@ -327,9 +329,10 @@ VT100.prototype.getUserSettings = function() {
 
 VT100.prototype.storeUserSettings = function() {
   var settings  = 'shellInABox=' + this.signature + ':' +
-                  (this.utfEnabled ? '1' : '0') +
-                  (this.visualBell ? '1' : '0') +
-                  (this.autoprint  ? '1' : '0');
+                  (this.utfEnabled     ? '1' : '0') +
+                  (this.visualBell     ? '1' : '0') +
+                  (this.autoprint      ? '1' : '0') +
+                  (this.blinkingCursor ? '1' : '0');
   if (typeof userCSSList != 'undefined') {
     for (var i = 0; i < userCSSList.length; ++i) {
       settings += userCSSList[i][2] ? '1' : '0';
@@ -1954,8 +1957,12 @@ VT100.prototype.toggleBell = function() {
   this.visualBell = !this.visualBell;
 };
 
+VT100.prototype.toggleCursorBlinking = function() {
+  this.blinkingCursor = !this.blinkingCursor;
+};
+
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.10 (revision 210)" +
+  alert("VT100 Terminal Emulator " + "2.10 (revision 212)" +
         "\nCopyright 2008-2010 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
@@ -1985,9 +1992,12 @@ VT100.prototype.showContextMenu = function(x, y) {
           '<li id="beginconfig">' +
              (this.utfEnabled ? '<img src="enabled.gif" />' : '') +
              'Unicode</li>' +
-          '<li id="endconfig">' +
+          '<li>' +
              (this.visualBell ? '<img src="enabled.gif" />' : '') +
              'Visual Bell</li>'+
+          '<li id="endconfig">' +
+             (this.blinkingCursor ? '<img src="enabled.gif" />' : '') +
+             'Blinking Cursor</li>'+
           (this.usercss.firstChild ?
            '<hr id="beginusercss" />' +
            this.usercss.innerHTML +
@@ -2015,7 +2025,8 @@ VT100.prototype.showContextMenu = function(x, y) {
 
   // Actions for default items
   var actions                 = [ this.copyLast, p, this.reset,
-                                  this.toggleUTF, this.toggleBell ];
+                                  this.toggleUTF, this.toggleBell,
+                                  this.toggleCursorBlinking ];
 
   // Actions for user CSS styles (if any)
   for (var i = 0; i < this.usercssActions.length; ++i) {
@@ -2615,7 +2626,7 @@ VT100.prototype.keyUp = function(event) {
 
 VT100.prototype.animateCursor = function(inactive) {
   if (!this.cursorInterval) {
-    this.cursorInterval     = setInterval(
+    this.cursorInterval       = setInterval(
       function(vt100) {
         return function() {
           vt100.animateCursor();
@@ -2628,10 +2639,14 @@ VT100.prototype.animateCursor = function(inactive) {
   }
   if (inactive != undefined || this.cursor.className != 'inactive') {
     if (inactive) {
-      this.cursor.className = 'inactive';
+      this.cursor.className   = 'inactive';
     } else {
-      this.cursor.className = this.cursor.className == 'bright'
-                              ? 'dim' : 'bright';
+      if (this.blinkingCursor) {
+        this.cursor.className = this.cursor.className == 'bright'
+                                ? 'dim' : 'bright';
+      } else {
+        this.cursor.className = 'bright';
+      }
     }
   }
 };
index 94620f810b02a91a1532641b88a292a5b82f3a83..8e27d6f439f058836cc999f6cd050e488865ac4e 100644 (file)
@@ -358,7 +358,7 @@ ShellInABox.prototype.extendContextMenu = function(entries, actions) {
 };
 
 ShellInABox.prototype.about = function() {
-  alert("Shell In A Box version " + "2.10 (revision 210)" +
+  alert("Shell In A Box version " + "2.10 (revision 212)" +
         "\nCopyright 2008-2010 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com" +
         (typeof serverSupportsSSL != 'undefined' && serverSupportsSSL ?
index 2d45b79821823381716bcc0f07be53bba7f9cd89..2aeb9f8e69c408c599166b61141a20aa1f59d059 100644 (file)
@@ -281,11 +281,12 @@ VT100.prototype.getUserSettings = function() {
   // Compute hash signature to identify the entries in the userCSS menu.
   // If the menu is unchanged from last time, default values can be
   // looked up in a cookie associated with this page.
-  this.signature            = 1;
+  this.signature            = 2;
   this.utfPreferred         = true;
   this.visualBell           = typeof suppressAllAudio != 'undefined' &&
                               suppressAllAudio;
   this.autoprint            = true;
+  this.blinkingCursor       = true;
   if (this.visualBell) {
     this.signature          = Math.floor(16807*this.signature + 1) %
                                          ((1 << 31) - 1);
@@ -315,6 +316,7 @@ VT100.prototype.getUserSettings = function() {
       this.utfPreferred     = settings.charAt(0) != '0';
       this.visualBell       = settings.charAt(1) != '0';
       this.autoprint        = settings.charAt(2) != '0';
+      this.blinkingCursor   = settings.charAt(3) != '0';
       if (typeof userCSSList != 'undefined') {
         for (var i = 0; i < userCSSList.length; ++i) {
           userCSSList[i][2] = settings.charAt(i + 3) != '0';
@@ -327,9 +329,10 @@ VT100.prototype.getUserSettings = function() {
 
 VT100.prototype.storeUserSettings = function() {
   var settings  = 'shellInABox=' + this.signature + ':' +
-                  (this.utfEnabled ? '1' : '0') +
-                  (this.visualBell ? '1' : '0') +
-                  (this.autoprint  ? '1' : '0');
+                  (this.utfEnabled     ? '1' : '0') +
+                  (this.visualBell     ? '1' : '0') +
+                  (this.autoprint      ? '1' : '0') +
+                  (this.blinkingCursor ? '1' : '0');
   if (typeof userCSSList != 'undefined') {
     for (var i = 0; i < userCSSList.length; ++i) {
       settings += userCSSList[i][2] ? '1' : '0';
@@ -1954,8 +1957,12 @@ VT100.prototype.toggleBell = function() {
   this.visualBell = !this.visualBell;
 };
 
+VT100.prototype.toggleCursorBlinking = function() {
+  this.blinkingCursor = !this.blinkingCursor;
+};
+
 VT100.prototype.about = function() {
-  alert("VT100 Terminal Emulator " + "2.10 (revision 210)" +
+  alert("VT100 Terminal Emulator " + "2.10 (revision 212)" +
         "\nCopyright 2008-2010 by Markus Gutschke\n" +
         "For more information check http://shellinabox.com");
 };
@@ -1985,9 +1992,12 @@ VT100.prototype.showContextMenu = function(x, y) {
           '<li id="beginconfig">' +
              (this.utfEnabled ? '<img src="enabled.gif" />' : '') +
              'Unicode</li>' +
-          '<li id="endconfig">' +
+          '<li>' +
              (this.visualBell ? '<img src="enabled.gif" />' : '') +
              'Visual Bell</li>'+
+          '<li id="endconfig">' +
+             (this.blinkingCursor ? '<img src="enabled.gif" />' : '') +
+             'Blinking Cursor</li>'+
           (this.usercss.firstChild ?
            '<hr id="beginusercss" />' +
            this.usercss.innerHTML +
@@ -2015,7 +2025,8 @@ VT100.prototype.showContextMenu = function(x, y) {
 
   // Actions for default items
   var actions                 = [ this.copyLast, p, this.reset,
-                                  this.toggleUTF, this.toggleBell ];
+                                  this.toggleUTF, this.toggleBell,
+                                  this.toggleCursorBlinking ];
 
   // Actions for user CSS styles (if any)
   for (var i = 0; i < this.usercssActions.length; ++i) {
@@ -2615,7 +2626,7 @@ VT100.prototype.keyUp = function(event) {
 
 VT100.prototype.animateCursor = function(inactive) {
   if (!this.cursorInterval) {
-    this.cursorInterval     = setInterval(
+    this.cursorInterval       = setInterval(
       function(vt100) {
         return function() {
           vt100.animateCursor();
@@ -2628,10 +2639,14 @@ VT100.prototype.animateCursor = function(inactive) {
   }
   if (inactive != undefined || this.cursor.className != 'inactive') {
     if (inactive) {
-      this.cursor.className = 'inactive';
+      this.cursor.className   = 'inactive';
     } else {
-      this.cursor.className = this.cursor.className == 'bright'
-                              ? 'dim' : 'bright';
+      if (this.blinkingCursor) {
+        this.cursor.className = this.cursor.className == 'bright'
+                                ? 'dim' : 'bright';
+      } else {
+        this.cursor.className = 'bright';
+      }
     }
   }
 };
index 4d83daaba78a1392310820b3671784ec48f2cc80..51c8fe93c77b2a935c90c914b47173a1f77a8ada 100644 (file)
@@ -281,11 +281,12 @@ VT100.prototype.getUserSettings = function() {
   // Compute hash signature to identify the entries in the userCSS menu.
   // If the menu is unchanged from last time, default values can be
   // looked up in a cookie associated with this page.
-  this.signature            = 1;
+  this.signature            = 2;
   this.utfPreferred         = true;
   this.visualBell           = typeof suppressAllAudio != 'undefined' &&
                               suppressAllAudio;
   this.autoprint            = true;
+  this.blinkingCursor       = true;
   if (this.visualBell) {
     this.signature          = Math.floor(16807*this.signature + 1) %
                                          ((1 << 31) - 1);
@@ -315,6 +316,7 @@ VT100.prototype.getUserSettings = function() {
       this.utfPreferred     = settings.charAt(0) != '0';
       this.visualBell       = settings.charAt(1) != '0';
       this.autoprint        = settings.charAt(2) != '0';
+      this.blinkingCursor   = settings.charAt(3) != '0';
       if (typeof userCSSList != 'undefined') {
         for (var i = 0; i < userCSSList.length; ++i) {
           userCSSList[i][2] = settings.charAt(i + 3) != '0';
@@ -327,9 +329,10 @@ VT100.prototype.getUserSettings = function() {
 
 VT100.prototype.storeUserSettings = function() {
   var settings  = 'shellInABox=' + this.signature + ':' +
-                  (this.utfEnabled ? '1' : '0') +
-                  (this.visualBell ? '1' : '0') +
-                  (this.autoprint  ? '1' : '0');
+                  (this.utfEnabled     ? '1' : '0') +
+                  (this.visualBell     ? '1' : '0') +
+                  (this.autoprint      ? '1' : '0') +
+                  (this.blinkingCursor ? '1' : '0');
   if (typeof userCSSList != 'undefined') {
     for (var i = 0; i < userCSSList.length; ++i) {
       settings += userCSSList[i][2] ? '1' : '0';
@@ -1954,6 +1957,10 @@ VT100.prototype.toggleBell = function() {
   this.visualBell = !this.visualBell;
 };
 
+VT100.prototype.toggleCursorBlinking = function() {
+  this.blinkingCursor = !this.blinkingCursor;
+};
+
 VT100.prototype.about = function() {
   alert("VT100 Terminal Emulator " + VERSION +
         "\nCopyright 2008-2010 by Markus Gutschke\n" +
@@ -1985,9 +1992,12 @@ VT100.prototype.showContextMenu = function(x, y) {
           '<li id="beginconfig">' +
              (this.utfEnabled ? '<img src="enabled.gif" />' : '') +
              'Unicode</li>' +
-          '<li id="endconfig">' +
+          '<li>' +
              (this.visualBell ? '<img src="enabled.gif" />' : '') +
              'Visual Bell</li>'+
+          '<li id="endconfig">' +
+             (this.blinkingCursor ? '<img src="enabled.gif" />' : '') +
+             'Blinking Cursor</li>'+
           (this.usercss.firstChild ?
            '<hr id="beginusercss" />' +
            this.usercss.innerHTML +
@@ -2015,7 +2025,8 @@ VT100.prototype.showContextMenu = function(x, y) {
 
   // Actions for default items
   var actions                 = [ this.copyLast, p, this.reset,
-                                  this.toggleUTF, this.toggleBell ];
+                                  this.toggleUTF, this.toggleBell,
+                                  this.toggleCursorBlinking ];
 
   // Actions for user CSS styles (if any)
   for (var i = 0; i < this.usercssActions.length; ++i) {
@@ -2615,7 +2626,7 @@ VT100.prototype.keyUp = function(event) {
 
 VT100.prototype.animateCursor = function(inactive) {
   if (!this.cursorInterval) {
-    this.cursorInterval     = setInterval(
+    this.cursorInterval       = setInterval(
       function(vt100) {
         return function() {
           vt100.animateCursor();
@@ -2628,10 +2639,14 @@ VT100.prototype.animateCursor = function(inactive) {
   }
   if (inactive != undefined || this.cursor.className != 'inactive') {
     if (inactive) {
-      this.cursor.className = 'inactive';
+      this.cursor.className   = 'inactive';
     } else {
-      this.cursor.className = this.cursor.className == 'bright'
-                              ? 'dim' : 'bright';
+      if (this.blinkingCursor) {
+        this.cursor.className = this.cursor.className == 'bright'
+                                ? 'dim' : 'bright';
+      } else {
+        this.cursor.className = 'bright';
+      }
     }
   }
 };
This page took 0.121552 seconds and 5 git commands to generate.