Skip to content

Commit 395a603

Browse files
authored
Update index.html
1 parent 9d5a5c9 commit 395a603

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@
5757
border-top: 1px solid #ccc;
5858
background: #fff;
5959
}
60-
button {
60+
button, label[for="loadFile"] {
6161
margin-right: 10px;
6262
padding: 5px 10px;
6363
cursor: pointer;
64+
background: #eee;
65+
border: 1px solid #ccc;
66+
border-radius: 4px;
67+
display: inline-block;
6468
}
6569
#output {
6670
margin-top: 5px;
@@ -98,8 +102,8 @@
98102
<div style="display: flex; justify-content: center; align-items: center; gap: 15px; margin: 10px;">
99103
<h2 style="margin: 0;">Blockly JavaScript Builder</h2>
100104
<button onclick="saveWorkspace()">💾 Save</button>
101-
<input type="file" id="loadFile" style="display: none;" accept=".xml" />
102-
<button onclick="document.getElementById('loadFile').click()">📂 Load</button>
105+
<label for="loadFile">📂 Load</label>
106+
<input type="file" id="loadFile" accept=".xml" style="display: none;" />
103107
</div>
104108

105109
<div id="main">
@@ -306,7 +310,7 @@ <h4 style="margin: 0;">📄 JavaScript Code</h4>
306310
reader.onload = function(e) {
307311
const xmlText = e.target.result;
308312
try {
309-
const xml = Blockly.utils.xml.textToDom(xmlText); // ✅ FIXED
313+
const xml = Blockly.utils.xml.textToDom(xmlText);
310314
Blockly.Xml.clearWorkspaceAndLoadFromXml(xml, workspace);
311315
} catch (err) {
312316
alert("❌ Failed to load workspace: " + err.message);

0 commit comments

Comments
 (0)