Skip to content

Instantly share code, notes, and snippets.

@valzav
Created February 19, 2015 15:33
Show Gist options
  • Save valzav/8961a9381abb1b852924 to your computer and use it in GitHub Desktop.
Save valzav/8961a9381abb1b852924 to your computer and use it in GitHub Desktop.
//Place your logic in some js function, e.g. check_current_user:
<script>
function check_current_user() {
BTSW.current_user(function(user){
// replace the line below with your logic, e.g. if user then show or hide something
console.log("---- check_current_user : ", user);
})
}
</script>
//Then add script.onload = check_current_user to the widget's code:
<script>
var BTSW = window.BTSW || {};
(function () {
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = 'https://faucet.bitshares.org/widgets/1/w.js?ref='+encodeURIComponent(document.referrer);
script.onload = check_current_user;
var entry = document.getElementsByTagName('script')[0];
entry.parentNode.insertBefore(script, entry);
}());
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment