mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Revert "Fix some stuff with ls() and cat"
This commit is contained in:
parent
d37e8f1d5f
commit
1f5ab50b79
@ -346,10 +346,9 @@ scp
|
|||||||
ls
|
ls
|
||||||
^^
|
^^
|
||||||
|
|
||||||
.. js:function:: ls(hostname/ip, [grep])
|
.. js:function:: ls(hostname/ip)
|
||||||
|
|
||||||
:param string hostname/ip: Hostname or IP of the target server
|
:param string hostname/ip: Hostname or IP of the target server
|
||||||
:param string grep: a substring to search for in the filename.
|
|
||||||
|
|
||||||
Returns an array with the filenames of all files on the specified server (as strings). The returned array
|
Returns an array with the filenames of all files on the specified server (as strings). The returned array
|
||||||
is sorted in alphabetic order
|
is sorted in alphabetic order
|
||||||
|
@ -42,7 +42,7 @@ function showMessage(msg) {
|
|||||||
var txt = "Message received from unknown sender: <br><br>" +
|
var txt = "Message received from unknown sender: <br><br>" +
|
||||||
"<i>" + msg.msg + "</i><br><br>" +
|
"<i>" + msg.msg + "</i><br><br>" +
|
||||||
"This message was saved as " + msg.filename + " onto your home computer.";
|
"This message was saved as " + msg.filename + " onto your home computer.";
|
||||||
dialogBoxCreate(txt, true);
|
dialogBoxCreate(txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Adds a message to a server
|
//Adds a message to a server
|
||||||
|
@ -834,16 +834,6 @@ function NetscriptFunctions(workerScript) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0; i < server.textFiles.length; i++) {
|
|
||||||
if (filter) {
|
|
||||||
if (server.textFiles[i].fn.includes(filter)) {
|
|
||||||
allFiles.push(server.textFiles[i].fn);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
allFiles.push(server.textFiles[i].fn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Sort the files alphabetically then print each
|
//Sort the files alphabetically then print each
|
||||||
allFiles.sort();
|
allFiles.sort();
|
||||||
return allFiles;
|
return allFiles;
|
||||||
|
@ -32,7 +32,7 @@ $(document).on('click', '.dialog-box-close-button', function( event ) {
|
|||||||
|
|
||||||
var dialogBoxOpened = false;
|
var dialogBoxOpened = false;
|
||||||
|
|
||||||
function dialogBoxCreate(txt, preformatted) {
|
function dialogBoxCreate(txt) {
|
||||||
var container = document.createElement("div");
|
var container = document.createElement("div");
|
||||||
container.setAttribute("class", "dialog-box-container");
|
container.setAttribute("class", "dialog-box-container");
|
||||||
|
|
||||||
@ -43,16 +43,8 @@ function dialogBoxCreate(txt, preformatted) {
|
|||||||
closeButton.setAttribute("class", "dialog-box-close-button");
|
closeButton.setAttribute("class", "dialog-box-close-button");
|
||||||
closeButton.innerHTML = "×"
|
closeButton.innerHTML = "×"
|
||||||
|
|
||||||
var textE;
|
var textE = document.createElement("p");
|
||||||
if (preformatted) {
|
textE.innerHTML = txt.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
||||||
// For text files as they are often computed data that
|
|
||||||
// shouldn't be wrapped and should retain tabstops.
|
|
||||||
textE = document.createElement("pre");
|
|
||||||
textE.innerHTML = txt;
|
|
||||||
} else {
|
|
||||||
textE = document.createElement("p");
|
|
||||||
textE.innerHTML = txt.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
||||||
}
|
|
||||||
|
|
||||||
content.appendChild(closeButton);
|
content.appendChild(closeButton);
|
||||||
content.appendChild(textE);
|
content.appendChild(textE);
|
||||||
|
Loading…
Reference in New Issue
Block a user