-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
418 lines (380 loc) · 24.1 KB
/
Copy pathindex.html
File metadata and controls
418 lines (380 loc) · 24.1 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DSPF·RAD · Browser-based IBM i (AS/400) display file designer</title>
<meta name="description"
content="DSPF·RAD is a browser-based RAD designer for IBM i (AS/400) display files. Drag widgets onto a 5250 grid (24x80 or 27x132) and watch DSPF source regenerate live. Supports subfiles (SFL/SFLCTL), ENPTUI controls, and RPGLE / COBOL skeleton generation.">
<meta name="keywords"
content="DSPF, DDS, IBM i, AS/400, AS400, iSeries, System i, 5250, 5251, RPG, RPGLE, COBOL, display file, subfile, SFL, SFLCTL, ENPTUI, terminal designer, RAD, green screen, SDA">
<meta name="author" content="Alexandre Bencz">
<meta name="robots" content="index, follow">
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large">
<meta name="theme-color" content="#008080">
<link rel="canonical" href="https://dspf-rad.bencz.cc/">
<!-- Open Graph (Facebook, LinkedIn, Discord, Slack, ...) -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="DSPF·RAD">
<meta property="og:title" content="DSPF·RAD · Browser-based IBM i display file designer">
<meta property="og:description" content="Drag-and-drop RAD designer for DSPF (display files) on IBM i / AS/400. Live two-way sync between canvas and source, with RPGLE and COBOL skeleton generation.">
<meta property="og:url" content="https://dspf-rad.bencz.cc/">
<meta property="og:image" content="https://github.com/user-attachments/assets/0ece6fdb-8651-4c0f-9ca9-1dc545fc8b5b">
<meta property="og:image:width" content="1510">
<meta property="og:image:height" content="864">
<meta property="og:image:alt" content="DSPF·RAD designer showing a 5250 sign-on screen with palette, canvas, inspector and live DSPF source.">
<meta property="og:locale" content="en_US">
<!-- Twitter / X card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="DSPF·RAD · Browser-based IBM i display file designer">
<meta name="twitter:description" content="Drag-and-drop RAD designer for DSPF on IBM i / AS/400. Two-way sync between canvas and source.">
<meta name="twitter:image" content="https://github.com/user-attachments/assets/0ece6fdb-8651-4c0f-9ca9-1dc545fc8b5b>
<meta name="twitter:image:alt" content="DSPF·RAD designer showing a 5250 sign-on screen with palette, canvas, inspector and live DSPF source.">
<!-- Structured data for search engines (schema.org SoftwareApplication) -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "DSPF·RAD",
"url": "https://dspf-rad.bencz.cc/",
"description": "Browser-based RAD designer for IBM i (AS/400) display files (DSPF). Drag widgets onto a 5250 grid with live two-way sync between the canvas and DSPF source. Includes RPGLE and COBOL skeleton generators with protected regions.",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any (web browser)",
"browserRequirements": "Requires a modern browser with ES modules and import maps (Chrome, Firefox, Safari, Edge).",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"license": "https://www.gnu.org/licenses/gpl-3.0.en.html",
"codeRepository": "https://github.com/bencz/DSPF-RAD",
"sameAs": [
"https://github.com/bencz/DSPF-RAD"
],
"author": {
"@type": "Person",
"name": "Alexandre Bencz",
"url": "https://github.com/bencz"
}
}
</script>
<link rel="icon" type="image/svg+xml"
href="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><rect width='64' height='64' fill='%23050a05'/><text x='32' y='44' font-family='monospace' font-size='18' font-weight='bold' fill='%2333ff33' text-anchor='middle'>DSPF</text></svg>">
<!-- 98.css gives us the Win98 chrome — bitmap MS Sans Serif font, raised/sunken
3D borders, native button/input/select look, .window + .title-bar + .status-bar
primitives. Loaded BEFORE our styles.css so we can override what doesn't
fit (compact menubar buttons, the dark embedded canvas, the dark CodeMirror
editor inside its Win98 frame, the custom palette items, etc.). -->
<link rel="stylesheet" href="https://unpkg.com/98.css">
<link rel="stylesheet" href="styles.css">
<!-- No-FOUC theme application — runs BEFORE styles.css paints.
Reads localStorage first (explicit user choice wins). If empty,
falls back to the OS preference via prefers-color-scheme. Once
the rest of the app boots, src/app/Theme.js takes over the
wiring (toggle button + live OS-pref tracking).
Kept inline because any external script would race the first
paint and cause a light↔dark flash. -->
<script>
(function () {
try {
var saved = localStorage.getItem('dspf-theme');
var theme = saved
|| (window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark' : 'light');
document.documentElement.setAttribute('data-theme', theme);
} catch (_) {
document.documentElement.setAttribute('data-theme', 'light');
}
})();
</script>
<!-- Import map so CodeMirror 6 sub-packages share a single instance
of @codemirror/state / @codemirror/view across the dep graph.
Without this, esm.sh serves a fresh copy of @codemirror/state to
each sub-package and the EditorView's instanceof checks fail with
"Unrecognized extension value". Every package is fetched with
?external= for its sub-deps so esm.sh emits bare imports, which
the browser resolves through this map to ONE URL per package. -->
<script type="importmap">
{
"imports": {
"@codemirror/state": "https://esm.sh/@codemirror/state@6.5.0",
"@codemirror/view": "https://esm.sh/@codemirror/view@6.34.0?external=@codemirror/state",
"@codemirror/language": "https://esm.sh/@codemirror/language@6.10.0?external=@codemirror/state,@codemirror/view,@lezer/common,@lezer/highlight",
"@codemirror/autocomplete": "https://esm.sh/@codemirror/autocomplete@6.18.0?external=@codemirror/state,@codemirror/view,@codemirror/language",
"@codemirror/commands": "https://esm.sh/@codemirror/commands@6.7.0?external=@codemirror/state,@codemirror/view,@codemirror/language",
"@codemirror/search": "https://esm.sh/@codemirror/search@6.5.6?external=@codemirror/state,@codemirror/view",
"@codemirror/lint": "https://esm.sh/@codemirror/lint@6.8.0?external=@codemirror/state,@codemirror/view",
"@lezer/common": "https://esm.sh/@lezer/common@1.2.3",
"@lezer/highlight": "https://esm.sh/@lezer/highlight@1.2.1?external=@lezer/common",
"@lezer/lr": "https://esm.sh/@lezer/lr@1.4.2?external=@lezer/common",
"codemirror": "https://esm.sh/codemirror@6.0.1?external=@codemirror/state,@codemirror/view,@codemirror/language,@codemirror/autocomplete,@codemirror/commands,@codemirror/search,@codemirror/lint"
}
}
</script>
</head>
<body class="dspf-rad">
<!-- Outer "shell" window fills the viewport. Title-bar is the classic Win98
blue gradient; the controls on the right are decorative (tabindex=-1)
since this lives inside the browser. -->
<div class="window app-window">
<div class="title-bar">
<div class="title-bar-text">
<span class="app-brand-mark">DSPF</span> · RAD — IronTerm Display File Designer
</div>
</div>
<div class="app-body">
<!-- Classic Win98 menubar. Each top-level <li> is a menu (File,
Record, View, Export, Help) with a .menu-title button and a
.menu-dropdown <ul> that appears on click. Menu items carry
a data-cmd that the menubar controller in main.js dispatches
to the hidden #legacyControls (where the existing
handlers live). No JS handler in main.js needed to move —
we only synthesize clicks/changes on those hidden controls.
Access keys are marked with <u>X</u> for visual hint only;
we don't bind Alt+letter (avoids fighting browser defaults). -->
<menu id="menubar" role="menubar">
<li class="menu" data-menu="file">
<button class="menu-title" type="button"><u>F</u>ile</button>
<ul class="menu-dropdown" role="menu">
<li><button class="menu-item" data-cmd="newDoc">
<span class="menu-label"><u>N</u>ew</span>
<span class="menu-accel">Ctrl+N</span>
</button></li>
<li><button class="menu-item" data-cmd="openDoc">
<span class="menu-label"><u>O</u>pen…</span>
<span class="menu-accel">Ctrl+O</span>
</button></li>
<li><button class="menu-item" data-cmd="saveDoc">
<span class="menu-label"><u>S</u>ave</span>
<span class="menu-accel">Ctrl+S</span>
</button></li>
</ul>
</li>
<li class="menu" data-menu="export">
<button class="menu-title" type="button"><u>E</u>xport</button>
<ul class="menu-dropdown" role="menu">
<li><button class="menu-item" data-cmd="genRpgle">
<span class="menu-label">Generate <u>R</u>PGLE skeleton…</span>
</button></li>
<li><button class="menu-item" data-cmd="genCobol">
<span class="menu-label">Generate <u>C</u>OBOL skeleton…</span>
</button></li>
<li class="menu-separator"></li>
<li><button class="menu-item" data-cmd="exportJson">
<span class="menu-label">Copy model as <u>J</u>SON (debug)</span>
</button></li>
</ul>
</li>
<li class="menu" data-menu="help">
<button class="menu-title" type="button"><u>H</u>elp</button>
<ul class="menu-dropdown" role="menu">
<li><button class="menu-item" data-cmd="about">
<span class="menu-label"><u>A</u>bout DSPF·RAD…</span>
</button></li>
</ul>
</li>
<!-- Flex spacer + the right-side bits the old toolbar carried
(interaction hint chip and the ephemeral status text). -->
<li class="menubar-spacer" aria-hidden="true"></li>
<li class="menubar-info">
<button id="themeToggle" type="button" class="theme-toggle"
title="Toggle light/dark theme" aria-label="Toggle theme">☀</button>
<span class="hint" title="Drag from palette · Click to select · Arrow keys to nudge (Shift = ×5) · Del to remove">drag·click·arrows·Del</span>
<span id="status" class="toolbar-status">ready</span>
</li>
</menu>
<!-- Visible toolbar row beneath the menubar. Holds the controls
the user reaches for most often — Model, Record, view toggles.
Classic VB6 / Borland layout: menubar for discoverable actions,
toolbar for the fast-path controls. IDs match what main.js
already wires up, so no handler changes are needed. -->
<div id="toolbar" class="toolbar-row">
<label class="lbl">Model
<select id="modelSel" title="Display file geometry">
<option value="24x80" selected>24×80 (5251-11)</option>
<option value="27x132">27×132 (3477-FC)</option>
</select>
</label>
<span class="sep" aria-hidden="true"></span>
<label class="lbl">Record
<select id="recordSel" title="Active record format"></select>
</label>
<button id="addRecord" title="Add a new record format">+R</button>
<button id="addSubfile" title="Add a Subfile pair (SFL + SFLCTL) wired with defaults">+SFL</button>
<button id="renameRecord" title="Rename the active record format">⇄</button>
<button id="deleteRecord" title="Delete the active record format">−R</button>
<span class="sep" aria-hidden="true"></span>
<button id="overlayToggle" class="toggle"
title="Render the other records faded behind the active one">Overlay</button>
<button id="hideCondToggle" class="toggle"
title="Hide items that only render when an indicator is on/off (cleans up screens like CLOCK)">Hide cond</button>
</div>
<!-- Legacy controls — originals the JS handlers in main.js are bound
to. Menubar items dispatch by id (e.g. File > New calls
#newDoc.click()). Hidden via [hidden] but present in the DOM so
click events still fire. Visible controls (Model / Record /
Overlay / Hide cond) were lifted to #toolbar above; only the
menubar-only commands stay here. -->
<div id="legacyControls" hidden>
<button id="newDoc" title="Discard the current design and start fresh">New</button>
<button id="openDoc" title="Open DSPF source">Open…</button>
<button id="saveDoc" title="Generate DSPF source">Save</button>
<input id="fileInput" type="file">
<button id="genRpgle" title="Generate RPGLE skeleton with protected regions">↗ RPGLE</button>
<button id="genCobol" title="Generate COBOL skeleton with protected regions">↗ COBOL</button>
<button id="exportJson" title="Copy internal model as JSON (debug)">{·}</button>
</div>
<!-- 3-column workspace: Palette | Canvas | Inspector.
Each side panel is its own Win98 .window with a title bar —
MDI-style nesting that matches IDEs of the era (VB6 / Borland). -->
<div class="workspace">
<aside class="window panel palette" id="palette">
<div class="title-bar">
<div class="title-bar-text">Palette</div>
</div>
<div class="panel-body">
<div class="palette-group">
<h4>Widgets</h4>
<div class="palette-item" draggable="true" data-kind="constant" data-text="Sample">
<span class="pi-icon">A</span><span class="pi-label">Constant</span>
</div>
<div class="palette-item" draggable="true" data-kind="input" data-length="10">
<span class="pi-icon">▭</span><span class="pi-label">Input field</span>
</div>
<div class="palette-item" draggable="true" data-kind="output" data-length="10">
<span class="pi-icon">▷</span><span class="pi-label">Output field</span>
</div>
<div class="palette-item" draggable="true" data-kind="both" data-length="10">
<span class="pi-icon">⇄</span><span class="pi-label">I/O field</span>
</div>
</div>
<div class="palette-group">
<h4>Presets</h4>
<div class="palette-item" draggable="true" data-kind="constant" data-text="================================================================================">
<span class="pi-icon">─</span><span class="pi-label">Rule line</span>
</div>
<div class="palette-item" draggable="true" data-kind="constant" data-text="Sign On" data-dspatr="HI" data-color="WHT">
<span class="pi-icon">»</span><span class="pi-label">"Sign On" title</span>
</div>
<div class="palette-item" draggable="true" data-kind="input" data-length="10" data-name="USER" data-dspatr="UL">
<span class="pi-icon">▭</span><span class="pi-label">USER (10A, UL)</span>
</div>
<div class="palette-item" draggable="true" data-kind="input" data-length="10" data-name="PASSWD" data-dspatr="ND,UL">
<span class="pi-icon">▭</span><span class="pi-label">Password (ND·UL)</span>
</div>
<div class="palette-item" draggable="true" data-kind="output" data-length="6" data-name="MSG" data-dspatr="HI" data-color="YLW">
<span class="pi-icon">▷</span><span class="pi-label">Message (HI·YLW)</span>
</div>
<div class="palette-item" draggable="true" data-kind="constant" data-text="F3=Exit F12=Cancel" data-color="BLU">
<span class="pi-icon">⌨</span><span class="pi-label">Function-key legend</span>
</div>
</div>
<div class="palette-group">
<h4>ENPTUI controls</h4>
<div class="palette-item" draggable="true" data-kind="pushbtn">
<span class="pi-icon">⊓</span><span class="pi-label">Push button</span>
</div>
<div class="palette-item" draggable="true" data-kind="pushbtnGroup">
<span class="pi-icon">⊓⊓</span><span class="pi-label">Push button group (3)</span>
</div>
<div class="palette-item" draggable="true" data-kind="radio">
<span class="pi-icon">◉</span><span class="pi-label">Radio (single)</span>
</div>
<div class="palette-item" draggable="true" data-kind="radioGroup">
<span class="pi-icon">◉</span><span class="pi-label">Radio group (3)</span>
</div>
<div class="palette-item" draggable="true" data-kind="checkbox">
<span class="pi-icon">☑</span><span class="pi-label">Checkbox (single)</span>
</div>
<div class="palette-item" draggable="true" data-kind="checkGroup">
<span class="pi-icon">☑</span><span class="pi-label">Check group (3)</span>
</div>
<div class="palette-item" draggable="true" data-kind="mnubar">
<span class="pi-icon">≡</span><span class="pi-label">Menu bar (2 items)</span>
</div>
<div class="palette-item" draggable="true" data-kind="cntfld">
<span class="pi-icon">¶</span><span class="pi-label">Continued field</span>
</div>
<div class="palette-item" draggable="true" data-kind="errmsg">
<span class="pi-icon">!</span><span class="pi-label">Error msg field</span>
</div>
</div>
<div class="palette-group">
<h4>System values</h4>
<div class="palette-item" draggable="true" data-kind="sysvalue" data-sys="DATE">
<span class="pi-icon">⌚</span><span class="pi-label">DATE</span>
</div>
<div class="palette-item" draggable="true" data-kind="sysvalue" data-sys="TIME">
<span class="pi-icon">⌛</span><span class="pi-label">TIME</span>
</div>
<div class="palette-item" draggable="true" data-kind="sysvalue" data-sys="USER">
<span class="pi-icon">☻</span><span class="pi-label">USER</span>
</div>
<div class="palette-item" draggable="true" data-kind="sysvalue" data-sys="SYSNAME">
<span class="pi-icon">⌬</span><span class="pi-label">SYSNAME</span>
</div>
</div>
<p class="palette-hint">
Drag onto the grid <em>or</em> click an item then click the grid (click-to-place).
</p>
</div>
</aside>
<!-- Canvas sits in a sunken 3D well — looks like the embedded
terminal display in a Client Access / PCOMM Win98 window. -->
<main class="canvas-wrap">
<div class="canvas-frame" id="canvasFrame">
<canvas id="grid" tabindex="0"></canvas>
</div>
<div class="canvas-help" id="canvasHelp">Drag a widget from the palette onto the grid.</div>
</main>
<aside class="window panel inspector" id="inspector">
<div class="title-bar">
<div class="title-bar-text">Inspector</div>
</div>
<div class="panel-body" id="inspectorBody">
<p class="empty">Nothing selected.</p>
</div>
</aside>
</div>
<!-- Splitter between workspace and source panel. The classic Win98
splitter pattern (dotted gripper in the middle) is drawn via
::after in CSS. -->
<div class="resize-handle" id="resizeHandle" role="separator"
aria-label="Resize source panel" aria-orientation="horizontal"></div>
<!-- Bottom source panel: its own Win98 sub-window with a title bar
plus a gray sub-toolbar holding the column-marker toggle and
the sync-status LED. The collapse arrow MUST live in the
title-bar (not the sub-toolbar) because the sub-toolbar is
hidden when collapsed — keeping the arrow inside the title-bar
means the user can always click it to re-expand. The button
has no aria-label so 98.css's [aria-label="Minimize"]
background-image rule doesn't paint over our ▾/▴ text. -->
<section class="window source-panel" id="sourcePanel">
<div class="title-bar">
<div class="title-bar-text">Source — DSPF</div>
<div class="title-bar-controls">
<button id="sourceCollapse" class="source-collapse"
title="Hide source panel">▾</button>
</div>
</div>
<div class="source-toolbar">
<button id="cursorColToggle" class="source-chip"
title="Vertical column marker at cursor position">┃ col</button>
<span class="source-toolbar-spacer"></span>
<span class="source-status ok" id="sourceStatus" title="Sync state">sync</span>
</div>
<div class="source-editor" id="sourceEditor"></div>
</section>
<!-- 98.css .status-bar gets the classic horizontal-striped bottom
field layout for free. IDs match what main.js writes to. -->
<div id="statusbar" class="status-bar" role="status" aria-live="polite">
<p class="status-bar-field" id="sbModel" title="Display model">24×80</p>
<p class="status-bar-field" id="sbRecord" title="Active record">—</p>
<p class="status-bar-field" id="sbItems" title="Item count in active record">0 items</p>
<p class="status-bar-field" id="sbCursor" title="Grid cursor (row, col)">(–,–)</p>
</div>
</div>
</div>
<script type="module" src="src/main.js"></script>
</body>
</html>