Ex124OJ

Extend 124OJ!

当前为 2025-01-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Ex124OJ
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2.1
  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': 'Pond-Ink/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 avail(name) {
  513. return !variables_1.GroupBelong[name] || variables_1.GroupsEnabled.includes(variables_1.GroupBelong[name]);
  514. }
  515. function getUserLink_Ex124OJ(username, rating, addSymbol) {
  516. if (!username) {
  517. return '';
  518. }
  519. if (addSymbol == undefined) {
  520. addSymbol = true;
  521. }
  522. var text = username, at, color = getColOfRating(rating);
  523. if (username.charAt(0) == '@') {
  524. at = true;
  525. username = username.substr(1);
  526. }
  527. if (variables_1.NameColorList && variables_1.NameColorList[username] && avail(username)) {
  528. text = '';
  529. for (var char = 1; char < variables_1.NameColorList[username].length; char++) {
  530. text += "<font style=\"color:".concat(variables_1.NameColorList[username][char], "\">").concat(username.substring(char - 1, char), "</font>");
  531. }
  532. text += username.substring(variables_1.NameColorList[username].length - 1);
  533. if (at)
  534. text = '@' + text;
  535. color = variables_1.NameColorList[username][0];
  536. }
  537. if (variables_1.CCFBadgeList && variables_1.CCFBadgeList[username]) {
  538. for (var j in variables_1.CCFBadgeList[username]) {
  539. text += " ".concat(ccfbadgecode(variables_1.CCFBadgeList[username][j]));
  540. }
  541. }
  542. if (variables_1.FFCBadgeList && variables_1.FFCBadgeList[username]) {
  543. for (var j in variables_1.FFCBadgeList[username]) {
  544. text += " ".concat(ffcbadgecode(variables_1.FFCBadgeList[username][j]));
  545. }
  546. }
  547. if (variables_1.TagBadgeList && variables_1.TagBadgeList[username] && avail(username)) {
  548. for (var j in variables_1.TagBadgeList[username]) {
  549. text += " ".concat(tagbadgecode(variables_1.TagBadgeList[username][j].color, variables_1.TagBadgeList[username][j].text));
  550. }
  551. }
  552. if (addSymbol) {
  553. if (rating >= 2500) {
  554. text += '<sup>';
  555. for (var i = 2500; i <= rating; i += 200) {
  556. text += "&alefsym;";
  557. }
  558. text += "</sup>";
  559. }
  560. }
  561. return '<a class="uoj-username" href="' + uojHome + '/user/profile/' + username + '" style="color:' + color + '">' + text + '</a>';
  562. }
  563. function getUserSpan_Ex124OJ(username, rating, addSymbol) {
  564. if (!username) {
  565. return '';
  566. }
  567. if (addSymbol == undefined) {
  568. addSymbol = true;
  569. }
  570. var text = username, at, color = getColOfRating(rating);
  571. if (username.charAt(0) == '@') {
  572. at = true;
  573. username = username.substr(1);
  574. }
  575. if (variables_1.NameColorList && variables_1.NameColorList[username] && avail(username)) {
  576. text = '';
  577. for (var char = 1; char < variables_1.NameColorList[username].length; char++) {
  578. text += "<font style=\"color:".concat(variables_1.NameColorList[username][char], "\">").concat(username.substring(char - 1, char), "</font>");
  579. }
  580. text += username.substring(variables_1.NameColorList[username].length - 1);
  581. if (at)
  582. text = '@' + text;
  583. color = variables_1.NameColorList[username][0];
  584. }
  585. if (variables_1.CCFBadgeList && variables_1.CCFBadgeList[username]) {
  586. for (var j in variables_1.CCFBadgeList[username]) {
  587. text += " ".concat(ccfbadgecode(variables_1.CCFBadgeList[username][j]));
  588. }
  589. }
  590. if (variables_1.FFCBadgeList && variables_1.FFCBadgeList[username]) {
  591. for (var j in variables_1.FFCBadgeList[username]) {
  592. text += " ".concat(ffcbadgecode(variables_1.FFCBadgeList[username][j]));
  593. }
  594. }
  595. if (variables_1.TagBadgeList && variables_1.TagBadgeList[username] && avail(username)) {
  596. for (var j in variables_1.TagBadgeList[username]) {
  597. text += " ".concat(tagbadgecode(variables_1.TagBadgeList[username][j].color, variables_1.TagBadgeList[username][j].text));
  598. }
  599. }
  600. if (addSymbol) {
  601. if (rating >= 2500) {
  602. text += '<sup>';
  603. for (var i = 2500; i <= rating; i += 200) {
  604. text += "&alefsym;";
  605. }
  606. text += "</sup>";
  607. }
  608. }
  609. return '<span class="uoj-username" style="color:' + color + '">' + text + '</span>';
  610. }
  611. function uoj_honor_Ex124OJ() {
  612. return this.each(function () {
  613. var honor = $(this).text();
  614. var rating = $(this).data("rating");
  615. if (isNaN(rating)) {
  616. return;
  617. }
  618. var text = honor, color = getColOfRating(rating);
  619. if (variables_1.NameColorList && variables_1.NameColorList[honor]) {
  620. text = '';
  621. for (var char = 1; char < variables_1.NameColorList[honor].length; char++) {
  622. text += "<font style=\"color:".concat(variables_1.NameColorList[honor][char], "\">").concat(honor.substring(char - 1, char), "</font>");
  623. }
  624. text += honor.substring(variables_1.NameColorList[honor].length - 1);
  625. color = variables_1.NameColorList[honor][0];
  626. }
  627. if (variables_1.CCFBadgeList && variables_1.CCFBadgeList[honor]) {
  628. for (var j in variables_1.CCFBadgeList[honor]) {
  629. text += " ".concat(ccfbadgecode(variables_1.CCFBadgeList[honor][j]));
  630. }
  631. }
  632. if (variables_1.FFCBadgeList && variables_1.FFCBadgeList[honor]) {
  633. for (var j in variables_1.FFCBadgeList[honor]) {
  634. text += " ".concat(ffcbadgecode(variables_1.FFCBadgeList[honor][j]));
  635. }
  636. }
  637. if (variables_1.TagBadgeList && variables_1.TagBadgeList[honor]) {
  638. for (var j in variables_1.TagBadgeList[honor]) {
  639. text += " ".concat(tagbadgecode(variables_1.TagBadgeList[honor][j].color, variables_1.TagBadgeList[honor][j].text));
  640. }
  641. }
  642. if (rating >= 2500) {
  643. text += '<sup>';
  644. for (var i = 2500; i <= rating; i += 200) {
  645. text += "&alefsym;";
  646. }
  647. text += "</sup>";
  648. }
  649. $(this).css("color", color).html(text);
  650. if (variables_1.GroupBelong[honor]) {
  651. $(this).attr('title', "Ex124OJ Group: ".concat(variables_1.GroupBelong[honor]));
  652. }
  653. });
  654. }
  655. function launchNameStyle() {
  656. var _a, _b;
  657. unsafeWindow.getUserLink = getUserLink_Ex124OJ;
  658. unsafeWindow.getUserSpan = getUserSpan_Ex124OJ;
  659. (_b = (_a = unsafeWindow.$) === null || _a === void 0 ? void 0 : _a.fn) === null || _b === void 0 ? void 0 : _b.uoj_honor = uoj_honor_Ex124OJ;
  660. }
  661. function NameStyle() {
  662. unsafeWindow.launchNameStyle = launchNameStyle;
  663. var script = document.createElement('script');
  664. script.setAttribute('type', 'text/javascript');
  665. script.innerHTML = "\n launchNameStyle();\n ";
  666. document.head.appendChild(script);
  667. $(document).ready(function () {
  668. launchNameStyle();
  669. });
  670. }
  671. exports.NameStyle = NameStyle;
  672.  
  673.  
  674. /***/ }),
  675.  
  676. /***/ 823:
  677. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  678.  
  679.  
  680. Object.defineProperty(exports, "__esModule", ({ value: true }));
  681. exports.Problem = void 0;
  682. var utils_1 = __webpack_require__(593);
  683. var variables_1 = __webpack_require__(449);
  684. var code_1 = __webpack_require__(480);
  685. function appendsource() {
  686. var mathjaxconfig = document.createElement('script');
  687. mathjaxconfig.type = 'text/x-mathjax-config';
  688. 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 ";
  689. document.head.appendChild(mathjaxconfig);
  690. var mathjax = document.createElement('script');
  691. mathjax.src = '//cdn.bootcss.com/mathjax/2.6.0/MathJax.js?config=TeX-AMS_HTML';
  692. document.head.appendChild(mathjax);
  693. var jquery = document.createElement('script');
  694. jquery.src = 'http://124.221.194.184/js/jquery.form.min.js';
  695. document.head.appendChild(jquery);
  696. var shtypical = document.createElement('link');
  697. shtypical.type = 'text/css';
  698. shtypical.rel = 'stylesheet';
  699. shtypical.href = 'http://124.221.194.184/css/sh_typical.min.css';
  700. document.head.append(shtypical);
  701. var shmain = document.createElement('script');
  702. shmain.src = 'http://124.221.194.184/js/sh_main.min.js';
  703. document.head.appendChild(shmain);
  704. shmain.addEventListener('load', function () {
  705. sh_highlightDocument();
  706. });
  707. }
  708. function Problem() {
  709. GM_addStyle("\n.partly-hidden {\n transition: opacity 125ms;\n}\n.partly-hidden:not(:hover) {\n opacity: 0;\n}\n ");
  710. var uojcontent = document.querySelector('div.uoj-content');
  711. if (!uojcontent) {
  712. return;
  713. }
  714. if (!uojcontent.querySelectorAll('.page-header').length) {
  715. var lostpage_1 = document.body.innerHTML;
  716. 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 () {
  717. if ((0, utils_1.isProblem)()[2]) {
  718. 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 ";
  719. }
  720. else {
  721. return "<h1 class=\"page-header text-center\" id=\"problem-name\"></h1>";
  722. }
  723. })(), "\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>");
  724. GM_xmlhttpRequest({
  725. method: "GET",
  726. 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]),
  727. nocache: true,
  728. onload: function (data) {
  729. if (data.status == 200) {
  730. var res = JSON.parse(data.response);
  731. var title = document.querySelector('head > title');
  732. if (title && res.title) {
  733. title.innerHTML = res.title;
  734. }
  735. var problename = document.querySelector('#problem-name');
  736. if (problename && res.problemname) {
  737. problename.innerHTML = res.problemname;
  738. }
  739. var contestname = document.querySelector('#contest-name');
  740. if (contestname && res.contestname) {
  741. contestname.innerHTML = res.contestname;
  742. }
  743. var statement = document.querySelector('#tab-statement');
  744. if (statement && res.statement) {
  745. statement.innerHTML = res.statement;
  746. }
  747. var timelimit = document.querySelector('#time-limit');
  748. if (timelimit && res.timelimit) {
  749. timelimit.innerHTML = res.timelimit;
  750. }
  751. var memorylimit = document.querySelector('#memory-limit');
  752. if (memorylimit && res.memorylimit) {
  753. memorylimit.innerHTML = res.memorylimit;
  754. }
  755. var vote = document.querySelector('#vote');
  756. if (vote && res.vote) {
  757. vote.innerHTML = res.vote;
  758. eval('$(".uoj-click-zan-block").click_zan_block();');
  759. }
  760. var countdown = document.querySelector('#contest-countdown');
  761. if (countdown && res.script) {
  762. eval(res.script);
  763. }
  764. appendsource();
  765. (0, code_1.CodeCopy)();
  766. }
  767. else {
  768. document.body.innerHTML = lostpage_1;
  769. }
  770. }
  771. });
  772. }
  773. var tabcontent = document.querySelector('div.tab-content');
  774. if (tabcontent) {
  775. var navbar_1 = document.createElement('div');
  776. tabcontent.before(navbar_1);
  777. navbar_1.setAttribute('style', 'border-bottom: 1px solid ' + (variables_1.Darktheme ? '#2e2e30' : '#dee2e6;'));
  778. var statisticsButton = document.querySelector('div.uoj-content > a[role=button]');
  779. if (statisticsButton)
  780. navbar_1.appendChild(statisticsButton);
  781. var DownloadTag_1 = document.createElement('a');
  782. navbar_1.appendChild(DownloadTag_1);
  783. DownloadTag_1.setAttribute('role', 'button');
  784. DownloadTag_1.setAttribute('class', 'btn btn-secondary float-right partly-hidden');
  785. DownloadTag_1.setAttribute('href', '/download.php?type=problem&id=' + (0, utils_1.isProblem)()[3]);
  786. DownloadTag_1.setAttribute('target', '_blank');
  787. DownloadTag_1.innerHTML = '<span class="glyphicon glyphicon-download-alt"></span> 下载数据';
  788. GM_xmlhttpRequest({
  789. method: 'GET',
  790. url: "https://ex124oj.pond.ink/api/problem/".concat((0, utils_1.isProblem)()[3], "/markdown"),
  791. onload: function (data) {
  792. if (data.status === 200) {
  793. var copy_md_1 = document.createElement('a');
  794. navbar_1.insertBefore(copy_md_1, DownloadTag_1);
  795. copy_md_1.setAttribute('role', 'button');
  796. copy_md_1.setAttribute('class', 'btn btn-primary float-right');
  797. copy_md_1.setAttribute('href', 'javascript:void(0)');
  798. copy_md_1.innerHTML = '<i class="fa-brands fa-markdown"></i> 复制 MD';
  799. var problem_md_text_1 = data.response;
  800. copy_md_1.addEventListener('click', function () {
  801. GM_setClipboard(problem_md_text_1, "text");
  802. copy_md_1.innerHTML = '<i class="fa-solid fa-check"></i> 复制 MD';
  803. setTimeout(function () { copy_md_1.innerHTML = '<i class="fa-brands fa-markdown"></i> 复制 MD'; }, 500);
  804. });
  805. }
  806. else {
  807. console.error('fail to get markdown text');
  808. }
  809. }
  810. });
  811. var navtabs = document.querySelector('div.uoj-content > ul[role=tablist]');
  812. if (navtabs) {
  813. navbar_1.appendChild(navtabs);
  814. navtabs.setAttribute('style', 'border-bottom: none');
  815. var TJTag = document.createElement('li');
  816. navtabs.insertBefore(TJTag, null);
  817. TJTag.setAttribute('class', 'nav-item partly-hidden');
  818. var TJInnerTag = document.createElement('a');
  819. TJTag.appendChild(TJInnerTag);
  820. TJInnerTag.setAttribute('role', 'tab');
  821. TJInnerTag.setAttribute('class', 'nav-link');
  822. TJInnerTag.setAttribute('href', '/download.php?type=tj&id=' + (0, utils_1.isProblem)()[3]);
  823. TJInnerTag.innerHTML = '<span class="glyphicon glyphicon-book"></span> 题解';
  824. }
  825. }
  826. }
  827. exports.Problem = Problem;
  828.  
  829.  
  830. /***/ }),
  831.  
  832. /***/ 310:
  833. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  834.  
  835.  
  836. Object.defineProperty(exports, "__esModule", ({ value: true }));
  837. exports.Settings = void 0;
  838. var variables_1 = __webpack_require__(449);
  839. function Settings() {
  840. var _a;
  841. 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}"));
  842. var HomepageEntrance = document.createElement('li');
  843. var NavBarTablist = document.querySelector('div[role=main] > div > ul[role=tablist]');
  844. NavBarTablist.insertBefore(HomepageEntrance, NavBarTablist.firstChild);
  845. HomepageEntrance.setAttribute('class', 'nav-item');
  846. 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>';
  847. HomepageEntrance.onclick = function () {
  848. document.body.setAttribute('class', 'settings-popup-active');
  849. };
  850. var SettingsOverlay = document.createElement('div');
  851. document.body.insertBefore(SettingsOverlay, document.body.firstChild);
  852. SettingsOverlay.setAttribute('class', 'settings-overlay');
  853. var SettingsPopup = document.createElement('div');
  854. SettingsOverlay.appendChild(SettingsPopup);
  855. SettingsPopup.setAttribute('class', 'settings-popup');
  856. var SettingsTitlebar = document.createElement('div');
  857. SettingsPopup.appendChild(SettingsTitlebar);
  858. SettingsTitlebar.setAttribute('class', 'row settings-titlebar');
  859. 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>';
  860. var SettingsCloseButton = document.createElement('span');
  861. SettingsPopup.appendChild(SettingsCloseButton);
  862. SettingsCloseButton.setAttribute('style', 'position: fixed;right: 20px;top:20px;cursor: pointer');
  863. SettingsCloseButton.setAttribute('onclick', 'document.body.setAttribute(\'class\', \'\');');
  864. SettingsCloseButton.innerHTML = '<h4><i class="fa fa-xmark"></i></h4>';
  865. var background = document.createElement('div');
  866. SettingsPopup.appendChild(background);
  867. background.setAttribute('class', 'row');
  868. var backgroundImageLabel = document.createElement('strong');
  869. background.appendChild(backgroundImageLabel);
  870. backgroundImageLabel.setAttribute('style', 'font-size: 1.25em');
  871. backgroundImageLabel.innerHTML = '背景图片&emsp;&emsp;&emsp;&emsp;';
  872. var backgroundImageInput = document.createElement('input');
  873. background.appendChild(backgroundImageInput);
  874. backgroundImageInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: initial');
  875. backgroundImageInput.setAttribute('class', 'form-control');
  876. var siteIcon = document.createElement('div');
  877. SettingsPopup.appendChild(siteIcon);
  878. siteIcon.setAttribute('class', 'row');
  879. var siteIconImageLabel = document.createElement('strong');
  880. siteIcon.appendChild(siteIconImageLabel);
  881. siteIconImageLabel.setAttribute('style', 'font-size: 1.25em');
  882. siteIconImageLabel.innerHTML = '网站图标&emsp;&emsp;&emsp;&emsp;';
  883. var siteIconImageInput = document.createElement('input');
  884. siteIcon.appendChild(siteIconImageInput);
  885. siteIconImageInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: initial');
  886. siteIconImageInput.setAttribute('class', 'form-control');
  887. var EnabledGroupsR = document.createElement('div');
  888. SettingsPopup.appendChild(EnabledGroupsR);
  889. EnabledGroupsR.setAttribute('class', 'row');
  890. var EnabledGroupsLabel = document.createElement('strong');
  891. EnabledGroupsR.appendChild(EnabledGroupsLabel);
  892. EnabledGroupsLabel.setAttribute('style', 'font-size: 1.25em');
  893. EnabledGroupsLabel.innerHTML = '选中组别&emsp;&emsp;&emsp;&emsp;';
  894. var EnabledGroupsInput = document.createElement('input');
  895. EnabledGroupsR.appendChild(EnabledGroupsInput);
  896. EnabledGroupsInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: initial');
  897. EnabledGroupsInput.setAttribute('class', 'form-control');
  898. var Switchs = document.createElement('div');
  899. SettingsPopup.appendChild(Switchs);
  900. Switchs.setAttribute('class', 'row');
  901. var academic = document.createElement('div');
  902. Switchs.appendChild(academic);
  903. var academicLabel = document.createElement('strong');
  904. academic.appendChild(academicLabel);
  905. academicLabel.setAttribute('style', 'font-size: 1.25em; vertical-align: middle;');
  906. academicLabel.innerHTML = '学术模式&emsp;&emsp;&emsp;&emsp;';
  907. var academicSwitch = document.createElement('label');
  908. academicSwitch.className = 'switch';
  909. academic.appendChild(academicSwitch);
  910. academicSwitch.innerHTML = '<input type="checkbox" id="AcademicSwitch" style="display: none;">\n<i id="AcademicSwitchIcon" class="slider"></i>';
  911. {
  912. var space = document.createElement('p');
  913. Switchs.appendChild(space);
  914. space.innerHTML = '&emsp;&emsp;&emsp;&emsp;';
  915. }
  916. var ligatures = document.createElement('div');
  917. Switchs.appendChild(ligatures);
  918. var ligaturesLabel = document.createElement('strong');
  919. ligatures.appendChild(ligaturesLabel);
  920. ligaturesLabel.setAttribute('style', 'font-size: 1.25em; vertical-align: middle;');
  921. ligaturesLabel.innerHTML = '代码连字&emsp;&emsp;&emsp;&emsp;';
  922. var ligaturesSwitch = document.createElement('label');
  923. ligaturesSwitch.className = 'switch';
  924. ligatures.appendChild(ligaturesSwitch);
  925. ligaturesSwitch.innerHTML = '<input type="checkbox" id="LigaturesSwitch" style="display: none;">\n<i id="LigaturesSwitchIcon" class="slider"></i>';
  926. {
  927. var space = document.createElement('p');
  928. Switchs.appendChild(space);
  929. space.innerHTML = '&emsp;&emsp;&emsp;&emsp;';
  930. }
  931. var darktheme = document.createElement('div');
  932. Switchs.appendChild(darktheme);
  933. var darkthemeLabel = document.createElement('strong');
  934. darktheme.appendChild(darkthemeLabel);
  935. darkthemeLabel.setAttribute('style', 'font-size: 1.25em; vertical-align: middle;');
  936. darkthemeLabel.innerHTML = '主题风格&emsp;&emsp;&emsp;&emsp;';
  937. var darkthemeSelect = document.createElement('select');
  938. darktheme.appendChild(darkthemeSelect);
  939. darkthemeSelect.classList.add('form-control');
  940. darkthemeSelect.style.display = 'inline-block';
  941. darkthemeSelect.style.width = 'unset';
  942. darkthemeSelect.style.verticalAlign = 'middle';
  943. darkthemeSelect.innerHTML = '<option value="follow">跟随系统</option><option value="light">Light</option><option value="dark">Dark</option>';
  944. var NewYearMagicR = document.createElement('div');
  945. var NameColorLabel = document.createElement('strong');
  946. var NameColorInput = document.createElement('input');
  947. var TagColorLabel = document.createElement('strong');
  948. var TagColorInput = document.createElement('input');
  949. var TagContentLabel = document.createElement('strong');
  950. var TagContentInput = document.createElement('input');
  951. NewYearMagicR.setAttribute('class', 'row');
  952. NewYearMagicR.appendChild(NameColorLabel);
  953. NameColorLabel.setAttribute('style', 'font-size: 1.25em');
  954. NameColorLabel.innerHTML = 'NameColor&emsp;';
  955. NewYearMagicR.appendChild(NameColorInput);
  956. NameColorInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: 100px');
  957. NameColorInput.setAttribute('class', 'form-control');
  958. NewYearMagicR.setAttribute('class', 'row');
  959. NewYearMagicR.appendChild(TagColorLabel);
  960. TagColorLabel.setAttribute('style', 'font-size: 1.25em');
  961. TagColorLabel.innerHTML = '&emsp;TagColor&emsp;';
  962. NewYearMagicR.appendChild(TagColorInput);
  963. TagColorInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: 100px');
  964. TagColorInput.setAttribute('class', 'form-control');
  965. NewYearMagicR.setAttribute('class', 'row');
  966. NewYearMagicR.appendChild(TagContentLabel);
  967. TagContentLabel.setAttribute('style', 'font-size: 1.25em');
  968. TagContentLabel.innerHTML = '&emsp;TagContent&emsp;';
  969. NewYearMagicR.appendChild(TagContentInput);
  970. TagContentInput.setAttribute('style', 'flex-grow: 1; height: 2em; width: 100px');
  971. TagContentInput.setAttribute('class', 'form-control');
  972. if (variables_1.NewYearMagic)
  973. SettingsPopup.appendChild(NewYearMagicR);
  974. backgroundImageInput.value = variables_1.BackgroundImage;
  975. siteIconImageInput.value = variables_1.SiteIconImage;
  976. EnabledGroupsInput.value = variables_1.EnabledGroups;
  977. document.getElementById('AcademicSwitch').checked = variables_1.Academic;
  978. document.getElementById('LigaturesSwitch').checked = variables_1.Ligatures;
  979. darkthemeSelect.value = variables_1.DarkthemeSelect;
  980. var UserName = (_a = document.getElementsByClassName('nav-link dropdown-toggle')[0].firstElementChild.childNodes[0].textContent) === null || _a === void 0 ? void 0 : _a.trimEnd();
  981. if (variables_1.NewYearMagic) {
  982. NameColorInput.value = variables_1.NameColorList[UserName].join(',');
  983. TagColorInput.value = variables_1.TagBadgeList[UserName][0].color;
  984. TagContentInput.value = variables_1.TagBadgeList[UserName][0].text;
  985. }
  986. var FooterRow = document.createElement('div');
  987. FooterRow.setAttribute('class', 'settings-footerbar');
  988. SettingsPopup.appendChild(FooterRow);
  989. var Ok = document.createElement('button');
  990. FooterRow.appendChild(Ok);
  991. Ok.setAttribute('class', 'btn btn-search btn-outline-primary float-right');
  992. Ok.innerHTML = '保存';
  993. Ok.onclick = function () {
  994. GM_setValue('BackgroundImage', backgroundImageInput.value);
  995. GM_setValue('SiteIconImage', siteIconImageInput.value);
  996. GM_setValue('EnabledGroups', EnabledGroupsInput.value);
  997. GM_setValue('Academic', document.getElementById('AcademicSwitch').checked);
  998. GM_setValue('Ligatures', document.getElementById('LigaturesSwitch').checked);
  999. GM_setValue('Darktheme', darkthemeSelect.value);
  1000. if (variables_1.NewYearMagic && (NameColorInput.value != variables_1.NameColorList[UserName].join(',') || TagColorInput.value != variables_1.TagBadgeList[UserName][0].color || TagContentInput.value != variables_1.TagBadgeList[UserName][0].text)) {
  1001. fetch("http://124.221.194.184/user/msg", {
  1002. method: "POST",
  1003. headers: {
  1004. "Content-Type": "application/x-www-form-urlencoded"
  1005. },
  1006. body: new URLSearchParams({
  1007. user_msg: "1",
  1008. receiver: variables_1.NewYearMagicBot,
  1009. message: "{\"NameColor\": ".concat(NameColorInput.value ? "\"".concat(NameColorInput.value, "\"") : "null", ", \"TagColor\": ").concat(TagColorInput.value ? "\"".concat(TagColorInput.value, "\"") : "null", ", \"TagContent\": ").concat(TagContentInput.value ? "\"".concat(TagContentInput.value, "\"") : "null", "}")
  1010. }),
  1011. });
  1012. fetch("https://ex124oj.pond.ink/api/magic/".concat(UserName), {
  1013. method: "POST",
  1014. headers: {},
  1015. body: new URLSearchParams({}),
  1016. });
  1017. var start = Date.now();
  1018. while (Date.now() - start < 2000) { }
  1019. }
  1020. location.reload();
  1021. };
  1022. var Clear = document.createElement('button');
  1023. FooterRow.appendChild(Clear);
  1024. Clear.setAttribute('class', 'btn btn-search btn-outline-primary float-right');
  1025. Clear.innerHTML = '恢复默认';
  1026. Clear.onclick = function () {
  1027. var values = GM_listValues();
  1028. for (var value in values) {
  1029. GM_deleteValue(values[value]);
  1030. }
  1031. location.reload();
  1032. };
  1033. }
  1034. exports.Settings = Settings;
  1035.  
  1036.  
  1037. /***/ }),
  1038.  
  1039. /***/ 978:
  1040. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1041.  
  1042.  
  1043. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1044. exports.Submission = void 0;
  1045. var code_1 = __webpack_require__(480);
  1046. var utils_1 = __webpack_require__(593);
  1047. function SubmissionCrack() {
  1048. var content = document.querySelector('div.uoj-content');
  1049. if (!content || !content.children.length && !content.children[0].className.includes('table-responsive')) {
  1050. return;
  1051. }
  1052. GM_xmlhttpRequest({
  1053. method: "GET",
  1054. url: "https://ex124oj.pond.ink/api/submission/".concat((0, utils_1.isSubmission)()[1]),
  1055. nocache: true,
  1056. onload: function (data) {
  1057. if (data.status == 200) {
  1058. SubmissionCard(JSON.parse(data.response));
  1059. }
  1060. else {
  1061. SubmissionCard({});
  1062. }
  1063. },
  1064. onerror: function (error) {
  1065. SubmissionCard({});
  1066. }
  1067. });
  1068. }
  1069. function SubmissionCard(data) {
  1070. var _a;
  1071. 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 ");
  1072. var content = document.querySelector('div.uoj-content');
  1073. if (content && content.children.length) {
  1074. var TabList = document.createElement('ul');
  1075. content.insertBefore(TabList, content.children[1]);
  1076. TabList.setAttribute('class', 'nav nav-tabs');
  1077. TabList.setAttribute('role', 'tablist');
  1078. var TabContent = document.createElement('div');
  1079. content.insertBefore(TabContent, content.children[2]);
  1080. TabContent.setAttribute('class', 'tab-content');
  1081. TabContent.style.marginBottom = '20px';
  1082. var counter = 0, cardtitle = void 0;
  1083. var flag = { answer: false, details: false };
  1084. for (var i = 3; i < content.children.length; i++, counter++) {
  1085. var classlist = content.children[i].getAttribute('class');
  1086. if (classlist && classlist.includes('card')) {
  1087. var isActive = !counter;
  1088. var title = document.createElement('li');
  1089. TabList.appendChild(title);
  1090. title.setAttribute('class', 'nav-item');
  1091. var titleText = (_a = content.children[i].querySelector('h4.card-title')) === null || _a === void 0 ? void 0 : _a.textContent;
  1092. if (titleText) {
  1093. cardtitle = titleText.charAt(0).toUpperCase() + titleText.slice(1);
  1094. title.innerHTML = "<a class=\"nav-link".concat(isActive ? ' active' : '', "\" href=\"#card").concat(counter, "\" role=\"tab\" data-toggle=\"tab\" aria-selected=\"true\">").concat(cardtitle, "</a>");
  1095. if (cardtitle == 'Answer') {
  1096. flag.answer = true;
  1097. }
  1098. else if (cardtitle == '详细' || cardtitle == 'Details') {
  1099. flag.details = true;
  1100. }
  1101. }
  1102. var card = document.createElement('div');
  1103. TabContent.appendChild(card);
  1104. card.setAttribute('class', "tab-pane card".concat(isActive ? ' active' : ''));
  1105. card.setAttribute('id', "card".concat(counter));
  1106. var card_body = content.children[i].querySelector('div.card-body');
  1107. if (cardtitle == 'Answer' && data.answer && data.answer.body) {
  1108. card_body = document.createElement('div');
  1109. card_body.classList.add('card-body');
  1110. card_body.innerHTML = data.answer.body;
  1111. }
  1112. else if ((cardtitle == '详细' || cardtitle == 'Details') && data.details && data.details.body) {
  1113. card_body = document.createElement('div');
  1114. card_body.classList.add('card-body');
  1115. card_body.innerHTML = data.details.body;
  1116. }
  1117. if (card_body) {
  1118. card.appendChild(card_body);
  1119. }
  1120. var card_footer = content.children[i].querySelector('div.card-footer');
  1121. if (card_footer) {
  1122. card.appendChild(card_footer);
  1123. }
  1124. if (cardtitle == 'Answer' && data.answer && data.answer.footer) {
  1125. card_footer.innerHTML = data.answer.footer;
  1126. }
  1127. content.removeChild(content.children[i]);
  1128. i--;
  1129. }
  1130. }
  1131. if (!flag.answer && data.answer) {
  1132. var isActive = !counter;
  1133. var title = document.createElement('li');
  1134. TabList.appendChild(title);
  1135. title.setAttribute('class', 'nav-item');
  1136. title.innerHTML = "<a class=\"nav-link".concat(isActive ? ' active' : '', "\" href=\"#card").concat(counter, "\" role=\"tab\" data-toggle=\"tab\" aria-selected=\"true\">Answer</a>");
  1137. var card = document.createElement('div');
  1138. TabContent.appendChild(card);
  1139. card.setAttribute('class', "tab-pane card".concat(isActive ? ' active' : ''));
  1140. card.setAttribute('id', "card".concat(counter));
  1141. if (data.answer.body) {
  1142. var card_body = document.createElement('div');
  1143. card_body.classList.add('card-body');
  1144. card_body.innerHTML = data.answer.body;
  1145. card.appendChild(card_body);
  1146. }
  1147. if (data.answer.footer) {
  1148. var card_body = document.createElement('div');
  1149. card_body.classList.add('card-footer');
  1150. card_body.innerHTML = data.answer.footer;
  1151. card.appendChild(card_body);
  1152. }
  1153. counter++;
  1154. }
  1155. if (!flag.details) {
  1156. var isActive = !counter;
  1157. var title = document.createElement('li');
  1158. TabList.appendChild(title);
  1159. title.setAttribute('class', 'nav-item');
  1160. title.innerHTML = "<a class=\"nav-link".concat(isActive ? ' active' : '', "\" href=\"#card").concat(counter, "\" role=\"tab\" data-toggle=\"tab\" aria-selected=\"true\">\u8BE6\u7EC6</a>");
  1161. var card = document.createElement('div');
  1162. TabContent.appendChild(card);
  1163. card.setAttribute('class', "tab-pane card".concat(isActive ? ' active' : ''));
  1164. card.setAttribute('id', "card".concat(counter));
  1165. if (data.details.body) {
  1166. var card_body = document.createElement('div');
  1167. card_body.classList.add('card-body');
  1168. card_body.innerHTML = data.details.body;
  1169. card.appendChild(card_body);
  1170. }
  1171. counter++;
  1172. }
  1173. sh_highlightDocument();
  1174. (0, code_1.CodeCopy)();
  1175. }
  1176. }
  1177. function Submission() {
  1178. SubmissionCrack();
  1179. }
  1180. exports.Submission = Submission;
  1181.  
  1182.  
  1183. /***/ }),
  1184.  
  1185. /***/ 900:
  1186. /***/ ((__unused_webpack_module, exports) => {
  1187.  
  1188.  
  1189. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1190. exports.TableStyle = void 0;
  1191. function TableStyle() {
  1192. var Tables = document.getElementsByTagName('table');
  1193. for (var table in Tables) {
  1194. if (Tables[table].nodeType) {
  1195. var parentNode = Tables[table].parentNode;
  1196. var parentClass = parentNode.getAttribute('class');
  1197. var classList = Tables[table].classList;
  1198. if (parentClass !== 'legend' && classList.length === 0) {
  1199. Tables[table].classList.add('table', 'table-bordered');
  1200. }
  1201. }
  1202. }
  1203. var ths = document.getElementsByTagName('th');
  1204. for (var th in ths) {
  1205. if (ths[th].nodeType && ths[th].getAttribute('align')) {
  1206. ths[th].setAttribute('style', 'text-align:' + ths[th].getAttribute('align'));
  1207. }
  1208. }
  1209. }
  1210. exports.TableStyle = TableStyle;
  1211.  
  1212.  
  1213. /***/ }),
  1214.  
  1215. /***/ 446:
  1216. /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
  1217.  
  1218.  
  1219. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1220. exports.Theme = void 0;
  1221. var variables_1 = __webpack_require__(449);
  1222. function Theme() {
  1223. GM_addElement('link', {
  1224. href: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css',
  1225. rel: 'stylesheet'
  1226. });
  1227. 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 "));
  1228. if (variables_1.Darktheme) {
  1229. 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 ");
  1230. }
  1231. }
  1232. exports.Theme = Theme;
  1233.  
  1234.  
  1235. /***/ }),
  1236.  
  1237. /***/ 720:
  1238. /***/ ((__unused_webpack_module, exports) => {
  1239.  
  1240.  
  1241. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1242. exports.RandomProblem = void 0;
  1243. function RandomProblem() {
  1244. var SearchBox = document.getElementById('form-search-problem');
  1245. if (SearchBox) {
  1246. var RandomButton = document.createElement('div');
  1247. RandomButton.setAttribute('class', 'input-group-append');
  1248. RandomButton.innerHTML = '<button class="btn btn-search btn-outline-primary" style="height: calc(1.5em + 0.75rem + 2px);" onclick="randomProblem();">随机跳题</button>';
  1249. var RandomScript = document.createElement('script');
  1250. RandomScript.innerHTML =
  1251. "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}";
  1252. SearchBox.after(RandomButton);
  1253. RandomButton.after(RandomScript);
  1254. }
  1255. }
  1256. exports.RandomProblem = RandomProblem;
  1257.  
  1258.  
  1259. /***/ }),
  1260.  
  1261. /***/ 593:
  1262. /***/ ((__unused_webpack_module, exports) => {
  1263.  
  1264.  
  1265. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1266. exports.isBlog = exports.isUserProfile = exports.isProblem = exports.isStandings = exports.isContest = exports.isContests = exports.isSubmission = exports.isHomepage = void 0;
  1267. var HomepageRegExp = /^http:\/\/124.221.194.184(\/)?(\?.*)?$/;
  1268. function isHomepage() {
  1269. return window.location.href.match(HomepageRegExp);
  1270. }
  1271. exports.isHomepage = isHomepage;
  1272. var submissionRegExp = /^http:\/\/124.221.194.184\/submission\/(\d+)(\?.*)?$/;
  1273. function isSubmission() {
  1274. return window.location.href.match(submissionRegExp);
  1275. }
  1276. exports.isSubmission = isSubmission;
  1277. var ContestsRegExp = /^http:\/\/124.221.194.184\/contests(\?.*)?$/;
  1278. function isContests() {
  1279. return window.location.href.match(ContestsRegExp);
  1280. }
  1281. exports.isContests = isContests;
  1282. var ContestRegExp = /^http:\/\/124.221.194.184\/contest\/(\d+)(\?.*)?$/;
  1283. function isContest() {
  1284. return window.location.href.match(ContestRegExp);
  1285. }
  1286. exports.isContest = isContest;
  1287. var StandingsRegExp = /^http:\/\/124.221.194.184\/contest\/(\d+)\/standings(\?.*)?$/;
  1288. function isStandings() {
  1289. return window.location.href.match(StandingsRegExp);
  1290. }
  1291. exports.isStandings = isStandings;
  1292. var ProblemRegExp = /^http:\/\/124.221.194.184(\/contest\/(\d+))?\/problem\/(\d+)(\?.*)?$/;
  1293. function isProblem() {
  1294. return window.location.href.match(ProblemRegExp);
  1295. }
  1296. exports.isProblem = isProblem;
  1297. var UserProfileRegExp = /^http:\/\/124.221.194.184\/user\/profile\/.+(\?.*)?$/;
  1298. function isUserProfile() {
  1299. return window.location.href.match(UserProfileRegExp);
  1300. }
  1301. exports.isUserProfile = isUserProfile;
  1302. var BlogRegExp = /^http:\/\/124.221.194.184\/blog\/.+(\?.*)?$/;
  1303. function isBlog() {
  1304. return window.location.href.match(BlogRegExp);
  1305. }
  1306. exports.isBlog = isBlog;
  1307.  
  1308.  
  1309. /***/ }),
  1310.  
  1311. /***/ 449:
  1312. /***/ ((__unused_webpack_module, exports) => {
  1313.  
  1314.  
  1315. Object.defineProperty(exports, "__esModule", ({ value: true }));
  1316. exports.getVariables = exports.NewYearMagicBot = exports.NewYearMagic = exports.TagBadgeList = exports.FFCBadgeList = exports.CCFBadgeList = exports.NameColorList = exports.GroupBelong = exports.GroupsEnabled = exports.Darktheme = exports.DarkthemeSelect = exports.Ligatures = exports.Academic = exports.EnabledGroups = exports.SiteIconImage = exports.BackgroundImage = exports.version = void 0;
  1317. exports.version = "1.1.17";
  1318. function getRandomColorCode() {
  1319. var letters = '0123456789ABCDEF';
  1320. var colorCode = '#';
  1321. for (var i = 0; i < 6; i++) {
  1322. colorCode += letters[Math.floor(Math.random() * 16)];
  1323. }
  1324. return colorCode;
  1325. }
  1326. function getVariables() {
  1327. exports.BackgroundImage = GM_getValue('BackgroundImage', '');
  1328. exports.SiteIconImage = GM_getValue('SiteIconImage', '');
  1329. exports.EnabledGroups = GM_getValue('EnabledGroups', '');
  1330. exports.Academic = GM_getValue('Academic', false);
  1331. exports.Ligatures = GM_getValue('Ligatures', true);
  1332. exports.DarkthemeSelect = GM_getValue('Darktheme', "follow");
  1333. exports.Darktheme = (exports.DarkthemeSelect == 'light' || exports.DarkthemeSelect == 'dark') ? exports.DarkthemeSelect == 'dark' : (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches);
  1334. exports.GroupsEnabled = exports.EnabledGroups.split(/\s*,\s*/);
  1335. var variables = GM_getValue('public_variables', {});
  1336. exports.GroupBelong = {};
  1337. for (var group in variables.Groups) {
  1338. for (var _i = 0, _a = variables.Groups[group]; _i < _a.length; _i++) {
  1339. var name_1 = _a[_i];
  1340. exports.GroupBelong[name_1] = group;
  1341. }
  1342. }
  1343. exports.NewYearMagic = variables.NewYearMagic;
  1344. exports.NewYearMagicBot = variables.NewYearMagicBot;
  1345. var randomcolor = getRandomColorCode();
  1346. exports.NameColorList = variables.NameColorList;
  1347. if (exports.NewYearMagic && variables.NewYearMagicNameColorList) {
  1348. for (var i in variables.NewYearMagicNameColorList) {
  1349. if (!variables.NewYearMagicNameColorList[i])
  1350. continue;
  1351. for (var j = 0; j < variables.NewYearMagicNameColorList[i].length; j++) {
  1352. if (variables.NewYearMagicNameColorList[i][j])
  1353. exports.NameColorList[i][j] = variables.NewYearMagicNameColorList[i][j];
  1354. }
  1355. }
  1356. }
  1357. if (exports.NameColorList) {
  1358. for (var i in exports.NameColorList) {
  1359. for (var j = 0; j < exports.NameColorList[i].length; j++) {
  1360. if (exports.NameColorList[i][j] == 'rand') {
  1361. exports.NameColorList[i][j] = randomcolor;
  1362. }
  1363. }
  1364. }
  1365. }
  1366. exports.CCFBadgeList = variables.CCFBadgeList;
  1367. if (exports.CCFBadgeList) {
  1368. for (var i in exports.CCFBadgeList) {
  1369. for (var j = 0; j < exports.CCFBadgeList[i].length; j++) {
  1370. if (exports.CCFBadgeList[i][j] == 'rand') {
  1371. exports.CCFBadgeList[i][j] = randomcolor;
  1372. }
  1373. }
  1374. }
  1375. }
  1376. exports.FFCBadgeList = variables.FFCBadgeList;
  1377. if (exports.FFCBadgeList) {
  1378. for (var i in exports.FFCBadgeList) {
  1379. for (var j = 0; j < exports.FFCBadgeList[i].length; j++) {
  1380. if (exports.FFCBadgeList[i][j] == 'rand') {
  1381. exports.FFCBadgeList[i][j] = randomcolor;
  1382. }
  1383. }
  1384. }
  1385. }
  1386. exports.TagBadgeList = variables.TagBadgeList;
  1387. if (exports.NewYearMagic && variables.NewYearMagicTagBadgeList) {
  1388. for (var i in variables.NewYearMagicTagBadgeList) {
  1389. for (var j = 0; j < variables.NewYearMagicTagBadgeList[i].length; j++) {
  1390. if (variables.NewYearMagicTagBadgeList[i][j].color) {
  1391. exports.TagBadgeList[i][j].color = variables.NewYearMagicTagBadgeList[i][j].color;
  1392. }
  1393. if (variables.NewYearMagicTagBadgeList[i][j].text) {
  1394. exports.TagBadgeList[i][j].text = variables.NewYearMagicTagBadgeList[i][j].text;
  1395. }
  1396. }
  1397. }
  1398. }
  1399. if (exports.TagBadgeList) {
  1400. for (var i in exports.TagBadgeList) {
  1401. for (var j = 0; j < exports.TagBadgeList[i].length; j++) {
  1402. if (exports.TagBadgeList[i][j].color == 'rand') {
  1403. exports.TagBadgeList[i][j].color = randomcolor;
  1404. }
  1405. }
  1406. }
  1407. }
  1408. GM_xmlhttpRequest({
  1409. method: "GET",
  1410. url: "https://ex124oj.pond.ink/public/variables.json",
  1411. nocache: true,
  1412. onload: function (data) {
  1413. GM_setValue('public_variables', JSON.parse(data.response));
  1414. }
  1415. });
  1416. }
  1417. exports.getVariables = getVariables;
  1418.  
  1419.  
  1420. /***/ })
  1421.  
  1422. /******/ });
  1423. /************************************************************************/
  1424. /******/ // The module cache
  1425. /******/ var __webpack_module_cache__ = {};
  1426. /******/
  1427. /******/ // The require function
  1428. /******/ function __webpack_require__(moduleId) {
  1429. /******/ // Check if module is in cache
  1430. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  1431. /******/ if (cachedModule !== undefined) {
  1432. /******/ return cachedModule.exports;
  1433. /******/ }
  1434. /******/ // Create a new module (and put it into the cache)
  1435. /******/ var module = __webpack_module_cache__[moduleId] = {
  1436. /******/ // no module.id needed
  1437. /******/ // no module.loaded needed
  1438. /******/ exports: {}
  1439. /******/ };
  1440. /******/
  1441. /******/ // Execute the module function
  1442. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  1443. /******/
  1444. /******/ // Return the exports of the module
  1445. /******/ return module.exports;
  1446. /******/ }
  1447. /******/
  1448. /************************************************************************/
  1449. var __webpack_exports__ = {};
  1450. // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
  1451. (() => {
  1452. var exports = __webpack_exports__;
  1453. var __webpack_unused_export__;
  1454.  
  1455. /// <reference path="index.d.ts" />
  1456. __webpack_unused_export__ = ({ value: true });
  1457. var utils_1 = __webpack_require__(593);
  1458. var variables_1 = __webpack_require__(449);
  1459. var theme_1 = __webpack_require__(446);
  1460. var settings_1 = __webpack_require__(310);
  1461. var name_1 = __webpack_require__(819);
  1462. var appearance_1 = __webpack_require__(690);
  1463. var discussion_1 = __webpack_require__(992);
  1464. var code_1 = __webpack_require__(480);
  1465. var table_1 = __webpack_require__(900);
  1466. var toolbar_1 = __webpack_require__(720);
  1467. var announcement_1 = __webpack_require__(579);
  1468. var submission_1 = __webpack_require__(978);
  1469. var contest_1 = __webpack_require__(103);
  1470. var problem_1 = __webpack_require__(823);
  1471. var gravatar_1 = __webpack_require__(18);
  1472. (function () {
  1473. 'use strict';
  1474. (0, variables_1.getVariables)();
  1475. (0, theme_1.Theme)();
  1476. (0, name_1.NameStyle)();
  1477. document.addEventListener('DOMContentLoaded', function () {
  1478. (0, settings_1.Settings)();
  1479. (0, appearance_1.Background)();
  1480. (0, appearance_1.changeIcon)();
  1481. (0, discussion_1.DiscussionCard)();
  1482. (0, code_1.CodeCopy)();
  1483. (0, table_1.TableStyle)();
  1484. (0, toolbar_1.RandomProblem)();
  1485. if ((0, utils_1.isHomepage)())
  1486. (0, announcement_1.exAnnouncements)();
  1487. if ((0, utils_1.isSubmission)())
  1488. (0, submission_1.Submission)();
  1489. if ((0, utils_1.isContests)())
  1490. (0, contest_1.ContestsCard)();
  1491. if ((0, utils_1.isContest)())
  1492. (0, contest_1.ContestHome)();
  1493. if ((0, utils_1.isProblem)())
  1494. (0, problem_1.Problem)();
  1495. if ((0, utils_1.isUserProfile)() || (0, utils_1.isBlog)())
  1496. (0, gravatar_1.changeGravatarURL)();
  1497. });
  1498. window.onload = function () {
  1499. if ((0, utils_1.isStandings)())
  1500. (0, contest_1.ContestStandings)();
  1501. };
  1502. })();
  1503.  
  1504. })();
  1505.  
  1506. /******/ })()
  1507. ;