Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
5573c91c
Commit
5573c91c
authored
Apr 24, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加超链接功能
parent
f5a98519
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
4 deletions
+58
-4
import.js
import.js
+5
-4
hyperlink.js
src/module/hyperlink.js
+53
-0
No files found.
import.js
View file @
5573c91c
...
@@ -26,9 +26,9 @@
...
@@ -26,9 +26,9 @@
,
'module/layout.default.js'
,
'module/layout.default.js'
,
'module/layout.bottom.js'
,
'module/layout.bottom.js'
,
'core/minder.select.js'
,
'core/minder.select.js'
//
,'module/view.js'
,
'module/view.js'
//
,'module/dragtree.js'
,
'module/dragtree.js'
//
,'module/dropfile.js'
,
'module/dropfile.js'
,
'module/keyboard.js'
,
'module/keyboard.js'
,
'module/select.js'
,
'module/select.js'
,
'module/history.js'
,
'module/history.js'
...
@@ -38,8 +38,9 @@
...
@@ -38,8 +38,9 @@
,
'module/editor.selection.js'
,
'module/editor.selection.js'
,
'module/basestyle.js'
,
'module/basestyle.js'
,
'module/font.js'
,
'module/font.js'
//
,'module/zoom.js'
,
'module/zoom.js'
,
'module/nodetext.js'
,
'module/nodetext.js'
,
'module/hyperlink.js'
,
'ui/jquery-ui-1.10.4.custom.min.js'
,
'ui/jquery-ui-1.10.4.custom.min.js'
,
'ui/widget.js'
,
'ui/widget.js'
,
'ui/button.js'
,
'ui/button.js'
...
...
src/module/hyperlink.js
0 → 100644
View file @
5573c91c
KityMinder
.
registerModule
(
"hyperlink"
,
function
()
{
return
{
"commands"
:
{
"createlink"
:
kity
.
createClass
(
"hyperlink"
,
{
base
:
Command
,
execute
:
function
(
url
)
{
var
nodes
=
km
.
getSelectedNodes
();
if
(
this
.
queryState
(
'hyperlink'
)
==
1
)
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'hyperlink'
);
}
)
}
else
{
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
n
.
setData
(
'hyperlink'
,
url
);
}
)
}
},
queryState
:
function
()
{
var
nodes
=
km
.
getSelectedNodes
(),
result
=
0
;
if
(
nodes
.
length
==
0
)
{
return
-
1
;
}
utils
.
each
(
nodes
,
function
(
i
,
n
)
{
if
(
n
&&
n
.
getData
(
'hyperlink'
)
)
{
result
=
1
;
return
false
;
}
}
);
return
result
;
}
}
)
},
"events"
:
{
"RenderNodeRight"
:
function
(
e
)
{
var
node
=
e
.
node
,
url
;
if
(
url
=
node
.
getData
(
'h'
)){
var
link
=
new
kity
.
HyperLink
(
url
);
var
rect
=
new
kity
.
Rect
();
var
box
=
node
.
getContRc
().
getBoundaryBox
();
rect
.
setWidth
(
10
).
setHeight
(
10
).
fill
(
'#ccc'
).
setPosition
(
box
.
x
+
box
.
width
+
2
,
rect
.
getHeight
()
/-
2
);
link
.
appendChild
(
rect
);
node
.
getContRc
().
appendChild
(
link
);
}
}
}
};
}
);
\ No newline at end of file
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