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
6b099d49
Commit
6b099d49
authored
Oct 14, 2014
by
techird
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'share-edit' into dev
parents
cfa6c9a3
bb63d0b3
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
270 additions
and
84 deletions
+270
-84
.jshintrc
.jshintrc
+1
-0
import.js
import.js
+2
-1
zh-cn.js
lang/zh-cn/zh-cn.js
+7
-2
default.js
ui/menu/default.js
+46
-32
netdisk.js
ui/menu/open/netdisk.js
+3
-3
download.js
ui/menu/save/download.js
+1
-1
share.js
ui/menu/share/share.js
+96
-7
view.js
ui/menu/share/view.js
+21
-8
_quickvisit.less
ui/theme/default/css/_quickvisit.less
+10
-0
_user.less
ui/theme/default/css/_user.less
+12
-6
default.all.css
ui/theme/default/css/default.all.css
+13
-0
default.all.css.map
ui/theme/default/css/default.all.css.map
+1
-1
icons.png
ui/theme/default/images/icons.png
+0
-0
feedback.js
ui/topbar/feedback.js
+23
-0
quickvisit.js
ui/topbar/quickvisit.js
+19
-16
user.js
ui/topbar/user.js
+2
-2
ui.js
ui/ui.js
+4
-4
notice.js
ui/widget/notice.js
+9
-1
No files found.
.jshintrc
View file @
6b099d49
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
"white": false,
"white": false,
"quotmark": false,
"quotmark": false,
"browser": true,
"browser": true,
"boss": true,
"predef" : [
"predef" : [
"module",
"module",
"require",
"require",
...
...
import.js
View file @
6b099d49
...
@@ -172,9 +172,10 @@
...
@@ -172,9 +172,10 @@
{
path
:
'ui/menu/help/feedback.js'
,
pack
:
'edit|share'
},
{
path
:
'ui/menu/help/feedback.js'
,
pack
:
'edit|share'
},
/* UI Top Bar */
/* UI Top Bar */
{
path
:
'ui/topbar/quickvisit.js'
,
pack
:
'edit'
},
{
path
:
'ui/topbar/quickvisit.js'
,
pack
:
'edit
|share
'
},
{
path
:
'ui/topbar/history.js'
,
pack
:
'edit'
},
{
path
:
'ui/topbar/history.js'
,
pack
:
'edit'
},
{
path
:
'ui/topbar/user.js'
,
pack
:
'edit'
},
{
path
:
'ui/topbar/user.js'
,
pack
:
'edit'
},
{
path
:
'ui/topbar/feedback.js'
,
pack
:
'edit|share'
},
{
path
:
'ui/topbar/search.js'
,
pack
:
'edit|share'
},
{
path
:
'ui/topbar/search.js'
,
pack
:
'edit|share'
},
{
path
:
'ui/topbar/switch-view.js'
,
pack
:
'm-share'
},
{
path
:
'ui/topbar/switch-view.js'
,
pack
:
'm-share'
},
{
path
:
'ui/topbar/m-logo.js'
,
pack
:
'm-share'
},
{
path
:
'ui/topbar/m-logo.js'
,
pack
:
'm-share'
},
...
...
lang/zh-cn/zh-cn.js
View file @
6b099d49
...
@@ -54,6 +54,8 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -54,6 +54,8 @@ KityMinder.LANG['zh-cn'] = {
'err_create_share'
:
'分享失败'
,
'err_create_share'
:
'分享失败'
,
'err_mkdir'
:
'目录创建失败'
,
'err_mkdir'
:
'目录创建失败'
,
'err_ls'
:
'读取目录失败'
,
'err_ls'
:
'读取目录失败'
,
'err_share_data'
:
'加载分享内容出错'
,
'err_share_sync_fail'
:
'分享内容同步失败'
,
'unknownreason'
:
'可能是外星人篡改了代码...'
,
'unknownreason'
:
'可能是外星人篡改了代码...'
,
'pcs_code'
:
{
'pcs_code'
:
{
...
@@ -126,6 +128,8 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -126,6 +128,8 @@ KityMinder.LANG['zh-cn'] = {
}
}
},
},
'ui'
:
{
'ui'
:
{
'load_share_for_edit'
:
'正在加载分享的文件...'
,
'share_sync_success'
:
'分享内容已同步'
,
'error_detail'
:
'详细信息'
,
'error_detail'
:
'详细信息'
,
'copy_and_feedback'
:
'复制并反馈'
,
'copy_and_feedback'
:
'复制并反馈'
,
...
@@ -157,7 +161,8 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -157,7 +161,8 @@ KityMinder.LANG['zh-cn'] = {
'new'
:
'新建 (Ctrl + Alt + N)'
,
'new'
:
'新建 (Ctrl + Alt + N)'
,
'save'
:
'保存 (Ctrl + S)'
,
'save'
:
'保存 (Ctrl + S)'
,
'share'
:
'分享 (Ctrl + Alt + S)'
,
'share'
:
'分享 (Ctrl + Alt + S)'
,
'feedback'
:
'反馈问题(F1)'
'feedback'
:
'反馈问题(F1)'
,
'editshare'
:
'编辑'
},
},
'menu'
:
{
'menu'
:
{
...
@@ -212,7 +217,7 @@ KityMinder.LANG['zh-cn'] = {
...
@@ -212,7 +217,7 @@ KityMinder.LANG['zh-cn'] = {
'email_share'
:
'邮件邀请'
,
'email_share'
:
'邮件邀请'
,
'url_share'
:
'脑图 URL 地址:'
,
'url_share'
:
'脑图 URL 地址:'
,
'sns_share'
:
'社交网络分享:'
,
'sns_share'
:
'社交网络分享:'
,
'sns_share_text'
:
'“{0}” - 我用
「百度脑图」
制作的思维导图,快看看吧!(地址:{1})'
,
'sns_share_text'
:
'“{0}” - 我用
百度脑图
制作的思维导图,快看看吧!(地址:{1})'
,
'none_share_description'
:
'不分享当前脑图'
,
'none_share_description'
:
'不分享当前脑图'
,
'public_share_description'
:
'创建任何人可见的分享'
,
'public_share_description'
:
'创建任何人可见的分享'
,
'share_button_text'
:
'创建'
,
'share_button_text'
:
'创建'
,
...
...
ui/menu/default.js
View file @
6b099d49
...
@@ -17,45 +17,59 @@ KityMinder.registerUI('menu/default', function(minder) {
...
@@ -17,45 +17,59 @@ KityMinder.registerUI('menu/default', function(minder) {
var
$share
=
minder
.
getUI
(
'menu/share/share'
);
var
$share
=
minder
.
getUI
(
'menu/share/share'
);
var
$draft
=
minder
.
getUI
(
'menu/open/draft'
);
var
$draft
=
minder
.
getUI
(
'menu/open/draft'
);
// 主菜单默认选中「打开」
setMenuDefaults
();
$menu
.
$tabs
.
select
(
1
);
loadLandingFile
();
// $menu.show();
// 打开菜单默认选中「本地文件」
// $menu.$tabs.select(5);
$open
.
$tabs
.
select
(
2
);
function
setMenuDefaults
()
{
if
(
$draft
.
hasDraft
())
{
// 草稿箱有草稿,默认选中「草稿箱」,并打开最近编辑的文件
// 主菜单默认选中「打开」
$open
.
$tabs
.
select
(
3
);
$menu
.
$tabs
.
select
(
1
);
$draft
.
openLast
();
}
else
{
// 打开菜单默认选中「本地文件」
// 没有草稿,但用户登陆了
$open
.
$tabs
.
select
(
2
);
// 保存菜单默认选中「导出到本地」
$save
.
$tabs
.
select
(
1
);
// 如果用户登陆了,选中「百度云存储」
fio
.
user
.
check
().
then
(
function
(
user
)
{
fio
.
user
.
check
().
then
(
function
(
user
)
{
if
(
user
)
{
if
(
user
)
{
// 有最近文件选中「最近文件」
$save
.
$tabs
.
select
(
0
);
if
(
$recent
.
hasRecent
())
{
$open
.
$tabs
.
select
(
0
);
$recent
.
loadLast
();
}
// 否则选中网盘目录
else
{
$open
.
$tabs
.
select
(
1
);
}
}
}
});
});
$share
.
$menu
.
$tabs
.
select
(
0
);
// 当前脑图
}
}
// 保存菜单默认选中「导出到本地」
function
loadLandingFile
()
{
$save
.
$tabs
.
select
(
1
);
var
pattern
=
/
(?:
shareId|share_id
)
=
(\w
+
)([
&#
]
|$
)
/
;
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
// 如果用户登陆了,选中「百度云存储」
if
(
match
)
{
fio
.
user
.
check
().
then
(
function
(
user
)
{
$share
.
loadShareFile
();
if
(
user
)
{
$save
.
$tabs
.
select
(
0
);
}
}
});
else
if
(
$draft
.
hasDraft
())
{
// 草稿箱有草稿,默认选中「草稿箱」,并打开最近编辑的文件
$share
.
$tabs
.
select
(
0
);
// 当前脑图
$open
.
$tabs
.
select
(
3
);
// $menu.show();
$draft
.
openLast
();
// $menu.$tabs.select(5);
}
else
{
// 没有草稿,但用户登陆了
fio
.
user
.
check
().
then
(
function
(
user
)
{
if
(
user
)
{
// 有最近文件选中「最近文件」
if
(
$recent
.
hasRecent
())
{
$open
.
$tabs
.
select
(
0
);
$recent
.
loadLast
();
}
// 否则选中网盘目录
else
{
$open
.
$tabs
.
select
(
1
);
}
}
});
}
}
});
});
});
});
\ No newline at end of file
ui/menu/open/netdisk.js
View file @
6b099d49
...
@@ -41,7 +41,7 @@ KityMinder.registerUI('menu/open/netdisk', function(minder) {
...
@@ -41,7 +41,7 @@ KityMinder.registerUI('menu/open/netdisk', function(minder) {
return
open
(
file
.
path
);
return
open
(
file
.
path
);
});
});
function
open
(
path
)
{
function
open
(
path
,
errorHandler
)
{
$menu
.
hide
();
$menu
.
hide
();
...
@@ -74,10 +74,10 @@ KityMinder.registerUI('menu/open/netdisk', function(minder) {
...
@@ -74,10 +74,10 @@ KityMinder.registerUI('menu/open/netdisk', function(minder) {
}
}
function
error
(
e
)
{
function
error
(
e
)
{
return
notice
.
error
(
'err_load'
,
e
);
return
errorHandler
&&
errorHandler
(
e
)
||
notice
.
error
(
'err_load'
,
e
);
}
}
return
read
().
then
(
load
,
error
).
then
(
function
()
{
return
read
().
then
(
load
)[
'catch'
](
error
).
then
(
function
()
{
$
(
minder
.
getRenderTarget
()).
removeClass
(
'loading'
);
$
(
minder
.
getRenderTarget
()).
removeClass
(
'loading'
);
...
...
ui/menu/save/download.js
View file @
6b099d49
...
@@ -129,7 +129,7 @@ KityMinder.registerUI('menu/save/download', function(minder) {
...
@@ -129,7 +129,7 @@ KityMinder.registerUI('menu/save/download', function(minder) {
netdisk
.
mute
=
true
;
netdisk
.
mute
=
true
;
setTimeout
(
function
()
{
setTimeout
(
function
()
{
netdisk
.
mute
=
false
;
netdisk
.
mute
=
false
;
});
}
,
1000
);
}
}
$form
.
appendTo
(
'body'
).
submit
().
remove
();
$form
.
appendTo
(
'body'
).
submit
().
remove
();
...
...
ui/menu/share/share.js
View file @
6b099d49
...
@@ -12,6 +12,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
...
@@ -12,6 +12,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
var
$create_menu
=
$
(
$share_menu
.
createSub
(
'createshare'
));
var
$create_menu
=
$
(
$share_menu
.
createSub
(
'createshare'
));
var
$manage_menu
=
$
(
$share_menu
.
createSub
(
'manageshare'
));
var
$manage_menu
=
$
(
$share_menu
.
createSub
(
'manageshare'
));
var
$doc
=
minder
.
getUI
(
'doc'
);
var
$doc
=
minder
.
getUI
(
'doc'
);
var
notice
=
minder
.
getUI
(
'widget/notice'
);
var
BACKEND_URL
=
'http://naotu.baidu.com/share.php'
;
var
BACKEND_URL
=
'http://naotu.baidu.com/share.php'
;
...
@@ -20,7 +21,11 @@ KityMinder.registerUI('menu/share/share', function(minder) {
...
@@ -20,7 +21,11 @@ KityMinder.registerUI('menu/share/share', function(minder) {
renderCreatePanel
().
then
(
bindCreatePanelEvent
);
renderCreatePanel
().
then
(
bindCreatePanelEvent
);
renderManagePanel
();
renderManagePanel
();
var
shareListLoaded
=
loadShareList
().
then
(
bindManageActions
);
var
shareListLoaded
=
loadShareList
();
shareListLoaded
.
then
(
renderShareList
);
shareListLoaded
.
then
(
bindManageActions
);
minder
.
on
(
'uiready'
,
function
()
{
minder
.
on
(
'uiready'
,
function
()
{
minder
.
getUI
(
'topbar/user'
).
requireLogin
(
$manage_menu
);
minder
.
getUI
(
'topbar/user'
).
requireLogin
(
$manage_menu
);
...
@@ -52,11 +57,94 @@ KityMinder.registerUI('menu/share/share', function(minder) {
...
@@ -52,11 +57,94 @@ KityMinder.registerUI('menu/share/share', function(minder) {
id
:
shared
.
id
||
shared
.
shareMinder
.
id
,
id
:
shared
.
id
||
shared
.
shareMinder
.
id
,
record
:
doc
.
json
record
:
doc
.
json
}
}
}).
then
(
function
()
{
notice
.
info
(
minder
.
getLang
(
'ui.share_sync_success'
,
doc
.
title
));
})[
'catch'
](
function
(
e
)
{
notice
.
error
(
'err_share_sync_failed'
,
e
);
});
});
});
});
}
}
});
});
function
loadShareFile
()
{
var
pattern
=
/
(?:
shareId|share_id
)
=
(\w
+
)([
&#
]
|$
)
/
;
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
if
(
!
match
)
return
Promise
.
resolve
(
null
);
var
shareId
=
match
[
1
];
$
(
minder
.
getRenderTarget
()).
addClass
(
'loading'
);
shareListLoaded
.
then
(
function
(
list
)
{
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
var
id
=
list
[
i
].
id
||
list
[
i
].
shareMinder
.
id
;
if
(
id
==
shareId
&&
list
[
i
].
path
)
{
return
loadOriginFile
(
list
[
i
]);
}
}
return
loadShare
(
shareId
);
});
}
function
loadOriginFile
(
share
)
{
var
$netdisk
=
minder
.
getUI
(
'menu/open/netdisk'
);
notice
.
info
(
minder
.
getLang
(
'ui.load_share_for_edit'
,
share
.
title
));
return
$netdisk
.
open
(
share
.
path
,
function
()
{
// 网盘加载失败
return
loadShare
(
share
);
});
}
function
loadShare
(
shareId
)
{
function
renderShareData
(
data
)
{
if
(
data
.
error
)
{
notice
.
error
(
'err_share_data'
,
data
.
error
);
return
;
}
var
content
=
data
.
shareMinder
.
data
;
return
$doc
.
load
({
source
:
'share'
,
content
:
content
,
protocol
:
'json'
,
saved
:
true
,
ownerId
:
data
.
uid
,
ownerName
:
data
.
uname
});
}
var
$container
=
$
(
minder
.
getRenderTarget
()).
addClass
(
'loading'
);
return
$
.
pajax
({
url
:
'http://naotu.baidu.com/share.php'
,
data
:
{
action
:
'find'
,
id
:
shareId
},
dataType
:
'json'
}).
then
(
renderShareData
)[
'catch'
](
function
(
e
)
{
notice
.
error
(
'err_share_data'
,
e
);
}).
then
(
function
()
{
$container
.
removeClass
(
'loading'
);
});
}
function
getShareByPath
(
path
)
{
function
getShareByPath
(
path
)
{
if
(
!
path
||
!
shareList
)
return
null
;
if
(
!
path
||
!
shareList
)
return
null
;
...
@@ -151,9 +239,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
...
@@ -151,9 +239,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
return
;
return
;
case
$target
.
hasClass
(
'edit-action'
):
case
$target
.
hasClass
(
'edit-action'
):
var
$netdisk
=
minder
.
getUI
(
'menu/open/netdisk'
);
loadOriginFile
(
share
);
$netdisk
.
open
(
share
.
path
);
return
;
return
;
}
}
});
});
...
@@ -316,7 +402,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
...
@@ -316,7 +402,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
return
fio
.
user
.
check
().
then
(
function
(
user
)
{
return
fio
.
user
.
check
().
then
(
function
(
user
)
{
if
(
!
user
)
return
;
if
(
!
user
)
return
;
$
.
pajax
(
BACKEND_URL
,
{
return
$
.
pajax
(
BACKEND_URL
,
{
type
:
'GET'
,
type
:
'GET'
,
...
@@ -331,7 +417,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
...
@@ -331,7 +417,7 @@ KityMinder.registerUI('menu/share/share', function(minder) {
return
(
shareList
=
result
.
list
||
[]);
return
(
shareList
=
result
.
list
||
[]);
})
.
then
(
renderShareList
)
;
});
});
});
}
}
...
@@ -431,5 +517,8 @@ KityMinder.registerUI('menu/share/share', function(minder) {
...
@@ -431,5 +517,8 @@ KityMinder.registerUI('menu/share/share', function(minder) {
}
}
}
}
return
$share_menu
;
return
{
$menu
:
$share_menu
,
loadShareFile
:
loadShareFile
};
});
});
\ No newline at end of file
ui/menu/share/view.js
View file @
6b099d49
...
@@ -10,10 +10,25 @@ KityMinder.registerUI('menu/share/view', function (minder) {
...
@@ -10,10 +10,25 @@ KityMinder.registerUI('menu/share/view', function (minder) {
var
$menu
=
minder
.
getUI
(
'menu/menu'
);
var
$menu
=
minder
.
getUI
(
'menu/menu'
);
var
$save
=
minder
.
getUI
(
'menu/save/save'
);
var
$save
=
minder
.
getUI
(
'menu/save/save'
);
var
$doc
=
minder
.
getUI
(
'doc'
);
var
$doc
=
minder
.
getUI
(
'doc'
);
var
notice
=
minder
.
getUI
(
'widget/notice'
);
var
shareId
;
$menu
.
$tabs
.
select
(
0
);
$menu
.
$tabs
.
select
(
0
);
$save
.
$tabs
.
select
(
0
);
$save
.
$tabs
.
select
(
0
);
minder
.
on
(
'uiready'
,
function
()
{
var
$quickvisit
=
minder
.
getUI
(
'topbar/quickvisit'
);
var
$edit
=
$quickvisit
.
add
(
'editshare'
,
'right'
);
$edit
.
on
(
'click'
,
function
()
{
if
(
shareId
)
window
.
open
(
'edit.html?shareId='
+
shareId
);
});
$quickvisit
.
$new
.
remove
();
$quickvisit
.
$save
.
remove
();
$quickvisit
.
$share
.
remove
();
});
function
loadShareDoc
()
{
function
loadShareDoc
()
{
var
pattern
=
/
(?:
shareId|share_id
)
=
(\w
+
)([
&#
]
|$
)
/
;
var
pattern
=
/
(?:
shareId|share_id
)
=
(\w
+
)([
&#
]
|$
)
/
;
...
@@ -21,14 +36,12 @@ KityMinder.registerUI('menu/share/view', function (minder) {
...
@@ -21,14 +36,12 @@ KityMinder.registerUI('menu/share/view', function (minder) {
if
(
!
match
)
return
Promise
.
resolve
(
null
);
if
(
!
match
)
return
Promise
.
resolve
(
null
);
var
shareId
=
match
[
1
];
shareId
=
match
[
1
];
function
renderShareData
(
data
)
{
function
renderShareData
(
data
)
{
if
(
data
.
error
)
{
if
(
data
.
error
)
{
window
.
alert
(
data
.
error
);
return
notice
.
error
(
'err_share_data'
,
data
.
error
);
window
.
location
.
href
=
'index.html'
;
return
;
}
}
var
content
=
data
.
shareMinder
.
data
;
var
content
=
data
.
shareMinder
.
data
;
...
@@ -44,7 +57,7 @@ KityMinder.registerUI('menu/share/view', function (minder) {
...
@@ -44,7 +57,7 @@ KityMinder.registerUI('menu/share/view', function (minder) {
}).
then
(
function
(
doc
)
{
}).
then
(
function
(
doc
)
{
var
$title
=
minder
.
getUI
(
'topbar/title'
);
var
$title
=
minder
.
getUI
(
'topbar/title'
);
$title
.
setTitle
(
'[分享的] '
+
$title
.
getTitle
());
$title
.
setTitle
(
'[分享的] '
+
$title
.
getTitle
()
+
' (只读)'
);
});
});
}
}
...
@@ -52,7 +65,7 @@ KityMinder.registerUI('menu/share/view', function (minder) {
...
@@ -52,7 +65,7 @@ KityMinder.registerUI('menu/share/view', function (minder) {
return
$
.
pajax
({
return
$
.
pajax
({
url
:
'http://naotu.baidu.com/share.php'
,
//'http://naotu.baidu.com/mongo.php',
url
:
'http://naotu.baidu.com/share.php'
,
data
:
{
data
:
{
action
:
'find'
,
action
:
'find'
,
...
@@ -63,14 +76,14 @@ KityMinder.registerUI('menu/share/view', function (minder) {
...
@@ -63,14 +76,14 @@ KityMinder.registerUI('menu/share/view', function (minder) {
}).
then
(
renderShareData
)[
'catch'
](
function
(
e
)
{
}).
then
(
renderShareData
)[
'catch'
](
function
(
e
)
{
window
.
alert
(
'请求分享文件失败,请重试!'
);
notice
.
error
(
'err_share_data'
,
e
);
}).
then
(
function
()
{
}).
then
(
function
()
{
$
(
minder
.
getRenderTarget
()).
removeClass
(
'loading'
);
minder
.
disable
();
minder
.
disable
();
minder
.
execCommand
(
'hand'
,
true
);
minder
.
execCommand
(
'hand'
,
true
);
$container
.
removeClass
(
'loading'
);
$container
.
removeClass
(
'loading'
);
});
});
}
}
...
...
ui/theme/default/css/_quickvisit.less
View file @
6b099d49
...
@@ -51,6 +51,16 @@
...
@@ -51,6 +51,16 @@
}
}
}
}
&.editshare {
margin-right: 5px;
float: right;
&:after {
top: 6.5px;
left: 7px;
background-position: 0 -1060px;
}
}
&:hover {
&:hover {
background-color: @tab-hover;
background-color: @tab-hover;
}
}
...
...
ui/theme/default/css/_user.less
View file @
6b099d49
...
@@ -55,12 +55,18 @@
...
@@ -55,12 +55,18 @@
height: 30px;
height: 30px;
}
}
}
}
&.login-button .fui-icon {
&.login-button {
width: 25px;
.fui-icon {
height: 25px;
border-radius: 100%;
margin-right: 3px;
width: 25px;
vertical-align: baseline;
height: 25px;
background: url(../images/icons.png) 0 -320px;
margin-right: 3px;
vertical-align: baseline;
background: url(../images/icons.png) 0 -320px;
}
.fui-label {
display: none;
}
}
}
}
}
}
}
...
...
ui/theme/default/css/default.all.css
View file @
6b099d49
...
@@ -1973,6 +1973,15 @@ body {
...
@@ -1973,6 +1973,15 @@ body {
left
:
7px
;
left
:
7px
;
background-position
:
0
-970px
;
background-position
:
0
-970px
;
}
}
#panel
.quick-visit-button.editshare
{
margin-right
:
5px
;
float
:
right
;
}
#panel
.quick-visit-button.editshare
:after
{
top
:
6.5px
;
left
:
7px
;
background-position
:
0
-1060px
;
}
#panel
.quick-visit-button
:hover
{
#panel
.quick-visit-button
:hover
{
background-color
:
#5a6378
;
background-color
:
#5a6378
;
}
}
...
@@ -2240,12 +2249,16 @@ body {
...
@@ -2240,12 +2249,16 @@ body {
height
:
30px
;
height
:
30px
;
}
}
#panel
div
.user-panel
.fui-button.login-button
.fui-icon
{
#panel
div
.user-panel
.fui-button.login-button
.fui-icon
{
border-radius
:
100%
;
width
:
25px
;
width
:
25px
;
height
:
25px
;
height
:
25px
;
margin-right
:
3px
;
margin-right
:
3px
;
vertical-align
:
baseline
;
vertical-align
:
baseline
;
background
:
url(../images/icons.png)
0
-320px
;
background
:
url(../images/icons.png)
0
-320px
;
}
}
#panel
div
.user-panel
.fui-button.login-button
.fui-label
{
display
:
none
;
}
.login-tip
{
.login-tip
{
display
:
none
;
display
:
none
;
}
}
...
...
ui/theme/default/css/default.all.css.map
View file @
6b099d49
This diff is collapsed.
Click to expand it.
ui/theme/default/images/icons.png
View replaced file @
cfa6c9a3
View file @
6b099d49
19.2 KB
|
W:
|
H:
19.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/topbar/feedback.js
0 → 100644
View file @
6b099d49
/**
* @fileOverview
*
* 快速反馈按钮
*
* @author: techird
* @copyright: Baidu FEX, 2014
*/
KityMinder
.
registerUI
(
'topbar/feedback'
,
function
(
minder
)
{
var
$quickvisit
=
minder
.
getUI
(
'topbar/quickvisit'
);
var
$feedback
=
$quickvisit
.
add
(
'feedback'
,
'right'
);
function
quickFeedback
()
{
var
$menu
=
minder
.
getUI
(
'menu/menu'
);
$menu
.
$tabs
.
select
(
5
);
$menu
.
show
();
}
$feedback
.
click
(
quickFeedback
);
minder
.
addShortcut
(
'f1'
,
quickFeedback
);
return
$feedback
;
});
\ No newline at end of file
ui/topbar/quickvisit.js
View file @
6b099d49
...
@@ -8,24 +8,33 @@
...
@@ -8,24 +8,33 @@
*/
*/
KityMinder
.
registerUI
(
'topbar/quickvisit'
,
function
(
minder
)
{
KityMinder
.
registerUI
(
'topbar/quickvisit'
,
function
(
minder
)
{
function
btn
(
name
)
{
var
rightDocks
=
[];
return
$
(
'<a class="quick-visit-button"></a>'
)
function
btn
(
name
,
dockRight
)
{
var
$btn
=
$
(
'<a class="quick-visit-button"></a>'
)
.
text
(
minder
.
getLang
(
'ui.quickvisit.'
+
name
))
.
text
(
minder
.
getLang
(
'ui.quickvisit.'
+
name
))
.
attr
(
'title'
,
minder
.
getLang
(
'ui.quickvisit.'
+
name
))
.
attr
(
'title'
,
minder
.
getLang
(
'ui.quickvisit.'
+
name
))
.
addClass
(
name
)
.
addClass
(
name
);
.
appendTo
(
'#panel'
);
if
(
dockRight
)
rightDocks
.
push
(
$btn
);
else
$btn
.
appendTo
(
'#panel'
);
return
$btn
;
}
}
var
$new
=
btn
(
'new'
),
var
$new
=
btn
(
'new'
),
$save
=
btn
(
'save'
),
$save
=
btn
(
'save'
),
$share
=
btn
(
'share'
),
$share
=
btn
(
'share'
);
$feedback
=
btn
(
'feedback'
);
var
ret
=
{};
var
ret
=
{
$new
:
$new
,
$save
:
$save
,
$share
:
$share
};
minder
.
on
(
'uiready'
,
function
quickVisit
()
{
minder
.
on
(
'uiready'
,
function
quickVisit
()
{
$
(
'#panel #search'
).
after
(
$feedback
);
while
(
rightDocks
.
length
)
$
(
'#panel #search'
).
after
(
rightDocks
.
shift
()
);
function
quickNew
()
{
function
quickNew
()
{
var
$doc
=
minder
.
getUI
(
'doc'
);
var
$doc
=
minder
.
getUI
(
'doc'
);
...
@@ -52,16 +61,10 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
...
@@ -52,16 +61,10 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
$menu
.
show
();
$menu
.
show
();
}
}
function
quickFeedback
()
{
var
$menu
=
minder
.
getUI
(
'menu/menu'
);
$menu
.
$tabs
.
select
(
5
);
$menu
.
show
();
}
$new
.
click
(
quickNew
);
$new
.
click
(
quickNew
);
$save
.
click
(
quickSave
);
$save
.
click
(
quickSave
);
$share
.
click
(
quickShare
);
$share
.
click
(
quickShare
);
$feedback
.
click
(
quickFeedback
);
minder
.
addShortcut
(
'ctrl+alt+n'
,
quickNew
);
minder
.
addShortcut
(
'ctrl+alt+n'
,
quickNew
);
minder
.
addShortcut
(
'ctrl+s'
,
quickSave
);
minder
.
addShortcut
(
'ctrl+s'
,
quickSave
);
...
@@ -71,15 +74,15 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
...
@@ -71,15 +74,15 @@ KityMinder.registerUI('topbar/quickvisit', function (minder) {
$menu
.
$tabs
.
select
(
2
);
$menu
.
$tabs
.
select
(
2
);
$menu
.
show
();
$menu
.
show
();
});
});
minder
.
addShortcut
(
'f1'
,
quickFeedback
);
ret
.
ready
=
true
;
ret
.
ready
=
true
;
ret
.
quickNew
=
quickNew
;
ret
.
quickNew
=
quickNew
;
ret
.
quickSave
=
quickSave
;
ret
.
quickSave
=
quickSave
;
ret
.
quickShare
=
quickShare
;
ret
.
quickShare
=
quickShare
;
ret
.
quickFeedback
=
quickFeedback
;
});
});
ret
.
add
=
btn
;
return
ret
;
return
ret
;
});
});
\ No newline at end of file
ui/topbar/user.js
View file @
6b099d49
...
@@ -101,7 +101,7 @@ KityMinder.registerUI('topbar/user', function(minder) {
...
@@ -101,7 +101,7 @@ KityMinder.registerUI('topbar/user', function(minder) {
fio
.
user
.
fire
(
'login'
,
user
);
fio
.
user
.
fire
(
'login'
,
user
);
}
else
{
}
else
{
if
(
window
.
location
.
href
.
indexOf
(
'nocheck'
)
==
-
1
)
{
if
(
window
.
location
.
href
.
indexOf
(
'nocheck'
)
==
-
1
)
{
logout
();
return
login
();
}
else
{
}
else
{
$loginButton
.
show
();
$loginButton
.
show
();
}
}
...
@@ -122,7 +122,7 @@ KityMinder.registerUI('topbar/user', function(minder) {
...
@@ -122,7 +122,7 @@ KityMinder.registerUI('topbar/user', function(minder) {
$loginButton
.
setLabel
(
minder
.
getLang
(
'ui.loggingin'
));
$loginButton
.
setLabel
(
minder
.
getLang
(
'ui.loggingin'
));
fio
.
user
.
login
({
fio
.
user
.
login
({
remember
:
7
*
24
*
60
*
60
// remember 7 days
remember
:
7
*
24
*
60
*
60
// remember 7 days
})
.
then
(
check
)
;
});
}
}
function
switchUser
()
{
function
switchUser
()
{
...
...
ui/ui.js
View file @
6b099d49
...
@@ -58,11 +58,11 @@
...
@@ -58,11 +58,11 @@
return
this
.
_ui
[
id
];
return
this
.
_ui
[
id
];
}
}
});
});
$
.
ajaxSetup
({
cache
:
false
});
$
.
extend
(
$
,
{
$
.
extend
(
$
,
{
pajax
:
function
(
opt
)
{
pajax
:
function
()
{
opt
.
cache
=
false
;
return
Promise
.
resolve
(
$
.
ajax
.
apply
(
$
,
arguments
));
return
Promise
.
resolve
(
$
.
ajax
(
opt
));
}
}
});
});
...
...
ui/widget/notice.js
View file @
6b099d49
...
@@ -25,6 +25,10 @@ KityMinder.registerUI('widget/notice', function (minder) {
...
@@ -25,6 +25,10 @@ KityMinder.registerUI('widget/notice', function (minder) {
className
:
'error-dialog'
className
:
'error-dialog'
}).
appendTo
(
document
.
getElementById
(
'content-wrapper'
));
}).
appendTo
(
document
.
getElementById
(
'content-wrapper'
));
$error
.
on
(
'ok cancel'
,
function
(
e
)
{
if
(
error
.
resolve
)
error
.
resolve
(
e
);
});
var
$error_body
=
$
(
$error
.
getBodyElement
());
var
$error_body
=
$
(
$error
.
getBodyElement
());
var
isBuilded
=
(
function
()
{
var
isBuilded
=
(
function
()
{
...
@@ -136,7 +140,7 @@ KityMinder.registerUI('widget/notice', function (minder) {
...
@@ -136,7 +140,7 @@ KityMinder.registerUI('widget/notice', function (minder) {
if
(
e
.
getDetail
)
return
e
;
if
(
e
.
getDetail
)
return
e
;
// 文件访问错误
// 文件访问错误
if
(
e
instanceof
fio
.
FileRequestError
)
{
if
(
typeof
(
fio
)
!=
'undefined'
&&
(
e
instanceof
fio
.
FileRequestError
)
)
{
if
(
!
e
.
status
)
{
if
(
!
e
.
status
)
{
e
.
description
=
errorMessage
.
err_network
;
e
.
description
=
errorMessage
.
err_network
;
}
else
{
}
else
{
...
@@ -205,6 +209,10 @@ KityMinder.registerUI('widget/notice', function (minder) {
...
@@ -205,6 +209,10 @@ KityMinder.registerUI('widget/notice', function (minder) {
$error
.
show
();
$error
.
show
();
$error
.
getElement
().
style
.
top
=
'180px'
;
$error
.
getElement
().
style
.
top
=
'180px'
;
return
new
Promise
(
function
(
resolve
)
{
error
.
resolve
=
resolve
;
});
}
}
...
...
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