Ai
2 Star 2 Fork 0

CodeKpy/PHP助手升级版

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.html 2.50 KB
一键复制 编辑 原始数据 按行查看 历史
CodeKpy 提交于 2023-09-23 13:44 +08:00 . [bugfix]bug多多
<!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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/codekpy/phphelper-2.git
git@gitee.com:codekpy/phphelper-2.git
codekpy
phphelper-2
PHP助手升级版
master

搜索帮助