index.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <!DOCTYPE html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <title>moe</title>
  5. <script type="text/javascript" src="/js/jquery.min.js"></script>
  6. <link rel="stylesheet" href="/css/bootstrap.min.css">
  7. <script type="text/javascript" src="/js/bootstrap.min.js"></script>
  8. <link rel="preconnect" href="https://fonts.googleapis.com">
  9. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  10. <link href="/css/css2.css" rel="stylesheet">
  11. <link rel="stylesheet" href="/css/style.css">
  12. <script>
  13. var status = 0, oid, user, pwd, paused = [], isadmin, sel = [], selected = [], tStatus = []
  14. const rot = '43.143.233.184:81', root = 'https://43.143.233.184:81/'
  15. function getDate(date) {
  16. return new Date(date).toLocaleDateString()
  17. }
  18. function getCookie(name) {
  19. let arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
  20. if (arr != null) return arr[2];
  21. return null;
  22. }
  23. function delCookie(name, path = 'u') {
  24. var exp = new Date();
  25. exp.setTime(exp.getTime() - 1);
  26. var cval = getCookie(name);
  27. if (cval != null)
  28. document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ((path == 'u') ? '' : ';path=' + path)
  29. }
  30. function getUrl(e) {
  31. return e.replace('dd.sdsz.com.cn', rot).replace(/^http:/, 'https:').replace(rot.split(':')[0] + '/', rot + '/').replace('service=http%3A%2F%2F' + root, 'service=http%3A%2F%2Fdd.sdsz.com.cn')
  32. }
  33. function setStatus(e, fast) {
  34. console.log('STATUS', e)
  35. status = e
  36. $('body').removeClass('grey')
  37. if (e == 1) {
  38. paused = []
  39. $('#loginSt').text('登录成功')
  40. $('.login').hide(200)
  41. $('#loginSt').addClass('label-success')
  42. $('#loginSt').removeClass('label-danger')
  43. $('.reqLogin').show(300)
  44. } else if (e == 2) {
  45. $('#loginSt').text('登录失败')
  46. $('#loginSt').removeClass('label-success')
  47. $('#loginSt').addClass('label-danger')
  48. } else if (e == 3) {
  49. delCookie('moe', '/')
  50. document.cookie = 'moe=guest;path=/';
  51. $('#loginSt').text('游客')
  52. $('.login').hide(200)
  53. $('.reqLogin').show(300)
  54. } else {
  55. isadmin = 0
  56. $('.login').show(200)
  57. $('#loginSt').text('未登录')
  58. $('#loginSt').removeClass('label-success')
  59. $('#loginSt').removeClass('label-danger')
  60. $('.reqLogin').hide(300 * !fast)
  61. $('#user').text('-')
  62. $('body').addClass('grey')
  63. }
  64. }
  65. function delCookies(force = 0) {
  66. if (force) {
  67. delCookie('CASTGC', '/')
  68. delCookie('moe', '/')
  69. delCookie('gosh', '/score/')
  70. if (force <= 2) {
  71. delCookie('gosh', '/sso/')
  72. delCookie('gowd', '/sso/')
  73. }
  74. }
  75. if (force >= 2) {
  76. delCookie('JSESSIONID', '/bxn-portal/')
  77. delCookie('JSESSIONID', '/bxn-library/')
  78. delCookie('JSESSIONID', '/bxn-core-uic/')
  79. }
  80. delCookie('JSESSIONID', '/')
  81. delCookie('SSOID', '/')
  82. delCookie('JSESSIONID', '/sso/')
  83. }
  84. function gget(url, call) {
  85. fetch(url, {
  86. "method": "GET",
  87. "credentials": 'include'
  88. }).then(e => e.text()).then(call)
  89. }
  90. function gpost(url, bd, call) {
  91. fetch(url, {
  92. headers: { 'Content-type': 'application/json' },
  93. method: "POST",
  94. credentials: 'include',
  95. body: bd
  96. }).then(e => e.text()).then(call)
  97. }
  98. function getStatus(id, ds, dt) {
  99. let s = new Date(ds), t = new Date(dt), e = new Date();
  100. if (e < s) return tStatus[id] = '未开始'
  101. if (e < t) return tStatus[id] = '进行中'
  102. else return tStatus[id] = '已结束'
  103. }
  104. function contestTouch() {
  105. gpost('contest/touch', JSON.stringify({
  106. no: $('#tNo').val(),
  107. title: $('#tTitle').val(),
  108. description: $('#tDescription').val(),
  109. dates: new Date($('#tStart')[0].valueAsNumber).toUTCString(),
  110. datet: new Date($('#tEnd')[0].valueAsNumber).toUTCString(),
  111. sel: $('#tSel').val()
  112. }), e => {
  113. e = JSON.parse(e)
  114. if (e.no) alert('您无权进行此操作')
  115. else {
  116. $('.tNew').toggle(300)
  117. debug('TOUCH', 'contest, affected ' + e.affectedRows + ' rows.')
  118. postLogin();
  119. }
  120. })
  121. }
  122. function contestRm(id, name) {
  123. if (prompt('确认删除?输入“' + name + '”以确认。') != name) return
  124. gpost('contest/rm', `{"id":"${id}"}`, e => {
  125. e = JSON.parse(e)
  126. if (e.no) alert('您无权进行此操作')
  127. else {
  128. debug('RM', 'contest, affected ' + e.affectedRows + ' rows.')
  129. postLogin();
  130. }
  131. })
  132. }
  133. function contestantTouch(id) {
  134. gpost('contestant/touch', JSON.stringify({
  135. name: $(`#c${id}Name`).val(),
  136. description: $(`#c${id}Description`).val(),
  137. img: $(`#c${id}Img`).val(),
  138. contest: id.toString()
  139. }), e => {
  140. e = JSON.parse(e)
  141. if (e.no) alert('您无权进行此操作')
  142. else {
  143. $(`.c${id}New`).toggle(300)
  144. debug('TOUCH', 'contestant, affected ' + e.affectedRows + ' rows.')
  145. getContest(id, 1);
  146. }
  147. })
  148. }
  149. function contestantRm(id, name, tId) {
  150. if (prompt('确认删除?输入“' + name + '”以确认。') != name) return
  151. gpost('contestant/rm', `{"id":"${id}"}`, e => {
  152. e = JSON.parse(e)
  153. if (e.no) alert('您无权进行此操作')
  154. else {
  155. debug('RM', 'contestant, affected ' + e.affectedRows + ' rows.')
  156. getContest(tId, 1);
  157. }
  158. })
  159. }
  160. function select(tId, id) {
  161. selected[tId][id] = !selected[tId][id]
  162. let count = 0
  163. if (selected[tId][id]) $('#contestant-' + id).addClass('active'), count++
  164. else $('#contestant-' + id).removeClass('active')
  165. for (let i = selected[tId].length - 1; i >= 0; i--) {
  166. if (i == id) continue;
  167. if (selected[tId][i]) {
  168. if (count >= sel[tId]) selected[tId][i] = false, $('#contestant-' + i).removeClass('active')
  169. else $('#contestant-' + i).addClass('active'), count++
  170. }
  171. else if (selected[tId][i] === false) $('#contestant-' + i).removeClass('active')
  172. }
  173. if (count) $('#content-' + tId + '>.voteBtn').removeClass('disabled')
  174. else $('#content-' + tId + '>.voteBtn').addClass('disabled')
  175. }
  176. function getVote(id) {
  177. debug('GET', 'Vote #' + id)
  178. gpost('vote/count', `{"contest":"${id}"}`, e => {
  179. e = JSON.parse(e)
  180. for (let i = 0; i < e.length; i++) {
  181. e[i].count -= parseInt($('#vote-' + e[i].t).text())
  182. for (let j = 0; j < e[i].count; j++) {
  183. setTimeout(() => {
  184. $('#vote-' + e[i].t).text(parseInt($('#vote-' + e[i].t).text()) + 1)
  185. let g = parseInt($('#vote-' + e[i].t).text()) / 2
  186. $('#contestant-' + e[i].t).css('background-image', `linear-gradient(to right,rgba(155,155,155,0.5) ${g}%,rgba(235,235,235,0.5) ${g}%)`)
  187. }, j * Math.max(5, 50 - 0.5 * j))
  188. }
  189. }
  190. })
  191. }
  192. function vote(id) {
  193. let to = []
  194. for (let i = 0; i < selected[id].length; i++) {
  195. if (selected[id][i]) {
  196. to.push(i)
  197. }
  198. }
  199. if (!to.length) return alert('请先选择')
  200. gpost('vote', JSON.stringify({
  201. contest: id.toString(),
  202. to: to
  203. }), e => {
  204. $('#content-' + id + '>.voteBtn').removeClass('btn-danger')
  205. if (e == 'success') getVote(id), $('#content-' + id + '>.voteBtn').addClass('btn-success');
  206. else {
  207. if (e == 'guest') alert('游客不得投票!')
  208. if (e == 'already') alert('已经投过票了!'), $('#content-' + id + '>.voteBtn').addClass('disabled')
  209. else $('#content-' + id + '>.voteBtn').addClass('btn-danger')
  210. }
  211. })
  212. }
  213. function getContest(id, force = 0, call = () => { }) {
  214. debug('GET', 'Contest #' + id)
  215. if ($('#content-' + id).text() && !force) return call()
  216. $('#content-' + id).empty()
  217. gpost('contestant', `{"contest":"${id}"}`, e => {
  218. e = JSON.parse(e)
  219. if (!e.length) $('#content-' + id).text('无选手')
  220. else $('#content-' + id).html(`<b style="font-size:16px">选手列表</b>(${e.length}选${sel[id]}):`)
  221. if (tStatus[id] == '进行中') $('#content-' + id).append(`<button class="btn btn-default btn-xs" onclick="getVote(${id});">刷新票数</button>`)
  222. $('#content-' + id).append(`<br>`)
  223. for (let i = 0; i < e.length; i++) {
  224. $('#content-' + id).append(`\
  225. <span id="contestant-${e[i].id}" class="contestant s${Math.ceil(Math.random() * 3)}" onclick="select(${id},${e[i].id})">\
  226. <b style="font-size:18px">${e[i].name}</b><br><span id="vote-${e[i].id}">0</span>票 ${isadmin ? ` <a href="javascript:contestantRm(${e[i].id},'${e[i].name}',${id})">删除</a>` : ''} \
  227. <img class="img-responsive center-block" src="${e[i].img.split('.png')[0] + '_thumb.png'}">\
  228. <div style="white-space:pre-wrap">${e[i].description}</div>\
  229. </span>`)
  230. selected[id][e[i].id] = false
  231. }
  232. if (tStatus[id] == '进行中' && getCookie('moe') != 'guest') $('#content-' + id).append(`<br><button class="btn btn-default disabled voteBtn" onclick="vote(${id})">投票 <span class="glyphicon glyphicon-thumbs-up"></span></button>`)
  233. if (isadmin) $('#content-' + id).append(`\
  234. <button class="btn btn-default admin" onclick="$('.c${id}New').toggle(300)">添加选手 <span class="glyphicon glyphicon-plus"></span></button>
  235. <div class="row c${id}New" style="display:none">
  236. <div class="col-md-6">名称
  237. <input id="c${id}Name" class="form-control" placeholder="伅" autocomplete="off">
  238. </div>
  239. <div class="col-md-6">图片链接
  240. <input class="form-control" id="c${id}Img" placeholder="https://**/*.png" autocomplete="off">
  241. </div>
  242. <div class="col-sm-12" style="margin-top: 10px;">
  243. <textarea id="c${id}Description" class="form-control" placeholder="介绍(请勿使用英文引号和分号)" style="resize: vertical"></textarea>
  244. <button class="btn btn-default" onclick="contestantTouch(${id})" style="margin-top: 10px;">提交 <span class="glyphicon glyphicon-send tSend"></span></button>
  245. </div>
  246. </div>
  247. `)
  248. $('#content-' + id).append(`<br><br>`)
  249. getVote(id)
  250. call()
  251. })
  252. }
  253. function postLogin() {
  254. debug('LOGIN DONE.', 'initiate fetching.')
  255. if (status != 1 && status != 3) return;
  256. if (getCookie('moe') && getCookie('moe')[0] == '!') isadmin = 1
  257. if (status == 1) {
  258. if (!user) user = getCookie('gosh'), pwd = getCookie('gowd')
  259. document.cookie = "gosh=" + user + ";path=/score/;expires=Fri, 05 Feb 2077 12:34:56 GMT";
  260. document.cookie = "gosh=" + user + ";path=/sso/;expires=Fri, 05 Feb 2077 12:34:56 GMT";
  261. document.cookie = "gowd=" + pwd + ";path=/sso/;expires=Fri, 05 Feb 2077 12:34:56 GMT";
  262. if (isadmin) $('#user').text('admin')
  263. else get('bxn-portal/portal/api/proxy?username=true&userId=true&needvalidate=true&t=http%3A%2F%2F202.94.10.118%2Fbxn-library%2Fapi%2Flibrary%2FgetLatestBorrowBook%3Fcategory%3D1&resourceId=103519&cache=nocache&systime=0', e => {
  264. e = JSON.parse(e)
  265. $('#user').text(e.requestParams[0].ownerName)
  266. oid = e.requestParams[0].ownerId
  267. })
  268. }
  269. gget('contest', e => {
  270. e = JSON.parse(e)
  271. $('#contest').empty()
  272. for (let i = 0; i < e.length; i++) {
  273. sel[e[i].id] = e[i].sel
  274. selected[e[i].id] = []
  275. $('#contest').prepend(`\
  276. <li id="contest-${e[i].id}">\
  277. <span onclick="getContest(${e[i].id},0,()=>{$(this).toggleClass('active').siblings('div').toggle(300)})" class="title">第 ${e[i].no} 届${e[i].title}\
  278. <span class="pull-right" style="color:#999"><span class="admin"><a href="javascript:contestRm(${e[i].id},'第${e[i].no}届${e[i].title}')">删除</a> ${e[i].id} - </span>${getStatus(e[i].id, e[i].dates, e[i].datet)}</span>\
  279. </span>
  280. <div style="display:none;white-space:pre-wrap"><span class="pull-right" style="color:#999">${getDate(e[i].dates)} - ${getDate(e[i].datet)}</span>${e[i].description}</div><div id="content-${e[i].id}" style="display:none"></div>\
  281. </li>`)
  282. }
  283. if (status == 1 && isadmin) $('.admin').show()
  284. else $('.admin').hide()
  285. })
  286. }
  287. function debug(e, str = '') {
  288. $('.debugList').append(`<li class="auto-warp"><b>${e}</b> ${str} <span class="pull-right" style="color:#999">${status}</span></li>`)
  289. }
  290. function login() {
  291. debug('LOGIN.')
  292. if (status == 1) return;
  293. delCookies()
  294. user = $('#loginId').val(), pwd = $('#loginPwd').val()
  295. return fetch(root + "sso/login", {
  296. headers: {
  297. "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
  298. // "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36"
  299. },
  300. method: "GET",
  301. mode: "cors",
  302. credentials: 'include'
  303. }).then(() => {
  304. return fetch('https://43.143.233.184/moelogin', {
  305. method: 'POST',
  306. headers: { 'Content-type': 'application/json' },
  307. body: JSON.stringify({
  308. user: user,
  309. pwd: pwd,
  310. cook: getCookie('JSESSIONID')
  311. }),
  312. credentials: 'include',
  313. })
  314. }).then(e => e.text()).then(e => { setStatus((e != 'success') + 1), Promise.resolve() })
  315. }
  316. function matches(e) {
  317. return e.match(/(^\[\]$|param":"|<tr>|DOCTYPE|in\?username=|requestParams|\"newmessage\"|Sorry, Page Not Found|北师大实验中学--登录)/s)
  318. }
  319. // 异步递归嘿嘿嘿,再多 302 也不怕;再加上回调函数,真是妙
  320. async function next(e, call, ac, login) {
  321. if (e.length < 3000 && !matches(e) && (!e.match('\/login\\?') || login)) {
  322. return fetch(getUrl(e), {
  323. method: 'GET',
  324. credentials: 'include',
  325. headers: {
  326. Accept: ac
  327. }
  328. }).then(e => e.text()).then(res => { next(res, call, ac, login) })
  329. }
  330. else return call(e), new Promise((resolve, reject) => { })
  331. }
  332. function pre(e, url, call) {
  333. if (e.match('北师大实验中学--登录')) {
  334. debug('OUTDATED CAS! NEED RELOGIN')
  335. delCookie('CASTGC', '/')
  336. tryLogin()
  337. }
  338. if (e.length < 3000 && e.match('\/login\\?')) {
  339. var name = url.split('/')[0], f = paused.filter(e => e.name == name)
  340. debug('FAILED', url)
  341. if (url.match('\/login\\?')) return
  342. if (f.length) f[0].arr.push(url), f[0].carr.push(call)
  343. else {
  344. paused.push({ name: name, arr: [url], carr: [call] })
  345. debug('GET COOKIE...')
  346. get(name + '/casfailed.jsp', () => {
  347. let f = paused.filter(e => e.name == name)[0]
  348. for (let i = 0; i < f.arr.length; i++)get(f.arr[i], f.carr[i])
  349. paused.splice(paused.indexOf(f), 1)
  350. }, '*/*', 1)
  351. }
  352. } else {
  353. $('#bxn' + url.split('bxn')[1].split(/(\/|%2F)/)[0]).addClass('bg-success').addClass('text-success')
  354. if (status == 1) call(e)
  355. }
  356. }
  357. function get(url, call = () => { }, ac = '*/*', login = 0) {
  358. if (isadmin) return
  359. console.log("GET", url)
  360. debug('GET', url)
  361. if (status != 1) return
  362. next(root + url, e => { pre(e, url, call); }, ac, login)
  363. }
  364. let trying = 0
  365. function tryLogin() {
  366. if (trying) return debug('LOGIN', 'already in progress.')
  367. isadmin = 0
  368. if (getCookie('moe') && getCookie('moe')[0] == '!') {
  369. debug('LOGIN', 'admin!')
  370. setStatus(1), postLogin()
  371. } else if (getCookie('CASTGC')) {
  372. debug('LOGIN', 'using CAS.')
  373. setStatus(1), postLogin()
  374. } else if (getCookie('gosh') && getCookie('gosh') != 'null' && getCookie('gowd') != 'null') {
  375. debug('LOGIN', 'using stored cookie.')
  376. setStatus(0)
  377. trying = 1
  378. $('#loginId').val(getCookie('gosh'))
  379. $('#loginPwd').val(getCookie('gowd'))
  380. login().then(() => { status == 2 ? setStatus(0, 1) : (trying = 0, postLogin()); })
  381. } else debug('LOGIN', 'no available method.'), setStatus(0, 1)
  382. }
  383. $().ready(() => {
  384. $('.e').addClass('reqLogin')
  385. $('.e').removeClass('e')
  386. tryLogin()
  387. $("[data-toggle='tooltip']").tooltip();
  388. $('.banner').text('庆祝 moe 建站 ' + Math.ceil((new Date().getTime() - 1676000714191) / 86400000) + ' 天')
  389. })
  390. </script>
  391. <style>
  392. .pass {
  393. font-weight: bold;
  394. font-family: 'Courier New', Courier, monospace;
  395. }
  396. li {
  397. border-bottom: 3px solid #eee;
  398. word-wrap: break-word;
  399. }
  400. li>.title {
  401. transition-duration: 300ms;
  402. display: inline-block;
  403. width: 100%;
  404. cursor: pointer;
  405. font-size: 18px
  406. }
  407. li>.active.title {
  408. font-size: 22px;
  409. font-weight: bold;
  410. }
  411. li>.active~div {
  412. background-image: linear-gradient(to right, #fffaf0, #f4f2ef);
  413. border-left: 3px solid #ccc;
  414. padding-left: 5px;
  415. }
  416. li:hover {
  417. background-color: #eee;
  418. }
  419. .box {
  420. transition-duration: 300ms;
  421. min-height: 210px;
  422. }
  423. .box::before {
  424. content: '';
  425. display: block;
  426. width: 100%;
  427. height: 3px;
  428. margin-top: 10px;
  429. border-bottom: 1px solid;
  430. border-image: linear-gradient(to right, transparent, #6aaad8, #75ddb6, transparent) 1;
  431. }
  432. .box:hover::before {
  433. border-bottom: 3px solid;
  434. border-image: linear-gradient(to right, transparent, #6aaad8, #75ddb6, transparent) 1;
  435. }
  436. body:not(.grey) .box:hover {
  437. background-image: linear-gradient(#faffef, transparent);
  438. }
  439. .page-header.nohr {
  440. margin-bottom: 0;
  441. border-bottom: none;
  442. }
  443. span.full {
  444. width: 100%;
  445. display: inline-block;
  446. cursor: pointer;
  447. }
  448. .breadcrumb {
  449. padding: 0;
  450. margin-bottom: 5px;
  451. }
  452. .auto-warp {
  453. word-wrap: break-word;
  454. word-break: break-all;
  455. overflow: hidden;
  456. transition-duration: 500ms;
  457. max-height: 22.4px;
  458. }
  459. .auto-warp:hover {
  460. max-height: 100px;
  461. }
  462. .contestant {
  463. display: inline-block;
  464. width: 30%;
  465. vertical-align: top;
  466. border-left: 3px solid #ddd;
  467. margin-bottom: 5px;
  468. margin-left: 5px;
  469. text-align: center;
  470. transition-duration: 100ms;
  471. cursor: pointer;
  472. }
  473. .contestant>img {
  474. transition-duration: 100ms;
  475. }
  476. .contestant:hover {
  477. background-color: #ddd;
  478. }
  479. .contestant.active>b {
  480. display: inline-block;
  481. width: 100%;
  482. background-image: linear-gradient(to right, transparent, #e5e9be, #a8d2bd, transparent);
  483. }
  484. .contestant.active>img {
  485. scale: 1.1;
  486. border-radius: 5px;
  487. margin-top: 10px;
  488. margin-bottom: 10px;
  489. }
  490. .contestant.active.s1 {
  491. transform: skew(2deg, 3deg);
  492. }
  493. .contestant.active.s2 {
  494. transform: skew(-2deg, -3deg);
  495. }
  496. .contestant.active.s3 {
  497. transform: skew(4deg, -3deg);
  498. }
  499. .grey {
  500. background-color: #e3e3e3;
  501. }
  502. body {
  503. transition-duration: 300ms;
  504. }
  505. </style>
  506. </head>
  507. <body class="grey">
  508. <div class="page-header nohr">
  509. <h2>
  510. <!-- <img src="RC.png" width="32px" style="position:relative;top:-4px"> -->
  511. 实萌
  512. </h2>
  513. <span id="loginSt" class="label label-default">未登录</span>
  514. <span id="user" class="label label-default">-</span>
  515. <button class="btn btn-danger btn-xs e" onclick="postLogin()" title="刷新数据">
  516. <span class="glyphicon glyphicon-refresh"></span>
  517. </button>
  518. <button class="btn btn-danger btn-xs e" onclick="delCookies(1);setStatus(0)" onmouseenter="$('#double-off').css('scale','100%')" onmouseleave="$('#double-off').css('scale','0')" title="退出登录">
  519. <span class="glyphicon glyphicon-log-out"></span>
  520. </button>
  521. <button id="double-off" class="btn btn-danger btn-xs e" onclick="delCookies(2);location.reload()" onmouseenter="$('#double-off').css('scale','100%')" onmouseleave="$('#double-off').css('scale','0')" style="scale:0;transition-duration: 1000ms;" data-toggle="tooltip" data-placement="right" title="全部重置">
  522. <span class="glyphicon glyphicon-off"></span>
  523. </button>
  524. <button class="btn btn-danger btn-xs login" onclick="delCookies(2);location.reload()" data-toggle="tooltip" data-placement="right" title="全部重置">
  525. <span class="glyphicon glyphicon-off"></span>
  526. </button>
  527. </div>
  528. <div class="col-sm-12 e box box-contest">
  529. <div class="page-header">
  530. <h3><span class="glyphicon glyphicon-fire"></span> 比赛列表
  531. </h3>
  532. </div>
  533. <ul id="contest" class="list-unstyled"></ul>
  534. <button class="btn btn-default admin" onclick="$('.tNew').toggle(300)">新建比赛 <span class="glyphicon glyphicon-plus"></span></button>
  535. <div class="tNew" style="display:none">
  536. <div class="col-md-4">
  537. 标题
  538. <div class="input-group">
  539. <div class="input-group-addon">第</div>
  540. <input id="tNo" class="form-control" placeholder="0" autocomplete="off">
  541. <div class="input-group-addon">届</div>
  542. <input id="tTitle" class="form-control" placeholder="测试赛" autocomplete="off">
  543. </div>
  544. </div>
  545. <div class="col-md-3 col-sm-6">
  546. 开始时间(以零点计算)
  547. <input class="form-control" type="date" id="tStart" min="2022-01-01" value="2023-02-10">
  548. </div>
  549. <div class="col-md-3 col-sm-6">
  550. 结束时间
  551. <input class="form-control" type="date" id="tEnd" min="2022-01-01" value="2023-02-10">
  552. </div>
  553. <div class="col-md-2">
  554. 多选个数
  555. <input id="tSel" class="form-control" placeholder="2" autocomplete="off">
  556. </div>
  557. <div class="col-sm-12" style="margin-top: 10px;">
  558. <textarea id="tDescription" class="form-control" placeholder="介绍(请勿使用英文引号和分号)" style="resize: vertical"></textarea>
  559. <button class="btn btn-default" onclick="contestTouch()" style="margin-top: 10px;">提交 <span class="glyphicon glyphicon-send tSend"></span></button>
  560. </div>
  561. </div>
  562. </div>
  563. <div class="col-md-4 col-sm-6 box">
  564. <div class="page-header">
  565. <h3><span class="glyphicon glyphicon-user"></span> 账号
  566. <ul class="btn-group breadcrumb debug" style="display: none;font-size:10px;top:5px">
  567. <li id="bxn-portal" onclick="get('bxn-portal/portal/osforstudent/index')">bxn-portal</li>
  568. <li id="bxn-core-uic" onclick="get('bxn-core-uic/uic/index')">bxn-core-uic</li>
  569. <li id="bxn-library" onclick="get('bxn-library/library/jumpExamreport?jumpUrl=')">bxn-library</li>
  570. <li id="bxn-office" onclick="get('bxn-office/mail/index')">bxn-office</li>
  571. </ul>
  572. </h3>
  573. </div>
  574. <button class="btn btn-default e" onclick="$('.debug').toggle(200)">debug</button>
  575. <div class="login">
  576. (登录数字校园)
  577. <br>
  578. <div class="input-group">
  579. <span class="input-group-addon">账号</span>
  580. <input id="loginId" type="id" class="pass form-control" placeholder="20222222">
  581. </div>
  582. <br>
  583. <div class="input-group">
  584. <span class="input-group-addon">密码</span>
  585. <input id="loginPwd" type="password" class="pass form-control" placeholder="password">
  586. <span class="input-group-btn">
  587. <button class="btn btn-default" type="button" onclick="login().then(postLogin)">
  588. <span class="glyphicon glyphicon-log-in"></span> 登录
  589. </button>
  590. </span>
  591. </div>
  592. <br>
  593. <button class="btn btn-default" onclick="setStatus(3);postLogin()"><span class="glyphicon glyphicon-user"></span> 游客</button><small>(可查看票数,不得投票)</small>
  594. </div>
  595. <div class="debug" style="display: none;">
  596. <button class="btn btn-default btn-xs" onclick="$('.debugList').empty()"><span class="glyphicon glyphicon-trash"></span> 清除</button>
  597. <ul class="debugList list-unstyled" style="font-family: 'Courier New', Courier, monospace;"></ul>
  598. </div>
  599. </div>
  600. <div style="position:fixed;bottom:10px;left:10px;color:#ccc">
  601. 北师大实验中学
  602. </div>
  603. <div style="position:fixed;bottom:10px;right:10px;color:#ccc" class="banner"></div>
  604. </body>