1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-09 09:35:02 +09:00

fix challenge

This commit is contained in:
Andrew Simachev 2024-01-22 19:50:46 +01:00
parent 6e7e600c2a
commit 986ee5e0e7
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8

View file

@ -26,7 +26,6 @@
.buttons button:hover { background: #f09c0e; }
</style>
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="./main.js" type="text/javascript"></script>
</head>
<body>
<div class="content">
@ -40,5 +39,35 @@
<button id="close"></button>
</div>
</div>
<script type="text/javascript">
$(() => {
const win = $(window);
const closeButton = $('#close');
const challengeEl = $('#challenge');
document.title = 'Anytype';
closeButton.off('click').on('click', e => {
e.preventDefault();
window.close();
});
win.off('message').on('message', e => {
const { challenge, theme, lang } = e.originalEvent.data;
challengeEl.text(challenge);
$('html').attr({ class: theme });
$.ajax({
url: `../lib/json/lang/${lang}.json`,
method: 'GET',
contentType: 'application/json',
success: data => {
closeButton.text(data.commonClose);
},
});
});
});
</script>
</body>
</html>