-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature discussion: Multiple HTML files and working links #28
Comments
Would you want the JS/CSS files to be loaded in all pages? |
Yes, for simplicity. But when using multiple HTML, I think I'll just not make a JS file. |
I think this is an interesting idea, and it could be solved quite elegantly if #6 gets implemented. A dropdown to select the active html file could be shown next to the address field if there are more than one .html file.. |
I don't think #6 should get implemented, as there are a lot of people not using routing. Could be optional though. 🙂 Do you have any suggestions on how to switch pages when overriding local links in the iFrame? I don't think my implementation is very good. |
Is there a safe way to message which page that should be active from inside the iFrame? In my prototype I used an url argument that was picked up in the location variable, but this might mess up some scripts. Is there another way you can think of or is this undoable? |
I didn't know how you'd feel about such a feature, so I thought it would be best to bring it up here. Multiple HTML files is handy for teaching students how websites work.
Multiple HTML files is relatively easy to implement. The trickery comes when trying to make links work to switch between them. I have a working local branch, but it needs polishing before I can make a pull request.
The way I've done it there, is having a new value in
state
calledhtmlInView
, that is set to whichever html file that was clicked last. I've also added a script in the iframe that catches all links pointing to local files and changes them to parameter/hash values. Then I monitor the location.href of the runtime and changehtmlInView
if it points to a html file instate.files
. It's working, but I don't know if this breaks the purpose of a sandbox or if there's an easier way to do this?Any thoughts?
The text was updated successfully, but these errors were encountered: