Yeah I understand the scrolling issue. I'm just not certain of how to fix it.
Searching through the net, I came across setTimeout. This fix appears to work on local LAN scenarios:
1. Insert:
function waitb4scroll() {
document.getElementById('shell').scrollTop = document.getElementById('shell').scrollHeight;
}
immediately before
function sendcmd() {
2. Then, insert
setTimeout('waitb4scroll()', 1000);
right before
}
function toggle(id)
{
.
From what I understand, this gives a delay of at least a second before the 'shell' window scrolls to the bottom. This is not the ideal solution obviously, but I guess it works well in most LAN environments. Playing with the 1000 milliseconds value would be left to the administrator, I guess. I seriously doubt it would work acceptably in WAN scenarios.
The better approach I'm looking for would involve something like:
while (document.getElementById('cmd').value != '') {
//do some waiting while yielding to other instructions
//... how is this done in JavaScript?
}
document.getElementById('shell').scrollTop = document.getElementById('shell').scrollHeight;
The idea is to wait/yield to other instructions until the element 'cmd' has been reset to an empty string before doing the scroll. I just don't know how to do this in JavaScript.
I'll add a clear screen button or something (doing it with a command might interfere with the need to run a real command...unlikely but still). Are there any other customization settings you think I should add?
I concur that is the best approach for clearing the screen. Messing too much with the inputs would potentially screw a few shell directives.
Have you tried issuing a "dir c:\"? When I do this over LAN, it goes well. But when I do this over WAN, the directive sent becomes "dir c:\\". But I have to investigate further. My own settings may be at fault again *sigh*.
So far I don't have anything else yet to add to the customization settings. I can appreciate the simplicity of it all as of yet. Thanks.