diff --git a/android/app/src/main/assets/public/blah/en-cat.json b/android/app/src/main/assets/public/blah/en-cat.json index f06e9ea5..a5e5a89f 100644 --- a/android/app/src/main/assets/public/blah/en-cat.json +++ b/android/app/src/main/assets/public/blah/en-cat.json @@ -262,5 +262,10 @@ "action.leaving.group": "Leaving group, meow...", "action.key.rotating": "Rotating keys, meow...", "action.key.rotation": "Key rotation, meow", - "desc.leave.group.confirm": "Are you sure you want to leave this group, meow?" + "desc.leave.group.confirm": "Are you sure you want to leave this group, meow?", + "desc.key.rotation.you": "You will generate a new encryption key for this group, meow.", + "label.keys.to.encrypt": "keys to encrypt, meow", + "action.group.creating": "Creating group, meow...", + "title.group.settings": "Group settings, meow", + "title.leave.group": "Leave group, meow" } \ No newline at end of file diff --git a/android/app/src/main/assets/public/blah/en-us.json b/android/app/src/main/assets/public/blah/en-us.json index effa6346..634760ad 100644 --- a/android/app/src/main/assets/public/blah/en-us.json +++ b/android/app/src/main/assets/public/blah/en-us.json @@ -262,5 +262,10 @@ "action.leaving.group": "Leaving group...", "action.key.rotating": "Rotating keys...", "action.key.rotation": "Key rotation", - "desc.leave.group.confirm": "Are you sure you want to leave this group?" + "desc.leave.group.confirm": "Are you sure you want to leave this group?", + "desc.key.rotation.you": "You will generate a new encryption key for this group.", + "label.keys.to.encrypt": "keys to encrypt", + "action.group.creating": "Creating group...", + "title.group.settings": "Group settings", + "title.leave.group": "Leave group" } \ No newline at end of file diff --git a/android/app/src/main/assets/public/blah/pl-pl.json b/android/app/src/main/assets/public/blah/pl-pl.json index 3a00a975..6b7c54b4 100644 --- a/android/app/src/main/assets/public/blah/pl-pl.json +++ b/android/app/src/main/assets/public/blah/pl-pl.json @@ -262,5 +262,10 @@ "action.leaving.group": "Opuszczanie grupy...", "action.key.rotating": "Obracanie kluczy...", "action.key.rotation": "Rotacja kluczy", - "desc.leave.group.confirm": "Czy na pewno chcesz opuścić tę grupę?" + "desc.leave.group.confirm": "Czy na pewno chcesz opuścić tę grupę?", + "desc.key.rotation.you": "Wygenerujesz nowy klucz szyfrujący dla tej grupy.", + "label.keys.to.encrypt": "kluczy do zaszyfrowania", + "action.group.creating": "Tworzenie grupy...", + "title.group.settings": "Ustawienia grupy", + "title.leave.group": "Opuść grupę" } \ No newline at end of file diff --git a/android/app/src/main/assets/public/icons.js b/android/app/src/main/assets/public/icons.js index 06596908..ae3b562c 100644 --- a/android/app/src/main/assets/public/icons.js +++ b/android/app/src/main/assets/public/icons.js @@ -30,11 +30,10 @@ const ICONS = { pin: (props) => ICONS._material(``, props), call: (props) => ICONS._material(``, props), account: (props) => ICONS._material(``, props), - settings: (props) => ICONS._material(``, props), profile: (props) => ICONS._material(``, props), replyAction: (props) => ICONS._material(``, props), react: (props) => ICONS._material(``, props), - settingsProfile: (props) => ICONS._material(``, props), + settings: (props) => ICONS._material(``, props), download: (props) => ICONS._feather(``, props), camera: (props) => ICONS._feather(``, props), diff --git a/android/app/src/main/assets/public/main.js b/android/app/src/main/assets/public/main.js index 7a90b060..4d906816 100644 --- a/android/app/src/main/assets/public/main.js +++ b/android/app/src/main/assets/public/main.js @@ -432,7 +432,7 @@ function showConfirmPopup(titleKey, descHtml, confirmActionKey, cancelActionKey, let popupContainer = document.getElementById("generic-popup-container"); let popupInner = document.getElementById("generic-popup-inner"); - let confirmClass = isDestructive ? "popup-btn-danger" : "popup-btn-confirm"; + let confirmClass = isDestructive ? "popup-btn-danger" : ""; genericPopupCancelCallback = onCancel; @@ -449,10 +449,10 @@ function showConfirmPopup(titleKey, descHtml, confirmActionKey, cancelActionKey, ${descHtml}
- -
@@ -474,7 +474,7 @@ function showPromptPopup(titleKey, descHtml, placeholderKey, confirmActionKey, c let popupContainer = document.getElementById("generic-popup-container"); let popupInner = document.getElementById("generic-popup-inner"); - let confirmClass = isDestructive ? "popup-btn-danger" : "popup-btn-confirm"; + let confirmClass = isDestructive ? "popup-btn-danger" : ""; genericPopupCancelCallback = onCancel; @@ -491,12 +491,15 @@ function showPromptPopup(titleKey, descHtml, placeholderKey, confirmActionKey, c
${descHtml}
- +
+ + +
- -
@@ -531,7 +534,7 @@ function closeRotationPopup() { async function showRotationPopup(groupId, originalMessagePayload) { pendingRotationMessagePayload = originalMessagePayload; - showAction("action.key.rotation", "key_rotation"); + showAction("action.key.rotating", "key_rotation"); try { let membersRaw = await fetchEncrypted("group/members", groupId); @@ -539,7 +542,7 @@ async function showRotationPopup(groupId, originalMessagePayload) { let members = JSON.parse(membersRaw); - let descHtml = `desc.key.rotation.info

${members.length} label.members`; + let descHtml = `desc.key.rotation.you

${members.length} label.keys.to.encrypt`; showConfirmPopup( "title.key.rotation", @@ -557,6 +560,7 @@ async function showRotationPopup(groupId, originalMessagePayload) { async function executeKeyRotation() { closeRotationPopup(); + clearAction("key_rotation"); showAction("action.key.rotating", "key_rotation_exec"); try { @@ -2742,7 +2746,7 @@ async function inviteToGroupPrompt(groupId) { showPromptPopup( "action.invite", "", - "prompt.invite.username", + "title.username", "action.invite", "action.cancel", async (targetUsername) => { @@ -4282,17 +4286,26 @@ async function changePassword() { } async function deleteAccount() { - if (!confirm(processBlah("desc.delete.account") + "\n\n" + processBlah("prompt.are.you.sure"))) return; - showAction("action.account.deleting", "accountdel"); - let res = await fetchPostEnc(`${url}/deleteaccount?id=${window.id}`, ""); - clearAction("accountdel"); - let text = res; - if (text.startsWith("success:")) { - alert(processBlah(text)); - logout(); - } else { - showBlahNotification(text); - } + showConfirmPopup( + "title.delete.account", + "desc.delete.account

prompt.are.you.sure", + "action.delete.account", + "action.cancel", + async () => { + showAction("action.account.deleting", "accountdel"); + let res = await fetchPostEnc(`${url}/deleteaccount?id=${window.id}`, ""); + clearAction("accountdel"); + let text = res; + if (text.startsWith("success:")) { + alert(processBlah(text)); + logout(); + } else { + showBlahNotification(text); + } + }, + null, + true + ); } async function saveProfile() { diff --git a/android/app/src/main/assets/public/screens.js b/android/app/src/main/assets/public/screens.js index 8f1f7e04..ddc0a5e2 100644 --- a/android/app/src/main/assets/public/screens.js +++ b/android/app/src/main/assets/public/screens.js @@ -211,7 +211,7 @@ var profileContextMenu = ` title.profile + `; diff --git a/android/app/src/main/assets/public/style.css b/android/app/src/main/assets/public/style.css index d9c8260e..81f402e4 100644 --- a/android/app/src/main/assets/public/style.css +++ b/android/app/src/main/assets/public/style.css @@ -878,35 +878,27 @@ sidebarelement:has(.icon-button:active) indicator:not(.active) { height: auto; max-height: 85vh; } -.popup-btn-cancel { +button.profile-action-btn.popup-action-btn { + flex: 1; + display: flex; + justify-content: center; + margin-top: 0; +} +button.profile-action-btn.popup-btn-cancel { background: rgba(255, 255, 255, 0.05); color: var(--text-color); border: var(--border-width) solid var(--light-border-color); - flex: 1; - justify-content: center; } -.popup-btn-cancel:hover { +button.profile-action-btn.popup-btn-cancel:hover { background: rgba(255, 255, 255, 0.1); } -.popup-btn-confirm { - background: var(--text-color); - color: var(--main-bg-color); +button.profile-action-btn.popup-btn-danger, button.submit-button.popup-btn-danger { + background: var(--big-red) !important; + color: white !important; border: none; - flex: 1; - justify-content: center; } -.popup-btn-confirm:hover { - background: white; -} -.popup-btn-danger { - background: var(--big-red); - color: white; - border: none; - flex: 1; - justify-content: center; -} -.popup-btn-danger:hover { - background: #ff5252; +button.profile-action-btn.popup-btn-danger:hover, button.submit-button.popup-btn-danger:hover { + filter: brightness(0.85); } .profile-popup-container.show .profile-popup-content { transform: scale(1); diff --git a/webroot/blah/en-cat.json b/webroot/blah/en-cat.json index f06e9ea5..a5e5a89f 100644 --- a/webroot/blah/en-cat.json +++ b/webroot/blah/en-cat.json @@ -262,5 +262,10 @@ "action.leaving.group": "Leaving group, meow...", "action.key.rotating": "Rotating keys, meow...", "action.key.rotation": "Key rotation, meow", - "desc.leave.group.confirm": "Are you sure you want to leave this group, meow?" + "desc.leave.group.confirm": "Are you sure you want to leave this group, meow?", + "desc.key.rotation.you": "You will generate a new encryption key for this group, meow.", + "label.keys.to.encrypt": "keys to encrypt, meow", + "action.group.creating": "Creating group, meow...", + "title.group.settings": "Group settings, meow", + "title.leave.group": "Leave group, meow" } \ No newline at end of file diff --git a/webroot/blah/en-us.json b/webroot/blah/en-us.json index effa6346..634760ad 100644 --- a/webroot/blah/en-us.json +++ b/webroot/blah/en-us.json @@ -262,5 +262,10 @@ "action.leaving.group": "Leaving group...", "action.key.rotating": "Rotating keys...", "action.key.rotation": "Key rotation", - "desc.leave.group.confirm": "Are you sure you want to leave this group?" + "desc.leave.group.confirm": "Are you sure you want to leave this group?", + "desc.key.rotation.you": "You will generate a new encryption key for this group.", + "label.keys.to.encrypt": "keys to encrypt", + "action.group.creating": "Creating group...", + "title.group.settings": "Group settings", + "title.leave.group": "Leave group" } \ No newline at end of file diff --git a/webroot/blah/pl-pl.json b/webroot/blah/pl-pl.json index 3a00a975..6b7c54b4 100644 --- a/webroot/blah/pl-pl.json +++ b/webroot/blah/pl-pl.json @@ -262,5 +262,10 @@ "action.leaving.group": "Opuszczanie grupy...", "action.key.rotating": "Obracanie kluczy...", "action.key.rotation": "Rotacja kluczy", - "desc.leave.group.confirm": "Czy na pewno chcesz opuścić tę grupę?" + "desc.leave.group.confirm": "Czy na pewno chcesz opuścić tę grupę?", + "desc.key.rotation.you": "Wygenerujesz nowy klucz szyfrujący dla tej grupy.", + "label.keys.to.encrypt": "kluczy do zaszyfrowania", + "action.group.creating": "Tworzenie grupy...", + "title.group.settings": "Ustawienia grupy", + "title.leave.group": "Opuść grupę" } \ No newline at end of file diff --git a/webroot/icons.js b/webroot/icons.js index 06596908..ae3b562c 100644 --- a/webroot/icons.js +++ b/webroot/icons.js @@ -30,11 +30,10 @@ const ICONS = { pin: (props) => ICONS._material(``, props), call: (props) => ICONS._material(``, props), account: (props) => ICONS._material(``, props), - settings: (props) => ICONS._material(``, props), profile: (props) => ICONS._material(``, props), replyAction: (props) => ICONS._material(``, props), react: (props) => ICONS._material(``, props), - settingsProfile: (props) => ICONS._material(``, props), + settings: (props) => ICONS._material(``, props), download: (props) => ICONS._feather(``, props), camera: (props) => ICONS._feather(``, props), diff --git a/webroot/main.js b/webroot/main.js index 7a90b060..4d906816 100644 --- a/webroot/main.js +++ b/webroot/main.js @@ -432,7 +432,7 @@ function showConfirmPopup(titleKey, descHtml, confirmActionKey, cancelActionKey, let popupContainer = document.getElementById("generic-popup-container"); let popupInner = document.getElementById("generic-popup-inner"); - let confirmClass = isDestructive ? "popup-btn-danger" : "popup-btn-confirm"; + let confirmClass = isDestructive ? "popup-btn-danger" : ""; genericPopupCancelCallback = onCancel; @@ -449,10 +449,10 @@ function showConfirmPopup(titleKey, descHtml, confirmActionKey, cancelActionKey, ${descHtml}
- -
@@ -474,7 +474,7 @@ function showPromptPopup(titleKey, descHtml, placeholderKey, confirmActionKey, c let popupContainer = document.getElementById("generic-popup-container"); let popupInner = document.getElementById("generic-popup-inner"); - let confirmClass = isDestructive ? "popup-btn-danger" : "popup-btn-confirm"; + let confirmClass = isDestructive ? "popup-btn-danger" : ""; genericPopupCancelCallback = onCancel; @@ -491,12 +491,15 @@ function showPromptPopup(titleKey, descHtml, placeholderKey, confirmActionKey, c
${descHtml}
- +
+ + +
- -
@@ -531,7 +534,7 @@ function closeRotationPopup() { async function showRotationPopup(groupId, originalMessagePayload) { pendingRotationMessagePayload = originalMessagePayload; - showAction("action.key.rotation", "key_rotation"); + showAction("action.key.rotating", "key_rotation"); try { let membersRaw = await fetchEncrypted("group/members", groupId); @@ -539,7 +542,7 @@ async function showRotationPopup(groupId, originalMessagePayload) { let members = JSON.parse(membersRaw); - let descHtml = `desc.key.rotation.info

${members.length} label.members`; + let descHtml = `desc.key.rotation.you

${members.length} label.keys.to.encrypt`; showConfirmPopup( "title.key.rotation", @@ -557,6 +560,7 @@ async function showRotationPopup(groupId, originalMessagePayload) { async function executeKeyRotation() { closeRotationPopup(); + clearAction("key_rotation"); showAction("action.key.rotating", "key_rotation_exec"); try { @@ -2742,7 +2746,7 @@ async function inviteToGroupPrompt(groupId) { showPromptPopup( "action.invite", "", - "prompt.invite.username", + "title.username", "action.invite", "action.cancel", async (targetUsername) => { @@ -4282,17 +4286,26 @@ async function changePassword() { } async function deleteAccount() { - if (!confirm(processBlah("desc.delete.account") + "\n\n" + processBlah("prompt.are.you.sure"))) return; - showAction("action.account.deleting", "accountdel"); - let res = await fetchPostEnc(`${url}/deleteaccount?id=${window.id}`, ""); - clearAction("accountdel"); - let text = res; - if (text.startsWith("success:")) { - alert(processBlah(text)); - logout(); - } else { - showBlahNotification(text); - } + showConfirmPopup( + "title.delete.account", + "desc.delete.account

prompt.are.you.sure", + "action.delete.account", + "action.cancel", + async () => { + showAction("action.account.deleting", "accountdel"); + let res = await fetchPostEnc(`${url}/deleteaccount?id=${window.id}`, ""); + clearAction("accountdel"); + let text = res; + if (text.startsWith("success:")) { + alert(processBlah(text)); + logout(); + } else { + showBlahNotification(text); + } + }, + null, + true + ); } async function saveProfile() { diff --git a/webroot/screens.js b/webroot/screens.js index 8f1f7e04..ddc0a5e2 100644 --- a/webroot/screens.js +++ b/webroot/screens.js @@ -211,7 +211,7 @@ var profileContextMenu = ` title.profile + `; diff --git a/webroot/style.css b/webroot/style.css index d9c8260e..81f402e4 100644 --- a/webroot/style.css +++ b/webroot/style.css @@ -878,35 +878,27 @@ sidebarelement:has(.icon-button:active) indicator:not(.active) { height: auto; max-height: 85vh; } -.popup-btn-cancel { +button.profile-action-btn.popup-action-btn { + flex: 1; + display: flex; + justify-content: center; + margin-top: 0; +} +button.profile-action-btn.popup-btn-cancel { background: rgba(255, 255, 255, 0.05); color: var(--text-color); border: var(--border-width) solid var(--light-border-color); - flex: 1; - justify-content: center; } -.popup-btn-cancel:hover { +button.profile-action-btn.popup-btn-cancel:hover { background: rgba(255, 255, 255, 0.1); } -.popup-btn-confirm { - background: var(--text-color); - color: var(--main-bg-color); +button.profile-action-btn.popup-btn-danger, button.submit-button.popup-btn-danger { + background: var(--big-red) !important; + color: white !important; border: none; - flex: 1; - justify-content: center; } -.popup-btn-confirm:hover { - background: white; -} -.popup-btn-danger { - background: var(--big-red); - color: white; - border: none; - flex: 1; - justify-content: center; -} -.popup-btn-danger:hover { - background: #ff5252; +button.profile-action-btn.popup-btn-danger:hover, button.submit-button.popup-btn-danger:hover { + filter: brightness(0.85); } .profile-popup-container.show .profile-popup-content { transform: scale(1);