From e661b23eca8cf6437a812ff8dfbbc9c937989c5f Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 11 Sep 2015 08:39:25 -0600 Subject: [PATCH] * Strict mode --- core/predefined_mci.js | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/core/predefined_mci.js b/core/predefined_mci.js index d0e7a2b9..f8a8886a 100644 --- a/core/predefined_mci.js +++ b/core/predefined_mci.js @@ -21,29 +21,29 @@ function getPredefinedMCIValue(client, code) { try { return { - BN : function boardName() { return Config.general.boardName }, - VL : function versionLabel() { return 'ENiGMA½ v' + packageJson.version }, - VN : function version() { return packageJson.version }, + BN : function boardName() { return Config.general.boardName; }, + VL : function versionLabel() { return 'ENiGMA½ v' + packageJson.version; }, + VN : function version() { return packageJson.version; }, - UN : function userName() { return client.user.username }, - UI : function userId() { return client.user.userId.toString() }, - UG : function groups() { return _.values(client.user.groups).join(', ') }, - UR : function realName() { return client.user.properties.real_name }, - LO : function location() { return client.user.properties.location }, - UA : function age() { return client.user.getAge().toString() }, - UB : function birthdate() { return moment(client.user.properties.birthdate).format(client.currentTheme.helpers.getDateFormat()) }, - US : function sex() { return client.user.properties.sex }, - UE : function emailAddres() { return client.user.properties.email_address }, - UW : function webAddress() { return client.user.properties.web_address }, - UF : function affils() { return client.user.properties.affiliation }, - UT : function themeId() { return client.user.properties.theme_id }, - UC : function loginCount() { return client.user.properties.login_count.toString() }, + UN : function userName() { return client.user.username; }, + UI : function userId() { return client.user.userId.toString(); }, + UG : function groups() { return _.values(client.user.groups).join(', '); }, + UR : function realName() { return client.user.properties.real_name; }, + LO : function location() { return client.user.properties.location; }, + UA : function age() { return client.user.getAge().toString(); }, + UB : function birthdate() { return moment(client.user.properties.birthdate).format(client.currentTheme.helpers.getDateFormat()); }, + US : function sex() { return client.user.properties.sex; }, + UE : function emailAddres() { return client.user.properties.email_address; }, + UW : function webAddress() { return client.user.properties.web_address; }, + UF : function affils() { return client.user.properties.affiliation; }, + UT : function themeId() { return client.user.properties.theme_id; }, + UC : function loginCount() { return client.user.properties.login_count.toString(); }, - MS : function accountCreated() { return moment(client.user.properties.account_created).format(client.currentTheme.helpers.getDateFormat()) }, - CS : function currentStatus() { return client.currentStatus }, + MS : function accountCreated() { return moment(client.user.properties.account_created).format(client.currentTheme.helpers.getDateFormat()); }, + CS : function currentStatus() { return client.currentStatus; }, MD : function currentMenuDescription() { - return _.has(self, 'client.currentMenuModule.menuConfig.desc') ? client.currentMenuModule.menuConfig.desc : ''; + return _.has(client, 'currentMenuModule.menuConfig.desc') ? client.currentMenuModule.menuConfig.desc : ''; }, MA : function messageAreaDescription() { @@ -51,14 +51,14 @@ function getPredefinedMCIValue(client, code) { return area ? area.desc : ''; }, - SH : function termHeight() { return client.term.termHeight.toString() }, - SW : function termWidth() { return client.term.termWidth.toString() }, + SH : function termHeight() { return client.term.termHeight.toString(); }, + SW : function termWidth() { return client.term.termWidth.toString(); }, - ND : function connectedNode() { return client.node.toString() }, + ND : function connectedNode() { return client.node.toString(); }, // :TODO: change to CD for 'Current Date' - DT : function date() { return moment().format(client.currentTheme.helpers.getDateFormat()) }, - CT : function time() { return moment().format(client.currentTheme.helpers.getTimeFormat()) }, + DT : function date() { return moment().format(client.currentTheme.helpers.getDateFormat()); }, + CT : function time() { return moment().format(client.currentTheme.helpers.getTimeFormat()) ;}, OS : function operatingSystem() { @@ -71,14 +71,14 @@ function getPredefinedMCIValue(client, code) { }[os.platform()] || os.type(); }, - OA : function systemArchitecture() { return os.arch() }, - SC : function systemCpuModel() { return os.cpus()[0].model }, + OA : function systemArchitecture() { return os.arch(); }, + SC : function systemCpuModel() { return os.cpus()[0].model; }, - IP : function clientIpAddress() { return client.address().address }, + IP : function clientIpAddress() { return client.address().address; }, }[code](); } catch(e) { // Don't use client.log here as we may not have a client logger established yet!! - Log.warn( { code : code, exception : e.message }, 'Exception caught attempting to construct predefined label'); + Log.warn( { code : code, exception : e.message }, 'Exception caught attempting to construct predefined MCI value'); } }