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
;
var
utils
=
KM
.
utils
;
function
hrefStartWith
(
href
,
arr
)
{
KM
.
registerWidget
(
'markers'
,
{
href
=
href
.
replace
(
/^
\s
+|
\s
+$/g
,
''
);
tpl
:
"<ul class='icon-list'>"
+
for
(
var
i
=
0
,
ai
;
ai
=
arr
[
i
++
];)
{
"<li value='1' type='setpriority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) 0 0'></span><span><%= priority %>1</span></li>"
+
if
(
href
.
indexOf
(
ai
)
==
0
)
{
"<li value='2' type='setpriority'><span class='icon' style='background:url(../dialogs/icons/iconpriority.png) -20px 0'></span><span><%= priority %>2</span></li>"
+
return
true
;
"<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
);
}
}
}
this
.
root
().
html
(
html
);
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
);
},
},
initEvent
:
function
(
km
,
$w
)
{
initEvent
:
function
(
km
,
$w
)
{
var
link
=
km
.
queryCommandValue
(
'link'
);
$w
.
on
(
"click"
,
"li"
,
function
()
{
if
(
link
){
var
$this
=
$
(
this
);
$
(
'#kmui-link-Jhref'
,
$w
).
val
(
utils
.
html
(
$
(
link
).
attr
(
'href'
)));
$this
.
siblings
().
removeClass
(
"active"
);
$
(
'#kmui-link-Jtitle'
,
$w
).
val
(
$
(
link
).
attr
(
'title'
));
$this
.
toggleClass
(
"active"
);
$
(
link
).
attr
(
'target'
)
==
'_blank'
&&
$
(
'#kmui-link-Jtarget'
).
attr
(
'checked'
,
true
)
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
:
{
buttons
:
{
'ok'
:
{
'ok'
:
{
exec
:
function
(
km
,
$w
)
{
exec
:
function
(
km
,
$w
)
{
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
var
href
=
$
(
'#kmui-link-Jhref'
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
);
if
(
href
)
{
if
(
href
)
{
km
.
execCommand
(
'link'
,
{
km
.
execCommand
(
'link'
,
{
'href'
:
href
,
'href'
:
href
,
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'target'
:
$
(
"#kmui-link-Jtarget:checked"
).
length
?
"_blank"
:
'_self'
,
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'title'
:
$
(
"#kmui-link-Jtitle"
).
val
().
replace
(
/^
\s
+|
\s
+$/g
,
''
),
'_href'
:
href
'_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(
...
@@ -59,7 +59,7 @@ $dependency = Array(
,
'src/adapter/combobox.js'
,
'src/adapter/combobox.js'
,
'src/adapter/saveto.js'
,
'src/adapter/saveto.js'
,
'src/adapter/hand.js'
,
'src/adapter/hand.js'
,
'src/adapter/
icon
.js'
,
'src/adapter/
dialog
.js'
,
'src/protocal/plain.js'
,
'src/protocal/plain.js'
,
'src/protocal/json.js'
,
'src/protocal/json.js'
);
);
...
...
lang/zh-cn/zh-cn.js
View file @
8aedd457
KityMinder
.
LANG
[
'zh-cn'
]
=
{
KityMinder
.
LANG
[
'zh-cn'
]
=
{
'maintopic'
:
'中心主题'
,
'topic'
:
'分支主题'
,
'tooltips'
:
{
'tooltips'
:
{
'undo'
:
'撤销'
,
'undo'
:
'撤销'
,
'redo'
:
'重做'
,
'redo'
:
'重做'
,
...
@@ -9,23 +11,30 @@ KityMinder.LANG[ 'zh-cn' ] = {
...
@@ -9,23 +11,30 @@ KityMinder.LANG[ 'zh-cn' ] = {
'fontsize'
:
'字号'
,
'fontsize'
:
'字号'
,
'layoutstyle'
:
'主题'
,
'layoutstyle'
:
'主题'
,
'saveto'
:
'导出'
,
'saveto'
:
'导出'
,
'hand'
:
'允许拖拽'
'hand'
:
'允许拖拽'
,
'markers'
:
'添加标签'
},
},
'popupcolor'
:
{
'popupcolor'
:
{
'clearColor'
:
'清空颜色'
,
'clearColor'
:
'清空颜色'
,
'standardColor'
:
'标准颜色'
,
'standardColor'
:
'标准颜色'
,
'themeColor'
:
'主题颜色'
'themeColor'
:
'主题颜色'
},
},
'dialogs'
:{
'dialogs'
:
{
'markers'
:{
'markers'
:
{
'static'
:{
'static'
:
{
'lang_input_text'
:
'文本内容:'
,
'lang_input_text'
:
'文本内容:'
,
'lang_input_url'
:
'链接地址:'
,
'lang_input_url'
:
'链接地址:'
,
'lang_input_title'
:
'标题:'
,
'lang_input_title'
:
'标题:'
,
'lang_input_target'
:
'是否在新窗口打开:'
'lang_input_target'
:
'是否在新窗口打开:'
},
},
'validLink'
:
'只支持选中一个链接时生效'
,
'priority'
:
'优先级'
,
'httpPrompt'
:
'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀'
'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
=
{
opt
=
{
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
,
width
:
200
,
url
:
me
.
getOptions
(
'KITYMINDER_HOME_URL'
)
+
'dialogs/'
+
name
+
'/'
+
name
+
'.js'
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
,
url
:
me
.
getOptions
(
'KITYMINDER_HOME_URL'
)
+
'dialogs/'
+
name
+
'/'
+
name
+
'.js'
,
};
};
var
$btn
=
$
.
kmuibutton
({
var
$btn
=
$
.
kmuibutton
(
{
icon
:
name
,
icon
:
name
,
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
});
}
);
//加载模版数据
//加载模版数据
utils
.
loadFile
(
document
,
{
utils
.
loadFile
(
document
,
{
src
:
opt
.
url
,
src
:
opt
.
url
,
tag
:
"script"
,
tag
:
"script"
,
type
:
"text/javascript"
,
type
:
"text/javascript"
,
defer
:
"defer"
defer
:
"defer"
},
function
(){
},
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
);
$dialog
=
$
.
kmuimodal
(
opt
);
$dialog
=
$
.
kmuimodal
(
opt
);
$dialog
.
attr
(
'id'
,
'kmui-dialog-'
+
name
).
addClass
(
'kmui-dialog-'
+
name
)
$dialog
.
attr
(
'id'
,
'kmui-dialog-'
+
name
).
addClass
(
'kmui-dialog-'
+
name
)
.
find
(
'.kmui-modal-body'
).
addClass
(
'kmui-dialog-'
+
name
+
'-body'
);
.
find
(
'.kmui-modal-body'
).
addClass
(
'kmui-dialog-'
+
name
+
'-body'
);
$dialog
.
kmui
().
on
(
'beforeshow'
,
function
()
{
$dialog
.
kmui
().
on
(
'beforeshow'
,
function
()
{
var
$root
=
this
.
root
(),
var
$root
=
this
.
root
(),
win
=
null
,
win
=
null
,
offset
=
null
;
offset
=
null
;
if
(
!
$root
.
parent
()[
0
]
)
{
if
(
!
$root
.
parent
()[
0
])
{
me
.
$container
.
find
(
'.kmui-dialog-container'
).
append
(
$root
);
me
.
$container
.
find
(
'.kmui-dialog-container'
).
append
(
$root
);
}
}
KM
.
setWidgetBody
(
name
,
$dialog
,
me
);
KM
.
setWidgetBody
(
name
,
$dialog
,
me
);
}
).
attachTo
(
$btn
)
}).
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
)
});
me
.
on
(
'interactchange'
,
function
()
{
me
.
on
(
'interactchange'
,
function
()
{
var
state
=
this
.
queryCommandState
(
name
);
var
state
=
this
.
queryCommandState
(
name
);
$btn
.
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
)
$btn
.
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
)
});
}
);
return
$btn
;
return
$btn
;
});
}
);
\ No newline at end of file
\ No newline at end of file
src/core/kityminder.js
View file @
8aedd457
var
KityMinder
=
var
KityMinder
=
window
.
KM
=
window
.
KM
=
window
.
KityMinder
=
function
()
{
window
.
KityMinder
=
function
()
{
var
instanceMap
=
{},
instanceId
=
0
;
var
instanceMap
=
{},
instanceId
=
0
;
return
{
return
{
version
:
'1.0.0'
,
version
:
'1.0.0'
,
createMinder
:
function
(
renderTarget
,
options
)
{
createMinder
:
function
(
renderTarget
,
options
)
{
options
=
options
||
{};
options
=
options
||
{};
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
options
.
renderTo
=
Utils
.
isString
(
renderTarget
)
?
document
.
getElementById
(
renderTarget
)
:
renderTarget
;
var
minder
=
new
Minder
(
options
);
var
minder
=
new
Minder
(
options
);
this
.
addMinder
(
options
.
renderTo
,
minder
);
this
.
addMinder
(
options
.
renderTo
,
minder
);
return
minder
;
return
minder
;
},
},
addMinder
:
function
(
target
,
minder
)
{
addMinder
:
function
(
target
,
minder
)
{
var
id
;
var
id
;
if
(
typeof
(
target
)
===
'string'
)
{
if
(
typeof
(
target
)
===
'string'
)
{
id
=
target
;
id
=
target
;
...
@@ -20,17 +20,16 @@ var KityMinder =
...
@@ -20,17 +20,16 @@ var KityMinder =
}
}
instanceMap
[
id
]
=
minder
;
instanceMap
[
id
]
=
minder
;
},
},
getMinder
:
function
(
target
,
options
)
{
getMinder
:
function
(
target
,
options
)
{
var
id
;
var
id
;
if
(
typeof
(
target
)
===
'string'
)
{
if
(
typeof
(
target
)
===
'string'
)
{
id
=
target
;
id
=
target
;
}
else
{
}
else
{
id
=
target
.
id
||
(
"KM_INSTANCE_"
+
instanceId
++
);
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", {
...
@@ -39,7 +39,7 @@ var Minder = KityMinder.Minder = kity.createClass( "KityMinder", {
this
.
_addRenderContainer
();
this
.
_addRenderContainer
();
this
.
_root
=
new
MinderNode
(
"Main Topic"
);
this
.
_root
=
new
MinderNode
(
this
.
getLang
().
maintopic
);
this
.
_root
.
setType
(
"root"
);
this
.
_root
.
setType
(
"root"
);
if
(
this
.
_options
.
renderTo
)
{
if
(
this
.
_options
.
renderTo
)
{
this
.
renderTo
(
this
.
_options
.
renderTo
);
this
.
renderTo
(
this
.
_options
.
renderTo
);
...
...
src/core/minder.lang.js
View file @
8aedd457
//添加多语言模块
//添加多语言模块
kity
.
extendClass
(
Minder
,
{
kity
.
extendClass
(
Minder
,
{
getLang
:
function
(
path
)
{
getLang
:
function
(
path
)
{
var
lang
=
KM
.
LANG
[
this
.
getOptions
(
'lang'
)
];
var
lang
=
KM
.
LANG
[
this
.
getOptions
(
'lang'
)
];
if
(
!
lang
)
{
if
(
!
lang
)
{
throw
Error
(
"not import language file"
);
throw
Error
(
"not import language file"
);
}
}
path
=
(
path
||
""
).
split
(
"."
);
path
=
(
path
||
""
).
split
(
"."
);
for
(
var
i
=
0
,
ci
;
ci
=
path
[
i
++
];
)
{
for
(
var
i
=
0
,
ci
;
ci
=
path
[
i
++
];
)
{
lang
=
lang
[
ci
];
lang
=
lang
[
ci
];
if
(
!
lang
)
break
;
if
(
!
lang
)
break
;
}
}
return
lang
;
return
lang
;
}
}
...
...
src/core/minder.module.js
View file @
8aedd457
...
@@ -38,12 +38,12 @@ kity.extendClass( Minder, {
...
@@ -38,12 +38,12 @@ kity.extendClass( Minder, {
}
}
}
}
if
(
moduleDeals
.
defaultOptions
)
{
if
(
moduleDeals
.
defaultOptions
)
{
this
.
setDefaultOptions
(
moduleDeals
.
defaultOptions
);
this
.
setDefaultOptions
(
moduleDeals
.
defaultOptions
);
}
}
//添加模块的快捷键
//添加模块的快捷键
if
(
moduleDeals
.
addShortcutKeys
)
{
if
(
moduleDeals
.
addShortcutKeys
)
{
this
.
addShortcutKeys
(
moduleDeals
.
addShortcutKeys
)
this
.
addShortcutKeys
(
moduleDeals
.
addShortcutKeys
)
}
}
}
}
...
...
src/module/editor.js
View file @
8aedd457
...
@@ -83,7 +83,43 @@ KityMinder.registerModule( "TextEditModule", function () {
...
@@ -83,7 +83,43 @@ KityMinder.registerModule( "TextEditModule", function () {
},
},
'stopTextEdit'
:
function
(){
'stopTextEdit'
:
function
(){
sel
.
setHide
();
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',{
...
@@ -77,8 +77,10 @@ Minder.Receiver = kity.createClass('Receiver',{
switch
(
keyCode
){
switch
(
keyCode
){
case
keymap
.
Enter
:
case
keymap
.
Enter
:
case
keymap
.
Tab
:
case
keymap
.
Tab
:
if
(
this
.
keydownNode
===
this
.
minderNode
){
this
.
setTextEditStatus
(
false
);
this
.
setTextEditStatus
(
false
);
this
.
clear
();
this
.
clear
();
}
e
.
preventDefault
();
e
.
preventDefault
();
return
;
return
;
case
keymap
.
Shift
:
case
keymap
.
Shift
:
...
@@ -263,5 +265,9 @@ Minder.Receiver = kity.createClass('Receiver',{
...
@@ -263,5 +265,9 @@ Minder.Receiver = kity.createClass('Receiver',{
range
.
setEnd
(
node
,
this
.
selection
.
endOffset
);
range
.
setEnd
(
node
,
this
.
selection
.
endOffset
);
range
.
select
();
range
.
select
();
return
this
;
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
()
{
KityMinder
.
registerModule
(
"IconModule"
,
function
()
{
var
renderPriorityIcon
=
function
(
node
,
val
)
{
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
_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
_number
=
new
kity
.
Text
().
setContent
(
val
).
fill
(
"white"
).
setSize
(
12
);
var
_rc
=
new
kity
.
Group
();
var
_rc
=
new
kity
.
Group
();
...
@@ -34,45 +34,63 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -34,45 +34,63 @@ KityMinder.registerModule( "IconModule", function () {
d
.
carcTo
(
6
,
0
,
6
,
1
,
0
);
d
.
carcTo
(
6
,
0
,
6
,
1
,
0
);
break
;
break
;
case
5
:
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
;
break
;
}
}
if
(
val
<
5
)
d
.
close
();
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"#29A6BD"
);
_percent
.
fill
(
"#29A6BD"
);
};
};
var
ChangeIconCommand
=
kity
.
createClass
(
"AddIcon
Command"
,
(
function
()
{
var
setPriorityCommand
=
kity
.
createClass
(
"SetPriority
Command"
,
(
function
()
{
return
{
return
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
iconType
,
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
(
iconType
,
value
);
nodes
[
i
].
setData
(
"PriorityIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
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
{
return
{
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
iconTyp
e
)
{
execute
:
function
(
km
,
valu
e
)
{
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
(
iconType
,
null
);
nodes
[
i
].
setData
(
"ProgressIcon"
,
value
);
km
.
updateLayout
(
nodes
[
i
]
);
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
{
return
{
"commands"
:
{
"commands"
:
{
"
changeicon"
:
ChangeIcon
Command
,
"
setpriority"
:
setPriority
Command
,
"
removeicon"
:
RemoveIcon
Command
"
setprogress"
:
setProgress
Command
},
},
"events"
:
{
"events"
:
{
""
:
function
(
e
)
{
},
"RenderNode"
:
function
(
e
)
{
"RenderNode"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
node
=
e
.
node
;
var
iconRc
=
node
.
getIconRc
();
var
iconRc
=
node
.
getIconRc
();
...
@@ -92,6 +110,7 @@ KityMinder.registerModule( "IconModule", function () {
...
@@ -92,6 +110,7 @@ KityMinder.registerModule( "IconModule", function () {
var
iconWidth
=
iconRc
.
getWidth
();
var
iconWidth
=
iconRc
.
getWidth
();
var
textShape
=
node
.
getTextShape
();
var
textShape
=
node
.
getTextShape
();
if
(
iconWidth
)
textShape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
iconWidth
+
5
,
0
)
);
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 () {
...
@@ -67,6 +67,7 @@ KityMinder.registerModule( "KeyboardModule", function () {
buildPositionNetwork
(
this
.
getRoot
()
);
buildPositionNetwork
(
this
.
getRoot
()
);
},
},
keydown
:
function
(
e
)
{
keydown
:
function
(
e
)
{
var
keys
=
KityMinder
.
keymap
;
var
keys
=
KityMinder
.
keymap
;
if
(
this
.
receiver
.
isTextEditStatus
()
)
{
if
(
this
.
receiver
.
isTextEditStatus
()
)
{
switch
(
e
.
originEvent
.
keyCode
)
{
switch
(
e
.
originEvent
.
keyCode
)
{
...
@@ -85,13 +86,15 @@ KityMinder.registerModule( "KeyboardModule", function () {
...
@@ -85,13 +86,15 @@ KityMinder.registerModule( "KeyboardModule", function () {
}
}
return
;
return
;
}
}
var
node
=
e
.
getTargetNode
();
this
.
receiver
.
keydownNode
=
node
;
switch
(
e
.
originEvent
.
keyCode
)
{
switch
(
e
.
originEvent
.
keyCode
)
{
case
keys
.
Enter
:
case
keys
.
Enter
:
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
'Topic'
)
);
this
.
execCommand
(
'appendSiblingNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
);
e
.
preventDefault
();
e
.
preventDefault
();
break
;
break
;
case
keys
.
Tab
:
case
keys
.
Tab
:
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
'Topic'
)
);
this
.
execCommand
(
'appendChildNode'
,
new
MinderNode
(
this
.
getLang
().
topic
)
);
e
.
preventDefault
();
e
.
preventDefault
();
break
;
break
;
case
keys
.
Backspace
:
case
keys
.
Backspace
:
...
...
src/ui/modal.js
View file @
8aedd457
...
@@ -49,7 +49,6 @@ KM.ui.define( 'modal', {
...
@@ -49,7 +49,6 @@ KM.ui.define( 'modal', {
return
me
[
!
me
.
data
(
"isShown"
)
?
'show'
:
'hide'
]();
return
me
[
!
me
.
data
(
"isShown"
)
?
'show'
:
'hide'
]();
},
},
show
:
function
()
{
show
:
function
()
{
var
me
=
this
;
var
me
=
this
;
me
.
trigger
(
"beforeshow"
);
me
.
trigger
(
"beforeshow"
);
...
...
themes/default/_css/buttonicon.css
View file @
8aedd457
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-hand
{
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-hand
{
background
:
url(../images/hand.png)
no-repeat
2px
2px
;
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
;
background
:
url(../images/flag.png)
no-repeat
2px
2px
;
}
}
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-clock
{
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-clock
{
...
...
themes/default/_css/dialog.css
View file @
8aedd457
.kmui-modal
{
.kmui-modal
{
position
:
fixed
;
position
:
fixed
;
_position
:
absolute
;
top
:
10px
;
top
:
10%
;
right
:
10px
;
left
:
50%
;
border
:
1px
solid
#acacac
;
box-shadow
:
2px
2px
5px
#d3d6da
;
background-color
:
#ffffff
;
background-color
:
#ffffff
;
outline
:
0
;
outline
:
0
;
border-radius
:
5px
;
box-shadow
:
3px
3px
8px
rgba
(
0
,
0
,
0
,
.5
);
}
}
.kmui-modal-header
{
.kmui-modal-header
{
padding
:
5px
10px
;
padding
:
5px
10px
;
...
...
themes/default/_css/dialogsize.css
View file @
8aedd457
.kmui-modal-header
.kmui-title
{
font-size
:
14px
;
}
.kmui-dialog-markers-body
{
.kmui-dialog-markers-body
{
width
:
700px
;
padding-bottom
:
5px
height
:
400px
;
}
.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