Add blahs in actions
This commit is contained in:
parent
5a9875ea01
commit
81145968a1
9 changed files with 237 additions and 35 deletions
98
android/app/src/main/assets/public/blah/en-cat.json
Normal file
98
android/app/src/main/assets/public/blah/en-cat.json
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
"user.not.found": "meowser not found :c",
|
||||
"cant.invite.urself": "you can't invite yourself, silly :3",
|
||||
"user.already.invited": "you have already invited this user meow",
|
||||
"user.invited": "user invited successfully :3",
|
||||
"cant.create.dm.without.invitation": "you can't create a dm without invitation ><",
|
||||
"dm.begin.notice": "at the beginning of a meowchat, you should always verify that the person you're talking to is the intended recipient",
|
||||
"failed.accept.dm": "failed to accept direct meowchat",
|
||||
"dm.accepted": "direct meowchat accepted",
|
||||
"no.invite.found": "you can't create a dm without invitation *hiss*",
|
||||
"unknown.error": "unknown error :o",
|
||||
"account.creation.request.expired": "cat creation request expired. try again",
|
||||
"invalid.username": "invalid cat name: {0}",
|
||||
"invalid.password": "invalid meow word: {0}",
|
||||
"incorrect.captcha": "incorrect captcha. try meowgain",
|
||||
"username.taken": "this cat name is already taken",
|
||||
"accounts.slots.full": "you can't create a new cat because all collars are used. try again later",
|
||||
"registration.disabled": "registration disabled",
|
||||
"account.created": "cat created successfully",
|
||||
"password.changed": "meow word changed successfully",
|
||||
"keys.updated": "nametag updated successfully",
|
||||
"unknown.request": "unknown request: {0}",
|
||||
"login.successful": "pawgin successful :3",
|
||||
"username.length": "cat name must be {0} characters long",
|
||||
"username.conditions.allowed": "cat name can only include {all}",
|
||||
"password.not.hashed.properly": "meow word is not hashed properly",
|
||||
"invalid.username.or.password": "invalid cat name or meow word",
|
||||
"account.not.exist": "cat with this name doesn't exist",
|
||||
"invalid.nonce": "invalid nonce. try again",
|
||||
"username.changed": "cat name changed successfully",
|
||||
"auth.failed.redirect.to.login": "failed to find owner. redirecting to pawgin...",
|
||||
"dm.refresh.failed": "failed to refresh direct meowchats",
|
||||
"chat.add.failed": "failed to add meowchat",
|
||||
"something.wrong.mayb.pass": "something went wrong... :c (probably wrong meow word)",
|
||||
"something.wrong": "something went wrong... :c",
|
||||
"passwords.not.match": "meow word do not match",
|
||||
"password.cant.empty": "meow word cannot be empty",
|
||||
"username.cant.empty": "cat name cannot be empty",
|
||||
"bad.request": "bad request!!!",
|
||||
|
||||
"letters": "letters",
|
||||
"numbers": "numbers",
|
||||
"underscores": "underscores",
|
||||
|
||||
"loading.connecting": "connecting...",
|
||||
"loading.loading": "loading...",
|
||||
"loading.done": "ready! :3",
|
||||
|
||||
"title.home": "bed",
|
||||
"title.dms": "direct meowchats",
|
||||
"title.groups": "clowder",
|
||||
"title.welcome.splash": "welpaw to Meowven",
|
||||
"desc.welcome.splash": "first Larpix client",
|
||||
"title.splash": "splash",
|
||||
"title.create.dm": "invite to direct meowchat",
|
||||
"title.create.space": "create house",
|
||||
"title.create.group": "create clowder",
|
||||
"title.add.chat": "add meowchat",
|
||||
"desc.add.chat": "add a private, encrypted meowchat by entering a cat name",
|
||||
"desc.create.group": "create a private, encrypted clowder",
|
||||
"placeholder.create.group.input": "my clowder",
|
||||
"placeholder.create.space.input": "my house",
|
||||
"title.name": "name",
|
||||
"desc.create.space": "create a house for your community",
|
||||
"desc.join.space": "join a community that fits you",
|
||||
"title.join.space": "join house",
|
||||
"title.space.id": "house id",
|
||||
"title.inbox": "inbox",
|
||||
"title.invites": "invites",
|
||||
"title.notifications": "notifications",
|
||||
"title.received": "received",
|
||||
"title.sent": "sent",
|
||||
"title.all": "all",
|
||||
"title.unread": "unread",
|
||||
|
||||
"title.sign.up": "sign up",
|
||||
"title.sign.in": "sign in",
|
||||
"title.sign.in.to": "sign in to your larpix instance",
|
||||
"title.server.host": "server host",
|
||||
"title.username": "meow name",
|
||||
"title.password": "meow word",
|
||||
"title.new.here.?": "new here?",
|
||||
"title.create.an.account": "create a cat",
|
||||
"join.larpix": "join Larpix",
|
||||
"title.create.new.account": "create new larpix cat account",
|
||||
"notice.use.strong.pass": "remember to use a strong meow word! tt will be used to lock your collar",
|
||||
"title.confirm.password": "confirm meow word",
|
||||
"title.already.registered.?": "already a kitty?",
|
||||
"title.back.to.login": "back to pawgin",
|
||||
"title.verify": "verify",
|
||||
"title.captcha.desc": "prove you are a kitty",
|
||||
"title.captcha.code": "captcha code",
|
||||
"title.invitation.code": "invitation code",
|
||||
"title.back.to.register": "back to registration",
|
||||
"placeholder.username": "cat name",
|
||||
"placeholder.invitation.code": "invitation code",
|
||||
"placeholder.captcha.code": "captcha code"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -96,7 +96,7 @@
|
|||
}
|
||||
sidebarPfp.src = await getAvatarUrl(username);
|
||||
|
||||
showAction("Authenticating...", "startauth");
|
||||
showAction("action.auth", "startauth");
|
||||
let res = await Auth(username, password);
|
||||
clearAction("startauth");
|
||||
if (res.startsWith("success:")) {
|
||||
|
|
@ -120,9 +120,9 @@
|
|||
try {
|
||||
|
||||
|
||||
showAction("Refreshing dms...", "dmrefresh");
|
||||
let res = await fetchEncrypted("user/dm/list", "");
|
||||
console.log(res);
|
||||
showAction("action.dm.fetch", "dmrefresh");
|
||||
let res = await fetchEncrypted("user/dm/list");
|
||||
|
||||
clearAction("dmrefresh");
|
||||
}
|
||||
catch (e) {
|
||||
|
|
@ -133,9 +133,9 @@
|
|||
|
||||
async function addDm() {
|
||||
try {
|
||||
showAction("Adding...", "dmadd");
|
||||
showAction("action.dm.adding", "dmadd");
|
||||
let res = await fetchEncrypted("user/dm/invite", document.getElementById("addchat-username").value);
|
||||
console.log(res);
|
||||
|
||||
clearAction("dmadd");
|
||||
showBlahNotification(res);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ async function Auth(username, password) {
|
|||
}
|
||||
|
||||
|
||||
async function fetchEncrypted(request, body) {
|
||||
async function fetchEncrypted(request, body = "") {
|
||||
|
||||
let nonce = await getNonce(username, passwordHash);
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ function showAction(message, actionid) {
|
|||
|
||||
const notif = document.createElement('div');
|
||||
notif.className = `notification action`;
|
||||
notif.textContent = message;
|
||||
notif.textContent = processBlah(message);
|
||||
notif.id = `notification-${actionid}`;
|
||||
|
||||
container.appendChild(notif);
|
||||
|
|
@ -964,16 +964,60 @@ function setActiveRoombarItem(itemId) {
|
|||
}
|
||||
}
|
||||
|
||||
function switchInvitesTab(tab) {
|
||||
async function switchInvitesTab(tab) {
|
||||
if (!document.getElementById(`tab-invites-${tab}`).classList.contains('tab-inactive')) return;
|
||||
document.getElementById('tab-invites-received').classList.add('tab-inactive');
|
||||
document.getElementById('tab-invites-sent').classList.add('tab-inactive');
|
||||
document.getElementById(`tab-invites-${tab}`).classList.remove('tab-inactive');
|
||||
|
||||
let container = document.getElementById("invites-container");
|
||||
let innerString = "";
|
||||
|
||||
|
||||
if (tab == "received")
|
||||
if (tab === "received")
|
||||
{
|
||||
|
||||
try {
|
||||
showAction("action.fetching.invites.recv", "fetching.invites.recv");
|
||||
let res = await fetchEncrypted("user/invites/received");
|
||||
if (res !== "")
|
||||
{
|
||||
if (res.includes(",")) {
|
||||
console.log(res);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(res);
|
||||
container.innerHTML = invitesEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
showBlahNotification("error:something.wrong");
|
||||
console.error(e);
|
||||
}
|
||||
clearAction("fetching.invites.recv");
|
||||
}
|
||||
else if (tab === "sent")
|
||||
{
|
||||
try {
|
||||
showAction("action.fetching.invites.sent", "fetching.invites.sent");
|
||||
let res = await fetchEncrypted("user/invites/sent");
|
||||
if (res !== "")
|
||||
{
|
||||
if (res.includes(",")) {
|
||||
console.log(res);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(res);
|
||||
container.innerHTML = invitesEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
showBlahNotification("error:something.wrong");
|
||||
console.error(e);
|
||||
}
|
||||
clearAction("fetching.invites.sent");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,4 +170,6 @@ var addSpaceMenu = `
|
|||
|
||||
//elements
|
||||
var detailsBtn = `<button class="mobile-nav-btn right" onclick="mobileNavDetails()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg></button>`;
|
||||
var backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/></svg></button>`;
|
||||
var backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/></svg></button>`;
|
||||
|
||||
var invitesEntry = `???`;
|
||||
|
|
@ -72,6 +72,14 @@
|
|||
"title.sent": "Sent",
|
||||
"title.all": "All",
|
||||
"title.unread": "Unread",
|
||||
"desc.no.invites": "No invites found",
|
||||
"desc.no.notifications": "No notifications found",
|
||||
|
||||
"action.fetching.invites.sent": "Fetching sent invites...",
|
||||
"action.fetching.invites.recv": "Fetching received invites...",
|
||||
"action.dm.fetch": "Fetching dms...",
|
||||
"action.dm.adding": "Adding...",
|
||||
"action.auth": "Authenticating...",
|
||||
|
||||
"title.sign.up": "Sign Up",
|
||||
"title.sign.in": "Sign In",
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
}
|
||||
sidebarPfp.src = await getAvatarUrl(username);
|
||||
|
||||
showAction("Authenticating...", "startauth");
|
||||
showAction("action.auth", "startauth");
|
||||
let res = await Auth(username, password);
|
||||
clearAction("startauth");
|
||||
if (res.startsWith("success:")) {
|
||||
|
|
@ -120,9 +120,9 @@
|
|||
try {
|
||||
|
||||
|
||||
showAction("Refreshing dms...", "dmrefresh");
|
||||
let res = await fetchEncrypted("user/dm/list", "");
|
||||
console.log(res);
|
||||
showAction("action.dm.fetch", "dmrefresh");
|
||||
let res = await fetchEncrypted("user/dm/list");
|
||||
|
||||
clearAction("dmrefresh");
|
||||
}
|
||||
catch (e) {
|
||||
|
|
@ -133,9 +133,9 @@
|
|||
|
||||
async function addDm() {
|
||||
try {
|
||||
showAction("Adding...", "dmadd");
|
||||
showAction("action.dm.adding", "dmadd");
|
||||
let res = await fetchEncrypted("user/dm/invite", document.getElementById("addchat-username").value);
|
||||
console.log(res);
|
||||
|
||||
clearAction("dmadd");
|
||||
showBlahNotification(res);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ async function Auth(username, password) {
|
|||
}
|
||||
|
||||
|
||||
async function fetchEncrypted(request, body) {
|
||||
async function fetchEncrypted(request, body = "") {
|
||||
|
||||
let nonce = await getNonce(username, passwordHash);
|
||||
|
||||
|
|
@ -420,7 +420,7 @@ function showAction(message, actionid) {
|
|||
|
||||
const notif = document.createElement('div');
|
||||
notif.className = `notification action`;
|
||||
notif.textContent = message;
|
||||
notif.textContent = processBlah(message);
|
||||
notif.id = `notification-${actionid}`;
|
||||
|
||||
container.appendChild(notif);
|
||||
|
|
@ -964,16 +964,60 @@ function setActiveRoombarItem(itemId) {
|
|||
}
|
||||
}
|
||||
|
||||
function switchInvitesTab(tab) {
|
||||
async function switchInvitesTab(tab) {
|
||||
if (!document.getElementById(`tab-invites-${tab}`).classList.contains('tab-inactive')) return;
|
||||
document.getElementById('tab-invites-received').classList.add('tab-inactive');
|
||||
document.getElementById('tab-invites-sent').classList.add('tab-inactive');
|
||||
document.getElementById(`tab-invites-${tab}`).classList.remove('tab-inactive');
|
||||
|
||||
let container = document.getElementById("invites-container");
|
||||
let innerString = "";
|
||||
|
||||
|
||||
if (tab == "received")
|
||||
if (tab === "received")
|
||||
{
|
||||
|
||||
try {
|
||||
showAction("action.fetching.invites.recv", "fetching.invites.recv");
|
||||
let res = await fetchEncrypted("user/invites/received");
|
||||
if (res !== "")
|
||||
{
|
||||
if (res.includes(",")) {
|
||||
console.log(res);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(res);
|
||||
container.innerHTML = invitesEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
showBlahNotification("error:something.wrong");
|
||||
console.error(e);
|
||||
}
|
||||
clearAction("fetching.invites.recv");
|
||||
}
|
||||
else if (tab === "sent")
|
||||
{
|
||||
try {
|
||||
showAction("action.fetching.invites.sent", "fetching.invites.sent");
|
||||
let res = await fetchEncrypted("user/invites/sent");
|
||||
if (res !== "")
|
||||
{
|
||||
if (res.includes(",")) {
|
||||
console.log(res);
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log(res);
|
||||
container.innerHTML = invitesEntry;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
showBlahNotification("error:something.wrong");
|
||||
console.error(e);
|
||||
}
|
||||
clearAction("fetching.invites.sent");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -170,4 +170,6 @@ var addSpaceMenu = `
|
|||
|
||||
//elements
|
||||
var detailsBtn = `<button class="mobile-nav-btn right" onclick="mobileNavDetails()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg></button>`;
|
||||
var backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/></svg></button>`;
|
||||
var backBtnHtml = `<button class="mobile-nav-btn" onclick="mobileNavBack()"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="var(--text-color)"><path d="m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"/></svg></button>`;
|
||||
|
||||
var invitesEntry = `???`;
|
||||
Loading…
Add table
Add a link
Reference in a new issue