-
-
Save jt2190/1521478 to your computer and use it in GitHub Desktop.
Code for omniauth fb pop-up login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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