Commit 327f7577 authored by techird's avatar techird

Landing page

parent 9ac13bec
...@@ -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
...@@ -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
...@@ -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;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment