代码拉取完成,页面将自动刷新
<!doctype html>
<html lang="zh-cmn">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="./src/assets/boxy.png" />
<meta name="description" content="PHP助手 是一款基于 Boxy-Google Blockly 的图形化代码编辑器。" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#4062f6" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="x5-fullscreen" content="true" />
<meta name="fullscreen" content="yes" />
<title>PHP助手</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script>
function handleIconClick() {
Blockly.hideChaff()
}
function handleReadFile(name){
var url = "./api.php";
var data = {
mode: 'read',
name: name
};
fetch(url, {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json'
}
})
.then(function(response) {
return response.json();
})
.then(function(x) {
console.log(x);
Blockly.serialization.workspaces.load(x, store.workspaceSvg);
})
.catch(function(error) {
console.error(error);
});
}
function handleSaveToCloud() {
var phph_name = ''
const json = Blockly.serialization.workspaces.save(store.workspaceSvg)
const text = JSON.stringify(json)
var result = prompt("请输入你的名字", file_name);
if (result === null) {
console.log("用户点击了取消按钮");
phph_name = 'project'
} else {
phph_name = result
}
var file_name = phph_name
var url = "./api.php";
var data = {
// 请求体数据
mode:'save',
code:text,
name:phph_name
};
axios.post(url,JSON.stringify(data))
.then((x)=>{
console.log(x.data)
})
/*fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
body: JSON.stringify(data)
})
.then(function(response) {
return response.json();
})
.then(function(data) {
console.log(data);
})
.catch(function(error) {
console.log(error);
});
*/
}
function handleReadCloud(){
var url = "./api.php";
var data = {
// 请求体数据
mode:'list',
};
axios.post(url,JSON.stringify(data))
.then((x)=>{
console.log(x.data)
openFullscreen(x.data)
})
}
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。