diff --git a/doc/source/netscriptfunctions.rst b/doc/source/netscriptfunctions.rst index 63fb428ca..8661ee953 100644 --- a/doc/source/netscriptfunctions.rst +++ b/doc/source/netscriptfunctions.rst @@ -346,10 +346,9 @@ scp 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 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 is sorted in alphabetic order diff --git a/src/Message.js b/src/Message.js index 0b5b9a98a..667c8d147 100644 --- a/src/Message.js +++ b/src/Message.js @@ -42,7 +42,7 @@ function showMessage(msg) { var txt = "Message received from unknown sender:

" + "" + msg.msg + "

" + "This message was saved as " + msg.filename + " onto your home computer."; - dialogBoxCreate(txt, true); + dialogBoxCreate(txt); } //Adds a message to a server diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 946ffe38b..9fde02dae 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -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 allFiles.sort(); return allFiles; diff --git a/utils/DialogBox.js b/utils/DialogBox.js index 44554b562..8425c053b 100644 --- a/utils/DialogBox.js +++ b/utils/DialogBox.js @@ -32,7 +32,7 @@ $(document).on('click', '.dialog-box-close-button', function( event ) { var dialogBoxOpened = false; -function dialogBoxCreate(txt, preformatted) { +function dialogBoxCreate(txt) { var container = document.createElement("div"); container.setAttribute("class", "dialog-box-container"); @@ -43,16 +43,8 @@ function dialogBoxCreate(txt, preformatted) { closeButton.setAttribute("class", "dialog-box-close-button"); closeButton.innerHTML = "×" - var textE; - if (preformatted) { - // 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, '
'); - } + var textE = document.createElement("p"); + textE.innerHTML = txt.replace(/(?:\r\n|\r|\n)/g, '
'); content.appendChild(closeButton); content.appendChild(textE);