等待老师开始比赛…
打开训练页 4–6 个标签
点击按钮,或按 Alt+P / Q / R / T / Y / U。若 Chrome 拦截弹窗,请允许“始终允许弹出式窗口”。
+ +快捷键帮助
新建标签页
切到第3个标签
关闭当前标签
下一个标签
后退
前进
刷新页面
页内查找
收藏
下载列表
关闭当前窗口
显示桌面
说明:Ctrl+T/W/N、Alt+F4、Win+D 这类系统级快捷键常被 Windows/浏览器优先接管,网页不能可靠检测,只能用于讲解和人工观察。
${p.desc}
`;const b=document.createElement('button');b.textContent='在新标签页打开';b.onclick=()=>openPage(p.page);el.appendChild(b);wrap.appendChild(el)})} +function openPage(n){window.open(`/page/${n}`,'_blank')} +document.getElementById('loginForm').onsubmit=async e=>{e.preventDefault();const r=await API.post('/api/login',{username:username.value,password:password.value});if(!r.ok){API.notify(notice,r.message);return}const s=await API.get('/api/student/state');if(studentMustChange(s.student)){document.getElementById('passwordChange').classList.remove('hidden');API.notify(notice,'首次使用,请先修改密码');return}logged=true;notice.textContent='';render();await applyStudentState(s);setInterval(refreshStudent,1000)}; +document.getElementById('passwordChange').onsubmit=async e=>{e.preventDefault();const r=await API.post('/api/password',{oldPassword:oldPassword.value,newPassword:newPassword.value});API.notify(notice,r.message);if(r.ok){logged=true;document.getElementById('passwordChange').classList.add('hidden');render()}}; +document.getElementById('logout').onclick=async()=>{await API.post('/api/logout');location.reload()}; +document.addEventListener('keydown',e=>{if(!logged||e.ctrlKey||e.metaKey)return;const k=keyName(e);if(e.altKey&&'PQRTYU'.includes(k)){consumeKey(e);openPage('PQRTYU'.indexOf(k)+1);reportEvent({type:'page',page:'PQRTYU'.indexOf(k)+1})}},true); diff --git a/shortcut_trainer/static/index.html b/shortcut_trainer/static/index.html new file mode 100644 index 0000000..ad5d3f4 --- /dev/null +++ b/shortcut_trainer/static/index.html @@ -0,0 +1,13 @@ +点击按钮,或按 Alt+P / Q / R / T / Y / U。若 Chrome 拦截弹窗,请允许“始终允许弹出式窗口”。
+ +说明:Ctrl+T/W/N、Alt+F4、Win+D 这类系统级快捷键常被 Windows/浏览器优先接管,网页不能可靠检测,只能用于讲解和人工观察。
正在准备本页内容…
类似 Word 功能区:先按 Alt+K / H / B 展开对应面板,再按面板里的字母。
外部链接:按 Alt+B 展开保障面板,再按 L,然后按 D 打开百度,或按 F 打开 Bilibili。不必继续按着 Alt。
在页面空白处右键,可打开练习菜单;菜单打开后按 E/R/C。
测试账号 test01 到 test05,初始密码 test1234,班级为「测试」。与分组系统共用同一学生库。
+修改后请把新密码告知学生;该学生的所有已登录会话会立即退出。
+