Skip to content

Commit 532760f

Browse files
authored
Merge pull request #1195 from joshunrau/dev
add html support, meta tag support, fix issue with forms in playground
2 parents 78d72ab + 73e37f2 commit 532760f

File tree

13 files changed

+290
-217
lines changed

13 files changed

+290
-217
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,

apps/playground/src/instruments/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { loadAssetAsBase64 } from '@/utils/load';
88
// Instruments in development
99
const EXCLUDED_LABELS: string[] = [];
1010

11-
const textFiles: { [key: string]: string } = import.meta.glob('./**/*.{css,js,jsx,json,ts,tsx,svg}', {
11+
const textFiles: { [key: string]: string } = import.meta.glob('./**/*.{css,js,jsx,json,ts,tsx,svg,html}', {
1212
eager: true,
1313
import: 'default',
1414
query: '?raw'

0 commit comments

Comments
 (0)