From 69c24d56410887bfb9c45cf86d33a64e110fc2db Mon Sep 17 00:00:00 2001 From: 9glenda Date: Mon, 5 Jun 2023 18:44:49 +0000 Subject: [PATCH 01/13] make frontend less suck --- web/ts/script.ts | 2177 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 1522 insertions(+), 655 deletions(-) diff --git a/web/ts/script.ts b/web/ts/script.ts index 496d682e..bf5f6f60 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -1,5 +1,811 @@ import { saveAsFile, checkDropdownValue, getDropdownElementIndex, apiCall } from "./framework.js"; -//import * as person from "../ts-gen/person.js"; +import * as person from "../ts-gen/person.js"; + +class Person extends person.Person { + Post(loadingSpinner?: HTMLDivElement): void { + const requestOptions = { + method: "POST", + body: JSON.stringify(this), + }; + + fetch(apiCall("/person"), requestOptions) + .then(() => { + if (loadingSpinner) { + loadingSpinner.style.display = "none"; + } + location.reload(); + }) + .catch((error) => { + console.error("Error:", error); + }); + } + + Edit(): void { + let obj = this; + mainContainer.style.display = "none"; + editContainer.style.display = "flex"; + + editShowID.innerHTML = obj.id; + + editNameTag.value = obj.name; + + if (obj.gender != "") { + const genderSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(1) > .gender-select") as HTMLElement; + const selectItems = genderSelect.querySelector(".select-items") as HTMLElement; + const selectSelected = genderSelect.querySelector(".select-selected") as HTMLElement; + + const genderIndex: string | undefined = getDropdownElementIndex("gender", obj.gender); + + if (genderIndex != undefined) { + const genderElement = selectItems.children[parseInt(genderIndex)]; + + selectSelected.innerHTML = translateRawWord(obj.gender)!; + genderElement.className = "same-as-selected"; + } + } + + if (obj.ethnicity != "") { + const ethnicitySelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(2) > .ethnicity-select") as HTMLElement; + const selectItems = ethnicitySelect.querySelector(".select-items") as HTMLElement; + const selectSelected = ethnicitySelect.querySelector(".select-selected") as HTMLElement; + + const ethnicityIndex: string | undefined = getDropdownElementIndex("ethnicity", obj.ethnicity); + + if (ethnicityIndex != undefined) { + const ethnicityElement = selectItems.children[parseInt(ethnicityIndex)]; + + selectSelected.innerHTML = translateRawWord(obj.ethnicity)!; + ethnicityElement.className = "same-as-selected"; + } + } + + editAge.innerHTML = obj.age.toString(); + editBday.innerHTML = obj.bday; + editAddress.innerHTML = obj.address; + + // Phone + + const phoneBase = document.querySelector(".phone-base") as HTMLDivElement; + + if (Object.keys(obj.phone).length >= 1) { + for (const [_, phone] of Object.entries(obj.phone)) { + const phoneVar = (phone as { number: string, valid: boolean, phoneinfoga: { Country: string } }) + + const container = document.createElement("div"); + container.className = "phone-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "phone-subcontainer"; + + const phone_input = document.createElement("input"); + phone_input.className = "form-input phone"; + phone_input.id = "e-phone"; + phone_input.type = "tel"; + phone_input.placeholder = "Enter phone number"; + phone_input.spellcheck = false; + phone_input.setAttribute("lng-tag", "enter_phone_number") + phone_input.required = true; + phone_input.value = phoneVar.number; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + container.appendChild(subContainer); + subContainer.appendChild(phone_input); + phoneBase.appendChild(container); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + + del_btn.onclick = function () { + container.remove(); + } + + refreshTranslation(); + }; + } + + document.getElementById("phone-add-btn")!.onclick = function () { + const phone_container = document.createElement("div"); + phone_container.className = "phone-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "phone-subcontainer"; + + const phone_input = document.createElement("input"); + phone_input.className = "form-input e-phone"; + phone_input.id = "phone"; + phone_input.type = "tel"; + phone_input.placeholder = "Enter phone number"; + phone_input.spellcheck = false; + phone_input.setAttribute("lng-tag", "enter_phone_number") + //phone_input.maxLength = "15"; // FIXME some formattings can have more then 15 chars. + phone_input.required = true; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + phoneBase.appendChild(phone_container); + phone_container.appendChild(subContainer); + subContainer.appendChild(phone_input); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn_div.onclick = function () { + phone_container.remove(); + } + + refreshTranslation(); + } + + if (obj.civilstatus != "") { + const civilstatusSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(7) > .civilstatus-select") as HTMLElement; + const selectItems = civilstatusSelect.querySelector(".select-items"); + const selectSelected = civilstatusSelect.querySelector(".select-selected"); + + const civilstatusIndex = getDropdownElementIndex("civilstatus", obj.civilstatus); + + if (civilstatusIndex != undefined) { + const civilstatusElement = selectItems!.children[parseInt(civilstatusIndex)]; + + selectSelected!.innerHTML = translateRawWord(obj.civilstatus)!; + civilstatusElement.className = "same-as-selected"; + } + } + + editKids.innerHTML = obj.kids; + + // Hobbies + + const hobbyBase = document.querySelector(".e-hobby-base") as HTMLDivElement; + + if (Object.keys(obj.hobbies).length >= 1) { + for (const [_, hobby] of Object.entries(obj.hobbies)) { + const hobbyVar = (hobby as { hobby: string }) + + const container = document.createElement("div"); + container.className = "hobby-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "hobby-subcontainer"; + + const hobby_input = document.createElement("input") as HTMLInputElement; + hobby_input.className = "form-input hobby"; + hobby_input.id = "e-hobby"; + hobby_input.placeholder = "Enter hobby"; + hobby_input.spellcheck = false; + hobby_input.setAttribute("lng-tag", "enter_hobby") + hobby_input.value = hobbyVar.hobby; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + container.appendChild(subContainer); + subContainer.appendChild(hobby_input); + hobbyBase.appendChild(container); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn.onclick = function () { + container.remove(); + } + + refreshTranslation(); + }; + } + + document.getElementById("hobby-add-btn")!.onclick = function () { + const hobby_container = document.createElement("div"); + hobby_container.className = "hobby-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "hobby-subcontainer"; + + const hobby_input = document.createElement("input"); + hobby_input.className = "form-input e-hobby"; + hobby_input.id = "hobby"; + hobby_input.type = "text"; + hobby_input.placeholder = "Enter hobby"; + hobby_input.setAttribute("lng-tag", "enter_hobby") + hobby_input.spellcheck = false; + hobby_input.required = true; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + hobbyBase.appendChild(hobby_container); + hobby_container.appendChild(subContainer); + subContainer.appendChild(hobby_input); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn_div.onclick = function () { + hobby_container.remove(); + } + + refreshTranslation(); + } + + editOccupation.innerHTML = obj.occupation; + editPrevOccupation.innerHTML = obj.prevoccupation; + editEducation.innerHTML = obj.education; + + if (obj.religion != "") { + const religionSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(15) > .religion-select") as HTMLElement; + const selectItems = religionSelect.querySelector(".select-items") as HTMLElement; + const selectSelected = religionSelect.querySelector(".select-selected") as HTMLElement; + + const religionIndex = getDropdownElementIndex("religion", obj.religion); + + if (religionIndex != undefined) { + const religionElement = selectItems.children[parseInt(religionIndex)]; + + selectSelected.innerHTML = translateRawWord(obj.religion)!; + religionElement.className = "same-as-selected"; + } + } + + editPets.innerHTML = obj.pets; + + // Clubs + + const clubBase = document.querySelector(".e-club-base") as HTMLDivElement; + + if (Object.keys(obj.clubs).length >= 1) { + for (const [_, club] of Object.entries(obj.clubs)) { + const clubVar = (club as { club: string }) + + const container = document.createElement("div"); + container.className = "club-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "club-subcontainer"; + + const club_input = document.createElement("input"); + club_input.className = "form-input club"; + club_input.id = "e-club"; + club_input.type = "text"; + club_input.placeholder = "Enter club"; + club_input.spellcheck = false; + club_input.setAttribute("lng-tag", "enter_club") + club_input.value = clubVar.club; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + container.appendChild(subContainer); + subContainer.appendChild(club_input); + clubBase.appendChild(container); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn.onclick = function () { + container.remove(); + } + + refreshTranslation(); + }; + } + + document.getElementById("club-add-btn")!.onclick = function () { + const club_container = document.createElement("div"); + club_container.className = "club-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "club-subcontainer"; + + const club_input = document.createElement("input"); + club_input.className = "form-input e-club"; + club_input.id = "club"; + club_input.type = "text"; + club_input.placeholder = "Enter club"; + club_input.spellcheck = false; + club_input.setAttribute("lng-tag", "enter_club") + club_input.required = true; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + clubBase.appendChild(club_container); + club_container.appendChild(subContainer); + subContainer.appendChild(club_input); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn_div.onclick = function () { + club_container.remove(); + } + + refreshTranslation(); + } + + editLegal.innerHTML = obj.legal; + editPolitical.innerHTML = obj.political; + + // Sources + + const sourceBase = document.querySelector(".e-source-base") as HTMLDivElement; + + if (Object.keys(obj.sources).length >= 1) { + for (const [_, url] of Object.entries(obj.sources)) { + const sourceVar = (url as { url: string }) + + const container = document.createElement("div"); + container.className = "source-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "source-subcontainer"; + + const source_input = document.createElement("input"); + source_input.className = "form-input source"; + source_input.id = "e-source"; + source_input.type = "text"; + source_input.placeholder = "Enter source"; + source_input.spellcheck = false; + source_input.setAttribute("lng-tag", "enter_source") + source_input.value = sourceVar.url; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + container.appendChild(subContainer); + subContainer.appendChild(source_input); + sourceBase.appendChild(container); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn.onclick = function () { + container.remove(); + } + + refreshTranslation(); + }; + } + + document.getElementById("source-add-btn")!.onclick = function () { + const source_container = document.createElement("div"); + source_container.className = "source-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "source-subcontainer"; + + const source_input = document.createElement("input"); + source_input.className = "form-input e-source"; + source_input.id = "source"; + source_input.type = "text"; + source_input.placeholder = "Enter source"; + source_input.spellcheck = false; + source_input.setAttribute("lng-tag", "enter_source") + source_input.required = true; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + sourceBase.appendChild(source_container); + source_container.appendChild(subContainer); + subContainer.appendChild(source_input); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn_div.onclick = function () { + source_container.remove(); + } + + refreshTranslation(); + } + + editNotes.innerHTML = obj.notes; + + // IPs + + const ipBase = document.querySelector(".e-ip-base") as HTMLDivElement; + + if (Object.keys(obj.ips).length >= 1) { + for (const [_, ip] of Object.entries(obj.ips)) { + const ipVar = (ip as { ip: string }) + + const container = document.createElement("div"); + container.className = "ip-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "ip-subcontainer"; + + const ip_input = document.createElement("input"); + ip_input.className = "form-input ip"; + ip_input.id = "e-ip"; + ip_input.type = "text"; + ip_input.placeholder = "Enter IP"; + ip_input.spellcheck = false; + ip_input.setAttribute("lng-tag", "enter_ip") + ip_input.value = ipVar.ip; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + container.appendChild(subContainer); + subContainer.appendChild(ip_input); + ipBase.appendChild(container); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn.onclick = function () { + container.remove(); + } + + refreshTranslation(); + }; + } + + document.getElementById("ip-add-btn")!.onclick = function () { + const ip_container = document.createElement("div"); + ip_container.className = "ip-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "ip-subcontainer"; + + const ip_input = document.createElement("input"); + ip_input.className = "form-input e-ip"; + ip_input.id = "ip"; + ip_input.type = "text"; + ip_input.placeholder = "Enter IP"; + ip_input.spellcheck = false; + ip_input.setAttribute("lng-tag", "enter_ip") + ip_input.required = true; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + ipBase.appendChild(ip_container); + ip_container.appendChild(subContainer); + subContainer.appendChild(ip_input); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn_div.onclick = function () { + ip_container.remove(); + } + + refreshTranslation(); + } + + // Email + + const emailBase = document.querySelector(".email-base") as HTMLDivElement; + + if (Object.keys(obj.email).length >= 1) { + for (const [_, email] of Object.entries(obj.email)) { + const emailVar = (email as { mail: string, services: {} }); + + const container = document.createElement("div"); + container.className = "email-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "email-subcontainer"; + + const email_input = document.createElement("input"); + email_input.className = "form-input e-mail"; + email_input.id = "e-mail"; + email_input.type = "email"; + email_input.placeholder = "Enter email address"; + email_input.spellcheck = false; + email_input.setAttribute("lng-tag", "enter_email_address") + email_input.required = true; + email_input.value = emailVar.mail; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + container.appendChild(subContainer); + subContainer.appendChild(email_input); + emailBase.appendChild(container); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + if (emailVar.services != undefined && emailVar.services != null && emailVar.services != "") { + const hidden_email_save = document.createElement("p"); + hidden_email_save.className = "hidden-email-save"; + + hidden_email_save.innerHTML = JSON.stringify(emailVar.services); + container.appendChild(hidden_email_save); + } + + del_btn.onclick = function () { + container.remove(); + } + + refreshTranslation(); + }; + } + + + + document.getElementById("email-add-btn")!.onclick = function () { + const email_base = document.querySelector(".email-base"); + + const email_container = document.createElement("div"); + email_container.className = "email-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "email-subcontainer"; + + const email_input = document.createElement("input"); + email_input.className = "form-input e-mail"; + email_input.id = "e-mail"; + email_input.type = "email"; + email_input.placeholder = "Enter email address"; + email_input.spellcheck = false; + email_input.setAttribute("lng-tag", "enter_email_address") + email_input.required = true; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + emailBase.appendChild(email_container); + email_container.appendChild(subContainer); + subContainer.appendChild(email_input); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + const hidden_email_save = document.createElement("p"); + hidden_email_save.className = "hidden-email-save"; + email_container.appendChild(hidden_email_save); + + del_btn_div.onclick = function () { + email_container.remove(); + } + + refreshTranslation(); + } + + // Accounts + + if (Object.keys(obj.accounts).length != 0 && obj.accounts != null) { + for (const [_, accObj] of Object.entries(obj.accounts)) { + const accVar = (accObj as { service: string, id: string, username: string, url: string, profilePicture: { [key: number]: { img: string, img_hash: number } }, bio: { [key: number]: { bio: string } } }); + + //let accObj = obj.accounts[i]; + + // Creating elements + + const base_div = document.createElement("div"); // Outer div + base_div.className = "acc-chip"; + + const pfp_img = document.createElement("img"); // Pfp img + pfp_img.className = "userPfp"; + + if (accVar.profilePicture != null) { + pfp_img.src = "data:image/png;base64," + accVar.profilePicture["1"].img; + } else { + pfp_img.src = "https://as2.ftcdn.net/v2/jpg/03/32/59/65/1000_F_332596535_lAdLhf6KzbW6PWXBWeIFTovTii1drkbT.jpg" + } + + const info_div = document.createElement("div"); // Info div + info_div.className = "info-container"; + + const icon_space = document.createElement("div"); + icon_space.className = "icon-space"; + + const service_p = document.createElement("a"); + service_p.className = "serviceName"; + service_p.innerHTML = accVar.service; + service_p.href = accVar.url; + service_p.target = "_blank"; + + const name_p = document.createElement("a"); + name_p.className = "userName"; + name_p.innerHTML = accVar.username; + name_p.href = accVar.url; + name_p.target = "_blank"; + + document.querySelector(".e-accounts")!.appendChild(base_div); + base_div.appendChild(pfp_img); + base_div.appendChild(info_div); + base_div.appendChild(icon_space); + info_div.appendChild(service_p); + info_div.appendChild(name_p); + + if (accVar.service.toLowerCase() == "github") { // If the service is github, add a deep investigation button + const deep_btn = document.createElement("div"); + deep_btn.className = "deepInvBtn btn btn-secondary"; + deep_btn.id = "deepInvBtn"; + + const deep_btn_txt = document.createElement("p"); + deep_btn_txt.className = "deepInvBtnTxt"; + deep_btn_txt.innerHTML = "Deep Investigation"; + + base_div.appendChild(deep_btn); + deep_btn.appendChild(deep_btn_txt); + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "delAccBtn-deep btn btn-secondary"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + base_div.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + + // Deep investigation + deep_btn.onclick = async function () { + if (icon_space.firstChild) { + icon_space.firstChild.remove(); + } + + deep_btn_txt.innerHTML = "This may take up to an hour..."; + + const loadingSpinner = document.createElement("div"); + loadingSpinner.className = "neu"; + loadingSpinner.id = "deepInvLoadingSpinner"; + loadingSpinner.style.display = "flex"; + + const loadingSpinnerShape = document.createElement("div"); + loadingSpinnerShape.className = "neu_shape"; + + const loadingSpinnerInner = document.createElement("div"); + loadingSpinnerInner.className = "neu_inner"; + + const loadingSpinnerBall = document.createElement("div"); + loadingSpinnerBall.className = "neu_ball"; + + + icon_space.appendChild(loadingSpinner) + loadingSpinner.appendChild(loadingSpinnerShape); + loadingSpinnerShape.appendChild(loadingSpinnerInner); + loadingSpinnerInner.appendChild(loadingSpinnerBall); + loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); + loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); + loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); + + + const res = await fetch(apiCall("/deep/github/" + accVar.username)) + let data = await res.json(); + + loadingSpinner.remove(); + + const deepInvResIcon = document.createElement("ion-icon") as IonIconElement; + deepInvResIcon.className = "deepInvResIcon"; + + icon_space.appendChild(deepInvResIcon); + + if (data != null && data != "{}" && res.status == 200) { + deep_btn_txt.innerHTML = "Deep Investigation"; + + deepInvResIcon.name = "checkmark-outline"; + deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" + + for (const [i, _] of Object.entries(data)) { + let obj = data[i]; + + const email_container = document.createElement("div"); + email_container.className = "email-container"; + + const subContainer = document.createElement("div"); + subContainer.className = "email-subcontainer"; + + const email_input = document.createElement("input"); + email_input.className = "form-input e-mail"; + email_input.id = "e-mail"; + email_input.type = "email"; + email_input.placeholder = "Enter email address"; + email_input.spellcheck = false; + email_input.setAttribute("lng-tag", "enter_email_address") + email_input.value = obj.mail; + + const del_btn_div = document.createElement("div"); + del_btn_div.className = "del-btn"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + const hidden_email_save = document.createElement("p"); + hidden_email_save.className = "hidden-email-save"; + + hidden_email_save.innerHTML = JSON.stringify(obj.services); + + emailBase.appendChild(email_container); + email_container.appendChild(subContainer); + subContainer.appendChild(email_input); + subContainer.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + email_container.appendChild(hidden_email_save); + + del_btn_div.onclick = function () { + email_container.remove(); + } + + refreshTranslation(); + } + } else if (res.status == 403 && data["fatal"] == "rate limited") { + deepInvResIcon.name = "timer-outline"; + deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.15rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" + } else { + deepInvResIcon.name = "close-outline"; + deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" + } + } + + + del_btn_div.onclick = function () { + fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { + method: "GET", + mode: "no-cors" + }); + + base_div.remove(); + // TODO Add stuff here + } + } else { + const del_btn_div = document.createElement("div"); + del_btn_div.className = "delAccBtn btn btn-secondary"; + + const del_btn = document.createElement("ion-icon") as IonIconElement; + del_btn.name = "remove-outline"; + + base_div.appendChild(del_btn_div); + del_btn_div.appendChild(del_btn); + + del_btn_div.onclick = function () { + fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { + method: "GET", + mode: "no-cors" + }); + + base_div.remove(); + + // TODO Add stuff here + } + } + + if (accVar.bio != null) { + const bio_p = document.createElement("p"); + bio_p.className = "userBio"; + bio_p.innerHTML = accVar.bio["1"].bio; + + info_div.appendChild(bio_p); + } + } + } + return + } +} + const searchBar = document.getElementById("searchbar"); @@ -108,17 +914,40 @@ document.getElementById("savemdbtn")!.onclick = async function () { saveAsFile(textToSave.markdown, getName!.value.toLowerCase().replace(/ /g, "") + ".md"); } + function checkId(): string { + let idExists = false; + const data = await getData() as object[]; + let totalIds = Object.keys(data).length; + let preId = String(totalIds + 1); -document.getElementById("newbtn")!.onclick = function () { - mainContainer.style.display = "none"; - createContainer.style.display = "flex"; + for (let i = 0; i < totalIds; i++) { + if (Object.keys(data)[i] == preId) { + idExists = true; + break; + } + } + + if (idExists) { + preId = String(parseInt(preId) + 1); + return checkId(preId); + } + return preId; + } +// NEW BUTTON +document.getElementById("newbtn")!.onclick = async function () { + let obj = new Person(); + obj.id = checkId(); + obj.name = ""; + obj.Edit(); + // mainContainer.style.display = "none"; + // createContainer.style.display = "flex"; } document.getElementById("exportbtn")!.onclick = function () { saveAsFile(JSON.stringify(getData()), "data.json"); } -function createCards(obj: any) { +function createCards(obj: Person){ let x = document.querySelector('#list-holder')!; // Basic @@ -182,14 +1011,14 @@ function createCards(obj: any) { d_icon.className = "icon" d_icon.setAttribute("name", "trash-outline"); - d_icon_div.onclick = function () { - fetch(apiCall("/people/" + obj.id + "/delete"), { - method: "GET", - mode: "no-cors" - }).then(function () { - location.reload(); - }); - } + d_icon_div.onclick = function () { + fetch(apiCall("/people/" + obj.id + "/delete"), { + method: "GET", + mode: "no-cors" + }).then(function () { + location.reload(); + }); +} acc_icon_div.onclick = function () { editShowID.innerHTML = obj.id; @@ -328,16 +1157,12 @@ function createCards(obj: any) { // Check if accObj.service and accObj.username are also in accounts object at obj.accounts let getId = editShowID.innerHTML - const res = await fetch(apiCall("/people/" + getId)) + const res = await fetch(apiCall("/people/" + getId)); - let data = await res.json(); + let data = await res.json() as Person; data.accounts[accObj.service + "-" + accObj.username] = accObj; - - fetch(apiCall("/person"), { - method: 'POST', - body: JSON.stringify(data) - }); + data.Post() accept_p.innerHTML = "Accepted!"; } @@ -392,21 +1217,21 @@ function createCards(obj: any) { viewNameTag.value = obj.name; - viewGender.innerHTML = translateRawWord("Gender:")! + " " + translateRawWord(obj.gender); - viewEthnicity.innerHTML = translateRawWord("Ethnicity:")! + " " + translateRawWord(obj.ethnicity); - viewAge.innerHTML = translateRawWord("Age:")! + " " + obj.age; - viewBday.innerHTML = translateRawWord("Birthday:")! + " " + obj.bday; - viewAddress.innerHTML = translateRawWord("Address:")! + " " + obj.address; - viewCivilStatus.innerHTML = translateRawWord("Civil status:")! + " " + translateRawWord(obj.civilstatus); - viewKids.innerHTML = translateRawWord("Kids:") + " " + obj.kids; - viewOccupation.innerHTML = translateRawWord("Occupation:")! + " " + obj.occupation; - viewPrevOccupation.innerHTML = translateRawWord("Previous Occupation:")! + obj.prevoccupation; - viewEducation.innerHTML = translateRawWord("Education:")! + " " + obj.education; - viewReligion.innerHTML = translateRawWord("Religion:")! + " " + translateRawWord(obj.religion); - viewPets.innerHTML = translateRawWord("Pets:")! + " " + obj.pets; - viewLegal.innerHTML = translateRawWord("Legal:")! + " " + obj.legal; - viewPolitical.innerHTML = translateRawWord("Political:")! + " " + obj.political; - viewNotes.innerHTML = obj.notes; + viewGender.innerHTML = translateRawWord("Gender:")! + " " + (translateRawWord(obj.gender) || ""); + viewEthnicity.innerHTML = translateRawWord("Ethnicity:")! + " " + (translateRawWord(obj.ethnicity) || ""); + viewAge.innerHTML = translateRawWord("Age:")! + " " + (obj.age || ""); + viewBday.innerHTML = translateRawWord("Birthday:")! + " " + (obj.bday || ""); + viewAddress.innerHTML = translateRawWord("Address:")! + " " + (obj.address || ""); + viewCivilStatus.innerHTML = translateRawWord("Civil status:")! + " " + (translateRawWord(obj.civilstatus) || ""); + viewKids.innerHTML = translateRawWord("Kids:") + " " + (obj.kids || ""); + viewOccupation.innerHTML = translateRawWord("Occupation:")! + " " + (obj.occupation || ""); + viewPrevOccupation.innerHTML = translateRawWord("Previous Occupation:")! + (obj.prevoccupation || ""); + viewEducation.innerHTML = translateRawWord("Education:")! + " " + (obj.education || ""); + viewReligion.innerHTML = translateRawWord("Religion:")! + " " + (translateRawWord(obj.religion) || ""); + viewPets.innerHTML = translateRawWord("Pets:")! + " " + (obj.pets || ""); + viewLegal.innerHTML = translateRawWord("Legal:")! + " " + (obj.legal || ""); + viewPolitical.innerHTML = translateRawWord("Political:")! + " " + (obj.political || ""); + viewNotes.innerHTML = (obj.notes || ""); const allObjectsAtStart = document.querySelectorAll(".viewtag"); @@ -713,7 +1538,7 @@ function createCards(obj: any) { if (Object.keys(obj.email).length >= 1) { for (const [_, email] of Object.entries(obj.email)) { - const emailVar = (email as { mail: string, valid: boolean, services: { service: { name: string, icon: string, link: string } } }) + const emailVar = (email as person.Email) if (emailVar.mail != "" && emailVar.mail != null && emailVar.mail != undefined) { viewEmailSpacemaker.style.display = "block"; @@ -825,7 +1650,7 @@ function createCards(obj: any) { // Accounts - if (obj.accounts.length != 0 && obj.accounts != null) { + if (Object.keys(obj.accounts).length != 0 && obj.accounts != null) { for (const [_, accObj] of Object.entries(obj.accounts)) { const accVar = (accObj as { service: string, id: string, username: string, url: string, profilePicture: { [key: number]: { img: string, img_hash: number } }, bio: { [key: number]: { bio: string } } }); @@ -877,788 +1702,790 @@ function createCards(obj: any) { } } } - + // edit button e_icon_div.onclick = function () { - mainContainer.style.display = "none"; - editContainer.style.display = "flex"; - - editShowID.innerHTML = obj.id; - - editNameTag.value = obj.name; - - if (obj.gender != "") { - const genderSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(1) > .gender-select") as HTMLElement; - const selectItems = genderSelect.querySelector(".select-items") as HTMLElement; - const selectSelected = genderSelect.querySelector(".select-selected") as HTMLElement; - - const genderIndex: string | undefined = getDropdownElementIndex("gender", obj.gender); - - if (genderIndex != undefined) { - const genderElement = selectItems.children[parseInt(genderIndex)]; - - selectSelected.innerHTML = translateRawWord(obj.gender)!; - genderElement.className = "same-as-selected"; - } - } - - if (obj.ethnicity != "") { - const ethnicitySelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(2) > .ethnicity-select") as HTMLElement; - const selectItems = ethnicitySelect.querySelector(".select-items") as HTMLElement; - const selectSelected = ethnicitySelect.querySelector(".select-selected") as HTMLElement; - - const ethnicityIndex: string | undefined = getDropdownElementIndex("ethnicity", obj.ethnicity); - - if (ethnicityIndex != undefined) { - const ethnicityElement = selectItems.children[parseInt(ethnicityIndex)]; - - selectSelected.innerHTML = translateRawWord(obj.ethnicity)!; - ethnicityElement.className = "same-as-selected"; - } - } - - editAge.innerHTML = obj.age; - editBday.innerHTML = obj.bday; - editAddress.innerHTML = obj.address; - - // Phone - - const phoneBase = document.querySelector(".phone-base") as HTMLDivElement; - - if (Object.keys(obj.phone).length >= 1) { - for (const [_, phone] of Object.entries(obj.phone)) { - const phoneVar = (phone as { number: string, valid: boolean, phoneinfoga: { Country: string } }) - - const container = document.createElement("div"); - container.className = "phone-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "phone-subcontainer"; - - const phone_input = document.createElement("input"); - phone_input.className = "form-input phone"; - phone_input.id = "e-phone"; - phone_input.type = "tel"; - phone_input.placeholder = "Enter phone number"; - phone_input.spellcheck = false; - phone_input.setAttribute("lng-tag", "enter_phone_number") - phone_input.required = true; - phone_input.value = phoneVar.number; - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + let obj2 = new Person(obj); + obj2.Edit() + //mainContainer.style.display = "none"; + //editContainer.style.display = "flex"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - container.appendChild(subContainer); - subContainer.appendChild(phone_input); - phoneBase.appendChild(container); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + //editShowID.innerHTML = obj.id; + //editNameTag.value = obj.name; - del_btn.onclick = function () { - container.remove(); - } + //if (obj.gender != "") { + // const genderSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(1) > .gender-select") as HTMLElement; + // const selectItems = genderSelect.querySelector(".select-items") as HTMLElement; + // const selectSelected = genderSelect.querySelector(".select-selected") as HTMLElement; - refreshTranslation(); - }; - } + // const genderIndex: string | undefined = getDropdownElementIndex("gender", obj.gender); - document.getElementById("phone-add-btn")!.onclick = function () { - const phone_container = document.createElement("div"); - phone_container.className = "phone-container"; + // if (genderIndex != undefined) { + // const genderElement = selectItems.children[parseInt(genderIndex)]; - const subContainer = document.createElement("div"); - subContainer.className = "phone-subcontainer"; + // selectSelected.innerHTML = translateRawWord(obj.gender)!; + // genderElement.className = "same-as-selected"; + // } + //} - const phone_input = document.createElement("input"); - phone_input.className = "form-input e-phone"; - phone_input.id = "phone"; - phone_input.type = "tel"; - phone_input.placeholder = "Enter phone number"; - phone_input.spellcheck = false; - phone_input.setAttribute("lng-tag", "enter_phone_number") - //phone_input.maxLength = "15"; // FIXME some formattings can have more then 15 chars. - phone_input.required = true; + //if (obj.ethnicity != "") { + // const ethnicitySelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(2) > .ethnicity-select") as HTMLElement; + // const selectItems = ethnicitySelect.querySelector(".select-items") as HTMLElement; + // const selectSelected = ethnicitySelect.querySelector(".select-selected") as HTMLElement; - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + // const ethnicityIndex: string | undefined = getDropdownElementIndex("ethnicity", obj.ethnicity); - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // if (ethnicityIndex != undefined) { + // const ethnicityElement = selectItems.children[parseInt(ethnicityIndex)]; - phoneBase.appendChild(phone_container); - phone_container.appendChild(subContainer); - subContainer.appendChild(phone_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // selectSelected.innerHTML = translateRawWord(obj.ethnicity)!; + // ethnicityElement.className = "same-as-selected"; + // } + //} - del_btn_div.onclick = function () { - phone_container.remove(); - } + //editAge.innerHTML = obj.age.toString(); + //editBday.innerHTML = obj.bday; + //editAddress.innerHTML = obj.address; - refreshTranslation(); - } + //// Phone - if (obj.civilstatus != "") { - const civilstatusSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(7) > .civilstatus-select") as HTMLElement; - const selectItems = civilstatusSelect.querySelector(".select-items"); - const selectSelected = civilstatusSelect.querySelector(".select-selected"); + //const phoneBase = document.querySelector(".phone-base") as HTMLDivElement; - const civilstatusIndex = getDropdownElementIndex("civilstatus", obj.civilstatus); + //if (Object.keys(obj.phone).length >= 1) { + // for (const [_, phone] of Object.entries(obj.phone)) { + // const phoneVar = (phone as { number: string, valid: boolean, phoneinfoga: { Country: string } }) - if (civilstatusIndex != undefined) { - const civilstatusElement = selectItems!.children[parseInt(civilstatusIndex)]; + // const container = document.createElement("div"); + // container.className = "phone-container"; - selectSelected!.innerHTML = translateRawWord(obj.civilstatus)!; - civilstatusElement.className = "same-as-selected"; - } - } + // const subContainer = document.createElement("div"); + // subContainer.className = "phone-subcontainer"; - editKids.innerHTML = obj.kids; + // const phone_input = document.createElement("input"); + // phone_input.className = "form-input phone"; + // phone_input.id = "e-phone"; + // phone_input.type = "tel"; + // phone_input.placeholder = "Enter phone number"; + // phone_input.spellcheck = false; + // phone_input.setAttribute("lng-tag", "enter_phone_number") + // phone_input.required = true; + // phone_input.value = phoneVar.number; - // Hobbies + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - const hobbyBase = document.querySelector(".e-hobby-base") as HTMLDivElement; + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - if (Object.keys(obj.hobbies).length >= 1) { - for (const [_, hobby] of Object.entries(obj.hobbies)) { - const hobbyVar = (hobby as { hobby: string }) + // container.appendChild(subContainer); + // subContainer.appendChild(phone_input); + // phoneBase.appendChild(container); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - const container = document.createElement("div"); - container.className = "hobby-container"; - const subContainer = document.createElement("div"); - subContainer.className = "hobby-subcontainer"; + // del_btn.onclick = function () { + // container.remove(); + // } - const hobby_input = document.createElement("input") as HTMLInputElement; - hobby_input.className = "form-input hobby"; - hobby_input.id = "e-hobby"; - hobby_input.placeholder = "Enter hobby"; - hobby_input.spellcheck = false; - hobby_input.setAttribute("lng-tag", "enter_hobby") - hobby_input.value = hobbyVar.hobby; + // refreshTranslation(); + // }; + //} - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + //document.getElementById("phone-add-btn")!.onclick = function () { + // const phone_container = document.createElement("div"); + // phone_container.className = "phone-container"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const subContainer = document.createElement("div"); + // subContainer.className = "phone-subcontainer"; - container.appendChild(subContainer); - subContainer.appendChild(hobby_input); - hobbyBase.appendChild(container); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // const phone_input = document.createElement("input"); + // phone_input.className = "form-input e-phone"; + // phone_input.id = "phone"; + // phone_input.type = "tel"; + // phone_input.placeholder = "Enter phone number"; + // phone_input.spellcheck = false; + // phone_input.setAttribute("lng-tag", "enter_phone_number") + // //phone_input.maxLength = "15"; // FIXME some formattings can have more then 15 chars. + // phone_input.required = true; - del_btn.onclick = function () { - container.remove(); - } + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - refreshTranslation(); - }; - } + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - document.getElementById("hobby-add-btn")!.onclick = function () { - const hobby_container = document.createElement("div"); - hobby_container.className = "hobby-container"; + // phoneBase.appendChild(phone_container); + // phone_container.appendChild(subContainer); + // subContainer.appendChild(phone_input); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - const subContainer = document.createElement("div"); - subContainer.className = "hobby-subcontainer"; + // del_btn_div.onclick = function () { + // phone_container.remove(); + // } - const hobby_input = document.createElement("input"); - hobby_input.className = "form-input e-hobby"; - hobby_input.id = "hobby"; - hobby_input.type = "text"; - hobby_input.placeholder = "Enter hobby"; - hobby_input.setAttribute("lng-tag", "enter_hobby") - hobby_input.spellcheck = false; - hobby_input.required = true; + // refreshTranslation(); + //} - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + //if (obj.civilstatus != "") { + // const civilstatusSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(7) > .civilstatus-select") as HTMLElement; + // const selectItems = civilstatusSelect.querySelector(".select-items"); + // const selectSelected = civilstatusSelect.querySelector(".select-selected"); - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const civilstatusIndex = getDropdownElementIndex("civilstatus", obj.civilstatus); - hobbyBase.appendChild(hobby_container); - hobby_container.appendChild(subContainer); - subContainer.appendChild(hobby_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // if (civilstatusIndex != undefined) { + // const civilstatusElement = selectItems!.children[parseInt(civilstatusIndex)]; - del_btn_div.onclick = function () { - hobby_container.remove(); - } + // selectSelected!.innerHTML = translateRawWord(obj.civilstatus)!; + // civilstatusElement.className = "same-as-selected"; + // } + //} - refreshTranslation(); - } - - editOccupation.innerHTML = obj.occupation; - editPrevOccupation.innerHTML = obj.prevoccupation; - editEducation.innerHTML = obj.education; - - if (obj.religion != "") { - const religionSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(15) > .religion-select") as HTMLElement; - const selectItems = religionSelect.querySelector(".select-items") as HTMLElement; - const selectSelected = religionSelect.querySelector(".select-selected") as HTMLElement; + //editKids.innerHTML = obj.kids; - const religionIndex = getDropdownElementIndex("religion", obj.religion); + //// Hobbies - if (religionIndex != undefined) { - const religionElement = selectItems.children[parseInt(religionIndex)]; + //const hobbyBase = document.querySelector(".e-hobby-base") as HTMLDivElement; - selectSelected.innerHTML = translateRawWord(obj.religion)!; - religionElement.className = "same-as-selected"; - } - } + //if (Object.keys(obj.hobbies).length >= 1) { + // for (const [_, hobby] of Object.entries(obj.hobbies)) { + // const hobbyVar = (hobby as { hobby: string }) + + // const container = document.createElement("div"); + // container.className = "hobby-container"; + + // const subContainer = document.createElement("div"); + // subContainer.className = "hobby-subcontainer"; + + // const hobby_input = document.createElement("input") as HTMLInputElement; + // hobby_input.className = "form-input hobby"; + // hobby_input.id = "e-hobby"; + // hobby_input.placeholder = "Enter hobby"; + // hobby_input.spellcheck = false; + // hobby_input.setAttribute("lng-tag", "enter_hobby") + // hobby_input.value = hobbyVar.hobby; - editPets.innerHTML = obj.pets; + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - // Clubs + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - const clubBase = document.querySelector(".e-club-base") as HTMLDivElement; + // container.appendChild(subContainer); + // subContainer.appendChild(hobby_input); + // hobbyBase.appendChild(container); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - if (Object.keys(obj.clubs).length >= 1) { - for (const [_, club] of Object.entries(obj.clubs)) { - const clubVar = (club as { club: string }) + // del_btn.onclick = function () { + // container.remove(); + // } - const container = document.createElement("div"); - container.className = "club-container"; + // refreshTranslation(); + // }; + //} - const subContainer = document.createElement("div"); - subContainer.className = "club-subcontainer"; + //document.getElementById("hobby-add-btn")!.onclick = function () { + // const hobby_container = document.createElement("div"); + // hobby_container.className = "hobby-container"; - const club_input = document.createElement("input"); - club_input.className = "form-input club"; - club_input.id = "e-club"; - club_input.type = "text"; - club_input.placeholder = "Enter club"; - club_input.spellcheck = false; - club_input.setAttribute("lng-tag", "enter_club") - club_input.value = clubVar.club; + // const subContainer = document.createElement("div"); + // subContainer.className = "hobby-subcontainer"; + + // const hobby_input = document.createElement("input"); + // hobby_input.className = "form-input e-hobby"; + // hobby_input.id = "hobby"; + // hobby_input.type = "text"; + // hobby_input.placeholder = "Enter hobby"; + // hobby_input.setAttribute("lng-tag", "enter_hobby") + // hobby_input.spellcheck = false; + // hobby_input.required = true; - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - container.appendChild(subContainer); - subContainer.appendChild(club_input); - clubBase.appendChild(container); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // hobbyBase.appendChild(hobby_container); + // hobby_container.appendChild(subContainer); + // subContainer.appendChild(hobby_input); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - del_btn.onclick = function () { - container.remove(); - } + // del_btn_div.onclick = function () { + // hobby_container.remove(); + // } - refreshTranslation(); - }; - } + // refreshTranslation(); + //} + + //editOccupation.innerHTML = obj.occupation; + //editPrevOccupation.innerHTML = obj.prevoccupation; + //editEducation.innerHTML = obj.education; + + //if (obj.religion != "") { + // const religionSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(15) > .religion-select") as HTMLElement; + // const selectItems = religionSelect.querySelector(".select-items") as HTMLElement; + // const selectSelected = religionSelect.querySelector(".select-selected") as HTMLElement; - document.getElementById("club-add-btn")!.onclick = function () { - const club_container = document.createElement("div"); - club_container.className = "club-container"; + // const religionIndex = getDropdownElementIndex("religion", obj.religion); - const subContainer = document.createElement("div"); - subContainer.className = "club-subcontainer"; + // if (religionIndex != undefined) { + // const religionElement = selectItems.children[parseInt(religionIndex)]; - const club_input = document.createElement("input"); - club_input.className = "form-input e-club"; - club_input.id = "club"; - club_input.type = "text"; - club_input.placeholder = "Enter club"; - club_input.spellcheck = false; - club_input.setAttribute("lng-tag", "enter_club") - club_input.required = true; + // selectSelected.innerHTML = translateRawWord(obj.religion)!; + // religionElement.className = "same-as-selected"; + // } + //} - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + //editPets.innerHTML = obj.pets; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + //// Clubs - clubBase.appendChild(club_container); - club_container.appendChild(subContainer); - subContainer.appendChild(club_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + //const clubBase = document.querySelector(".e-club-base") as HTMLDivElement; - del_btn_div.onclick = function () { - club_container.remove(); - } + //if (Object.keys(obj.clubs).length >= 1) { + // for (const [_, club] of Object.entries(obj.clubs)) { + // const clubVar = (club as { club: string }) - refreshTranslation(); - } + // const container = document.createElement("div"); + // container.className = "club-container"; - editLegal.innerHTML = obj.legal; - editPolitical.innerHTML = obj.political; + // const subContainer = document.createElement("div"); + // subContainer.className = "club-subcontainer"; - // Sources + // const club_input = document.createElement("input"); + // club_input.className = "form-input club"; + // club_input.id = "e-club"; + // club_input.type = "text"; + // club_input.placeholder = "Enter club"; + // club_input.spellcheck = false; + // club_input.setAttribute("lng-tag", "enter_club") + // club_input.value = clubVar.club; - const sourceBase = document.querySelector(".e-source-base") as HTMLDivElement; + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - if (Object.keys(obj.sources).length >= 1) { - for (const [_, url] of Object.entries(obj.sources)) { - const sourceVar = (url as { url: string }) + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - const container = document.createElement("div"); - container.className = "source-container"; + // container.appendChild(subContainer); + // subContainer.appendChild(club_input); + // clubBase.appendChild(container); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - const subContainer = document.createElement("div"); - subContainer.className = "source-subcontainer"; + // del_btn.onclick = function () { + // container.remove(); + // } + + // refreshTranslation(); + // }; + //} - const source_input = document.createElement("input"); - source_input.className = "form-input source"; - source_input.id = "e-source"; - source_input.type = "text"; - source_input.placeholder = "Enter source"; - source_input.spellcheck = false; - source_input.setAttribute("lng-tag", "enter_source") - source_input.value = sourceVar.url; + //document.getElementById("club-add-btn")!.onclick = function () { + // const club_container = document.createElement("div"); + // club_container.className = "club-container"; - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + // const subContainer = document.createElement("div"); + // subContainer.className = "club-subcontainer"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const club_input = document.createElement("input"); + // club_input.className = "form-input e-club"; + // club_input.id = "club"; + // club_input.type = "text"; + // club_input.placeholder = "Enter club"; + // club_input.spellcheck = false; + // club_input.setAttribute("lng-tag", "enter_club") + // club_input.required = true; - container.appendChild(subContainer); - subContainer.appendChild(source_input); - sourceBase.appendChild(container); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - del_btn.onclick = function () { - container.remove(); - } + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - refreshTranslation(); - }; - } + // clubBase.appendChild(club_container); + // club_container.appendChild(subContainer); + // subContainer.appendChild(club_input); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - document.getElementById("source-add-btn")!.onclick = function () { - const source_container = document.createElement("div"); - source_container.className = "source-container"; + // del_btn_div.onclick = function () { + // club_container.remove(); + // } - const subContainer = document.createElement("div"); - subContainer.className = "source-subcontainer"; + // refreshTranslation(); + //} - const source_input = document.createElement("input"); - source_input.className = "form-input e-source"; - source_input.id = "source"; - source_input.type = "text"; - source_input.placeholder = "Enter source"; - source_input.spellcheck = false; - source_input.setAttribute("lng-tag", "enter_source") - source_input.required = true; + //editLegal.innerHTML = obj.legal; + //editPolitical.innerHTML = obj.political; - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + //// Sources - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + //const sourceBase = document.querySelector(".e-source-base") as HTMLDivElement; - sourceBase.appendChild(source_container); - source_container.appendChild(subContainer); - subContainer.appendChild(source_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + //if (Object.keys(obj.sources).length >= 1) { + // for (const [_, url] of Object.entries(obj.sources)) { + // const sourceVar = (url as { url: string }) - del_btn_div.onclick = function () { - source_container.remove(); - } + // const container = document.createElement("div"); + // container.className = "source-container"; - refreshTranslation(); - } + // const subContainer = document.createElement("div"); + // subContainer.className = "source-subcontainer"; - editNotes.innerHTML = obj.notes; + // const source_input = document.createElement("input"); + // source_input.className = "form-input source"; + // source_input.id = "e-source"; + // source_input.type = "text"; + // source_input.placeholder = "Enter source"; + // source_input.spellcheck = false; + // source_input.setAttribute("lng-tag", "enter_source") + // source_input.value = sourceVar.url; - // IPs + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; + + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; + + // container.appendChild(subContainer); + // subContainer.appendChild(source_input); + // sourceBase.appendChild(container); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); + + // del_btn.onclick = function () { + // container.remove(); + // } + + // refreshTranslation(); + // }; + //} + + //document.getElementById("source-add-btn")!.onclick = function () { + // const source_container = document.createElement("div"); + // source_container.className = "source-container"; + + // const subContainer = document.createElement("div"); + // subContainer.className = "source-subcontainer"; + + // const source_input = document.createElement("input"); + // source_input.className = "form-input e-source"; + // source_input.id = "source"; + // source_input.type = "text"; + // source_input.placeholder = "Enter source"; + // source_input.spellcheck = false; + // source_input.setAttribute("lng-tag", "enter_source") + // source_input.required = true; + + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - const ipBase = document.querySelector(".e-ip-base") as HTMLDivElement; + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - if (Object.keys(obj.ips).length >= 1) { - for (const [_, ip] of Object.entries(obj.ips)) { - const ipVar = (ip as { ip: string }) + // sourceBase.appendChild(source_container); + // source_container.appendChild(subContainer); + // subContainer.appendChild(source_input); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - const container = document.createElement("div"); - container.className = "ip-container"; + // del_btn_div.onclick = function () { + // source_container.remove(); + // } - const subContainer = document.createElement("div"); - subContainer.className = "ip-subcontainer"; + // refreshTranslation(); + //} - const ip_input = document.createElement("input"); - ip_input.className = "form-input ip"; - ip_input.id = "e-ip"; - ip_input.type = "text"; - ip_input.placeholder = "Enter IP"; - ip_input.spellcheck = false; - ip_input.setAttribute("lng-tag", "enter_ip") - ip_input.value = ipVar.ip; + //editNotes.innerHTML = obj.notes; - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + //// IPs - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + //const ipBase = document.querySelector(".e-ip-base") as HTMLDivElement; - container.appendChild(subContainer); - subContainer.appendChild(ip_input); - ipBase.appendChild(container); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + //if (Object.keys(obj.ips).length >= 1) { + // for (const [_, ip] of Object.entries(obj.ips)) { + // const ipVar = (ip as { ip: string }) - del_btn.onclick = function () { - container.remove(); - } + // const container = document.createElement("div"); + // container.className = "ip-container"; - refreshTranslation(); - }; - } + // const subContainer = document.createElement("div"); + // subContainer.className = "ip-subcontainer"; - document.getElementById("ip-add-btn")!.onclick = function () { - const ip_container = document.createElement("div"); - ip_container.className = "ip-container"; + // const ip_input = document.createElement("input"); + // ip_input.className = "form-input ip"; + // ip_input.id = "e-ip"; + // ip_input.type = "text"; + // ip_input.placeholder = "Enter IP"; + // ip_input.spellcheck = false; + // ip_input.setAttribute("lng-tag", "enter_ip") + // ip_input.value = ipVar.ip; + + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; + + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; + + // container.appendChild(subContainer); + // subContainer.appendChild(ip_input); + // ipBase.appendChild(container); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - const subContainer = document.createElement("div"); - subContainer.className = "ip-subcontainer"; + // del_btn.onclick = function () { + // container.remove(); + // } - const ip_input = document.createElement("input"); - ip_input.className = "form-input e-ip"; - ip_input.id = "ip"; - ip_input.type = "text"; - ip_input.placeholder = "Enter IP"; - ip_input.spellcheck = false; - ip_input.setAttribute("lng-tag", "enter_ip") - ip_input.required = true; + // refreshTranslation(); + // }; + //} - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + //document.getElementById("ip-add-btn")!.onclick = function () { + // const ip_container = document.createElement("div"); + // ip_container.className = "ip-container"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const subContainer = document.createElement("div"); + // subContainer.className = "ip-subcontainer"; - ipBase.appendChild(ip_container); - ip_container.appendChild(subContainer); - subContainer.appendChild(ip_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // const ip_input = document.createElement("input"); + // ip_input.className = "form-input e-ip"; + // ip_input.id = "ip"; + // ip_input.type = "text"; + // ip_input.placeholder = "Enter IP"; + // ip_input.spellcheck = false; + // ip_input.setAttribute("lng-tag", "enter_ip") + // ip_input.required = true; - del_btn_div.onclick = function () { - ip_container.remove(); - } + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - refreshTranslation(); - } + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - // Email + // ipBase.appendChild(ip_container); + // ip_container.appendChild(subContainer); + // subContainer.appendChild(ip_input); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - const emailBase = document.querySelector(".email-base") as HTMLDivElement; + // del_btn_div.onclick = function () { + // ip_container.remove(); + // } - if (Object.keys(obj.email).length >= 1) { - for (const [_, email] of Object.entries(obj.email)) { - const emailVar = (email as { mail: string, services: {} }); + // refreshTranslation(); + //} - const container = document.createElement("div"); - container.className = "email-container"; + //// Email - const subContainer = document.createElement("div"); - subContainer.className = "email-subcontainer"; + //const emailBase = document.querySelector(".email-base") as HTMLDivElement; - const email_input = document.createElement("input"); - email_input.className = "form-input e-mail"; - email_input.id = "e-mail"; - email_input.type = "email"; - email_input.placeholder = "Enter email address"; - email_input.spellcheck = false; - email_input.setAttribute("lng-tag", "enter_email_address") - email_input.required = true; - email_input.value = emailVar.mail; + //if (Object.keys(obj.email).length >= 1) { + // for (const [_, email] of Object.entries(obj.email)) { + // const emailVar = (email as { mail: string, services: {} }); - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + // const container = document.createElement("div"); + // container.className = "email-container"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const subContainer = document.createElement("div"); + // subContainer.className = "email-subcontainer"; - container.appendChild(subContainer); - subContainer.appendChild(email_input); - emailBase.appendChild(container); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // const email_input = document.createElement("input"); + // email_input.className = "form-input e-mail"; + // email_input.id = "e-mail"; + // email_input.type = "email"; + // email_input.placeholder = "Enter email address"; + // email_input.spellcheck = false; + // email_input.setAttribute("lng-tag", "enter_email_address") + // email_input.required = true; + // email_input.value = emailVar.mail; - if (emailVar.services != undefined && emailVar.services != null && emailVar.services != "") { - const hidden_email_save = document.createElement("p"); - hidden_email_save.className = "hidden-email-save"; + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - hidden_email_save.innerHTML = JSON.stringify(emailVar.services); - container.appendChild(hidden_email_save); - } + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - del_btn.onclick = function () { - container.remove(); - } + // container.appendChild(subContainer); + // subContainer.appendChild(email_input); + // emailBase.appendChild(container); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - refreshTranslation(); - }; - } + // if (emailVar.services != undefined && emailVar.services != null && emailVar.services != "") { + // const hidden_email_save = document.createElement("p"); + // hidden_email_save.className = "hidden-email-save"; + // hidden_email_save.innerHTML = JSON.stringify(emailVar.services); + // container.appendChild(hidden_email_save); + // } + // del_btn.onclick = function () { + // container.remove(); + // } - document.getElementById("email-add-btn")!.onclick = function () { - const email_base = document.querySelector(".email-base"); + // refreshTranslation(); + // }; + //} - const email_container = document.createElement("div"); - email_container.className = "email-container"; - const subContainer = document.createElement("div"); - subContainer.className = "email-subcontainer"; - const email_input = document.createElement("input"); - email_input.className = "form-input e-mail"; - email_input.id = "e-mail"; - email_input.type = "email"; - email_input.placeholder = "Enter email address"; - email_input.spellcheck = false; - email_input.setAttribute("lng-tag", "enter_email_address") - email_input.required = true; + //document.getElementById("email-add-btn")!.onclick = function () { + // const email_base = document.querySelector(".email-base"); - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + // const email_container = document.createElement("div"); + // email_container.className = "email-container"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const subContainer = document.createElement("div"); + // subContainer.className = "email-subcontainer"; - emailBase.appendChild(email_container); - email_container.appendChild(subContainer); - subContainer.appendChild(email_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // const email_input = document.createElement("input"); + // email_input.className = "form-input e-mail"; + // email_input.id = "e-mail"; + // email_input.type = "email"; + // email_input.placeholder = "Enter email address"; + // email_input.spellcheck = false; + // email_input.setAttribute("lng-tag", "enter_email_address") + // email_input.required = true; - const hidden_email_save = document.createElement("p"); - hidden_email_save.className = "hidden-email-save"; - email_container.appendChild(hidden_email_save); + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - del_btn_div.onclick = function () { - email_container.remove(); - } + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - refreshTranslation(); - } + // emailBase.appendChild(email_container); + // email_container.appendChild(subContainer); + // subContainer.appendChild(email_input); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - // Accounts + // const hidden_email_save = document.createElement("p"); + // hidden_email_save.className = "hidden-email-save"; + // email_container.appendChild(hidden_email_save); - if (obj.accounts != "{}" && obj.accounts != null) { - for (const [_, accObj] of Object.entries(obj.accounts)) { - const accVar = (accObj as { service: string, id: string, username: string, url: string, profilePicture: { [key: number]: { img: string, img_hash: number } }, bio: { [key: number]: { bio: string } } }); + // del_btn_div.onclick = function () { + // email_container.remove(); + // } - //let accObj = obj.accounts[i]; + // refreshTranslation(); + //} - // Creating elements + //// Accounts - const base_div = document.createElement("div"); // Outer div - base_div.className = "acc-chip"; + //if (Object.keys(obj.accounts).length != 0 && obj.accounts != null) { + // for (const [_, accObj] of Object.entries(obj.accounts)) { + // const accVar = (accObj as { service: string, id: string, username: string, url: string, profilePicture: { [key: number]: { img: string, img_hash: number } }, bio: { [key: number]: { bio: string } } }); - const pfp_img = document.createElement("img"); // Pfp img - pfp_img.className = "userPfp"; + // //let accObj = obj.accounts[i]; - if (accVar.profilePicture != null) { - pfp_img.src = "data:image/png;base64," + accVar.profilePicture["1"].img; - } else { - pfp_img.src = "https://as2.ftcdn.net/v2/jpg/03/32/59/65/1000_F_332596535_lAdLhf6KzbW6PWXBWeIFTovTii1drkbT.jpg" - } + // // Creating elements - const info_div = document.createElement("div"); // Info div - info_div.className = "info-container"; + // const base_div = document.createElement("div"); // Outer div + // base_div.className = "acc-chip"; - const icon_space = document.createElement("div"); - icon_space.className = "icon-space"; + // const pfp_img = document.createElement("img"); // Pfp img + // pfp_img.className = "userPfp"; - const service_p = document.createElement("a"); - service_p.className = "serviceName"; - service_p.innerHTML = accVar.service; - service_p.href = accVar.url; - service_p.target = "_blank"; + // if (accVar.profilePicture != null) { + // pfp_img.src = "data:image/png;base64," + accVar.profilePicture["1"].img; + // } else { + // pfp_img.src = "https://as2.ftcdn.net/v2/jpg/03/32/59/65/1000_F_332596535_lAdLhf6KzbW6PWXBWeIFTovTii1drkbT.jpg" + // } - const name_p = document.createElement("a"); - name_p.className = "userName"; - name_p.innerHTML = accVar.username; - name_p.href = accVar.url; - name_p.target = "_blank"; + // const info_div = document.createElement("div"); // Info div + // info_div.className = "info-container"; - document.querySelector(".e-accounts")!.appendChild(base_div); - base_div.appendChild(pfp_img); - base_div.appendChild(info_div); - base_div.appendChild(icon_space); - info_div.appendChild(service_p); - info_div.appendChild(name_p); + // const icon_space = document.createElement("div"); + // icon_space.className = "icon-space"; - if (accVar.service.toLowerCase() == "github") { // If the service is github, add a deep investigation button - const deep_btn = document.createElement("div"); - deep_btn.className = "deepInvBtn btn btn-secondary"; - deep_btn.id = "deepInvBtn"; + // const service_p = document.createElement("a"); + // service_p.className = "serviceName"; + // service_p.innerHTML = accVar.service; + // service_p.href = accVar.url; + // service_p.target = "_blank"; - const deep_btn_txt = document.createElement("p"); - deep_btn_txt.className = "deepInvBtnTxt"; - deep_btn_txt.innerHTML = "Deep Investigation"; + // const name_p = document.createElement("a"); + // name_p.className = "userName"; + // name_p.innerHTML = accVar.username; + // name_p.href = accVar.url; + // name_p.target = "_blank"; - base_div.appendChild(deep_btn); - deep_btn.appendChild(deep_btn_txt); + // document.querySelector(".e-accounts")!.appendChild(base_div); + // base_div.appendChild(pfp_img); + // base_div.appendChild(info_div); + // base_div.appendChild(icon_space); + // info_div.appendChild(service_p); + // info_div.appendChild(name_p); - const del_btn_div = document.createElement("div"); - del_btn_div.className = "delAccBtn-deep btn btn-secondary"; + // if (accVar.service.toLowerCase() == "github") { // If the service is github, add a deep investigation button + // const deep_btn = document.createElement("div"); + // deep_btn.className = "deepInvBtn btn btn-secondary"; + // deep_btn.id = "deepInvBtn"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const deep_btn_txt = document.createElement("p"); + // deep_btn_txt.className = "deepInvBtnTxt"; + // deep_btn_txt.innerHTML = "Deep Investigation"; - base_div.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // base_div.appendChild(deep_btn); + // deep_btn.appendChild(deep_btn_txt); + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "delAccBtn-deep btn btn-secondary"; - // Deep investigation - deep_btn.onclick = async function () { - if (icon_space.firstChild) { - icon_space.firstChild.remove(); - } + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - deep_btn_txt.innerHTML = "This may take up to an hour..."; + // base_div.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - const loadingSpinner = document.createElement("div"); - loadingSpinner.className = "neu"; - loadingSpinner.id = "deepInvLoadingSpinner"; - loadingSpinner.style.display = "flex"; - const loadingSpinnerShape = document.createElement("div"); - loadingSpinnerShape.className = "neu_shape"; + // // Deep investigation + // deep_btn.onclick = async function () { + // if (icon_space.firstChild) { + // icon_space.firstChild.remove(); + // } - const loadingSpinnerInner = document.createElement("div"); - loadingSpinnerInner.className = "neu_inner"; + // deep_btn_txt.innerHTML = "This may take up to an hour..."; - const loadingSpinnerBall = document.createElement("div"); - loadingSpinnerBall.className = "neu_ball"; + // const loadingSpinner = document.createElement("div"); + // loadingSpinner.className = "neu"; + // loadingSpinner.id = "deepInvLoadingSpinner"; + // loadingSpinner.style.display = "flex"; + // const loadingSpinnerShape = document.createElement("div"); + // loadingSpinnerShape.className = "neu_shape"; - icon_space.appendChild(loadingSpinner) - loadingSpinner.appendChild(loadingSpinnerShape); - loadingSpinnerShape.appendChild(loadingSpinnerInner); - loadingSpinnerInner.appendChild(loadingSpinnerBall); - loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); - loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); - loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); + // const loadingSpinnerInner = document.createElement("div"); + // loadingSpinnerInner.className = "neu_inner"; + // const loadingSpinnerBall = document.createElement("div"); + // loadingSpinnerBall.className = "neu_ball"; - const res = await fetch(apiCall("/deep/github/" + accVar.username)) - let data = await res.json(); - loadingSpinner.remove(); + // icon_space.appendChild(loadingSpinner) + // loadingSpinner.appendChild(loadingSpinnerShape); + // loadingSpinnerShape.appendChild(loadingSpinnerInner); + // loadingSpinnerInner.appendChild(loadingSpinnerBall); + // loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); + // loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); + // loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); - const deepInvResIcon = document.createElement("ion-icon") as IonIconElement; - deepInvResIcon.className = "deepInvResIcon"; - icon_space.appendChild(deepInvResIcon); + // const res = await fetch(apiCall("/deep/github/" + accVar.username)) + // let data = await res.json(); - if (data != null && data != "{}" && res.status == 200) { - deep_btn_txt.innerHTML = "Deep Investigation"; + // loadingSpinner.remove(); - deepInvResIcon.name = "checkmark-outline"; - deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" + // const deepInvResIcon = document.createElement("ion-icon") as IonIconElement; + // deepInvResIcon.className = "deepInvResIcon"; - for (const [i, _] of Object.entries(data)) { - let obj = data[i]; + // icon_space.appendChild(deepInvResIcon); - const email_container = document.createElement("div"); - email_container.className = "email-container"; + // if (data != null && data != "{}" && res.status == 200) { + // deep_btn_txt.innerHTML = "Deep Investigation"; - const subContainer = document.createElement("div"); - subContainer.className = "email-subcontainer"; + // deepInvResIcon.name = "checkmark-outline"; + // deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" - const email_input = document.createElement("input"); - email_input.className = "form-input e-mail"; - email_input.id = "e-mail"; - email_input.type = "email"; - email_input.placeholder = "Enter email address"; - email_input.spellcheck = false; - email_input.setAttribute("lng-tag", "enter_email_address") - email_input.value = obj.mail; + // for (const [i, _] of Object.entries(data)) { + // let obj = data[i]; - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; + // const email_container = document.createElement("div"); + // email_container.className = "email-container"; - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; + // const subContainer = document.createElement("div"); + // subContainer.className = "email-subcontainer"; - const hidden_email_save = document.createElement("p"); - hidden_email_save.className = "hidden-email-save"; + // const email_input = document.createElement("input"); + // email_input.className = "form-input e-mail"; + // email_input.id = "e-mail"; + // email_input.type = "email"; + // email_input.placeholder = "Enter email address"; + // email_input.spellcheck = false; + // email_input.setAttribute("lng-tag", "enter_email_address") + // email_input.value = obj.mail; - hidden_email_save.innerHTML = JSON.stringify(obj.services); + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "del-btn"; - emailBase.appendChild(email_container); - email_container.appendChild(subContainer); - subContainer.appendChild(email_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - email_container.appendChild(hidden_email_save); + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - del_btn_div.onclick = function () { - email_container.remove(); - } + // const hidden_email_save = document.createElement("p"); + // hidden_email_save.className = "hidden-email-save"; - refreshTranslation(); - } - } else if (res.status == 403 && data["fatal"] == "rate limited") { - deepInvResIcon.name = "timer-outline"; - deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.15rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" - } else { - deepInvResIcon.name = "close-outline"; - deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" - } - } + // hidden_email_save.innerHTML = JSON.stringify(obj.services); + // emailBase.appendChild(email_container); + // email_container.appendChild(subContainer); + // subContainer.appendChild(email_input); + // subContainer.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); + // email_container.appendChild(hidden_email_save); - del_btn_div.onclick = function () { - fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { - method: "GET", - mode: "no-cors" - }); + // del_btn_div.onclick = function () { + // email_container.remove(); + // } - base_div.remove(); - // TODO Add stuff here - } - } else { - const del_btn_div = document.createElement("div"); - del_btn_div.className = "delAccBtn btn btn-secondary"; + // refreshTranslation(); + // } + // } else if (res.status == 403 && data["fatal"] == "rate limited") { + // deepInvResIcon.name = "timer-outline"; + // deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.15rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" + // } else { + // deepInvResIcon.name = "close-outline"; + // deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" + // } + // } - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - base_div.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); + // del_btn_div.onclick = function () { + // fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { + // method: "GET", + // mode: "no-cors" + // }); - del_btn_div.onclick = function () { - fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { - method: "GET", - mode: "no-cors" - }); + // base_div.remove(); + // // TODO Add stuff here + // } + // } else { + // const del_btn_div = document.createElement("div"); + // del_btn_div.className = "delAccBtn btn btn-secondary"; - base_div.remove(); + // const del_btn = document.createElement("ion-icon") as IonIconElement; + // del_btn.name = "remove-outline"; - // TODO Add stuff here - } - } + // base_div.appendChild(del_btn_div); + // del_btn_div.appendChild(del_btn); - if (accVar.bio != null) { - const bio_p = document.createElement("p"); - bio_p.className = "userBio"; - bio_p.innerHTML = accVar.bio["1"].bio; + // del_btn_div.onclick = function () { + // fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { + // method: "GET", + // mode: "no-cors" + // }); + + // base_div.remove(); - info_div.appendChild(bio_p); - } - } - } + // // TODO Add stuff here + // } + // } + + // if (accVar.bio != null) { + // const bio_p = document.createElement("p"); + // bio_p.className = "userBio"; + // bio_p.innerHTML = accVar.bio["1"].bio; + + // info_div.appendChild(bio_p); + // } + // } + //} } } @@ -1804,13 +2631,32 @@ createSaveBtn.onclick = async function () { // new document save button const loadingSpinner = document.querySelector("#c-loading-spinner") as HTMLDivElement; loadingSpinner.style.display = "flex" - fetch(apiCall("/person"), { - method: "POST", - body: JSON.stringify({ "id": id, "name": name, "gender": gender, "ethnicity": ethnicity, "age": age, "bday": bday, "address": address, "phone": phoneNumbers, "civilstatus": civilstatus, "kids": kids, "hobbies": hobbies, "email": emailAddresses, "ips": ips, "occupation": occupation, "prevoccupation": prevoccupation, "education": education, "religion": religion, "pets": pets, "clubs": clubs, "legal": legal, "political": political, "sources": sources, "notes": notes }) - }).then(function () { - loadingSpinner.style.display = "none" - location.reload(); - }); + let obj = new Person(); + obj.id = id; + obj.name = name; + obj.gender = gender || ''; + obj.ethnicity = ethnicity || ''; + obj.age = age; + obj.bday = bday; + obj.address = address; + obj.phone = phoneNumbers as { [key: string]: person.PhoneNumber }; + obj.civilstatus = civilstatus || ''; + obj.kids = kids; + obj.hobbies = hobbies; + obj.email = emailAddresses as unknown as { [key: string]: person.Email }; + obj.ips = ips; + obj.occupation = occupation; + obj.prevoccupation = prevoccupation; + obj.education = education; + obj.religion = religion || ''; + obj.pets = pets; + obj.clubs = clubs; + obj.legal = legal; + obj.political = political; + obj.sources = sources; + obj.notes = notes; + + obj.Post(loadingSpinner) } const editSaveBtn = document.querySelector("#e-savebtn")! as HTMLDivElement; @@ -1949,13 +2795,34 @@ editSaveBtn.onclick = async function () { let data = await res.json(); - fetch(apiCall("/person"), { - method: "POST", - body: JSON.stringify({ "id": id, "name": name, "gender": gender, "ethnicity": ethnicity, "age": age, "bday": bday, "address": address, "phone": phoneNumbers, "civilstatus": civilstatus, "kids": kids, "hobbies": hobbies, "email": emailAddresses, "ips": ips, "occupation": occupation, "prevoccupation": prevoccupation, "education": education, "religion": religion, "pets": pets, "clubs": clubs, "legal": legal, "political": political, "sources": sources, "notes": notes, "accounts": data.accounts }) - }).then(function () { - loadingSpinner.style.display = "none" - location.reload(); - }); + let obj = new Person(); + obj.id = id; + obj.name = name; + obj.gender = gender || ''; + obj.ethnicity = ethnicity || ''; + obj.age = age; + obj.bday = bday; + obj.address = address; + obj.phone = phoneNumbers as { [key: string]: person.PhoneNumber }; + obj.civilstatus = civilstatus || ''; + obj.kids = kids; + obj.hobbies = hobbies; + obj.email = emailAddresses as unknown as { [key: string]: person.Email }; + obj.ips = ips; + obj.occupation = occupation; + obj.prevoccupation = prevoccupation; + obj.education = education; + obj.religion = religion || ''; + obj.pets = pets; + obj.clubs = clubs; + obj.legal = legal; + obj.political = political; + obj.sources = sources; + obj.notes = notes; + obj.accounts = data.accounts; + + obj.Post(loadingSpinner); + } document.getElementById("backbtn")!.onclick = function () { @@ -2327,8 +3194,8 @@ async function runOnStart() { exportBtn.style.display = "none"; } else { for (const [i, _] of Object.entries(data)) { - let obj = data[Number(i)] as any; - //let obj = data[Number(i)] as person.Person; + //let obj = data[Number(i)] as any; + let obj = data[Number(i)] as Person; createCards(obj); } From 62be9c6a81c5428fe30ad349ac9625ec3064f393 Mon Sep 17 00:00:00 2001 From: 9glenda Date: Mon, 5 Jun 2023 18:48:43 +0000 Subject: [PATCH 02/13] fixed syntax error --- web/ts/script.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/web/ts/script.ts b/web/ts/script.ts index bf5f6f60..4698701e 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -914,12 +914,19 @@ document.getElementById("savemdbtn")!.onclick = async function () { saveAsFile(textToSave.markdown, getName!.value.toLowerCase().replace(/ /g, "") + ".md"); } - function checkId(): string { - let idExists = false; + +// NEW BUTTON +document.getElementById("newbtn")!.onclick = async function () { + const data = await getData() as object[]; + let totalIds = Object.keys(data).length; let preId = String(totalIds + 1); + + function checkId(preId: string): string { + let idExists = false; + for (let i = 0; i < totalIds; i++) { if (Object.keys(data)[i] == preId) { idExists = true; @@ -933,10 +940,8 @@ document.getElementById("savemdbtn")!.onclick = async function () { } return preId; } -// NEW BUTTON -document.getElementById("newbtn")!.onclick = async function () { let obj = new Person(); - obj.id = checkId(); + obj.id = checkId(preId); obj.name = ""; obj.Edit(); // mainContainer.style.display = "none"; From 5a7e8c1c893cae69a436b78962e9681f97296a61 Mon Sep 17 00:00:00 2001 From: 9glenda Date: Mon, 5 Jun 2023 18:51:49 +0000 Subject: [PATCH 03/13] added api generated classes --- generate/generate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate/generate.go b/generate/generate.go index b0157bd8..b9c8bfd3 100644 --- a/generate/generate.go +++ b/generate/generate.go @@ -10,13 +10,14 @@ import ( "sync" //"github.com/seekr-osint/seekr/api" + "github.com/seekr-osint/seekr/api" "github.com/seekr-osint/seekr/api/config" "github.com/tkrajina/typescriptify-golang-structs/typescriptify" ) func main() { wg := &sync.WaitGroup{} - //GenType(api.Person{}, wg) + GenType(api.Person{}, wg) GenType(config.Config{}, wg) wg.Wait() From caac5fea069d032a72dd646e8abe58d6629ddb19 Mon Sep 17 00:00:00 2001 From: 9glenda Date: Mon, 5 Jun 2023 19:23:15 +0000 Subject: [PATCH 04/13] fixed bugs --- web/ts/script.ts | 1274 +--------------------------------------------- 1 file changed, 28 insertions(+), 1246 deletions(-) diff --git a/web/ts/script.ts b/web/ts/script.ts index 4698701e..6d6fec38 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -59,7 +59,7 @@ class Person extends person.Person { } } - editAge.innerHTML = obj.age.toString(); + editAge.innerHTML = obj.age.toString() || ""; editBday.innerHTML = obj.bday; editAddress.innerHTML = obj.address; @@ -940,9 +940,17 @@ document.getElementById("newbtn")!.onclick = async function () { } return preId; } + let obj = new Person(); obj.id = checkId(preId); obj.name = ""; + obj.accounts = {}; + obj.phone = {}; + obj.email = {}; + obj.age = 0; + obj.address = ""; + obj.bday = ""; + obj.kids = ""; obj.Edit(); // mainContainer.style.display = "none"; // createContainer.style.display = "flex"; @@ -1222,20 +1230,20 @@ function createCards(obj: Person){ viewNameTag.value = obj.name; - viewGender.innerHTML = translateRawWord("Gender:")! + " " + (translateRawWord(obj.gender) || ""); - viewEthnicity.innerHTML = translateRawWord("Ethnicity:")! + " " + (translateRawWord(obj.ethnicity) || ""); - viewAge.innerHTML = translateRawWord("Age:")! + " " + (obj.age || ""); - viewBday.innerHTML = translateRawWord("Birthday:")! + " " + (obj.bday || ""); - viewAddress.innerHTML = translateRawWord("Address:")! + " " + (obj.address || ""); - viewCivilStatus.innerHTML = translateRawWord("Civil status:")! + " " + (translateRawWord(obj.civilstatus) || ""); + viewGender.innerHTML = translateRawWord("Gender:")! + " " + translateRawWord(obj.gender); + viewEthnicity.innerHTML = translateRawWord("Ethnicity:")! + " " + translateRawWord(obj.ethnicity); + viewAge.innerHTML = translateRawWord("Age:")! + " " + obj.age; + viewBday.innerHTML = translateRawWord("Birthday:")! + " " + obj.bday; + viewAddress.innerHTML = translateRawWord("Address:")! + " " + obj.address; + viewCivilStatus.innerHTML = translateRawWord("Civil status:")! + " " + translateRawWord(obj.civilstatus); viewKids.innerHTML = translateRawWord("Kids:") + " " + (obj.kids || ""); - viewOccupation.innerHTML = translateRawWord("Occupation:")! + " " + (obj.occupation || ""); - viewPrevOccupation.innerHTML = translateRawWord("Previous Occupation:")! + (obj.prevoccupation || ""); - viewEducation.innerHTML = translateRawWord("Education:")! + " " + (obj.education || ""); - viewReligion.innerHTML = translateRawWord("Religion:")! + " " + (translateRawWord(obj.religion) || ""); - viewPets.innerHTML = translateRawWord("Pets:")! + " " + (obj.pets || ""); - viewLegal.innerHTML = translateRawWord("Legal:")! + " " + (obj.legal || ""); - viewPolitical.innerHTML = translateRawWord("Political:")! + " " + (obj.political || ""); + viewOccupation.innerHTML = translateRawWord("Occupation:")! + " " + obj.occupation; + viewPrevOccupation.innerHTML = translateRawWord("Previous Occupation:")! + obj.prevoccupation; + viewEducation.innerHTML = translateRawWord("Education:")! + " " + obj.education; + viewReligion.innerHTML = translateRawWord("Religion:")! + " " + translateRawWord(obj.religion); + viewPets.innerHTML = translateRawWord("Pets:")! + " " + obj.pets; + viewLegal.innerHTML = translateRawWord("Legal:")! + " " + obj.legal; + viewPolitical.innerHTML = translateRawWord("Political:")! + " " + obj.political; viewNotes.innerHTML = (obj.notes || ""); @@ -1711,958 +1719,9 @@ function createCards(obj: Person){ e_icon_div.onclick = function () { let obj2 = new Person(obj); obj2.Edit() - //mainContainer.style.display = "none"; - //editContainer.style.display = "flex"; - - //editShowID.innerHTML = obj.id; - - //editNameTag.value = obj.name; - - //if (obj.gender != "") { - // const genderSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(1) > .gender-select") as HTMLElement; - // const selectItems = genderSelect.querySelector(".select-items") as HTMLElement; - // const selectSelected = genderSelect.querySelector(".select-selected") as HTMLElement; - - // const genderIndex: string | undefined = getDropdownElementIndex("gender", obj.gender); - - // if (genderIndex != undefined) { - // const genderElement = selectItems.children[parseInt(genderIndex)]; - - // selectSelected.innerHTML = translateRawWord(obj.gender)!; - // genderElement.className = "same-as-selected"; - // } - //} - - //if (obj.ethnicity != "") { - // const ethnicitySelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(2) > .ethnicity-select") as HTMLElement; - // const selectItems = ethnicitySelect.querySelector(".select-items") as HTMLElement; - // const selectSelected = ethnicitySelect.querySelector(".select-selected") as HTMLElement; - - // const ethnicityIndex: string | undefined = getDropdownElementIndex("ethnicity", obj.ethnicity); - - // if (ethnicityIndex != undefined) { - // const ethnicityElement = selectItems.children[parseInt(ethnicityIndex)]; - - // selectSelected.innerHTML = translateRawWord(obj.ethnicity)!; - // ethnicityElement.className = "same-as-selected"; - // } - //} - - //editAge.innerHTML = obj.age.toString(); - //editBday.innerHTML = obj.bday; - //editAddress.innerHTML = obj.address; - - //// Phone - - //const phoneBase = document.querySelector(".phone-base") as HTMLDivElement; - - //if (Object.keys(obj.phone).length >= 1) { - // for (const [_, phone] of Object.entries(obj.phone)) { - // const phoneVar = (phone as { number: string, valid: boolean, phoneinfoga: { Country: string } }) - - // const container = document.createElement("div"); - // container.className = "phone-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "phone-subcontainer"; - - // const phone_input = document.createElement("input"); - // phone_input.className = "form-input phone"; - // phone_input.id = "e-phone"; - // phone_input.type = "tel"; - // phone_input.placeholder = "Enter phone number"; - // phone_input.spellcheck = false; - // phone_input.setAttribute("lng-tag", "enter_phone_number") - // phone_input.required = true; - // phone_input.value = phoneVar.number; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // container.appendChild(subContainer); - // subContainer.appendChild(phone_input); - // phoneBase.appendChild(container); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - - // del_btn.onclick = function () { - // container.remove(); - // } - - // refreshTranslation(); - // }; - //} - - //document.getElementById("phone-add-btn")!.onclick = function () { - // const phone_container = document.createElement("div"); - // phone_container.className = "phone-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "phone-subcontainer"; - - // const phone_input = document.createElement("input"); - // phone_input.className = "form-input e-phone"; - // phone_input.id = "phone"; - // phone_input.type = "tel"; - // phone_input.placeholder = "Enter phone number"; - // phone_input.spellcheck = false; - // phone_input.setAttribute("lng-tag", "enter_phone_number") - // //phone_input.maxLength = "15"; // FIXME some formattings can have more then 15 chars. - // phone_input.required = true; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // phoneBase.appendChild(phone_container); - // phone_container.appendChild(subContainer); - // subContainer.appendChild(phone_input); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn_div.onclick = function () { - // phone_container.remove(); - // } - - // refreshTranslation(); - //} - - //if (obj.civilstatus != "") { - // const civilstatusSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(7) > .civilstatus-select") as HTMLElement; - // const selectItems = civilstatusSelect.querySelector(".select-items"); - // const selectSelected = civilstatusSelect.querySelector(".select-selected"); - - // const civilstatusIndex = getDropdownElementIndex("civilstatus", obj.civilstatus); - - // if (civilstatusIndex != undefined) { - // const civilstatusElement = selectItems!.children[parseInt(civilstatusIndex)]; - - // selectSelected!.innerHTML = translateRawWord(obj.civilstatus)!; - // civilstatusElement.className = "same-as-selected"; - // } - //} - - //editKids.innerHTML = obj.kids; - - //// Hobbies - - //const hobbyBase = document.querySelector(".e-hobby-base") as HTMLDivElement; - - //if (Object.keys(obj.hobbies).length >= 1) { - // for (const [_, hobby] of Object.entries(obj.hobbies)) { - // const hobbyVar = (hobby as { hobby: string }) - - // const container = document.createElement("div"); - // container.className = "hobby-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "hobby-subcontainer"; - - // const hobby_input = document.createElement("input") as HTMLInputElement; - // hobby_input.className = "form-input hobby"; - // hobby_input.id = "e-hobby"; - // hobby_input.placeholder = "Enter hobby"; - // hobby_input.spellcheck = false; - // hobby_input.setAttribute("lng-tag", "enter_hobby") - // hobby_input.value = hobbyVar.hobby; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // container.appendChild(subContainer); - // subContainer.appendChild(hobby_input); - // hobbyBase.appendChild(container); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn.onclick = function () { - // container.remove(); - // } - - // refreshTranslation(); - // }; - //} - - //document.getElementById("hobby-add-btn")!.onclick = function () { - // const hobby_container = document.createElement("div"); - // hobby_container.className = "hobby-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "hobby-subcontainer"; - - // const hobby_input = document.createElement("input"); - // hobby_input.className = "form-input e-hobby"; - // hobby_input.id = "hobby"; - // hobby_input.type = "text"; - // hobby_input.placeholder = "Enter hobby"; - // hobby_input.setAttribute("lng-tag", "enter_hobby") - // hobby_input.spellcheck = false; - // hobby_input.required = true; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // hobbyBase.appendChild(hobby_container); - // hobby_container.appendChild(subContainer); - // subContainer.appendChild(hobby_input); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn_div.onclick = function () { - // hobby_container.remove(); - // } - - // refreshTranslation(); - //} - - //editOccupation.innerHTML = obj.occupation; - //editPrevOccupation.innerHTML = obj.prevoccupation; - //editEducation.innerHTML = obj.education; - - //if (obj.religion != "") { - // const religionSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(15) > .religion-select") as HTMLElement; - // const selectItems = religionSelect.querySelector(".select-items") as HTMLElement; - // const selectSelected = religionSelect.querySelector(".select-selected") as HTMLElement; - - // const religionIndex = getDropdownElementIndex("religion", obj.religion); - - // if (religionIndex != undefined) { - // const religionElement = selectItems.children[parseInt(religionIndex)]; - - // selectSelected.innerHTML = translateRawWord(obj.religion)!; - // religionElement.className = "same-as-selected"; - // } - //} - - //editPets.innerHTML = obj.pets; - - //// Clubs - - //const clubBase = document.querySelector(".e-club-base") as HTMLDivElement; - - //if (Object.keys(obj.clubs).length >= 1) { - // for (const [_, club] of Object.entries(obj.clubs)) { - // const clubVar = (club as { club: string }) - - // const container = document.createElement("div"); - // container.className = "club-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "club-subcontainer"; - - // const club_input = document.createElement("input"); - // club_input.className = "form-input club"; - // club_input.id = "e-club"; - // club_input.type = "text"; - // club_input.placeholder = "Enter club"; - // club_input.spellcheck = false; - // club_input.setAttribute("lng-tag", "enter_club") - // club_input.value = clubVar.club; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // container.appendChild(subContainer); - // subContainer.appendChild(club_input); - // clubBase.appendChild(container); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn.onclick = function () { - // container.remove(); - // } - - // refreshTranslation(); - // }; - //} - - //document.getElementById("club-add-btn")!.onclick = function () { - // const club_container = document.createElement("div"); - // club_container.className = "club-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "club-subcontainer"; - - // const club_input = document.createElement("input"); - // club_input.className = "form-input e-club"; - // club_input.id = "club"; - // club_input.type = "text"; - // club_input.placeholder = "Enter club"; - // club_input.spellcheck = false; - // club_input.setAttribute("lng-tag", "enter_club") - // club_input.required = true; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // clubBase.appendChild(club_container); - // club_container.appendChild(subContainer); - // subContainer.appendChild(club_input); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn_div.onclick = function () { - // club_container.remove(); - // } - - // refreshTranslation(); - //} - - //editLegal.innerHTML = obj.legal; - //editPolitical.innerHTML = obj.political; - - //// Sources - - //const sourceBase = document.querySelector(".e-source-base") as HTMLDivElement; - - //if (Object.keys(obj.sources).length >= 1) { - // for (const [_, url] of Object.entries(obj.sources)) { - // const sourceVar = (url as { url: string }) - - // const container = document.createElement("div"); - // container.className = "source-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "source-subcontainer"; - - // const source_input = document.createElement("input"); - // source_input.className = "form-input source"; - // source_input.id = "e-source"; - // source_input.type = "text"; - // source_input.placeholder = "Enter source"; - // source_input.spellcheck = false; - // source_input.setAttribute("lng-tag", "enter_source") - // source_input.value = sourceVar.url; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // container.appendChild(subContainer); - // subContainer.appendChild(source_input); - // sourceBase.appendChild(container); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn.onclick = function () { - // container.remove(); - // } - - // refreshTranslation(); - // }; - //} - - //document.getElementById("source-add-btn")!.onclick = function () { - // const source_container = document.createElement("div"); - // source_container.className = "source-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "source-subcontainer"; - - // const source_input = document.createElement("input"); - // source_input.className = "form-input e-source"; - // source_input.id = "source"; - // source_input.type = "text"; - // source_input.placeholder = "Enter source"; - // source_input.spellcheck = false; - // source_input.setAttribute("lng-tag", "enter_source") - // source_input.required = true; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // sourceBase.appendChild(source_container); - // source_container.appendChild(subContainer); - // subContainer.appendChild(source_input); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn_div.onclick = function () { - // source_container.remove(); - // } - - // refreshTranslation(); - //} - - //editNotes.innerHTML = obj.notes; - - //// IPs - - //const ipBase = document.querySelector(".e-ip-base") as HTMLDivElement; - - //if (Object.keys(obj.ips).length >= 1) { - // for (const [_, ip] of Object.entries(obj.ips)) { - // const ipVar = (ip as { ip: string }) - - // const container = document.createElement("div"); - // container.className = "ip-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "ip-subcontainer"; - - // const ip_input = document.createElement("input"); - // ip_input.className = "form-input ip"; - // ip_input.id = "e-ip"; - // ip_input.type = "text"; - // ip_input.placeholder = "Enter IP"; - // ip_input.spellcheck = false; - // ip_input.setAttribute("lng-tag", "enter_ip") - // ip_input.value = ipVar.ip; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // container.appendChild(subContainer); - // subContainer.appendChild(ip_input); - // ipBase.appendChild(container); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn.onclick = function () { - // container.remove(); - // } - - // refreshTranslation(); - // }; - //} - - //document.getElementById("ip-add-btn")!.onclick = function () { - // const ip_container = document.createElement("div"); - // ip_container.className = "ip-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "ip-subcontainer"; - - // const ip_input = document.createElement("input"); - // ip_input.className = "form-input e-ip"; - // ip_input.id = "ip"; - // ip_input.type = "text"; - // ip_input.placeholder = "Enter IP"; - // ip_input.spellcheck = false; - // ip_input.setAttribute("lng-tag", "enter_ip") - // ip_input.required = true; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // ipBase.appendChild(ip_container); - // ip_container.appendChild(subContainer); - // subContainer.appendChild(ip_input); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn_div.onclick = function () { - // ip_container.remove(); - // } - - // refreshTranslation(); - //} - - //// Email - - //const emailBase = document.querySelector(".email-base") as HTMLDivElement; - - //if (Object.keys(obj.email).length >= 1) { - // for (const [_, email] of Object.entries(obj.email)) { - // const emailVar = (email as { mail: string, services: {} }); - - // const container = document.createElement("div"); - // container.className = "email-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "email-subcontainer"; - - // const email_input = document.createElement("input"); - // email_input.className = "form-input e-mail"; - // email_input.id = "e-mail"; - // email_input.type = "email"; - // email_input.placeholder = "Enter email address"; - // email_input.spellcheck = false; - // email_input.setAttribute("lng-tag", "enter_email_address") - // email_input.required = true; - // email_input.value = emailVar.mail; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // container.appendChild(subContainer); - // subContainer.appendChild(email_input); - // emailBase.appendChild(container); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // if (emailVar.services != undefined && emailVar.services != null && emailVar.services != "") { - // const hidden_email_save = document.createElement("p"); - // hidden_email_save.className = "hidden-email-save"; - - // hidden_email_save.innerHTML = JSON.stringify(emailVar.services); - // container.appendChild(hidden_email_save); - // } - - // del_btn.onclick = function () { - // container.remove(); - // } - - // refreshTranslation(); - // }; - //} - - - - //document.getElementById("email-add-btn")!.onclick = function () { - // const email_base = document.querySelector(".email-base"); - - // const email_container = document.createElement("div"); - // email_container.className = "email-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "email-subcontainer"; - - // const email_input = document.createElement("input"); - // email_input.className = "form-input e-mail"; - // email_input.id = "e-mail"; - // email_input.type = "email"; - // email_input.placeholder = "Enter email address"; - // email_input.spellcheck = false; - // email_input.setAttribute("lng-tag", "enter_email_address") - // email_input.required = true; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // emailBase.appendChild(email_container); - // email_container.appendChild(subContainer); - // subContainer.appendChild(email_input); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // const hidden_email_save = document.createElement("p"); - // hidden_email_save.className = "hidden-email-save"; - // email_container.appendChild(hidden_email_save); - - // del_btn_div.onclick = function () { - // email_container.remove(); - // } - - // refreshTranslation(); - //} - - //// Accounts - - //if (Object.keys(obj.accounts).length != 0 && obj.accounts != null) { - // for (const [_, accObj] of Object.entries(obj.accounts)) { - // const accVar = (accObj as { service: string, id: string, username: string, url: string, profilePicture: { [key: number]: { img: string, img_hash: number } }, bio: { [key: number]: { bio: string } } }); - - // //let accObj = obj.accounts[i]; - - // // Creating elements - - // const base_div = document.createElement("div"); // Outer div - // base_div.className = "acc-chip"; - - // const pfp_img = document.createElement("img"); // Pfp img - // pfp_img.className = "userPfp"; - - // if (accVar.profilePicture != null) { - // pfp_img.src = "data:image/png;base64," + accVar.profilePicture["1"].img; - // } else { - // pfp_img.src = "https://as2.ftcdn.net/v2/jpg/03/32/59/65/1000_F_332596535_lAdLhf6KzbW6PWXBWeIFTovTii1drkbT.jpg" - // } - - // const info_div = document.createElement("div"); // Info div - // info_div.className = "info-container"; - - // const icon_space = document.createElement("div"); - // icon_space.className = "icon-space"; - - // const service_p = document.createElement("a"); - // service_p.className = "serviceName"; - // service_p.innerHTML = accVar.service; - // service_p.href = accVar.url; - // service_p.target = "_blank"; - - // const name_p = document.createElement("a"); - // name_p.className = "userName"; - // name_p.innerHTML = accVar.username; - // name_p.href = accVar.url; - // name_p.target = "_blank"; - - // document.querySelector(".e-accounts")!.appendChild(base_div); - // base_div.appendChild(pfp_img); - // base_div.appendChild(info_div); - // base_div.appendChild(icon_space); - // info_div.appendChild(service_p); - // info_div.appendChild(name_p); - - // if (accVar.service.toLowerCase() == "github") { // If the service is github, add a deep investigation button - // const deep_btn = document.createElement("div"); - // deep_btn.className = "deepInvBtn btn btn-secondary"; - // deep_btn.id = "deepInvBtn"; - - // const deep_btn_txt = document.createElement("p"); - // deep_btn_txt.className = "deepInvBtnTxt"; - // deep_btn_txt.innerHTML = "Deep Investigation"; - - // base_div.appendChild(deep_btn); - // deep_btn.appendChild(deep_btn_txt); - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "delAccBtn-deep btn btn-secondary"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // base_div.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - - // // Deep investigation - // deep_btn.onclick = async function () { - // if (icon_space.firstChild) { - // icon_space.firstChild.remove(); - // } - - // deep_btn_txt.innerHTML = "This may take up to an hour..."; - - // const loadingSpinner = document.createElement("div"); - // loadingSpinner.className = "neu"; - // loadingSpinner.id = "deepInvLoadingSpinner"; - // loadingSpinner.style.display = "flex"; - - // const loadingSpinnerShape = document.createElement("div"); - // loadingSpinnerShape.className = "neu_shape"; - - // const loadingSpinnerInner = document.createElement("div"); - // loadingSpinnerInner.className = "neu_inner"; - - // const loadingSpinnerBall = document.createElement("div"); - // loadingSpinnerBall.className = "neu_ball"; - - - // icon_space.appendChild(loadingSpinner) - // loadingSpinner.appendChild(loadingSpinnerShape); - // loadingSpinnerShape.appendChild(loadingSpinnerInner); - // loadingSpinnerInner.appendChild(loadingSpinnerBall); - // loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); - // loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); - // loadingSpinnerInner.appendChild(loadingSpinnerBall.cloneNode()); - - - // const res = await fetch(apiCall("/deep/github/" + accVar.username)) - // let data = await res.json(); - - // loadingSpinner.remove(); - - // const deepInvResIcon = document.createElement("ion-icon") as IonIconElement; - // deepInvResIcon.className = "deepInvResIcon"; - - // icon_space.appendChild(deepInvResIcon); - - // if (data != null && data != "{}" && res.status == 200) { - // deep_btn_txt.innerHTML = "Deep Investigation"; - - // deepInvResIcon.name = "checkmark-outline"; - // deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" - - // for (const [i, _] of Object.entries(data)) { - // let obj = data[i]; - - // const email_container = document.createElement("div"); - // email_container.className = "email-container"; - - // const subContainer = document.createElement("div"); - // subContainer.className = "email-subcontainer"; - - // const email_input = document.createElement("input"); - // email_input.className = "form-input e-mail"; - // email_input.id = "e-mail"; - // email_input.type = "email"; - // email_input.placeholder = "Enter email address"; - // email_input.spellcheck = false; - // email_input.setAttribute("lng-tag", "enter_email_address") - // email_input.value = obj.mail; - - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "del-btn"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // const hidden_email_save = document.createElement("p"); - // hidden_email_save.className = "hidden-email-save"; - - // hidden_email_save.innerHTML = JSON.stringify(obj.services); - - // emailBase.appendChild(email_container); - // email_container.appendChild(subContainer); - // subContainer.appendChild(email_input); - // subContainer.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - // email_container.appendChild(hidden_email_save); - - // del_btn_div.onclick = function () { - // email_container.remove(); - // } - - // refreshTranslation(); - // } - // } else if (res.status == 403 && data["fatal"] == "rate limited") { - // deepInvResIcon.name = "timer-outline"; - // deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.15rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" - // } else { - // deepInvResIcon.name = "close-outline"; - // deepInvResIcon.style.filter = "drop-shadow(0.3rem 0.3rem 0.2rem var(--greyLight-2)) drop-shadow(-0.2rem -0.2rem 0.5rem var(--white));" - // } - // } - - - // del_btn_div.onclick = function () { - // fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { - // method: "GET", - // mode: "no-cors" - // }); - - // base_div.remove(); - // // TODO Add stuff here - // } - // } else { - // const del_btn_div = document.createElement("div"); - // del_btn_div.className = "delAccBtn btn btn-secondary"; - - // const del_btn = document.createElement("ion-icon") as IonIconElement; - // del_btn.name = "remove-outline"; - - // base_div.appendChild(del_btn_div); - // del_btn_div.appendChild(del_btn); - - // del_btn_div.onclick = function () { - // fetch(apiCall("/people/" + document.querySelector("#e-showid")!.innerHTML + "/accounts/" + accVar.service + "-" + accVar.username + "/delete"), { - // method: "GET", - // mode: "no-cors" - // }); - - // base_div.remove(); - - // // TODO Add stuff here - // } - // } - - // if (accVar.bio != null) { - // const bio_p = document.createElement("p"); - // bio_p.className = "userBio"; - // bio_p.innerHTML = accVar.bio["1"].bio; - - // info_div.appendChild(bio_p); - // } - // } - //} } } -// CREATE - -const createSaveBtn = document.getElementById("c-savebtn") as HTMLDivElement; - -createSaveBtn.onclick = async function () { // new document save button - const data = await getData() as object[]; - - let totalIds = Object.keys(data).length; - let preId = String(totalIds + 1); - - //A function to check if the data list includes that id already, if it does, it should add one until it doesnt exist - function checkId(preId: string): string { - let idExists = false; - - for (let i = 0; i < totalIds; i++) { - if (Object.keys(data)[i] == preId) { - idExists = true; - break; - } - } - - if (idExists) { - preId = String(parseInt(preId) + 1); - return checkId(preId); - } - return preId; - } - - let id = checkId(preId); - - let name = createNameTag.value; - - let gender = checkDropdownValue("create", "gender"); - - let ethnicity = checkDropdownValue("create", "ethnicity"); - - let age = parseInt(document.querySelector(".c-age")!.innerHTML); - - if (age <= 0) { - age *= -1 - } - if (age > 120) { - age = 120 - } - - let bday = document.querySelector(".c-bday")!.innerHTML; - let address = document.querySelector(".c-address")!.innerHTML; - - let createPhoneContainers = document.querySelectorAll(".c-phone-container") as NodeListOf; - let phoneNumbers: {[key: string]: {number: string}} = {}; - - createPhoneContainers.forEach((container: HTMLDivElement) => { - const phoneInput: HTMLInputElement | null = container.querySelector('input[type="tel"]')!; - - const phoneNumber: string = phoneInput.value.toString(); - - phoneNumbers[phoneNumber] = { - "number": phoneNumber - }; - }); - - let civilstatus = checkDropdownValue("create", "civilstatus"); - - let kids = document.querySelector(".c-kids")!.innerHTML; - - let createHobbyContainers = document.querySelectorAll(".c-hobby-container") as NodeListOf; - let hobbies: {[key: string]: {hobby: string}} = {}; - - createHobbyContainers.forEach(function (container) { - let hobbyInput = container.querySelector("input")!; - hobbies[hobbyInput.value] = { - "hobby": hobbyInput.value - }; - }); - - let occupation = document.querySelector(".c-occupation")!.innerHTML; - let prevoccupation = document.querySelector(".c-prevoccupation")!.innerHTML; - let education = document.querySelector(".c-education")!.innerHTML; - - let religion = checkDropdownValue("create", "religion"); - - let pets = document.querySelector(".c-pets")!.innerHTML; - - let editClubContainers = document.querySelectorAll(".c-club-container") as NodeListOf; - let clubs: {[key: string]: {club: string}} = {}; - - editClubContainers.forEach(function (container) { - let clubInput = container.querySelector("input")!; - clubs[clubInput.value] = { - "club": clubInput.value - }; - }); - - let legal = document.querySelector(".c-legal")!.innerHTML; - let political = document.querySelector(".c-political")!.innerHTML; - - let editSourceContainers = document.querySelectorAll(".c-source-container") as NodeListOf; - let sources: {[key: string]: {url: string}} = {}; - - editSourceContainers.forEach(function (container) { - let sourceInput = container.querySelector("input")!; - sources[sourceInput.value] = { - "url": sourceInput.value - }; - }); - - let notes = document.querySelector(".c-notes")!.innerHTML; - - let createEmailContainers = document.querySelectorAll(".c-email-container") as NodeListOf; - let emailAddresses: {[key: string]: {mail: string, src: string, services: string}} = {}; - - createEmailContainers.forEach(function (container) { - let hiddenElement = container.querySelector(".hidden-email-save")!; - - // FIXME this is beatiful - let hiddenElementVal = null; - - if (hiddenElement.innerHTML != "" && hiddenElement.innerHTML != null && hiddenElement.innerHTML != undefined) { - hiddenElementVal = JSON.parse(hiddenElement.innerHTML); - } - - let emailInput = container.querySelector("input")!; - emailAddresses[emailInput.value] = { - "mail": emailInput.value, - "src": "manual", - "services": hiddenElementVal - }; - }); - - let createIPContainers = document.querySelectorAll(".c-ip-container"); - let ips: {[key: string]: {ip: string}} = {}; - - createIPContainers.forEach(function (container) { - let ipInput = container.querySelector("input")!; - ips[ipInput.value] = { - "ip": ipInput.value - }; - }); - - const loadingSpinner = document.querySelector("#c-loading-spinner") as HTMLDivElement; - loadingSpinner.style.display = "flex" - - let obj = new Person(); - obj.id = id; - obj.name = name; - obj.gender = gender || ''; - obj.ethnicity = ethnicity || ''; - obj.age = age; - obj.bday = bday; - obj.address = address; - obj.phone = phoneNumbers as { [key: string]: person.PhoneNumber }; - obj.civilstatus = civilstatus || ''; - obj.kids = kids; - obj.hobbies = hobbies; - obj.email = emailAddresses as unknown as { [key: string]: person.Email }; - obj.ips = ips; - obj.occupation = occupation; - obj.prevoccupation = prevoccupation; - obj.education = education; - obj.religion = religion || ''; - obj.pets = pets; - obj.clubs = clubs; - obj.legal = legal; - obj.political = political; - obj.sources = sources; - obj.notes = notes; - - obj.Post(loadingSpinner) -} const editSaveBtn = document.querySelector("#e-savebtn")! as HTMLDivElement; @@ -2798,9 +1857,13 @@ editSaveBtn.onclick = async function () { const res = await fetch(apiCall("/people/" + id)) - let data = await res.json(); - + let data = await res.json() as Person; let obj = new Person(); + if (data == null) { + obj.accounts = {}; + } else { + obj.accounts = data.accounts; + } obj.id = id; obj.name = name; obj.gender = gender || ''; @@ -2824,7 +1887,6 @@ editSaveBtn.onclick = async function () { obj.political = political; obj.sources = sources; obj.notes = notes; - obj.accounts = data.accounts; obj.Post(loadingSpinner); @@ -2899,290 +1961,10 @@ document.getElementById("e-backbtn")!.onclick = function () { parentElement.innerHTML = ""; } -document.getElementById("c-backbtn")!.onclick = function () { - mainContainer.style.display = "flex"; - createContainer.style.display = "none"; -} - document.getElementById("acc-backbtn")!.onclick = function () { // account back button location.reload(); } -// Clubs - -document.getElementById("c-club-add-btn")!.onclick = function () { - const club_base = document.querySelector(".c-club-base") as HTMLDivElement; - - const club_container = document.createElement("div"); - club_container.className = "c-club-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "club-subcontainer"; - - const club_input = document.createElement("input"); - club_input.className = "form-input e-club"; - club_input.id = "club"; - club_input.type = "text"; - club_input.placeholder = "Enter club"; - club_input.spellcheck = false; - club_input.setAttribute("lng-tag", "enter_club") - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; - - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - club_base.appendChild(club_container); - club_container.appendChild(subContainer); - subContainer.appendChild(club_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - del_btn_div.onclick = function () { - club_container.remove(); - } - - refreshTranslation(); -} - -// Sources - -document.getElementById("c-source-add-btn")!.onclick = function () { - const source_base = document.querySelector(".c-source-base") as HTMLDivElement; - - const source_container = document.createElement("div"); - source_container.className = "c-source-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "source-subcontainer"; - - const source_input = document.createElement("input"); - source_input.className = "form-input e-source"; - source_input.id = "source"; - source_input.type = "text"; - source_input.placeholder = "Enter source"; - source_input.spellcheck = false; - source_input.setAttribute("lng-tag", "enter_source") - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; - - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - source_base.appendChild(source_container); - source_container.appendChild(subContainer); - subContainer.appendChild(source_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - del_btn_div.onclick = function () { - source_container.remove(); - } - - refreshTranslation(); -} - -// IPs - -document.getElementById("c-ip-add-btn")!.onclick = function () { - const ip_base = document.querySelector(".c-ip-base") as HTMLDivElement; - - const ip_container = document.createElement("div"); - ip_container.className = "c-ip-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "ip-subcontainer"; - - const ip_input = document.createElement("input"); - ip_input.className = "form-input e-ip"; - ip_input.id = "ip"; - ip_input.type = "text"; - ip_input.placeholder = "Enter IP"; - ip_input.spellcheck = false; - ip_input.setAttribute("lng-tag", "enter_ip") - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; - - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - ip_base.appendChild(ip_container); - ip_container.appendChild(subContainer); - subContainer.appendChild(ip_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - del_btn_div.onclick = function () { - ip_container.remove(); - } - - refreshTranslation(); -} - -// Phone - -document.getElementById("c-phone-add-btn")!.onclick = function () { - const phone_base = document.querySelector(".c-phone-base") as HTMLDivElement; - - const phone_container = document.createElement("div"); - phone_container.className = "c-phone-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "phone-subcontainer"; - - const phone_input = document.createElement("input"); - phone_input.className = "form-input e-phone"; - phone_input.id = "phone"; - phone_input.type = "tel"; - phone_input.placeholder = "Enter phone number"; - phone_input.spellcheck = false; - phone_input.setAttribute("lng-tag", "enter_phone_number") - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; - - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - phone_base.appendChild(phone_container); - phone_container.appendChild(subContainer); - subContainer.appendChild(phone_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - del_btn_div.onclick = function () { - phone_container.remove(); - } - - refreshTranslation(); -} - -// Hobbies - -document.getElementById("c-hobby-add-btn")!.onclick = function () { - const hobby_base = document.querySelector(".c-hobby-base") as HTMLDivElement; - - const hobby_container = document.createElement("div"); - hobby_container.className = "c-hobby-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "hobby-subcontainer"; - - const hobby_input = document.createElement("input"); - hobby_input.className = "form-input e-hobby"; - hobby_input.id = "hobby"; - hobby_input.type = "tel"; - hobby_input.placeholder = "Enter hobby"; - hobby_input.spellcheck = false; - hobby_input.setAttribute("lng-tag", "enter_hobby") - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; - - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - hobby_base.appendChild(hobby_container); - hobby_container.appendChild(subContainer); - subContainer.appendChild(hobby_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - del_btn_div.onclick = function () { - hobby_container.remove(); - } - - refreshTranslation(); -} - -// IPs - -document.getElementById("c-ip-add-btn")!.onclick = function () { - const ip_base = document.querySelector(".c-ip-base") as HTMLDivElement; - - const ip_container = document.createElement("div"); - ip_container.className = "c-ip-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "ip-subcontainer"; - - const ip_input = document.createElement("input"); - ip_input.className = "form-input e-ip"; - ip_input.id = "ip"; - ip_input.type = "tel"; - ip_input.placeholder = "Enter IP"; - ip_input.spellcheck = false; - ip_input.setAttribute("lng-tag", "enter_ip") - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; - - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - ip_base.appendChild(ip_container); - ip_container.appendChild(subContainer); - subContainer.appendChild(ip_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - del_btn_div.onclick = function () { - ip_container.remove(); - } - - refreshTranslation(); -} - -// Email - -document.getElementById("c-add-btn")!.onclick = function () { - const email_base = document.querySelector(".c-email-base") as HTMLDivElement; - - const email_container = document.createElement("div"); - email_container.className = "c-email-container"; - - const subContainer = document.createElement("div"); - subContainer.className = "c-email-subcontainer"; - - const email_input = document.createElement("input"); - email_input.className = "form-input e-mail"; - email_input.id = "c-e-mail"; - email_input.type = "email"; - email_input.placeholder = "Enter email address"; - email_input.spellcheck = false; - email_input.setAttribute("lng-tag", "enter_email_address") - - const del_btn_div = document.createElement("div"); - del_btn_div.className = "del-btn"; - - const del_btn = document.createElement("ion-icon") as IonIconElement; - del_btn.name = "remove-outline"; - - email_base.appendChild(email_container); - email_container.appendChild(email_input); - email_container.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - const hidden_email_save = document.createElement("p"); - hidden_email_save.className = "hidden-email-save"; - email_container.appendChild(hidden_email_save); - - del_btn_div.onclick = function () { - email_container.remove(); - } - - email_container.appendChild(subContainer); - subContainer.appendChild(email_input); - subContainer.appendChild(del_btn_div); - del_btn_div.appendChild(del_btn); - - refreshTranslation(); -} - - runOnStart(); From 1f8f8fee560e05d82ddad5529ea28ef31984f5ee Mon Sep 17 00:00:00 2001 From: Nite <67828948+Niteletsplay@users.noreply.github.com> Date: Fri, 16 Jun 2023 16:56:41 +0200 Subject: [PATCH 05/13] small adjustments --- web/ts/framework.ts | 6 +++--- web/ts/script.ts | 13 ++++++++----- web/ts/theme_loader.ts | 2 -- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/web/ts/framework.ts b/web/ts/framework.ts index 6374367d..ce934b9f 100644 --- a/web/ts/framework.ts +++ b/web/ts/framework.ts @@ -167,10 +167,10 @@ function checkDropdownValue(windowType: "edit" | "create", dropdownType: "gender ethnicity[translateText("indigenous_slash_native_american")!] = "Indigenous/Native American"; ethnicity[translateText("multiracial_slash_mixed")!] = "Multiracial/Mixed"; } - console.log(ethnicity[selectedEthnicity]) + return ethnicity[selectedEthnicity]; } else if (dropdownType == "religion") { - const selectedReligion = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(14) > div > div.select-selected")?.innerHTML ?? ""; + const selectedReligion = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(15) > div > div.select-selected")!.innerHTML ?? ""; const religion: { [key: string]: string } = {}; // English @@ -201,7 +201,7 @@ function checkDropdownValue(windowType: "edit" | "create", dropdownType: "gender return religion[selectedReligion]; } else if (dropdownType == "civilstatus") { - const selectedCivilstatus = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(6) > div > div.select-selected")?.innerHTML ?? ""; + const selectedCivilstatus = document.querySelector("body > div." + windowType + "-container > div > div.scroll-box > div:nth-child(7) > div > div.select-selected")?.innerHTML ?? ""; const civilstatus: { [key: string]: string } = {}; // English diff --git a/web/ts/script.ts b/web/ts/script.ts index 6d6fec38..261a9c21 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -2,7 +2,7 @@ import { saveAsFile, checkDropdownValue, getDropdownElementIndex, apiCall } from import * as person from "../ts-gen/person.js"; class Person extends person.Person { - Post(loadingSpinner?: HTMLDivElement): void { + Post(loadingSpinner?: HTMLDivElement): void { const requestOptions = { method: "POST", body: JSON.stringify(this), @@ -19,7 +19,7 @@ class Person extends person.Person { console.error("Error:", error); }); } - + Edit(): void { let obj = this; mainContainer.style.display = "none"; @@ -55,6 +55,8 @@ class Person extends person.Person { const ethnicityElement = selectItems.children[parseInt(ethnicityIndex)]; selectSelected.innerHTML = translateRawWord(obj.ethnicity)!; + + console.log(selectSelected.innerHTML); ethnicityElement.className = "same-as-selected"; } } @@ -1828,7 +1830,7 @@ editSaveBtn.onclick = async function () { editEmailContainers.forEach(function (container) { let hiddenElement = container.querySelector(".hidden-email-save")!; - // FIXME this is beatiful + // FIXME this is beautiful let hiddenElementVal = null; if (hiddenElement.innerHTML != "" && hiddenElement.innerHTML != null && hiddenElement.innerHTML != undefined) { @@ -1859,11 +1861,13 @@ editSaveBtn.onclick = async function () { let data = await res.json() as Person; let obj = new Person(); + if (data == null) { obj.accounts = {}; } else { obj.accounts = data.accounts; } + obj.id = id; obj.name = name; obj.gender = gender || ''; @@ -2035,5 +2039,4 @@ async function searchEntries() { } } - -export { }; +export { }; \ No newline at end of file diff --git a/web/ts/theme_loader.ts b/web/ts/theme_loader.ts index 6465aea9..f93b2e88 100644 --- a/web/ts/theme_loader.ts +++ b/web/ts/theme_loader.ts @@ -12,8 +12,6 @@ function setDefaultIfNotStored(): void { localStorage.setItem("theme", defaultTheme); changeTheme(defaultTheme); - - console.log(localStorage.getItem("theme")); } } From 2c9b9b586c89e51a422c12df7c77efc86318dbd0 Mon Sep 17 00:00:00 2001 From: Nite <67828948+Niteletsplay@users.noreply.github.com> Date: Thu, 29 Jun 2023 20:46:51 +0200 Subject: [PATCH 06/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11db2eff..2833c026 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ## Introduction Seekr is a multi-purpose toolkit for gathering and managing OSINT-data with a sleek web interface. Our desktop view enables you to have all of your favourite OSINT tools integrated in one. The backend is written in Go with BadgerDB as database and it offers a wide range of features for data collection, organization, and analysis. Whether you're a researcher, investigator, or just someone looking to gather information, seekr makes it easy to find and manage the data you need. Give it a try and see how it can streamline your OSINT workflow! -Check the wiki for setup guide, etc. +Check the wiki for setup guide, API-docs, etc. From ac791782de00bf3b54d49e6284009d0f8fe5f778 Mon Sep 17 00:00:00 2001 From: Nite <67828948+Niteletsplay@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:10:54 +0200 Subject: [PATCH 07/13] Removed console log --- web/ts/script.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/web/ts/script.ts b/web/ts/script.ts index 261a9c21..3577f783 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -56,7 +56,6 @@ class Person extends person.Person { selectSelected.innerHTML = translateRawWord(obj.ethnicity)!; - console.log(selectSelected.innerHTML); ethnicityElement.className = "same-as-selected"; } } From ca886244b91d879b9869da1f297002680ca93eec Mon Sep 17 00:00:00 2001 From: Nite <67828948+Niteletsplay@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:12:20 +0200 Subject: [PATCH 08/13] Code formatting --- web/ts/script.ts | 64 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/web/ts/script.ts b/web/ts/script.ts index 3577f783..691165aa 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -1,6 +1,6 @@ import { saveAsFile, checkDropdownValue, getDropdownElementIndex, apiCall } from "./framework.js"; import * as person from "../ts-gen/person.js"; - + class Person extends person.Person { Post(loadingSpinner?: HTMLDivElement): void { const requestOptions = { @@ -19,7 +19,7 @@ class Person extends person.Person { console.error("Error:", error); }); } - + Edit(): void { let obj = this; mainContainer.style.display = "none"; @@ -238,11 +238,11 @@ class Person extends person.Person { refreshTranslation(); } - + editOccupation.innerHTML = obj.occupation; editPrevOccupation.innerHTML = obj.prevoccupation; editEducation.innerHTML = obj.education; - + if (obj.religion != "") { const religionSelect = document.querySelector(".edit-container > .components > .scroll-box > div:nth-child(15) > .religion-select") as HTMLElement; const selectItems = religionSelect.querySelector(".select-items") as HTMLElement; @@ -596,7 +596,7 @@ class Person extends person.Person { // Accounts - if (Object.keys(obj.accounts).length != 0 && obj.accounts != null) { + if (Object.keys(obj.accounts).length != 0 && obj.accounts != null) { for (const [_, accObj] of Object.entries(obj.accounts)) { const accVar = (accObj as { service: string, id: string, username: string, url: string, profilePicture: { [key: number]: { img: string, img_hash: number } }, bio: { [key: number]: { bio: string } } }); @@ -817,7 +817,7 @@ const channel = new BroadcastChannel("seekr-channel"); channel.addEventListener("message", (event) => { if (event.data.type === "theme") { const theme = event.data.theme; - + document.documentElement.setAttribute("data-theme", theme); } else if (event.data.type === "language") { translate() @@ -835,7 +835,7 @@ interface IonIconElement extends HTMLElement { // Variables for HTML elements - // General +// General const mainContainer = document.querySelector(".main") as HTMLDivElement; const container = document.querySelector(".container") as HTMLDivElement; @@ -961,7 +961,7 @@ document.getElementById("exportbtn")!.onclick = function () { saveAsFile(JSON.stringify(getData()), "data.json"); } -function createCards(obj: Person){ +function createCards(obj: Person) { let x = document.querySelector('#list-holder')!; // Basic @@ -1025,14 +1025,14 @@ function createCards(obj: Person){ d_icon.className = "icon" d_icon.setAttribute("name", "trash-outline"); - d_icon_div.onclick = function () { - fetch(apiCall("/people/" + obj.id + "/delete"), { - method: "GET", - mode: "no-cors" - }).then(function () { - location.reload(); - }); -} + d_icon_div.onclick = function () { + fetch(apiCall("/people/" + obj.id + "/delete"), { + method: "GET", + mode: "no-cors" + }).then(function () { + location.reload(); + }); + } acc_icon_div.onclick = function () { editShowID.innerHTML = obj.id; @@ -1080,7 +1080,7 @@ function createCards(obj: Person){ const term_header = document.createElement("p"); term_header.className = "term-header"; - term_header.textContent = accNameTag.value; + term_header.textContent = accNameTag.value; term_container.appendChild(term_header); @@ -1267,7 +1267,7 @@ function createCards(obj: Person){ let tempText = item.innerHTML.substring(item.innerHTML.indexOf(':') + 1).trim(); // Check if the text is empty, null, or undefined - if (tempText.length <= 0 || tempText.replace(" ","") == "" || tempText == null || tempText == undefined || tempText == "0") { + if (tempText.length <= 0 || tempText.replace(" ", "") == "" || tempText == null || tempText == undefined || tempText == "0") { // Remove the object from the page // allObjects[i].remove(); @@ -1755,7 +1755,7 @@ editSaveBtn.onclick = async function () { let gender = checkDropdownValue("edit", "gender"); let ethnicity = checkDropdownValue("edit", "ethnicity"); - + let age = parseInt(editAge.innerHTML); if (age < 0) { @@ -1768,7 +1768,7 @@ editSaveBtn.onclick = async function () { let bday = editBday.innerHTML; let address = editAddress.innerHTML; - let phoneNumbers: {[key: string]: {number: string}} = {}; + let phoneNumbers: { [key: string]: { number: string } } = {}; editPhoneContainers.forEach((container: HTMLDivElement) => { const phoneInput: HTMLInputElement | null = container.querySelector('input[type="tel"]')!; @@ -1784,7 +1784,7 @@ editSaveBtn.onclick = async function () { let kids = editKids.innerHTML; - let hobbies: {[key: string]: {hobby: string}} = {}; + let hobbies: { [key: string]: { hobby: string } } = {}; editHobbyContainers.forEach(function (container) { let hobbyInput = container.querySelector("input")!; @@ -1801,7 +1801,7 @@ editSaveBtn.onclick = async function () { let pets = editPets.innerHTML; - let clubs: {[key: string]: {club: string}} = {}; + let clubs: { [key: string]: { club: string } } = {}; editClubContainers.forEach(function (container) { let clubInput = container.querySelector("input")!; @@ -1813,7 +1813,7 @@ editSaveBtn.onclick = async function () { let legal = editLegal.innerHTML; let political = editPolitical.innerHTML; - let sources: {[key: string]: {url: string}} = {}; + let sources: { [key: string]: { url: string } } = {}; editSourceContainers.forEach(function (container) { let sourceInput = container.querySelector("input")!; @@ -1824,11 +1824,11 @@ editSaveBtn.onclick = async function () { let notes = editNotes.innerHTML; - let emailAddresses: {[key: string]: {mail: string, src: string, services: string}} = {}; + let emailAddresses: { [key: string]: { mail: string, src: string, services: string } } = {}; editEmailContainers.forEach(function (container) { let hiddenElement = container.querySelector(".hidden-email-save")!; - + // FIXME this is beautiful let hiddenElementVal = null; @@ -1843,8 +1843,8 @@ editSaveBtn.onclick = async function () { "services": hiddenElementVal }; }); - - let ips: {[key: string]: {ip: string}} = {}; + + let ips: { [key: string]: { ip: string } } = {}; editIPContainers.forEach(function (container) { let ipInput = container.querySelector("input")!; @@ -1852,7 +1852,7 @@ editSaveBtn.onclick = async function () { "ip": ipInput.value }; }); - + const loadingSpinner = document.querySelector("#e-loading-spinner")! as HTMLDivElement; loadingSpinner.style.display = "flex" @@ -1874,11 +1874,11 @@ editSaveBtn.onclick = async function () { obj.age = age; obj.bday = bday; obj.address = address; - obj.phone = phoneNumbers as { [key: string]: person.PhoneNumber }; - obj.civilstatus = civilstatus || ''; + obj.phone = phoneNumbers as { [key: string]: person.PhoneNumber }; + obj.civilstatus = civilstatus || ''; obj.kids = kids; obj.hobbies = hobbies; - obj.email = emailAddresses as unknown as { [key: string]: person.Email }; + obj.email = emailAddresses as unknown as { [key: string]: person.Email }; obj.ips = ips; obj.occupation = occupation; obj.prevoccupation = prevoccupation; @@ -1986,7 +1986,7 @@ async function runOnStart() { for (const [i, _] of Object.entries(data)) { //let obj = data[Number(i)] as any; let obj = data[Number(i)] as Person; - + createCards(obj); } } From b517f172b15304e7223121267445f2d64309f101 Mon Sep 17 00:00:00 2001 From: Nite <67828948+Niteletsplay@users.noreply.github.com> Date: Mon, 10 Jul 2023 19:24:24 +0200 Subject: [PATCH 09/13] Export as json fixed --- web/ts/script.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/ts/script.ts b/web/ts/script.ts index 691165aa..bc973557 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -900,7 +900,7 @@ async function getData(): Promise { let data = await res.json(); - return data; + return data; } searchBar!.addEventListener("keyup", searchEntries); @@ -957,8 +957,10 @@ document.getElementById("newbtn")!.onclick = async function () { // createContainer.style.display = "flex"; } -document.getElementById("exportbtn")!.onclick = function () { - saveAsFile(JSON.stringify(getData()), "data.json"); +document.getElementById("exportbtn")!.onclick = async function () { + const data = await getData() as object[]; + + saveAsFile(JSON.stringify(data), "data.json"); } function createCards(obj: Person) { From da1247fe5b567a916756e00428b744ac659ba750 Mon Sep 17 00:00:00 2001 From: 9glenda Date: Mon, 10 Jul 2023 20:02:09 +0200 Subject: [PATCH 10/13] fixed account scanning Inheritance is the biggest thread to the human species. --- web/ts/script.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/ts/script.ts b/web/ts/script.ts index bc973557..95b40b6e 100644 --- a/web/ts/script.ts +++ b/web/ts/script.ts @@ -1178,7 +1178,10 @@ function createCards(obj: Person) { let data = await res.json() as Person; data.accounts[accObj.service + "-" + accObj.username] = accObj; - data.Post() + fetch(apiCall("/person"), { + method: 'POST', + body: JSON.stringify(data) + }); accept_p.innerHTML = "Accepted!"; } @@ -2040,4 +2043,4 @@ async function searchEntries() { } } -export { }; \ No newline at end of file +export { }; From d50ae66911b81f000b8b6bef4a8f930c5085620f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:27:02 +0000 Subject: [PATCH 11/13] Bump golang.org/x/oauth2 from 0.8.0 to 0.10.0 (#495) * Bump golang.org/x/oauth2 from 0.8.0 to 0.10.0 Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.8.0 to 0.10.0. - [Commits](https://github.com/golang/oauth2/compare/v0.8.0...v0.10.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * updated hash --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 9glenda --- flake.nix | 2 +- go.mod | 12 ++++++------ go.sum | 25 +++++++++++++------------ 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index afd6b5e4..af472e5b 100644 --- a/flake.nix +++ b/flake.nix @@ -102,7 +102,7 @@ #"-X main.version=${version}" ]; - vendorSha256 = "sha256-KB9T++h6cvOvPmnDauE/r882E9qs4aNt8T7tKjlVrIE="; + vendorSha256 = "sha256-5fMynajkyrTOCTNW1WjuUNRrgTjroHWYV/Fb1ad2rLI="; }; }); diff --git a/go.mod b/go.mod index 887b5732..5b94b207 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/src-d/enry/v2 v2.1.0 github.com/sundowndev/phoneinfoga/v2 v2.10.5 github.com/tkrajina/typescriptify-golang-structs v0.1.10 - golang.org/x/oauth2 v0.8.0 + golang.org/x/oauth2 v0.10.0 ) require ( @@ -155,16 +155,16 @@ require ( go.uber.org/multierr v1.11.0 // indirect go4.org v0.0.0-20200411211856-f5505b9728dd // indirect golang.org/x/arch v0.3.0 // indirect - golang.org/x/crypto v0.9.0 // indirect + golang.org/x/crypto v0.11.0 // indirect golang.org/x/exp v0.0.0-20230420155640-133eef4313cb // indirect golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/djherbis/times.v1 v1.3.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/toqueteos/substring.v1 v1.0.2 // indirect diff --git a/go.sum b/go.sum index b4fdf39f..b4dc4bb0 100644 --- a/go.sum +++ b/go.sum @@ -497,8 +497,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -561,15 +561,15 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -617,8 +617,8 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -626,7 +626,7 @@ golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -637,8 +637,9 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -730,8 +731,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 907d47c0a101310b1e39173a97388716994ea255 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 18:32:34 +0000 Subject: [PATCH 12/13] Bump github.com/sundowndev/phoneinfoga/v2 from 2.10.5 to 2.10.7 (#494) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump github.com/sundowndev/phoneinfoga/v2 from 2.10.5 to 2.10.7 Bumps [github.com/sundowndev/phoneinfoga/v2](https://github.com/sundowndev/phoneinfoga) from 2.10.5 to 2.10.7. - [Release notes](https://github.com/sundowndev/phoneinfoga/releases) - [Changelog](https://github.com/sundowndev/phoneinfoga/blob/master/.goreleaser.yml) - [Commits](https://github.com/sundowndev/phoneinfoga/compare/v2.10.5...v2.10.7) --- updated-dependencies: - dependency-name: github.com/sundowndev/phoneinfoga/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * updated hash --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: naŭ glenda --- flake.nix | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index af472e5b..e643705f 100644 --- a/flake.nix +++ b/flake.nix @@ -102,7 +102,7 @@ #"-X main.version=${version}" ]; - vendorSha256 = "sha256-5fMynajkyrTOCTNW1WjuUNRrgTjroHWYV/Fb1ad2rLI="; + vendorSha256 = "sha256-xgUdi0jpGilGznyDaXIND8OAOAfGmnBX7AIkpWaytxo="; }; }); diff --git a/go.mod b/go.mod index 5b94b207..dbe18fbb 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/projectdiscovery/subfinder/v2 v2.5.9 github.com/rocketlaunchr/google-search v1.1.5 github.com/src-d/enry/v2 v2.1.0 - github.com/sundowndev/phoneinfoga/v2 v2.10.5 + github.com/sundowndev/phoneinfoga/v2 v2.10.7 github.com/tkrajina/typescriptify-golang-structs v0.1.10 golang.org/x/oauth2 v0.10.0 ) diff --git a/go.sum b/go.sum index b4dc4bb0..82a1fd06 100644 --- a/go.sum +++ b/go.sum @@ -431,8 +431,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/sundowndev/phoneinfoga/v2 v2.10.5 h1:+SRR7IfV19O+ctnFtShA+1ffwyMrhNxCfOK2fv38+2Y= -github.com/sundowndev/phoneinfoga/v2 v2.10.5/go.mod h1:iJy1IgGZfZErQ4JgRqh6cwJ4Ds1vqikc/Ez9LtlA+9U= +github.com/sundowndev/phoneinfoga/v2 v2.10.7 h1:RMYC4GRRVV0I7dnLln+UZ85MAdKwqpri0wqyM5FkRgQ= +github.com/sundowndev/phoneinfoga/v2 v2.10.7/go.mod h1:iJy1IgGZfZErQ4JgRqh6cwJ4Ds1vqikc/Ez9LtlA+9U= github.com/temoto/robotstxt v1.1.1/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo= github.com/temoto/robotstxt v1.1.2 h1:W2pOjSJ6SWvldyEuiFXNxz3xZ8aiWX5LbfDiOFd7Fxg= github.com/temoto/robotstxt v1.1.2/go.mod h1:+1AmkuG3IYkh1kv0d2qEB9Le88ehNO0zwOr3ujewlOo= From 67c71d91a7889a0ca9c81ed3269b289c20458d10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 20:40:37 +0200 Subject: [PATCH 13/13] Bump github.com/rocketlaunchr/google-search from 1.1.5 to 1.1.6 (#493) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump github.com/rocketlaunchr/google-search from 1.1.5 to 1.1.6 Bumps [github.com/rocketlaunchr/google-search](https://github.com/rocketlaunchr/google-search) from 1.1.5 to 1.1.6. - [Release notes](https://github.com/rocketlaunchr/google-search/releases) - [Commits](https://github.com/rocketlaunchr/google-search/compare/v1.1.5...v1.1.6) --- updated-dependencies: - dependency-name: github.com/rocketlaunchr/google-search dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * updated hash --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: naŭ glenda --- flake.nix | 2 +- go.mod | 2 +- go.sum | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index e643705f..8186a634 100644 --- a/flake.nix +++ b/flake.nix @@ -102,7 +102,7 @@ #"-X main.version=${version}" ]; - vendorSha256 = "sha256-xgUdi0jpGilGznyDaXIND8OAOAfGmnBX7AIkpWaytxo="; + vendorSha256 = "sha256-6/oUypEcri/TulwNVllB9Z8HxTxj+0pNLJ8Hqsb2NsQ="; }; }); diff --git a/go.mod b/go.mod index dbe18fbb..77060001 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/pelletier/go-toml v1.9.5 github.com/pemistahl/lingua-go v1.3.3 github.com/projectdiscovery/subfinder/v2 v2.5.9 - github.com/rocketlaunchr/google-search v1.1.5 + github.com/rocketlaunchr/google-search v1.1.6 github.com/src-d/enry/v2 v2.1.0 github.com/sundowndev/phoneinfoga/v2 v2.10.7 github.com/tkrajina/typescriptify-golang-structs v0.1.10 diff --git a/go.sum b/go.sum index 82a1fd06..5752909b 100644 --- a/go.sum +++ b/go.sum @@ -393,8 +393,8 @@ github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rocketlaunchr/google-search v1.1.5 h1:C4TsvRJ/MnBqqObs7iOjDllQYr78Tzwqq0W7GZWpO+8= -github.com/rocketlaunchr/google-search v1.1.5/go.mod h1:/IXrZI7HaBmdh75AoBpOnewFfg70ufG7KcA82Y7C6Mw= +github.com/rocketlaunchr/google-search v1.1.6 h1:DcSluQWDWEMqo6jp6OGllMTI9SBECpSmUZFntAX4j/o= +github.com/rocketlaunchr/google-search v1.1.6/go.mod h1:fk5J/qPpaRDjLWdFxT+dmuiqG7kxXArC7K8A+gj88Nk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= @@ -561,6 +561,7 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -617,6 +618,7 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -626,6 +628,7 @@ golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -642,7 +645,6 @@ golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -731,6 +733,7 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=