Skip to content

Instantly share code, notes, and snippets.

@jt2190
Forked from anonymous/omniauth_fb_popup
Created December 26, 2011 15:55
Show Gist options
  • Save jt2190/1521478 to your computer and use it in GitHub Desktop.
Save jt2190/1521478 to your computer and use it in GitHub Desktop.
Code for omniauth fb pop-up login
<html>
<head>
<title>Raoul Allwani's JavaScript problem</title>
</head>
<body>
<a class="login-popup">Login Popup Anchor</h1>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$('a.login-popup').click(function(e) {
console.log('here');
var width = 600, height = 400;
var left = (screen.width / 2) - (width / 2);
var top = (screen.height / 2) - (2 * height / 3);
var features = 'menubar=no,toolbar=no,status=no,width=' + width + ',height=' + height + ',toolbar=no,left=' + left + ',top=' + top;
var loginWindow = window.open('/auth/facebook', '_blank', features);
loginWindow.focus();
e.preventDefault();
return false;
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment