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
230e65df
Commit
230e65df
authored
Feb 17, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added func
parent
772be409
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
89 deletions
+77
-89
dev.php
dist/dev.php
+1
-1
zh-cn.js
lang/zh-cn/zh-cn.js
+11
-10
dialog.js
src/adapter/dialog.js
+40
-59
modal.js
src/ui/modal.js
+6
-9
buttonicon.css
themes/default/_css/buttonicon.css
+1
-4
dialog.css
themes/default/_css/dialog.css
+18
-6
No files found.
dist/dev.php
View file @
230e65df
...
...
@@ -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 @
230e65df
...
...
@@ -9,23 +9,24 @@ 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://前缀'
'validLink'
:
'只支持选中一个链接时生效'
,
'httpPrompt'
:
'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀'
}
}
...
...
src/adapter/dialog.js
View file @
230e65df
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'
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
);
$dialog
.
on
(
"click"
,
"#icon-priority li"
,
function
()
{
var
$this
=
$
(
this
);
var
val
=
$this
.
val
();
me
.
execCommand
(
"changeicon"
,
"PriorityIcon"
,
val
);
}
).
on
(
"click"
,
"#icon-progress li"
,
function
()
{
var
$this
=
$
(
this
);
var
val
=
$this
.
val
();
me
.
execCommand
(
"changeicon"
,
"ProgressIcon"
,
val
);
}
);
}
).
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/ui/modal.js
View file @
230e65df
...
...
@@ -5,16 +5,13 @@ KM.ui.define( 'modal', {
'<div class="kmui-close" data-hide="modal"></div>'
+
'<h3 class="kmui-title"><%=title%></h3>'
+
'</div>'
+
'<div class="kmui-modal-body" style="<%if(width){%>width:<%=width%>px;<%}%>'
+
'<%if(height){%>height:<%=height%>px;<%}%>">'
+
' </div>'
+
'<% if(cancellabel || oklabel) {%>'
+
'<div class="kmui-modal-footer">'
+
'<div class="kmui-modal-tip"></div>'
+
'<%if(oklabel){%><div class="kmui-btn kmui-btn-primary" data-ok="modal"><%=oklabel%></div><%}%>'
+
'<%if(cancellabel){%><div class="kmui-btn" data-hide="modal"><%=cancellabel%></div><%}%>'
+
'<div>'
+
'<h3>优先级</h3>'
+
'<ul class="icon-list" id="icon-priority"><li value="1">1</li><li value="2">2</li><li value="3">3</li><li value="4">4</li><li value="5">5</li></ul>'
+
'<h3>进程</h3>'
+
'<ul class="icon-list" id="icon-progress"><li value="1">1</li><li value="2">2</li><li value="3">3</li><li value="4">4</li><li value="5">5</li></ul>'
+
'</div>'
+
'<
%}%><
/div>'
,
'</div>'
,
defaultOpt
:
{
title
:
""
,
cancellabel
:
""
,
...
...
themes/default/_css/buttonicon.css
View file @
230e65df
...
...
@@ -17,9 +17,6 @@
.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
;
}
\ No newline at end of file
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-clock
{
background
:
url(../images/clock.png)
no-repeat
2px
2px
;
}
\ No newline at end of file
themes/default/_css/dialog.css
View file @
230e65df
.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
;
...
...
@@ -80,3 +79,16 @@
line-height
:
30px
;
display
:
none
;
}
.icon-list
{
margin
:
0
;
padding
:
0
}
.icon-list
li
{
padding
:
10px
20px
;
margin
:
0
;
list-style
:
none
;
cursor
:
pointer
;
}
.icon-list
li
:hover
{
background
:
#cfe0f7
}
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