Skip to content

Instantly share code, notes, and snippets.

@BitPuffin
Last active December 25, 2015 06:59
Show Gist options
  • Save BitPuffin/6936429 to your computer and use it in GitHub Desktop.
Save BitPuffin/6936429 to your computer and use it in GitHub Desktop.
var signinLink = document.getElementById('signin')
var signoutLink = document.getElementById('signout')
if (signinLink) {
signinLink.onclick = function() { alert("Time to sign in!"); navigator.id.request(); }
}
if (signoutLink) {
signoutLink.onclick = function() { navigator.id.logout(); }
}
#! stdtmpl
# proc htmlLayout(request: TRequest, content, title: string): string =
# result = ""
<!DOCTYPE html>
<html>
<head>
<title>${title}</title>
<script src="https://login.persona.org/include.js"></script>
<script src="/js/personabuttons.js"></script>
<script src="/js/personawatcher.js"></script>
</head>
<body>
<h1>Personal Site</h1>
${content}
<a href="#" id="signin"><img src="https://developer.mozilla.org/files/3969/plain_sign_in_blue.png"/></a>
<a href="#" id="signout">sign out</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment