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
cfc65d13
Commit
cfc65d13
authored
May 17, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev
parent
b6a7a3db
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
57 deletions
+63
-57
markers.js
dialogs/markers/markers.js
+1
-1
icon.js
src/module/icon.js
+62
-56
No files found.
dialogs/markers/markers.js
View file @
cfc65d13
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
"<li value='7' type='priority'><span class='icon p7'></span><span><%= priority %>7</span></li>"
+
"<li value='7' type='priority'><span class='icon p7'></span><span><%= priority %>7</span></li>"
+
"<li value='8' type='priority'><span class='icon p8'></span><span><%= priority %>8</span></li>"
+
"<li value='8' type='priority'><span class='icon p8'></span><span><%= priority %>8</span></li>"
+
"<li value='9' type='priority'><span class='icon p9'></span><span><%= priority %>9</span></li>"
+
"<li value='9' type='priority'><span class='icon p9'></span><span><%= priority %>9</span></li>"
+
"<li value='0' type='priority'><span class='icon p0'></span><span><%= priority %>0</span></li>"
+
"<li value='
1
0' type='priority'><span class='icon p0'></span><span><%= priority %>0</span></li>"
+
"</ul>"
+
"</ul>"
+
"<ul class='icon-list progress'>"
+
"<ul class='icon-list progress'>"
+
"<li value='1' type='progress'><span class='icon p1'></span><span><%= progress.notdone %></span></li>"
+
"<li value='1' type='progress'><span class='icon p1'></span><span><%= progress.notdone %></span></li>"
+
...
...
src/module/icon.js
View file @
cfc65d13
KityMinder
.
registerModule
(
"IconModule"
,
function
()
{
KityMinder
.
registerModule
(
"IconModule"
,
function
()
{
var
minder
=
this
;
var
minder
=
this
;
var
renderPriorityIcon
=
function
(
node
,
val
)
{
var
renderPriorityIcon
=
function
(
node
,
val
)
{
var
colors
=
[
""
,
"#A92E24"
,
"#29A6BD"
,
"#1E8D54"
,
"#eb6100"
,
"#876DDA"
];
var
colors
=
[
""
,
"#A92E24"
,
"#29A6BD"
,
"#1E8D54"
,
"#eb6100"
,
"#876DDA"
,
"#828282"
,
"#828282"
,
"#828282"
,
"#828282"
,
"#828282"
];
var
_bg
=
new
kity
.
Rect
().
fill
(
colors
[
val
]
).
setRadius
(
3
).
setWidth
(
20
).
setHeight
(
20
);
var
bgcolor
=
colors
[
val
];
var
_number
=
new
kity
.
Text
().
setContent
(
val
).
fill
(
"white"
).
setSize
(
12
);
var
_bg
=
new
kity
.
Rect
().
fill
(
colors
[
val
]).
setRadius
(
3
).
setWidth
(
20
).
setHeight
(
20
);
var
_number
;
if
(
val
<
10
)
{
_number
=
new
kity
.
Text
().
setContent
(
val
).
fill
(
"white"
).
setSize
(
12
);
}
else
{
_number
=
new
kity
.
Rect
().
fill
(
"white"
).
setWidth
(
14
).
setHeight
(
14
).
translate
(
-
3
,
-
12
);
}
var
_rc
=
new
kity
.
Group
();
var
_rc
=
new
kity
.
Group
();
_rc
.
addShapes
(
[
_bg
,
_number
]
);
_rc
.
addShapes
(
[
_bg
,
_number
]
);
node
.
getContRc
().
addShape
(
_rc
);
node
.
getContRc
().
addShape
(
_rc
);
_number
.
setTranslate
(
6
,
15
);
_number
.
setTranslate
(
6
,
15
);
var
rcHeight
=
_rc
.
getHeight
();
var
rcHeight
=
_rc
.
getHeight
();
_rc
.
setTranslate
(
0
,
-
rcHeight
/
2
);
_rc
.
setTranslate
(
0
,
-
rcHeight
/
2
);
};
};
var
renderProgressIcon
=
function
(
node
,
val
)
{
var
renderProgressIcon
=
function
(
node
,
val
)
{
var
_rc
=
new
kity
.
Group
();
var
_rc
=
new
kity
.
Group
();
var
_contRc
=
node
.
getContRc
();
var
_contRc
=
node
.
getContRc
();
var
_bg
=
new
kity
.
Circle
().
setRadius
(
8
).
fill
(
"white"
).
stroke
(
new
kity
.
Pen
(
"#29A6BD"
,
2
)
);
var
_bg
=
new
kity
.
Circle
().
setRadius
(
8
).
fill
(
"white"
).
stroke
(
new
kity
.
Pen
(
"#29A6BD"
,
2
)
);
var
_percent
,
d
;
var
_percent
,
d
;
if
(
val
<
5
)
{
if
(
val
<
5
)
{
_percent
=
new
kity
.
Path
();
_percent
=
new
kity
.
Path
();
d
=
_percent
.
getDrawer
();
d
=
_percent
.
getDrawer
();
d
.
moveTo
(
0
,
0
).
lineTo
(
6
,
0
);
d
.
moveTo
(
0
,
0
).
lineTo
(
6
,
0
);
}
else
_percent
=
new
kity
.
Group
();
}
else
_percent
=
new
kity
.
Group
();
_rc
.
addShapes
(
[
_bg
,
_percent
]
);
_rc
.
addShapes
(
[
_bg
,
_percent
]
);
_contRc
.
addShape
(
_rc
);
_contRc
.
addShape
(
_rc
);
switch
(
val
)
{
switch
(
val
)
{
case
1
:
case
1
:
break
;
break
;
case
2
:
case
2
:
d
.
carcTo
(
6
,
0
,
0
,
0
,
-
6
);
d
.
carcTo
(
6
,
0
,
0
,
0
,
-
6
);
break
;
break
;
case
3
:
case
3
:
d
.
carcTo
(
6
,
0
,
0
,
-
6
,
0
);
d
.
carcTo
(
6
,
0
,
0
,
-
6
,
0
);
break
;
break
;
case
4
:
case
4
:
d
.
carcTo
(
6
,
1
,
0
,
0
,
6
);
d
.
carcTo
(
6
,
1
,
0
,
0
,
6
);
break
;
break
;
case
5
:
case
5
:
var
check
=
new
kity
.
Path
();
var
check
=
new
kity
.
Path
();
_percent
.
addShapes
(
[
new
kity
.
Circle
().
setRadius
(
6
).
fill
(
"#29A6BD"
),
check
]
);
_percent
.
addShapes
(
[
new
kity
.
Circle
().
setRadius
(
6
).
fill
(
"#29A6BD"
),
check
]
);
check
.
getDrawer
().
moveTo
(
-
3
,
0
).
lineTo
(
-
1
,
3
).
lineTo
(
3
,
-
2
);
check
.
getDrawer
().
moveTo
(
-
3
,
0
).
lineTo
(
-
1
,
3
).
lineTo
(
3
,
-
2
);
check
.
stroke
(
new
kity
.
Pen
(
"white"
,
2
).
setLineCap
(
"round"
)
);
check
.
stroke
(
new
kity
.
Pen
(
"white"
,
2
).
setLineCap
(
"round"
)
);
break
;
break
;
}
}
if
(
val
<
5
)
d
.
close
();
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"#29A6BD"
);
_percent
.
fill
(
"#29A6BD"
);
var
pre
=
node
.
getData
(
"PriorityIcon"
);
var
pre
=
node
.
getData
(
"PriorityIcon"
);
var
style
=
minder
.
getCurrentLayoutStyle
()[
node
.
getType
()
];
var
style
=
minder
.
getCurrentLayoutStyle
()[
node
.
getType
()
];
if
(
!
pre
)
_rc
.
setTranslate
(
_rc
.
getWidth
()
/
2
,
0
);
if
(
!
pre
)
_rc
.
setTranslate
(
_rc
.
getWidth
()
/
2
,
0
);
else
_rc
.
setTranslate
(
_contRc
.
getWidth
()
+
style
.
spaceLeft
,
0
);
else
_rc
.
setTranslate
(
_contRc
.
getWidth
()
+
style
.
spaceLeft
,
0
);
};
};
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriorityCommand"
,
(
function
()
{
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriorityCommand"
,
(
function
()
{
return
{
return
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
value
)
{
execute
:
function
(
km
,
value
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
"PriorityIcon"
,
value
);
nodes
[
i
].
setData
(
"PriorityIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
km
.
updateLayout
(
nodes
[
i
]
);
}
}
},
},
queryValue
:
function
(
km
)
{
queryValue
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
var
val
;
var
val
;
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
val
=
nodes
[
i
].
getData
(
"PriorityIcon"
);
val
=
nodes
[
i
].
getData
(
"PriorityIcon"
);
if
(
val
)
break
;
if
(
val
)
break
;
}
}
return
val
;
return
val
;
}
}
};
};
}
)()
);
}
)()
);
var
setProgressCommand
=
kity
.
createClass
(
"SetProgressCommand"
,
(
function
()
{
var
setProgressCommand
=
kity
.
createClass
(
"SetProgressCommand"
,
(
function
()
{
return
{
return
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
value
)
{
execute
:
function
(
km
,
value
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
"ProgressIcon"
,
value
);
nodes
[
i
].
setData
(
"ProgressIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
km
.
updateLayout
(
nodes
[
i
]
);
}
}
},
},
queryValue
:
function
(
km
)
{
queryValue
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
nodes
=
km
.
getSelectedNodes
();
var
val
;
var
val
;
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
val
=
nodes
[
i
].
getData
(
"ProgressIcon"
);
val
=
nodes
[
i
].
getData
(
"ProgressIcon"
);
if
(
val
)
break
;
if
(
val
)
break
;
}
}
return
val
;
return
val
;
}
}
};
};
}
)()
);
}
)()
);
return
{
return
{
"commands"
:
{
"commands"
:
{
"priority"
:
setPriorityCommand
,
"priority"
:
setPriorityCommand
,
"progress"
:
setProgressCommand
"progress"
:
setProgressCommand
},
},
"events"
:
{
"events"
:
{
"RenderNodeLeft"
:
function
(
e
)
{
"RenderNodeLeft"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
node
=
e
.
node
;
var
PriorityIconVal
=
node
.
getData
(
"PriorityIcon"
);
var
PriorityIconVal
=
node
.
getData
(
"PriorityIcon"
);
var
ProgressIconVal
=
node
.
getData
(
"ProgressIcon"
);
var
ProgressIconVal
=
node
.
getData
(
"ProgressIcon"
);
var
contRc
=
node
.
getContRc
();
var
contRc
=
node
.
getContRc
();
if
(
PriorityIconVal
)
{
if
(
PriorityIconVal
)
{
renderPriorityIcon
(
node
,
PriorityIconVal
);
renderPriorityIcon
(
node
,
PriorityIconVal
);
}
}
if
(
ProgressIconVal
)
{
if
(
ProgressIconVal
)
{
renderProgressIcon
(
node
,
ProgressIconVal
);
renderProgressIcon
(
node
,
ProgressIconVal
);
}
}
}
}
}
}
};
};
}
);
});
\ No newline at end of file
\ 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