* Use pre-release of string-format with Python like widths/etc.

* Very minor updates to message list
This commit is contained in:
Bryan Ashby 2015-10-09 20:46:28 -06:00
parent 0fd9df3821
commit a6cd6bd3b9
3 changed files with 10 additions and 16 deletions

View File

@ -530,8 +530,7 @@
}, },
"messageAreaMessageList" : { "messageAreaMessageList" : {
"module" : "msg_list", "module" : "msg_list",
"art" : "msg_list", "art" : "msg_list"
"fallback" : "messageArea",
"config" : { "config" : {
"listType" : "public" "listType" : "public"
}, },
@ -556,7 +555,7 @@
}, },
"actionKeys" : [ "actionKeys" : [
{ {
"keys" : [ "escape" ], "keys" : [ "escape", "q", "shift + q" ],
"action" : "@menu:messageArea" "action" : "@menu:messageArea"
} }
] ]
@ -710,11 +709,9 @@
focus: true focus: true
} }
ET3: { ET3: {
//width: 27
argName: subject argName: subject
maxLength: 72 maxLength: 72
submit: true submit: true
//textOverflow: ...
} }
TL4: { TL4: {
// :TODO: this is for RE: line (NYI) // :TODO: this is for RE: line (NYI)
@ -733,10 +730,10 @@
1: { 1: {
mci: { mci: {
MT1: { MT1: {
width: 79 width: 79
height: 14 height: 14
argName: message argName: message
mode: edit mode: edit
} }
} }
submit: { submit: {
@ -767,7 +764,6 @@
{ {
value: { 1: 1 } value: { 1: 1 }
action: @systemMethod:fallbackMenu action: @systemMethod:fallbackMenu
//action: @method:replyDiscard
} }
{ {
value: { 1: 2 }, value: { 1: 2 },
@ -791,7 +787,6 @@
} }
{ {
keys: [ "d", "shift + d" ] keys: [ "d", "shift + d" ]
//action: @method:replyDiscard
action: @systemMethod:fallbackMenu action: @systemMethod:fallbackMenu
} }
{ {

View File

@ -112,14 +112,12 @@ MessageListModule.prototype.mciReady = function(mciData, cb) {
function populateList(callback) { function populateList(callback) {
var msgListView = vc.getView(1); var msgListView = vc.getView(1);
// :TODO: {name!over5}, ...over6, over7... -> "text..." for format()
var msgNum = 1; var msgNum = 1;
msgListView.setItems(_.map(self.messageList, function formatMsgListEntry(mle) { msgListView.setItems(_.map(self.messageList, function formatMsgListEntry(mle) {
return '{msgNum} - {subj} {to}'.format( { return '{msgNum:>4} - {subj:>25} {to:>15}'.format( {
msgNum : msgNum++, msgNum : msgNum++,
subj : mle.subject, subj : mle.subject,
to : mle.toUsername to : mle.toUserName
} ); } );
})); }));
@ -131,6 +129,7 @@ MessageListModule.prototype.mciReady = function(mciData, cb) {
function complete(err) { function complete(err) {
if(err) { if(err) {
// :TODO: log this properly // :TODO: log this properly
// :TODO: use fallbackMenuModule() here
self.client.gotoMenuModule( { name : self.menuConfig.fallback } ); self.client.gotoMenuModule( { name : self.menuConfig.fallback } );
console.log(err) console.log(err)
} }

View File

@ -17,7 +17,7 @@
"gaze" : "0.5.x", "gaze" : "0.5.x",
"mkdirp" : "0.5.x", "mkdirp" : "0.5.x",
"pty.js" : "0.3.x", "pty.js" : "0.3.x",
"string-format" : "0.5.x", "string-format" : "davidchambers/string-format#mini-language",
"hjson" : "1.7.x" "hjson" : "1.7.x"
}, },
"engine" : "node >= 0.12.2" "engine" : "node >= 0.12.2"