Skip to content

Commit

Permalink
一些微小的改进
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperIceCN committed Feb 23, 2021
1 parent b4bcc68 commit b25b773
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
11 changes: 2 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,6 @@ <h4 class="modal-title" translate="yes">管理插件</h4>
<script>
window.setInterval("checkbaseobj()",5000)

/* TODO: Change toolbox XML ID if necessary. Can export toolbox XML from Workspace Factory. */
var toolbox = document.getElementById("toolbox");

var options = {
Expand Down Expand Up @@ -1074,20 +1073,15 @@ <h4 class="modal-title" translate="yes">管理插件</h4>
}
};

/* Inject your workspace */
var workspace = Blockly.inject('blocklyDiv', options);

/* Load Workspace Blocks from XML to workspace. Remove all code below if no blocks to load */

/* TODO: Change workspace blocks XML ID if necessary. Can export workspace blocks XML from Workspace Factory. */
var workspaceBlocks = document.getElementById("workspaceBlocks");

/* Load blocks to workspace. */
Blockly.Xml.domToWorkspace(workspaceBlocks, workspace);
//

window.setTimeout(BlocklyStorage.restoreBlocks, 0);
BlocklyStorage.backupOnUnload();
//

function myUpdateFunction(event) {
var code = Blockly.JavaScript.workspaceToCode(workspace);
document.getElementById('jspreview').innerHTML = code;
Expand All @@ -1107,7 +1101,6 @@ <h4 class="modal-title" translate="yes">管理插件</h4>
}
}
}

</script>
<script>
var jsnum1;
Expand Down
8 changes: 4 additions & 4 deletions jar.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
}
if(isChinese(f.name)){
mdui.alert("您选择的文件名含有中文!这会导致编译系统错误,请改文件名后重新选择!","选择失败");
f=null;
f=null;document.getElementById("sefile").files=[];
}else if(numstart(f.name)){
mdui.alert("您选择的文件名以数字开头!这会导致编译系统错误,请改文件名后重新选择!","选择失败");
f=null;
f=null;document.getElementById("sefile").files=[];
}else if(f.name.indexOf("-")!=-1){
mdui.alert("您选择的文件名含有非法字符!这会导致编译系统错误,请改文件名后重新选择!","选择失败");
f=null;
f=null;document.getElementById("sefile").files=[];
}else if(f.size>=1024*1024){
mdui.alert('您选择的文件大小'+(f.size/1024).toFixed(2)+"KB,文件大小限制1024KB以内!", '选择失败');
f=null;
f=null;document.getElementById("sefile").files=[];
}else{
document.getElementById("uploadbtn").innerHTML=f.name+" "+(f.size/1024).toFixed(2)+"KB";
changed=true;
Expand Down
2 changes: 1 addition & 1 deletion showblock.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<script src="./js/custom/JSON.js"></script>
<xml xmlns="https://developers.google.com/blockly/xml" id="workspaceBlocks" style="display: none"></xml>
</head>
<body>
<body style="background-color: #252525;">
<div id="blocklyDiv" style="position: absolute;width: 97vw;height: 98vh;transform: translateZ(0);"></div>
<script>
function getQueryString(name) {
Expand Down

0 comments on commit b25b773

Please sign in to comment.