Commit 22b6446a by xhw

更新迭代

parent 136721d0
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js" integrity="sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs=" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js" integrity="sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow@0.0.48/dist/drawflow.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow@0.0.48/dist/drawflow.min.css">
<link rel="stylesheet" type="text/css" href="beautiful.css" /> <link rel="stylesheet" type="text/css" href="beautiful.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
<script src="https://unpkg.com/micromodal/dist/micromodal.min.js"></script> --> <script src="https://unpkg.com/micromodal/dist/micromodal.min.js"></script> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" />
<script src="./js/drawflow.min.js"></script> <script src="./js/drawflow.min.js"></script>
<script src="./js/all.min.js" integrity="sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs=" crossorigin="anonymous"></script> <script src="./js/all.min.js" integrity="sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs=" crossorigin="anonymous"></script>
......
...@@ -14,9 +14,10 @@ ...@@ -14,9 +14,10 @@
<link rel="stylesheet" type="text/css" href="css/drawflow.min.css"> <link rel="stylesheet" type="text/css" href="css/drawflow.min.css">
<script src="js/drawflow.min.js"></script> <script src="js/drawflow.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/beautiful.css" /> <link rel="stylesheet" type="text/css" href="css/beautiful.css" />
<link rel="stylesheet" href="css/all.css" integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" /> <!-- <link rel="stylesheet" href="css/all.css" integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" /> -->
<link href="css/googleapis.css" rel="stylesheet"> <link href="css/googleapis.css" rel="stylesheet">
<script src="js/micromodal.min.js"></script> <script src="js/micromodal.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" />
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
...@@ -149,14 +150,15 @@ ...@@ -149,14 +150,15 @@
html: '<pre><code>'+JSON.stringify(editor.export(), null,4)+'</code></pre>' html: '<pre><code>'+JSON.stringify(editor.export(), null,4)+'</code></pre>'
})">Export</div> })">Export</div>
<div class="btn-clear" onclick="editor.clearModuleSelected()">Clear</div> <div class="btn-clear" onclick="editor.clearModuleSelected()">Clear</div>
<div class="btn-lock"> <div class="btn-lock">
<i id="lock" class="fas fa-lock" onclick="editor.editor_mode='fixed'; changeMode('lock');"></i> <i id="lock" class="fas fa-lock " onclick="editor.editor_mode='fixed'; changeMode('lock');"></i>
<i id="unlock" class="fas fa-lock-open" onclick="editor.editor_mode='edit'; changeMode('unlock');" style="display:none;"></i> <i id="unlock" class="fas fa-lock-open " onclick="editor.editor_mode='edit'; changeMode('unlock');" style="display:none;"></i>
</div> </div>
<div class="bar-zoom"> <div class="bar-zoom">
<i class="fas fa-search-minus" onclick="editor.zoom_out()"></i> <i class="fas fa-search-minus " onclick="editor.zoom_out()"></i>
<i class="fas fa-search" onclick="editor.zoom_reset()"></i> <i class="fas fa-search " onclick="editor.zoom_reset()"></i>
<i class="fas fa-search-plus" onclick="editor.zoom_in()"></i> <i class="fas fa-search-plus " onclick="editor.zoom_in()"></i>
</div> </div>
</div> </div>
</div> </div>
...@@ -237,6 +239,11 @@ ...@@ -237,6 +239,11 @@
} }
window.onload = function() {
rightMenu()
}
var id = document.getElementById("drawflow"); var id = document.getElementById("drawflow");
const editor = new Drawflow(id); const editor = new Drawflow(id);
editor.reroute = true; editor.reroute = true;
...@@ -332,7 +339,14 @@ ...@@ -332,7 +339,14 @@
/* Mouse and Touch Actions */ /* Mouse and Touch Actions */
var x ,y;
function positonXY(event) {
x = event.pageX; // 水平坐标(含滚动距离)
y = event.pageY; // 垂直坐标(含滚动距离)
console.log(`文档坐标:(${x}, ${y})`);
}
const controller = new AbortController();
//tab切换 //tab切换
function TabToggle() { function TabToggle() {
...@@ -349,18 +363,21 @@ ...@@ -349,18 +363,21 @@
//恢复dom事件监听 //恢复dom事件监听
WZCContorller = new Controller(); WZCContorller = new Controller();
// document.removeEventListener('contextmenu', handleContextmenu); // document.removeEventListener('contextmenu', handleContextmenu);
window.off = true
document.getElementById("drawflow").removeEventListener("contextmenu", positonXY) document.getElementById("drawflow").removeEventListener("contextmenu", positonXY)
}else{ }else{
$("#timerSlider").fadeOut(1000) $("#timerSlider").fadeOut(1000)
document.getElementById("drawflow").addEventListener("contextmenu", positonXY)
//显示画板 隐藏底部菜单 //显示画板 隐藏底部菜单
$("#draw").show() $("#draw").show()
$("#timerSlider").hide() $("#timerSlider").hide()
$("#Scene").hide() $("#Scene").hide()
$("body").css("background","#fff") $("body").css("background","#fff")
//解除dom事件监听 //解除dom事件监听
document[on.Start] = null; document[on.Start] = null;
rightMenu() window.off = false
document.getElementById("drawflow").addEventListener("contextmenu", positonXY) // rightMenu()
} }
} }
}); });
...@@ -745,7 +762,7 @@ ...@@ -745,7 +762,7 @@
function changeMode(option) { function changeMode(option) {
//console.log(lock.id); console.log(lock.id);
if(option == 'lock') { if(option == 'lock') {
lock.style.display = 'none'; lock.style.display = 'none';
unlock.style.display = 'block'; unlock.style.display = 'block';
......
...@@ -208,20 +208,23 @@ function handleContextmenu(e) { ...@@ -208,20 +208,23 @@ function handleContextmenu(e) {
customMenu.style.top = posY + 'px'; customMenu.style.top = posY + 'px';
} }
var x ,y; // var x ,y;
function positonXY(event) { // function positonXY(event) {
x = event.pageX; // 水平坐标(含滚动距离) // x = event.pageX; // 水平坐标(含滚动距离)
y = event.pageY; // 垂直坐标(含滚动距离) // y = event.pageY; // 垂直坐标(含滚动距离)
console.log(`文档坐标:(${x}, ${y})`); // console.log(`文档坐标:(${x}, ${y})`);
} // }
// 右键菜单 // 右键菜单
function rightMenu() { function rightMenu() {
const customMenu = document.getElementById('customContextMenu'); const customMenu = document.getElementById('customContextMenu');
const demoArea = document.getElementById('demoArea'); // const demoArea = document.getElementById('demoArea');
// 在文档上监听右键点击事件 // 在文档上监听右键点击事件
document.addEventListener('contextmenu',handleContextmenu); document.getElementById("drawflow").addEventListener('contextmenu',handleContextmenu);
// 点击任意位置关闭菜单(菜单自身点击除外) // 点击任意位置关闭菜单(菜单自身点击除外)
document.addEventListener('click', (e) => { document.addEventListener('click', (e) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment