File tree 4 files changed +10
-10
lines changed
4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ static function getResult(){
50
50
}
51
51
52
52
static function write ($ result ){
53
- $ _SESSION ["phpcommandline " ]["commandresult " ] .= (strlen ($ _SESSION ["phpcommandline " ]["commandresult " ])==0 ? "" : "<br> " ).$ result ;
53
+ $ _SESSION ["phpcommandline " ]["commandresult " ] .= (strlen ($ _SESSION ["phpcommandline " ]["commandresult " ])==0 ? "" : "\n " ).$ result ;
54
54
}
55
55
56
56
private static function popCommand (){
Original file line number Diff line number Diff line change 1
1
<?php
2
2
function helpMain ($ args , $ command ){
3
3
lCommand::write ("> $ command " );
4
- $ content = "pre-installed programs:<br> " ;
4
+ $ content = "pre-installed programs: \n " ;
5
5
$ dirs = array_filter (glob ('programs/* ' ), 'is_dir ' );
6
6
foreach ($ dirs as $ i =>$ s ){
7
- $ content .= " - " .str_replace ("programs/ " , "" , $ s ).(($ i <count ($ dirs )-1 ) ? "<br> " : "" );
7
+ $ content .= " - " .str_replace ("programs/ " , "" , $ s ).(($ i <count ($ dirs )-1 ) ? "\n " : "" );
8
8
}
9
- $ content .= "<br>custom programs:<br> " ;
9
+ $ content .= "\n custom programs:\n " ;
10
10
$ dirs = array_filter (glob ('../programs/* ' ), 'is_dir ' );
11
11
foreach ($ dirs as $ i =>$ s ){
12
- $ content .= " - " .str_replace ("../programs/ " , "" , $ s ).(($ i <count ($ dirs )-1 ) ? "<br> " : "" );
12
+ $ content .= " - " .str_replace ("../programs/ " , "" , $ s ).(($ i <count ($ dirs )-1 ) ? "\n " : "" );
13
13
}
14
14
lCommand::write ($ content );
15
15
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ function moreMain($args, $command){
3
3
lCommand::write ("> $ command " );
4
4
if (count ($ args )==1 ){
5
5
if (lSystem::fileExists (lSystem::getPWD ()."/ " .$ args [0 ])){
6
- lCommand::write (nl2br ( htmlentities (file_get_contents (lSystem::getPWD ()."/ " .$ args [0 ]) )));
6
+ lCommand::write (htmlentities (file_get_contents (lSystem::getPWD ()."/ " .$ args [0 ])));
7
7
}else {
8
8
lCommand::write ("file not found " );
9
9
}
Original file line number Diff line number Diff line change 14
14
#content{
15
15
position : absolute ;
16
16
bottom : 50px ;
17
- max - height : calc (100vh - 50px );
17
+ height : calc (100vh - 50px );
18
18
overflow : auto ;
19
19
width : calc (100 % - 32px );
20
20
}
@@ -83,7 +83,7 @@ class CommandLine{
83
83
xhttp . send ();
84
84
}
85
85
static print(content){
86
- document . getElementById (" content" ). innerHTML += " <br> " + content ;
86
+ document . getElementById (" content" ). innerHTML += " \n " + content ;
87
87
document . getElementById (" content" ). scrollTop = document . getElementById (" content" ). scrollHeight ;
88
88
}
89
89
static reset(content){
@@ -102,7 +102,7 @@ class CommandLine{
102
102
if (this . readyState == 4 && this . status == 200 ) {
103
103
let answer = JSON . parse (xhttp . responseText );
104
104
console . log (answer );
105
- if (answer [" return" ]!= null ) document . getElementsByTagName (' textarea' )[0 ]. value += answer [" return" ];
105
+ if (answer [" return" ]!= null && answer [ " return " ] != " " ) document . getElementsByTagName (' textarea' )[0 ]. value += answer [" return" ];
106
106
}
107
107
} ;
108
108
xhttp.open("GET", "commandline/autocomplete.php?input="+encodeURIComponent(input), true);
@@ -114,7 +114,7 @@ class CommandLine{
114
114
</script >
115
115
</head >
116
116
<body ondblclick = " document.getElementsByTagName('textarea')[0].focus();" >
117
- <div id = " content" class = " content" ></div >
118
117
<div class = " input" ><span >$</span ><textarea autocomplete = " off" spellcheck = " false" autofocus rows = " 1" onkeydown = " CommandLine.parseCommand(event);" ></textarea ></div >
118
+ <textarea disabled id = " content" class = " content" ></textarea >
119
119
</body >
120
120
</html >
You can’t perform that action at this time.
0 commit comments