mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-12 23:54:38 +02:00
* A few MCI codes
* Fix timer/flicker bug @ connect ANSI term size detection
This commit is contained in:
parent
4288c5b2e9
commit
ff5d568259
4 changed files with 20 additions and 6 deletions
|
@ -21,12 +21,18 @@ function ansiQueryTermSizeIfNeeded(client, cb) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var done = function(res) {
|
||||||
|
client.removeListener('cursor position report', cprListener);
|
||||||
|
clearTimeout(giveUpTimer);
|
||||||
|
cb(res);
|
||||||
|
};
|
||||||
|
|
||||||
var cprListener = function(pos) {
|
var cprListener = function(pos) {
|
||||||
//
|
//
|
||||||
// If we've already found out, disregard
|
// If we've already found out, disregard
|
||||||
//
|
//
|
||||||
if(client.term.termHeight > 0 || client.term.termWidth > 0) {
|
if(client.term.termHeight > 0 || client.term.termWidth > 0) {
|
||||||
cb(true);
|
done(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +48,7 @@ function ansiQueryTermSizeIfNeeded(client, cb) {
|
||||||
client.log.warn(
|
client.log.warn(
|
||||||
{ height : h, width : w },
|
{ height : h, width : w },
|
||||||
'Ignoring ANSI CPR screen size query response due to very small values');
|
'Ignoring ANSI CPR screen size query response due to very small values');
|
||||||
cb(false);
|
done(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,17 +64,17 @@ function ansiQueryTermSizeIfNeeded(client, cb) {
|
||||||
'Window size updated'
|
'Window size updated'
|
||||||
);
|
);
|
||||||
|
|
||||||
cb(true);
|
done(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
client.once('cursor position report', cprListener);
|
client.once('cursor position report', cprListener);
|
||||||
|
|
||||||
// give up after 2s
|
// give up after 2s
|
||||||
setTimeout(function onTimeout() {
|
var giveUpTimer = setTimeout(function onTimeout() {
|
||||||
client.removeListener('cursor position report', cprListener);
|
done(false);
|
||||||
cb(false);
|
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
|
// This causes
|
||||||
client.term.write(ansi.queryScreenSize());
|
client.term.write(ansi.queryScreenSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,9 +46,16 @@ MCIViewFactory.prototype.getPredefinedViewLabel = function(code) {
|
||||||
UW : this.client.user.properties.web_address,
|
UW : this.client.user.properties.web_address,
|
||||||
UF : this.client.user.properties.affiliation,
|
UF : this.client.user.properties.affiliation,
|
||||||
UT : this.client.user.properties.theme_id,
|
UT : this.client.user.properties.theme_id,
|
||||||
|
MS : moment(this.client.user.properties.timestamp).format(this.client.currentTheme.helpers.getDateFormat()),
|
||||||
|
|
||||||
|
|
||||||
|
SH : this.client.term.termHeight.toString(),
|
||||||
|
SW : this.client.term.termWidth.toString(),
|
||||||
|
|
||||||
ND : this.client.runtime.id.toString(),
|
ND : this.client.runtime.id.toString(),
|
||||||
|
|
||||||
|
DT : moment().format(this.client.currentTheme.helpers.getDateFormat()),
|
||||||
|
|
||||||
OS : {
|
OS : {
|
||||||
linux : 'Linux',
|
linux : 'Linux',
|
||||||
darwin : 'Mac OS X',
|
darwin : 'Mac OS X',
|
||||||
|
|
|
@ -92,6 +92,7 @@ function submitApplication(callingMenu, formData, extraArgs) {
|
||||||
affiliation : formData.value.affils,
|
affiliation : formData.value.affils,
|
||||||
email_address : formData.value.email,
|
email_address : formData.value.email,
|
||||||
web_address : formData.value.web,
|
web_address : formData.value.web,
|
||||||
|
timestamp : new Date().toISOString(),
|
||||||
|
|
||||||
// :TODO: This is set in User.create() -- proabbly don't need it here:
|
// :TODO: This is set in User.create() -- proabbly don't need it here:
|
||||||
//account_status : Config.users.requireActivation ? user.User.AccountStatus.inactive : user.User.AccountStatus.active,
|
//account_status : Config.users.requireActivation ? user.User.AccountStatus.inactive : user.User.AccountStatus.active,
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue