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
8aedd457
Commit
8aedd457
authored
Feb 18, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
merge changes
parents
4df655fe
d53af815
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
234 additions
and
174 deletions
+234
-174
iconpriority.png
dialogs/icons/iconpriority.png
+0
-0
iconprogress.png
dialogs/icons/iconprogress.png
+0
-0
markers.js
dialogs/markers/markers.js
+52
-56
dev.php
dist/dev.php
+1
-1
zh-cn.js
lang/zh-cn/zh-cn.js
+19
-10
dialog.js
src/adapter/dialog.js
+29
-57
kityminder.js
src/core/kityminder.js
+9
-10
minder.js
src/core/minder.js
+1
-1
minder.lang.js
src/core/minder.lang.js
+8
-8
minder.module.js
src/core/minder.module.js
+4
-4
editor.js
src/module/editor.js
+36
-0
editor.receiver.js
src/module/editor.receiver.js
+8
-2
icon.js
src/module/icon.js
+32
-13
keyboard.js
src/module/keyboard.js
+5
-2
modal.js
src/ui/modal.js
+0
-1
buttonicon.css
themes/default/_css/buttonicon.css
+1
-1
dialog.css
themes/default/_css/dialog.css
+4
-5
dialogsize.css
themes/default/_css/dialogsize.css
+25
-3
clock.png
themes/default/images/clock.png
+0
-0
flag.png
themes/default/images/flag.png
+0
-0
No files found.
dialogs/icons/iconpriority.png
0 → 100644
View file @
8aedd457
3.74 KB
dialogs/icons/iconprogress.png
0 → 100644
View file @
8aedd457
3.74 KB
dialogs/markers/markers.js
View file @
8aedd457
(
function
()
{
(
function
()
{
var
utils
=
KM
.
utils
;
function
hrefStartWith
(
href
,
arr
)
{
href
=
href
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
for
(
var
i
=
0
,
ai
;
ai
=
arr
[
i
++
];)
{
if
(
href
.
indexOf
(
ai
)
==
0
)
{
return
true
;
KM
.
registerWidget
(
'markers'
,
{
tpl
:
"<ul class='icon-list'>"
+
"<li value='1' type='setpriority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) 0 0'></span><span><%= priority %>1</span></li>"
+
"<li value='2' type='setpriority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -20px 0'></span><span><%= priority %>2</span></li>"
+
"<li value='3' type='setpriority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -40px 0'></span><span><%= priority %>3</span></li>"
+
"<li value='4' type='setpriority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -60px 0'></span><span><%= priority %>4</span></li>"
+
"<li value='5' type='setpriority'><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='setprogress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) 0 0'></span><span><%= progress.notdone %></span></li>"
+
"<li value='2' type='setprogress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -20px 0'></span><span><%= progress.quarterdone %></span></li>"
+
"<li value='3' type='setprogress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -40px 0'></span><span><%= progress.halfdone %></span></li>"
+
"<li value='4' type='setprogress'><span class='icon' style='background:url(../dialogs/icons/iconprogress.png) -60px 0'></span><span><%= progress.threequartersdone %></span></li>"
+
"<li value='5' type='setprogress'><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'
);
if
(
lang
)
{
var
html
=
$
.
parseTmpl
(
this
.
tpl
,
lang
);
}
}
return
false
;
}
KM
.
registerWidget
(
'markers'
,
{
tpl
:
"<style type=
\"
text/css
\"
>"
+
".kmui-dialog-link .kmui-link-table{font-size: 12px;margin: 10px;line-height: 30px}"
+
".kmui-dialog-link .kmui-link-txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;}"
+
"</style>"
+
"<table class=
\"
kmui-link-table
\"
>"
+
"<tr>"
+
"<td><label for=
\"
href
\"
><%=lang_input_url%></label></td>"
+
"<td><input class=
\"
kmui-link-txt
\"
id=
\"
kmui-link-Jhref
\"
type=
\"
text
\"
/></td>"
+
"</tr>"
+
"<tr>"
+
"<td><label for=
\"
title
\"
><%=lang_input_title%></label></td>"
+
"<td><input class=
\"
kmui-link-txt
\"
id=
\"
kmui-link-Jtitle
\"
type=
\"
text
\"
/></td>"
+
"</tr>"
+
"<tr>"
+
"<td colspan=
\"
2
\"
>"
+
"<label for=
\"
target
\"
><%=lang_input_target%></label>"
+
"<input id=
\"
kmui-link-Jtarget
\"
type=
\"
checkbox
\"
/>"
+
"</td>"
+
"</tr>"
+
"</table>"
,
initContent
:
function
(
km
)
{
var
lang
=
km
.
getLang
(
'dialogs.markers'
);
if
(
lang
)
{
var
html
=
$
.
parseTmpl
(
this
.
tpl
,
lang
.
static
);
}
this
.
root
().
html
(
html
);
this
.
root
().
html
(
html
);
},
initEvent
:
function
(
km
,
$w
)
{
var
link
=
km
.
queryCommandValue
(
'link'
);
if
(
link
){
$
(
'#kmui-link-Jhref'
,
$w
).
val
(
utils
.
html
(
$
(
link
).
attr
(
'href'
)));
$
(
'#kmui-link-Jtitle'
,
$w
).
val
(
$
(
link
).
attr
(
'title'
));
$
(
link
).
attr
(
'target'
)
==
'_blank'
&&
$
(
'#kmui-link-Jtarget'
).
attr
(
'checked'
,
true
)
initEvent
:
function
(
km
,
$w
)
{
$w
.
on
(
"click"
,
"li"
,
function
()
{
var
$this
=
$
(
this
);
$this
.
siblings
().
removeClass
(
"active"
);
$this
.
toggleClass
(
"active"
);
var
val
=
$this
.
val
();
if
(
!
$this
.
hasClass
(
"active"
)
)
{
val
=
null
;
}
var
type
=
$this
.
attr
(
"type"
);
km
.
execCommand
(
type
,
val
);
}
);
km
.
on
(
'interactchange'
,
function
(
e
)
{
var
valPri
=
this
.
queryCommandValue
(
"setpriority"
);
var
valPro
=
this
.
queryCommandValue
(
"setprogress"
);
$w
.
find
(
"li[type='setpriority']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='setpriority'][value='"
+
valPri
+
"']"
).
addClass
(
"active"
);
$w
.
find
(
"li[type='setprogress']"
).
removeClass
(
"active"
);
$w
.
find
(
"li[type='setprogress'][value='"
+
valPro
+
"']"
).
addClass
(
"active"
);
}
);
},
buttons
:
{
'ok'
:
{
exec
:
function
(
km
,
$w
)
{
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
exec
:
function
(
km
,
$w
)
{
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
if
(
href
)
{
km
.
execCommand
(
'link'
,
{
if
(
href
)
{
km
.
execCommand
(
'link'
,
{
'href'
:
href
,
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'_href'
:
href
});
}
);
}
}
},
'cancel'
:{}
'cancel'
:
{}
},
width
:
400
})
})();
width
:
200
,
}
)
}
)();
\ No newline at end of file
dist/dev.php
View file @
8aedd457
...
...
@@ -59,7 +59,7 @@ $dependency = Array(
,
'src/adapter/combobox.js'
,
'src/adapter/saveto.js'
,
'src/adapter/hand.js'
,
'src/adapter/
icon
.js'
,
'src/adapter/
dialog
.js'
,
'src/protocal/plain.js'
,
'src/protocal/json.js'
);
...
...
lang/zh-cn/zh-cn.js
View file @
8aedd457
KityMinder
.
LANG
[
'zh-cn'
]
=
{
'maintopic'
:
'中心主题'
,
'topic'
:
'分支主题'
,
'tooltips'
:
{
'undo'
:
'撤销'
,
'redo'
:
'重做'
,
...
...
@@ -9,23 +11,30 @@ KityMinder.LANG[ 'zh-cn' ] = {
'fontsize'
:
'字号'
,
'layoutstyle'
:
'主题'
,
'saveto'
:
'导出'
,
'hand'
:
'允许拖拽'
'hand'
:
'允许拖拽'
,
'markers'
:
'添加标签'
},
'popupcolor'
:
{
'clearColor'
:
'清空颜色'
,
'standardColor'
:
'标准颜色'
,
'themeColor'
:
'主题颜色'
},
'dialogs'
:{
'markers'
:{
'static'
:{
'lang_input_text'
:
'文本内容:'
,
'lang_input_url'
:
'链接地址:'
,
'lang_input_title'
:
'标题:'
,
'lang_input_target'
:
'是否在新窗口打开:'
'dialogs'
:
{
'markers'
:
{
'static'
:
{
'lang_input_text'
:
'文本内容:'
,
'lang_input_url'
:
'链接地址:'
,
'lang_input_title'
:
'标题:'
,
'lang_input_target'
:
'是否在新窗口打开:'
},
'validLink'
:
'只支持选中一个链接时生效'
,
'httpPrompt'
:
'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀'
'priority'
:
'优先级'
,
'progress'
:
{
'notdone'
:
"未完成"
,
'quarterdone'
:
'完成1/4'
,
'halfdone'
:
'完成1/2'
,
'threequartersdone'
:
'完成3/4'
,
'done'
:
'已完成'
,
}
}
}
...
...
src/adapter/dialog.js
View file @
8aedd457
KM
.
registerUI
(
'markers'
,
function
(
name
)
{
KM
.
registerUI
(
'markers'
,
function
(
name
)
{
var
me
=
this
,
currentRange
,
$dialog
,
var
me
=
this
,
currentRange
,
$dialog
,
opt
=
{
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
,
url
:
me
.
getOptions
(
'KITYMINDER_HOME_URL'
)
+
'dialogs/'
+
name
+
'/'
+
name
+
'.js'
width
:
200
,
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
,
url
:
me
.
getOptions
(
'KITYMINDER_HOME_URL'
)
+
'dialogs/'
+
name
+
'/'
+
name
+
'.js'
,
};
var
$btn
=
$
.
kmuibutton
({
var
$btn
=
$
.
kmuibutton
(
{
icon
:
name
,
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
});
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
}
);
//加载模版数据
utils
.
loadFile
(
document
,
{
utils
.
loadFile
(
document
,
{
src
:
opt
.
url
,
tag
:
"script"
,
type
:
"text/javascript"
,
defer
:
"defer"
},
function
(){
//调整数据
var
data
=
KM
.
getWidgetData
(
name
);
if
(
data
.
buttons
){
var
ok
=
data
.
buttons
.
ok
;
if
(
ok
){
opt
.
oklabel
=
ok
.
label
||
me
.
getLang
(
'ok'
);
if
(
ok
.
exec
){
opt
.
okFn
=
function
(){
return
$
.
proxy
(
ok
.
exec
,
null
,
me
,
$dialog
)()
}
}
}
var
cancel
=
data
.
buttons
.
cancel
;
if
(
cancel
){
opt
.
cancellabel
=
cancel
.
label
||
me
.
getLang
(
'cancel'
);
if
(
cancel
.
exec
){
opt
.
cancelFn
=
function
(){
return
$
.
proxy
(
cancel
.
exec
,
null
,
me
,
$dialog
)()
}
}
}
}
data
.
width
&&
(
opt
.
width
=
data
.
width
);
data
.
height
&&
(
opt
.
height
=
data
.
height
);
},
function
()
{
$dialog
=
$
.
kmuimodal
(
opt
);
$dialog
=
$
.
kmuimodal
(
opt
);
$dialog
.
attr
(
'id'
,
'kmui-dialog-'
+
name
).
addClass
(
'kmui-dialog-'
+
name
)
.
find
(
'.kmui-modal-body'
).
addClass
(
'kmui-dialog-'
+
name
+
'-body'
);
$dialog
.
attr
(
'id'
,
'kmui-dialog-'
+
name
).
addClass
(
'kmui-dialog-'
+
name
)
.
find
(
'.kmui-modal-body'
).
addClass
(
'kmui-dialog-'
+
name
+
'-body'
);
$dialog
.
kmui
().
on
(
'beforeshow'
,
function
()
{
$dialog
.
kmui
().
on
(
'beforeshow'
,
function
()
{
var
$root
=
this
.
root
(),
win
=
null
,
offset
=
null
;
if
(
!
$root
.
parent
()[
0
])
{
me
.
$container
.
find
(
'.kmui-dialog-container'
).
append
(
$root
);
if
(
!
$root
.
parent
()[
0
]
)
{
me
.
$container
.
find
(
'.kmui-dialog-container'
).
append
(
$root
);
}
KM
.
setWidgetBody
(
name
,
$dialog
,
me
);
}).
on
(
'afterbackdrop'
,
function
(){
this
.
$backdrop
.
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
1
).
appendTo
(
me
.
$container
.
find
(
'.kmui-dialog-container'
))
$dialog
.
css
(
'zIndex'
,
me
.
getOptions
(
'zIndex'
)
+
2
)
}).
attachTo
(
$btn
)
});
KM
.
setWidgetBody
(
name
,
$dialog
,
me
);
}
).
attachTo
(
$btn
)
}
);
me
.
on
(
'interactchange'
,
function
()
{
var
state
=
this
.
queryCommandState
(
name
);
$btn
.
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
)
});
me
.
on
(
'interactchange'
,
function
()
{
var
state
=
this
.
queryCommandState
(
name
);
$btn
.
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
)
}
);
return
$btn
;
});
\ No newline at end of file
}
);
\ No newline at end of file
src/core/kityminder.js
View file @
8aedd457
var
KityMinder
=
window
.
KM
=
window
.
KityMinder
=
function
()
{
window
.
KityMinder
=
function
()
{
var
instanceMap
=
{},
instanceId
=
0
;
return
{
version
:
'1.0.0'
,
createMinder
:
function
(
renderTarget
,
options
)
{
version
:
'1.0.0'
,
createMinder
:
function
(
renderTarget
,
options
)
{
options
=
options
||
{};
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
var
minder
=
new
Minder
(
options
);
this
.
addMinder
(
options
.
renderTo
,
minder
);
this
.
addMinder
(
options
.
renderTo
,
minder
);
return
minder
;
},
addMinder
:
function
(
target
,
minder
)
{
addMinder
:
function
(
target
,
minder
)
{
var
id
;
if
(
typeof
(
target
)
===
'string'
)
{
id
=
target
;
...
...
@@ -20,17 +20,16 @@ var KityMinder =
}
instanceMap
[
id
]
=
minder
;
},
getMinder
:
function
(
target
,
options
)
{
getMinder
:
function
(
target
,
options
)
{
var
id
;
if
(
typeof
(
target
)
===
'string'
)
{
id
=
target
;
}
else
{
id
=
target
.
id
||
(
"KM_INSTANCE_"
+
instanceId
++
);
}
return
instanceMap
[
id
]
||
this
.
createMinder
(
target
,
options
);
return
instanceMap
[
id
]
||
this
.
createMinder
(
target
,
options
);
},
//挂接多语言
LANG
:{}
LANG
:
{}
}
}();
}();
\ No newline at end of file
src/core/minder.js
View file @
8aedd457
...
...
@@ -39,7 +39,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_addRenderContainer
();
this
.
_root
=
new
MinderNode
(
"Main Topic"
);
this
.
_root
=
new
MinderNode
(
this
.
getLang
().
maintopic
);
this
.
_root
.
setType
(
"root"
);
if
(
this
.
_options
.
renderTo
)
{
this
.
renderTo
(
this
.
_options
.
renderTo
);
...
...
src/core/minder.lang.js
View file @
8aedd457
//添加多语言模块
kity
.
extendClass
(
Minder
,
{
getLang
:
function
(
path
)
{
getLang
:
function
(
path
)
{
var
lang
=
KM
.
LANG
[
this
.
getOptions
(
'lang'
)
];
if
(
!
lang
)
{
throw
Error
(
"not import language file"
);
var
lang
=
KM
.
LANG
[
this
.
getOptions
(
'lang'
)
];
if
(
!
lang
)
{
throw
Error
(
"not import language file"
);
}
path
=
(
path
||
""
).
split
(
"."
);
for
(
var
i
=
0
,
ci
;
ci
=
path
[
i
++
];
)
{
lang
=
lang
[
ci
];
if
(
!
lang
)
break
;
path
=
(
path
||
""
).
split
(
"."
);
for
(
var
i
=
0
,
ci
;
ci
=
path
[
i
++
];
)
{
lang
=
lang
[
ci
];
if
(
!
lang
)
break
;
}
return
lang
;
}
...
...
src/core/minder.module.js
View file @
8aedd457
...
...
@@ -38,12 +38,12 @@ kity.extendClass( Minder, {
}
}
if
(
moduleDeals
.
defaultOptions
)
{
this
.
setDefaultOptions
(
moduleDeals
.
defaultOptions
);
if
(
moduleDeals
.
defaultOptions
)
{
this
.
setDefaultOptions
(
moduleDeals
.
defaultOptions
);
}
//添加模块的快捷键
if
(
moduleDeals
.
addShortcutKeys
)
{
this
.
addShortcutKeys
(
moduleDeals
.
addShortcutKeys
)
if
(
moduleDeals
.
addShortcutKeys
)
{
this
.
addShortcutKeys
(
moduleDeals
.
addShortcutKeys
)
}
}
...
...
src/module/editor.js
View file @
8aedd457
...
...
@@ -83,7 +83,43 @@ 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
);
}
}
}
};
...
...
src/module/editor.receiver.js
View file @
8aedd457
...
...
@@ -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
:
...
...
@@ -263,5 +265,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 @
8aedd457
KityMinder
.
registerModule
(
"IconModule"
,
function
()
{
var
renderPriorityIcon
=
function
(
node
,
val
)
{
var
colors
=
[
""
,
"#A92E24"
,
"#29A6BD"
,
"#1E8D54"
,
"
orange
"
,
"#876DDA"
];
var
colors
=
[
""
,
"#A92E24"
,
"#29A6BD"
,
"#1E8D54"
,
"
#eb6100
"
,
"#876DDA"
];
var
_bg
=
new
kity
.
Rect
().
fill
(
colors
[
val
]
).
setRadius
(
3
).
setWidth
(
20
).
setHeight
(
20
);
var
_number
=
new
kity
.
Text
().
setContent
(
val
).
fill
(
"white"
).
setSize
(
12
);
var
_rc
=
new
kity
.
Group
();
...
...
@@ -34,45 +34,63 @@ KityMinder.registerModule( "IconModule", function () {
d
.
carcTo
(
6
,
0
,
6
,
1
,
0
);
break
;
case
5
:
_percent
.
addShape
(
new
kity
.
Circle
().
setRadius
(
6
).
fill
(
"#29A6BD"
)
);
var
check
=
new
kity
.
Path
();
_percent
.
addShapes
(
[
new
kity
.
Circle
().
setRadius
(
6
).
fill
(
"#29A6BD"
),
check
]
);
check
.
getDrawer
().
moveTo
(
-
3
,
0
).
lineTo
(
-
1
,
3
).
lineTo
(
3
,
-
2
);
check
.
stroke
(
new
kity
.
Pen
(
"white"
,
2
).
setLineCap
(
"round"
)
);
break
;
}
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"#29A6BD"
);
};
var
ChangeIconCommand
=
kity
.
createClass
(
"AddIcon
Command"
,
(
function
()
{
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriority
Command"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
,
iconType
,
value
)
{
execute
:
function
(
km
,
value
)
{
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
iconType
,
value
);
nodes
[
i
].
setData
(
"PriorityIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
}
},
queryValue
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
val
;
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
val
=
nodes
[
i
].
getData
(
"PriorityIcon"
);
if
(
val
)
break
;
}
return
val
;
}
};
}
)()
);
var
RemoveIconCommand
=
kity
.
createClass
(
"RemoveIcon
Command"
,
(
function
()
{
var
setProgressCommand
=
kity
.
createClass
(
"SetProgress
Command"
,
(
function
()
{
return
{
base
:
Command
,
execute
:
function
(
km
,
iconTyp
e
)
{
execute
:
function
(
km
,
valu
e
)
{
var
nodes
=
km
.
getSelectedNodes
();
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
nodes
[
i
].
setData
(
iconType
,
null
);
nodes
[
i
].
setData
(
"ProgressIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
}
},
queryValue
:
function
(
km
)
{
var
nodes
=
km
.
getSelectedNodes
();
var
val
;
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
val
=
nodes
[
i
].
getData
(
"ProgressIcon"
);
if
(
val
)
break
;
}
return
val
;
}
};
}
)()
);
return
{
"commands"
:
{
"
changeicon"
:
ChangeIcon
Command
,
"
removeicon"
:
RemoveIcon
Command
"
setpriority"
:
setPriority
Command
,
"
setprogress"
:
setProgress
Command
},
"events"
:
{
""
:
function
(
e
)
{
},
"RenderNode"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
iconRc
=
node
.
getIconRc
();
...
...
@@ -92,6 +110,7 @@ KityMinder.registerModule( "IconModule", function () {
var
iconWidth
=
iconRc
.
getWidth
();
var
textShape
=
node
.
getTextShape
();
if
(
iconWidth
)
textShape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
iconWidth
+
5
,
0
)
);
else
textShape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
0
,
0
)
);
}
}
};
...
...
src/module/keyboard.js
View file @
8aedd457
...
...
@@ -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,13 +86,15 @@ 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
(
'Topic'
)
);
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
);
e
.
preventDefault
();
break
;
case
keys
.
Tab
:
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
);
e
.
preventDefault
();
break
;
case
keys
.
Backspace
:
...
...
src/ui/modal.js
View file @
8aedd457
...
...
@@ -49,7 +49,6 @@ KM.ui.define( 'modal', {
return
me
[
!
me
.
data
(
"isShown"
)
?
'show'
:
'hide'
]();
},
show
:
function
()
{
var
me
=
this
;
me
.
trigger
(
"beforeshow"
);
...
...
themes/default/_css/buttonicon.css
View file @
8aedd457
...
...
@@ -17,7 +17,7 @@
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-hand
{
background
:
url(../images/hand.png)
no-repeat
2px
2px
;
}
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-
flag
{
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-
markers
{
background
:
url(../images/flag.png)
no-repeat
2px
2px
;
}
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-clock
{
...
...
themes/default/_css/dialog.css
View file @
8aedd457
.kmui-modal
{
position
:
fixed
;
_position
:
absolute
;
top
:
10%
;
left
:
50%
;
border
:
1px
solid
#acacac
;
box-shadow
:
2px
2px
5px
#d3d6da
;
top
:
10px
;
right
:
10px
;
background-color
:
#ffffff
;
outline
:
0
;
border-radius
:
5px
;
box-shadow
:
3px
3px
8px
rgba
(
0
,
0
,
0
,
.5
);
}
.kmui-modal-header
{
padding
:
5px
10px
;
...
...
themes/default/_css/dialogsize.css
View file @
8aedd457
.kmui-modal-header
.kmui-title
{
font-size
:
14px
;
}
.kmui-dialog-markers-body
{
width
:
700px
;
height
:
400px
;
padding-bottom
:
5px
}
.icon-list
{
margin
:
0
;
padding
:
0
}
.icon-list
li
{
padding
:
5px
10px
;
margin
:
0
;
list-style
:
none
;
cursor
:
pointer
;
color
:
#333
}
.icon-list
li
:hover
,
.icon-list
li
.active
{
background
:
#cfe0f7
}
.icon-list
li
span
.icon
{
display
:
inline-block
;
width
:
20px
;
height
:
20px
;
vertical-align
:
middle
;
margin-right
:
10px
;
}
\ No newline at end of file
themes/default/images/clock.png
0 → 100644
View file @
8aedd457
790 Bytes
themes/default/images/flag.png
0 → 100644
View file @
8aedd457
3.22 KB
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