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
Hide 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) {
...
@@ -48,28 +48,42 @@ KityMinder.registerUI('menu/default', function(minder) {
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
var
match
=
pattern
.
exec
(
window
.
location
)
||
pattern
.
exec
(
document
.
referrer
);
if
(
match
)
{
if
(
match
)
{
$share
.
loadShareFile
();
return
$share
.
loadShareFile
();
}
}
else
if
(
$draft
.
hasDraft
())
{
// 草稿箱有草稿,默认选中「草稿箱」,并打开最近编辑的文件
// 检查登录状态
$open
.
$tabs
.
select
(
3
);
fio
.
user
.
check
().
then
(
function
(
user
)
{
$draft
.
openLast
();
var
draft
=
$draft
.
last
();
}
else
{
var
recent
=
$recent
.
last
();
// 没有草稿,但用户登陆了
fio
.
user
.
check
().
then
(
function
(
user
)
{
// 登录
if
(
user
)
{
if
(
user
)
{
// 有最近文件选中「最近文件」
if
(
recent
)
{
if
(
$recent
.
hasRecent
())
{
if
(
draft
)
{
$open
.
$tabs
.
select
(
0
);
if
(
recent
.
time
>
draft
.
time
)
openRecent
();
$recent
.
loadLast
();
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) {
...
@@ -150,6 +150,9 @@ KityMinder.registerUI('menu/open/draft', function(minder) {
},
},
openLast
:
function
()
{
openLast
:
function
()
{
$ul
.
find
(
'.draft-list-item'
).
eq
(
0
).
click
();
$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) {
...
@@ -114,6 +114,9 @@ KityMinder.registerUI('menu/open/recent', function(minder) {
},
},
loadLast
:
function
()
{
loadLast
:
function
()
{
$ul
.
find
(
'.recent-file-item'
).
eq
(
0
).
click
();
$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