Closed stevenseeley closed 10 years ago
@net-ninja sorry for the slow reply. i'm currently out of town, but will get back to you next week. I was pretty sure I had multiple shells working on a single page, but if it's not working, it's certainly a bug and I will take care of it
bump, I still care about this. @sdether did you end up getting it working?
This works, never mind! (sorry)
Glad you got it working. I was just troubleshooting myself, since it's certainly not as simple as it should be. I tried the fiddle and couldn't get it load the libraries properly. Trying to set up locally, i then realized that you have to also define input_id in the config, since each shell needs its own input div.
Overall, doing multiple shells is annoyingly complicated. It should really be a matter of a using a container ID and then classes to find the view and input.
Readline also has a mode for attaching to an element, so that it activates/deactivates on focus, but that doesn't currently work with Shell, so you have to manage activation/deactivation by yourself, since in the default Shell implementation, Readline binds to the window and takes over all input on activation, which means only one Shell can be active.
I seem to not be able to render a shell and parse input if another shell variable is created. see http://jsfiddle.net/LHJLd/
basically I do this...
var shell = Josh.Shell({ history: history, shell_panel_id: "shell-panel-0", shell_view_id: "shell-view-0" }); shell.activate(); var shell1 = Josh.Shell({ history: history, shell_panel_id: "shell-panel-1", shell_view_id: "shell-view-1"});
and then in the html body: