# HG changeset patch # User Pascal Bellard # Date 1235496313 0 # Node ID a88940f8334a3babcdd7de06dd91994d7ad41312 # Parent 8a251dbc2bed78671d207724443903499f0bdc25 Ajaxterm: set blue theme diff -r 8a251dbc2bed -r a88940f8334a ajaxterm/receipt --- a/ajaxterm/receipt Tue Feb 24 11:01:55 2009 +0000 +++ b/ajaxterm/receipt Tue Feb 24 17:25:13 2009 +0000 @@ -23,7 +23,7 @@ post_install() { grep ^RUN_DAEMONS $1/etc/rcS.conf | grep -q "ajaxterm" || sed -i \ - 's/RUN_DAEMONS="slim/RUN_DAEMONS="slim ajaxterm/' $1/etc/rcS.conf + 's/RUN_DAEMONS="/RUN_DAEMONS="ajaxterm /' $1/etc/rcS.conf # Configure lighttpd server if [ -f $1/usr/lib/lighttpd/mod_proxy.so ]; then #https://www.dupnet.org/dotclear/index.php/2007/10/07/11-ajaxterm-et-lighttpd diff -r 8a251dbc2bed -r a88940f8334a ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.css Tue Feb 24 17:25:13 2009 +0000 @@ -0,0 +1,61 @@ +pre.stat { + margin: 0px; + padding: 4px; + display: block; + font-family: monospace; + font-weight: bold; + white-space: pre; + background-color: #00d; + border-top: 1px solid #88d; + color: white; +} +pre.stat span { + padding: 0px; +} +pre.stat .on { + background-color: #080; + cursor: pointer; +} +pre.stat .off { + background-color: #48e; + cursor: pointer; +} +pre.term { + margin: 0px; + padding: 4px; + display: block; + font-family: monospace; + white-space: pre; + background-color: black; + border-top: 1px solid white; + color: #fff; +} +pre.term span.f0 { color: #000; } +pre.term span.f1 { color: #b00; } +pre.term span.f2 { color: #0b0; } +pre.term span.f3 { color: #bb0; } +pre.term span.f4 { color: #00b; } +pre.term span.f5 { color: #b0b; } +pre.term span.f6 { color: #0bb; } +pre.term span.f7 { color: #bbb; } +pre.term span.f8 { color: #666; } +pre.term span.f9 { color: #f00; } +pre.term span.f10 { color: #0f0; } +pre.term span.f11 { color: #ff0; } +pre.term span.f12 { color: #00f; } +pre.term span.f13 { color: #f0f; } +pre.term span.f14 { color: #0ff; } +pre.term span.f15 { color: #fff; } +pre.term span.b0 { background-color: #000; } +pre.term span.b1 { background-color: #b00; } +pre.term span.b2 { background-color: #0b0; } +pre.term span.b3 { background-color: #bb0; } +pre.term span.b4 { background-color: #00b; } +pre.term span.b5 { background-color: #b0b; } +pre.term span.b6 { background-color: #0bb; } +pre.term span.b7 { background-color: #bbb; } + +body { background-color: #ccc; } +#term { + float: left; +} diff -r 8a251dbc2bed -r a88940f8334a ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.js --- a/ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.js Tue Feb 24 11:01:55 2009 +0000 +++ b/ajaxterm/stuff/usr/share/ajaxterm/ajaxterm.js Tue Feb 24 17:25:13 2009 +0000 @@ -12,13 +12,13 @@ var keybuf=[]; var sending=0; var rmax=1; - var popupargs='width='+(25+(width*7))+ - ',height='+(45+(height*14))+',scrollbars=no'; + var popupargs='width='+(80+(width*7))+',height='+(70+(height*14))+ + ',scrollbars=no,location=no,menubar=no,status=no,toolbar=no'; var debugmsg=0; + var closed=0; var div=document.getElementById(id); var dstat=document.createElement('pre'); - var sled=document.createElement('span'); var opt_get=document.createElement('a'); var opt_color=document.createElement('a'); var opt_paste=document.createElement('a'); @@ -28,11 +28,10 @@ var dterm=document.createElement('div'); function debug(s) { - debugmsg=1; + debugmsg=(new Date).getTime(); sdebug.innerHTML=s; } function error() { - sled.className='off'; // debug("Connection lost timeout ts:"+((new Date).getTime())); debug("Connection lost "+((new Date).toTimeString())); } @@ -102,14 +101,16 @@ window.open(''+self.location,'',popupargs); } function do_close(event) { + closed=1; + debug('Disconnected'); window.close(); } function update() { // debug("ts: "+((new Date).getTime())+" rmax:"+rmax); + if(debugmsg+5000 < (new Date).getTime()) debugmsg=0; if(debugmsg==0) sdebug.innerHTML=(new Date).toString(); if(sending==0) { sending=1; - sled.className='on'; var r=new XMLHttpRequest(); var send=""; while(keybuf.length>0) { @@ -146,18 +147,21 @@ rmax=2000; } sending=0; - sled.className='off'; - timeout=window.setTimeout(update,rmax); + if (closed==0) { + timeout=window.setTimeout(update,rmax); + } } else { debug("Connection error status:"+r.status); } } } - error_timeout=window.setTimeout(error,5000); - if(opt_get.className=='on') { - r.send(null); - } else { - r.send(query); + if (closed==0) { + error_timeout=window.setTimeout(error,5000); + if(opt_get.className=='on') { + r.send(null); + } else { + r.send(query); + } } } } @@ -165,7 +169,9 @@ keybuf.unshift(s); if(sending==0) { window.clearTimeout(timeout); - timeout=window.setTimeout(update,1); + if (closed==0) { + timeout=window.setTimeout(update,1); + } } } function keypress(ev) { @@ -260,9 +266,6 @@ } } function init() { - sled.appendChild(document.createTextNode('\xb7')); - sled.className='off'; - dstat.appendChild(sled); dstat.appendChild(document.createTextNode(' ')); opt_add(opt_color,'Colors'); opt_color.className='on'; diff -r 8a251dbc2bed -r a88940f8334a ajaxterm/stuff/usr/share/ajaxterm/login --- a/ajaxterm/stuff/usr/share/ajaxterm/login Tue Feb 24 11:01:55 2009 +0000 +++ b/ajaxterm/stuff/usr/share/ajaxterm/login Tue Feb 24 17:25:13 2009 +0000 @@ -2,12 +2,15 @@ server="" if [ -x /usr/bin/ssh ]; then - echo -n "Server: " + echo -n "SSH server: " read -t 300 server || exit 1 fi [ -n "$server" ] || exec /bin/login case "$server" in -*@*);; *) echo -n "$server login: "; read user; server="$user@$server";; +*@*) ;; +*) echo -n "$server login: " + read -t 30 user || exit 1 + server="$user@$server";; esac sshargs="-oPreferredAuthentications=keyboard-interactive,password -oNoHostAuthenticationForLocalhost=yes -oLogLevel=FATAL -F/dev/null"; [ -L /usr/bin/ssh ] && sshargs=""