Skip to content

Dynamically loading panes #28

@josephguillaume

Description

@josephguillaume

Responding to the README:

And so we hope we will end up with panes dynamically laoded according to user configuration preferences.

I thought I'd describe what I currently do and what I'm still missing.

A pane needs to be defined and registered using JS, so I have a index.html file that provides a custom pane sitting in my pod. When I navigate to it within solidos, it gets rendered in an IFrame.
Within that file, I call

parent.panes.register(p)

Or so that it becomes the default pane for that session:

parent.panes.list.unshift(p)                                                       
parent.panes["myPaneName"]=p
  1. The latter is a workaround because register always adds panes in order of decreasing preference, so a user-defined pane will never be default
  2. I currently have to specifically navigate to index.html within solidos. Pasting the URL straight into the location bar doesn't load solidos, and navigating to the folder loads solidos but not index.html. Implement the index.html convention client-side in the folder browser solidos#196 would change the latter, i.e. the pane registration code would run automatically when navigating to the folder
  3. In some use cases, I don't need the pane to be always available - it would be ok for it to be registered only when navigating to a folder. For other use cases, it would be useful if the pane was automatically loaded from my preferences file (perhaps lazily the first time the relevant class is encountered). Presumably this would be just JS rather than an index.html, though maybe it could be an entire custom component.
  4. I do see there are security issues with executing arbitrary JS that has access to the entire parent solidos environment. I only have html files I have written in my pod at this time.

Despite the limitations above I find it very useful to be able to change a custom pane on the fly rather than having to recompile and without adding it to the mashlib bundle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions