diff --git a/clite/commands.js b/clite/commands.js index 28f5bf6..1e35051 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -311,7 +311,6 @@ Options: stdio.close(fd); var parts = txt.split('\n'); - // TODO: split long lines parts.forEach(function(line) { if (line.length > tty.chars) { var sects = line.match(new RegExp('(.{1,'+tty.chars+'})','g')); @@ -321,7 +320,7 @@ Options: lines.push(line); }); - bottomLine = lines.length-tty.lines; + bottomLine = (lines.length-tty.lines); showAt(0); } diff --git a/clite/core.js b/clite/core.js index 6a206ee..348d1f5 100644 --- a/clite/core.js +++ b/clite/core.js @@ -67,7 +67,7 @@ var clite = { var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; - script.src = name; + script.src = name+'?d='+(new Date).getTime(); script.onload = callback; head.appendChild(script); }, @@ -78,7 +78,7 @@ var clite = { return; } - fetch(name) + fetch(name+'?d='+(new Date).getTime()) .then(response => response.text()) .then((data) => { callback(data); @@ -205,6 +205,13 @@ data/about.txt:/usr/share/site/about:0:0:-rw-rw-r--`; }else{ var fd = clite.io.open('/usr/share/introduction',function(fd) { clite.user.genGuest(); + clite.shell.writeLine(` + _____ _ _____ _ + / ____| | |_ _| | + | | | | | | | |_ ___ + | | | | | | | __/ _ \\ + | |____| |____ _| |_| || __/ + \\_____|______|_____|\\__\\___|`); if (!fd) return; var d = clite.io.readAll(fd); @@ -840,7 +847,11 @@ clite.term = { var term = document.getElementById('terminal'); var p = term.parentNode; tty.data.el.style.width = term.offsetWidth+'px'; - tty.data.el.style.minHeight = term.offsetHeight+'px'; + if (p.offsetHeight > term.offsetHeight) { + tty.data.el.style.minHeight = p.offsetHeight+'px'; + }else{ + tty.data.el.style.minHeight = term.offsetHeight+'px'; + } tty.data.el.style.position = 'absolute'; tty.data.el.style.top = term.offsetTop+'px'; tty.data.el.style.left = term.offsetLeft+'px'; @@ -849,8 +860,8 @@ clite.term = { var s = document.createElement('span'); s.innerText = 'W'; tty.data.el.appendChild(s); - tty.lines = tty.data.el.offsetHeight/s.offsetHeight; - tty.chars = (tty.data.el.offsetWidth/s.offsetWidth)*0.8; + tty.lines = parseInt((tty.data.el.offsetHeight/s.offsetHeight)*0.9); + tty.chars = parseInt((tty.data.el.offsetWidth/s.offsetWidth)*0.8); tty.data.el.removeChild(s); clite.events.refocus(); return tty; diff --git a/index.php b/index.php deleted file mode 100644 index d9a9319..0000000 --- a/index.php +++ /dev/null @@ -1,7 +0,0 @@ - - -