Ex124OJ

Extend 124OJ!

当前为 2023-11-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Ex124OJ
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1.10
  5. // @description Extend 124OJ!
  6. // @author Sukwants
  7. // @license MIT
  8. // @match http://124.221.194.184/*
  9. // @icon https://ex124oj.pond.ink/images/icon.png
  10. // @grant unsafeWindow
  11. // @grant GM_addElement
  12. // @grant GM_addStyle
  13. // @grant GM_setClipboard
  14. // @grant GM_getValue
  15. // @grant GM_setValue
  16. // @grant GM_deleteValue
  17. // @grant GM_listValues
  18. // @grant GM_xmlhttpRequest
  19. // @connect ex124oj.pond.ink
  20. // @run-at document-start
  21. // @require http://124.221.194.184/js/jquery.min.js
  22. // ==/UserScript==
  23.  
  24.  
  25. /******/ (() => { // webpackBootstrap
  26. /******/ "use strict";
  27. /******/ var __webpack_modules__ = ({
  28.  
  29. /***/ 579:
  30. /***/ ((__unused_webpack_module, exports) => {
  31.  
  32.  
  33. Object.defineProperty(exports, "__esModule", ({ value: true }));
  34. exports.exAnnouncements = void 0;
  35. function exAnnouncements() {
  36. var PostsExp = /<body[\s\S]*?>([\s\S]*?)<\/body>/;
  37. var WrittenByExp = /^by (.*)$/;
  38. var DateTimeExp = /^(.*?) .*$/;
  39. if (document.getElementsByClassName('uoj-content')[0].children[0].children[0].children[0]) {
  40. GM_xmlhttpRequest({
  41. method: "GET",
  42. url: "https://ex124oj.pond.ink/categories/Announcements/",
  43. nocache: true,
  44. onload: function (data) {
  45. var Announcements = document.querySelector('div.uoj-content > div.card.card-default > div.card-body > div.row > div:first-child > table');
  46. if (Announcements) {
  47. Announcements.querySelector('thead > tr').innerHTML = '<th style="width:30%">公告</th><th style="width:10%"></th><th style="width:10%"></th><th style="width:30%">Ex 公告</th><th style="width:10%"></th><th style="width:10%"></th>';
  48. var trs = Announcements.querySelectorAll('tbody > tr');
  49. for (var tr = 0; tr < trs.length - 1; ++tr) {
  50. if (trs[tr].innerHTML) {
  51. trs[tr].innerHTML = (trs[tr].children.length > 2 ? trs[tr].innerHTML : '<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>') + '<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>';
  52. if (WrittenByExp.test(trs[tr].children[1] && trs[tr].children[1].innerHTML)) {
  53. trs[tr].children[1].innerHTML = trs[tr].children[1].innerHTML.match(WrittenByExp)[1];
  54. }
  55. if (DateTimeExp.test(trs[tr].children[2] && trs[tr].children[2].innerHTML)) {
  56. trs[tr].children[2].innerHTML = '<small>' + trs[tr].children[2].textContent.match(DateTimeExp)[1] + '</small>';
  57. }
  58. }
  59. }
  60. trs[trs.length - 1].innerHTML = '<td class="text-right" colspan="3"><a href="/announcements">所有公告……</a></td><td class="text-right" colspan="3"><a href="https://ex124oj.pond.ink/categories/Announcements/">所有公告……</a></td>';
  61. var PostsPage = (new DOMParser()).parseFromString(data.response, 'text/html');
  62. var Posts = PostsPage.querySelectorAll('article');
  63. for (var i = 0; i < Posts.length && i < 5; ++i) {
  64. var title = Posts[i].querySelector('a.post-title-link');
  65. Announcements.querySelector('tbody').children[i].children[3].innerHTML = "<a href=\"https://ex124oj.pond.ink".concat(title.getAttribute('href'), "\">").concat(title.innerText, "</a>");
  66. Announcements.querySelector('tbody').children[i].children[4].innerHTML = '<a class="uoj-username" href="https://ex124oj.pond.ink/" style="color:rgb(40,173,202)">Ex124OJ</a>';
  67. var date = Posts[i].querySelector('time');
  68. Announcements.querySelector('tbody').children[i].children[5].innerHTML = '<small>' + date.getAttribute('content') + '</small>';
  69. }
  70. }
  71. }
  72. });
  73. }
  74. }
  75. exports.exAnnouncements = exAnnouncements;
  76.  
  77.  
  78. /***/ }),
  79.  
  80. /***/ 690:
  81. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  82.  
  83.  
  84. Object.defineProperty(exports, "__esModule", ({ value: true }));
  85. exports.changeIcon = exports.Background = void 0;
  86. var variables_1 = __webpack_require__(449);
  87. function Background() {
  88. if (variables_1.BackgroundImage) {
  89. var titlebar = document.querySelector('div.container > div:first-child');
  90. if (titlebar) {
  91. titlebar.style.marginLeft = titlebar.style.marginRight = '-15px';
  92. }
  93. GM_addStyle("\nbody {\n background: url(".concat(variables_1.BackgroundImage, ");\n background-repeat: no-repeat;\n background-attachment: fixed;\n background-position: 50% 50%;\n background-size: cover;\n}\n.uoj-content {\n background-color: ").concat(!variables_1.Darktheme ? '#fff' : '#222', ";\n margin: 16px -16px;\n padding: 16px 16px;\n opacity: 0.85;\n border-radius: 8px;\n}\n.navbar {\n margin: 16px -16px;\n padding: 8px 16px;\n opacity: 0.85;\n border-radius: 8px;\n}\n.giscus {\n opacity: 0.85;\n}\n "));
  94. }
  95. }
  96. exports.Background = Background;
  97. function getIcon() {
  98. if (variables_1.SiteIconImage)
  99. return variables_1.SiteIconImage;
  100. else
  101. return '/images/logo.png';
  102. }
  103. function changeIcon() {
  104. var LogoURLRegExp = /^.*\/images\/logo(_small){0,1}.png$/;
  105. var Links = document.getElementsByTagName('link');
  106. for (var link in Links) {
  107. if (Links[link] && Links[link].nodeType && Links[link].getAttribute('rel') == 'shortcut icon') {
  108. Links[link].setAttribute('href', getIcon());
  109. }
  110. }
  111. var Icons = document.getElementsByTagName('img');
  112. for (var icon in Icons) {
  113. if (Icons[icon] instanceof Element && Icons[icon].nodeType === Node.ELEMENT_NODE) {
  114. var srcAttribute = Icons[icon].getAttribute('src');
  115. if (srcAttribute !== null && LogoURLRegExp.test(srcAttribute)) {
  116. if (!Icons[icon].getAttribute('style')) {
  117. Icons[icon].setAttribute('src', getIcon());
  118. Icons[icon].setAttribute('style', 'width:100%;height:auto;object-fit:cover');
  119. }
  120. else {
  121. Icons[icon].setAttribute('src', getIcon());
  122. }
  123. }
  124. }
  125. }
  126. }
  127. exports.changeIcon = changeIcon;
  128.  
  129.  
  130. /***/ }),
  131.  
  132. /***/ 480:
  133. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  134.  
  135.  
  136. Object.defineProperty(exports, "__esModule", ({ value: true }));
  137. exports.CodeCopy = void 0;
  138. var variables_1 = __webpack_require__(449);
  139. function CodeCopy() {
  140. if (!(/^.*\/manage\/statement(\?.*){0,1}$/).test(window.location.href)) {
  141. var CodeBlocks = document.getElementsByTagName('pre');
  142. var _loop_1 = function (cb) {
  143. if (CodeBlocks[cb] && CodeBlocks[cb].nodeType) {
  144. var Content_1 = CodeBlocks[cb].innerText;
  145. CodeBlocks[cb].style.position = 'relative';
  146. var CopyButton_1 = document.createElement('button');
  147. CodeBlocks[cb].insertBefore(CopyButton_1, CodeBlocks[cb].children[0]);
  148. CopyButton_1.setAttribute('class', 'copybutton');
  149. CopyButton_1.setAttribute('id', "copybutton".concat(cb));
  150. if (variables_1.Darktheme)
  151. CopyButton_1.setAttribute('style', "color: white;");
  152. CopyButton_1.innerHTML = '<i class="fa-solid fa-copy"></i>';
  153. CopyButton_1.onclick = function () {
  154. GM_setClipboard(Content_1, 'text');
  155. CopyButton_1.innerHTML = '<i class="fa-solid fa-check"></i>';
  156. setTimeout(function () { CopyButton_1.innerHTML = '<i class="fa-solid fa-copy"></i>'; }, 500);
  157. };
  158. }
  159. };
  160. for (var cb in CodeBlocks) {
  161. _loop_1(cb);
  162. }
  163. }
  164. }
  165. exports.CodeCopy = CodeCopy;
  166.  
  167.  
  168. /***/ }),
  169.  
  170. /***/ 103:
  171. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  172.  
  173.  
  174. Object.defineProperty(exports, "__esModule", ({ value: true }));
  175. exports.ContestStandings = exports.ContestHome = exports.ContestsCard = void 0;
  176. var variables_1 = __webpack_require__(449);
  177. var utils_1 = __webpack_require__(593);
  178. function ContestsCard() {
  179. var content = document.querySelector('div.uoj-content');
  180. if (content && content.children.length > 1) {
  181. var TabList = document.createElement('ul');
  182. content.insertBefore(TabList, content.children[0]);
  183. TabList.setAttribute('class', 'nav nav-tabs');
  184. TabList.setAttribute('role', 'tablist');
  185. var TabContent = document.createElement('div');
  186. content.insertBefore(TabContent, content.children[1]);
  187. TabContent.setAttribute('class', 'tab-content');
  188. TabContent.style.marginBottom = '20px';
  189. TabContent.style.marginTop = '20px';
  190. var counter = 0;
  191. for (var i = 2; i < content.children.length; i++) {
  192. console.log(content.children[i].tagName);
  193. if (content.children[i].tagName.toUpperCase() == 'H4') {
  194. var isActive = !counter;
  195. var title = document.createElement('li');
  196. TabList.appendChild(title);
  197. title.setAttribute('class', 'nav-item');
  198. var titleText = content.children[i].textContent;
  199. if (titleText) {
  200. titleText = titleText.charAt(0).toUpperCase() + titleText.slice(1);
  201. title.innerHTML = "<a class=\"nav-link".concat(isActive ? ' active' : '', "\" href=\"#card").concat(counter, "\" role=\"tab\" data-toggle=\"tab\" aria-selected=\"true\">").concat(titleText, "</a>");
  202. }
  203. var card = document.createElement('div');
  204. TabContent.appendChild(card);
  205. card.setAttribute('class', "tab-pane".concat(isActive ? ' active' : ''));
  206. card.setAttribute('id', "card".concat(counter));
  207. content.removeChild(content.children[i]);
  208. counter++;
  209. }
  210. else if (counter) {
  211. TabContent.children[counter - 1].appendChild(content.children[i]);
  212. }
  213. else {
  214. content.removeChild(content.children[i]);
  215. }
  216. i--;
  217. }
  218. }
  219. }
  220. exports.ContestsCard = ContestsCard;
  221. function ContestHome() {
  222. var content = document.querySelector('div.uoj-content');
  223. if (content && content.querySelectorAll('div').length < 2) {
  224. GM_xmlhttpRequest({
  225. method: "GET",
  226. url: "https://ex124oj.pond.ink/api/contest/".concat((0, utils_1.isContest)()[1]),
  227. nocache: true,
  228. onload: function (data) {
  229. if (data.status == 200) {
  230. var res = JSON.parse(data.response);
  231. var title = document.querySelector('head > title');
  232. if (title && res.title) {
  233. title.innerHTML = res.title;
  234. }
  235. var content_1 = document.querySelector('div.uoj-content');
  236. if (content_1 && res.content) {
  237. content_1.innerHTML = res.content;
  238. eval('unsafeWindow.$(".countdown").countdown();');
  239. }
  240. }
  241. }
  242. });
  243. }
  244. }
  245. exports.ContestHome = ContestHome;
  246. function PinLineHeader() {
  247. var lines = document.querySelectorAll('div#standings > div.table-responsive > table tr');
  248. for (var i = 0; i < lines.length; i++) {
  249. var line = lines[i];
  250. var x = 0;
  251. for (var j = 0; j < line.children.length && j < 3; j++) {
  252. line.children[j].style.position = 'sticky';
  253. line.children[j].style.left = x + 'px';
  254. line.children[j].classList.add('checked');
  255. x = x + parseFloat(window.getComputedStyle(line.children[j]).width);
  256. }
  257. }
  258. }
  259. var ContestHomepage;
  260. function ProblemTitles() {
  261. var solve = function () {
  262. var lines = document.querySelectorAll('div#standings > div.table-responsive > table tr');
  263. var problems = {};
  264. var rows = ContestHomepage.querySelectorAll('table > tbody > tr');
  265. for (var i = 0; i < rows.length; i++) {
  266. if (rows[i].children.length >= 2) {
  267. var id = rows[i].children[0].textContent, title = rows[i].children[1].textContent;
  268. if (id && title) {
  269. problems[id] = "".concat(id, ". ").concat(title);
  270. }
  271. }
  272. }
  273. for (var i = 0; i < lines.length; i++) {
  274. var line = lines[i];
  275. for (var j = 3; j < line.children.length; j++) {
  276. var title = lines[0].children[j].querySelector('a');
  277. if (title && title.textContent && problems[title.textContent]) {
  278. line.children[j].title = problems[title.textContent];
  279. }
  280. }
  281. }
  282. };
  283. if (ContestHomepage) {
  284. solve();
  285. }
  286. else {
  287. GM_xmlhttpRequest({
  288. method: "GET",
  289. url: "/contest/".concat(contest_id),
  290. nocache: true,
  291. onload: function (data) {
  292. ContestHomepage = (new DOMParser()).parseFromString(data.response, 'text/html');
  293. solve();
  294. }
  295. });
  296. }
  297. }
  298. var Problemchecked = [];
  299. function ShowStandings() {
  300. PinLineHeader();
  301. ProblemTitles();
  302. var lines = document.querySelectorAll('div#standings > div.table-responsive > table tr');
  303. if (!lines.length) {
  304. return;
  305. }
  306. var sum = 0;
  307. for (var k = 0; k < lines.length; k++) {
  308. var _loop_1 = function (i) {
  309. if (Problemchecked[i - 3]) {
  310. lines[k].children[i].classList.add('checked');
  311. if (k == 0)
  312. sum++;
  313. }
  314. lines[k].children[i].addEventListener('click', function (event) {
  315. var target = event.target;
  316. if (target.tagName === 'A') {
  317. return;
  318. }
  319. Problemchecked[i - 3] = !Problemchecked[i - 3];
  320. displayStandings();
  321. });
  322. };
  323. for (var i = 3; i < lines[k].children.length; i++) {
  324. _loop_1(i);
  325. }
  326. }
  327. if (sum == 0) {
  328. return;
  329. }
  330. var scores = document.querySelectorAll('div#standings > div.table-responsive > table > tbody > tr > td:nth-child(3) > div > span.uoj-score');
  331. for (var i = 0; i < scores.length; i++) {
  332. scores[i].style.color = getColOfScore(standings[i][0] / sum);
  333. }
  334. }
  335. function displayStandings() {
  336. var standingsArea = document.querySelector('div#standings');
  337. if (!standingsArea) {
  338. return;
  339. }
  340. var lines = standingsArea.querySelectorAll('div.table-responsive > table tr');
  341. var headline = lines[0];
  342. var Problemsum = headline.children.length - 3;
  343. var Usersum = lines.length - 1;
  344. // let checked = false;
  345. // for (let i = 0; i < Problemsum; i++) {
  346. // checked = checked || Problemchecked[i];
  347. // }
  348. for (var i = 0; i < Usersum; i++) {
  349. var name_1 = standings[i][2][0];
  350. standings[i][0] = standings[i][1] = 0;
  351. for (var j = 0; j < Problemsum; j++) {
  352. if ((Problemchecked[j] /* || !checked*/) && score[name_1][j] !== undefined) {
  353. standings[i][0] += score[name_1][j][0], standings[i][1] += score[name_1][j][1];
  354. }
  355. }
  356. }
  357. standings.sort(function (a, b) {
  358. return a[0] != b[0] ? b[0] - a[0] : a[1] - b[1];
  359. });
  360. for (var i = 0; i < Usersum; i++) {
  361. if (!i || standings[i][0] != standings[i - 1][0] || standings[i][1] != standings[i - 1][1]) {
  362. standings[i][3] = i + 1;
  363. }
  364. else {
  365. standings[i][3] = standings[i - 1][3];
  366. }
  367. }
  368. var tableBefore = document.querySelector('div.table-responsive');
  369. if (tableBefore && tableBefore.children[0]) {
  370. var ScrollRight = parseInt(window.getComputedStyle(tableBefore.children[0]).width) - tableBefore.scrollLeft;
  371. showStandings();
  372. ShowStandings();
  373. var tableAfter = document.querySelector('div.table-responsive');
  374. if (tableAfter && tableAfter.children[0]) {
  375. tableAfter.scrollLeft = parseInt(window.getComputedStyle(tableAfter.children[0]).width) - ScrollRight;
  376. }
  377. }
  378. }
  379. function NavBar(ProblemSum) {
  380. var navtabs = document.querySelector('div.uoj-content ul[role=tablist]');
  381. if (!navtabs) {
  382. return;
  383. }
  384. var navbar = document.createElement('div');
  385. navtabs.before(navbar);
  386. navbar.setAttribute('style', variables_1.Darktheme ? 'border-bottom: 1px solid #2e2e30;' : 'border-bottom: 1px solid #dee2e6;');
  387. var floatright = document.createElement('div');
  388. navbar.appendChild(floatright);
  389. floatright.setAttribute('class', 'float-right');
  390. var unselectall = document.createElement('a');
  391. floatright.appendChild(unselectall);
  392. unselectall.setAttribute('class', 'btn btn-info btn-sm');
  393. unselectall.setAttribute('target', '_blank');
  394. unselectall.style.color = '#fff';
  395. unselectall.style.cursor = 'pointer';
  396. unselectall.addEventListener('click', function () {
  397. Problemchecked = new Array(ProblemSum).fill(true);
  398. displayStandings();
  399. });
  400. unselectall.innerHTML = '全选';
  401. var selectall = document.createElement('a');
  402. floatright.appendChild(selectall);
  403. selectall.setAttribute('class', 'btn btn-primary btn-sm');
  404. selectall.setAttribute('target', '_blank');
  405. selectall.style.color = '#fff';
  406. selectall.style.cursor = 'pointer';
  407. selectall.addEventListener('click', function () {
  408. Problemchecked = new Array(ProblemSum).fill(false);
  409. displayStandings();
  410. });
  411. selectall.innerHTML = '全不选';
  412. navbar.appendChild(navtabs);
  413. navtabs.setAttribute('style', 'border-bottom: none');
  414. }
  415. function ContestStandings() {
  416. GM_addStyle("\ndiv#standings > div.table-responsive > table > thead > tr > th:nth-child(-n+3)::before,\ndiv#standings > div.table-responsive > table > tbody > tr > td:nth-child(-n+3)::before {\n content: \"\";\n position: absolute;\n top: 0;\n right: 100%;\n width: 1px;\n height: 100%;\n background-color: ".concat(variables_1.Darktheme ? '#2e2e30' : '#dee2e6', ";\n}\n\ndiv#standings > div.table-responsive > table > thead > tr > th.checked, \ndiv#standings > div.table-responsive > table > tbody > tr:nth-of-type(even) > td.checked {\n background-color: ").concat(variables_1.Darktheme ? '#192523' : '#F4FFFF', ";\n}\ndiv#standings > div.table-responsive > table > tbody > tr:nth-of-type(odd) > td.checked {\n background-color: ").concat(variables_1.Darktheme ? '#1F2B29' : '#F0FFFF', ";\n}\n\n"));
  417. var ProblemSum = document.querySelectorAll('div#standings > div.table-responsive > table > thead > tr > th').length - 3;
  418. Problemchecked = new Array(ProblemSum).fill(true);
  419. displayStandings();
  420. NavBar(ProblemSum);
  421. }
  422. exports.ContestStandings = ContestStandings;
  423.  
  424.  
  425. /***/ }),
  426.  
  427. /***/ 992:
  428. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  429.  
  430.  
  431. Object.defineProperty(exports, "__esModule", ({ value: true }));
  432. exports.DiscussionCard = void 0;
  433. var variables_1 = __webpack_require__(449);
  434. var variables_2 = __webpack_require__(449);
  435. function DiscussionCard() {
  436. var _a;
  437. var footer = document.querySelector('div.uoj-footer');
  438. if (footer) {
  439. var discrd = document.createElement('div');
  440. discrd.setAttribute('class', 'giscus');
  441. footer.insertBefore(discrd, footer.firstChild);
  442. var writebutton = document.createElement('button');
  443. writebutton.setAttribute('class', 'btn btn-search btn-outline-primary');
  444. writebutton.style.height = 'calc(1.5em + 0.75rem + 2px)';
  445. writebutton.innerHTML = '<i class="fa fa-pen"> 写评论';
  446. writebutton.onclick = function () {
  447. $("html, body").animate({ scrollTop: $(document).height() }, "slow");
  448. };
  449. footer.insertBefore(writebutton, discrd);
  450. GM_addElement('script', {
  451. 'src': 'https://giscus.app/client.js',
  452. 'data-repo': 'Ex124OJ/Ex124OJ-discussions',
  453. 'data-repo-id': 'R_kgDOImiZLA',
  454. 'data-category': 'Ideas',
  455. 'data-category-id': 'DIC_kwDOImiZLM4CTCIj',
  456. 'data-mapping': 'pathname',
  457. 'data-strict': '1',
  458. 'data-reactions-enabled': '1',
  459. 'data-emit-metadata': '0',
  460. 'data-input-position': 'bottom',
  461. 'data-theme': variables_2.Darktheme ? 'noborder_dark' : 'light',
  462. 'data-lang': 'zh-CN',
  463. 'data-loading': 'lazy',
  464. 'crossorigin': 'anonymous',
  465. 'async': ''
  466. });
  467. GM_addStyle("\n.giscus {\n display: ".concat((variables_1.Academic == true ? 'none' : 'unset'), ";\n}\n.giscus-frame {\n margin-top: 20px;\n}\n "));
  468. var lanButton = document.getElementsByClassName('btn-group dropright mb-3')[0];
  469. var blankLine = document.createElement('div');
  470. blankLine.style.marginTop = '20px';
  471. (_a = lanButton.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(blankLine, lanButton);
  472. }
  473. }
  474. exports.DiscussionCard = DiscussionCard;
  475.  
  476.  
  477. /***/ }),
  478.  
  479. /***/ 18:
  480. /***/ ((__unused_webpack_module, exports) => {
  481.  
  482.  
  483. Object.defineProperty(exports, "__esModule", ({ value: true }));
  484. exports.changeGravatarURL = void 0;
  485. function changeGravatarURL() {
  486. var GravatarURLRegExp = /\/\/cn.gravatar.com\/avatar\/(.*)/;
  487. var Gravatars = document.querySelectorAll('img');
  488. for (var i in Gravatars) {
  489. if (Gravatars[i] && Gravatars[i].nodeType
  490. && GravatarURLRegExp.test(Gravatars[i].getAttribute('src'))
  491. && Gravatars[i].getAttribute('alt').toLowerCase().includes('avatar')) {
  492. Gravatars[i].setAttribute('src', '//cravatar.cn/avatar/' + Gravatars[i].getAttribute('src').match(GravatarURLRegExp)[1]);
  493. }
  494. }
  495. }
  496. exports.changeGravatarURL = changeGravatarURL;
  497.  
  498.  
  499. /***/ }),
  500.  
  501. /***/ 819:
  502. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  503.  
  504.  
  505. //@ts-nocheck
  506. Object.defineProperty(exports, "__esModule", ({ value: true }));
  507. exports.NameStyle = void 0;
  508. var variables_1 = __webpack_require__(449);
  509. var ccfbadgecode = function (color) { return "<svg width=\"1em\" height=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1600.000000 1600.000000\" style=\"margin-bottom:.25em!important;bottom:10px;--fa-badge-color:".concat(color, ";\"><g transform=\"translate(0.000000,1600.000000) scale(0.100000,-0.100000)\" fill=\"var(--fa-badge-color)\" stroke=\"none\"><path d=\"M7757 15990 c-453 -44 -890 -196 -1257 -437 -187 -124 -312 -227 -470 -390 -247 -253 -426 -521 -560 -839 -24 -54 -44 -101 -46 -103 -2 -2 -38 11 -81 29 -515 216 -1090 266 -1648 145 -505 -110 -976 -368 -1348 -739 -432 -430 -700 -976 -789 -1606 -20 -144 -17 -565 5 -710 38 -242 96 -459 179 -663 22 -54 38 -100 37 -101 -2 -2 -53 -24 -114 -50 -308 -131 -580 -314 -834 -561 -443 -432 -716 -972 -808 -1600 -24 -168 -24 -562 0 -730 92 -626 365 -1168 803 -1595 153 -149 248 -226 407 -331 142 -95 285 -172 432 -235 61 -26 112 -48 114 -50 1 -1 -15 -47 -37 -101 -83 -204 -141 -421 -179 -663 -22 -144 -25 -567 -5 -705 49 -342 131 -609 273 -895 377 -758 1084 -1298 1914 -1465 216 -43 290 -50 550 -50 187 1 279 5 365 18 242 38 459 96 663 179 54 22 100 38 101 37 2 -2 22 -49 46 -103 141 -334 319 -596 585 -862 238 -238 449 -391 730 -529 853 -418 1839 -373 2649 120 236 143 496 367 678 585 158 188 317 447 414 675 26 61 48 111 49 113 2 2 54 -17 117 -42 209 -83 440 -143 683 -178 120 -17 552 -17 670 0 50 7 144 24 210 37 1083 217 1932 1066 2150 2150 43 216 50 290 50 550 -1 187 -5 279 -18 365 -38 242 -96 459 -179 663 -22 54 -38 100 -37 101 2 2 49 22 103 46 334 141 596 319 862 585 172 172 247 263 368 447 596 907 592 2106 -12 3013 -123 185 -222 304 -388 465 -243 236 -538 431 -841 556 -48 20 -90 38 -92 39 -1 2 15 48 37 102 83 204 141 421 179 663 22 144 25 567 5 705 -49 340 -132 610 -273 895 -377 756 -1085 1299 -1909 1464 -222 45 -294 51 -555 51 -187 -1 -279 -5 -365 -18 -242 -38 -459 -96 -663 -179 -54 -22 -100 -38 -101 -37 -2 2 -22 49 -45 104 -202 478 -572 926 -1002 1211 -343 227 -723 374 -1125 434 -157 24 -501 34 -647 20z m2823 -5244 c44 -22 139 -112 492 -469 472 -477 489 -497 503 -614 8 -64 -15 -162 -53 -219 -38 -58 -4132 -4121 -4198 -4166 -64 -44 -145 -63 -223 -54 -126 15 -95 -12 -959 858 -438 442 -988 997 -1223 1233 -491 494 -484 484 -484 635 0 153 -10 140 498 642 512 507 507 503 657 503 152 -1 109 35 878 -740 l679 -685 1522 1510 c837 830 1537 1521 1556 1536 64 48 121 65 215 61 69 -3 96 -9 140 -31z\"/></g></svg>"); };
  510. var ffcbadgecode = function (color) { return "<svg width=\"1em\" height=\"1em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1600.000000 1600.000000\" style=\"margin-bottom:.25em!important;bottom:10px;--fa-badge-color:".concat(color, ";\"><g transform=\"translate(0.000000,1600.000000) scale(0.100000,-0.100000)\" fill=\"var(--fa-badge-color)\" stroke=\"none\"><path d=\"M7757 15990 c-453 -44 -890 -196 -1257 -437 -187 -124 -312 -227 -470 -390 -247 -253 -426 -521 -560 -839 -24 -54 -44 -101 -46 -103 -2 -2 -38 11 -81 29 -515 216 -1090 266 -1648 145 -505 -110 -976 -368 -1348 -739 -432 -430 -700 -976 -789 -1606 -20 -144 -17 -565 5 -710 38 -242 96 -459 179 -663 22 -54 38 -100 37 -101 -2 -2 -53 -24 -114 -50 -308 -131 -580 -314 -834 -561 -443 -432 -716 -972 -808 -1600 -24 -168 -24 -562 0 -730 92 -626 365 -1168 803 -1595 153 -149 248 -226 407 -331 142 -95 285 -172 432 -235 61 -26 112 -48 114 -50 1 -1 -15 -47 -37 -101 -83 -204 -141 -421 -179 -663 -22 -144 -25 -567 -5 -705 49 -342 131 -609 273 -895 377 -758 1084 -1298 1914 -1465 216 -43 290 -50 550 -50 187 1 279 5 365 18 242 38 459 96 663 179 54 22 100 38 101 37 2 -2 22 -49 46 -103 141 -334 319 -596 585 -862 238 -238 449 -391 730 -529 853 -418 1839 -373 2649 120 236 143 496 367 678 585 158 188 317 447 414 675 26 61 48 111 49 113 2 2 54 -17 117 -42 209 -83 440 -143 683 -178 120 -17 552 -17 670 0 50 7 144 24 210 37 1083 217 1932 1066 2150 2150 43 216 50 290 50 550 -1 187 -5 279 -18 365 -38 242 -96 459 -179 663 -22 54 -38 100 -37 101 2 2 49 22 103 46 334 141 596 319 862 585 172 172 247 263 368 447 596 907 592 2106 -12 3013 -123 185 -222 304 -388 465 -243 236 -538 431 -841 556 -48 20 -90 38 -92 39 -1 2 15 48 37 102 83 204 141 421 179 663 22 144 25 567 5 705 -49 340 -132 610 -273 895 -377 756 -1085 1299 -1909 1464 -222 45 -294 51 -555 51 -187 -1 -279 -5 -365 -18 -242 -38 -459 -96 -663 -179 -54 -22 -100 -38 -101 -37 -2 2 -22 49 -45 104 -202 478 -572 926 -1002 1211 -343 227 -723 374 -1125 434 -157 24 -501 34 -647 20z m-1670 -4681 c55 -20 88 -51 573 -533 283 -282 722 -718 976 -970 l461 -457 794 787 c437 434 869 863 961 954 184 182 245 223 343 235 75 10 175 -15 237 -58 25 -17 239 -228 475 -467 323 -328 435 -447 453 -485 21 -42 25 -65 25 -145 0 -82 -4 -103 -27 -152 -28 -60 18 -13 -1506 -1538 l-454 -455 793 -800 c436 -440 868 -875 959 -967 182 -184 223 -245 235 -343 10 -75 -15 -175 -58 -237 -17 -25 -228 -239 -467 -475 -328 -323 -447 -435 -485 -453 -42 -21 -65 -25 -145 -25 -82 0 -103 4 -152 27 -60 28 -14 -17 -1539 1507 l-456 456 -544 -535 c-299 -294 -737 -726 -974 -961 -336 -333 -441 -430 -479 -448 -101 -46 -213 -46 -311 0 -56 26 -88 57 -582 559 -340 345 -372 380 -391 433 -29 78 -30 185 -1 264 20 55 51 88 533 573 282 283 719 723 971 977 l458 462 -529 538 c-291 296 -720 732 -955 968 -333 336 -430 441 -448 479 -46 101 -46 213 0 311 26 56 57 88 559 582 335 330 381 372 430 391 76 29 189 29 267 1z\"/></g></svg>"); };
  511. var tagbadgecode = function (color, text) { return "<span style=\"background-color:".concat(color, ";padding:0.2em 0.6em;border-radius:.2em;color:#fff;font-size:0.7em;font-weight:bold;display:inline-block\">").concat(text, "</span>"); };
  512. function getUserLink_Ex124OJ(username, rating, addSymbol) {
  513. if (!username) {
  514. return '';
  515. }
  516. if (addSymbol == undefined) {
  517. addSymbol = true;
  518. }
  519. var text = username, at, color = getColOfRating(rating);
  520. if (username.charAt(0) == '@') {
  521. at = true;
  522. username = username.substr(1);
  523. }
  524. if (variables_1.NameColorList && variables_1.NameColorList[username]) {
  525. text = '';
  526. for (var char = 1; char < variables_1.NameColorList[username].length; char++) {
  527. text += "<font style=\"color:".concat(variables_1.NameColorList[username][char], "\">").concat(username.substring(char - 1, char), "</font>");
  528. }
  529. text += username.substring(variables_1.NameColorList[username].length - 1);
  530. if (at)
  531. text = '@' + text;
  532. color = variables_1.NameColorList[username][0];
  533. }
  534. if (variables_1.CCFBadgeList && variables_1.CCFBadgeList[username]) {
  535. for (var j in variables_1.CCFBadgeList[username]) {
  536. text += " ".concat(ccfbadgecode(variables_1.CCFBadgeList[username][j]));
  537. }
  538. }
  539. if (variables_1.FFCBadgeList && variables_1.FFCBadgeList[username]) {
  540. for (var j in variables_1.FFCBadgeList[username]) {
  541. text += " ".concat(ffcbadgecode(variables_1.FFCBadgeList[username][j]));
  542. }
  543. }
  544. if (variables_1.TagBadgeList && variables_1.TagBadgeList[username]) {
  545. for (var j in variables_1.TagBadgeList[username]) {
  546. text += " ".concat(tagbadgecode(variables_1.TagBadgeList[username][j].color, variables_1.TagBadgeList[username][j].text));
  547. }
  548. }
  549. if (addSymbol) {
  550. if (rating >= 2500) {
  551. text += '<sup>';
  552. for (var i = 2500; i <= rating; i += 200) {
  553. text += "&alefsym;";
  554. }
  555. text += "</sup>";
  556. }
  557. }
  558. return '<a class="uoj-username" href="' + uojHome + '/user/profile/' + username + '" style="color:' + color + '">' + text + '</a>';
  559. }
  560. function getUserSpan_Ex124OJ(username, rating, addSymbol) {
  561. if (!username) {
  562. return '';
  563. }
  564. if (addSymbol == undefined) {
  565. addSymbol = true;
  566. }
  567. var text = username, at, color = getColOfRating(rating);
  568. if (username.charAt(0) == '@') {
  569. at = true;
  570. username = username.substr(1);
  571. }
  572. if (variables_1.NameColorList && variables_1.NameColorList[username]) {
  573. text = '';
  574. for (var char = 1; char < variables_1.NameColorList[username].length; char++) {
  575. text += "<font style=\"color:".concat(variables_1.NameColorList[username][char], "\">").concat(username.substring(char - 1, char), "</font>");
  576. }
  577. text += username.substring(variables_1.NameColorList[username].length - 1);
  578. if (at)
  579. text = '@' + text;
  580. color = variables_1.NameColorList[username][0];
  581. }
  582. if (variables_1.CCFBadgeList && variables_1.CCFBadgeList[username]) {
  583. for (var j in variables_1.CCFBadgeList[username]) {
  584. text += " ".concat(ccfbadgecode(variables_1.CCFBadgeList[username][j]));
  585. }
  586. }
  587. if (variables_1.FFCBadgeList && variables_1.FFCBadgeList[username]) {
  588. for (var j in variables_1.FFCBadgeList[username]) {
  589. text += " ".concat(ffcbadgecode(variables_1.FFCBadgeList[username][j]));
  590. }
  591. }
  592. if (variables_1.TagBadgeList && variables_1.TagBadgeList[username]) {
  593. for (var j in variables_1.TagBadgeList[username]) {
  594. text += " ".concat(tagbadgecode(variables_1.TagBadgeList[username][j].color, variables_1.TagBadgeList[username][j].text));
  595. }
  596. }
  597. if (addSymbol) {
  598. if (rating >= 2500) {
  599. text += '<sup>';
  600. for (var i = 2500; i <= rating; i += 200) {
  601. text += "&alefsym;";
  602. }
  603. text += "</sup>";
  604. }
  605. }
  606. return '<span class="uoj-username" style="color:' + color + '">' + text + '</span>';
  607. }
  608. function uoj_honor_Ex124OJ() {
  609. return this.each(function () {
  610. var honor = $(this).text();
  611. var rating = $(this).data("rating");
  612. if (isNaN(rating)) {
  613. return;
  614. }
  615. var text = honor, color = getColOfRating(rating);
  616. if (variables_1.NameColorList && variables_1.NameColorList[honor]) {
  617. text = '';
  618. for (var char = 1; char < variables_1.NameColorList[honor].length; char++) {
  619. text += "<font style=\"color:".concat(variables_1.NameColorList[honor][char], "\">").concat(honor.substring(char - 1, char), "</font>");
  620. }
  621. text += honor.substring(variables_1.NameColorList[honor].length - 1);
  622. color = variables_1.NameColorList[honor][0];
  623. }
  624. if (variables_1.CCFBadgeList && variables_1.CCFBadgeList[honor]) {
  625. for (var j in variables_1.CCFBadgeList[honor]) {
  626. text += " ".concat(ccfbadgecode(variables_1.CCFBadgeList[honor][j]));
  627. }
  628. }
  629. if (variables_1.FFCBadgeList && variables_1.FFCBadgeList[honor]) {
  630. for (var j in variables_1.FFCBadgeList[honor]) {
  631. text += " ".concat(ffcbadgecode(variables_1.FFCBadgeList[honor][j]));
  632. }
  633. }
  634. if (variables_1.TagBadgeList && variables_1.TagBadgeList[honor]) {
  635. for (var j in variables_1.TagBadgeList[honor]) {
  636. text += " ".concat(tagbadgecode(variables_1.TagBadgeList[honor][j].color, variables_1.TagBadgeList[honor][j].text));
  637. }
  638. }
  639. if (rating >= 2500) {
  640. text += '<sup>';
  641. for (var i = 2500; i <= rating; i += 200) {
  642. text += "&alefsym;";
  643. }
  644. text += "</sup>";
  645. }
  646. $(this).css("color", color).html(text);
  647. });
  648. }
  649. function launchNameStyle() {
  650. var _a, _b;
  651. unsafeWindow.getUserLink = getUserLink_Ex124OJ;
  652. unsafeWindow.getUserSpan = getUserSpan_Ex124OJ;
  653. (_b = (_a = unsafeWindow.$) === null || _a === void 0 ? void 0 : _a.fn) === null || _b === void 0 ? void 0 : _b.uoj_honor = uoj_honor_Ex124OJ;
  654. }
  655. function NameStyle() {
  656. unsafeWindow.launchNameStyle = launchNameStyle;
  657. var script = document.createElement('script');
  658. script.setAttribute('type', 'text/javascript');
  659. script.innerHTML = "\n launchNameStyle();\n ";
  660. document.head.appendChild(script);
  661. $(document).ready(function () {
  662. launchNameStyle();
  663. });
  664. }
  665. exports.NameStyle = NameStyle;
  666.  
  667.  
  668. /***/ }),
  669.  
  670. /***/ 823:
  671. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  672.  
  673.  
  674. Object.defineProperty(exports, "__esModule", ({ value: true }));
  675. exports.Problem = void 0;
  676. var utils_1 = __webpack_require__(593);
  677. var variables_1 = __webpack_require__(449);
  678. var code_1 = __webpack_require__(480);
  679. function appendsource() {
  680. var mathjaxconfig = document.createElement('script');
  681. mathjaxconfig.type = 'text/x-mathjax-config';
  682. mathjaxconfig.innerHTML = "\n MathJax.Hub.Config({\n showProcessingMessages: false,\n tex2jax: {\n inlineMath: [[\"$\", \"$\"], [\"\\\\(\", \"\\\\)\"]],\n processEscapes:true\n },\n menuSettings: {\n zoom: \"Hover\"\n }\n });\n ";
  683. document.head.appendChild(mathjaxconfig);
  684. var mathjax = document.createElement('script');
  685. mathjax.src = '//cdn.bootcss.com/mathjax/2.6.0/MathJax.js?config=TeX-AMS_HTML';
  686. document.head.appendChild(mathjax);
  687. var jquery = document.createElement('script');
  688. jquery.src = 'http://124.221.194.184/js/jquery.form.min.js';
  689. document.head.appendChild(jquery);
  690. var shtypical = document.createElement('link');
  691. shtypical.type = 'text/css';
  692. shtypical.rel = 'stylesheet';
  693. shtypical.href = 'http://124.221.194.184/css/sh_typical.min.css';
  694. document.head.append(shtypical);
  695. var shmain = document.createElement('script');
  696. shmain.src = 'http://124.221.194.184/js/sh_main.min.js';
  697. document.head.appendChild(shmain);
  698. shmain.addEventListener('load', function () {
  699. sh_highlightDocument();
  700. });
  701. }
  702. function Problem() {
  703. GM_addStyle("\n.partly-hidden {\n transition: opacity 125ms;\n}\n.partly-hidden:not(:hover) {\n opacity: 0;\n}\n ");
  704. var uojcontent = document.querySelector('div.uoj-content');
  705. if (!uojcontent) {
  706. return;
  707. }
  708. if (!uojcontent.querySelectorAll('.page-header').length) {
  709. var lostpage_1 = document.body.innerHTML;
  710. uojcontent.innerHTML = "\n<div class=\"row d-flex justify-content-center\">\n <span class=\"badge badge-secondary mr-1\" id=\"time-limit\">\u65F6\u95F4\u9650\u5236:</span>\n <span class=\"badge badge-secondary mr-1\" id=\"memory-limit\">\u7A7A\u95F4\u9650\u5236:</span>\n</div>\n<div class=\"float-right\">\n <div class=\"uoj-click-zan-block\" id=\"vote\"></div>\n</div>\n".concat((function () {
  711. if ((0, utils_1.isProblem)()[2]) {
  712. return "\n<div class=\"page-header row\">\n <h1 class=\"col-md-3 text-left\" id=\"contest-name\"><small></small></h1>\n <h1 class=\"col-md-7 text-center\" id=\"problem-name\"></h1>\n <div class=\"col-md-2 text-right\" id=\"contest-countdown\"></div>\n</div>\n ";
  713. }
  714. else {
  715. return "<h1 class=\"page-header text-center\" id=\"problem-name\"></h1>";
  716. }
  717. })(), "\n<a role=\"button\" class=\"btn btn-info float-right\" href=\"").concat((0, utils_1.isProblem)()[2] ? "/contest/".concat((0, utils_1.isProblem)()[2]) : '', "/problem/").concat((0, utils_1.isProblem)()[3], "/statistics\"><span class=\"glyphicon glyphicon-stats\"></span> \u7EDF\u8BA1</a>\n\n<ul class=\"nav nav-tabs\" role=\"tablist\">\n <li class=\"nav-item\"><a class=\"nav-link active\" href=\"#tab-statement\" role=\"tab\" data-toggle=\"tab\"><span class=\"glyphicon glyphicon-book\"></span> \u63CF\u8FF0</a></li>\n ").concat((0, utils_1.isProblem)()[2] ? "<li class=\"nav-item\"><a class=\"nav-link\" id=\"nav-contest\" href=\"/contest/".concat((0, utils_1.isProblem)()[2], "\" role=\"tab\">\u8FD4\u56DE\u6BD4\u8D5B</a></li>") : '', "\n</ul>\n<div class=\"tab-content\">\n <div class=\"tab-pane active\" id=\"tab-statement\">\n </div>\n</div>");
  718. GM_xmlhttpRequest({
  719. method: "GET",
  720. url: "https://ex124oj.pond.ink/api".concat((0, utils_1.isProblem)()[2] ? "/contest/".concat((0, utils_1.isProblem)()[2]) : '', "/problem/").concat((0, utils_1.isProblem)()[3]),
  721. nocache: true,
  722. onload: function (data) {
  723. if (data.status == 200) {
  724. var res = JSON.parse(data.response);
  725. var title = document.querySelector('head > title');
  726. if (title && res.title) {
  727. title.innerHTML = res.title;
  728. }
  729. var problename = document.querySelector('#problem-name');
  730. if (problename && res.problemname) {
  731. problename.innerHTML = res.problemname;
  732. }
  733. var contestname = document.querySelector('#contest-name');
  734. if (contestname && res.contestname) {
  735. contestname.innerHTML = res.contestname;
  736. }
  737. var statement = document.querySelector('#tab-statement');
  738. if (statement && res.statement) {
  739. statement.innerHTML = res.statement;
  740. }
  741. var timelimit = document.querySelector('#time-limit');
  742. if (timelimit && res.timelimit) {
  743. timelimit.innerHTML = res.timelimit;
  744. }
  745. var memorylimit = document.querySelector('#memory-limit');
  746. if (memorylimit && res.memorylimit) {
  747. memorylimit.innerHTML = res.memorylimit;
  748. }
  749. var vote = document.querySelector('#vote');
  750. if (vote && res.vote) {
  751. vote.innerHTML = res.vote;
  752. eval('$(".uoj-click-zan-block").click_zan_block();');
  753. }
  754. var countdown = document.querySelector('#contest-countdown');
  755. if (countdown && res.script) {
  756. eval(res.script);
  757. }
  758. appendsource();
  759. (0, code_1.CodeCopy)();
  760. }
  761. else {
  762. document.body.innerHTML = lostpage_1;
  763. }
  764. }
  765. });
  766. }
  767. var tabcontent = document.querySelector('div.tab-content');
  768. if (tabcontent) {
  769. var navbar = document.createElement('div');
  770. tabcontent.before(navbar);
  771. navbar.setAttribute('style', 'border-bottom: 1px solid ' + (variables_1.Darktheme ? '#2e2e30' : '#dee2e6;'));
  772. var statisticsButton = document.querySelector('div.uoj-content > a[role=button]');
  773. if (statisticsButton)
  774. navbar.appendChild(statisticsButton);
  775. var DownloadTag = document.createElement('a');
  776. navbar.appendChild(DownloadTag);
  777. DownloadTag.setAttribute('role', 'button');
  778. DownloadTag.setAttribute('class', 'btn btn-primary float-right partly-hidden');
  779. DownloadTag.setAttribute('href', '/download.php?type=problem&id=' + (0, utils_1.isProblem)()[3]);
  780. DownloadTag.setAttribute('target', '_blank');
  781. DownloadTag.innerHTML = '<span class="glyphicon glyphicon-download-alt"></span> 下载数据';
  782. var navtabs = document.querySelector('div.uoj-content > ul[role=tablist]');
  783. if (navtabs) {
  784. navbar.appendChild(navtabs);
  785. navtabs.setAttribute('style', 'border-bottom: none');
  786. var TJTag = document.createElement('li');
  787. navtabs.insertBefore(TJTag, null);
  788. TJTag.setAttribute('class', 'nav-item partly-hidden');
  789. var TJInnerTag = document.createElement('a');
  790. TJTag.appendChild(TJInnerTag);
  791. TJInnerTag.setAttribute('role', 'tab');
  792. TJInnerTag.setAttribute('class', 'nav-link');
  793. TJInnerTag.setAttribute('href', '/download.php?type=tj&id=' + (0, utils_1.isProblem)()[3]);
  794. TJInnerTag.innerHTML = '<span class="glyphicon glyphicon-book"></span> 题解';
  795. }
  796. }
  797. }
  798. exports.Problem = Problem;
  799.  
  800.  
  801. /***/ }),
  802.  
  803. /***/ 310:
  804. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  805.  
  806.  
  807. Object.defineProperty(exports, "__esModule", ({ value: true }));
  808. exports.Settings = void 0;
  809. var variables_1 = __webpack_require__(449);
  810. function Settings() {
  811. GM_addStyle("\n.settings-overlay {\n position: fixed;\n height: 100%;\n width: 100%;\n transition: visibility 0.4s, background 0.4s;\n top: 0;\n left: 0;\n visibility: hidden;\n z-index: 229;\n}\n.settings-popup-active .settings-overlay {\n background: ".concat(variables_1.Darktheme ? 'rgb(255,255,255,.3)' : 'rgb(0,0,0,.3)', ";\n visibility: visible;\n}\n.settings-popup {\n width: 60%;\n position: relative;\n transform: translate(-50%, -50%);\n top: 50%;\n left: 50%;\n visibility: hidden;\n border-radius: .5rem;\n padding: 20px 20px;\n}\n.settings-popup-active .settings-overlay .settings-popup {\n background: ").concat(variables_1.Darktheme ? '#222' : '#ffffff', ";\n visibility: visible;\n}\n.settings-popup .row {\n padding: 0 30px 30px;\n}\n.settings-popup .row * {\n margin-bottom: 0;\n}\n.settings-titlebar {\n padding: 10px 20px 30px 20px !important;\n}\n.settings-titlebar h4 {\n position: relative;\n top: 50%;\n left: 0;\n transform: translate(0, -50%);\n}\n.settings-footerbar {\n height: 60px;\n padding: 20px 20px;\n}\n.switch {\n position: relative;\n vertical-align: middle;\n width: 60px;\n height: 28px;\n}\n.switch input {\n opacity: 0;\n width: 0;\n height: 0;\n}\n.settings-popup-active .slider {\n position: absolute;\n visibility: visible;\n cursor: pointer;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: ").concat(variables_1.Darktheme ? '#333' : '#ccc', ";\n transition: background-color .4s;\n transition: visiblility 0s;\n border-radius: 28px;\n}\n.settings-popup-active .slider:before {\n position: absolute;\n visibility: visible;\n content: \"\";\n height: 20px;\n width: 20px;\n left: 4px;\n bottom: 4px;\n background-color: ").concat(variables_1.Darktheme ? '#222' : '#ffffff', ";\n transition: .4s;\n border-radius: 50%;\n}\ninput:checked + .slider {\n background-color: #28ADCA;\n}\ninput:checked + .slider:before {\n transform: translateX(32px);\n}"));
  812. var HomepageEntrance = document.createElement('li');
  813. var NavBarTablist = document.querySelector('div[role=main] > div > ul[role=tablist]');
  814. NavBarTablist.insertBefore(HomepageEntrance, NavBarTablist.firstChild);
  815. HomepageEntrance.setAttribute('class', 'nav-item');
  816. HomepageEntrance.innerHTML = '<span style="padding: 0.5rem 1rem; cursor:pointer"><span style="background-color: #28adca;padding:0.2em 0.6em;border-radius: 1em;color:#fff;font-size: 0.7em;font-weight:bold;display:inline-block;position: relative;top: 50%;transform: translate(0,-50%);">Ex124OJ</span></span>';
  817. HomepageEntrance.onclick = function () {
  818. document.body.setAttribute('class', 'settings-popup-active');
  819. };
  820. var SettingsOverlay = document.createElement('div');
  821. document.body.insertBefore(SettingsOverlay, document.body.firstChild);
  822. SettingsOverlay.setAttribute('class', 'settings-overlay');
  823. var SettingsPopup = document.createElement('div');
  824. SettingsOverlay.appendChild(SettingsPopup);
  825. SettingsPopup.setAttribute('class', 'settings-popup');
  826. var SettingsTitlebar = document.createElement('div');
  827. SettingsPopup.appendChild(SettingsTitlebar);
  828. SettingsTitlebar.setAttribute('class', 'row settings-titlebar');
  829. SettingsTitlebar.innerHTML = '<h3 style="width:100%;height:3.5rem"><img src="https://ex124oj.pond.ink/images/icon.png" style="height:3.5rem;width:3.5rem;margin-right:10px"><span style="vertical-align:middle"> Ex124OJ 控制面板</span> <span style="vertical-align:middle;cursor:pointer;margin:0 10px" onclick="window.open(\'https://ex124oj.pond.ink/\');"><span style="height:1.75rem;line-height:3.5rem;vertical-align:middle;padding:0 .5rem;background-color:#28adca;border-radius:1em;color:#fff;font-size:1.2rem;font-weight:bold">Ex124OJ</span></span><span style="color:#7f7f7f;line-height:3.5rem;vertical-align:middle;font-size:1.2rem">' + variables_1.version + '</span></h3>';
  830. var SettingsCloseButton = document.createElement('span');
  831. SettingsPopup.appendChild(SettingsCloseButton);
  832. SettingsCloseButton.setAttribute('style', 'position: fixed;right: 20px;top:20px;cursor: pointer');
  833. SettingsCloseButton.setAttribute('onclick', 'document.body.setAttribute(\'class\', \'\');');
  834. SettingsCloseButton.innerHTML = '<h4><i class="fa fa-xmark"></i></h4>';
  835. var background = document.createElement('div');
  836. SettingsPopup.appendChild(background);
  837. background.setAttribute('class', 'row');
  838. var backgroundImageLabel = document.createElement('strong');
  839. background.appendChild(backgroundImageLabel);
  840. backgroundImageLabel.setAttribute('style', 'font-size: 1.25em');
  841. backgroundImageLabel.innerHTML = '背景图片&emsp;&emsp;&emsp;&emsp;';
  842. var backgroundImageInput = document.createElement('input');
  843. background.appendChild(backgroundImageInput);
  844. backgroundImageInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: initial');
  845. backgroundImageInput.setAttribute('class', 'form-control');
  846. var siteIcon = document.createElement('div');
  847. SettingsPopup.appendChild(siteIcon);
  848. siteIcon.setAttribute('class', 'row');
  849. var siteIconImageLabel = document.createElement('strong');
  850. siteIcon.appendChild(siteIconImageLabel);
  851. siteIconImageLabel.setAttribute('style', 'font-size: 1.25em');
  852. siteIconImageLabel.innerHTML = '网站图标&emsp;&emsp;&emsp;&emsp;';
  853. var siteIconImageInput = document.createElement('input');
  854. siteIcon.appendChild(siteIconImageInput);
  855. siteIconImageInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: initial');
  856. siteIconImageInput.setAttribute('class', 'form-control');
  857. var Switchs = document.createElement('div');
  858. SettingsPopup.appendChild(Switchs);
  859. Switchs.setAttribute('class', 'row');
  860. var academic = document.createElement('div');
  861. Switchs.appendChild(academic);
  862. var academicLabel = document.createElement('strong');
  863. academic.appendChild(academicLabel);
  864. academicLabel.setAttribute('style', 'font-size: 1.25em; vertical-align: middle;');
  865. academicLabel.innerHTML = '学术模式&emsp;&emsp;&emsp;&emsp;';
  866. var academicSwitch = document.createElement('label');
  867. academicSwitch.className = 'switch';
  868. academic.appendChild(academicSwitch);
  869. academicSwitch.innerHTML = '<input type="checkbox" id="AcademicSwitch" style="display: none;">\n<i id="AcademicSwitchIcon" class="slider"></i>';
  870. {
  871. var space = document.createElement('p');
  872. Switchs.appendChild(space);
  873. space.innerHTML = '&emsp;&emsp;&emsp;&emsp;';
  874. }
  875. var ligatures = document.createElement('div');
  876. Switchs.appendChild(ligatures);
  877. var ligaturesLabel = document.createElement('strong');
  878. ligatures.appendChild(ligaturesLabel);
  879. ligaturesLabel.setAttribute('style', 'font-size: 1.25em; vertical-align: middle;');
  880. ligaturesLabel.innerHTML = '代码连字&emsp;&emsp;&emsp;&emsp;';
  881. var ligaturesSwitch = document.createElement('label');
  882. ligaturesSwitch.className = 'switch';
  883. ligatures.appendChild(ligaturesSwitch);
  884. ligaturesSwitch.innerHTML = '<input type="checkbox" id="LigaturesSwitch" style="display: none;">\n<i id="LigaturesSwitchIcon" class="slider"></i>';
  885. {
  886. var space = document.createElement('p');
  887. Switchs.appendChild(space);
  888. space.innerHTML = '&emsp;&emsp;&emsp;&emsp;';
  889. }
  890. var darktheme = document.createElement('div');
  891. Switchs.appendChild(darktheme);
  892. var darkthemeLabel = document.createElement('strong');
  893. darktheme.appendChild(darkthemeLabel);
  894. darkthemeLabel.setAttribute('style', 'font-size: 1.25em; vertical-align: middle;');
  895. darkthemeLabel.innerHTML = '主题风格&emsp;&emsp;&emsp;&emsp;';
  896. var darkthemeSelect = document.createElement('select');
  897. darktheme.appendChild(darkthemeSelect);
  898. darkthemeSelect.classList.add('form-control');
  899. darkthemeSelect.style.display = 'inline-block';
  900. darkthemeSelect.style.width = 'unset';
  901. darkthemeSelect.style.verticalAlign = 'middle';
  902. darkthemeSelect.innerHTML = '<option value="follow">跟随系统</option><option value="light">Light</option><option value="dark">Dark</option>';
  903. backgroundImageInput.value = variables_1.BackgroundImage;
  904. siteIconImageInput.value = variables_1.SiteIconImage;
  905. document.getElementById('AcademicSwitch').checked = variables_1.Academic;
  906. document.getElementById('LigaturesSwitch').checked = variables_1.Ligatures;
  907. darkthemeSelect.value = variables_1.DarkthemeSelect;
  908. var FooterRow = document.createElement('div');
  909. FooterRow.setAttribute('class', 'settings-footerbar');
  910. SettingsPopup.appendChild(FooterRow);
  911. var Ok = document.createElement('button');
  912. FooterRow.appendChild(Ok);
  913. Ok.setAttribute('class', 'btn btn-search btn-outline-primary float-right');
  914. Ok.innerHTML = '保存';
  915. Ok.onclick = function () {
  916. GM_setValue('BackgroundImage', backgroundImageInput.value);
  917. GM_setValue('SiteIconImage', siteIconImageInput.value);
  918. GM_setValue('Academic', document.getElementById('AcademicSwitch').checked);
  919. GM_setValue('Ligatures', document.getElementById('LigaturesSwitch').checked);
  920. GM_setValue('Darktheme', darkthemeSelect.value);
  921. location.reload();
  922. };
  923. var Clear = document.createElement('button');
  924. FooterRow.appendChild(Clear);
  925. Clear.setAttribute('class', 'btn btn-search btn-outline-primary float-right');
  926. Clear.innerHTML = '恢复默认';
  927. Clear.onclick = function () {
  928. var values = GM_listValues();
  929. for (var value in values) {
  930. GM_deleteValue(values[value]);
  931. }
  932. location.reload();
  933. };
  934. }
  935. exports.Settings = Settings;
  936.  
  937.  
  938. /***/ }),
  939.  
  940. /***/ 978:
  941. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  942.  
  943.  
  944. Object.defineProperty(exports, "__esModule", ({ value: true }));
  945. exports.Submission = void 0;
  946. var code_1 = __webpack_require__(480);
  947. var utils_1 = __webpack_require__(593);
  948. function SubmissionCrack() {
  949. var content = document.querySelector('div.uoj-content');
  950. if (!content || !content.children.length && !content.children[0].className.includes('table-responsive')) {
  951. return;
  952. }
  953. GM_xmlhttpRequest({
  954. method: "GET",
  955. url: "https://ex124oj.pond.ink/api/submission/".concat((0, utils_1.isSubmission)()[1]),
  956. nocache: true,
  957. onload: function (data) {
  958. if (data.status == 200) {
  959. SubmissionCard(JSON.parse(data.response));
  960. }
  961. else {
  962. SubmissionCard({});
  963. }
  964. },
  965. onerror: function (error) {
  966. SubmissionCard({});
  967. }
  968. });
  969. }
  970. function SubmissionCard(data) {
  971. var _a;
  972. GM_addStyle("\ndiv.tab-content > div.tab-pane.card {\n border-top: none;\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n}\n ");
  973. var content = document.querySelector('div.uoj-content');
  974. if (content && content.children.length) {
  975. var TabList = document.createElement('ul');
  976. content.insertBefore(TabList, content.children[1]);
  977. TabList.setAttribute('class', 'nav nav-tabs');
  978. TabList.setAttribute('role', 'tablist');
  979. var TabContent = document.createElement('div');
  980. content.insertBefore(TabContent, content.children[2]);
  981. TabContent.setAttribute('class', 'tab-content');
  982. TabContent.style.marginBottom = '20px';
  983. var counter = 0, cardtitle = void 0;
  984. var flag = { answer: false, details: false };
  985. for (var i = 3; i < content.children.length; i++, counter++) {
  986. var classlist = content.children[i].getAttribute('class');
  987. if (classlist && classlist.includes('card')) {
  988. var isActive = !counter;
  989. var title = document.createElement('li');
  990. TabList.appendChild(title);
  991. title.setAttribute('class', 'nav-item');
  992. var titleText = (_a = content.children[i].querySelector('h4.card-title')) === null || _a === void 0 ? void 0 : _a.textContent;
  993. if (titleText) {
  994. cardtitle = titleText.charAt(0).toUpperCase() + titleText.slice(1);
  995. title.innerHTML = "<a class=\"nav-link".concat(isActive ? ' active' : '', "\" href=\"#card").concat(counter, "\" role=\"tab\" data-toggle=\"tab\" aria-selected=\"true\">").concat(cardtitle, "</a>");
  996. if (cardtitle == 'Answer') {
  997. flag.answer = true;
  998. }
  999. else if (cardtitle == '详细' || cardtitle == 'Details') {
  1000. flag.details = true;
  1001. }
  1002. }
  1003. var card = document.createElement('div');
  1004. TabContent.appendChild(card);
  1005. card.setAttribute('class', "tab-pane card".concat(isActive ? ' active' : ''));
  1006. card.setAttribute('id', "card".concat(counter));
  1007. var card_body = content.children[i].querySelector('div.card-body');
  1008. if (cardtitle == 'Answer' && data.answer && data.answer.body) {
  1009. card_body = document.createElement('div');
  1010. card_body.classList.add('card-body');
  1011. card_body.innerHTML = data.answer.body;
  1012. }
  1013. else if ((cardtitle == '详细' || cardtitle == 'Details') && data.details && data.details.body) {
  1014. card_body = document.createElement('div');
  1015. card_body.classList.add('card-body');
  1016. card_body.innerHTML = data.details.body;
  1017. }
  1018. if (card_body) {
  1019. card.appendChild(card_body);
  1020. }
  1021. var card_footer = content.children[i].querySelector('div.card-footer');
  1022. if (card_footer) {
  1023. card.appendChild(card_footer);
  1024. }
  1025. if (cardtitle == 'Answer' && data.answer && data.answer.footer) {
  1026. card_footer.innerHTML = data.answer.footer;
  1027. }
  1028. content.removeChild(content.children[i]);
  1029. i--;
  1030. }
  1031. }
  1032. if (!flag.answer && data.answer) {
  1033. var isActive = !counter;
  1034. var title = document.createElement('li');
  1035. TabList.appendChild(title);
  1036. title.setAttribute('class', 'nav-item');
  1037. title.innerHTML = "<a class=\"nav-link".concat(isActive ? ' active' : '', "\" href=\"#card").concat(counter, "\" role=\"tab\" data-toggle=\"tab\" aria-selected=\"true\">Answer</a>");
  1038. var card = document.createElement('div');
  1039. TabContent.appendChild(card);
  1040. card.setAttribute('class', "tab-pane card".concat(isActive ? ' active' : ''));
  1041. card.setAttribute('id', "card".concat(counter));
  1042. if (data.answer.body) {
  1043. var card_body = document.createElement('div');
  1044. card_body.classList.add('card-body');
  1045. card_body.innerHTML = data.answer.body;
  1046. card.appendChild(card_body);
  1047. }
  1048. if (data.answer.footer) {
  1049. var card_body = document.createElement('div');
  1050. card_body.classList.add('card-footer');
  1051. card_body.innerHTML = data.answer.footer;
  1052. card.appendChild(card_body);
  1053. }
  1054. counter++;
  1055. }
  1056. if (!flag.details) {
  1057. var isActive = !counter;
  1058. var title = document.createElement('li');
  1059. TabList.appendChild(title);
  1060. title.setAttribute('class', 'nav-item');
  1061. title.innerHTML = "<a class=\"nav-link".concat(isActive ? ' active' : '', "\" href=\"#card").concat(counter, "\" role=\"tab\" data-toggle=\"tab\" aria-selected=\"true\">\u8BE6\u7EC6</a>");
  1062. var card = document.createElement('div');
  1063. TabContent.appendChild(card);
  1064. card.setAttribute('class', "tab-pane card".concat(isActive ? ' active' : ''));
  1065. card.setAttribute('id', "card".concat(counter));
  1066. if (data.details.body) {
  1067. var card_body = document.createElement('div');
  1068. card_body.classList.add('card-body');
  1069. card_body.innerHTML = data.details.body;
  1070. card.appendChild(card_body);
  1071. }
  1072. counter++;
  1073. }
  1074. sh_highlightDocument();
  1075. (0, code_1.CodeCopy)();
  1076. }
  1077. }
  1078. function Submission() {
  1079. SubmissionCrack();
  1080. }
  1081. exports.Submission = Submission;
  1082.  
  1083.  
  1084. /***/ }),
  1085.  
  1086. /***/ 900:
  1087. /***/ ((__unused_webpack_module, exports) => {
  1088.  
  1089.  
  1090. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1091. exports.TableStyle = void 0;
  1092. function TableStyle() {
  1093. var Tables = document.getElementsByTagName('table');
  1094. for (var table in Tables) {
  1095. if (Tables[table].nodeType) {
  1096. var parentNode = Tables[table].parentNode;
  1097. var parentClass = parentNode.getAttribute('class');
  1098. var classList = Tables[table].classList;
  1099. if (parentClass !== 'legend' && classList.length === 0) {
  1100. Tables[table].classList.add('table', 'table-bordered');
  1101. }
  1102. }
  1103. }
  1104. var ths = document.getElementsByTagName('th');
  1105. for (var th in ths) {
  1106. if (ths[th].nodeType && ths[th].getAttribute('align')) {
  1107. ths[th].setAttribute('style', 'text-align:' + ths[th].getAttribute('align'));
  1108. }
  1109. }
  1110. }
  1111. exports.TableStyle = TableStyle;
  1112.  
  1113.  
  1114. /***/ }),
  1115.  
  1116. /***/ 446:
  1117. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1118.  
  1119.  
  1120. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1121. exports.Theme = void 0;
  1122. var variables_1 = __webpack_require__(449);
  1123. function Theme() {
  1124. GM_addElement('link', {
  1125. href: 'https://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.1/css/fontawesome.css',
  1126. rel: 'stylesheet'
  1127. });
  1128. GM_addElement('link', {
  1129. href: 'https://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.1/css/brands.css',
  1130. rel: 'stylesheet'
  1131. });
  1132. GM_addElement('link', {
  1133. href: 'https://cdn.bootcdn.net/ajax/libs/font-awesome/6.2.1/css/solid.css',
  1134. rel: 'stylesheet'
  1135. });
  1136. GM_addStyle("\n@import url(https://cdn.jsdelivr.net/npm/firacode@6.2.0/distr/fira_code.css);\ncode {\n font-family: \"Fira Code\" !important;\n ".concat(variables_1.Ligatures ? '' : 'font-variant-ligatures: none !important;', "\n}\n.card {\n ").concat(variables_1.Darktheme ? 'border-color: rgba(255,255,255,.125); !important' : '', "\n}\n.card-footer {\n ").concat(variables_1.Darktheme ? 'border-color: rgba(255,255,255,.03); !important' : '', "\n}\npre, pre.sh_sourceCode {\n").concat(variables_1.Darktheme ? "\n color: #e0e0e0 !important;\n background-color: #222 !important;\n border-color: #2e2e30 !important;\n" : '', "\n}\ncode > span, code > span > span {\n font-style: normal !important;\n font-weight: 400 !important;\n}\ncode > span.sh_preproc, code > span.sh_preproc > span.sh_preproc,\ncode > span.sh_keyword, code > span.sh_keyword > span.sh_keyword,\ncode > span.sh_type, code > span.sh_type > span.sh_type {\n color: ").concat(!variables_1.Darktheme ? '#8959a8' : '#cc99cd', " !important;\n}\ncode > span.sh_string, code > span.sh_string > span.sh_string,\ncode > span.sh_specialchar, code > span.sh_specialchar > span.sh_specialchar {\n color: ").concat(!variables_1.Darktheme ? '#718c00' : '#7ec699', " !important;\n}\ncode > span.sh_cbracket, code > span.sh_cbracket > span.sh_cbracket {\n color: ").concat(!variables_1.Darktheme ? '#4d4d4c' : '#cccccc', " !important;\n}\ncode > span.sh_symbol, code > span.sh_symbol > span.sh_symbol {\n color: ").concat(!variables_1.Darktheme ? '#3e999f' : '#67cdcc', " !important;\n}\ncode > span.sh_number, code > span.sh_number > span.sh_number {\n color: ").concat(!variables_1.Darktheme ? '#f5871f' : '#f08d49', " !important;\n}\ncode > span.sh_function, code > span.sh_function > span.sh_function {\n color: ").concat(!variables_1.Darktheme ? '#4271ae' : '#f08d49', " !important;\n}\ncode > span.sh_comment, code > span.sh_comment > span.sh_comment {\n color: ").concat(!variables_1.Darktheme ? '#8e908c' : '#999999', " !important;\n}\n.copybutton {\n font-size: 1.1em;\n width: 2.2em;\n height: 2.2em;\n padding: 0;\n position: absolute;\n top: 0;\n right: 0;\n background-color: ").concat(variables_1.Darktheme ? 'rgb(255,255,255,.1)' : 'rgb(0,0,0,.1)', ";\n border: 0 solid transparent;\n border-bottom-left-radius: .28571429rem;\n}\n.copybutton:hover {\n background-color: ").concat(variables_1.Darktheme ? 'rgb(255,255,255,.2)' : 'rgb(0,0,0,.2);', ";\n}\n.copybutton:focus {\n outline: none;\n}\n "));
  1137. if (variables_1.Darktheme) {
  1138. GM_addStyle("\nbody {\n color: #f2eee8;\n background-color: #222;\n}\n\na.header-a {\n color: #f2eee8;\n}\n\n.navbar-light .navbar-brand {\n color: #fff\n}\n.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover {\n color: #fff\n}\n.navbar-light .navbar-nav .nav-link {\n color: rgba(255,255,255,.5)\n}\n.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover {\n color: rgba(255,255,255,.75)\n}\n.navbar-light .navbar-nav .nav-link.disabled {\n color: rgba(255,255,255,.25)\n}\n.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link {\n color: #fff\n}\n.navbar-light .navbar-toggler {\n color: rgba(255,255,255,.5);\n border-color: rgba(255,255,255,.1)\n}\n.navbar-light .navbar-toggler-icon {\n background-image: url(\"data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e\")\n}\n.navbar-light .navbar-text {\n color: rgba(255,255,255,.5)\n}\n.navbar-light .navbar-text a {\n color: #fff\n}\n.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover {\n color: #fff\n}\n.bg-light {\n background-color: #343a40!important\n}\na.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover {\n background-color: #1d2124!important\n}\n\n.uoj-footer {\n border-top-color: #272b31;\n}\n\n.page-header {\n border-color: #2e2e30;\n}\n\n.page-link, .page-item.disabled .page-link {\n background-color: #222;\n border-color: #2e2e30;\n}\n\n.card {\n background-color: #222;\n}\n.card-header {\n background-color: rgba(255,255,255,.03);\n border-bottom-color: rgba(255,255,255,.125);\n}\n\n.card-uoj-accepted>.card-header,\n.card-uoj-wrong>.card-header,\n.card-uoj-acceptable-answer>.card-header,\n.card-uoj-tle>.card-header {\n opacity: 0.9;\n}\n\n.nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active {\n color: #f2eee8;\n background-color: #222;\n border-color: #2e2e30 #2e2e30 #222;\n}\n.nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover {\n border-color: #2e2e30 #2e2e30 #222;\n}\n.nav-tabs {\n border-bottom-color: #2e2e30;\n}\n\n.bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-label {\n background-color: #222;\n border-color: #2e2e30;\n color: #f2eee8;\n}\n\n.table {\n color: #f2eee8;\n}\n.table-striped tbody tr:nth-of-type(odd) {\n background-color: rgba(255,255,255,.05);\n}\n.table-hover tbody tr:hover {\n color: #cccccc;\n background-color: rgba(255,255,255,.075);\n}\n.table thead th {\n border-bottom-color: #2e2e30;\n}\n.table td, .table th {\n border-color: #2e2e30;\n border-top-color: #2e2e30;\n}\n.table-bordered td, .table-bordered th {\n border-color: #2e2e30;\n}\n\n.form-control {\n color: #f2eee8;\n background-color: #222;\n border-color: #2e2e30;\n}\n.form-control:focus {\n color: #f2eee8;\n background-color: #222;\n}\n\n.img-thumbnail, .img-rounded {\n background-color: #222;\n}\n\n.list-group {\n background-color: #222;\n}\n.list-group-item {\n background-color: #222;\n border-color: rgba(255, 255, 255, .125);\n}\n\n.dropdown-menu.show {\n background-color: #222;\n border-color: rgba(255, 255, 255, .15);\n}\n.dropdown-item {\n color: #f2eee8;\n}\n.dropdown-item:focus, .dropdown-item:hover {\n color: #f2eee8;\n text-decoration: none;\n background-color: #14171c;\n}\n\n.CodeMirror, .CodeMirror-scroll {\n background-color: #222 !important;\n color: #f2eee8 !important;\n}\n.CodeMirror pre {\n background: transparent !important;\n}\n.CodeMirror-activeline-background, .CodeMirror-scroll {\n background-color: #222 !important;\n}\n.CodeMirror div.CodeMirror-cursor {\n border-left-color: white !important;\n}\n.CodeMirror-selected {\n background: #464646 !important;\n}\n.CodeMirror-focused .CodeMirror-selected {\n background: #464626 !important;\n}\n.CodeMirror-gutters, .CodeMirror-scroll > .CodeMirror-gutters {\n background-color: #222 !important;\n border-right-color: #59554f !important;\n color: #59554f !important;\n}\n.CodeMirror-linenumber {\n background-color: #222 !important;\n color: #59554f !important;\n}\n.blog-content-md-editor-toolbar {\n background: #343a40\n}\n\n#rating-tooltip {\n background-color: rgb(0,17,17) !important;\n border: rgb(0,34,34) !important;\n}\n\n#MathJax_ZoomFrame {\n color: black;\n}\n\n.modal-content {\n color: #f2eee8;\n background-color: #222;\n border-color: #2e2e30;\n}\n.modal-header {\n color: #f2eee8;\n background-color: #222;\n border-color: #2e2e30;\n}\n.modal-footer {\n color: #f2eee8;\n background-color: #222;\n border-color: #2e2e30;\n}\n\n ");
  1139. }
  1140. }
  1141. exports.Theme = Theme;
  1142.  
  1143.  
  1144. /***/ }),
  1145.  
  1146. /***/ 720:
  1147. /***/ ((__unused_webpack_module, exports) => {
  1148.  
  1149.  
  1150. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1151. exports.RandomProblem = void 0;
  1152. function RandomProblem() {
  1153. var SearchBox = document.getElementById('form-search-problem');
  1154. if (SearchBox) {
  1155. var RandomButton = document.createElement('div');
  1156. RandomButton.setAttribute('class', 'input-group-append');
  1157. RandomButton.innerHTML = '<button class="btn btn-search btn-outline-primary" style="height: calc(1.5em + 0.75rem + 2px);" onclick="randomProblem();">随机跳题</button>';
  1158. var RandomScript = document.createElement('script');
  1159. RandomScript.innerHTML =
  1160. "function randomProblem() {\n const randomProblemId = Math.ceil(Math.random() * 3000);\n ($.get('/problem/' + randomProblemId, (data, status) => {\n if (status == 'success') {\n window.location.href = '/problem/' + randomProblemId;\n } else {\n randomProblem();\n }\n })).error(() => {\n randomProblem();\n })\n}";
  1161. SearchBox.after(RandomButton);
  1162. RandomButton.after(RandomScript);
  1163. }
  1164. }
  1165. exports.RandomProblem = RandomProblem;
  1166.  
  1167.  
  1168. /***/ }),
  1169.  
  1170. /***/ 593:
  1171. /***/ ((__unused_webpack_module, exports) => {
  1172.  
  1173.  
  1174. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1175. exports.isBlog = exports.isUserProfile = exports.isProblem = exports.isStandings = exports.isContest = exports.isContests = exports.isSubmission = exports.isHomepage = void 0;
  1176. var HomepageRegExp = /^http:\/\/124.221.194.184(\/)?(\?.*)?$/;
  1177. function isHomepage() {
  1178. return window.location.href.match(HomepageRegExp);
  1179. }
  1180. exports.isHomepage = isHomepage;
  1181. var submissionRegExp = /^http:\/\/124.221.194.184\/submission\/(\d+)(\?.*)?$/;
  1182. function isSubmission() {
  1183. return window.location.href.match(submissionRegExp);
  1184. }
  1185. exports.isSubmission = isSubmission;
  1186. var ContestsRegExp = /^http:\/\/124.221.194.184\/contests(\?.*)?$/;
  1187. function isContests() {
  1188. return window.location.href.match(ContestsRegExp);
  1189. }
  1190. exports.isContests = isContests;
  1191. var ContestRegExp = /^http:\/\/124.221.194.184\/contest\/(\d+)(\?.*)?$/;
  1192. function isContest() {
  1193. return window.location.href.match(ContestRegExp);
  1194. }
  1195. exports.isContest = isContest;
  1196. var StandingsRegExp = /^http:\/\/124.221.194.184\/contest\/(\d+)\/standings(\?.*)?$/;
  1197. function isStandings() {
  1198. return window.location.href.match(StandingsRegExp);
  1199. }
  1200. exports.isStandings = isStandings;
  1201. var ProblemRegExp = /^http:\/\/124.221.194.184(\/contest\/(\d+))?\/problem\/(\d+)(\?.*)?$/;
  1202. function isProblem() {
  1203. return window.location.href.match(ProblemRegExp);
  1204. }
  1205. exports.isProblem = isProblem;
  1206. var UserProfileRegExp = /^http:\/\/124.221.194.184\/user\/profile\/.+(\?.*)?$/;
  1207. function isUserProfile() {
  1208. return window.location.href.match(UserProfileRegExp);
  1209. }
  1210. exports.isUserProfile = isUserProfile;
  1211. var BlogRegExp = /^http:\/\/124.221.194.184\/blog\/.+(\?.*)?$/;
  1212. function isBlog() {
  1213. return window.location.href.match(BlogRegExp);
  1214. }
  1215. exports.isBlog = isBlog;
  1216.  
  1217.  
  1218. /***/ }),
  1219.  
  1220. /***/ 449:
  1221. /***/ ((__unused_webpack_module, exports) => {
  1222.  
  1223.  
  1224. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1225. exports.getVariables = exports.TagBadgeList = exports.FFCBadgeList = exports.CCFBadgeList = exports.NameColorList = exports.Darktheme = exports.DarkthemeSelect = exports.Ligatures = exports.Academic = exports.SiteIconImage = exports.BackgroundImage = exports.version = void 0;
  1226. exports.version = "1.1.10";
  1227. function getRandomColorCode() {
  1228. var letters = '0123456789ABCDEF';
  1229. var colorCode = '#';
  1230. for (var i = 0; i < 6; i++) {
  1231. colorCode += letters[Math.floor(Math.random() * 16)];
  1232. }
  1233. return colorCode;
  1234. }
  1235. function getVariables() {
  1236. exports.BackgroundImage = GM_getValue('BackgroundImage', '');
  1237. exports.SiteIconImage = GM_getValue('SiteIconImage', '');
  1238. exports.Academic = GM_getValue('Academic', false);
  1239. exports.Ligatures = GM_getValue('Ligatures', true);
  1240. exports.DarkthemeSelect = GM_getValue('Darktheme', "follow");
  1241. exports.Darktheme = (exports.DarkthemeSelect == 'light' || exports.DarkthemeSelect == 'dark') ? exports.DarkthemeSelect == 'dark' : (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches);
  1242. var variables = GM_getValue('public_variables', {});
  1243. var randomcolor = getRandomColorCode();
  1244. exports.NameColorList = variables.NameColorList;
  1245. if (exports.NameColorList) {
  1246. for (var i in exports.NameColorList) {
  1247. for (var j = 0; j < exports.NameColorList[i].length; j++) {
  1248. if (exports.NameColorList[i][j] == 'rand') {
  1249. exports.NameColorList[i][j] = randomcolor;
  1250. }
  1251. }
  1252. }
  1253. }
  1254. exports.CCFBadgeList = variables.CCFBadgeList;
  1255. if (exports.CCFBadgeList) {
  1256. for (var i in exports.CCFBadgeList) {
  1257. for (var j = 0; j < exports.CCFBadgeList[i].length; j++) {
  1258. if (exports.CCFBadgeList[i][j] == 'rand') {
  1259. exports.CCFBadgeList[i][j] = randomcolor;
  1260. }
  1261. }
  1262. }
  1263. }
  1264. exports.FFCBadgeList = variables.FFCBadgeList;
  1265. if (exports.FFCBadgeList) {
  1266. for (var i in exports.FFCBadgeList) {
  1267. for (var j = 0; j < exports.FFCBadgeList[i].length; j++) {
  1268. if (exports.FFCBadgeList[i][j] == 'rand') {
  1269. exports.FFCBadgeList[i][j] = randomcolor;
  1270. }
  1271. }
  1272. }
  1273. }
  1274. exports.TagBadgeList = variables.TagBadgeList;
  1275. if (exports.TagBadgeList) {
  1276. for (var i in exports.TagBadgeList) {
  1277. for (var j = 0; j < exports.TagBadgeList[i].length; j++) {
  1278. if (exports.TagBadgeList[i][j].color == 'rand') {
  1279. exports.TagBadgeList[i][j].color = randomcolor;
  1280. }
  1281. }
  1282. }
  1283. }
  1284. GM_xmlhttpRequest({
  1285. method: "GET",
  1286. url: "https://ex124oj.pond.ink/public/variables.json",
  1287. nocache: true,
  1288. onload: function (data) {
  1289. GM_setValue('public_variables', JSON.parse(data.response));
  1290. }
  1291. });
  1292. }
  1293. exports.getVariables = getVariables;
  1294.  
  1295.  
  1296. /***/ })
  1297.  
  1298. /******/ });
  1299. /************************************************************************/
  1300. /******/ // The module cache
  1301. /******/ var __webpack_module_cache__ = {};
  1302. /******/
  1303. /******/ // The require function
  1304. /******/ function __webpack_require__(moduleId) {
  1305. /******/ // Check if module is in cache
  1306. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  1307. /******/ if (cachedModule !== undefined) {
  1308. /******/ return cachedModule.exports;
  1309. /******/ }
  1310. /******/ // Create a new module (and put it into the cache)
  1311. /******/ var module = __webpack_module_cache__[moduleId] = {
  1312. /******/ // no module.id needed
  1313. /******/ // no module.loaded needed
  1314. /******/ exports: {}
  1315. /******/ };
  1316. /******/
  1317. /******/ // Execute the module function
  1318. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  1319. /******/
  1320. /******/ // Return the exports of the module
  1321. /******/ return module.exports;
  1322. /******/ }
  1323. /******/
  1324. /************************************************************************/
  1325. var __webpack_exports__ = {};
  1326. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  1327. (() => {
  1328. var exports = __webpack_exports__;
  1329. var __webpack_unused_export__;
  1330.  
  1331. /// <reference path="index.d.ts" />
  1332. __webpack_unused_export__ = ({ value: true });
  1333. var utils_1 = __webpack_require__(593);
  1334. var variables_1 = __webpack_require__(449);
  1335. var theme_1 = __webpack_require__(446);
  1336. var settings_1 = __webpack_require__(310);
  1337. var name_1 = __webpack_require__(819);
  1338. var appearance_1 = __webpack_require__(690);
  1339. var discussion_1 = __webpack_require__(992);
  1340. var code_1 = __webpack_require__(480);
  1341. var table_1 = __webpack_require__(900);
  1342. var toolbar_1 = __webpack_require__(720);
  1343. var announcement_1 = __webpack_require__(579);
  1344. var submission_1 = __webpack_require__(978);
  1345. var contest_1 = __webpack_require__(103);
  1346. var problem_1 = __webpack_require__(823);
  1347. var gravatar_1 = __webpack_require__(18);
  1348. (function () {
  1349. 'use strict';
  1350. (0, variables_1.getVariables)();
  1351. (0, theme_1.Theme)();
  1352. (0, name_1.NameStyle)();
  1353. document.addEventListener('DOMContentLoaded', function () {
  1354. (0, settings_1.Settings)();
  1355. (0, appearance_1.Background)();
  1356. (0, appearance_1.changeIcon)();
  1357. (0, discussion_1.DiscussionCard)();
  1358. (0, code_1.CodeCopy)();
  1359. (0, table_1.TableStyle)();
  1360. (0, toolbar_1.RandomProblem)();
  1361. if ((0, utils_1.isHomepage)())
  1362. (0, announcement_1.exAnnouncements)();
  1363. if ((0, utils_1.isSubmission)())
  1364. (0, submission_1.Submission)();
  1365. if ((0, utils_1.isContests)())
  1366. (0, contest_1.ContestsCard)();
  1367. if ((0, utils_1.isContest)())
  1368. (0, contest_1.ContestHome)();
  1369. if ((0, utils_1.isProblem)())
  1370. (0, problem_1.Problem)();
  1371. if ((0, utils_1.isUserProfile)() || (0, utils_1.isBlog)())
  1372. (0, gravatar_1.changeGravatarURL)();
  1373. });
  1374. window.onload = function () {
  1375. if ((0, utils_1.isStandings)())
  1376. (0, contest_1.ContestStandings)();
  1377. };
  1378. })();
  1379.  
  1380. })();
  1381.  
  1382. /******/ })()
  1383. ;