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
2984262b
Commit
2984262b
authored
Oct 11, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加提示组件和错误反馈对话框;网盘接口全部加入重试机制
parent
46b4114d
Changes
24
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
731 additions
and
107 deletions
+731
-107
import.js
import.js
+5
-2
index.html
index.html
+79
-10
zh-cn.js
lang/zh-cn/zh-cn.js
+93
-3
promise-1.0.0.js
lib/promise-1.0.0.js
+2
-1
zip.js
lib/zip.js
+0
-1
layout.js
src/core/layout.js
+4
-2
zoom.js
src/module/zoom.js
+17
-15
doc.js
ui/doc.js
+4
-1
local.js
ui/menu/open/local.js
+25
-23
netdisk.js
ui/menu/open/netdisk.js
+15
-8
download.js
ui/menu/save/download.js
+9
-5
netdisk.js
ui/menu/save/netdisk.js
+16
-23
share.js
ui/menu/share/share.js
+7
-7
_notice.less
ui/theme/default/css/_notice.less
+132
-0
_search.less
ui/theme/default/css/_search.less
+1
-1
default.all.css
ui/theme/default/css/default.all.css
+148
-1
default.all.css.map
ui/theme/default/css/default.all.css.map
+1
-1
import.less
ui/theme/default/css/import.less
+1
-0
kmcat_sad.png
ui/theme/default/images/kmcat_sad.png
+0
-0
kmcat_warn.png
ui/theme/default/images/kmcat_warn.png
+0
-0
quickvisit.js
ui/topbar/quickvisit.js
+10
-0
fileloader.js
ui/widget/fileloader.js
+2
-1
netdiskfinder.js
ui/widget/netdiskfinder.js
+5
-2
notice.js
ui/widget/notice.js
+155
-0
No files found.
import.js
View file @
2984262b
...
...
@@ -123,8 +123,6 @@
{
path
:
'ui/memory.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'ui/fuix.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'ui/fiox.js'
,
pack
:
'edit'
},
{
path
:
'ui/doc.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'ui/contextmenu.js'
,
pack
:
'edit'
},
/* UI 组件 */
{
path
:
'ui/widget/commandbutton.js'
,
pack
:
'edit|share'
},
...
...
@@ -135,6 +133,11 @@
{
path
:
'ui/widget/locallist.js'
,
pack
:
'edit'
},
{
path
:
'ui/widget/netdiskfinder.js'
,
pack
:
'edit'
},
{
path
:
'ui/widget/menutab.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'ui/widget/notice.js'
,
pack
:
'edit|share|m-share'
},
/* 基本业务 */
{
path
:
'ui/doc.js'
,
pack
:
'edit|share|m-share'
},
{
path
:
'ui/contextmenu.js'
,
pack
:
'edit|share'
},
/* 视野导航 */
{
path
:
'ui/nav.js'
,
pack
:
'edit|share'
},
...
...
index.html
View file @
2984262b
...
...
@@ -2,9 +2,9 @@
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"title"
content=
"百度脑图(KityMinder)"
>
<meta
name=
"title"
content=
"百度脑图(KityMinder)
- 控制创意,如此简单
"
>
<meta
name=
"keyword"
content=
"kityminder,脑图,思维导图,kity,svg,minder,百度,fex,前端,在线"
>
<meta
name=
"description"
content=
"百度脑图,便捷的脑图编辑工具
。让您在线上直接创建、保存并分享你的思路。
"
>
<meta
name=
"description"
content=
"百度脑图,便捷的脑图编辑工具
- 控制创意,如此简单。让您在线上直接创建、保存并分享你的思路。免安装 云存储 易分享 体验舒适 功能丰富
"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, user-scalable=no"
>
<title>
百度脑图 - 便捷的思维编辑工具
</title>
...
...
@@ -96,6 +96,7 @@
body
{
background
:
#99806B
;
overflow
:
auto
;
}
::-webkit-selection
{
...
...
@@ -162,12 +163,24 @@
h1
{
margin
:
0
;
margin-top
:
2
00px
;
margin-top
:
1
00px
;
color
:
white
;
font-size
:
50px
;
line-height
:
1.4em
;
}
h1
span
{
font-size
:
0.6em
;
}
p
span
{
font-size
:
12px
;
display
:
block
;
margin-top
:
30px
;
color
:
rgba
(
255
,
255
,
255
,
.7
);
text-shadow
:
0
0
1px
rgba
(
0
,
0
,
0
,
.5
);
}
hr
{
height
:
0
;
border
:
none
;
...
...
@@ -266,21 +279,77 @@
}
</style>
<!-- ~~~~~~~~~~~~~~~~~~~ DP Code ~~~~~~~~~~~~~~~~~~~ -->
<script>
alog
(
'speed.set'
,
'ht'
,
+
new
Date
);
</script>
<!-- ~~~~~~~~~~~~~~~~~~~ DP Code ~~~~~~~~~~~~~~~~~~~ -->
</head>
<body>
<div
class=
"background"
></div>
<h1>
百度脑图
<br/>
为你记录各种奇思妙想
</h1>
<h1>
百度脑图
<br/>
<span>
控制创意,如此简单
</span>
</h1>
<hr
/>
<p
class=
"description"
>
无需安装 使用便捷
<br/>
云端存储数据 安全可靠
<br/>
舒适编写体验 功能丰富
<br/>
快捷分享 多端查看
<br
/>
完全免费
<br/>
免安装 云存储 易分享
<br/>
舒适的体验 丰富的功能
<br/>
</p>
<p
class=
"login"
>
<a>
开启
</a>
<a>
马上开启
</a>
<span>
使用百度账号登录
</span>
</p>
<script>
void
function
(
e
,
t
){
for
(
var
n
=
t
.
getElementsByTagName
(
"img"
),
a
=+
new
Date
,
i
=
[],
o
=
function
(){
this
.
removeEventListener
&&
this
.
removeEventListener
(
"load"
,
o
,
!
1
),
i
.
push
({
img
:
this
,
time
:
+
new
Date
})},
s
=
0
;
s
<
n
.
length
;
s
++
)
!
function
(){
var
e
=
n
[
s
];
e
.
addEventListener
?
!
e
.
complete
&&
e
.
addEventListener
(
"load"
,
o
,
!
1
):
e
.
attachEvent
&&
e
.
attachEvent
(
"onreadystatechange"
,
function
(){
"complete"
==
e
.
readyState
&&
o
.
call
(
e
,
o
)})}();
alog
(
"speed.set"
,{
fsItems
:
i
,
fs
:
a
})}(
window
,
document
);
</script>
<script>
/* 配置需要统计的模块,不需要的模块不配置即可(如不需要csp,下面的csp部分删除即可) */
window
.
alogObjectConfig
=
{
product
:
'612'
,
// 必须, DP平台产品线id
page
:
'index_html'
,
// 必须, DP平台页面id
monkey_page
:
''
,
// 如果页面已经有hunter平台的monkey,则为monkey的pageId, 否侧无需该字段
speed_page
:
''
,
// 如果页面已经有webspeed平台的性能监控,则为性能的page_id,否侧无需该字段
// 性能-------------------------------------------------------------------------------------------------------
speed
:
{
sample
:
1
// 抽样率, 0~1,建议使采样的pv控制在100万以内,必须要设定,否则统计不会生效
//custom_metrics: ['c_item1','p_item3'] //自定义的性能指标,自动上报,只有这些指标都统计完毕之后数据才会发送
//special_pages: [{id:34, sample:1}] // 特殊页面,和老的性能配置一致
},
// 访问和点击-------------------------------------------------------------------------------------------------
monkey
:
{
sample
:
1
// 抽样率, 0~1 建议使采样的pv控制在50万以内,必须要设定,否则统计不会生效
//hid: '' // 兼容hunter的monkey,monkey实验的ID
//pageflag: '' // 个别特殊产品线使用hunter的monkey的pageflag
},
// js异常,除window.onerror外,配合FIS插件还可以自动加try/catch监控,见下面的“高级功能”部分-----------------------
exception
:
{
sample
:
1
// 抽样率, 0~1 建议使采样的pv控制在50万以内,必须要设定,否则统计不会生效
},
// 浏览器新特性(H5/CSS3)--------------------------------------------------------------------------------------
feature
:
{
sample
:
1
// 抽样率, 0~1 建议使采样的pv控制在50万以内,必须要设定,否则统计不会生效
},
// 跨站资源监控-----------------------------------------------------------------------------------------------
csp
:
{
sample
:
1
,
// 抽样率, 0~1 建议使采样的pv控制在100万以内,必须要设定,否则统计不会生效
// 默认的跨站策略, 产品线可以根据自己的实际情况进行修改,Warn表示匹配的资源被算作跨域资源
'default-src'
:
[
{
match
:
'*bae.baidu.com'
,
target
:
'Accept,Warn'
},
{
match
:
'*.baidu.com,*.bdstatic.com,*.bdimg.com,localhost,*.hao123.com,*.hao123img.com'
,
target
:
'Accept'
},
{
match
:
/^
(
127|172|192|10
)(\.\d
+
){3}
$/
,
target
:
'Accept'
},
{
match
:
'*'
,
target
:
'Accept,Warn'
}
]
}
};
// pc和mobile端会稍有不同,必须严格按照该文档来部署,该段代码必须放在上面的window.alogObjectConfig配置之后
void
function
(
e
,
t
,
n
,
a
,
r
,
o
){
function
c
(
t
){
e
.
attachEvent
?
e
.
attachEvent
(
"onload"
,
t
,
!
1
):
e
.
addEventListener
&&
e
.
addEventListener
(
"load"
,
t
)}
function
i
(
e
,
n
,
a
){
a
=
a
||
15
;
var
r
=
new
Date
;
r
.
setTime
((
new
Date
).
getTime
()
+
1
e3
*
a
),
t
.
cookie
=
e
+
"="
+
escape
(
n
)
+
";path=/;expires="
+
r
.
toGMTString
()}
function
s
(
e
){
var
n
=
t
.
cookie
.
match
(
new
RegExp
(
"(^| )"
+
e
+
"=([^;]*)(;|$)"
));
return
null
!=
n
?
unescape
(
n
[
2
]):
null
}
function
d
(){
var
e
=
s
(
"PMS_JT"
);
if
(
e
){
i
(
"PMS_JT"
,
""
,
-
1
);
try
{
e
=
eval
(
e
)}
catch
(
n
){
e
=
{}}
e
.
r
&&
t
.
referrer
.
replace
(
/#.*/
,
""
)
!=
e
.
r
||
alog
(
"speed.set"
,
"wt"
,
e
.
s
)}}
c
(
function
(){
alog
(
"speed.set"
,
"lt"
,
+
new
Date
),
r
=
t
.
createElement
(
n
),
r
.
async
=!
0
,
r
.
src
=
a
+
"?v="
+~
(
new
Date
/
864
e5
),
o
=
t
.
getElementsByTagName
(
n
)[
0
],
o
.
parentNode
.
insertBefore
(
r
,
o
)}),
d
()}(
window
,
document
,
"script"
,
"http://img.baidu.com/hunter/alog/dp.min.js"
);
</script>
</body>
<!--Baidu Tongji Code-->
...
...
lang/zh-cn/zh-cn.js
View file @
2984262b
...
...
@@ -40,7 +40,96 @@ KityMinder.LANG['zh-cn'] = {
'resource'
:
'资源'
,
'attachment'
:
'附件'
},
'error_message'
:
{
'title'
:
'哎呀,脑图出错了'
,
'err_load'
:
'加载脑图失败'
,
'err_save'
:
'保存脑图失败'
,
'err_network'
:
'网络错误'
,
'err_doc_resolve'
:
'文档解析失败'
,
'err_unknown'
:
'发生了奇怪的错误'
,
'err_localfile_read'
:
'文件读取错误'
,
'err_download'
:
'文件下载失败'
,
'err_remove_share'
:
'取消分享失败'
,
'err_create_share'
:
'分享失败'
,
'err_mkdir'
:
'目录创建失败'
,
'err_ls'
:
'读取目录失败'
,
'unknownreason'
:
'可能是外星人篡改了代码...'
,
'pcs_code'
:
{
3
:
"不支持此接口"
,
4
:
"没有权限执行此操作"
,
5
:
"IP未授权"
,
110
:
"用户会话已过期,请重新登录"
,
31001
:
"数据库查询错误"
,
31002
:
"数据库连接错误"
,
31003
:
"数据库返回空结果"
,
31021
:
"网络错误"
,
31022
:
"暂时无法连接服务器"
,
31023
:
"输入参数错误"
,
31024
:
"app id为空"
,
31025
:
"后端存储错误"
,
31041
:
"用户的cookie不是合法的百度cookie"
,
31042
:
"用户未登陆"
,
31043
:
"用户未激活"
,
31044
:
"用户未授权"
,
31045
:
"用户不存在"
,
31046
:
"用户已经存在"
,
31061
:
"文件已经存在"
,
31062
:
"文件名非法"
,
31063
:
"文件父目录不存在"
,
31064
:
"无权访问此文件"
,
31065
:
"目录已满"
,
31066
:
"文件不存在"
,
31067
:
"文件处理出错"
,
31068
:
"文件创建失败"
,
31069
:
"文件拷贝失败"
,
31070
:
"文件删除失败"
,
31071
:
"不能读取文件元信息"
,
31072
:
"文件移动失败"
,
31073
:
"文件重命名失败"
,
31079
:
"未找到文件MD5,请使用上传API上传整个文件。"
,
31081
:
"superfile创建失败"
,
31082
:
"superfile 块列表为空"
,
31083
:
"superfile 更新失败"
,
31101
:
"tag系统内部错误"
,
31102
:
"tag参数错误"
,
31103
:
"tag系统错误"
,
31110
:
"未授权设置此目录配额"
,
31111
:
"配额管理只支持两级目录"
,
31112
:
"超出配额"
,
31113
:
"配额不能超出目录祖先的配额"
,
31114
:
"配额不能比子目录配额小"
,
31141
:
"请求缩略图服务失败"
,
31201
:
"签名错误"
,
31202
:
"文件不存在"
,
31203
:
"设置acl失败"
,
31204
:
"请求acl验证失败"
,
31205
:
"获取acl失败"
,
31206
:
"acl不存在"
,
31207
:
"bucket已存在"
,
31208
:
"用户请求错误"
,
31209
:
"服务器错误"
,
31210
:
"服务器不支持"
,
31211
:
"禁止访问"
,
31212
:
"服务不可用"
,
31213
:
"重试出错"
,
31214
:
"上传文件data失败"
,
31215
:
"上传文件meta失败"
,
31216
:
"下载文件data失败"
,
31217
:
"下载文件meta失败"
,
31218
:
"容量超出限额"
,
31219
:
"请求数超出限额"
,
31220
:
"流量超出限额"
,
31298
:
"服务器返回值KEY非法"
,
31299
:
"服务器返回值KEY不存在"
}
},
'ui'
:
{
'error_detail'
:
'详细信息'
,
'copy_and_feedback'
:
'复制并反馈'
,
'command'
:
{
'appendsiblingnode'
:
'插入同级主题'
,
'appendchildnode'
:
'插入下级主题'
,
...
...
@@ -106,8 +195,6 @@ KityMinder.LANG['zh-cn'] = {
'dropfile'
:
'或将文件拖至此处'
,
'unsupportedfile'
:
'不支持的文件格式'
,
'untitleddoc'
:
'未命名文档'
,
'errorloading'
:
'加载失败:{0}'
,
'unknownreason'
:
'可能是外星人篡改了代码...'
,
'overrideconfirm'
:
'{0} 已存在,确认覆盖吗?'
,
'checklogin'
:
'检查登录状态中...'
,
'loggingin'
:
'正在登录...'
,
...
...
@@ -221,7 +308,10 @@ KityMinder.LANG['zh-cn'] = {
'github_issue'
:
'Github'
,
'baidu_tieba'
:
'贴吧'
,
'clipboardunsupported'
:
'您的浏览器不支持剪贴板,请使用快捷键复制'
'clipboardunsupported'
:
'您的浏览器不支持剪贴板,请使用快捷键复制'
,
'save_success'
:
'文档已保存'
,
'autosave_success'
:
'文档已自动保存'
},
'popupcolor'
:
{
'clearColor'
:
'清空颜色'
,
...
...
lib/promise-1.0.0.js
View file @
2984262b
...
...
@@ -269,7 +269,8 @@ define("promise/polyfill",
return
isFunction
(
resolve
);
}());
if
(
!
es6PromiseSupport
||
~
window
.
location
.
href
.
indexOf
(
'rsvpromise'
))
{
// !es6PromiseSupport || ~window.location.href.indexOf('rsvpromise')
if
(
true
)
{
local
.
Promise
=
RSVPPromise
;
}
}
...
...
lib/zip.js
View file @
2984262b
...
...
@@ -723,7 +723,6 @@
entriesCallback
(
dataView
);
}
}
catch
(
e
){
console
.
log
(
e
);
onerror
(
ERR_READ
);
}
...
...
src/core/layout.js
View file @
2984262b
...
...
@@ -296,7 +296,7 @@ kity.extendClass(Minder, {
}
// 节点复杂度大于 100,关闭动画
if
(
complex
>
3
00
)
duration
=
0
;
if
(
complex
>
2
00
)
duration
=
0
;
function
applyMatrix
(
node
,
matrix
)
{
node
.
setGlobalLayoutTransform
(
matrix
);
...
...
@@ -561,7 +561,9 @@ var ResetLayoutCommand = kity.createClass('ResetLayoutCommand', {
});
});
minder
.
layout
(
300
);
}
},
enableReadOnly
:
true
});
KityMinder
.
registerModule
(
'LayoutModule'
,
{
...
...
src/module/zoom.js
View file @
2984262b
...
...
@@ -44,8 +44,9 @@ KityMinder.registerModule('Zoom', function() {
if
(
minder
.
getRoot
().
getComplex
()
>
200
)
{
minder
.
_zoomValue
=
value
;
return
minder
.
zoom
(
value
);
}
minder
.
zoom
(
value
);
minder
.
fire
(
'viewchange'
);
}
else
{
var
animator
=
new
kity
.
Animator
({
beginValue
:
minder
.
_zoomValue
,
finishValue
:
value
,
...
...
@@ -57,10 +58,11 @@ KityMinder.registerModule('Zoom', function() {
if
(
timeline
)
{
timeline
.
pause
();
}
timeline
=
animator
.
start
(
minder
,
300
,
'easeInOutSine'
,
function
()
{}
);
timeline
=
animator
.
start
(
minder
,
300
,
'easeInOutSine'
);
timeline
.
on
(
'finish'
,
function
()
{
minder
.
fire
(
'viewchange'
);
});
}
minder
.
fire
(
'zoom'
,
{
zoom
:
value
});
}
...
...
ui/doc.js
View file @
2984262b
...
...
@@ -12,6 +12,7 @@ KityMinder.registerUI('doc', function(minder) {
var
ret
=
minder
.
getUI
(
'eve'
).
setup
({});
var
current
=
{
saved
:
true
};
var
loading
=
false
;
var
notice
=
minder
.
getUI
(
'widget/notice'
);
/**
* 加载文档
...
...
@@ -53,9 +54,11 @@ KityMinder.registerUI('doc', function(minder) {
})[
'catch'
](
function
(
e
)
{
current
=
restore
;
window
.
alert
(
'加载文档失败:'
+
doc
.
titl
e
);
notice
.
error
(
'err_doc_resolve'
,
e
);
}).
then
(
function
(
doc
)
{
loading
=
false
;
if
(
doc
)
notice
.
info
(
'<b>'
+
doc
.
title
+
'</b> 加载完成'
);
return
doc
;
});
}
...
...
ui/menu/open/local.js
View file @
2984262b
...
...
@@ -12,6 +12,7 @@ KityMinder.registerUI('menu/open/local', function(minder) {
var
$menu
=
minder
.
getUI
(
'menu/menu'
);
var
$open
=
minder
.
getUI
(
'menu/open/open'
);
var
$doc
=
minder
.
getUI
(
'doc'
);
var
notice
=
minder
.
getUI
(
'widget/notice'
);
/* extension => protocol */
var
supports
=
{};
...
...
@@ -88,12 +89,12 @@ KityMinder.registerUI('menu/open/local', function(minder) {
var
protocol
=
supports
[
info
.
extension
];
if
(
!
protocol
||
!
protocol
.
decode
)
{
window
.
alert
(
minder
.
getLang
(
'ui.unsupportedfile'
));
notice
.
warn
(
minder
.
getLang
(
'ui.unsupportedfile'
));
return
Promise
.
reject
();
}
var
dataPromise
=
new
Promise
(
function
(
resolve
,
reject
)
{
function
loadFile
(
file
,
protocol
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
reader
;
if
(
protocol
.
dataType
==
'blob'
)
{
...
...
@@ -109,13 +110,15 @@ KityMinder.registerUI('menu/open/local', function(minder) {
reader
.
onerror
=
reject
;
reader
.
readAsText
(
domfile
,
'utf-8'
);
}
});
}
$
(
minder
.
getRenderTarget
()).
addClass
(
'loading'
);
return
dataPromise
.
then
(
function
(
data
)
{
function
loadFileError
()
{
var
notice
=
minder
.
getUI
(
'widget/notice'
);
notice
.
error
(
'err_localfile_read'
);
}
function
loadDoc
(
data
)
{
var
doc
=
{
content
:
data
.
content
,
protocol
:
protocol
.
name
,
...
...
@@ -124,12 +127,11 @@ KityMinder.registerUI('menu/open/local', function(minder) {
};
return
$doc
.
load
(
doc
);
}
})[
'catch'
](
function
(
error
)
{
window
.
alert
(
minder
.
getLang
(
'ui.errorloading'
,
error
.
message
||
minder
.
getLang
(
'ui.unknownreason'
)));
$
(
minder
.
getRenderTarget
()).
addClass
(
'loading'
);
}
).
then
(
function
()
{
return
loadFile
(
domfile
,
protocol
).
then
(
loadDoc
,
loadFileError
).
then
(
function
()
{
$
(
minder
.
getRenderTarget
()).
removeClass
(
'loading'
);
...
...
ui/menu/open/netdisk.js
View file @
2984262b
...
...
@@ -15,6 +15,7 @@ KityMinder.registerUI('menu/open/netdisk', function(minder) {
var
$eve
=
minder
.
getUI
(
'eve'
);
var
$doc
=
minder
.
getUI
(
'doc'
);
var
ret
=
$eve
.
setup
({});
var
notice
=
minder
.
getUI
(
'widget/notice'
);
/* 网盘面板 */
var
$panel
=
$
(
$open
.
createSub
(
'netdisk'
));
...
...
@@ -43,17 +44,22 @@ KityMinder.registerUI('menu/open/netdisk', function(minder) {
function
open
(
path
)
{
$menu
.
hide
();
$
(
minder
.
getRenderTarget
()).
addClass
(
'loading'
);
var
info
=
fio
.
file
.
anlysisPath
(
path
);
var
protocol
=
supports
[
info
.
extension
];
function
read
()
{
return
fio
.
file
.
read
({
path
:
path
,
dataType
:
protocol
.
dataType
}).
then
(
function
(
file
)
{
});
}
function
load
(
file
)
{
var
doc
=
{
protocol
:
supports
[
file
.
extension
].
name
,
...
...
@@ -65,12 +71,13 @@ KityMinder.registerUI('menu/open/netdisk', function(minder) {
};
return
$doc
.
load
(
doc
);
}
})[
'catch'
](
function
(
error
)
{
window
.
alert
(
minder
.
getLang
(
'ui.errorloading'
,
error
.
message
||
minder
.
getLang
(
'unknownreason'
)));
function
error
(
e
)
{
return
notice
.
error
(
'err_load'
,
e
);
}
}
).
then
(
function
()
{
return
read
().
then
(
load
,
error
).
then
(
function
()
{
$
(
minder
.
getRenderTarget
()).
removeClass
(
'loading'
);
...
...
ui/menu/save/download.js
View file @
2984262b
...
...
@@ -63,7 +63,8 @@ KityMinder.registerUI('menu/save/download', function(minder) {
return
null
;
})[
'catch'
](
function
exportError
(
e
)
{
window
.
alert
(
'下载失败:'
+
e
.
message
);
var
notice
=
minder
.
getUI
(
'widget/notice'
);
return
notice
.
error
(
'err_download'
,
e
);
})
.
then
(
function
done
(
tick
)
{
...
...
@@ -124,11 +125,14 @@ KityMinder.registerUI('menu/save/download', function(minder) {
$
(
'<input name="stamp" />'
).
val
(
stamp
).
appendTo
(
$form
);
var
netdisk
=
minder
.
getUI
(
'menu/save/netdisk'
);
if
(
netdisk
)
{
netdisk
.
mute
=
true
;
$form
.
appendTo
(
'body'
).
submit
().
remove
();
setTimeout
(
function
()
{
netdisk
.
mute
=
false
;
});
}
$form
.
appendTo
(
'body'
).
submit
().
remove
();
return
ret
;
}
...
...
ui/menu/save/netdisk.js
View file @
2984262b
...
...
@@ -13,6 +13,7 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
var
$eve
=
minder
.
getUI
(
'eve'
);
var
$doc
=
minder
.
getUI
(
'doc'
);
var
ret
=
$eve
.
setup
({});
var
notice
=
minder
.
getUI
(
'widget/notice'
);
/* extension => protocol */
var
supports
=
{};
...
...
@@ -162,7 +163,7 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
var
saving
=
0
;
function
doSave
(
path
,
protocol
,
doc
,
$mask
,
leaveTheMenu
)
{
function
doSave
(
path
,
protocol
,
doc
,
$mask
,
leaveTheMenu
,
msg
)
{
if
(
saving
)
return
;
...
...
@@ -170,10 +171,7 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
if
(
$mask
)
$mask
.
addClass
(
'loading'
);
function
tryUpload
(
data
)
{
if
(
tryUpload
.
tried
++
>
3
)
{
throw
new
Error
(
'超过最大重试次数,网盘服务可能当前不可用'
);
}
function
upload
(
data
)
{
return
fio
.
file
.
write
({
path
:
path
,
content
:
data
,
...
...
@@ -181,22 +179,9 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
});
}
tryUpload
.
tried
=
0
;
var
dataExported
=
minder
.
exportData
(
protocol
);
function
finish
(
file
)
{
return
dataExported
.
then
(
tryUpload
)[
'catch'
](
function
(
e
)
{
if
(
e
.
message
==
'Netdisk Request Error'
)
{
if
(
console
&&
console
.
warn
)
console
.
warn
(
e
);
// 网盘抽风失败,重试即可
return
new
Promise
(
function
(
resolve
,
reject
)
{
setTimeout
(
function
()
{
resolve
(
dataExported
.
then
(
tryUpload
));
},
200
);
});
}
window
.
alert
(
'保存文件失败:'
+
(
e
.
message
||
minder
.
getLang
(
'ui.unknownreason'
)));
}).
then
(
function
()
{
if
(
!
file
.
modifyTime
)
throw
new
Error
(
'File Save Error'
);
saving
=
false
;
...
...
@@ -206,18 +191,26 @@ KityMinder.registerUI('menu/save/netdisk', function(minder) {
$menu
.
hide
();
}
doc
.
path
=
path
;
doc
.
title
=
$filename
.
val
()
;
doc
.
path
=
file
.
path
;
doc
.
title
=
file
.
filename
;
doc
.
source
=
'netdisk'
;
doc
.
protocol
=
protocol
;
$doc
.
save
(
doc
);
notice
.
info
(
msg
||
minder
.
getLang
(
'ui.save_success'
));
setTimeout
(
function
()
{
$finder
.
list
(
$finder
.
pwd
(),
true
);
},
1499
);
});
}
function
error
(
e
)
{
notice
.
error
(
'err_save'
,
e
);
}
return
minder
.
exportData
(
protocol
).
then
(
upload
).
then
(
finish
,
error
);
}
function
setFileName
()
{
...
...
ui/menu/share/share.js
View file @
2984262b
...
...
@@ -172,9 +172,8 @@ KityMinder.registerUI('menu/share/share', function(minder) {
dataType
:
'json'
})[
'catch'
](
function
(
e
)
{
window
.
alert
(
minder
.
getLang
(
'remove_share_failed'
,
e
.
message
));
var
notice
=
minder
.
getUI
(
'widget/notice'
);
notice
.
error
(
'err_remove_share'
,
e
);
});
});
}
...
...
@@ -249,7 +248,8 @@ KityMinder.registerUI('menu/share/share', function(minder) {
})[
'catch'
](
function
(
e
)
{
window
.
alert
(
minder
.
getLang
(
'create_share_failed'
,
e
.
message
));
var
notice
=
minder
.
getUI
(
'widget/notice'
);
notice
.
error
(
'err_create_share'
,
e
);
});
})
...
...
@@ -298,8 +298,8 @@ KityMinder.registerUI('menu/share/share', function(minder) {
correctLevel
:
window
.
QRCode
.
CorrectLevel
.
M
});
var
shareConfig
=
window
.
_bd_share_config
.
common
,
resetShare
=
window
.
_bd_share_main
.
init
;
var
shareConfig
=
window
.
_bd_share_config
&&
window
.
_bd_share_config
.
common
,
resetShare
=
window
.
_bd_share_main
&&
window
.
_bd_share_main
.
init
;
if
(
shareConfig
&&
resetShare
)
{
shareConfig
.
bdTitle
=
shareConfig
.
bdText
=
minder
.
getMinderTitle
();
...
...
ui/theme/default/css/_notice.less
0 → 100644
View file @
2984262b
.notice-widget {
position: absolute;
right: 20px;
top: 20px;
padding: 5px 15px;
border-radius: 4px;
background: lighten(@tab-hover, 20%);
transition: all ease .2s;
opacity: 0;
color: white;
.transform(translate3d(0, -50px, 0));
p {
margin: 5px 0;
font-size: 12px;
}
&.show {
.transform(translate3d(0, 0, 0));
opacity: 1;
}
&.warn {
background: white url(../images/kmcat_warn.png) 8px 10px no-repeat;
color: rgb(255, 146, 0);
box-shadow: none;
padding-left: 35px;
border: 1px solid #FFB200;
}
}
#content-wrapper .error-dialog {
border-radius: 4px;
.fui-dialog-head {
background: #DC0000;
height: 40px;
line-height: 40px;
padding: 0 15px;
.fui-close-button {
top: 10px;
}
}
.fui-dialog-body {
.error-content {
background: url(../images/kmcat_sad.png) no-repeat;
padding-left: 80px;
h3 {
font-size: 16px;
font-weight: normal;
margin: 0;
}
p {
margin: 10px 0;
height: auto;
}
min-height: 80px;
}
.error-detail {
textarea {
box-sizing: border-box;
width: 100%;
height: 200px;
border: 1px solid #EEE;
background: #fcfcfc;
outline: none;
padding: 6px;
color: #666;
display: none;
}
position: relative;
a.expander {
display: block;
&:before {
.triangle-left(#333, 5px, 10px);
display: inline-block;
margin-right: 3px;
}
margin: 8px 0;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
.copy-and-feedback {
display: none;
float: right;
margin-top: 10px;
}
&.expanded {
textarea, .copy-and-feedback {
display: block;
}
a.expander:before {
.triangle-top(#333, 10px, 5px);
margin-right: 3px;
top: 3px;
position: relative;
display: inline-block;
}
}
&:before {
display: block;
content: '反馈详细信息有助于开发人员定位问题';
position: absolute;
top: 8px;
right: 0;
font-size: 12px;
color: #AAA;
}
}
}
.fui-dialog-foot {
position: static;
padding: 5px 20px;
.fui-button.fui-xdialog-ok-btn {
background: #dc0000;
margin: 10px 0;
&:hover {
background: #FF7F7F;
}
}
.fui-button.fui-xdialog-cancel-btn {
display: none;
}
}
}
\ No newline at end of file
ui/theme/default/css/_search.less
View file @
2984262b
...
...
@@ -17,7 +17,7 @@
background: @tab-hover;
border: none;
height: 20px;
line-height:
20px
;
line-height:
1em
;
border-radius: 15px;
outline: none;
color: @ui-fore;
...
...
ui/theme/default/css/default.all.css
View file @
2984262b
...
...
@@ -1297,6 +1297,153 @@ input[type=search]::-ms-clear {
.fui-popup-menu
.fui-spliter
:last-child
{
display
:
none
;
}
.notice-widget
{
position
:
absolute
;
right
:
20px
;
top
:
20px
;
padding
:
5px
15px
;
border-radius
:
4px
;
background
:
#8e96aa
;
transition
:
all
ease
.2s
;
opacity
:
0
;
color
:
white
;
-webkit-transform
:
translate3d
(
0
,
-50px
,
0
);
-moz-transform
:
translate3d
(
0
,
-50px
,
0
);
-ms-transform
:
translate3d
(
0
,
-50px
,
0
);
-o-transform
:
translate3d
(
0
,
-50px
,
0
);
tranform
:
translate3d
(
0
,
-50px
,
0
);
}
.notice-widget
p
{
margin
:
5px
0
;
font-size
:
12px
;
}
.notice-widget.show
{
-webkit-transform
:
translate3d
(
0
,
0
,
0
);
-moz-transform
:
translate3d
(
0
,
0
,
0
);
-ms-transform
:
translate3d
(
0
,
0
,
0
);
-o-transform
:
translate3d
(
0
,
0
,
0
);
tranform
:
translate3d
(
0
,
0
,
0
);
opacity
:
1
;
}
.notice-widget.warn
{
background
:
#ffffff
url(../images/kmcat_warn.png)
8px
10px
no-repeat
;
color
:
#ff9200
;
box-shadow
:
none
;
padding-left
:
35px
;
border
:
1px
solid
#FFB200
;
}
#content-wrapper
.error-dialog
{
border-radius
:
4px
;
}
#content-wrapper
.error-dialog
.fui-dialog-head
{
background
:
#DC0000
;
height
:
40px
;
line-height
:
40px
;
padding
:
0
15px
;
}
#content-wrapper
.error-dialog
.fui-dialog-head
.fui-close-button
{
top
:
10px
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-content
{
background
:
url(../images/kmcat_sad.png)
no-repeat
;
padding-left
:
80px
;
min-height
:
80px
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-content
h3
{
font-size
:
16px
;
font-weight
:
normal
;
margin
:
0
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-content
p
{
margin
:
10px
0
;
height
:
auto
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail
{
position
:
relative
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail
textarea
{
box-sizing
:
border-box
;
width
:
100%
;
height
:
200px
;
border
:
1px
solid
#EEE
;
background
:
#fcfcfc
;
outline
:
none
;
padding
:
6px
;
color
:
#666
;
display
:
none
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail
a
.expander
{
display
:
block
;
margin
:
8px
0
;
cursor
:
pointer
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail
a
.expander
:before
{
content
:
' '
;
display
:
block
;
width
:
0
;
height
:
0
;
padding
:
0
!important
;
line-height
:
0
;
font-size
:
0
;
border-style
:
solid
;
border-color
:
transparent
;
border-width
:
5px
5px
;
border-left-color
:
#333333
;
display
:
inline-block
;
margin-right
:
3px
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail
a
.expander
:hover
{
text-decoration
:
underline
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail
.copy-and-feedback
{
display
:
none
;
float
:
right
;
margin-top
:
10px
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail.expanded
textarea
,
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail.expanded
.copy-and-feedback
{
display
:
block
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail.expanded
a
.expander
:before
{
content
:
' '
;
display
:
block
;
width
:
0
;
height
:
0
;
padding
:
0
!important
;
line-height
:
0
;
font-size
:
0
;
border-style
:
solid
;
border-color
:
transparent
;
border-width
:
5px
5px
;
border-top-color
:
#333333
;
margin-right
:
3px
;
top
:
3px
;
position
:
relative
;
display
:
inline-block
;
}
#content-wrapper
.error-dialog
.fui-dialog-body
.error-detail
:before
{
display
:
block
;
content
:
'反馈详细信息有助于开发人员定位问题'
;
position
:
absolute
;
top
:
8px
;
right
:
0
;
font-size
:
12px
;
color
:
#AAA
;
}
#content-wrapper
.error-dialog
.fui-dialog-foot
{
position
:
static
;
padding
:
5px
20px
;
}
#content-wrapper
.error-dialog
.fui-dialog-foot
.fui-button.fui-xdialog-ok-btn
{
background
:
#dc0000
;
margin
:
10px
0
;
}
#content-wrapper
.error-dialog
.fui-dialog-foot
.fui-button.fui-xdialog-ok-btn
:hover
{
background
:
#FF7F7F
;
}
#content-wrapper
.error-dialog
.fui-dialog-foot
.fui-button.fui-xdialog-cancel-btn
{
display
:
none
;
}
/**
* 基本页面样式
*/
...
...
@@ -2003,7 +2150,7 @@ body {
background
:
#5a6378
;
border
:
none
;
height
:
20px
;
line-height
:
20px
;
line-height
:
1em
;
border-radius
:
15px
;
outline
:
none
;
color
:
#ffffff
;
...
...
ui/theme/default/css/default.all.css.map
View file @
2984262b
This diff is collapsed.
Click to expand it.
ui/theme/default/css/import.less
View file @
2984262b
...
...
@@ -4,6 +4,7 @@
@import "_public";
@import "_triangle";
@import "_widgets";
@import "_notice";
@import "_kityminder";
@import "_mainmenu";
...
...
ui/theme/default/images/kmcat_sad.png
0 → 100644
View file @
2984262b
1.38 KB
ui/theme/default/images/kmcat_warn.png
0 → 100644
View file @
2984262b
541 Bytes
ui/topbar/quickvisit.js
View file @
2984262b
...
...
@@ -21,6 +21,8 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
$share
=
btn
(
'share'
),
$feedback
=
btn
(
'feedback'
);
var
ret
=
{};
minder
.
on
(
'uiready'
,
function
quickVisit
()
{
$
(
'#panel #search'
).
after
(
$feedback
);
...
...
@@ -71,5 +73,13 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
});
minder
.
addShortcut
(
'f1'
,
quickFeedback
);
ret
.
ready
=
true
;
ret
.
quickNew
=
quickNew
;
ret
.
quickSave
=
quickSave
;
ret
.
quickShare
=
quickShare
;
ret
.
quickFeedback
=
quickFeedback
;
});
return
ret
;
});
\ No newline at end of file
ui/widget/fileloader.js
View file @
2984262b
...
...
@@ -45,7 +45,8 @@ KityMinder.registerUI('widget/fileloader', function(minder) {
}
function
error
(
err
)
{
window
.
alert
(
'加载文件失败:'
+
err
.
message
);
var
notice
=
minder
.
getUI
(
'widget/notice'
);
notice
.
error
(
'err_localfile_read'
,
err
);
$container
.
removeClass
(
'loading'
);
}
...
...
ui/widget/netdiskfinder.js
View file @
2984262b
...
...
@@ -120,7 +120,8 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
if
(
e
.
detail
&&
e
.
detail
.
error_code
==
31061
)
{
e
.
message
=
'已存在同名目录'
;
}
window
.
alert
(
'创建目录失败:'
+
e
.
message
);
var
notice
=
minder
.
getUI
(
'widget/notice'
);
notice
.
error
(
'err_mkdir'
,
e
);
$li
.
remove
();
}).
then
(
function
()
{
$container
.
removeClass
(
'loading'
);
...
...
@@ -188,7 +189,9 @@ KityMinder.registerUI('widget/netdiskfinder', function(minder) {
updateNav
();
return
Promise
.
all
([
listPromise
,
transitPromise
]).
then
(
renderList
,
function
(
error
)
{
window
.
alert
(
'加载目录发生错误:'
+
error
);
var
notice
=
minder
.
getUI
(
'widget/notice'
);
notice
.
error
(
'err_ls'
,
error
);
});
}
...
...
ui/widget/notice.js
0 → 100644
View file @
2984262b
/**
* @fileOverview
*
* 通知小组件
*
* @author: techird
* @copyright: Baidu FEX, 2014
*/
KityMinder
.
registerUI
(
'widget/notice'
,
function
(
minder
)
{
var
errorMessage
=
minder
.
getLang
(
'error_message'
);
var
memory
=
minder
.
getUI
(
'memory'
);
var
$notice
=
$
(
'<div>'
)
.
addClass
(
'notice-widget'
)
.
appendTo
(
'#kityminder'
);
var
$mask
=
$
(
'<div>'
)
.
addClass
(
'error-mask'
);
var
$error
=
new
FUI
.
Dialog
({
width
:
500
,
height
:
'auto'
,
prompt
:
true
,
caption
:
errorMessage
.
title
,
className
:
'error-dialog'
}).
appendTo
(
document
.
getElementById
(
'content-wrapper'
));
var
$error_body
=
$
(
$error
.
getBodyElement
());
$error_body
.
delegate
(
'.error-detail a.expander'
,
'click'
,
function
(
e
)
{
var
$detail
=
$
(
e
.
target
).
closest
(
'.error-detail'
).
toggleClass
(
'expanded'
);
memory
.
set
(
'show-error-detail'
,
$detail
.
hasClass
(
'expanded'
));
});
function
info
(
msg
,
warn
)
{
if
(
!
$notice
.
hasClass
(
'show'
))
$notice
.
empty
();
if
(
warn
)
$notice
.
addClass
(
'warn'
);
else
$notice
.
removeClass
(
'warn'
);
$notice
.
append
(
'<p>'
+
msg
+
'</p>'
);
$notice
.
addClass
(
'show'
);
clearTimeout
(
info
.
ttl
);
info
.
ttl
=
setTimeout
(
function
()
{
$notice
.
removeClass
(
'show'
);
},
warn
?
5000
:
3000
);
}
function
warn
(
msg
)
{
info
(
msg
,
warn
);
}
function
descriptReason
(
e
)
{
e
=
e
||
{};
if
(
typeof
(
e
)
==
'string'
)
{
e
=
new
Error
(
e
);
}
// 文件访问错误
if
(
e
instanceof
fio
.
FileRequestError
)
{
if
(
!
e
.
status
)
{
e
.
description
=
errorMessage
.
err_network
;
}
else
{
e
.
description
=
errorMessage
.
pcs_code
[
e
.
detail
.
error_code
];
}
e
.
getDetail
=
function
()
{
return
JSON
.
stringify
(
e
,
null
,
4
);
};
}
else
if
(
e
instanceof
Error
)
{
e
.
getDetail
=
function
()
{
return
e
.
stack
;
};
}
return
e
;
}
function
error
(
name
,
e
)
{
if
(
arguments
.
length
==
1
)
{
e
=
name
;
name
=
'unknown'
;
}
$error_body
.
empty
();
e
=
descriptReason
(
e
);
var
$content
=
$
(
'<div>'
)
.
addClass
(
'error-content'
)
.
appendTo
(
$error_body
);
var
$msg
=
$
(
'<h3>'
)
.
text
(
errorMessage
[
name
]
||
errorMessage
.
err_unknown
)
.
appendTo
(
$content
);
var
$reason
=
$
(
'<p>'
)
.
text
(
e
.
message
||
e
.
description
||
errorMessage
.
unknownreason
)
.
appendTo
(
$content
);
if
(
e
.
getDetail
)
{
var
$detail
=
$
(
'<div>'
)
.
addClass
(
'error-detail'
)
.
append
(
$
(
'<a class="expander"></a>'
).
text
(
minder
.
getLang
(
'ui.error_detail'
)))
.
appendTo
(
$error_body
);
var
$textarea
=
$
(
'<textarea>'
)
.
attr
(
'id'
,
'error-detail-content'
)
.
text
(
e
.
getDetail
())
.
appendTo
(
$detail
);
var
$copy
=
$
(
'<button>'
)
.
addClass
(
'copy-and-feedback'
)
.
text
(
minder
.
getLang
(
'ui.copy_and_feedback'
))
.
appendTo
(
$detail
);
$copy
.
attr
(
'data-clipboard-target'
,
'error-detail-content'
);
zeroCopy
(
$copy
);
if
(
memory
.
get
(
'show-error-detail'
))
$detail
.
addClass
(
'expanded'
);
}
$error
.
show
();
$error
.
getElement
().
style
.
top
=
'180px'
;
}
function
zeroCopy
(
$target
)
{
/* global ZeroClipboard:true */
if
(
window
.
ZeroClipboard
)
{
ZeroClipboard
.
config
({
swfPath
:
'lib/ZeroClipboard.swf'
,
hoverClass
:
'hover'
,
activeClass
:
'active'
});
var
clip
=
new
window
.
ZeroClipboard
(
$target
);
clip
.
on
(
'ready'
,
function
()
{
clip
.
on
(
'aftercopy'
,
function
()
{
$error
.
hide
();
minder
.
getUI
(
'topbar/quickvisit'
).
quickFeedback
();
});
});
}
else
{
$target
.
remove
();
}
}
return
{
info
:
info
,
error
:
error
,
warn
:
warn
};
});
\ 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