rename and moving text generating function
This commit is contained in:
parent
05bbb8ba2b
commit
c0d750acfb
@ -1,3 +1,3 @@
|
||||
function cmd_help() {
|
||||
return "Help haha";
|
||||
return "You need help? Sucks to be you! Hahahahaha";
|
||||
}
|
18
js/main.js
18
js/main.js
@ -76,17 +76,10 @@ document.addEventListener("keydown", e => {
|
||||
// Run command and return output???
|
||||
let commandOutput = runCommand(text);
|
||||
|
||||
const aTag = str => {
|
||||
const link = document.createElement("a");
|
||||
link.style.color = "lightgrey";
|
||||
link.textContent = str;
|
||||
return link;
|
||||
};
|
||||
|
||||
tbDiv.appendChild(aTag(text));
|
||||
tbDiv.appendChild(createText(text));
|
||||
tbDiv.innerHTML += `<br>`;
|
||||
if (commandOutput !== "") {
|
||||
tbDiv.append(aTag(commandOutput))
|
||||
tbDiv.append(createText(commandOutput))
|
||||
tbDiv.innerHTML += `<br>`;
|
||||
cursorYOffset++;
|
||||
}
|
||||
@ -110,6 +103,13 @@ document.addEventListener("keydown", e => {
|
||||
}
|
||||
});
|
||||
|
||||
function createText(str) {
|
||||
const link = document.createElement("a");
|
||||
link.style.color = "lightgrey";
|
||||
link.textContent = str;
|
||||
return link;
|
||||
}
|
||||
|
||||
function runCommand(input) {
|
||||
let output = "";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user