mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-07 13:15:28 +02:00
Merge branch 'master' of ssh://nu.l33t.codes:51977/git/base/enigma-bbs
This commit is contained in:
commit
07ee5079f4
2 changed files with 24 additions and 1 deletions
|
@ -52,6 +52,7 @@ var CONTROL = {
|
||||||
deleteLine : 'M',
|
deleteLine : 'M',
|
||||||
scrollUp : 'S',
|
scrollUp : 'S',
|
||||||
scrollDown : 'T',
|
scrollDown : 'T',
|
||||||
|
setScrollRegion : 'r',
|
||||||
savePos : 's',
|
savePos : 's',
|
||||||
restorePos : 'u',
|
restorePos : 'u',
|
||||||
queryPos : '6n',
|
queryPos : '6n',
|
||||||
|
|
|
@ -84,6 +84,12 @@ function MultiLineEditTextView(options) {
|
||||||
|
|
||||||
View.call(this, options);
|
View.call(this, options);
|
||||||
|
|
||||||
|
if(0 !== this.position.col) {
|
||||||
|
// :TODO: experimental - log this as warning if kept
|
||||||
|
this.position.col = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.lines = []; // a given line is text...until EOL
|
this.lines = []; // a given line is text...until EOL
|
||||||
|
@ -127,6 +133,11 @@ function MultiLineEditTextView(options) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
this.createScrollRegion = function() {
|
||||||
|
self.client.term.write(ansi.setScrollRegion(self.position.row, self.position.row + 5));//self.dimens.height));
|
||||||
|
};
|
||||||
|
|
||||||
this.redrawViewableText = function() {
|
this.redrawViewableText = function() {
|
||||||
var x = self.position.row;
|
var x = self.position.row;
|
||||||
var bottom = x + self.dimens.height;
|
var bottom = x + self.dimens.height;
|
||||||
|
@ -193,14 +204,22 @@ function MultiLineEditTextView(options) {
|
||||||
this.getLineIndex = function() {
|
this.getLineIndex = function() {
|
||||||
return self.topLineIndex + self.cursorPos.row;
|
return self.topLineIndex + self.cursorPos.row;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
require('util').inherits(MultiLineEditTextView, View);
|
require('util').inherits(MultiLineEditTextView, View);
|
||||||
|
|
||||||
|
MultiLineEditTextView.prototype.setPosition = function(pos) {
|
||||||
|
MultiLineEditTextView.super_.prototype.setPosition.call(this, pos);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
MultiLineEditTextView.prototype.redraw = function() {
|
MultiLineEditTextView.prototype.redraw = function() {
|
||||||
MultiLineEditTextView.super_.prototype.redraw.call(this);
|
MultiLineEditTextView.super_.prototype.redraw.call(this);
|
||||||
|
|
||||||
this.redrawViewableText();
|
//this.redrawViewableText();
|
||||||
|
this.client.term.write(this.text);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*MultiLineEditTextView.prototype.setFocus = function(focused) {
|
/*MultiLineEditTextView.prototype.setFocus = function(focused) {
|
||||||
|
@ -215,6 +234,9 @@ MultiLineEditTextView.prototype.setText = function(text) {
|
||||||
|
|
||||||
//this.cursorPos.row = this.position.row + this.dimens.height;
|
//this.cursorPos.row = this.position.row + this.dimens.height;
|
||||||
this.lines = this.wordWrap(text);
|
this.lines = this.wordWrap(text);
|
||||||
|
this.createScrollRegion();
|
||||||
|
|
||||||
|
this.text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiLineEditTextView.prototype.onSpecialKeyPress = function(keyName) {
|
MultiLineEditTextView.prototype.onSpecialKeyPress = function(keyName) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue