mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-04 00:41:56 +02:00
* Message view prev/next
* Message view up/down movement * Some new experimental MCI codes * Put cursor @ top of document in MLTEV preview mode * Fix fse finishedLoading() * Menus can have names, clients have current status
This commit is contained in:
parent
1f3948d84c
commit
6517f50e0c
8 changed files with 64 additions and 90 deletions
|
@ -78,9 +78,9 @@ function FullScreenEditorModule(options) {
|
|||
// editorType : email | area
|
||||
// editorMode : view | edit | quote
|
||||
//
|
||||
// extraArgs:
|
||||
// extraArgs - view mode
|
||||
// messageAreaName
|
||||
// messageNumber / messageTotal
|
||||
// messageIndex / messageTotal
|
||||
//
|
||||
//
|
||||
this.editorType = config.editorType;
|
||||
|
@ -88,7 +88,7 @@ function FullScreenEditorModule(options) {
|
|||
|
||||
if(_.isObject(options.extraArgs)) {
|
||||
this.messageAreaName = options.extraArgs.messageAreaName || Message.WellKnownAreaNames.Private;
|
||||
this.messageNumber = options.extraArgs.messageNumber || 0;
|
||||
this.messageIndex = options.extraArgs.messageIndex || 0;
|
||||
this.messageTotal = options.extraArgs.messageTotal || 0;
|
||||
}
|
||||
|
||||
|
@ -154,6 +154,7 @@ function FullScreenEditorModule(options) {
|
|||
var bodyMessageView = self.viewControllers.body.getView(1);
|
||||
if(bodyMessageView && _.has(self, 'message.message')) {
|
||||
bodyMessageView.setText(self.message.message);
|
||||
//bodyMessageView.redraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -493,7 +494,7 @@ function FullScreenEditorModule(options) {
|
|||
setHeaderText(MCICodeIds.ViewModeHeader.To, self.message.toUserName);
|
||||
setHeaderText(MCICodeIds.ViewModeHeader.Subject, self.message.subject);
|
||||
setHeaderText(MCICodeIds.ViewModeHeader.DateTime, moment(self.message.modTimestamp).format(self.client.currentTheme.helpers.getDateTimeFormat()));
|
||||
setHeaderText(MCICodeIds.ViewModeHeader.MsgNum, self.messageNumber.toString());
|
||||
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');
|
||||
|
|
|
@ -29,6 +29,8 @@ function MCIViewFactory(client) {
|
|||
this.client = client;
|
||||
}
|
||||
|
||||
// :TODO: This portion should be made more generic so pipe code formatting can use it!
|
||||
// e..g MCIPrint() -> enigmaToAnsi() ->
|
||||
MCIViewFactory.prototype.getPredefinedViewLabel = function(code) {
|
||||
|
||||
var self = this;
|
||||
|
@ -38,6 +40,10 @@ MCIViewFactory.prototype.getPredefinedViewLabel = function(code) {
|
|||
return area ? area.desc : '';
|
||||
}
|
||||
|
||||
function getCurrentMenuDescription() {
|
||||
return _.has(self, 'client.currentMenuModule.menuConfig.desc') ? self.client.currentMenuModule.menuConfig.desc : '';
|
||||
}
|
||||
|
||||
try {
|
||||
return {
|
||||
BN : Config.general.boardName,
|
||||
|
@ -57,10 +63,13 @@ MCIViewFactory.prototype.getPredefinedViewLabel = function(code) {
|
|||
UF : this.client.user.properties.affiliation,
|
||||
UT : this.client.user.properties.theme_id,
|
||||
MS : moment(this.client.user.properties.account_created).format(this.client.currentTheme.helpers.getDateFormat()),
|
||||
CS : this.client.currentStatus,
|
||||
MD : getCurrentMenuDescription(),
|
||||
|
||||
MA : getMessageAreaDescription(),
|
||||
|
||||
|
||||
|
||||
SH : this.client.term.termHeight.toString(),
|
||||
SW : this.client.term.termWidth.toString(),
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ function MenuModule(options) {
|
|||
this.menuConfig = options.menuConfig;
|
||||
this.menuConfig.options = options.menuConfig.options || {};
|
||||
this.menuMethods = {}; // methods called from @method's
|
||||
|
||||
|
||||
this.initViewControllers();
|
||||
|
||||
this.initSequence = function() {
|
||||
|
@ -138,16 +138,6 @@ function MenuModule(options) {
|
|||
menuUtil.handleAction(self.client, null, self.menuConfig);
|
||||
}
|
||||
};
|
||||
|
||||
this.setMenuStatus = function(status) {
|
||||
self.menuStatus = status;
|
||||
};
|
||||
|
||||
if(_.isString(this.menuConfig.status)) {
|
||||
self.setMenuStatus(self.menuConfig.status);
|
||||
} else {
|
||||
self.setMenuStatus('Browsing menus');
|
||||
}
|
||||
}
|
||||
|
||||
require('util').inherits(MenuModule, PluginModule);
|
||||
|
@ -158,6 +148,12 @@ MenuModule.prototype.enter = function(client) {
|
|||
this.client = client;
|
||||
assert(_.isObject(client));
|
||||
|
||||
if(_.isString(this.menuConfig.status)) {
|
||||
this.client.currentStatus = this.menuConfig.status;
|
||||
} else {
|
||||
this.client.currentStatus = 'Browsing menus';
|
||||
}
|
||||
|
||||
this.initSequence();
|
||||
};
|
||||
|
||||
|
|
|
@ -1049,8 +1049,14 @@ MultiLineEditTextView.prototype.setFocus = function(focused) {
|
|||
MultiLineEditTextView.prototype.setText = function(text) {
|
||||
//text = require('fs').readFileSync('/home/nuskooler/Downloads/test_text.txt', { encoding : 'utf-8'});
|
||||
|
||||
this.textLines = [ ];
|
||||
this.insertRawText(text);
|
||||
this.cursorEndOfDocument();
|
||||
|
||||
if(this.isEditMode()) {
|
||||
this.cursorEndOfDocument();
|
||||
} else if(this.isPreviewMode()) {
|
||||
this.cursorStartOfDocument();
|
||||
}
|
||||
};
|
||||
|
||||
MultiLineEditTextView.prototype.getData = function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue