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
bf0f6134
Commit
bf0f6134
authored
Feb 18, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/kitygraph/kityminder
into dev
parents
21387f72
8ac4e2ef
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
21 deletions
+42
-21
markers.js
dialogs/markers/markers.js
+16
-16
editor.js
src/module/editor.js
+15
-1
editor.receiver.js
src/module/editor.receiver.js
+1
-0
icon.js
src/module/icon.js
+4
-3
layout.default.js
src/module/layout.default.js
+4
-0
layout.js
src/module/layout.js
+2
-1
No files found.
dialogs/markers/markers.js
View file @
bf0f6134
...
...
@@ -2,18 +2,18 @@
var
utils
=
KM
.
utils
;
KM
.
registerWidget
(
'markers'
,
{
tpl
:
"<ul class='icon-list'>"
+
"<li value='1' type='
set
priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) 0 0'></span><span><%= priority %>1</span></li>"
+
"<li value='2' type='
set
priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -20px 0'></span><span><%= priority %>2</span></li>"
+
"<li value='3' type='
set
priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -40px 0'></span><span><%= priority %>3</span></li>"
+
"<li value='4' type='
set
priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -60px 0'></span><span><%= priority %>4</span></li>"
+
"<li value='5' type='
set
priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -80px 0'></span><span><%= priority %>5</span></li>"
+
"<li value='1' type='priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) 0 0'></span><span><%= priority %>1</span></li>"
+
"<li value='2' type='priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -20px 0'></span><span><%= priority %>2</span></li>"
+
"<li value='3' type='priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -40px 0'></span><span><%= priority %>3</span></li>"
+
"<li value='4' type='priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -60px 0'></span><span><%= priority %>4</span></li>"
+
"<li value='5' type='priority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -80px 0'></span><span><%= priority %>5</span></li>"
+
"</ul>"
+
"<ul class='icon-list'>"
+
"<li value='1' type='
set
progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) 0 0'></span><span><%= progress.notdone %></span></li>"
+
"<li value='2' type='
set
progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -20px 0'></span><span><%= progress.quarterdone %></span></li>"
+
"<li value='3' type='
set
progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -40px 0'></span><span><%= progress.halfdone %></span></li>"
+
"<li value='4' type='
set
progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -60px 0'></span><span><%= progress.threequartersdone %></span></li>"
+
"<li value='5' type='
set
progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -80px 0'></span><span><%= progress.done %></span></li>"
+
"<li value='1' type='progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) 0 0'></span><span><%= progress.notdone %></span></li>"
+
"<li value='2' type='progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -20px 0'></span><span><%= progress.quarterdone %></span></li>"
+
"<li value='3' type='progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -40px 0'></span><span><%= progress.halfdone %></span></li>"
+
"<li value='4' type='progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -60px 0'></span><span><%= progress.threequartersdone %></span></li>"
+
"<li value='5' type='progress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -80px 0'></span><span><%= progress.done %></span></li>"
+
"</ul>"
,
initContent
:
function
(
km
)
{
var
lang
=
km
.
getLang
(
'dialogs.markers'
);
...
...
@@ -35,12 +35,12 @@
km
.
execCommand
(
type
,
val
);
}
);
km
.
on
(
'interactchange'
,
function
(
e
)
{
var
valPri
=
this
.
queryCommandValue
(
"
set
priority"
);
var
valPro
=
this
.
queryCommandValue
(
"
set
progress"
);
$w
.
find
(
"li[type='
set
priority']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='
set
priority'][value='"
+
valPri
+
"']"
).
addClass
(
"active"
);
$w
.
find
(
"li[type='
set
progress']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='
set
progress'][value='"
+
valPro
+
"']"
).
addClass
(
"active"
);
var
valPri
=
this
.
queryCommandValue
(
"priority"
);
var
valPro
=
this
.
queryCommandValue
(
"progress"
);
$w
.
find
(
"li[type='priority']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='priority'][value='"
+
valPri
+
"']"
).
addClass
(
"active"
);
$w
.
find
(
"li[type='progress']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='progress'][value='"
+
valPro
+
"']"
).
addClass
(
"active"
);
}
);
},
buttons
:
{
...
...
src/module/editor.js
View file @
bf0f6134
...
...
@@ -48,7 +48,7 @@ KityMinder.registerModule( "TextEditModule", function () {
}
},
'mouseup'
:
function
(
e
){
if
(
!
sel
.
collapsed
){
if
(
!
sel
.
collapsed
&&
mouseDownStatus
){
receiver
.
updateRange
(
range
)
}
mouseDownStatus
=
false
;
...
...
@@ -119,6 +119,20 @@ KityMinder.registerModule( "TextEditModule", function () {
.
updateRange
(
range
);
}
if
(
e
.
commandName
==
'priority'
||
e
.
commandName
==
'progress'
){
receiver
.
setBaseOffset
()
.
getTextOffsetData
();
if
(
sel
.
collapsed
){
receiver
.
updateSelection
();
}
else
{
receiver
.
updateSelectionShow
(
1
)
}
}
}
}
...
...
src/module/editor.receiver.js
View file @
bf0f6134
...
...
@@ -144,6 +144,7 @@ Minder.Receiver = kity.createClass('Receiver',{
var
transformed
=
this
.
textShape
.
container
.
getTransform
().
transformBox
(
textOffset
);
//var contRcOffset = this.minderNode.getContRc().getRenderBox();
this
.
offset
=
{
x
:
nodeOffset
.
x
+
transformed
.
x
,
y
:
nodeOffset
.
y
+
transformed
.
y
...
...
src/module/icon.js
View file @
bf0f6134
...
...
@@ -87,17 +87,17 @@ KityMinder.registerModule( "IconModule", function () {
}
)()
);
return
{
"commands"
:
{
"
set
priority"
:
setPriorityCommand
,
"
set
progress"
:
setProgressCommand
"priority"
:
setPriorityCommand
,
"progress"
:
setProgressCommand
},
"events"
:
{
"RenderNode"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
iconRc
=
node
.
getIconRc
();
var
contRc
=
node
.
getContRc
();
var
PriorityIconVal
=
node
.
getData
(
"PriorityIcon"
);
var
ProgressIconVal
=
node
.
getData
(
"ProgressIcon"
);
//依次排布图标、文字
iconRc
.
setTransform
(
new
kity
.
Matrix
().
translate
(
0
,
-
20
)
);
iconRc
.
clear
();
var
PriorityIconWidth
=
0
;
if
(
PriorityIconVal
)
{
...
...
@@ -111,6 +111,7 @@ KityMinder.registerModule( "IconModule", function () {
var
textShape
=
node
.
getTextShape
();
if
(
iconWidth
)
textShape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
iconWidth
+
5
,
0
)
);
else
textShape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
0
,
0
)
);
iconRc
.
setTransform
(
new
kity
.
Matrix
().
translate
(
0
,
-
(
iconRc
.
getHeight
()
+
textShape
.
getHeight
()
)
/
2
)
);
}
}
};
...
...
src/module/layout.default.js
View file @
bf0f6134
...
...
@@ -546,6 +546,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
removeNode
:
function
(
nodes
)
{
while
(
nodes
.
length
!==
0
)
{
var
parent
=
nodes
[
0
].
getParent
();
if
(
!
parent
)
{
nodes
.
splice
(
0
,
1
);
return
false
;
}
var
nodeLayout
=
nodes
[
0
].
getLayout
();
if
(
parent
.
getType
()
===
"root"
)
{
var
sideList
=
parent
.
getLayout
()[
nodeLayout
.
appendside
+
"List"
];
...
...
src/module/layout.js
View file @
bf0f6134
...
...
@@ -132,6 +132,7 @@ KityMinder.registerModule( "LayoutModule", function () {
base
:
Command
,
execute
:
function
(
km
)
{
var
selectedNodes
=
km
.
getSelectedNodes
();
if
(
selectedNodes
.
length
===
0
)
return
false
;
var
_buffer
=
[];
for
(
var
i
=
0
;
i
<
selectedNodes
.
length
;
i
++
)
{
_buffer
.
push
(
selectedNodes
[
i
]
);
...
...
@@ -140,7 +141,7 @@ KityMinder.registerModule( "LayoutModule", function () {
var
parent
=
_buffer
[
0
].
getParent
();
if
(
parent
&&
_buffer
.
indexOf
(
parent
)
===
-
1
)
_buffer
.
push
(
parent
);
_buffer
.
shift
();
}
while
(
_buffer
.
length
!==
1
);
}
while
(
_buffer
.
length
>
1
);
km
.
removeNode
(
selectedNodes
);
km
.
select
(
_buffer
[
0
]
);
}
...
...
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