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
327f7577
Commit
327f7577
authored
Oct 15, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Landing page
parent
9ac13bec
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
19 deletions
+39
-19
default.js
ui/menu/default.js
+33
-19
draft.js
ui/menu/open/draft.js
+3
-0
recent.js
ui/menu/open/recent.js
+3
-0
No files found.
ui/menu/default.js
View file @
327f7577
...
...
@@ -48,28 +48,42 @@ KityMinder.registerUI('menu/default', function(minder) {
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
if
(
match
)
{
$share
.
loadShareFile
();
return
$share
.
loadShareFile
();
}
else
if
(
$draft
.
hasDraft
())
{
// 草稿箱有草稿,默认选中「草稿箱」,并打开最近编辑的文件
$open
.
$tabs
.
select
(
3
);
$draft
.
openLast
();
}
else
{
// 没有草稿,但用户登陆了
// 检查登录状态
fio
.
user
.
check
().
then
(
function
(
user
)
{
var
draft
=
$draft
.
last
();
var
recent
=
$recent
.
last
();
// 登录
if
(
user
)
{
// 有最近文件选中「最近文件」
if
(
$recent
.
hasRecent
())
{
$open
.
$tabs
.
select
(
0
);
$recent
.
loadLast
();
if
(
recent
)
{
if
(
draft
)
{
if
(
recent
.
time
>
draft
.
time
)
openRecent
();
else
openDraft
();
}
else
{
openRecent
();
}
// 否则选中网盘目录
else
{
$open
.
$tabs
.
select
(
1
);
}
else
{
if
(
draft
)
openDraft
();
else
$open
.
$tabs
.
select
(
1
);
// locale netdisk
}
}
else
{
if
(
draft
)
openDraft
();
else
$open
.
$tabs
.
select
(
2
);
// locale local
}
});
function
openDraft
()
{
$open
.
$tabs
.
select
(
3
);
$draft
.
openLast
();
}
function
openRecent
()
{
$open
.
$tabs
.
select
(
0
);
$recent
.
loadLast
();
}
});
}
});
});
\ No newline at end of file
ui/menu/open/draft.js
View file @
327f7577
...
...
@@ -150,6 +150,9 @@ KityMinder.registerUI('menu/open/draft', function(minder) {
},
openLast
:
function
()
{
$ul
.
find
(
'.draft-list-item'
).
eq
(
0
).
click
();
},
last
:
function
()
{
return
draftList
.
get
(
0
)
||
null
;
}
};
});
\ No newline at end of file
ui/menu/open/recent.js
View file @
327f7577
...
...
@@ -114,6 +114,9 @@ KityMinder.registerUI('menu/open/recent', function(minder) {
},
loadLast
:
function
()
{
$ul
.
find
(
'.recent-file-item'
).
eq
(
0
).
click
();
},
last
:
function
()
{
return
recentList
.
get
(
0
)
||
null
;
}
};
...
...
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