From 5bd0659a51f0e0f33df6784befad8bbda76dd750 Mon Sep 17 00:00:00 2001 From: lixinyang123 Date: Fri, 5 Apr 2024 01:24:23 +0800 Subject: [PATCH] Fixed CloudShell page remove footer error --- index.html | 24 ++++++++++++------------ js/favourites.js | 2 +- js/index.js | 12 +++++++----- view/cloudshell.html | 10 ++++++++++ view/home.html | 2 +- view/intro.html | 2 +- view/notfound.html | 2 +- 7 files changed, 33 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 4950891..2309cf6 100644 --- a/index.html +++ b/index.html @@ -42,35 +42,35 @@ @@ -136,9 +136,9 @@

新增内容

-

KVStorage

-

CorsProxy

-

ProxyService

+

KVStorage

+

CorsProxy

+

ProxyService

diff --git a/js/favourites.js b/js/favourites.js index ed1977f..943903d 100644 --- a/js/favourites.js +++ b/js/favourites.js @@ -3,7 +3,7 @@ var favourites = []; async function showFavourites() { if (!userInfo) { - navigation("home"); + navigate("home"); return; } diff --git a/js/index.js b/js/index.js index 8921fea..b2fccf1 100644 --- a/js/index.js +++ b/js/index.js @@ -2,6 +2,7 @@ let client_id = "68fd42deb929a87fc8b9"; let redirect_uri = "https://oauth.conchbrain.club/redirect"; let userInfo = undefined; let isDarkMode = false; +let onNavigated = undefined function login() { let href = `https://github.com/login/oauth/authorize?client_id=${client_id}&redirect_uri=${redirect_uri}`; @@ -65,7 +66,7 @@ function guid() { }); } -function navigation(name, isBack = false) { +function navigate(name, isBack = false) { window.scrollTo(0, 0); loadingState(true); @@ -82,9 +83,10 @@ function navigation(name, isBack = false) { loadingState(false); } else { - navigation("notfound"); + navigate("notfound"); loadingState(false); } + if (onNavigated) onNavigated(name, isBack) }); } @@ -194,7 +196,7 @@ async function init() { //初始化导航 window.onpopstate = (e) => { - navigation(e.state.page, true); + navigate(e.state.page, true); } //获取当前用户 @@ -213,10 +215,10 @@ async function init() { //导航到指定页面 if (href.includes("#")) { let page = href.substring(href.indexOf("#") + 1); - navigation(page); + navigate(page); } else { - navigation("home"); + navigate("home"); } initPWA() diff --git a/view/cloudshell.html b/view/cloudshell.html index da05a6f..61cb676 100644 --- a/view/cloudshell.html +++ b/view/cloudshell.html @@ -1 +1,11 @@ + + \ No newline at end of file diff --git a/view/home.html b/view/home.html index e48b19e..f90b9de 100644 --- a/view/home.html +++ b/view/home.html @@ -20,7 +20,7 @@

海螺大脑俱乐部

diff --git a/view/intro.html b/view/intro.html index 8c7bae5..3257c92 100644 --- a/view/intro.html +++ b/view/intro.html @@ -83,7 +83,7 @@

为什么不问问神奇的魔法海螺呢?

"你为什么不问它点什么问它点什么问它点什么!!"---派大星

- 今日的海螺推荐 diff --git a/view/notfound.html b/view/notfound.html index 6249dc4..41911a7 100644 --- a/view/notfound.html +++ b/view/notfound.html @@ -8,7 +8,7 @@

Ooops !

这里什么也没有

"我们不是原始人,我们拥有高科技" ---派大星


- +