• webv4 add menu items

    From Mortifis@VERT/ALLEYCAT to echicken on Sat Apr 4 17:02:20 2020
    Re: webv4 add menu items
    By: Mortifis to echicken on Fri Apr 03 2020 19:44:48

    https://github.com/echicken/synchronet-web-v4/wiki/Customization#pages

    Just create a subdirectory of webv4/pages/ and put more stuff in there. Those subdirectories can have their own subdirectories, etc. (I think).

    ---
    echicken


    Hmmm ... 1st I created a script 001-own.xjs page in webv4/pages and when I load webv4 it throws an error
    !JavaScript /sbbs/webv4/lib/pages.js line 62: TypeError: f.readln() is null

    also tied putting it in more/004-owm.xjs throws the same error ... apparently I do not know how to add pages or sidebars :'

    ---
    ­ Synchronet ­ AlleyCat! BBS Lake Echo, NS Canada
  • From echicken@VERT/ECBBS to Mortifis on Sat Apr 4 16:30:13 2020
    Re: webv4 add menu items
    By: Mortifis to echicken on Sat Apr 04 2020 17:02:20

    Hmmm ... 1st I created a script 001-own.xjs page in webv4/pages and when I load webv4 it throws an error
    !JavaScript /sbbs/webv4/lib/pages.js line 62: TypeError: f.readln() is null

    also tied putting it in more/004-owm.xjs throws the same error ... apparently I
    do not know how to add pages or sidebars :'

    Is 001-own.xjs empty? If not, can you put its contents somewhere (pastebin, etc.) where I can see them?

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Mortifis@VERT/ALLEYCAT to echicken on Sat Apr 4 17:39:59 2020
    Re: webv4 add menu items
    By: Mortifis to echicken on Sat Apr 04 2020 17:02:20

    Is 001-own.xjs empty? If not, can you put its contents somewhere (pastebin, etc.) where I can see them?

    ---
    echicken

    It's not empty but I changed the externsion to .ssjs and it is working now ... thanks echicken, I'll slowly figure it out ... then I will try to figure out how to change the css colors ...

    ---
    ­ Synchronet ­ AlleyCat! BBS Lake Echo, NS Canada
  • From echicken@VERT/ECBBS to Mortifis on Sat Apr 4 17:09:47 2020
    Re: webv4 add menu items
    By: Mortifis to echicken on Sat Apr 04 2020 17:39:59

    It's not empty but I changed the externsion to .ssjs and it is working now ...
    thanks echicken, I'll slowly figure it out ... then I will try to figure out

    That's confusing. At a glance I can't see why that alone would resolve the error you got. Did you make any other changes while you were at it?

    Also, XJS and SSJS files are subtly different, and XJS is almost always preferable for front-end / user-facing stuff. I'm sure you get the general idea of <?xjs ... ?> from your PHP experience. Did you change the extension as an experiment, or is this actually an SSJS file?

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From Mortifis@VERT/ALLEYCAT to echicken on Sat Apr 4 19:26:08 2020
    Re: webv4 add menu items
    By: Mortifis to echicken on Sat Apr 04 2020 17:39:59

    That's confusing. At a glance I can't see why that alone would resolve the error you got. Did you make any other changes while you were at it?

    Also, XJS and SSJS files are subtly different, and XJS is almost always preferable for front-end / user-facing stuff. I'm sure you get the general idea of <?xjs ... ?> from your PHP experience. Did you change the extension as an experiment, or is this actually an SSJS file?

    ---
    echicken

    it was orinally an .xjs file, I stripped the <?xjs ?> tags and changed the extension to ssjs. I was getting the same error with the sbbslist.xjs so I did the same to that both work ... no worries, thanks for the help, I'll keep playing with it

    (Nice web interface btw :-)

    ~Mortifis

    ---
    ­ Synchronet ­ AlleyCat! BBS Lake Echo, NS Canada
  • From echicken@VERT/ECBBS to Mortifis on Sat Apr 4 20:06:58 2020
    Re: webv4 add menu items
    By: Mortifis to echicken on Sat Apr 04 2020 19:26:08

    it was orinally an .xjs file, I stripped the <?xjs ?> tags and changed the extension to ssjs. I was getting the same error with the sbbslist.xjs so I did
    the same to that both work ... no worries, thanks for the help, I'll keep

    When doing this, you'd also need to convert any non-js stuff into printed JS strings:

    <div>hi</div>

    becomes:

    write('<div>hi</div>');

    but that's a huge pain. I'd rather figure out the cause of the problem than engage in that kind of workaround.

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
  • From echicken@VERT/ECBBS to Mortifis on Sun Apr 5 22:31:39 2020
    Re: webv4 add menu items
    By: Mortifis to echicken on Sun Apr 05 2020 23:12:04

    writeln('<a href="?pages/More/telegram.ssjs&to='+sys.host+'@'+sys.users[j].name
    +'"'>+sys.users[j].name+'</a>');

    !JavaScript SyntaxError: invalid XML attribute value

    is that because of the &=to portion?

    No, that's fine. You've got a misplaced apostrophe/single-quote:

    +'"'>+sys.users[j].name+'</a>');

    Should be:

    +'">'+sys.users[j].name+'</a>');

    ---
    echicken
    electronic chicken bbs - bbs.electronicchicken.com
    þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com