summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorrstular <rok@stular.eu>2020-05-15 02:03:18 +0200
committerrstular <rok@stular.eu>2020-05-15 02:03:47 +0200
commit662437081064d2addc3cb003855409403d4ec12f (patch)
tree50bda414b81af15d62231aa9e35c167c88d9068b /js
parentMerge branch 'dev' of github.com:beziapp/beziapp.github.io into dev (diff)
downloadbeziapp-662437081064d2addc3cb003855409403d4ec12f.tar
beziapp-662437081064d2addc3cb003855409403d4ec12f.tar.gz
beziapp-662437081064d2addc3cb003855409403d4ec12f.tar.bz2
beziapp-662437081064d2addc3cb003855409403d4ec12f.tar.lz
beziapp-662437081064d2addc3cb003855409403d4ec12f.tar.xz
beziapp-662437081064d2addc3cb003855409403d4ec12f.tar.zst
beziapp-662437081064d2addc3cb003855409403d4ec12f.zip
Diffstat (limited to 'js')
-rw-r--r--js/chats.js4
-rw-r--r--js/lang/bundle.js4
-rw-r--r--js/messaging.js40
3 files changed, 24 insertions, 24 deletions
diff --git a/js/chats.js b/js/chats.js
index 3073ac9..c60991e 100644
--- a/js/chats.js
+++ b/js/chats.js
@@ -133,7 +133,7 @@ async function sendMessage(recipient_number = null, body = null) {
try {
let gsecInstance = new gsec();
gsecInstance.login(username, password).then( () => {
- gsecInstance.sendMessage(recipient_number, "beziapp-ctlmsg-chat-" + body, "BežiApp chat: " + body).then((value) => {
+ gsecInstance.sendMessage(recipient_number, "ba-ctlmsg-chat-" + body, "BežiApp chat: " + body).then((value) => {
addMessage(0, body);
setLoading(false);
}).catch((err) => {
@@ -402,7 +402,7 @@ async function startLoadingMessagesForCategory(gsecInstance, category, lastpage)
async function renderMessages(gsecMsgList, whom, order = 1) { // order: 1=newest>olest 0=oldest>newest 2=autodetect (todo-not implemented)
for (const message of gsecMsgList) { // whom: 0=me 1=you
- if (message.subject.substring(0, 20) === "beziapp-ctlmsg-chat-") {
+ if (message.subject.substring(0, 20) === "ba-ctlmsg-chat-") {
addMessage(whom, message.subject.substring(20), 2, message.date.getTime);
}
}
diff --git a/js/lang/bundle.js b/js/lang/bundle.js
index e7dc1e6..4103f7b 100644
--- a/js/lang/bundle.js
+++ b/js/lang/bundle.js
@@ -199,7 +199,7 @@ var langstrings = {
messageStorageUsed: "message storage used in this folder",
maxMessagesNote: "you can only have 120 messages per message folder, older messages will not be shown. Remember to delete read and sent messages regulary to avoid any issues.",
loadMessageBody: "load message body",
- thisMessageWasEncrypted: "this message was encrypted by BežiApp",
+ thisMessageWasEncrypted: "this message was encrypted",
enterPassword: "enter password",
decrypt: "decrypt",
nameDirectoryNotSet: "name directory not set, sending unavailable",
@@ -382,7 +382,7 @@ var langstrings = {
messageStorageUsed: "zasedenost shrambe sporočil v tej mapi",
maxMessagesNote: "v vsaki mapi imate lahko največ 120 sporočil. Starejša sporočila ne bodo prikazana. Redno brišite sporočila, da se izognete morebitnim težavam.",
loadMessageBody: "naloži telo sporočila",
- thisMessageWasEncrypted: "to sporočilo je šifriral BežiApp",
+ thisMessageWasEncrypted: "to sporočilo je šifrirano",
enterPassword: "vnesite geslo",
decrypt: "dešifriraj",
nameDirectoryNotSet: "imenik ni nastavljen, pošiljanje ni mogoče",
diff --git a/js/messaging.js b/js/messaging.js
index 56812e4..3355297 100644
--- a/js/messaging.js
+++ b/js/messaging.js
@@ -1,7 +1,7 @@
const API_ENDPOINT = "https://gimb.tk/test.php";
const DIRECTORY_URL = "/directory.json";
-const ENCRYPTED_MESSAGE_REGEX = /<!-- beziapp-e2eemsg-(\d{4}) -->(\S+?)<!-- end-msg -->/g;
+const ENCRYPTED_MESSAGE_REGEX = /<!-- ba-e2eemsg-(\d{4}) -->(\S+?)<!-- end-msg -->/g;
// "Global" object for name directory and messages
var directory = null;
@@ -263,25 +263,25 @@ function displayMessage(id, data) {
var randomencdivid = Math.floor(Math.random() * 9999).toString().padStart(4, "0");
var msgcontent = `
- <div id='beziapp-msg-e2ee-form-${randomencdivid}'>
+ <div id='ba-msg-e2ee-form-${randomencdivid}'>
${D("thisMessageWasEncrypted")}
- <input type="password" autocomplete="new-password" id="beziapp-msg-e2ee-password-${randomencdivid}" placeholder="${S("password")} ...">
+ <input type="password" autocomplete="new-password" id="ba-msg-e2ee-password-${randomencdivid}" placeholder="${S("password")} ...">
<button
type="button"
value="Decrypt"
class="btn waves-effect waves-light"
onclick="
try {
- $('#beziapp-msg-e2ee-content-${randomencdivid}').html(
+ $('#ba-msg-e2ee-content-${randomencdivid}').html(
filterXSS(
sjcl.decrypt(
- $('#beziapp-msg-e2ee-password-${randomencdivid}').val(),
- $('#beziapp-msg-e2ee-content-${randomencdivid}').html()
+ $('#ba-msg-e2ee-password-${randomencdivid}').val(),
+ $('#ba-msg-e2ee-content-${randomencdivid}').html()
)
)
);
- $('#beziapp-msg-e2ee-content-${randomencdivid}').show();
- $('#beziapp-msg-e2ee-form-${randomencdivid}').hide();
+ $('#ba-msg-e2ee-content-${randomencdivid}').show();
+ $('#ba-msg-e2ee-form-${randomencdivid}').hide();
} catch (err) {
alert('${D("incorrectPassword")}');
}
@@ -290,7 +290,7 @@ function displayMessage(id, data) {
${S("decrypt")}
</button>
</div>
- <div id="beziapp-msg-e2ee-content-${randomencdivid}" hidden>
+ <div id="ba-msg-e2ee-content-${randomencdivid}" hidden>
${datatodecrypt}
</div>
`
@@ -322,7 +322,7 @@ function displayData(messageType) {
let msg_list = $(div_selector);
msg_list.html("");
messages[messageType.toString()].forEach(element => {
- if (!element["zadeva"].startsWith("beziapp-ctlmsg")) {
+ if (!element["zadeva"].startsWith("ba-ctlmsg")) {
msg_list.append(`
<div class="col s12 m12" id="msg_box-${filterXSS(element["id"])}">
@@ -504,27 +504,27 @@ function setupEventListeners() {
var encrypted_message = sjcl.encrypt($("#msg-e2ee-pass-input").val(), msgcontent);
msgcontent = `
<script src="${addrparts[0]}//${addrparts[2]}/js/lib/sjcl.js"></script>
- <div id="beziapp-msg-e2ee-form-${randomencdivid}">
+ <div id="ba-msg-e2ee-form-${randomencdivid}">
This message was encrypted by BežiApp.
- <input type="password" autocomplete="new-password" id="beziapp-msg-e2ee-password-${randomencdivid}" placeholder="Enter password ...">
+ <input type="password" autocomplete="new-password" id="ba-msg-e2ee-password-${randomencdivid}" placeholder="Enter password ...">
<input type="button" value="Decrypt" onclick="
try {
- console.log($('beziapp-msg-e2ee-content-${randomencdivid}').text());
- $('#beziapp-msg-e2ee-content-${randomencdivid}').html(
+ console.log($('ba-msg-e2ee-content-${randomencdivid}').text());
+ $('#ba-msg-e2ee-content-${randomencdivid}').html(
sjcl.decrypt(
- $('#beziapp-msg-e2ee-password-${randomencdivid}').val(),
- $('#beziapp-msg-e2ee-content-${randomencdivid}').text()
+ $('#ba-msg-e2ee-password-${randomencdivid}').val(),
+ $('#ba-msg-e2ee-content-${randomencdivid}').text()
)
);
- $('#beziapp-msg-e2ee-content-${randomencdivid}').show();
- $('#beziapp-msg-e2ee-form-${randomencdivid}').hide();
+ $('#ba-msg-e2ee-content-${randomencdivid}').show();
+ $('#ba-msg-e2ee-form-${randomencdivid}').hide();
} catch(err) {
alert('${D("incorrectPassword")}');
}
">
</div>
- <div id="beziapp-msg-e2ee-content-${randomencdivid}" hidden>
- <!-- beziapp-e2eemsg-${msgcontent.length.toString().padStart(4, "0")} -->${encrypted_message}<!-- end-msg -->
+ <div id="ba-msg-e2ee-content-${randomencdivid}" hidden>
+ <!-- ba-e2eemsg-${msgcontent.length.toString().padStart(4, "0")} -->${encrypted_message}<!-- end-msg -->
</div>
`
}