-
Notifications
You must be signed in to change notification settings - Fork 16
/
exolve-widget.html
44 lines (37 loc) · 1.18 KB
/
exolve-widget.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<!--
MIT License
Copyright (c) 2019 Viresh Ratnakar
See the full Exolve license notice in exolve-m.js.
This file can be hosted for use by any site as an iframe src, where
the puzzle spec is provided to Exolve via a message. To use this widget,
follow the instructions at:
https://github.com/viresh-ratnakar/exolve#exolve-widget
-->
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="exolve-m.css?v1.14"/>
<script src="exolve-m.js?v1.14"></script>
<script>
let puzzleText = '';
function receivePuzzle(event) {
if (event.data.indexOf('exolve-begin') < 0) {
return;
}
createExolve(event.data, "", false);
window.removeEventListener("message", receivePuzzle);
}
function prepareToReceivePuzzle() {
window.addEventListener("message", receivePuzzle, false);
let params = new URLSearchParams(document.location.search.substring(1));
let id = params.get("id");
window.parent.postMessage("EXOLVE-READY-" + id, "*");
}
</script>
<title>Exolve Crossword Widget</title>
</head>
<body onload="prepareToReceivePuzzle()">
</body>
</html>