Overwrite From Server
Sign-In widget with customizations, overwrite settings from the server
The Widget
The Code
This is the widget with customizations in the page overwriting those saved to your engage account. We had added two providers on the server (Blogger and flickr), but we are overwriting that here with just Twitter. The code you put on your site has precendence over the settings saved to the server as long as you have sufficient permissions to change that setting. Settings that you add in the page are validated, if you had added a provider that does not exist the widget would display a default set of providers. The following code goes in the <head> of your site. (Runs asynchronously – will not slow page load.)
<!doctype html>
<html>
<head>
<script type="text/javascript">
(function() {
if (typeof window.janrain !== 'object') window.janrain = {};
window.janrain.settings = {};
janrain.settings.tokenUrl = '__REPLACE_WITH_YOUR_TOKEN_URL__';
janrain.settings.providers = [
'twitter'
]
function isReady() { janrain.ready = true; };
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", isReady, false);
} else {
window.attachEvent('onload', isReady);
}
var e = document.createElement('script');
e.type = 'text/javascript';
e.id = 'janrainAuthWidget';
if (document.location.protocol === 'https:') {
e.src = 'https://rpxnow.com/js/lib/widget-examples-basic/engage.js';
} else {
e.src = 'http://widget-cdn.rpxnow.com/js/lib/widget-examples-basic/engage.js';
}
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(e, s);
})();
</script>
</head>
<body>
<div id="janrainEngageEmbed"></div>
</body>
</html>