Add README and app icon.
parent
09f652df3c
commit
d3474965ca
|
|
@ -0,0 +1,4 @@
|
||||||
|
# Message Center
|
||||||
|
|
||||||
|
- Groups messages from same sender.
|
||||||
|
- Scroll through all current messages.
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 400 B |
|
|
@ -104,17 +104,15 @@
|
||||||
this.numLines = 0;
|
this.numLines = 0;
|
||||||
let mnum = 0;
|
let mnum = 0;
|
||||||
for (msg of this.messageGroup.bodies) {
|
for (msg of this.messageGroup.bodies) {
|
||||||
this.messages[mnum] = g.wrapString(msg, messageRect.w - options.margin);
|
this.messages[mnum] = {
|
||||||
this.numLines += this.messages[mnum].length;
|
msg: g.wrapString(msg, messageRect.w - options.margin),
|
||||||
|
offset: this.numLines * this.lineH
|
||||||
|
}
|
||||||
|
this.numLines += this.messages[mnum].msg.length;
|
||||||
mnum++;
|
mnum++;
|
||||||
}
|
}
|
||||||
this.scrollY = 0;
|
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
|
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;
|
if (this.minY > 0) this.minY = 0;
|
||||||
}; // TextBox
|
}; // TextBox
|
||||||
|
|
||||||
|
|
@ -132,7 +130,7 @@
|
||||||
g.drawLine(x2 - 20, y + lineY - 5, x2, y + lineY - 10)
|
g.drawLine(x2 - 20, y + lineY - 5, x2, y + lineY - 10)
|
||||||
.drawLine(x2 - 20, y + lineY - 5, x2, y + lineY);
|
.drawLine(x2 - 20, y + lineY - 5, x2, y + lineY);
|
||||||
//.drawLine(x, y+lineY, x, y+(this.lineH*this.messages[msgNum].length));
|
//.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);
|
if (y + lineY >= y - this.lineH) g.drawString(line, x + options.margin, y + lineY);
|
||||||
lineY += this.lineH;
|
lineY += this.lineH;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 gid = m => m.title + m.src; // create unique group id
|
||||||
|
|
||||||
let groupMessages = function(messages) {
|
let groupMessages = function(messages) {
|
||||||
|
|
@ -316,8 +305,9 @@ let groupMessages = function(messages) {
|
||||||
while (msgs.length) {
|
while (msgs.length) {
|
||||||
let currentMessage = msgs[0];
|
let currentMessage = msgs[0];
|
||||||
let mg = msgs.filter(m => gid(m) === gid(currentMessage)); // put messages into group
|
let mg = msgs.filter(m => gid(m) === gid(currentMessage)); // put messages into group
|
||||||
let messageGroup = Object.assign({}, currentMessage, {id: gid(currentMessage), idList: [], bodies: []});
|
let messageGroup = Object.assign({}, currentMessage, { id: gid(currentMessage), idList: [], bodies: [], new: [] });
|
||||||
for (msg of mg) {
|
for (let msg of mg) {
|
||||||
|
messageGroup.new.unshift(msg.new);
|
||||||
messageGroup.idList.unshift(msg.id);
|
messageGroup.idList.unshift(msg.id);
|
||||||
messageGroup.bodies.unshift(msg.body);
|
messageGroup.bodies.unshift(msg.body);
|
||||||
}
|
}
|
||||||
|
|
@ -592,6 +582,9 @@ let showText = function(messages, id) {
|
||||||
setBusy(true);
|
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 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 if (idx >= 0) delete Bangle.MESSAGES[idx].new;
|
||||||
|
// TODO for (msg of msgBoxes[messageNum].m)
|
||||||
|
|
||||||
|
|
||||||
// TODO msgBoxes[messageNum].clearNew();
|
// TODO msgBoxes[messageNum].clearNew();
|
||||||
if (Math.abs(e.dy) > Math.abs(e.dx)) {
|
if (Math.abs(e.dy) > Math.abs(e.dx)) {
|
||||||
firstTouch = false;
|
firstTouch = false;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
atob("MDDCAP//viRSJhslAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKqqqqqqqqgAAAAACqqqqqqqqqqAAAAACqqqqqqqqqqAAAAAKqqqqqqqqqqgAAAAKqqqqqqqqqqgAAAAKqqqqqqqqqqgAAABVVVVVVVVeqqgAAAVVVVVVVVVV6qgAAAVVVVVVVVVVaqgAABVVVVVVVVVVeqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqgAABVVVVVVVVVVWqAAABVVVVVVVVVVWqAAABVVVVVVVVVVWgAAABVVVVVVVVVVUAAAABVVVVVVVVVVUAAAABVVVVVVVVVVUAAAABVVVVVVVVVVQAAAABVVVVVVVVVVQAAAABVVVVVVVVVUAAAAABVUAAAAAAAAAAAAABVQAAAAAAAAAAAAABVAAAAAAAAAAAAAABUAAAAAAAAAAAAAABQAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
{
|
{
|
||||||
"id":"messagecenter",
|
"id":"messagecenter",
|
||||||
"name":"Message Center",
|
"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"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue