Add README and app icon.

master
Bryan 2025-08-20 07:51:54 -06:00
parent 09f652df3c
commit d3474965ca
6 changed files with 847 additions and 848 deletions

4
README.md Normal file
View File

@ -0,0 +1,4 @@
# Message Center
- Groups messages from same sender.
- Scroll through all current messages.

BIN
icons8-chat-room-48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 400 B

View File

@ -104,17 +104,15 @@
this.numLines = 0;
let mnum = 0;
for (msg of this.messageGroup.bodies) {
this.messages[mnum] = g.wrapString(msg, messageRect.w - options.margin);
this.numLines += this.messages[mnum].length;
this.messages[mnum] = {
msg: g.wrapString(msg, messageRect.w - options.margin),
offset: this.numLines * this.lineH
}
this.numLines += this.messages[mnum].msg.length;
mnum++;
}
this.scrollY = 0;
console.log("options.fh: ", options.fh);
console.log("lineH: ", this.lineH);
console.log("numLines", this.numLines);
console.log("messageRect.y2", messageRect.y2);
this.minY = (messageRect.y2 - options.fh - (this.lineH * (this.numLines))); // can't for the life of me figure out why I'm having to +1 the num of lines
console.log("minY", this.minY);
if (this.minY > 0) this.minY = 0;
}; // TextBox
@ -132,7 +130,7 @@
g.drawLine(x2 - 20, y + lineY - 5, x2, y + lineY - 10)
.drawLine(x2 - 20, y + lineY - 5, x2, y + lineY);
//.drawLine(x, y+lineY, x, y+(this.lineH*this.messages[msgNum].length));
for (let line of this.messages[msgNum]) {
for (let line of this.messages[msgNum].msg) {
if (y + lineY >= y - this.lineH) g.drawString(line, x + options.margin, y + lineY);
lineY += this.lineH;
}

View File

@ -296,17 +296,6 @@ let showCall = function() {
});
};
// let catMessages = function(messageGroup) {
// let msg = "";
// let first = true;
// messageGroup.forEach((m => {
// msg = msg.subject ? msg.subject + "\n" : "";
// msg = msg + (first ? "" : "\n>\n") + m.body;
// first = false;
// }));
// return msg;
// };
let gid = m => m.title + m.src; // create unique group id
let groupMessages = function(messages) {
@ -316,8 +305,9 @@ let groupMessages = function(messages) {
while (msgs.length) {
let currentMessage = msgs[0];
let mg = msgs.filter(m => gid(m) === gid(currentMessage)); // put messages into group
let messageGroup = Object.assign({}, currentMessage, {id: gid(currentMessage), idList: [], bodies: []});
for (msg of mg) {
let messageGroup = Object.assign({}, currentMessage, { id: gid(currentMessage), idList: [], bodies: [], new: [] });
for (let msg of mg) {
messageGroup.new.unshift(msg.new);
messageGroup.idList.unshift(msg.id);
messageGroup.bodies.unshift(msg.body);
}
@ -592,6 +582,9 @@ let showText = function(messages, id) {
setBusy(true);
// TODO let idx = msgBoxes.findIndex(mb => mb.msg.id === msgBoxes[messageNum].msg.id); // TODO maybe we don't to do this check every time
// TODO if (idx >= 0) delete Bangle.MESSAGES[idx].new;
// TODO for (msg of msgBoxes[messageNum].m)
// TODO msgBoxes[messageNum].clearNew();
if (Math.abs(e.dy) > Math.abs(e.dx)) {
firstTouch = false;

1
messagecenter.img Normal file
View File

@ -0,0 +1 @@
atob("MDDCAP//viRSJhslAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKqqqqqqqqgAAAAACqqqqqqqqqqAAAAACqqqqqqqqqqAAAAAKqqqqqqqqqqgAAAAKqqqqqqqqqqgAAAAKqqqqqqqqqqgAAABVVVVVVVVeqqgAAAVVVVVVVVVV6qgAAAVVVVVVVVVVaqgAABVVVVVVVVVVeqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqAAABVVVVVVVVVVWqAAABVVVVVVVVVVWgAAABVVVVVVVVVVUAAAABVVVVVVVVVVUAAAABVVVVVVVVVVUAAAABVVVVVVVVVVQAAAABVVVVVVVVVVQAAAABVVVVVVVVVUAAAAABVUAAAAAAAAAAAAABVQAAAAAAAAAAAAABVAAAAAAAAAAAAAABUAAAAAAAAAAAAAABQAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")

View File

@ -1,5 +1,8 @@
{
"id":"messagecenter",
"name":"Message Center",
"src": "messagecenter.app.js"
"type":"tool",
"version":"0.1",
"tags":"tool,system",
"files":"messages.info, messagebox, messagecenter.app.js, messagecenter.boot.js, messagecenter.notify.js, messagegui"
}