Skip to content
Snippets Groups Projects
Commit e162990b authored by echicken's avatar echicken :chicken:
Browse files

Various minor adjustments

parent 1e16bf72
No related branches found
No related tags found
No related merge requests found
...@@ -13,13 +13,15 @@ const queue = js.global.load(true, `${js.exec_dir}background.js`, `${user.number ...@@ -13,13 +13,15 @@ const queue = js.global.load(true, `${js.exec_dir}background.js`, `${user.number
const HELP = const HELP =
'\x01h\x01wHelp:\r\n' '\x01h\x01wHelp:\r\n'
+ '\x01nUse your \x01h\x01ctab \x01n\x01wor \x01h\x01cleft\x01n\x01w/\x01h\x01cright \x01n\x01warrow keys to navigate between windows.\r\n' + '\x01nUse your \x01h\x01ctab \x01n\x01wor \x01h\x01cleft\x01n\x01w/\x01h\x01cright \x01n\x01warrow keys to navigate between windows.\r\n'
+ 'Use your \x01h\x01cup\x01n\x01w,\x01h\x01c down\x01n\x01w,\x01h\x01c page up\x01n\x01w,\x01h\x01c page down\x01n\x01w,\x01h\x01c home\x01n\x01w, and \x01h\x01cend \x01n\x01wkeys to scroll.\r\n' + 'Use \x01h\x01cup\x01n\x01w,\x01h\x01c down\x01n\x01w,\x01h\x01c page up\x01n\x01w,\x01h\x01c page down\x01n\x01w,\x01h\x01c home\x01n\x01w, and \x01h\x01cend \x01n\x01wto scroll,\r\n'
+ 'or type the name of an item to highlight it. Hit \x01h\x01center\x01n\x01w to select.\r\n'
+ '\x01h\x01cCTRL-W\x01n\x01who\'s online; \x01h\x01cCTRL-S\x01n\x01wend message; \x01h\x01cCTRL-L\x01n\x01wog off; \x01h\x01cCTRL-D\x01n\x01wisconnect' + '\x01h\x01cCTRL-W\x01n\x01who\'s online; \x01h\x01cCTRL-S\x01n\x01wend message; \x01h\x01cCTRL-L\x01n\x01wog off; \x01h\x01cCTRL-D\x01n\x01wisconnect'
export default class ActivityWindow extends ShellWindow { export default class ActivityWindow extends ShellWindow {
input: Input; input: Input;
inputWindow: ControlledWindow; inputWindow: ControlledWindow;
timestamp: number = 0;
constructor(name: string, wm: WindowManager, position: IPosition, size: ISize, footer: IBorderText) { constructor(name: string, wm: WindowManager, position: IPosition, size: ISize, footer: IBorderText) {
super(name, wm, position, size, footer); super(name, wm, position, size, footer);
...@@ -86,11 +88,11 @@ export default class ActivityWindow extends ShellWindow { ...@@ -86,11 +88,11 @@ export default class ActivityWindow extends ShellWindow {
this.window.scrollTo({ x: 0, y: this.window.contentWindow.dataHeight - this.window.contentWindow.size.height }); this.window.scrollTo({ x: 0, y: this.window.contentWindow.dataHeight - this.window.contentWindow.size.height });
break; break;
case keydefs.CTRL_H: // Help case keydefs.CTRL_H: // Help
this.window.write(`\r\n${HELP}`); this.window.write(`${HELP}`);
break; break;
case keydefs.CTRL_W: // Who's Online case keydefs.CTRL_W: // Who's Online
const presence = getPresence(); const presence = getPresence();
if (presence !== undefined) this.window.write(`\r\n${presence}`); if (presence !== undefined) this.window.write(`${presence}`);
break; break;
case keydefs.CTRL_S: // Send case keydefs.CTRL_S: // Send
if (!this.forceFocus) { if (!this.forceFocus) {
...@@ -112,7 +114,11 @@ export default class ActivityWindow extends ShellWindow { ...@@ -112,7 +114,11 @@ export default class ActivityWindow extends ShellWindow {
if (str !== '\x04') msg.push(str); if (str !== '\x04') msg.push(str);
} }
if (msg.length < 1) return; if (msg.length < 1) return;
this.window.write(`\r\n\x01n\x01m${system.timestr(time())}\x01n\x01w\r\n`); const now = time();
if (now - this.timestamp >= 60) {
this.window.write(`\x01n\x01m${system.timestr(time())}\x01n\x01w\r\n`);
this.timestamp = now;
}
this.window.write(msg.join('\r\n')); this.window.write(msg.join('\r\n'));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment