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
a0e1fc36
Commit
a0e1fc36
authored
Jan 06, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev
parent
bc465b0b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
16 deletions
+23
-16
dev.php
dist/dev.php
+1
-1
minder.node.js
src/core/minder.node.js
+0
-4
connect.js
src/module/connect.js
+3
-3
keyboard.js
src/module/keyboard.js
+5
-6
layout.js
src/module/layout.js
+0
-1
mouse.js
src/module/mouse.js
+6
-0
textedit.js
src/module/textedit.js
+8
-1
No files found.
dist/dev.php
View file @
a0e1fc36
...
...
@@ -26,10 +26,10 @@ $dependency = Array(
$content
=
""
;
header
(
'Content-Type: text/javascript; charset=utf-8'
);
foreach
(
$dependency
as
$index
=>
$dep
)
{
if
(
$_GET
[
'join'
]
!=
null
)
{
header
(
'Content-Type: text/javascript; charset=utf-8'
);
echo
file_get_contents
(
"../
$dep
"
)
.
"
\n\n
"
;
}
else
{
echo
"document.write('<script charset=utf-8 src=
\"
../
$dep
\"
></script>');"
;
...
...
src/core/minder.node.js
View file @
a0e1fc36
...
...
@@ -16,10 +16,6 @@ kity.extendClass( Minder, {
node
.
traverse
(
function
(
current
)
{
rc
.
removeShape
(
current
.
getRenderContainer
()
);
}
);
},
update
:
function
(
node
)
{
return
this
;
}
}
);
\ No newline at end of file
src/module/connect.js
View file @
a0e1fc36
...
...
@@ -150,14 +150,14 @@ var ConnectModule = KityMinder.registerModule( "ConnectModule", function () {
return
false
;
}
else
{
var
parent
=
curnode
.
getParent
();
var
connectExist
=
curnode
.
getData
(
"connect"
)
;
var
connectExist
=
curnode
.
_connect
;
if
(
connectExist
)
{
connectExist
.
updateConnection
();
}
else
{
var
_connect
=
new
ConnectBezier
(
parent
.
getRenderContainer
(),
curnode
.
getRenderContainer
()
);
var
nodeD
=
curnode
.
getData
(
"style"
);
_connect
.
stroke
(
new
kity
.
Pen
(
nodeD
.
stroke
,
nodeD
.
strokeWidth
)
);
curnode
.
setData
(
"connect"
,
_connect
)
;
curnode
.
_connect
=
_connect
;
minder
.
getRenderContainer
().
addShape
(
_connect
);
}
}
...
...
@@ -172,7 +172,7 @@ var ConnectModule = KityMinder.registerModule( "ConnectModule", function () {
}
function
removeConnect
(
node
)
{
var
connect
=
node
.
getData
(
"connect"
)
;
var
connect
=
node
.
_connect
;
if
(
connect
&&
connect
.
remove
)
{
connect
.
remove
();
}
...
...
src/module/keyboard.js
View file @
a0e1fc36
...
...
@@ -38,12 +38,12 @@ KityMinder.registerModule( "KeyboardModule", function () {
};
}
}
find
.
node
.
setData
(
'nearestNodes'
,
{
find
.
node
.
_nearestNodes
=
{
right
:
most
[
1
]
&&
most
[
1
].
node
||
null
,
top
:
most
[
2
]
&&
most
[
2
].
node
||
null
,
left
:
most
[
3
]
&&
most
[
3
].
node
||
null
,
down
:
most
[
4
]
&&
most
[
4
].
node
||
null
}
)
;
};
}
function
findMinDepthNode
(
nodes
)
{
...
...
@@ -64,9 +64,9 @@ KityMinder.registerModule( "KeyboardModule", function () {
base
:
Command
,
execute
:
function
(
km
,
type
,
referNode
)
{
var
node
=
this
.
createdNode
=
km
.
execCommand
(
'create'
+
type
+
'node'
,
referNode
);
km
.
execCommand
(
'editText'
,
node
);
km
.
selectSingle
(
node
);
km
.
execCommand
(
'rendernode'
,
[
referNode
,
node
]
);
km
.
execCommand
(
'editText'
,
node
);
km
.
execCommand
(
'rendernode'
,
referNode
);
this
.
setContentChanged
(
true
);
},
...
...
@@ -78,7 +78,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
var
KBNavigateCommand
=
kity
.
createClass
(
{
base
:
Command
,
execute
:
function
(
km
,
direction
,
referNode
)
{
var
nextNode
=
referNode
.
getData
(
'nearestNodes'
)
[
direction
];
var
nextNode
=
referNode
.
_nearestNodes
[
direction
];
if
(
nextNode
)
{
km
.
toggleSelect
(
[
referNode
,
nextNode
]
);
km
.
execCommand
(
'rendernode'
,
[
referNode
,
nextNode
]
);
...
...
@@ -127,7 +127,6 @@ KityMinder.registerModule( "KeyboardModule", function () {
var
sNodes
=
this
.
getSelectedNodes
(),
isSingleSelected
=
sNodes
.
length
===
1
,
isRootSelected
=
this
.
isNodeSelected
(
this
.
getRoot
()
);
console
.
log
(
e
.
originEvent
.
keyCode
);
e
.
originEvent
.
preventDefault
();
switch
(
e
.
originEvent
.
keyCode
)
{
...
...
src/module/layout.js
View file @
a0e1fc36
...
...
@@ -42,7 +42,6 @@ KityMinder.registerModule( "LayoutModule", function () {
return
{
base
:
Command
,
execute
:
function
(
km
,
sibling
)
{
console
.
log
(
sibling
);
var
parent
=
sibling
.
getParent
();
if
(
parent
)
{
return
createChildNode
(
km
,
parent
);
...
...
src/module/mouse.js
View file @
a0e1fc36
...
...
@@ -20,6 +20,12 @@ KityMinder.registerModule( "MouseModule", function () {
mousedown
:
function
(
e
)
{
var
clickNode
=
e
.
getTargetNode
();
this
.
execCommand
(
'selectsingle'
,
clickNode
);
if
(
+
new
Date
()
-
this
.
_lastMousedownTime
<
300
)
{
if
(
clickNode
)
{
this
.
execCommand
(
'edittext'
,
clickNode
);
}
}
this
.
_lastMousedownTime
=
+
new
Date
();
}
}
};
...
...
src/module/textedit.js
View file @
a0e1fc36
KityMinder
.
registerModule
(
"TextEditModule"
,
function
()
{
var
EditTextCommand
=
kity
.
createClass
(
'EditTextCommand'
,
{
base
:
Command
,
execute
:
function
(
km
,
node
)
{
node
.
setData
(
'text'
,
prompt
(
'input the text:'
)
);
km
.
execCommand
(
'rendernode'
,
node
);
}
}
);
return
{
"commands"
:
{
'edittext'
:
EditTextCommand
},
"events"
:
{
...
...
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