2024-05-31 15:55:30 -05:00
|
|
|
<!DOCTYPE html>
|
2024-05-31 18:28:30 -05:00
|
|
|
<script src="https://cdn.jsdelivr.net/gh/Sneed-Group/js-plus-plus@81aabdfb07451b663536e01b788634b446052141/jspp.js"></script>
|
2024-05-31 15:55:30 -05:00
|
|
|
<script>
|
2024-05-31 16:06:54 -05:00
|
|
|
const helpers = new JSPlusPlus.General.Helpers
|
2024-05-31 15:55:30 -05:00
|
|
|
const html = new JSPlusPlus.HTMLFrontend
|
|
|
|
html.initHead("Toxicity Check")
|
|
|
|
html.initBody()
|
2024-05-31 18:22:37 -05:00
|
|
|
async function tox() {
|
2024-05-31 18:08:50 -05:00
|
|
|
const sentence = document.getElementById("textBox1").value
|
|
|
|
let p = document.getElementById("toxicityBool")
|
2024-05-31 15:55:30 -05:00
|
|
|
const objSentence = [sentence]
|
2024-05-31 18:20:30 -05:00
|
|
|
let toxic = await helpers.isToxic(objSentence)
|
2024-05-31 18:33:27 -05:00
|
|
|
p.innerText = JSON.stringify(toxic.toString)
|
2024-05-31 17:36:47 -05:00
|
|
|
console.log(toxic)
|
2024-05-31 15:55:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
helpers.consoleUseWarner("DO NOT INPUT ANYTHING HERE UNLESS YOU KNOW WHAT YOU ARE DOING.")
|
|
|
|
|
2024-05-31 17:36:47 -05:00
|
|
|
let p = html.createParagraph("toxicityBool", "Input text to the text box bellow, click the button, and check here if its toxic.")
|
|
|
|
let textbox = html.createElement("textarea", "textBox1", {width: "80%", placeholder: "input sentence here."})
|
2024-05-31 15:55:30 -05:00
|
|
|
let submit = html.createElement("button", "submit")
|
|
|
|
|
2024-05-31 17:31:58 -05:00
|
|
|
submit.innerText = "Toxic?" // github pages pls dont bug out now
|
2024-05-31 17:30:18 -05:00
|
|
|
|
2024-05-31 18:08:50 -05:00
|
|
|
submit.addEventListener("click", tox);
|
2024-05-31 15:55:30 -05:00
|
|
|
</script>
|