mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-28 00:20:48 +00:00
move conversation viewer to own vue component
This commit is contained in:
parent
ec9eb0e0e1
commit
63d1722672
4 changed files with 1184 additions and 1038 deletions
File diff suppressed because it is too large
Load diff
1105
src/frontend/components/messages/ConversationViewer.vue
Normal file
1105
src/frontend/components/messages/ConversationViewer.vue
Normal file
File diff suppressed because it is too large
Load diff
15
src/frontend/js/DialogUtils.js
Normal file
15
src/frontend/js/DialogUtils.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class DialogUtils {
|
||||
|
||||
static alert(message) {
|
||||
if(window.electron){
|
||||
// running inside electron, use ipc alert
|
||||
window.electron.alert(message);
|
||||
} else {
|
||||
// running inside normal browser, use browser alert
|
||||
window.alert(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default DialogUtils;
|
||||
|
|
@ -72,6 +72,28 @@ class Utils {
|
|||
return this.formatSeconds(secondsAgo);
|
||||
}
|
||||
|
||||
static formatSecondsAgo(seconds) {
|
||||
const secondsAgo = Math.round((Date.now() / 1000) - seconds);
|
||||
return this.formatSeconds(secondsAgo);
|
||||
}
|
||||
|
||||
static formatMinutesSeconds(seconds) {
|
||||
const parsedSeconds = this.parseSeconds(seconds);
|
||||
const paddedMinutes = parsedSeconds.minutes.toString().padStart(2, "0");
|
||||
const paddedSeconds = parsedSeconds.seconds.toString().padStart(2, "0");
|
||||
return `${paddedMinutes}:${paddedSeconds}`;
|
||||
}
|
||||
|
||||
static arrayBufferToBase64(arrayBuffer) {
|
||||
var binary = '';
|
||||
var bytes = new Uint8Array(arrayBuffer);
|
||||
var len = bytes.byteLength;
|
||||
for(var i = 0; i < len; i++){
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
}
|
||||
return window.btoa(binary);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Utils;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue