« first day (788 days earlier)      last day (1851 days later) » 

 
7 hours later…
4:59 PM
@ngn Are you around to help me with some APL-related JS?
 
Ven
5:17 PM
APL-related JS?
 
@Ven The language bar.
 
Ven
if it's more related to JS than APL, maybe I can take a look
 
@Ven Sure, one sec, let me create a gist, but be warned, it is very much ngn/Arthur Whitney style JS.
 
Ven
@Adám I know I already took a look at the source back then
 
@Ven OK, so I have this which uses getElementById("lb") in a few places. I want to modify it so it acts on all the .lb elements instead of the single #lb element. Unfortunately, JS isn't as good for array programming as APL is… And I'm not a (good) JS programmer
 
Ven
5:26 PM
@Adám so it will create many language bars?
Beause the mousedown event isn't technically on #lb
 
@Ven Yes, eleven of them.
@Ven I know. #lb was just a container I created.
:49627342 I get: SyntaxError: redeclaration of formal parameter lb lb.js:40:12note: Previously declared at line 30, column 44
 
Ven
I just updated the gist
 
@Ven Ah, that may just have worked. I'll have to restyle it a bit to see the effect. I'll get back to you. Thanks so far.
@Ven Yesss, that does it. Thank you so much!
 
Ven
5:42 PM
Glad to give back a bit ;-).
 
@Ven Ah, there may be an issue. When pressing backtick, only the first language bar changes background colour, and the mode doesn't really work.
 
Ven
do you have a codepen page, or some interactive page with markup associated?
 
@Ven I can try to create one. Hang on.
 
Ven
...And they all insert to the same bar
 
@Ven Sure. That's intentional. On the real page, AJAX will toggle which div is visible, one at a time.
 
Ven
5:51 PM
wait, you want all the language bars to light up at once?
 
@Ven It doesn't really matter, as only one is visible at any one given time, but being that there is no point in distinguishing them, why not?
Actually, the handling of backtick and tab substitution is probably unnecessary to replicate 11 times…
 
Ven
You might need to explain a bit harder then :). You want language bars for several APL variants, like ngn's, dzaima's, Dyalog's, Extended's?
 
@Ven No, I have a single large html page where JS takes care of which visual page is visible at any given time. On each "page" there is an input field, and I'd like one language bar immediately adjacent to each input field
 
Ven
The idea of the "nearest lb" is a bit of a difficult one
well, trivial but dangerous
 
@Ven What? Each language bar just inserts into the input field that has focus.
 
Ven
6:06 PM
That's fine by you?
 
@Ven Yes. That is as it should be. If the user doesn't tamper with the page content, there'll only ever be one language bar and one input field visible at any given time. And if the user does tamper, no harm is done.
 
Ven
@Adám Maybe this.
 
@Ven I'd imagine "nearest lb" could be implemented as having a tag on every input specifying which bar it should use?
 
Ven
@dzaima yes, probably. But I went the "all LBs are affected" route instead ;-).
really I could just go up a container until a find an element with the class "lb".
 
6:27 PM
@Ven Perfect. Thank you!
 
 
5 hours later…
ngn
10:57 PM
@Adám it looks like Ven solved the problem. out of curiosity, why would you need more than 1 language bar?
 
5 hours ago, by Adám
@Ven No, I have a single large html page where JS takes care of which visual page is visible at any given time. On each "page" there is an input field, and I'd like one language bar immediately adjacent to each input field
 

« first day (788 days earlier)      last day (1851 days later) »