Skip to content

Commit 771e8c3

Browse files
committed
chore: update legacy example
1 parent aa9d36b commit 771e8c3

File tree

2 files changed

+17
-4
lines changed
  • apps/playground/src/instruments/examples/interactive/Interactive-With-Legacy-Script

2 files changed

+17
-4
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Document</title>
7+
</head>
8+
<body>
9+
<h1>Instrument</h1>
10+
<button type="button" id="submit-btn">Submit</button>
11+
</body>
12+
</html>

apps/playground/src/instruments/examples/interactive/Interactive-With-Legacy-Script/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import { defineInstrument } from '/runtime/v1/@opendatacapture/runtime-core';
44
import { z } from '/runtime/v1/[email protected]';
55

6+
import html from './index.html';
7+
68
import './legacy.js?legacy';
79

810
export default defineInstrument({
@@ -15,13 +17,12 @@ export default defineInstrument({
1517
tags: ['Legacy', 'Internet Explorer 6'],
1618
content: {
1719
render(done) {
18-
const button = document.createElement('button');
19-
button.textContent = 'Submit Instrument';
20-
document.body.appendChild(button);
20+
const button = document.getElementById('submit-btn')!;
2121
button.addEventListener('click', () => {
2222
done({ message });
2323
});
24-
}
24+
},
25+
html
2526
},
2627
clientDetails: {
2728
estimatedDuration: 1,

0 commit comments

Comments
 (0)