JSFiddle - React, Tailwind, and code Playground
by gmdavis62
HTML
<html><head></head>
<body onload="window.opener.handleOpenIDResponse((window.location+'').split('?')[1]);window.close();">
<a href="javascript:openPopupWindow('yahoo.com');">
<img src="http://www.yahoo.com/favicon.ico" style="border:none;"/> Sign in with a Yahoo! ID</a>
</body>
</html>
JavaScript
function openPopupWindow(openid) {
document.getElementById('ops').style.display = 'none';
document.getElementById('bucket').innerHTML = 'Signing you in <img src="/static/spinner.gif"/>';
window.open('/openid_begin?openid_identifier='+encodeURIComponent(openid), 'openid_popup', 'width=790,height=580');
}
function handleOpenIDResponse(openid_args) {
document.getElementById('ops').style.display = 'none';
document.getElementById('bucket').innerHTML = 'Verifying OpenID response';
YAHOO.util.Connect.asyncRequest('GET', '/openid_finish?'+openid_args,
{'success': function(r) {
document.getElementById('bucket').innerHTML = r.responseText;
}});
}