mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 19:20:41 +02:00
* Some code cleanup
* Lots of notes/thoughts
This commit is contained in:
parent
e8346779da
commit
3f92a7949d
6 changed files with 157 additions and 41 deletions
|
@ -184,23 +184,15 @@ function ViewController(options) {
|
|||
setViewProp('maxLength');
|
||||
setViewProp('width', function(v) { view.dimens.width = parseInt(v, 10); });
|
||||
|
||||
setViewProp('styleSGR1', function(v) {
|
||||
if(_.isObject(v)) {
|
||||
view.styleSGR1 = ansi.getSGRFromGraphicRendition(v, true);
|
||||
console.log(view.styleSGR1.substr(1))
|
||||
} else if(_.isString(v)) {
|
||||
view.styleSGR1 = v;
|
||||
}
|
||||
});
|
||||
|
||||
setViewProp('styleSGR2', function(v) {
|
||||
if(_.isObject(v)) {
|
||||
view.styleSGR2 = ansi.getSGRFromGraphicRendition(v, true);
|
||||
} else if(_.isString(v)) {
|
||||
view.styleSGR2 = v;
|
||||
}
|
||||
});
|
||||
|
||||
['styleSGR1', 'styleSGR2'].forEach(function styleSgr(style) {
|
||||
setViewProp(style, function(v) {
|
||||
if(_.isObject(v)) {
|
||||
view.styleSGR1 = ansi.getSGRFromGraphicRendition(v, true);
|
||||
} else if(_.isString(v)) {
|
||||
view.styleSGR1 = v;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
setViewProp('fillChar', function(v) {
|
||||
if(_.isNumber(v)) {
|
||||
|
@ -397,10 +389,14 @@ ViewController.prototype.loadFromPromptConfig = function(options, cb) {
|
|||
});
|
||||
},
|
||||
function applyViewConfiguration(callback) {
|
||||
self.applyViewConfig(promptConfig, function configApplied(err, info) {
|
||||
initialFocusId = info.initialFocusId;
|
||||
callback(err);
|
||||
});
|
||||
if(_.isObject(promptConfig.mci)) {
|
||||
self.applyViewConfig(promptConfig, function configApplied(err, info) {
|
||||
initialFocusId = info.initialFocusId;
|
||||
callback(err);
|
||||
});
|
||||
} else {
|
||||
callback(null);
|
||||
}
|
||||
},
|
||||
function prepareFormSubmission(callback) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue