forked from MajorVictory/3DDiceRoller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autodice.php
30 lines (25 loc) · 827 Bytes
/
autodice.php
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
<!DOCTYPE html>
<html>
<head>
<title>AutoDicer</title>
<script type='text/javascript'>
var m_ChildWindow = null;
function OpenChildWIndow() {
m_ChildWindow = window.open("http://dnd.majorsplace.com/dicex");
}
function RollDice() {
if (m_ChildWindow) {
let notation = $t.id('notation').value;
m_ChildWindow.postMessage(notation);
}
}
</script>
</head>
<body>
<button onclick='OpenChildWIndow();'>Open Dice window</button>
<br><br>
<input type="text" id="notation">
<button onclick='RollDice();'>Roll Dice</button>
<script type="text/javascript" src="./includes/teal.js"></script>
</body>
</html>