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
6761bdd8
Commit
6761bdd8
authored
Feb 17, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
Conflicts: configure.js lang/zh-cn/zh-cn.js
parents
219afeb1
2e7c0f6c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
74 deletions
+80
-74
dev.php
dist/dev.php
+1
-0
zh-cn.js
lang/zh-cn/zh-cn.js
+2
-2
button.js
src/adapter/button.js
+13
-14
icon.js
src/module/icon.js
+7
-4
modal.js
src/ui/modal.js
+51
-54
buttonicon.css
themes/default/_css/buttonicon.css
+6
-0
No files found.
dist/dev.php
View file @
6761bdd8
...
...
@@ -59,6 +59,7 @@ $dependency = Array(
,
'src/adapter/combobox.js'
,
'src/adapter/saveto.js'
,
'src/adapter/hand.js'
,
'src/adapter/icon.js'
,
'src/protocal/plain.js'
,
'src/protocal/json.js'
);
...
...
lang/zh-cn/zh-cn.js
View file @
6761bdd8
...
...
@@ -9,14 +9,13 @@ KityMinder.LANG[ 'zh-cn' ] = {
'fontsize'
:
'字号'
,
'layoutstyle'
:
'主题'
,
'saveto'
:
'导出'
,
'
markers'
:
'标示
'
'
hand'
:
'允许拖拽
'
},
'popupcolor'
:
{
'clearColor'
:
'清空颜色'
,
'standardColor'
:
'标准颜色'
,
'themeColor'
:
'主题颜色'
},
'hand'
:
'允许拖拽'
,
'dialogs'
:{
'markers'
:{
'static'
:{
...
...
@@ -29,4 +28,5 @@ KityMinder.LANG[ 'zh-cn' ] = {
'httpPrompt'
:
'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀'
}
}
};
\ No newline at end of file
src/adapter/button.js
View file @
6761bdd8
KM
.
registerUI
(
'bold italic redo undo'
,
function
(
name
)
{
KM
.
registerUI
(
'bold italic redo undo'
,
function
(
name
)
{
var
me
=
this
;
var
$btn
=
$
.
kmuibutton
({
icon
:
name
,
click
:
function
()
{
me
.
execCommand
(
name
);
var
$btn
=
$
.
kmuibutton
(
{
icon
:
name
,
click
:
function
()
{
me
.
execCommand
(
name
);
},
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
});
this
.
on
(
'interactchange'
,
function
()
{
var
state
=
this
.
queryCommandState
(
name
);
$btn
.
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
)
});
title
:
this
.
getLang
(
'tooltips'
)[
name
]
||
''
}
);
this
.
on
(
'interactchange'
,
function
()
{
var
state
=
this
.
queryCommandState
(
name
);
$btn
.
kmui
().
disabled
(
state
==
-
1
).
active
(
state
==
1
);
}
);
return
$btn
;
}
);
\ No newline at end of file
src/module/icon.js
View file @
6761bdd8
KityMinder
.
registerModule
(
"IconModule"
,
function
()
{
var
renderPriorityIcon
=
function
(
node
,
val
)
{
var
colors
=
[
""
,
"
red"
,
"blue"
,
"green"
,
"orange"
,
"purple
"
];
var
colors
=
[
""
,
"
#A92E24"
,
"#29A6BD"
,
"#1E8D54"
,
"orange"
,
"#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
();
...
...
@@ -10,7 +10,7 @@ KityMinder.registerModule( "IconModule", function () {
};
var
renderProgressIcon
=
function
(
node
,
val
,
left
)
{
var
_rc
=
new
kity
.
Group
();
var
_bg
=
new
kity
.
Circle
().
setRadius
(
8
).
fill
(
"white"
).
stroke
(
new
kity
.
Pen
(
"
blue
"
,
2
)
);
var
_bg
=
new
kity
.
Circle
().
setRadius
(
8
).
fill
(
"white"
).
stroke
(
new
kity
.
Pen
(
"
#29A6BD
"
,
2
)
);
var
_percent
,
d
;
if
(
val
<
5
)
{
_percent
=
new
kity
.
Path
();
...
...
@@ -34,11 +34,11 @@ KityMinder.registerModule( "IconModule", function () {
d
.
carcTo
(
6
,
0
,
6
,
1
,
0
);
break
;
case
5
:
_percent
.
addShape
(
new
kity
.
Circle
().
setRadius
(
6
).
fill
(
"
blue
"
)
);
_percent
.
addShape
(
new
kity
.
Circle
().
setRadius
(
6
).
fill
(
"
#29A6BD
"
)
);
break
;
}
if
(
val
<
5
)
d
.
close
();
_percent
.
fill
(
"
blue
"
);
_percent
.
fill
(
"
#29A6BD
"
);
};
var
ChangeIconCommand
=
kity
.
createClass
(
"AddIconCommand"
,
(
function
()
{
return
{
...
...
@@ -70,6 +70,9 @@ KityMinder.registerModule( "IconModule", function () {
"removeicon"
:
RemoveIconCommand
},
"events"
:
{
""
:
function
(
e
)
{
},
"RenderNode"
:
function
(
e
)
{
var
node
=
e
.
node
;
var
iconRc
=
node
.
getIconRc
();
...
...
src/ui/modal.js
View file @
6761bdd8
/*modal 类*/
KM
.
ui
.
define
(
'modal'
,
{
KM
.
ui
.
define
(
'modal'
,
{
tpl
:
'<div class="kmui-modal" tabindex="-1" >'
+
'<div class="kmui-modal-header">'
+
'<div class="kmui-close" data-hide="modal"></div>'
+
...
...
@@ -24,70 +24,70 @@ KM.ui.define('modal', {
backdrop
:
true
,
keyboard
:
true
},
init
:
function
(
options
)
{
init
:
function
(
options
)
{
var
me
=
this
;
me
.
root
(
$
(
$
.
parseTmpl
(
me
.
tpl
,
options
||
{}))
);
me
.
root
(
$
(
$
.
parseTmpl
(
me
.
tpl
,
options
||
{}
)
)
);
me
.
data
(
"options"
,
options
);
if
(
options
.
okFn
)
{
me
.
on
(
'ok'
,
$
.
proxy
(
options
.
okFn
,
me
)
)
me
.
data
(
"options"
,
options
);
if
(
options
.
okFn
)
{
me
.
on
(
'ok'
,
$
.
proxy
(
options
.
okFn
,
me
)
)
}
if
(
options
.
cancelFn
)
{
me
.
on
(
'beforehide'
,
$
.
proxy
(
options
.
cancelFn
,
me
)
)
if
(
options
.
cancelFn
)
{
me
.
on
(
'beforehide'
,
$
.
proxy
(
options
.
cancelFn
,
me
)
)
}
me
.
root
().
delegate
(
'[data-hide="modal"]'
,
'click'
,
$
.
proxy
(
me
.
hide
,
me
)
)
.
delegate
(
'[data-ok="modal"]'
,
'click'
,
$
.
proxy
(
me
.
ok
,
me
)
);
me
.
root
().
delegate
(
'[data-hide="modal"]'
,
'click'
,
$
.
proxy
(
me
.
hide
,
me
)
)
.
delegate
(
'[data-ok="modal"]'
,
'click'
,
$
.
proxy
(
me
.
ok
,
me
)
);
$
(
'[data-hide="modal"],[data-ok="modal"]'
,
me
.
root
()).
hover
(
function
()
{
$
(
this
).
toggleClass
(
'kmui-hover'
)
});
$
(
'[data-hide="modal"],[data-ok="modal"]'
,
me
.
root
()
).
hover
(
function
()
{
$
(
this
).
toggleClass
(
'kmui-hover'
)
}
);
},
toggle
:
function
()
{
var
me
=
this
;
return
me
[
!
me
.
data
(
"isShown"
)
?
'show'
:
'hide'
]();
return
me
[
!
me
.
data
(
"isShown"
)
?
'show'
:
'hide'
]();
},
show
:
function
()
{
var
me
=
this
;
me
.
trigger
(
"beforeshow"
);
me
.
trigger
(
"beforeshow"
);
if
(
me
.
data
(
"isShown"
)
)
return
;
if
(
me
.
data
(
"isShown"
)
)
return
;
me
.
data
(
"isShown"
,
true
);
me
.
data
(
"isShown"
,
true
);
me
.
escape
();
me
.
backdrop
(
function
()
{
me
.
backdrop
(
function
()
{
me
.
autoCenter
();
me
.
root
()
.
show
()
.
focus
()
.
trigger
(
'aftershow'
);
})
.
trigger
(
'aftershow'
);
}
)
},
showTip
:
function
(
text
)
{
$
(
'.kmui-modal-tip'
,
this
.
root
()
).
html
(
text
).
fadeIn
();
},
hideTip
:
function
(
text
)
{
$
(
'.kmui-modal-tip'
,
this
.
root
()
).
fadeOut
(
function
(){
$
(
this
).
html
(
''
);
$
(
'.kmui-modal-tip'
,
this
.
root
()
).
fadeOut
(
function
()
{
$
(
this
).
html
(
''
);
}
);
},
autoCenter
:
function
()
{
//ie6下不用处理了
!
$
.
IE6
&&
this
.
root
().
css
(
"margin-left"
,
-
(
this
.
root
().
width
()
/
2
)
);
!
$
.
IE6
&&
this
.
root
().
css
(
"margin-left"
,
-
(
this
.
root
().
width
()
/
2
)
);
},
hide
:
function
()
{
var
me
=
this
;
me
.
trigger
(
"beforehide"
);
me
.
trigger
(
"beforehide"
);
if
(
!
me
.
data
(
"isShown"
)
)
return
;
if
(
!
me
.
data
(
"isShown"
)
)
return
;
me
.
data
(
"isShown"
,
false
);
me
.
data
(
"isShown"
,
false
);
me
.
escape
();
...
...
@@ -95,61 +95,58 @@ KM.ui.define('modal', {
},
escape
:
function
()
{
var
me
=
this
;
if
(
me
.
data
(
"isShown"
)
&&
me
.
data
(
"options"
).
keyboard
)
{
me
.
root
().
on
(
'keyup'
,
function
(
e
)
{
if
(
me
.
data
(
"isShown"
)
&&
me
.
data
(
"options"
).
keyboard
)
{
me
.
root
().
on
(
'keyup'
,
function
(
e
)
{
e
.
which
==
27
&&
me
.
hide
();
})
}
else
if
(
!
me
.
data
(
"isShown"
))
{
me
.
root
().
off
(
'keyup'
);
}
)
}
else
if
(
!
me
.
data
(
"isShown"
)
)
{
me
.
root
().
off
(
'keyup'
);
}
},
hideModal
:
function
()
{
var
me
=
this
;
me
.
root
().
hide
();
me
.
backdrop
(
function
()
{
me
.
backdrop
(
function
()
{
me
.
removeBackdrop
();
me
.
trigger
(
'afterhide'
);
})
me
.
trigger
(
'afterhide'
);
}
)
},
removeBackdrop
:
function
()
{
this
.
$backdrop
&&
this
.
$backdrop
.
remove
();
this
.
$backdrop
=
null
;
},
backdrop
:
function
(
callback
)
{
backdrop
:
function
(
callback
)
{
var
me
=
this
;
if
(
me
.
data
(
"isShown"
)
&&
me
.
data
(
"options"
).
backdrop
)
{
me
.
$backdrop
=
$
(
'<div class="kmui-modal-backdrop" />'
).
click
(
me
.
data
(
"options"
).
backdrop
==
'static'
?
$
.
proxy
(
me
.
root
()[
0
].
focus
,
me
.
root
()[
0
])
:
$
.
proxy
(
me
.
hide
,
me
)
if
(
me
.
data
(
"isShown"
)
&&
me
.
data
(
"options"
).
backdrop
)
{
me
.
$backdrop
=
$
(
'<div class="kmui-modal-backdrop" />'
).
click
(
me
.
data
(
"options"
).
backdrop
==
'static'
?
$
.
proxy
(
me
.
root
()[
0
].
focus
,
me
.
root
()[
0
]
)
:
$
.
proxy
(
me
.
hide
,
me
)
)
}
me
.
trigger
(
'afterbackdrop'
);
me
.
trigger
(
'afterbackdrop'
);
callback
&&
callback
();
},
attachTo
:
function
(
$obj
)
{
attachTo
:
function
(
$obj
)
{
var
me
=
this
if
(
!
$obj
.
data
(
'$mergeObj'
)
)
{
if
(
!
$obj
.
data
(
'$mergeObj'
)
)
{
$obj
.
data
(
'$mergeObj'
,
me
.
root
()
);
$obj
.
on
(
'click'
,
function
()
{
me
.
toggle
(
$obj
)
});
me
.
data
(
'$mergeObj'
,
$obj
)
$obj
.
data
(
'$mergeObj'
,
me
.
root
()
);
$obj
.
on
(
'click'
,
function
()
{
me
.
toggle
(
$obj
)
}
);
me
.
data
(
'$mergeObj'
,
$obj
)
}
},
ok
:
function
()
{
var
me
=
this
;
me
.
trigger
(
'beforeok'
);
if
(
me
.
trigger
(
"ok"
,
me
)
===
false
)
{
me
.
trigger
(
'beforeok'
);
if
(
me
.
trigger
(
"ok"
,
me
)
===
false
)
{
return
;
}
me
.
hide
();
},
getBodyContainer
:
function
()
{
return
this
.
root
().
find
(
'.kmui-modal-body'
)
return
this
.
root
().
find
(
'.kmui-modal-body'
)
}
});
}
);
\ No newline at end of file
themes/default/_css/buttonicon.css
View file @
6761bdd8
...
...
@@ -17,3 +17,9 @@
.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
{
background
:
url(../images/flag.png)
no-repeat
2px
2px
;
}
.kmui-btn-toolbar
.kmui-btn
.kmui-icon-clock
{
background
:
url(../images/clock.png)
no-repeat
2px
2px
;
}
\ 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