Skip to content

Conversation

natefaubion
Copy link
Contributor

No description provided.

@natefaubion
Copy link
Contributor Author

Note this looks for gist.github.com urls, not ?gist= urls.


window.addEventListener("message", function(event) {
if (event.data && event.data.gistId && /^[0-9a-f]+$/.test(event.data.gistId)) {
window.location.search = "gist=" + event.data.gistId;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to worry about this clobbering other query string parameters? I haven’t worked out what the session one does yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just went with this because that's how all the current links work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is supposed to preserve session, which saves your editor to local state.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants