Skip to content

Allow gist navigation #140

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

Merged
merged 1 commit into from
Mar 15, 2020
Merged

Conversation

natefaubion
Copy link
Contributor

No description provided.

@natefaubion
Copy link
Contributor Author

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

@@ -184,6 +184,12 @@
clearInterval(sendSources);
}, { once: true });

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