Possible fix for IE problems with horizontal positioning of cursor if the line

ends in spaces.


git-svn-id: https://shellinabox.googlecode.com/svn/trunk@85 0da03de8-d603-11dd-86c2-0f8696b7b6f9
This commit is contained in:
zodiac 2009-03-21 16:49:17 +00:00
parent 0ac80a7829
commit 0596dc00c3
5 changed files with 16 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2009-03-21 Markus Gutschke <markus@shellinabox.com>
* Possible fix for IE problems with horizontal positioning of
cursor if the line ends in spaces.
2009-03-21 Markus Gutschke <markus@shellinabox.com> 2009-03-21 Markus Gutschke <markus@shellinabox.com>
* Released version 2.5 * Released version 2.5

View file

@ -95,7 +95,7 @@
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Most recent revision number in the version control system */ /* Most recent revision number in the version control system */
#define VCS_REVISION "84" #define VCS_REVISION "85"
/* Version number of package */ /* Version number of package */
#define VERSION "2.5" #define VERSION "2.5"

2
configure vendored
View file

@ -2055,7 +2055,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
VCS_REVISION=84 VCS_REVISION=85
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF

View file

@ -2,7 +2,7 @@ AC_PREREQ(2.57)
dnl This is the one location where the authoritative version number is stored dnl This is the one location where the authoritative version number is stored
AC_INIT(shellinabox, 2.5, markus@shellinabox.com) AC_INIT(shellinabox, 2.5, markus@shellinabox.com)
VCS_REVISION=84 VCS_REVISION=85
AC_SUBST(VCS_REVISION) AC_SUBST(VCS_REVISION)
AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}", AC_DEFINE_UNQUOTED(VCS_REVISION, "${VCS_REVISION}",
[Most recent revision number in the version control system]) [Most recent revision number in the version control system])

View file

@ -202,6 +202,7 @@ VT100.prototype.initializeElements = function(container) {
!this.getChildById(this.container, 'padding') || !this.getChildById(this.container, 'padding') ||
!this.getChildById(this.container, 'cursor') || !this.getChildById(this.container, 'cursor') ||
!this.getChildById(this.container, 'lineheight') || !this.getChildById(this.container, 'lineheight') ||
!this.getChildById(this.container, 'space') ||
!this.getChildById(this.container, 'input') || !this.getChildById(this.container, 'input') ||
!this.getChildById(this.container, 'cliphelper') || !this.getChildById(this.container, 'cliphelper') ||
!this.getChildById(this.container, 'attrib')) { !this.getChildById(this.container, 'attrib')) {
@ -245,6 +246,7 @@ VT100.prototype.initializeElements = function(container) {
'<pre id="cursor">&nbsp;</pre>' + '<pre id="cursor">&nbsp;</pre>' +
'</div>' + '</div>' +
'<div class="hidden">' + '<div class="hidden">' +
'<pre><div><span id="space"></span></div></pre>' +
'<input type="textfield" id="input" />' + '<input type="textfield" id="input" />' +
'<input type="textfield" id="cliphelper" />' + '<input type="textfield" id="cliphelper" />' +
'<span id="attrib">&nbsp;</span>' + '<span id="attrib">&nbsp;</span>' +
@ -275,14 +277,15 @@ VT100.prototype.initializeElements = function(container) {
this.menu = this.getChildById(this.container, 'menu'); this.menu = this.getChildById(this.container, 'menu');
this.scrollable = this.getChildById(this.container, this.scrollable = this.getChildById(this.container,
'scrollable'); 'scrollable');
this.lineheight = this.getChildById(this.container,
'lineheight');
this.console = this.console =
[ this.getChildById(this.container, 'console'), [ this.getChildById(this.container, 'console'),
this.getChildById(this.container, 'alt_console') ]; this.getChildById(this.container, 'alt_console') ];
var ieProbe = this.getChildById(this.container, 'ieprobe'); var ieProbe = this.getChildById(this.container, 'ieprobe');
this.cursor = this.getChildById(this.container, 'cursor');
this.lineheight = this.getChildById(this.container,
'lineheight');
this.padding = this.getChildById(this.container, 'padding'); this.padding = this.getChildById(this.container, 'padding');
this.cursor = this.getChildById(this.container, 'cursor');
this.space = this.getChildById(this.container, 'space');
this.input = this.getChildById(this.container, 'input'); this.input = this.getChildById(this.container, 'input');
this.cliphelper = this.getChildById(this.container, this.cliphelper = this.getChildById(this.container,
'cliphelper'); 'cliphelper');
@ -1029,7 +1032,8 @@ VT100.prototype.putString = function(x, y, text, style) {
if (pixelX >= 0) { if (pixelX >= 0) {
this.cursor.style.left = (pixelX + (this.isIE ? 1 : 0)) + 'px'; this.cursor.style.left = (pixelX + (this.isIE ? 1 : 0)) + 'px';
} else { } else {
this.cursor.style.left = this.cursorX*this.cursorWidth + this.setTextContent(this.space, this.spaces(this.cursorX));
this.cursor.style.left = this.space.offsetWidth +
console.offsetLeft + 'px'; console.offsetLeft + 'px';
} }
this.cursorY = yIdx - this.numScrollbackLines; this.cursorY = yIdx - this.numScrollbackLines;