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
1c977eb9
Commit
1c977eb9
authored
Feb 17, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
by zhanyi
parent
8cdd0c12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
176 additions
and
43 deletions
+176
-43
configure.js
configure.js
+76
-15
zh-cn.js
lang/zh-cn/zh-cn.js
+15
-3
utils.js
src/core/utils.js
+83
-1
dialogsize.css
themes/default/_css/dialogsize.css
+2
-24
No files found.
configure.js
View file @
1c977eb9
window
.
KITYMINDER_CONFIG
=
{
(
function
(){
//定义工具栏
function
getKMBasePath
(
docUrl
,
confUrl
)
{
toolbars
:
[
'hand | undo redo | bold italic | fontfamily fontsize forecolor | saveto'
]
//设置主题
return
getBasePath
(
docUrl
||
self
.
document
.
URL
||
self
.
location
.
href
,
confUrl
||
getConfigFilePath
()
);
//,defaultlayoutstyle : 'default' //设置默认的主题
//,layoutstyle : [] //添加有那些主图
//回退相关选项
}
//,maxUndoCount:20 //最大可回退的次数,默认20
//语言默认是zh-cn
function
getConfigFilePath
()
{
//,lang:'zh-cn'
//设置km整体的z-index大小
var
configPath
=
document
.
getElementsByTagName
(
'script'
);
//,zIndex : 1000
return
configPath
[
configPath
.
length
-
1
].
src
;
};
}
\ No newline at end of file
function
getBasePath
(
docUrl
,
confUrl
)
{
var
basePath
=
confUrl
;
if
(
/^
(\/
|
\\\\)
/
.
test
(
confUrl
)){
basePath
=
/^.+
?\w(\/
|
\\\\)
/
.
exec
(
docUrl
)[
0
]
+
confUrl
.
replace
(
/^
(\/
|
\\\\)
/
,
''
);
}
else
if
(
!
/^
[
a-z
]
+:/i
.
test
(
confUrl
)
)
{
docUrl
=
docUrl
.
split
(
"#"
)[
0
].
split
(
"?"
)[
0
].
replace
(
/
[^\\\/]
+$/
,
''
);
basePath
=
docUrl
+
""
+
confUrl
;
}
return
optimizationPath
(
basePath
);
}
function
optimizationPath
(
path
)
{
var
protocol
=
/^
[
a-z
]
+:
\/\/
/
.
exec
(
path
)[
0
],
tmp
=
null
,
res
=
[];
path
=
path
.
replace
(
protocol
,
""
).
split
(
"?"
)[
0
].
split
(
"#"
)[
0
];
path
=
path
.
replace
(
/
\\
/g
,
'/'
).
split
(
/
\/
/
);
path
[
path
.
length
-
1
]
=
""
;
while
(
path
.
length
)
{
if
(
(
tmp
=
path
.
shift
()
)
===
".."
)
{
res
.
pop
();
}
else
if
(
tmp
!==
"."
)
{
res
.
push
(
tmp
);
}
}
return
protocol
+
res
.
join
(
"/"
);
}
window
.
KITYMINDER_CONFIG
=
{
'KITYMINDER_HOME_URL'
:
getKMBasePath
(),
//定义工具栏
toolbars
:
[
'hand | undo redo | bold italic | fontfamily fontsize forecolor | saveto | markers'
]
//设置主题
//,defaultlayoutstyle : 'default' //设置默认的主题
//,layoutstyle : [] //添加有那些主图
//回退相关选项
//,maxUndoCount:20 //最大可回退的次数,默认20
//语言默认是zh-cn
//,lang:'zh-cn'
//设置km整体的z-index大小
//,zIndex : 1000
};
})()
lang/zh-cn/zh-cn.js
View file @
1c977eb9
...
@@ -8,13 +8,25 @@ KityMinder.LANG[ 'zh-cn' ] = {
...
@@ -8,13 +8,25 @@ KityMinder.LANG[ 'zh-cn' ] = {
'fontfamily'
:
'字体'
,
'fontfamily'
:
'字体'
,
'fontsize'
:
'字号'
,
'fontsize'
:
'字号'
,
'layoutstyle'
:
'主题'
,
'layoutstyle'
:
'主题'
,
'saveto'
:
'导出'
'saveto'
:
'导出'
,
'markers'
:
'标示'
},
},
'popupcolor'
:
{
'popupcolor'
:
{
'clearColor'
:
'清空颜色'
,
'clearColor'
:
'清空颜色'
,
'standardColor'
:
'标准颜色'
,
'standardColor'
:
'标准颜色'
,
'themeColor'
:
'主题颜色'
'themeColor'
:
'主题颜色'
},
},
'hand'
:
'允许拖拽'
'hand'
:
'允许拖拽'
,
'dialogs'
:{
'markers'
:{
'static'
:{
'lang_input_text'
:
'文本内容:'
,
'lang_input_url'
:
'链接地址:'
,
'lang_input_title'
:
'标题:'
,
'lang_input_target'
:
'是否在新窗口打开:'
},
'validLink'
:
'只支持选中一个链接时生效'
,
'httpPrompt'
:
'您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀'
}
}
};
};
\ No newline at end of file
src/core/utils.js
View file @
1c977eb9
...
@@ -185,7 +185,89 @@ var utils = Utils = KityMinder.Utils = {
...
@@ -185,7 +185,89 @@ var utils = Utils = KityMinder.Utils = {
parent
=
parent
.
parent
;
parent
=
parent
.
parent
;
}
}
return
parent
;
return
parent
;
}
},
loadFile
:
function
()
{
var
tmpList
=
[];
function
getItem
(
doc
,
obj
)
{
try
{
for
(
var
i
=
0
,
ci
;
ci
=
tmpList
[
i
++
];)
{
if
(
ci
.
doc
===
doc
&&
ci
.
url
==
(
obj
.
src
||
obj
.
href
))
{
return
ci
;
}
}
}
catch
(
e
)
{
return
null
;
}
}
return
function
(
doc
,
obj
,
fn
)
{
var
item
=
getItem
(
doc
,
obj
);
if
(
item
)
{
if
(
item
.
ready
)
{
fn
&&
fn
();
}
else
{
item
.
funs
.
push
(
fn
)
}
return
;
}
tmpList
.
push
({
doc
:
doc
,
url
:
obj
.
src
||
obj
.
href
,
funs
:[
fn
]
});
if
(
!
doc
.
body
)
{
var
html
=
[];
for
(
var
p
in
obj
)
{
if
(
p
==
'tag'
)
continue
;
html
.
push
(
p
+
'="'
+
obj
[
p
]
+
'"'
)
}
doc
.
write
(
'<'
+
obj
.
tag
+
' '
+
html
.
join
(
' '
)
+
' ></'
+
obj
.
tag
+
'>'
);
return
;
}
if
(
obj
.
id
&&
doc
.
getElementById
(
obj
.
id
))
{
return
;
}
var
element
=
doc
.
createElement
(
obj
.
tag
);
delete
obj
.
tag
;
for
(
var
p
in
obj
)
{
element
.
setAttribute
(
p
,
obj
[
p
]);
}
element
.
onload
=
element
.
onreadystatechange
=
function
()
{
if
(
!
this
.
readyState
||
/loaded|complete/
.
test
(
this
.
readyState
))
{
item
=
getItem
(
doc
,
obj
);
if
(
item
.
funs
.
length
>
0
)
{
item
.
ready
=
1
;
for
(
var
fi
;
fi
=
item
.
funs
.
pop
();)
{
fi
();
}
}
element
.
onload
=
element
.
onreadystatechange
=
null
;
}
};
element
.
onerror
=
function
()
{
throw
Error
(
'The load '
+
(
obj
.
href
||
obj
.
src
)
+
' fails,check the url settings of file umeditor.config.js '
)
};
doc
.
getElementsByTagName
(
"head"
)[
0
].
appendChild
(
element
);
}
}(),
clone
:
function
(
source
,
target
)
{
var
tmp
;
target
=
target
||
{};
for
(
var
i
in
source
)
{
if
(
source
.
hasOwnProperty
(
i
))
{
tmp
=
source
[
i
];
if
(
typeof
tmp
==
'object'
)
{
target
[
i
]
=
utils
.
isArray
(
tmp
)
?
[]
:
{};
utils
.
clone
(
source
[
i
],
target
[
i
])
}
else
{
target
[
i
]
=
tmp
;
}
}
}
return
target
;
},
};
};
...
...
themes/default/_css/dialogsize.css
View file @
1c977eb9
/*图片上传*/
.kmui-dialog-image-body
{
width
:
700px
;
height
:
400px
;
}
/*插入视频*/
.kmui-dialog-video-body
{
width
:
600px
;
height
:
350px
;
}
/*谷歌地图*/
.kmui-dialog-gmap-body
{
width
:
550px
;
height
:
400px
;
}
/*百度地图*/
.kmui-dialog-markers-body
{
.kmui-dialog-map-body
{
width
:
700px
;
width
:
580px
;
height
:
400px
;
height
:
400px
;
}
/*链接*/
.kmui-dialog-link-body
{
width
:
400px
;
height
:
200px
;
}
}
\ 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