import { setupLoginModal, setupChangeDictionary, setupCreateNewDictionary, setupDeletedDictionaryChangeModal } from "./setupListeners"; import { request } from "./helpers"; export function renderLoginForm() { const loginModal = document.createElement('section'); loginModal.classList.add('modal'); loginModal.id = 'loginModal'; loginModal.innerHTML = ` `; document.body.appendChild(loginModal); setupLoginModal(loginModal); } export function renderMakePublic() { const editSettingsTab = document.getElementById('editSettingsTab'); const editSettingsTabHTML = ` `; editSettingsTab.innerHTML += editSettingsTabHTML; } export function renderAccountSettings() { const accountSettingsColumn = document.getElementById('accountSettings'); const accountSettingsHTML = `

Account Settings

`; accountSettingsColumn.innerHTML = accountSettingsHTML; } export function renderAccountActions() { const accountActionsColumn = document.getElementById('accountActions'); const accountActionsHTML = `

Account Actions

Create New Dictionary

Request Your Data

Per your GDPR rights in Articles 13–15 and 20, we allow you to request any and all data we have stored about you. The only data we have about you personally is your email address and your Public Name, if you decided to set one. All other data (your Dictionary data) is visible and accessible via the Export button under your Dictionary's Settings. Send an email to help@lexicon.ga to request your information.

Delete Your Account

Per your GDPR rights in Articles 17, if you wish for your account to be deleted, please contact us at help@lexicon.ga, and we will delete your account and all associated dictionaries and words as quickly as possible. Note that you can delete dictionaries yourself via your Dictionary's Settings.

Anything that is deleted from our system is permanently and irretrievably removed from our system and cannot be restored, though search engines or internet archives may retain a cached version of your content (there is nothing we can do about this, and you will need to seek out removal of that information by directly contacting the services that are caching your data).

`; accountActionsColumn.innerHTML = accountActionsHTML; renderChangeDictionaryOptions(); setupCreateNewDictionary(); } export function renderChangeDictionaryOptions() { request({ action: 'get-all-dictionary-names', }, dictionaries => { const changeDictionarySelect = document.getElementById('accountSettingsChangeDictionary'); const optionsHTML = dictionaries.map(dictionary => ``).join(''); changeDictionarySelect.innerHTML = optionsHTML; changeDictionarySelect.value = window.currentDictionary.externalID; setupChangeDictionary(); }, error => console.error(error)); } export function renderDeletedDictionaryChangeModal(deletedId) { const changeDictionarySelect = document.getElementById('accountSettingsChangeDictionary'); const lazyFilterOptions = changeDictionarySelect.querySelectorAll(`option:not([value="${deletedId}"])`); const lazyFilter = document.createElement('select'); lazyFilter.innerHTML = ''; lazyFilterOptions.forEach(option => { lazyFilter.appendChild(option); }); const otherDictionariesHTML = lazyFilter.innerHTML; const modal = document.createElement('section'); modal.classList.add('modal'); modal.innerHTML = ` `; document.body.appendChild(modal); setupDeletedDictionaryChangeModal(); }