Skip to content

Instantly share code, notes, and snippets.

@JFickel
Created June 27, 2014 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JFickel/c4ff315bb502d196f606 to your computer and use it in GitHub Desktop.
Save JFickel/c4ff315bb502d196f606 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<body>
<script>
var parseQueryString = function( queryString ) {
var params = {}, queries, temp, i, l;
// Split into key/value pairs
queries = queryString.split("&");
// Convert the array of strings into an object
for ( i = 0, l = queries.length; i < l; i++ ) {
temp = queries[i].split('=');
params[temp[0]] = temp[1];
}
return params;
};
var params = parseQueryString(window.location.search.slice(1));
var user = { name: "<%= @user.name %>", nickname: "<%= @user.nickname %>", email: "<%= @user.email %>", github_url: "<%= @user.github_url %>" };
<% if ENV['RAILS_ENV'] == 'production' %>
window.opener.postMessage(user, "http://marketplace-browser-client.herokuapp.com");
<% else %>
window.opener.postMessage(user, "http://localhost:4200");
<% end %>
window.close();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment