fixes
This commit is contained in:
18
frontend.ts
18
frontend.ts
@ -1,4 +1,4 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
|
||||
const inputElement = document.getElementById('input')as HTMLFormElement;
|
||||
const box = document.getElementById('response_text')as HTMLFormElement;
|
||||
@ -22,13 +22,20 @@ inputElement.addEventListener('keydown', function(event) {
|
||||
function convert_form(): string {
|
||||
|
||||
const user_input = inputElement.value;
|
||||
const converted_user_input = user_input.replace(/ /g, "");
|
||||
if (user_input == "") {
|
||||
|
||||
box.textContent = converted_user_input;
|
||||
return "error";
|
||||
} else {
|
||||
const converted_user_input = user_input.replace(/ /g, "");
|
||||
|
||||
inputElement.value = '';
|
||||
box.textContent = converted_user_input;
|
||||
|
||||
inputElement.value = '';
|
||||
|
||||
copy_to_clipboard();
|
||||
|
||||
return converted_user_input;}
|
||||
|
||||
return converted_user_input;
|
||||
}
|
||||
|
||||
|
||||
@ -39,4 +46,3 @@ function copy_to_clipboard() {
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,9 +1,13 @@
|
||||
{
|
||||
"name": "web_tool",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "web_tool",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^5.1.0"
|
||||
},
|
||||
|
||||
@ -21,6 +21,4 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"type": "commonjs"
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user