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
00eb48b2
Commit
00eb48b2
authored
Feb 17, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added 2icons
parent
ae2fa565
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
72 deletions
+75
-72
configure.js
configure.js
+1
-2
dev.php
dist/dev.php
+1
-0
zh-cn.js
lang/zh-cn/zh-cn.js
+3
-2
button.js
src/adapter/button.js
+13
-14
modal.js
src/ui/modal.js
+51
-54
buttonicon.css
themes/default/_css/buttonicon.css
+6
-0
No files found.
configure.js
View file @
00eb48b2
window
.
KITYMINDER_CONFIG
=
{
//定义工具栏
toolbars
:
[
'hand | undo redo | bold italic | fontfamily fontsize forecolor | saveto'
'hand
flag clock
| undo redo | bold italic | fontfamily fontsize forecolor | saveto'
]
//设置主题
//,defaultlayoutstyle : 'default' //设置默认的主题
//,layoutstyle : [] //添加有那些主图
...
...
dist/dev.php
View file @
00eb48b2
...
...
@@ -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 @
00eb48b2
...
...
@@ -15,6 +15,7 @@ KityMinder.LANG[ 'zh-cn' ] = {
'standardColor'
:
'标准颜色'
,
'themeColor'
:
'主题颜色'
},
'hand'
:
'允许拖拽'
'hand'
:
'允许拖拽'
,
'flag'
:
'优先级'
,
'clock'
:
'完成度'
};
\ No newline at end of file
src/adapter/button.js
View file @
00eb48b2
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/ui/modal.js
View file @
00eb48b2
/*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 @
00eb48b2
...
...
@@ -16,4 +16,10 @@
}
.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