Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2016-01-04 23:36:26 -07:00
commit 8bfeba5a18
3 changed files with 45 additions and 16 deletions

View File

@ -50,7 +50,7 @@ function init(configPath, cb) {
//
if(!_.has(mergedConfig, 'messages.areas.') ||
!_.isArray(mergedConfig.messages.areas) ||
0 == mergedConfig.messages.areas.length ||
0 === mergedConfig.messages.areas.length ||
!_.isString(mergedConfig.messages.areas[0].name))
{
var msgAreasErr = new Error('Please create at least one message area');

View File

@ -816,6 +816,29 @@ function FullScreenEditorModule(options) {
self.observeEditorEvents();
};
this.quoteBuilderFinalize = function() {
// :TODO: fix magic #'s
var quoteMsgView = self.viewControllers.quoteBuilder.getView(1);
var msgView = self.viewControllers.body.getView(1);
var quoteLines = quoteMsgView.getData();
if(quoteLines.trim().length > 0) {
msgView.addText(quoteMsgView.getData() + '\n');
}
quoteMsgView.setText('');
var footerName = self.getFooterName();
self.footerMode = 'editor';
self.switchFooter(function switched(err) {
self.switchFromQuoteBuilderToBody();
});
};
this.menuMethods = {
//
@ -893,23 +916,19 @@ function FullScreenEditorModule(options) {
var quoteText = self.viewControllers.quoteBuilder.getView(3).getItem(formData.value.quote);
quoteMsgView.addText(quoteText);
self.viewControllers.quoteBuilder.getView(3).focusNext();
//
// If this is *not* the last item, advance. Otherwise, do nothing as we
// don't want to jump back to the top and repeat already quoted lines
//
var quoteListView = self.viewControllers.quoteBuilder.getView(3);
if(quoteListView.getData() !== quoteListView.getCount() - 1) {
quoteListView.focusNext();
} else {
self.quoteBuilderFinalize();
}
},
quoteBuilderEscPressed : function(formData, extraArgs) {
// :TODO: fix magic #'s
var quoteMsgView = self.viewControllers.quoteBuilder.getView(1);
var msgView = self.viewControllers.body.getView(1);
msgView.addText(quoteMsgView.getData() + '\n');
quoteMsgView.setText('');
var footerName = self.getFooterName();
self.footerMode = 'editor';
self.switchFooter(function switched(err) {
self.switchFromQuoteBuilderToBody();
});
self.quoteBuilderFinalize();
},
/*
replyDiscard : function(formData, extraArgs) {

View File

@ -68,6 +68,16 @@ MenuView.prototype.setItems = function(items) {
}
};
MenuView.prototype.getCount = function() {
return this.items.length;
};
MenuView.prototype.getItems = function() {
return _.map(this.items, function itemIter(i) {
return i.text;
});
};
MenuView.prototype.getItem = function(index) {
return this.items[index].text;
};