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
003f8207
Commit
003f8207
authored
Feb 18, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/kitygraph/kityminder
into dev
parents
938a4fe6
84da7929
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
21 deletions
+81
-21
markers.js
dialogs/markers/markers.js
+16
-16
editor.js
src/module/editor.js
+51
-1
editor.receiver.js
src/module/editor.receiver.js
+9
-2
icon.js
src/module/icon.js
+2
-2
keyboard.js
src/module/keyboard.js
+3
-0
No files found.
dialogs/markers/markers.js
View file @
003f8207
...
...
@@ -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 @
003f8207
...
...
@@ -48,7 +48,7 @@ KityMinder.registerModule( "TextEditModule", function () {
}
},
'mouseup'
:
function
(
e
){
if
(
!
sel
.
collapsed
){
if
(
!
sel
.
collapsed
&&
mouseDownStatus
){
receiver
.
updateRange
(
range
)
}
mouseDownStatus
=
false
;
...
...
@@ -83,7 +83,57 @@ KityMinder.registerModule( "TextEditModule", function () {
},
'stopTextEdit'
:
function
(){
sel
.
setHide
();
receiver
.
clear
().
setTextEditStatus
(
false
);
},
'execCommand'
:
function
(
e
){
var
cmds
=
{
'appendchildnode'
:
1
,
'appendsiblingnode'
:
1
};
if
(
cmds
[
e
.
commandName
]){
var
node
=
km
.
getSelectedNode
();
var
textShape
=
node
.
getTextShape
();
textShape
.
setStyle
(
'cursor'
,
'default'
);
node
.
getTextShape
().
setStyle
(
'cursor'
,
'text'
);
receiver
.
setTextEditStatus
(
true
)
.
setSelection
(
sel
)
.
setKityMinder
(
this
)
.
setMinderNode
(
node
)
.
setTextShape
(
textShape
)
.
setBaseOffset
()
.
setContainerStyle
()
.
setSelectionHeight
()
.
getTextOffsetData
()
.
setIndex
(
0
)
.
updateSelection
()
.
setRange
(
range
);
sel
.
setStartOffset
(
0
);
sel
.
setEndOffset
(
textShape
.
getContent
().
length
);
sel
.
setShow
();
receiver
.
updateSelectionShow
(
1
)
.
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 @
003f8207
...
...
@@ -77,8 +77,10 @@ Minder.Receiver = kity.createClass('Receiver',{
switch
(
keyCode
){
case
keymap
.
Enter
:
case
keymap
.
Tab
:
if
(
this
.
keydownNode
===
this
.
minderNode
){
this
.
setTextEditStatus
(
false
);
this
.
clear
();
}
e
.
preventDefault
();
return
;
case
keymap
.
Shift
:
...
...
@@ -141,6 +143,7 @@ Minder.Receiver = kity.createClass('Receiver',{
// var textOffset = this.textShape.getRenderBox();
var
contRcOffset
=
this
.
minderNode
.
getContRc
().
getRenderBox
();
this
.
offset
=
{
x
:
nodeOffset
.
x
+
contRcOffset
.
x
,
y
:
nodeOffset
.
y
+
contRcOffset
.
y
...
...
@@ -263,5 +266,9 @@ Minder.Receiver = kity.createClass('Receiver',{
range
.
setEnd
(
node
,
this
.
selection
.
endOffset
);
range
.
select
();
return
this
;
},
setIndex
:
function
(
index
){
this
.
index
=
index
;
return
this
}
});
\ No newline at end of file
src/module/icon.js
View file @
003f8207
...
...
@@ -87,8 +87,8 @@ KityMinder.registerModule( "IconModule", function () {
}
)()
);
return
{
"commands"
:
{
"
set
priority"
:
setPriorityCommand
,
"
set
progress"
:
setProgressCommand
"priority"
:
setPriorityCommand
,
"progress"
:
setProgressCommand
},
"events"
:
{
"RenderNode"
:
function
(
e
)
{
...
...
src/module/keyboard.js
View file @
003f8207
...
...
@@ -67,6 +67,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
buildPositionNetwork
(
this
.
getRoot
()
);
},
keydown
:
function
(
e
)
{
var
keys
=
KityMinder
.
keymap
;
if
(
this
.
receiver
.
isTextEditStatus
()
)
{
switch
(
e
.
originEvent
.
keyCode
)
{
...
...
@@ -85,6 +86,8 @@ KityMinder.registerModule( "KeyboardModule", function () {
}
return
;
}
var
node
=
e
.
getTargetNode
();
this
.
receiver
.
keydownNode
=
node
;
switch
(
e
.
originEvent
.
keyCode
)
{
case
keys
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
);
...
...
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