diff --git a/core/fse.js b/core/fse.js index d9081fc0..b6e42118 100644 --- a/core/fse.js +++ b/core/fse.js @@ -7,6 +7,7 @@ var ansi = require('../core/ansi_term.js'); var theme = require('../core/theme.js'); var MultiLineEditTextView = require('../core/multi_line_edit_text_view.js').MultiLineEditTextView; var Message = require('../core/message.js'); +var getMessageAreaByName = require('../core/message_area.js').getMessageAreaByName; var async = require('async'); var assert = require('assert'); @@ -108,7 +109,6 @@ function FullScreenEditorModule(options) { if(_.isObject(options.extraArgs)) { //console.log(options.extraArgs) this.messageAreaName = options.extraArgs.messageAreaName || Message.WellKnownAreaNames.Private; - console.log(this.messageAreaName) this.messageIndex = options.extraArgs.messageIndex || 0; this.messageTotal = options.extraArgs.messageTotal || 0; } @@ -494,6 +494,8 @@ function FullScreenEditorModule(options) { if(self.replyToMessage) { self.initHeaderReplyEditMode(); + } else { + self.initHeaderNewEditMode(); } break; } @@ -568,41 +570,45 @@ function FullScreenEditorModule(options) { } }; + this.setHeaderText = function(id, text) { + var v = self.viewControllers.header.getView(id); + if(v) { + v.setText(text); + } + }; + + this.initHeaderGeneric = function() { + self.setHeaderText(MCICodeIds.ViewModeHeader.AreaName, getMessageAreaByName(self.messageAreaName).desc); + }; + this.initHeaderViewMode = function() { assert(_.isObject(self.message)); - function setHeaderText(id, text) { - var v = self.viewControllers.header.getView(id); - if(v) { - v.setText(text); - } - } + self.initHeaderGeneric(); + + self.setHeaderText(MCICodeIds.ViewModeHeader.From, self.message.fromUserName); + self.setHeaderText(MCICodeIds.ViewModeHeader.To, self.message.toUserName); + self.setHeaderText(MCICodeIds.ViewModeHeader.Subject, self.message.subject); + self.setHeaderText(MCICodeIds.ViewModeHeader.DateTime, moment(self.message.modTimestamp).format(self.client.currentTheme.helpers.getDateTimeFormat())); + self.setHeaderText(MCICodeIds.ViewModeHeader.MsgNum, (self.messageIndex + 1).toString()); + self.setHeaderText(MCICodeIds.ViewModeHeader.MsgTotal, self.messageTotal.toString()); + self.setHeaderText(MCICodeIds.ViewModeHeader.ViewCount, self.message.viewCount); + self.setHeaderText(MCICodeIds.ViewModeHeader.HashTags, 'TODO hash tags'); + self.setHeaderText(MCICodeIds.ViewModeHeader.MessageID, self.message.messageId); + self.setHeaderText(MCICodeIds.ViewModeHeader.ReplyToMsgID, self.message.replyToMessageId); + }; - setHeaderText(MCICodeIds.ViewModeHeader.From, self.message.fromUserName); - setHeaderText(MCICodeIds.ViewModeHeader.To, self.message.toUserName); - setHeaderText(MCICodeIds.ViewModeHeader.Subject, self.message.subject); - setHeaderText(MCICodeIds.ViewModeHeader.AreaName, self.messageAreaName); - setHeaderText(MCICodeIds.ViewModeHeader.DateTime, moment(self.message.modTimestamp).format(self.client.currentTheme.helpers.getDateTimeFormat())); - setHeaderText(MCICodeIds.ViewModeHeader.MsgNum, (self.messageIndex + 1).toString()); - setHeaderText(MCICodeIds.ViewModeHeader.MsgTotal, self.messageTotal.toString()); - setHeaderText(MCICodeIds.ViewModeHeader.ViewCount, self.message.viewCount); - setHeaderText(MCICodeIds.ViewModeHeader.HashTags, 'TODO hash tags'); - setHeaderText(MCICodeIds.ViewModeHeader.MessageID, self.message.messageId); - setHeaderText(MCICodeIds.ViewModeHeader.ReplyToMsgID, self.message.replyToMessageId); + this.initHeaderNewEditMode = function() { + self.initHeaderGeneric(); }; this.initHeaderReplyEditMode = function() { assert(_.isObject(self.replyToMessage)); - function setHeaderText(id, text) { - var v = self.viewControllers.header.getView(id); - if(v) { - v.setText(text); - } - } + self.initHeaderGeneric(); - setHeaderText(MCICodeIds.ReplyEditModeHeader.To, self.replyToMessage.fromUserName); - setHeaderText(MCICodeIds.ReplyEditModeHeader.Subject, 'RE: ' + self.replyToMessage.subject); + self.setHeaderText(MCICodeIds.ReplyEditModeHeader.To, self.replyToMessage.fromUserName); + self.setHeaderText(MCICodeIds.ReplyEditModeHeader.Subject, 'RE: ' + self.replyToMessage.subject); }; diff --git a/core/menu_util.js b/core/menu_util.js index 401c94f8..46a3c814 100644 --- a/core/menu_util.js +++ b/core/menu_util.js @@ -296,6 +296,7 @@ function applyThemeCustomization(options) { } if(themeConfig.mci) { + console.log('>>>>>>>>>>>>>>>>>>>>>>> ' + options.name) Object.keys(themeConfig.mci).forEach(function mciEntry(mci) { _.defaults(options.mci[mci], themeConfig.mci[mci]); }); diff --git a/core/message_area.js b/core/message_area.js index b99e6bbb..a54032d2 100644 --- a/core/message_area.js +++ b/core/message_area.js @@ -29,7 +29,6 @@ function getMessageAreaByName(areaName) { areaName = areaName.toLowerCase(); var availAreas = getAvailableMessageAreas(); - console.log(availAreas) var index = _.findIndex(availAreas, function pred(an) { return an.name == areaName; }); diff --git a/core/theme.js b/core/theme.js index b09c6b98..3933a161 100644 --- a/core/theme.js +++ b/core/theme.js @@ -196,7 +196,6 @@ function getThemeArt(options, cb) { if(artInfo || Config.defaults.theme === options.themeId) { callback(null, artInfo); } else { - console.log('trying default theme') options.basePath = paths.join(Config.paths.themes, Config.defaults.theme); art.getArt(options.name, options, function artLoaded(err, artInfo) { @@ -208,17 +207,20 @@ function getThemeArt(options, cb) { if(artInfo) { callback(null, artInfo); } else { - console.log('using general art dir') options.basePath = Config.paths.art; art.getArt(options.name, options, function artLoaded(err, artInfo) { - console.log('cannot find art: ' + options.name) callback(err, artInfo); }); } } ], - cb // cb(err, artInfo) + function complete(err, artInfo) { + if(err) { + options.client.log.debug( { error : err }, 'Cannot find art'); + } + cb(err, artInfo); + } ); } diff --git a/mods/menu.hjson b/mods/menu.hjson index aaa83b04..b6377cd0 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -586,18 +586,17 @@ "0" : { "mci" : { "TL1" : { - "width" : 27 + // "width" : 27 }, "TL2" : { - "width" : 27 + // "width" : 27 }, "TL3" : { - //"width" : 39, //"width" : 27, //"textOverflow" : "..." }, "TL5" : { - "width" : 27 + // "width" : 27 }, "MA5" : { "width" : 27, @@ -743,29 +742,29 @@ mci: { // :TODO: use appropriate system properties for these lenghts TL1: { - width: 27 + //width: 27 argName: from } ET2: { - width: 27 + //width: 27 argName: to focus: true } ET3: { - width: 27 + //width: 27 argName: subject maxLength: 72 submit: true - textOverflow: ... + //textOverflow: ... } TL4: { // :TODO: this is for RE: line (NYI) - width: 27 - textOverflow: ... + //width: 27 + //textOverflow: ... } MA5: { - width: 27 - textOverflow: ... + //width: 27 + //textOverflow: ... } } submit: { @@ -900,24 +899,24 @@ "0" : { mci: { TL1: { - width: 27 + //width: 27 argName: from } ET2: { - width: 27 + //width: 27 argName: to focus: true text: All } "ET3" : { - "width" : 27, + //"width" : 27, "argName" : "subject", "maxLength" : 72, "submit" : true }, "MA5" : { - "width" : 27, - "textOverflow" : "..." + //"width" : 27, + //"textOverflow" : "..." } }, "submit" : { diff --git a/mods/themes/luciano_blocktronics/MSGEFTR.ANS b/mods/themes/luciano_blocktronics/MSGEFTR.ANS index bfa907df..f4b4f1ac 100644 Binary files a/mods/themes/luciano_blocktronics/MSGEFTR.ANS and b/mods/themes/luciano_blocktronics/MSGEFTR.ANS differ diff --git a/mods/themes/luciano_blocktronics/MSGQUOT.ANS b/mods/themes/luciano_blocktronics/MSGQUOT.ANS index ebd09905..d313b228 100644 Binary files a/mods/themes/luciano_blocktronics/MSGQUOT.ANS and b/mods/themes/luciano_blocktronics/MSGQUOT.ANS differ diff --git a/mods/themes/luciano_blocktronics/MSGVHLP.ANS b/mods/themes/luciano_blocktronics/MSGVHLP.ANS new file mode 100644 index 00000000..f3fffd9d Binary files /dev/null and b/mods/themes/luciano_blocktronics/MSGVHLP.ANS differ diff --git a/mods/themes/luciano_blocktronics/theme.hjson b/mods/themes/luciano_blocktronics/theme.hjson index 24970aae..caa6101e 100644 --- a/mods/themes/luciano_blocktronics/theme.hjson +++ b/mods/themes/luciano_blocktronics/theme.hjson @@ -68,6 +68,39 @@ dateTimeFormat: MMM Do H:mm a } } + + messageAreaViewPost: { + 0: { + mci: { + TL1: { width: 19, textOverflow: "..." } + TL2: { width: 19, textOverflow: "..." } + TL3: { width: 19, textOverflow: "..." } + TL5: { width: 19, textOverflow: "..." } + } + } + } + + messageAreaNewPost: { + 0: { + mci: { + TL1: { width: 19, textOverflow: "..." } + ET2: { width: 19, textOverflow: "..." } + ET3: { width: 19, textOverflow: "..." } + //TL4: { width: 25 } + } + } + } + + messageAreaReplyPost: { + 0: { + mci: { + TL1: { width: 19, textOverflow: "..." } + ET2: { width: 19, textOverflow: "..." } + ET3: { width: 19, textOverflow: "..." } + TL4: { width: 25, textOverflow: "..." } + } + } + } } } } \ No newline at end of file