Created
February 19, 2015 15:33
-
-
Save valzav/8961a9381abb1b852924 to your computer and use it in GitHub Desktop.
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
//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