Subj : msg_select_area
To : art
From : Digital Man
Date : Tue Nov 10 2009 12:50 pm
Re: msg_select_area
By: art to All on Tue Nov 10 2009 06:50 pm
> Hi all,
>
> In DEFAULT.SRC, there's the following:
>
> cmdkey J
> msg_select_area
>
> How would I call msg_select_area in a .JS? I see previous threads on
> calling Baja modules, but this is still unclear to me, if someone could
> point me in the right direction please?
There is no equivalent function in JavaScript, but here is a snippet from
exec/classic_shell.js that does the same thing:
case 'J':
if(!msg_area.grp_list.length)
continue main;
while(1) {
var orig_grp=bbs.curgrp;
var i=0;
var j=0;
if(msg_area.grp_list.length>1) {
if(file_exists(system.text_dir+"menu/grps.*"))
bbs.menu("grps");
else {
console.putmsg(bbs.text(CfgGrpLstHdr),P_SAVEATR);
for(i=0;
i<msg_area.grp_list.length; i++) {
if(i==bbs.curgrp)
console.print('*');
else
console.print('
');
if(i<9)
console.print('
');
if(i<99)
console.print('
');
console.putmsg(format(bbs.text(CfgGrpLstFmt),i+1,msg_area.grp_list[i].descripti
on),P_SAVEATR);
}
}
console.mnemonics(format(bbs.text(JoinWhichGrp),bbs.curgrp+1));
j=get_next_num(msg_area.grp_list.length,false);
if(j<0)
continue main;
if(!j)
j=bbs.curgrp;
else
j--;
}
bbs.curgrp=j;
if(file_exists(system.text_dir+"menu/subs"+(bbs.curgrp+1)))
bbs.menu("subs"+(bbs.curgrp+1));
else {
console.clear();
console.putmsg(format(bbs.text(SubLstHdr),
msg_area.grp_list[j].description),P_SAVEATR);
for(i=0;
i<msg_area.grp_list[j].sub_list.length; i++) {
var msgbase=new
MsgBase(msg_area.grp_list[j].sub_list[i].code);
if(msgbase==undefined)
continue;
if(!msgbase.open())
continue;
if(i==bbs.cursub)
console.print('*');
else
console.print(' ');
if(i<9)
console.print(' ');
if(i<99)
console.print(' ');
console.putmsg(format(bbs.text(SubLstFmt),i+1,
msg_area.grp_list[j].sub_list[i].description,"",msgbase.total_msgs),P_SAVEATR);
msgbase.close();
}
}
console.mnemonics(format(bbs.text(JoinWhichSub),bbs.cursub+1));
i=get_next_num(msg_area.grp_list[j].sub_list.length,false);
if(i==-1) {
if(msg_area.grp_list.length==1) {
bbs.curgrp=orig_grp;
continue main;
}
continue;
}
if(!i)
i=bbs.cursub;
else
i--;
bbs.cursub=i;
continue main;
}
That didn't paste too well (we need a way to specify 4-space tabs in fseditor),
but you can find that code in:
http://cvs.synchro.net/cgi-bin/viewcvs.cgi/*checkout*/exec/classic_shell.js
digital man
Snapple "Real Fact" #100:
In a year, the average person walks 4 miles makeing their bed.
---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net