File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 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 ;
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 ) ;
You can’t perform that action at this time.
0 commit comments