From a6cd6bd3b9ea304182c00e489512aa346da900e2 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 9 Oct 2015 20:46:28 -0600 Subject: [PATCH] * Use pre-release of string-format with Python like widths/etc. * Very minor updates to message list --- mods/menu.hjson | 17 ++++++----------- mods/msg_list.js | 7 +++---- package.json | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/mods/menu.hjson b/mods/menu.hjson index 78307e5d..eef2b59a 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -530,8 +530,7 @@ }, "messageAreaMessageList" : { "module" : "msg_list", - "art" : "msg_list", - "fallback" : "messageArea", + "art" : "msg_list" "config" : { "listType" : "public" }, @@ -556,7 +555,7 @@ }, "actionKeys" : [ { - "keys" : [ "escape" ], + "keys" : [ "escape", "q", "shift + q" ], "action" : "@menu:messageArea" } ] @@ -710,11 +709,9 @@ focus: true } ET3: { - //width: 27 argName: subject maxLength: 72 submit: true - //textOverflow: ... } TL4: { // :TODO: this is for RE: line (NYI) @@ -733,10 +730,10 @@ 1: { mci: { MT1: { - width: 79 - height: 14 - argName: message - mode: edit + width: 79 + height: 14 + argName: message + mode: edit } } submit: { @@ -767,7 +764,6 @@ { value: { 1: 1 } action: @systemMethod:fallbackMenu - //action: @method:replyDiscard } { value: { 1: 2 }, @@ -791,7 +787,6 @@ } { keys: [ "d", "shift + d" ] - //action: @method:replyDiscard action: @systemMethod:fallbackMenu } { diff --git a/mods/msg_list.js b/mods/msg_list.js index 4f394ef5..288f15b3 100644 --- a/mods/msg_list.js +++ b/mods/msg_list.js @@ -112,14 +112,12 @@ MessageListModule.prototype.mciReady = function(mciData, cb) { function populateList(callback) { var msgListView = vc.getView(1); - // :TODO: {name!over5}, ...over6, over7... -> "text..." for format() - var msgNum = 1; msgListView.setItems(_.map(self.messageList, function formatMsgListEntry(mle) { - return '{msgNum} - {subj} {to}'.format( { + return '{msgNum:>4} - {subj:>25} {to:>15}'.format( { msgNum : msgNum++, subj : mle.subject, - to : mle.toUsername + to : mle.toUserName } ); })); @@ -131,6 +129,7 @@ MessageListModule.prototype.mciReady = function(mciData, cb) { function complete(err) { if(err) { // :TODO: log this properly + // :TODO: use fallbackMenuModule() here self.client.gotoMenuModule( { name : self.menuConfig.fallback } ); console.log(err) } diff --git a/package.json b/package.json index b2b6ebdf..f1cbfa7f 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "gaze" : "0.5.x", "mkdirp" : "0.5.x", "pty.js" : "0.3.x", - "string-format" : "0.5.x", + "string-format" : "davidchambers/string-format#mini-language", "hjson" : "1.7.x" }, "engine" : "node >= 0.12.2"