2020-07-29 10:51:18 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
2020-07-29 11:13:19 +02:00
|
|
|
<meta name="google-signin-client_id" content="580018768696-4beppspj6cu7rhjnfgok8lbmh9a4n3ok.apps.googleusercontent.com">
|
2020-07-29 10:51:18 +02:00
|
|
|
<title>Elm SPA</title>
|
2020-08-02 15:23:38 +02:00
|
|
|
<link rel="stylesheet" type="text/css" href="./output.css" />
|
|
|
|
<link rel="stylesheet" type="text/css" href="./print.css" media="print" />
|
2020-07-29 11:13:19 +02:00
|
|
|
<script src="https://apis.google.com/js/platform.js" async defer></script>
|
2020-07-29 10:51:18 +02:00
|
|
|
<script src="./Main.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body class="font-serif">
|
|
|
|
<div id="mount"></div>
|
|
|
|
<script>
|
2020-07-29 11:13:19 +02:00
|
|
|
function onSignIn(googleUser) {
|
2020-08-02 22:27:08 +02:00
|
|
|
console.log(googleUser);
|
2020-07-29 11:13:19 +02:00
|
|
|
}
|
|
|
|
|
2020-08-02 15:23:38 +02:00
|
|
|
var app = Elm.Main.init({node: document.getElementById("mount")});
|
|
|
|
|
|
|
|
app.ports.printPage.subscribe(function() {
|
|
|
|
window.print();
|
|
|
|
});
|
2020-08-02 22:27:08 +02:00
|
|
|
|
|
|
|
app.ports.googleSignIn.subscribe(function() {
|
|
|
|
var auth2 = gapi.auth2.getAuthInstance();
|
|
|
|
var googleUser = auth2.signIn();
|
|
|
|
});
|
|
|
|
|
|
|
|
app.ports.googleSignOut.subscribe(function() {
|
|
|
|
var auth2 = gapi.auth2.getAuthInstance();
|
|
|
|
auth2.signOut().then(function() {
|
|
|
|
console.log('Google user successfully signed out.');
|
|
|
|
});
|
|
|
|
});
|
2020-07-29 10:51:18 +02:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|