diff --git a/core/connect.js b/core/connect.js index ac6e124e..f89301ec 100644 --- a/core/connect.js +++ b/core/connect.js @@ -21,12 +21,18 @@ function ansiQueryTermSizeIfNeeded(client, cb) { return; } + var done = function(res) { + client.removeListener('cursor position report', cprListener); + clearTimeout(giveUpTimer); + cb(res); + }; + var cprListener = function(pos) { // // If we've already found out, disregard // if(client.term.termHeight > 0 || client.term.termWidth > 0) { - cb(true); + done(true); return; } @@ -42,7 +48,7 @@ function ansiQueryTermSizeIfNeeded(client, cb) { client.log.warn( { height : h, width : w }, 'Ignoring ANSI CPR screen size query response due to very small values'); - cb(false); + done(false); return; } @@ -58,17 +64,17 @@ function ansiQueryTermSizeIfNeeded(client, cb) { 'Window size updated' ); - cb(true); + done(true); }; client.once('cursor position report', cprListener); // give up after 2s - setTimeout(function onTimeout() { - client.removeListener('cursor position report', cprListener); - cb(false); + var giveUpTimer = setTimeout(function onTimeout() { + done(false); }, 2000); + // This causes client.term.write(ansi.queryScreenSize()); } diff --git a/core/mci_view_factory.js b/core/mci_view_factory.js index d6dfe8bf..802a4a85 100644 --- a/core/mci_view_factory.js +++ b/core/mci_view_factory.js @@ -46,9 +46,16 @@ MCIViewFactory.prototype.getPredefinedViewLabel = function(code) { UW : this.client.user.properties.web_address, UF : this.client.user.properties.affiliation, 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(), + DT : moment().format(this.client.currentTheme.helpers.getDateFormat()), + OS : { linux : 'Linux', darwin : 'Mac OS X', diff --git a/mods/apply.js b/mods/apply.js index 8aa0615e..11ef0d82 100644 --- a/mods/apply.js +++ b/mods/apply.js @@ -92,6 +92,7 @@ function submitApplication(callingMenu, formData, extraArgs) { affiliation : formData.value.affils, email_address : formData.value.email, web_address : formData.value.web, + timestamp : new Date().toISOString(), // :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, diff --git a/mods/art/userstats.ans b/mods/art/userstats.ans index 5b35b80c..2e38ebcc 100644 Binary files a/mods/art/userstats.ans and b/mods/art/userstats.ans differ