diff --git a/maipulse/html/index.html b/maipulse/html/index.html index 10a1a39..5978d40 100644 --- a/maipulse/html/index.html +++ b/maipulse/html/index.html @@ -1334,61 +1334,6 @@ async function updateMaster(){ ticker('曲库已更新:' + r.new + ' 首' + (r.added > 0 ? '(新增 ' + r.added + ')' : ''), 'ok'); } -const GH_KEY = 'maipulse.ghrepo'; -const GHT_KEY = 'maipulse.ghtoken'; - -async function checkGh(){ - const repo = ($('ghRepo').value || '').trim(); - const token = ($('ghToken').value || '').trim(); - if(!repo) return ticker('先填 owner/name', 'err'); - try{ localStorage.setItem(GH_KEY, repo); if(token) localStorage.setItem(GHT_KEY, token); }catch(e){} - const out = $('upOut'); - out.textContent = '正在问 GitHub…'; - let q = '/api/update-gh?repo=' + encodeURIComponent(repo); - if(token) q += '&token=' + encodeURIComponent(token); - const r = await get(q); - if(!r.ok){ out.textContent = r.error; return; } - if(r.newer){ - let act = ''; - if(r.url){ - if(window.Maipulse && window.Maipulse.installApk){ - act = '
'; - }else{ - act = '
点这里下载'; - } - } - out.innerHTML = 'GitHub 上有新版本 ' + r.remote + '(当前 ' + r.current + ')' - + (r.notes ? '
' + r.notes.slice(0, 300) : '') + act; - }else{ - out.innerHTML = 'GitHub 上已经是最新的(' + r.current + ',远端 ' + r.remote + ')'; - } -} - -async function checkUpdate(){ - const src = ($('upSrc').value || '').trim(); - if(!src) return ticker('先填更新源地址', 'err'); - try{ localStorage.setItem(UP_SRC_KEY, src); }catch(e){} - const out = $('upOut'); - out.textContent = '正在检查…'; - const r = await get('/api/update-check?source=' + encodeURIComponent(src)); - if(!r.ok){ out.textContent = r.error; return; } - if(r.newer){ - let act = ''; - if(r.url){ - // Android 壳里直接走系统下载器 + 安装器;网页版给个普通链接 - if(window.Maipulse && window.Maipulse.installApk){ - act = '
'; - }else{ - act = '
点这里下载'; - } - } - out.innerHTML = '有新版本 ' + r.remote + '(当前 ' + r.current + ')' - + (r.notes ? '
' + r.notes : '') + act; - }else{ - out.innerHTML = '已经是最新的(' + r.current + ',远端 ' + r.remote + ')'; - } -} - /* ---------- 旅行伙伴 ---------- */ let charPicked = []; async function loadCharacters(){ @@ -1970,7 +1915,6 @@ log('就绪。先扫码 → 登录 → 选功能。', 'dim'); applyLook(); loadVersion(); confSummary(); -try{ const _u = localStorage.getItem(UP_SRC_KEY); if(_u && $('upSrc')) $('upSrc').value = _u; const _g = localStorage.getItem(GH_KEY); if(_g && $('ghRepo')) $('ghRepo').value = _g; const _t = localStorage.getItem(GHT_KEY); if(_t && $('ghToken')) $('ghToken').value = _t; }catch(e){} loadAccounts(); // URL 带 ?uid= 时自动查这个账号的 B50 与推分(方便直接看别人的分) const uidParam = new URLSearchParams(location.search).get('uid'); @@ -2039,4 +1983,4 @@ if(location.search.indexOf('dbg') >= 0){ } - \ No newline at end of file +