• msg_select_area

    From art@VERT/FATCATS to All on Wed Nov 11 02:50:11 2009
    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?

    Thanks & regards,
    Art at fatcats dot poorcoding dot com

    | fatcats bbs |
    | + telnet://fatcats.poorcoding.com |
    | + ssh://fatcats.poorcoding.com:2322 |

    ---
    þ Synchronet þ fatcats bbs - http://fatcats.poorcoding.com
  • From Digital Man@VERT to art on Tue Nov 10 20:50:31 2009
    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 þ [vert/cvs/bbs].synchro.net
  • From art@VERT/FATCATS to Digital Man on Wed Nov 11 20:30:32 2009
    Re: msg_select_area
    By: Digital Man to art on Tue Nov 10 2009 12:50:31

    There is no equivalent function in JavaScript, but here is a snippet from exec/classic_shell.js that does the same thing:

    Hi Digital Man, thanks.

    I was hoping a function existed, I have seen the one in classic_shell.js, so I suppose I'll have to work from that.

    Kind regards,
    Art at fatcats dot poorcoding dot com

    | fatcats bbs |
    | + telnet://fatcats.poorcoding.com |
    | + ssh://fatcats.poorcoding.com:2322 |

    ---
    þ Synchronet þ fatcats bbs - http://fatcats.poorcoding.com
  • From Digital Man@VERT to art on Thu Nov 12 04:23:03 2009
    Re: msg_select_area
    By: art to Digital Man on Wed Nov 11 2009 12:30 pm

    Re: msg_select_area
    By: Digital Man to art on Tue Nov 10 2009 12:50:31

    There is no equivalent function in JavaScript, but here is a snippet
    from exec/classic_shell.js that does the same thing:

    Hi Digital Man, thanks.

    I was hoping a function existed, I have seen the one in classic_shell.js,
    so I suppose I'll have to work from that.

    A "bbs" function (method for the 'bbs' object) is probably a good idea (similar to the select_editor and select_shell methods) though. I'll put it on the to-do list.

    digital man

    Snapple "Real Fact" #188:
    Antarctica is the driest, coldest, windiest, and highest continent on earth.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net