Skip to content
Snippets Groups Projects
Commit aa678096 authored by mcmlxxix's avatar mcmlxxix
Browse files

removed unnecessary redraw calls, some display tweaks and fixes, removed...

removed unnecessary redraw calls, some display tweaks and fixes, removed "email target" menu (now handled by "email" menu)
parent 04441748
No related branches found
No related tags found
No related merge requests found
/* MENU OBJECTS */ /* MENU OBJECTS */
menuobj=[]; var menuobj=[];
menuobj["main"]=function() { menuobj["main"]=function() {
this.title="MAIN"; this.title="MAIN";
this.items=new Array(); this.items=new Array();
...@@ -44,6 +44,7 @@ menuobj["delfavorite"]=function() { ...@@ -44,6 +44,7 @@ menuobj["delfavorite"]=function() {
} }
set_hotkeys(this); set_hotkeys(this);
fill_menu(this); fill_menu(this);
this.node_action=NODE_DFLT;
} }
menuobj["addfavorite"]=function() { menuobj["addfavorite"]=function() {
this.title="ADD FAVORITE"; this.title="ADD FAVORITE";
...@@ -55,6 +56,7 @@ menuobj["addfavorite"]=function() { ...@@ -55,6 +56,7 @@ menuobj["addfavorite"]=function() {
this.addcmd(favorites.it,undefined,true); this.addcmd(favorites.it,undefined,true);
set_hotkeys(this); set_hotkeys(this);
fill_menu(this); fill_menu(this);
this.node_action=NODE_DFLT;
} }
menuobj["file"]=function() { menuobj["file"]=function() {
this.title="FILES"; this.title="FILES";
...@@ -109,7 +111,8 @@ menuobj["settings"]=function() { ...@@ -109,7 +111,8 @@ menuobj["settings"]=function() {
menuobj["email"]=function() { menuobj["email"]=function() {
this.title="E-MAIL"; this.title="E-MAIL";
this.items=new Array(); this.items=new Array();
this.addcmd("Send Mail","S"); this.addcmd('SysOp Feedback','F',user.compare_ars("REST S"));
this.addcmd("Send E-Mail","E",user.compare_ars("REST S AND REST E AND REST M"));
this.addcmd("Read Inbox","R"); this.addcmd("Read Inbox","R");
this.addcmd("Read Sent Messages","M",user.compare_ars("REST K")); this.addcmd("Read Sent Messages","M",user.compare_ars("REST K"));
set_hotkeys(this); set_hotkeys(this);
...@@ -124,7 +127,7 @@ menuobj["message"]=function() { ...@@ -124,7 +127,7 @@ menuobj["message"]=function() {
this.addcmd("Scan Messages To You","Y"); this.addcmd("Scan Messages To You","Y");
this.addcmd("Search Message Text","T"); this.addcmd("Search Message Text","T");
this.addcmd("Post Message","P",user.compare_ars("REST P")); this.addcmd("Post Message","P",user.compare_ars("REST P"));
if(user.compare_ars("REST N") && (msg_area.grp_list[bbs.curgrp].sub_list[bbs.crusub] & (SUB_QNET|SUB_PNET|SUB_FIDO))) if(user.compare_ars("REST N") && (msg_area.grp_list[bbs.curgrp].sub_list[bbs.cursub] & (SUB_QNET|SUB_PNET|SUB_FIDO)))
this.items[7].disabed=true; this.items[7].disabed=true;
this.addcmd("Read/Post Auto-Msg","A"); this.addcmd("Read/Post Auto-Msg","A");
this.addcmd("QWK Transfer Menu","Q"); this.addcmd("QWK Transfer Menu","Q");
...@@ -186,18 +189,6 @@ menuobj["userlist"]=function() { ...@@ -186,18 +189,6 @@ menuobj["userlist"]=function() {
set_hotkeys(this); set_hotkeys(this);
fill_menu(this); fill_menu(this);
} }
menuobj["emailtarget"]=function() {
this.title="E-MAIL";
this.info=system.text_dir + "cshell/email.ini";
this.items=new Array();
this.addcmd('Sysop','S',user.compare_ars("REST S"));
this.addcmd('Local User','L',user.compare_ars("REST E"));
this.addcmd('To Local User w/Attach','A',user.compare_ars("REST E"));
this.addcmd('To Remote User','R',user.compare_ars("REST E OR REST M"));
this.addcmd('To Remote User w/Attach','T',user.compare_ars("REST E OR REST M"));
set_hotkeys(this);
fill_menu(this);
}
menuobj["download"]=function() { menuobj["download"]=function() {
this.title="DOWNLOAD"; this.title="DOWNLOAD";
this.items=new Array(); this.items=new Array();
...@@ -443,25 +434,25 @@ menucmd["info"]=function(key) { ...@@ -443,25 +434,25 @@ menucmd["info"]=function(key) {
clear_screen(); clear_screen();
bbs.sys_info(); bbs.sys_info();
console.pause(); console.pause();
this.redraw();
break; break;
case 'V': case 'V':
clear_screen(); clear_screen();
bbs.ver(); bbs.ver();
console.pause(); console.pause();
this.redraw();
break; break;
case 'S': case 'S':
clear_screen(); clear_screen();
bbs.sub_info(); bbs.sub_info();
console.pause(); console.pause();
this.redraw();
break; break;
case 'Y': case 'Y':
clear_screen(); clear_screen();
bbs.user_info(); bbs.user_info();
console.pause(); console.pause();
this.redraw();
break; break;
case 'U': case 'U':
this.loadMenu("userlist"); this.loadMenu("userlist");
...@@ -469,7 +460,7 @@ menucmd["info"]=function(key) { ...@@ -469,7 +460,7 @@ menucmd["info"]=function(key) {
case 'T': case 'T':
clear_screen(); clear_screen();
bbs.text_sec(); bbs.text_sec();
this.redraw();
break; break;
} }
} }
...@@ -480,19 +471,19 @@ menucmd["userlist"]=function(key) { ...@@ -480,19 +471,19 @@ menucmd["userlist"]=function(key) {
clear_screen(); clear_screen();
bbs.list_logons(); bbs.list_logons();
console.pause(); console.pause();
this.redraw();
break; break;
case 'S': case 'S':
clear_screen(); clear_screen();
bbs.list_users(UL_SUB); bbs.list_users(UL_SUB);
console.pause(); console.pause();
this.redraw();
break; break;
case 'A': case 'A':
clear_screen(); clear_screen();
bbs.list_users(UL_ALL); bbs.list_users(UL_ALL);
console.pause(); console.pause();
this.redraw();
break; break;
} }
} }
...@@ -575,13 +566,13 @@ menucmd["file"]=function(key) { ...@@ -575,13 +566,13 @@ menucmd["file"]=function(key) {
break changedir; break changedir;
} }
} while(0); } while(0);
this.redraw();
break; break;
case 'L': case 'L':
clear_screen(); clear_screen();
bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number); bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number);
console.pause(); console.pause();
this.redraw();
break; break;
case 'N': case 'N':
this.loadMenu("filedir"); this.loadMenu("filedir");
...@@ -633,12 +624,12 @@ menucmd["file"]=function(key) { ...@@ -633,12 +624,12 @@ menucmd["file"]=function(key) {
} }
} }
} while(0); } while(0);
this.redraw();
break; break;
case 'B': case 'B':
clear_screen(); clear_screen();
bbs.batch_menu(); bbs.batch_menu();
this.redraw();
break; break;
case 'V': case 'V':
this.loadMenu("fileinfo"); this.loadMenu("fileinfo");
...@@ -680,7 +671,7 @@ menucmd["fileinfo"]=function(key) { ...@@ -680,7 +671,7 @@ menucmd["fileinfo"]=function(key) {
} }
} }
console.pause(); console.pause();
this.redraw();
break; break;
case 'I': case 'I':
clear_screen(); clear_screen();
...@@ -710,25 +701,25 @@ menucmd["fileinfo"]=function(key) { ...@@ -710,25 +701,25 @@ menucmd["fileinfo"]=function(key) {
} }
} }
console.pause(); console.pause();
this.redraw();
break; break;
case 'P': case 'P':
clear_screen(); clear_screen();
bbs.xfer_policy(); bbs.xfer_policy();
console.pause(); console.pause();
this.redraw();
break; break;
case 'D': case 'D':
clear_screen(); clear_screen();
bbs.dir_info(); bbs.dir_info();
console.pause(); console.pause();
this.redraw();
break; break;
case 'U': case 'U':
clear_screen(); clear_screen();
bbs.list_users(UL_DIR); bbs.list_users(UL_DIR);
console.pause(); console.pause();
this.redraw();
break; break;
case 'S': case 'S':
break; break;
...@@ -745,7 +736,7 @@ menucmd["scannewfile"]=function(key) { ...@@ -745,7 +736,7 @@ menucmd["scannewfile"]=function(key) {
console.putmsg("\r\nchNew File Scan (All)\r\n"); console.putmsg("\r\nchNew File Scan (All)\r\n");
bbs.scan_dirs(FL_ULTIME,true); bbs.scan_dirs(FL_ULTIME,true);
console.pause(); console.pause();
this.redraw();
break; break;
case 'L': case 'L':
/* Scan this lib only */ /* Scan this lib only */
...@@ -754,7 +745,7 @@ menucmd["scannewfile"]=function(key) { ...@@ -754,7 +745,7 @@ menucmd["scannewfile"]=function(key) {
for(i=0; i<file_area.lib_list[bbs.curlib].dir_list.length; i++) for(i=0; i<file_area.lib_list[bbs.curlib].dir_list.length; i++)
bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[i].number,FL_ULTIME); bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[i].number,FL_ULTIME);
console.pause(); console.pause();
this.redraw();
break; break;
case 'D': case 'D':
/* Scan this dir only */ /* Scan this dir only */
...@@ -762,13 +753,13 @@ menucmd["scannewfile"]=function(key) { ...@@ -762,13 +753,13 @@ menucmd["scannewfile"]=function(key) {
console.putmsg("\r\nchNew File Scan (Dir)\r\n"); console.putmsg("\r\nchNew File Scan (Dir)\r\n");
bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number,FL_ULTIME); bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number,FL_ULTIME);
console.pause(); console.pause();
this.redraw();
break; break;
case 'N': case 'N':
// ToDo: Don't clear screen here, just do one line // ToDo: Don't clear screen here, just do one line
clear_screen(); clear_screen();
bbs.new_file_time=bbs.get_newscantime(bbs.new_file_time); bbs.new_file_time=bbs.get_newscantime(bbs.new_file_time);
this.redraw();
break; break;
default: // Anything else will escape. default: // Anything else will escape.
left.menu.nodraw=true; left.menu.nodraw=true;
...@@ -787,7 +778,7 @@ menucmd["scanfilenames"]=function(key) { ...@@ -787,7 +778,7 @@ menucmd["scanfilenames"]=function(key) {
bbs.list_files(file_area.lib_list[i].dir_list[j].number,spec,0); bbs.list_files(file_area.lib_list[i].dir_list[j].number,spec,0);
} }
console.pause(); console.pause();
this.redraw();
break; break;
case 'L': case 'L':
/* Scan this lib only */ /* Scan this lib only */
...@@ -797,7 +788,7 @@ menucmd["scanfilenames"]=function(key) { ...@@ -797,7 +788,7 @@ menucmd["scanfilenames"]=function(key) {
for(j=0;j<file_area.lib_list[bbs.curlib].dir_list.length;j++) for(j=0;j<file_area.lib_list[bbs.curlib].dir_list.length;j++)
bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[j].number,spec,0); bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[j].number,spec,0);
console.pause(); console.pause();
this.redraw();
break; break;
case 'D': case 'D':
/* Scan this dir only */ /* Scan this dir only */
...@@ -806,7 +797,7 @@ menucmd["scanfilenames"]=function(key) { ...@@ -806,7 +797,7 @@ menucmd["scanfilenames"]=function(key) {
var spec=bbs.get_filespec(); var spec=bbs.get_filespec();
bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number,spec,0); bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number,spec,0);
console.pause(); console.pause();
this.redraw();
break; break;
default: // Anything else will escape. default: // Anything else will escape.
left.menu.nodraw=true; left.menu.nodraw=true;
...@@ -826,7 +817,7 @@ menucmd["scanfiledesc"]=function(key) { ...@@ -826,7 +817,7 @@ menucmd["scanfiledesc"]=function(key) {
bbs.list_files(file_area.lib_list[i].dir_list[j].number,spec,FL_FINDDESC); bbs.list_files(file_area.lib_list[i].dir_list[j].number,spec,FL_FINDDESC);
} }
console.pause(); console.pause();
this.redraw();
break; break;
case 'L': case 'L':
/* Scan this lib only */ /* Scan this lib only */
...@@ -837,7 +828,7 @@ menucmd["scanfiledesc"]=function(key) { ...@@ -837,7 +828,7 @@ menucmd["scanfiledesc"]=function(key) {
for(j=0;j<file_area.lib_list[bbs.curlib].dir_list.length;j++) for(j=0;j<file_area.lib_list[bbs.curlib].dir_list.length;j++)
bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[j].number,spec,FL_FINDDESC); bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[j].number,spec,FL_FINDDESC);
console.pause(); console.pause();
this.redraw();
break; break;
case 'D': case 'D':
/* Scan this dir only */ /* Scan this dir only */
...@@ -847,7 +838,7 @@ menucmd["scanfiledesc"]=function(key) { ...@@ -847,7 +838,7 @@ menucmd["scanfiledesc"]=function(key) {
var spec=console.getstr(40,K_LINE|K_UPPER); var spec=console.getstr(40,K_LINE|K_UPPER);
bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number,spec,FL_FINDDESC); bbs.list_files(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number,spec,FL_FINDDESC);
console.pause(); console.pause();
this.redraw();
break; break;
default: // Anything else will escape. default: // Anything else will escape.
left.menu.nodraw=true; left.menu.nodraw=true;
...@@ -859,22 +850,22 @@ menucmd["upload"]=function(key) { ...@@ -859,22 +850,22 @@ menucmd["upload"]=function(key) {
case 'C': // Current dir case 'C': // Current dir
clear_screen(); clear_screen();
bbs.upload_file(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number); bbs.upload_file(file_area.lib_list[bbs.curlib].dir_list[bbs.curdir].number);
this.redraw();
break; break;
case 'P': // Menu_upload dir case 'P': // Menu_upload dir
clear_screen(); clear_screen();
bbs.upload_file(file_area.upload_dir); bbs.upload_file(file_area.upload_dir);
this.redraw();
break; break;
case 'S': // Sysop dir case 'S': // Sysop dir
clear_screen(); clear_screen();
bbs.upload_file(file_area.sysop_dir); bbs.upload_file(file_area.sysop_dir);
this.redraw();
break; break;
case 'U': // To user case 'U': // To user
clear_screen(); clear_screen();
bbs.upload_file(file_area.user_dir); bbs.upload_file(file_area.user_dir);
this.redraw();
default: default:
left.menu.nodraw=true; left.menu.nodraw=true;
break; break;
...@@ -886,18 +877,18 @@ menucmd["download"]=function(key) { ...@@ -886,18 +877,18 @@ menucmd["download"]=function(key) {
case 'B': case 'B':
clear_screen(); clear_screen();
bbs.batch_download(); bbs.batch_download();
this.redraw();
break; break;
case 'N': case 'N':
clear_screen(); clear_screen();
var spec=bbs.get_filespec(); var spec=bbs.get_filespec();
bbs.list_file_info(bbs.curdir,spec,FI_DOWNLOAD); bbs.list_file_info(bbs.curdir,spec,FI_DOWNLOAD);
this.redraw();
break; break;
case 'U': case 'U':
clear_screen(); clear_screen();
bbs.list_file_info(bbs.curdir,spec,FI_USERXFER); bbs.list_file_info(bbs.curdir,spec,FI_USERXFER);
this.redraw();
break; break;
default: default:
left.menu.nodraw=true; left.menu.nodraw=true;
...@@ -998,12 +989,12 @@ menucmd["message"]=function(key) { ...@@ -998,12 +989,12 @@ menucmd["message"]=function(key) {
bbs.cursub=i; bbs.cursub=i;
break; break;
} }
this.redraw();
break; break;
case 'R': case 'R':
clear_screen(); clear_screen();
bbs.scan_posts(); bbs.scan_posts();
this.redraw();
break; break;
case 'N': case 'N':
this.loadMenu("newmsgscan"); this.loadMenu("newmsgscan");
...@@ -1017,23 +1008,23 @@ menucmd["message"]=function(key) { ...@@ -1017,23 +1008,23 @@ menucmd["message"]=function(key) {
case 'P': case 'P':
clear_screen(); clear_screen();
bbs.post_msg(); bbs.post_msg();
this.redraw();
break; break;
case 'A': case 'A':
clear_screen(); clear_screen();
bbs.auto_msg(); bbs.auto_msg();
this.redraw();
break; break;
case 'Q': case 'Q':
clear_screen(); clear_screen();
bbs.qwk_sec(); bbs.qwk_sec();
this.redraw();
break; break;
case 'V': case 'V':
clear_screen(); clear_screen();
bbs.sub_info(); bbs.sub_info();
console.pause(); console.pause();
this.redraw();
break; break;
} }
} }
...@@ -1050,7 +1041,7 @@ menucmd["searchmsgtxt"]=function(key) { ...@@ -1050,7 +1041,7 @@ menucmd["searchmsgtxt"]=function(key) {
bbs.scan_posts(msg_area.grp_list[i].sub_list[j].number, SCAN_FIND, str); bbs.scan_posts(msg_area.grp_list[i].sub_list[j].number, SCAN_FIND, str);
} }
} }
this.redraw();
break; break;
case 'G': case 'G':
clear_screen(); clear_screen();
...@@ -1058,14 +1049,14 @@ menucmd["searchmsgtxt"]=function(key) { ...@@ -1058,14 +1049,14 @@ menucmd["searchmsgtxt"]=function(key) {
str=console.getstr("",40,K_LINE|K_UPPER); str=console.getstr("",40,K_LINE|K_UPPER);
for(i=0; i<msg_area.grp_list[bbs.curgrp].sub_list.length; i++) for(i=0; i<msg_area.grp_list[bbs.curgrp].sub_list.length; i++)
bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[i].number, SCAN_FIND, str); bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[i].number, SCAN_FIND, str);
this.redraw();
break; break;
case 'S': case 'S':
clear_screen(); clear_screen();
console.putmsg("\r\n\x01c\x01hMessage Search\r\n"); console.putmsg("\r\n\x01c\x01hMessage Search\r\n");
str=console.getstr("",40,K_LINE|K_UPPER); str=console.getstr("",40,K_LINE|K_UPPER);
bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[bbs.cursub].number, SCAN_FIND, str); bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[bbs.cursub].number, SCAN_FIND, str);
this.redraw();
break; break;
default: default:
left.menu.nodraw=true; left.menu.nodraw=true;
...@@ -1085,25 +1076,25 @@ menucmd["yourmsgscan"]=function(key) { ...@@ -1085,25 +1076,25 @@ menucmd["yourmsgscan"]=function(key) {
bbs.scan_posts(msg_area.grp_list[j].sub_list[i].number, SCAN_TOYOU); bbs.scan_posts(msg_area.grp_list[j].sub_list[i].number, SCAN_TOYOU);
} }
} }
this.redraw();
break; break;
case 'G': case 'G':
clear_screen(); clear_screen();
console.putmsg("\r\n\x01c\x01hYour Message Scan\r\n"); console.putmsg("\r\n\x01c\x01hYour Message Scan\r\n");
for(i=0; i<msg_area.grp_list[bbs.curgrp].sub_list.length; i++) for(i=0; i<msg_area.grp_list[bbs.curgrp].sub_list.length; i++)
bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[i].number, SCAN_TOYOU); bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[i].number, SCAN_TOYOU);
this.redraw();
break; break;
case 'S': case 'S':
clear_screen(); clear_screen();
console.putmsg("\r\n\x01c\x01hYour Message Scan\r\n"); console.putmsg("\r\n\x01c\x01hYour Message Scan\r\n");
bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[bbs.cursub].number, SCAN_TOYOU); bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[bbs.cursub].number, SCAN_TOYOU);
this.redraw();
break; break;
case 'C': case 'C':
clear_screen(); clear_screen();
bbs.cfg_msg_scan(SCAN_CFG_TOYOU); bbs.cfg_msg_scan(SCAN_CFG_TOYOU);
this.redraw();
break; break;
default: default:
left.menu.nodraw=true; left.menu.nodraw=true;
...@@ -1120,30 +1111,30 @@ menucmd["newmsgscan"]=function(key) { ...@@ -1120,30 +1111,30 @@ menucmd["newmsgscan"]=function(key) {
for(i=0; i<msg_area.grp_list[j].sub_list.length; i++) for(i=0; i<msg_area.grp_list[j].sub_list.length; i++)
bbs.scan_posts(msg_area.grp_list[j].sub_list[i].number, SCAN_NEW); bbs.scan_posts(msg_area.grp_list[j].sub_list[i].number, SCAN_NEW);
} }
this.redraw();
break; break;
case 'G': case 'G':
clear_screen(); clear_screen();
console.putmsg("\r\n\x01c\x01hNew Message Scan\r\n"); console.putmsg("\r\n\x01c\x01hNew Message Scan\r\n");
for(i=0; i<msg_area.grp_list[bbs.curgrp].sub_list.length; i++) for(i=0; i<msg_area.grp_list[bbs.curgrp].sub_list.length; i++)
bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[i].number, SCAN_NEW); bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[i].number, SCAN_NEW);
this.redraw();
break; break;
case 'S': case 'S':
clear_screen(); clear_screen();
console.putmsg("\r\n\x01c\x01hNew Message Scan\r\n"); console.putmsg("\r\n\x01c\x01hNew Message Scan\r\n");
bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[bbs.cursub].number, SCAN_NEW); bbs.scan_posts(msg_area.grp_list[bbs.curgrp].sub_list[bbs.cursub].number, SCAN_NEW);
this.redraw();
break; break;
case 'C': case 'C':
clear_screen(); clear_screen();
bbs.cfg_msg_scan(SCAN_CFG_NEW); bbs.cfg_msg_scan(SCAN_CFG_NEW);
this.redraw();
break; break;
case 'P': case 'P':
clear_screen(); clear_screen();
bbs.cfg_msg_ptrs(SCAN_CFG_NEW); bbs.cfg_msg_ptrs(SCAN_CFG_NEW);
this.redraw();
break; break;
case 'R': case 'R':
bbs.reinit_msg_ptrs() bbs.reinit_msg_ptrs()
...@@ -1153,64 +1144,6 @@ menucmd["newmsgscan"]=function(key) { ...@@ -1153,64 +1144,6 @@ menucmd["newmsgscan"]=function(key) {
break; break;
} }
} }
menucmd["emailtarget"]=function(key) {
switch(key)
{
case 'S':
clear_screen();
bbs.email(1,WM_EMAIL,bbs.text(ReFeedback));
this.redraw();
break;
case 'L':
clear_screen();
console.putmsg("\x01_\r\n\x01b\x01hE-mail (User name or number): \x01w");
str=console.getstr("",40,K_UPRLWR);
if(str!=null && str!="") {
if(str=="Sysop")
str="1";
if(str.search(/\@/)!=-1)
bbs.netmail(str);
else {
i=bbs.finduser(str);
if(i>0)
bbs.email(i,WM_EMAIL);
}
}
this.redraw();
break;
case 'A':
clear_screen();
console.putmsg("\x01_\r\n\x01b\x01hE-mail (User name or number): \x01w");
str=console.getstr("",40,K_UPRLWR);
if(str!=null && str!="") {
i=bbs.finduser(str);
if(i>0)
bbs.email(i,WM_EMAIL|WM_FILE);
}
this.redraw();
break;
case 'R':
clear_screen();
if(console.noyes("\r\nAttach a file"))
i=0;
else
i=WM_FILE;
console.putmsg(bbs.text(EnterNetMailAddress),P_SAVEATR);
str=console.getstr("",60,K_LINE);
if(str!=null && str !="")
bbs.netmail(str,i);
this.redraw();
break;
case 'T':
clear_screen();
console.putmsg("\x01_\r\n\x01b\x01hE-mail (User name or number): \x01w");
str=console.getstr("",40,K_UPRLWR);
if(str!=null && str!="")
bbs.netmail(str,WM_FILE);
this.redraw();
break;
}
}
menucmd["email"]=function(key) { menucmd["email"]=function(key) {
var cur=1; var cur=1;
this.menu.current=cur; this.menu.current=cur;
...@@ -1218,20 +1151,47 @@ menucmd["email"]=function(key) { ...@@ -1218,20 +1151,47 @@ menucmd["email"]=function(key) {
var j; var j;
switch(key) switch(key)
{ {
case 'S':
this.loadMenu("emailtarget");
break;
case 'R': case 'R':
clear_screen(); clear_screen();
bbs.read_mail(MAIL_YOUR); bbs.read_mail(MAIL_YOUR);
console.pause(); console.pause();
this.redraw();
break; break;
case 'M': case 'M':
clear_screen(); clear_screen();
bbs.read_mail(MAIL_SENT); bbs.read_mail(MAIL_SENT);
console.pause(); console.pause();
this.redraw();
break;
case 'F':
clear_screen();
bbs.email(1,WM_EMAIL,bbs.text(ReFeedback));
break;
case 'E':
clear_screen();
bbs.replace_text(EnterNetMailAddress,
"_bh[cûb] yE-mail Address (user name, number or user@domain)");
console.putmsg(bbs.text(EnterNetMailAddress) + "\r\n",P_SAVEATR);
bbs.revert_text(EnterNetMailAddress);
str=console.getstr("",60,K_LINE|K_NOCRLF);
if(str==null || str=="") break;
var attach=WM_FILE;
if(console.noyes("\r\nAttach a file")) attach=0;
if(str.search(/\@/)!=-1) {
if(!user.compare_ars("REST M || REST E"))
bbs.netmail(str,attach);
break;
}
if(str=="SYSOP") str="1";
i=bbs.finduser(str);
if(i>0 && !user.compare_ars("REST E")) {
bbs.email(i,WM_EMAIL,attach);
}
break; break;
} }
cur=this.menu.current; cur=this.menu.current;
...@@ -1247,29 +1207,29 @@ menucmd["chat"]=function(key) { ...@@ -1247,29 +1207,29 @@ menucmd["chat"]=function(key) {
case 'M': case 'M':
clear_screen(); clear_screen();
bbs.multinode_chat(); bbs.multinode_chat();
this.redraw();
break; break;
case 'P': case 'P':
clear_screen(); clear_screen();
bbs.private_chat(); bbs.private_chat();
this.redraw();
break; break;
case 'C': case 'C':
clear_screen(); clear_screen();
if(!bbs.page_sysop()) if(!bbs.page_sysop())
bbs.page_guru(); bbs.page_guru();
this.redraw();
break; break;
case 'T': case 'T':
clear_screen(); clear_screen();
bbs.page_guru(); bbs.page_guru();
this.redraw();
break; break;
case 'F': case 'F':
clear_screen(); clear_screen();
bbs.exec("?finger"); bbs.exec("?finger");
console.pause(); console.pause();
this.redraw();
break; break;
case 'R': case 'R':
clear_screen(); clear_screen();
...@@ -1278,12 +1238,12 @@ menucmd["chat"]=function(key) { ...@@ -1278,12 +1238,12 @@ menucmd["chat"]=function(key) {
str=console.getstr(str, 50, K_EDIT|K_LINE|K_AUTODEL); str=console.getstr(str, 50, K_EDIT|K_LINE|K_AUTODEL);
if(!console.aborted) if(!console.aborted)
bbs.exec("?irc -a "+str); bbs.exec("?irc -a "+str);
this.redraw();
break; break;
case 'I': case 'I':
clear_screen(); clear_screen();
bbs.exec("?sbbsimsg"); bbs.exec("?sbbsimsg");
this.redraw();
break; break;
case 'S': case 'S':
this.loadMenu("chatsettings"); this.loadMenu("chatsettings");
...@@ -1319,12 +1279,12 @@ menucmd["settings"]=function(key) { ...@@ -1319,12 +1279,12 @@ menucmd["settings"]=function(key) {
/* Still using this shell? */ /* Still using this shell? */
if(user.command_shell != oldshell) if(user.command_shell != oldshell)
exit(0); exit(0);
this.redraw();
break; break;
case 'B': case 'B':
clear_screen(); clear_screen();
bbs.time_bank(); bbs.time_bank();
this.redraw();
break; break;
case 'F': case 'F':
this.loadMenu("filesettings"); this.loadMenu("filesettings");
......
...@@ -126,12 +126,13 @@ function RightWindow() ...@@ -126,12 +126,13 @@ function RightWindow()
this.alert_height=console.screen_rows-3-this.clock.height; this.alert_height=console.screen_rows-3-this.clock.height;
this.chat_msgs=0; this.chat_msgs=0;
this.notices=[]; this.notices=0;
} }
this.redraw=function() this.redraw=function()
{ {
drawSeparator(console.screen_columns-this.width,2,console.screen_rows-2);
this.clock.draw(this.clock_x,this.clock_y); this.clock.draw(this.clock_x,this.clock_y);
setPosition(this.alert_x,this.alert_y);
this.listNodes();
this.drawInfo(); this.drawInfo();
} }
this.cycle=function() this.cycle=function()
...@@ -141,19 +142,21 @@ function RightWindow() ...@@ -141,19 +142,21 @@ function RightWindow()
} }
if(this.update) { if(this.update) {
clearBlock(this.alert_x,this.alert_y,this.width-1,this.alert_height); clearBlock(this.alert_x,this.alert_y,this.width-1,this.alert_height);
this.drawInfo(); setPosition(this.alert_x,this.alert_y);
this.listNodes(); this.listNodes();
this.drawInfo();
this.update=false; this.update=false;
} }
} }
this.drawInfo=function() this.drawInfo=function()
{ {
setPosition(this.alert_x,this.alert_y); if(this.chat_msgs == 0 && this.notices == 0) return false;
if(this.chat_msgs > 0)
displayInfo(printPadded("\1r\1h *NEW CHAT MSGS*",this.width-1));
if(this.notices.length > 0)
displayInfo(printPadded("\1r\1h *NEW NOTICES*",this.width-1));
displayInfo(""); displayInfo("");
if(this.chat_msgs > 0)
displayInfo(printPadded("\1r\1h *" + this.chat_msgs + " NEW CHAT MSGS*",this.width-1));
if(this.notices > 0)
displayInfo(printPadded("\1r\1h *" + this.notices + " NEW NOTICES*",this.width-1));
} }
this.listNodes=function() this.listNodes=function()
{ {
...@@ -170,6 +173,11 @@ function RightWindow() ...@@ -170,6 +173,11 @@ function RightWindow()
if(count++==0) displayInfo(printPadded("\1w\1hNODE STATUS",this.width-1)); if(count++==0) displayInfo(printPadded("\1w\1hNODE STATUS",this.width-1));
displayInfo(printPadded("\1n" + (n+1) +"\1h: \1n\1g" + system.username(node.useron))); displayInfo(printPadded("\1n" + (n+1) +"\1h: \1n\1g" + system.username(node.useron)));
break; break;
case NODE_QUIET:
if(user.compare_ars("SYSOP") || (bbs.sys_status&SS_TMPSYSOP)) {
displayInfo(printPadded("\1n" + (n+1) +"\1h: \1n\1g" + system.username(node.useron) + " [Q]"));
}
break;
} }
} }
} }
...@@ -178,9 +186,9 @@ function RightWindow() ...@@ -178,9 +186,9 @@ function RightWindow()
this.chat_msgs++; this.chat_msgs++;
this.update=true; this.update=true;
} }
this.addNotice=function(text) this.addNotice=function()
{ {
this.notices.push(text); this.notices++;
this.update=true; this.update=true;
} }
} }
...@@ -195,12 +203,19 @@ function MainWindow() ...@@ -195,12 +203,19 @@ function MainWindow()
this.init=function() this.init=function()
{ {
this.chat.init(settings.main_width,settings.main_height-3,2,5); this.width=console.screen_columns-right.width-2;
this.chat.init(this.width,settings.main_height-3,2,5);
this.chat.input_line.init(9,console.screen_rows,console.screen_columns-9,"\0017","\1k"); this.chat.input_line.init(9,console.screen_rows,console.screen_columns-9,"\0017","\1k");
this.chat.joinChan("BBS MAIN",user.alias,user.name); this.chat.joinChan("BBS MAIN",user.alias,user.name);
this.loadWallPaper(directory(system.text_dir + "cshell/main.*.bin")[0]); this.loadWallPaper(directory(system.text_dir + "cshell/main.*.bin")[0]);
this.chat.chatroom.active=false; this.chat.chatroom.active=false;
} }
this.quitChat=function()
{
for(var c in this.chat.chatroom.channels) {
this.chat.partChan(c,user.alias);
}
}
this.drawTitle=function() this.drawTitle=function()
{ {
var scope=""; var scope="";
...@@ -237,6 +252,10 @@ function MainWindow() ...@@ -237,6 +252,10 @@ function MainWindow()
this.loadWallPaper(directory(system.text_dir + "cshell/main.*.bin")[0]); this.loadWallPaper(directory(system.text_dir + "cshell/main.*.bin")[0]);
this.redraw(); this.redraw();
} }
this.notice=function(text)
{
this.chat.chatroom.notice(text.replace("\r\n",""));
}
this.redraw=function() this.redraw=function()
{ {
if(this.in_chat) { if(this.in_chat) {
...@@ -246,6 +265,7 @@ function MainWindow() ...@@ -246,6 +265,7 @@ function MainWindow()
} else { } else {
this.clear(); this.clear();
} }
drawSeparator(this.chat.chatroom.x+this.chat.chatroom.columns,2,settings.main_height);
} }
this.drawChat=function() this.drawChat=function()
...@@ -255,16 +275,17 @@ function MainWindow() ...@@ -255,16 +275,17 @@ function MainWindow()
} }
this.loadWallPaper=function(file) this.loadWallPaper=function(file)
{ {
var width=this.chat.chatroom.columns;
var height=this.chat.chatroom.rows+3;
if(file_exists(file)) { if(file_exists(file)) {
var size=file_getname(file).split(".")[1].split("x"); var size=file_getname(file).split(".")[1].split("x");
if(size[0]) width=Number(size[0]); var width=Number(size[0]);
if(size[1]) height=Number(size[1]); var height=Number(size[1]);
} if(width <= this.chat.chatroom.columns &&
height <= this.chat.chatroom.rows+3) {
this.wp=new Graphic(width,height); this.wp=new Graphic(width,height);
this.wp.load(file); this.wp.load(file);
} }
}
}
this.drawWallPaper=function() this.drawWallPaper=function()
{ {
var posx=this.chat.chatroom.x; var posx=this.chat.chatroom.x;
...@@ -275,8 +296,6 @@ function MainWindow() ...@@ -275,8 +296,6 @@ function MainWindow()
posx+=parseInt(gapx/2,10); posx+=parseInt(gapx/2,10);
posy+=parseInt(gapy/2,10); posy+=parseInt(gapy/2,10);
} }
if(this.wp.width > this.chat.chatroom.columns ||
this.wp.height > this.chat.chatroom.rows+3) return false;
this.wp.draw(posx,posy); this.wp.draw(posx,posy);
this.wp_shown=true; this.wp_shown=true;
} }
...@@ -409,7 +428,7 @@ function Settings(list) ...@@ -409,7 +428,7 @@ function Settings(list)
this.clock_fg=BLACK; this.clock_fg=BLACK;
this.clock_bg=BG_LIGHTGRAY; this.clock_bg=BG_LIGHTGRAY;
this.right_width=18; this.right_width=20;
for(var s in list) { for(var s in list) {
this[s]=list[s]; this[s]=list[s];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment