Commit 327f7577 authored by techird's avatar techird

Landing page

parent 9ac13bec
......@@ -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) {
if (user) {
// 有最近文件选中「最近文件」
if ($recent.hasRecent()) {
$open.$tabs.select(0);
$recent.loadLast();
}
// 否则选中网盘目录
else {
$open.$tabs.select(1);
// 检查登录状态
fio.user.check().then(function(user) {
var draft = $draft.last();
var recent = $recent.last();
// 登录
if (user) {
if (recent) {
if (draft) {
if (recent.time > draft.time) openRecent();
else openDraft();
} else {
openRecent();
}
} 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) {
},
openLast: function() {
$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) {
},
loadLast: function() {
$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