Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Security
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xhw
Security
Commits
22b6446a
Commit
22b6446a
authored
Aug 01, 2025
by
xhw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新迭代
parent
136721d0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
19 deletions
+39
-19
docs/index.html
+1
-1
index.html
+27
-10
js/index.js
+11
-8
No files found.
docs/index.html
View file @
22b6446a
...
...
@@ -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>
<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" 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">
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></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/all.min.js"
integrity=
"sha256-KzZiKy0DWYsnwMF+X1DvQngQ2/FxF7MF3Ff72XcpuPs="
crossorigin=
"anonymous"
></script>
...
...
index.html
View file @
22b6446a
...
...
@@ -14,9 +14,10 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/drawflow.min.css"
>
<script
src=
"js/drawflow.min.js"
></script>
<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"
>
<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>
<body>
<div
id=
"wrapper"
>
...
...
@@ -149,14 +150,15 @@
html: '<pre><code>'+JSON.stringify(editor.export(), null,4)+'</code></pre>'
})"
>
Export
</div>
<div
class=
"btn-clear"
onclick=
"editor.clearModuleSelected()"
>
Clear
</div>
<div
class=
"btn-lock"
>
<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=
"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>
</div>
<div
class=
"bar-zoom"
>
<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-plus
"
onclick=
"editor.zoom_in()"
></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-plus
"
onclick=
"editor.zoom_in()"
></i>
</div>
</div>
</div>
...
...
@@ -237,6 +239,11 @@
}
window
.
onload
=
function
()
{
rightMenu
()
}
var
id
=
document
.
getElementById
(
"drawflow"
);
const
editor
=
new
Drawflow
(
id
);
editor
.
reroute
=
true
;
...
...
@@ -332,7 +339,14 @@
/* 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切换
function
TabToggle
()
{
...
...
@@ -349,18 +363,21 @@
//恢复dom事件监听
WZCContorller
=
new
Controller
();
// document.removeEventListener('contextmenu', handleContextmenu);
window
.
off
=
true
document
.
getElementById
(
"drawflow"
).
removeEventListener
(
"contextmenu"
,
positonXY
)
}
else
{
$
(
"#timerSlider"
).
fadeOut
(
1000
)
document
.
getElementById
(
"drawflow"
).
addEventListener
(
"contextmenu"
,
positonXY
)
//显示画板 隐藏底部菜单
$
(
"#draw"
).
show
()
$
(
"#timerSlider"
).
hide
()
$
(
"#Scene"
).
hide
()
$
(
"body"
).
css
(
"background"
,
"#fff"
)
//解除dom事件监听
//解除dom事件监听
document
[
on
.
Start
]
=
null
;
rightMenu
()
document
.
getElementById
(
"drawflow"
).
addEventListener
(
"contextmenu"
,
positonXY
)
window
.
off
=
false
// rightMenu()
}
}
});
...
...
@@ -745,7 +762,7 @@
function
changeMode
(
option
)
{
//
console.log(lock.id);
console
.
log
(
lock
.
id
);
if
(
option
==
'lock'
)
{
lock
.
style
.
display
=
'none'
;
unlock
.
style
.
display
=
'block'
;
...
...
js/index.js
View file @
22b6446a
...
...
@@ -208,20 +208,23 @@ function handleContextmenu(e) {
customMenu
.
style
.
top
=
posY
+
'px'
;
}
var
x
,
y
;
function
positonXY
(
event
)
{
x
=
event
.
pageX
;
// 水平坐标(含滚动距离)
y
=
event
.
pageY
;
// 垂直坐标(含滚动距离)
console
.
log
(
`文档坐标:(
${
x
}
,
${
y
}
)`
);
}
// var x ,y;
// function positonXY(event) {
// x = event.pageX; // 水平坐标(含滚动距离)
// y = event.pageY; // 垂直坐标(含滚动距离)
// console.log(`文档坐标:(${x}, ${y})`);
// }
// 右键菜单
function
rightMenu
()
{
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
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment