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
392d98e9
Commit
392d98e9
authored
Feb 12, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
8872ad78
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
38 deletions
+11
-38
configure.js
configure.js
+1
-1
dev.php
dist/dev.php
+2
-0
zh-cn.js
lang/zh-cn/zh-cn.js
+3
-1
combobox.js
src/adapter/combobox.js
+2
-36
minder.data.js
src/core/minder.data.js
+3
-0
No files found.
configure.js
View file @
392d98e9
window
.
KITYMINDER_CONFIG
=
{
window
.
KITYMINDER_CONFIG
=
{
//定义工具栏
//定义工具栏
toolbars
:[
toolbars
:[
'undo redo | bold italic | forecolor | layoutstyle | fontfamily fontsize'
'undo redo | bold italic | forecolor | layoutstyle | fontfamily fontsize
| saveto
'
]
]
//设置主题
//设置主题
...
...
dist/dev.php
View file @
392d98e9
...
@@ -48,9 +48,11 @@ $dependency = Array(
...
@@ -48,9 +48,11 @@ $dependency = Array(
,
'src/ui/tab.js'
,
'src/ui/tab.js'
,
'src/ui/separator.js'
,
'src/ui/separator.js'
,
'src/ui/scale.js'
,
'src/ui/scale.js'
,
'src/adapter/utils.js'
,
'src/adapter/adapter.js'
,
'src/adapter/adapter.js'
,
'src/adapter/button.js'
,
'src/adapter/button.js'
,
'src/adapter/combobox.js'
,
'src/adapter/combobox.js'
,
'src/adapter/saveto.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 @
392d98e9
...
@@ -3,7 +3,8 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -3,7 +3,8 @@ KityMinder.LANG['zh-cn'] = {
'undo'
:
'撤销'
,
'redo'
:
'重做'
,
'undo'
:
'撤销'
,
'redo'
:
'重做'
,
'bold'
:
'加粗'
,
'italic'
:
'斜体'
,
'bold'
:
'加粗'
,
'italic'
:
'斜体'
,
'forecolor'
:
'字体颜色'
,
'fontfamily'
:
'字体'
,
'fontsize'
:
'字号'
,
'forecolor'
:
'字体颜色'
,
'fontfamily'
:
'字体'
,
'fontsize'
:
'字号'
,
'layoutstyle'
:
'选择主题'
'layoutstyle'
:
'选择主题'
,
'saveto'
:
'另存为...'
},
},
'popupcolor'
:{
'popupcolor'
:{
...
@@ -11,4 +12,5 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -11,4 +12,5 @@ KityMinder.LANG['zh-cn'] = {
'standardColor'
:
'标准颜色'
,
'standardColor'
:
'标准颜色'
,
'themeColor'
:
'主题颜色'
'themeColor'
:
'主题颜色'
}
}
};
};
\ No newline at end of file
src/adapter/combobox.js
View file @
392d98e9
...
@@ -62,41 +62,7 @@ KM.registerUI('layoutstyle fontfamily fontsize', function( name ) {
...
@@ -62,41 +62,7 @@ KM.registerUI('layoutstyle fontfamily fontsize', function( name ) {
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
return
comboboxWidget
.
button
().
addClass
(
'kmui-combobox'
);
/**
* 宽度自适应工具函数
* @param word 单词内容
* @param hasSuffix 是否含有后缀
*/
function
wordCountAdaptive
(
word
,
hasSuffix
)
{
var
$tmpNode
=
$
(
'<span>'
).
html
(
word
).
css
(
{
display
:
'inline'
,
position
:
'absolute'
,
top
:
-
10000000
,
left
:
-
100000
}
).
appendTo
(
document
.
body
),
width
=
$tmpNode
.
width
();
$tmpNode
.
remove
();
$tmpNode
=
null
;
if
(
width
<
50
)
{
return
word
;
}
else
{
word
=
word
.
slice
(
0
,
hasSuffix
?
-
4
:
-
1
);
if
(
!
word
.
length
)
{
return
'...'
;
}
return
wordCountAdaptive
(
word
+
'...'
,
true
);
}
}
function
transForLayoutstyle
(
options
)
{
function
transForLayoutstyle
(
options
)
{
...
@@ -106,7 +72,7 @@ KM.registerUI('layoutstyle fontfamily fontsize', function( name ) {
...
@@ -106,7 +72,7 @@ KM.registerUI('layoutstyle fontfamily fontsize', function( name ) {
utils
.
each
(
options
.
items
,
function
(
k
,
v
){
utils
.
each
(
options
.
items
,
function
(
k
,
v
){
options
.
value
.
push
(
k
);
options
.
value
.
push
(
k
);
tempItems
.
push
(
k
);
tempItems
.
push
(
k
);
options
.
autowidthitem
.
push
(
wordCountAdaptive
(
tempItems
[
tempItems
.
length
-
1
]
)
);
options
.
autowidthitem
.
push
(
$
.
wordCountAdaptive
(
tempItems
[
tempItems
.
length
-
1
]
)
);
});
});
options
.
items
=
tempItems
;
options
.
items
=
tempItems
;
...
@@ -127,7 +93,7 @@ KM.registerUI('layoutstyle fontfamily fontsize', function( name ) {
...
@@ -127,7 +93,7 @@ KM.registerUI('layoutstyle fontfamily fontsize', function( name ) {
tempItems
.
push
(
temp
.
split
(
/
\s
*,
\s
*/
)[
0
]
);
tempItems
.
push
(
temp
.
split
(
/
\s
*,
\s
*/
)[
0
]
);
options
.
itemStyles
.
push
(
'font-family: '
+
temp
);
options
.
itemStyles
.
push
(
'font-family: '
+
temp
);
options
.
value
.
push
(
temp
);
options
.
value
.
push
(
temp
);
options
.
autowidthitem
.
push
(
wordCountAdaptive
(
tempItems
[
i
]
)
);
options
.
autowidthitem
.
push
(
$
.
wordCountAdaptive
(
tempItems
[
i
]
)
);
}
}
...
...
src/core/minder.data.js
View file @
392d98e9
...
@@ -8,6 +8,9 @@ Utils.extend( KityMinder, {
...
@@ -8,6 +8,9 @@ Utils.extend( KityMinder, {
},
},
getSupportedProtocals
:
function
()
{
getSupportedProtocals
:
function
()
{
return
Utils
.
keys
(
KityMinder
.
_protocals
);
return
Utils
.
keys
(
KityMinder
.
_protocals
);
},
getAllRegisteredProtocals
:
function
(){
return
KityMinder
.
_protocals
}
}
}
);
}
);
...
...
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