@shzlx/ui-default 4.58.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/README.md +5 -0
  2. package/api.ts +61 -0
  3. package/backendlib/builder.ts +182 -0
  4. package/backendlib/markdown-it-imsize.ts +235 -0
  5. package/backendlib/markdown-it-katex.ts +139 -0
  6. package/backendlib/markdown-it-media.ts +163 -0
  7. package/backendlib/markdown-it-xss.ts +200 -0
  8. package/backendlib/markdown.js +64 -0
  9. package/backendlib/misc.ts +54 -0
  10. package/backendlib/template.ts +279 -0
  11. package/breakpoints.json +5 -0
  12. package/components/DOMAttachedObject.ts +128 -0
  13. package/components/autocomplete/AssignSelectAutoComplete.tsx +22 -0
  14. package/components/autocomplete/CustomSelectAutoComplete.tsx +23 -0
  15. package/components/autocomplete/DomainSelectAutoComplete.tsx +18 -0
  16. package/components/autocomplete/FileSelectAutoComplete.tsx +26 -0
  17. package/components/autocomplete/LanguageSelectAutoComplete.tsx +24 -0
  18. package/components/autocomplete/ProblemSelectAutoComplete.tsx +18 -0
  19. package/components/autocomplete/UserSelectAutoComplete.tsx +23 -0
  20. package/components/autocomplete/components/AssignSelectAutoComplete.tsx +118 -0
  21. package/components/autocomplete/components/DomainSelectAutoComplete.tsx +53 -0
  22. package/components/autocomplete/components/FileSelectAutoComplete.tsx +50 -0
  23. package/components/autocomplete/components/LanguageSelectAutoComplete.tsx +48 -0
  24. package/components/autocomplete/components/ProblemSelectAutoComplete.tsx +54 -0
  25. package/components/autocomplete/components/UserSelectAutoComplete.tsx +54 -0
  26. package/components/autocomplete/domainselectautocomplete.page.styl +6 -0
  27. package/components/autocomplete/index.tsx +110 -0
  28. package/components/autocomplete/problemselectautocomplete.page.styl +6 -0
  29. package/components/autocomplete/userselectautocomplete.page.styl +6 -0
  30. package/components/browser-update.page.ts +27 -0
  31. package/components/calendar/calendar.page.styl +129 -0
  32. package/components/calendar/index.js +367 -0
  33. package/components/clipboard.page.ts +23 -0
  34. package/components/contest/contest.page.styl +119 -0
  35. package/components/contest/contest.page.ts +23 -0
  36. package/components/contest/contest_sidebar.page.styl +21 -0
  37. package/components/contest/problem-contest-bg.png +0 -0
  38. package/components/contest/problem-contest-bg@2x.png +0 -0
  39. package/components/customFont.page.tsx +90 -0
  40. package/components/datepicker/datepicker.page.tsx +94 -0
  41. package/components/dialog/DomDialog.ts +145 -0
  42. package/components/dialog/dialog.page.styl +40 -0
  43. package/components/dialog/index.tsx +285 -0
  44. package/components/discussion/CommentBox.js +103 -0
  45. package/components/discussion/collapsible.page.styl +40 -0
  46. package/components/discussion/collapsible.page.tsx +62 -0
  47. package/components/discussion/comments.page.styl +142 -0
  48. package/components/discussion/comments.page.tsx +192 -0
  49. package/components/discussion/discussion.page.styl +17 -0
  50. package/components/discussion/history.page.tsx +81 -0
  51. package/components/discussion/reaction.page.styl +30 -0
  52. package/components/discussion/reaction.page.tsx +103 -0
  53. package/components/drop/drop.page.styl +40 -0
  54. package/components/dropdown/Dropdown.js +50 -0
  55. package/components/dropdown/dropdown.page.styl +33 -0
  56. package/components/dropdown/dropdown.page.ts +8 -0
  57. package/components/editor/cmeditor.page.ts +23 -0
  58. package/components/editor/cmeditor.styl +10 -0
  59. package/components/editor/index.tsx +293 -0
  60. package/components/editor/mdeditor.ts +60 -0
  61. package/components/editor/textareaHandler.ts +29 -0
  62. package/components/footer/footer.page.styl +94 -0
  63. package/components/footer/footer.page.ts +26 -0
  64. package/components/form/button.page.default.styl +59 -0
  65. package/components/form/button.page.styl +36 -0
  66. package/components/form/checkbox.page.styl +89 -0
  67. package/components/form/form.page.styl +200 -0
  68. package/components/form/form.page.ts +20 -0
  69. package/components/form/multiSelectCheckbox.page.js +46 -0
  70. package/components/form/radiobox.page.styl +62 -0
  71. package/components/form/select.page.styl +29 -0
  72. package/components/form/textbox.page.styl +79 -0
  73. package/components/form/textbox.page.ts +21 -0
  74. package/components/form/var.inc.styl +14 -0
  75. package/components/header/header.page.styl +79 -0
  76. package/components/highlighter/code-example.js +111 -0
  77. package/components/highlighter/highlighter.page.styl +99 -0
  78. package/components/highlighter/highlighter.page.ts +72 -0
  79. package/components/highlighter/meta.js +15 -0
  80. package/components/highlighter/prismjs.js +122 -0
  81. package/components/hint.page.styl +9 -0
  82. package/components/hint.ts +19 -0
  83. package/components/hitokoto/index.page.js +21 -0
  84. package/components/hotkey/hotkey.page.js +83 -0
  85. package/components/katex/katex.page.js +26 -0
  86. package/components/katex/katex.page.styl +2 -0
  87. package/components/languageselect.tsx +94 -0
  88. package/components/loader/loader.page.styl +40 -0
  89. package/components/mantine.page.tsx +39 -0
  90. package/components/marker/Marker.js +192 -0
  91. package/components/marker/MarkerReactive.js +55 -0
  92. package/components/marker/marker.page.js +8 -0
  93. package/components/marker/marker.page.styl +57 -0
  94. package/components/media/media.page.js +46 -0
  95. package/components/menu/menu-heading.page.js +28 -0
  96. package/components/menu/menu.page.js +18 -0
  97. package/components/menu/menu.page.styl +68 -0
  98. package/components/message/index.page.ts +166 -0
  99. package/components/message/worker.ts +110 -0
  100. package/components/messagepad/DialogueListItem.page.styl +28 -0
  101. package/components/messagepad/DialogueListItemComponent.jsx +39 -0
  102. package/components/messagepad/Message.page.styl +64 -0
  103. package/components/messagepad/MessageComponent.jsx +33 -0
  104. package/components/messagepad/MessagePad.page.styl +99 -0
  105. package/components/messagepad/MessagePadDialogueContentContainer.jsx +104 -0
  106. package/components/messagepad/MessagePadDialogueListContainer.jsx +49 -0
  107. package/components/messagepad/MessagePadInputContainer.jsx +100 -0
  108. package/components/messagepad/index.jsx +49 -0
  109. package/components/messagepad/reducers/activeId.ts +36 -0
  110. package/components/messagepad/reducers/dialogues.js +53 -0
  111. package/components/messagepad/reducers/index.ts +14 -0
  112. package/components/messagepad/reducers/inputs.js +43 -0
  113. package/components/messagepad/reducers/isPosting.ts +49 -0
  114. package/components/monaco/index.ts +178 -0
  115. package/components/monaco/languages/markdown.ts +97 -0
  116. package/components/monaco/languages/typescript.ts +45 -0
  117. package/components/monaco/languages/yaml.ts +22 -0
  118. package/components/monaco/loader.ts +96 -0
  119. package/components/monaco/monaco.styl +30 -0
  120. package/components/monaco/nls.js +31 -0
  121. package/components/monaco/schema/problemconfig.ts +123 -0
  122. package/components/navigation/hamburgers.page.styl +87 -0
  123. package/components/navigation/nav-logo-small_dark.png +0 -0
  124. package/components/navigation/navigation.page.js +203 -0
  125. package/components/navigation/navigation.page.styl +211 -0
  126. package/components/notification/index.ts +105 -0
  127. package/components/notification/notification.page.js +14 -0
  128. package/components/notification/notification.page.styl +84 -0
  129. package/components/nprogress.page.styl +50 -0
  130. package/components/omnisearch/index.page.tsx +124 -0
  131. package/components/omnisearch/omnibar.page.styl +138 -0
  132. package/components/pager/pager.page.styl +57 -0
  133. package/components/preview/preview.page.ts +187 -0
  134. package/components/problem/create.page.js +12 -0
  135. package/components/problem/list.page.js +9 -0
  136. package/components/problem/rp.page.styl +4 -0
  137. package/components/problem/tag.page.styl +84 -0
  138. package/components/problemconfig/BasicForm.tsx +92 -0
  139. package/components/problemconfig/ProblemConfigEditor.tsx +170 -0
  140. package/components/problemconfig/ProblemConfigForm.tsx +140 -0
  141. package/components/problemconfig/ProblemConfigTree.tsx +163 -0
  142. package/components/problemconfig/ProblemType.tsx +165 -0
  143. package/components/problemconfig/index.tsx +91 -0
  144. package/components/problemconfig/reducer/config.ts +173 -0
  145. package/components/problemconfig/reducer/index.ts +11 -0
  146. package/components/problemconfig/reducer/testdata.ts +16 -0
  147. package/components/problemconfig/tree/AddTestcase.tsx +137 -0
  148. package/components/problemconfig/tree/SelectionManager.tsx +140 -0
  149. package/components/problemconfig/tree/SubtaskSettings.tsx +180 -0
  150. package/components/problemconfig/tree/Testcase.tsx +98 -0
  151. package/components/profile/backgrounds/1.jpg +0 -0
  152. package/components/profile/backgrounds/10.jpg +0 -0
  153. package/components/profile/backgrounds/11.jpg +0 -0
  154. package/components/profile/backgrounds/12.jpg +0 -0
  155. package/components/profile/backgrounds/13.jpg +0 -0
  156. package/components/profile/backgrounds/14.jpg +0 -0
  157. package/components/profile/backgrounds/15.jpg +0 -0
  158. package/components/profile/backgrounds/16.jpg +0 -0
  159. package/components/profile/backgrounds/17.jpg +0 -0
  160. package/components/profile/backgrounds/18.jpg +0 -0
  161. package/components/profile/backgrounds/19.jpg +0 -0
  162. package/components/profile/backgrounds/2.jpg +0 -0
  163. package/components/profile/backgrounds/20.jpg +0 -0
  164. package/components/profile/backgrounds/21.jpg +0 -0
  165. package/components/profile/backgrounds/3.jpg +0 -0
  166. package/components/profile/backgrounds/4.jpg +0 -0
  167. package/components/profile/backgrounds/5.jpg +0 -0
  168. package/components/profile/backgrounds/6.jpg +0 -0
  169. package/components/profile/backgrounds/7.jpg +0 -0
  170. package/components/profile/backgrounds/8.jpg +0 -0
  171. package/components/profile/backgrounds/9.jpg +0 -0
  172. package/components/profile/backgrounds/gen_thumbnails.sh +7 -0
  173. package/components/profile/backgrounds/thumbnail/1.jpg +0 -0
  174. package/components/profile/backgrounds/thumbnail/10.jpg +0 -0
  175. package/components/profile/backgrounds/thumbnail/11.jpg +0 -0
  176. package/components/profile/backgrounds/thumbnail/12.jpg +0 -0
  177. package/components/profile/backgrounds/thumbnail/13.jpg +0 -0
  178. package/components/profile/backgrounds/thumbnail/14.jpg +0 -0
  179. package/components/profile/backgrounds/thumbnail/15.jpg +0 -0
  180. package/components/profile/backgrounds/thumbnail/16.jpg +0 -0
  181. package/components/profile/backgrounds/thumbnail/17.jpg +0 -0
  182. package/components/profile/backgrounds/thumbnail/18.jpg +0 -0
  183. package/components/profile/backgrounds/thumbnail/19.jpg +0 -0
  184. package/components/profile/backgrounds/thumbnail/2.jpg +0 -0
  185. package/components/profile/backgrounds/thumbnail/20.jpg +0 -0
  186. package/components/profile/backgrounds/thumbnail/21.jpg +0 -0
  187. package/components/profile/backgrounds/thumbnail/3.jpg +0 -0
  188. package/components/profile/backgrounds/thumbnail/4.jpg +0 -0
  189. package/components/profile/backgrounds/thumbnail/5.jpg +0 -0
  190. package/components/profile/backgrounds/thumbnail/6.jpg +0 -0
  191. package/components/profile/backgrounds/thumbnail/7.jpg +0 -0
  192. package/components/profile/backgrounds/thumbnail/8.jpg +0 -0
  193. package/components/profile/backgrounds/thumbnail/9.jpg +0 -0
  194. package/components/profile/profile.page.styl +23 -0
  195. package/components/react/DomComponent.tsx +14 -0
  196. package/components/react/IconComponent.tsx +20 -0
  197. package/components/record/record.page.styl +26 -0
  198. package/components/rotator/index.js +75 -0
  199. package/components/rotator/rotator.page.styl +20 -0
  200. package/components/scratchpad/DataInput.page.styl +17 -0
  201. package/components/scratchpad/DataInputComponent.jsx +45 -0
  202. package/components/scratchpad/Editor.page.styl +13 -0
  203. package/components/scratchpad/Panel.page.styl +18 -0
  204. package/components/scratchpad/PanelButton.page.styl +15 -0
  205. package/components/scratchpad/PanelButtonComponent.jsx +19 -0
  206. package/components/scratchpad/PanelComponent.jsx +25 -0
  207. package/components/scratchpad/ScratchpadEditorContainer.tsx +137 -0
  208. package/components/scratchpad/ScratchpadPretestContainer.jsx +57 -0
  209. package/components/scratchpad/ScratchpadRecordsContainer.jsx +45 -0
  210. package/components/scratchpad/ScratchpadRecordsRowContainer.jsx +83 -0
  211. package/components/scratchpad/ScratchpadSettings.tsx +48 -0
  212. package/components/scratchpad/ScratchpadToolbarContainer.jsx +190 -0
  213. package/components/scratchpad/Tab.page.styl +24 -0
  214. package/components/scratchpad/Toolbar.page.styl +53 -0
  215. package/components/scratchpad/ToolbarComponent.jsx +85 -0
  216. package/components/scratchpad/index.tsx +132 -0
  217. package/components/scratchpad/reducers/editor.ts +24 -0
  218. package/components/scratchpad/reducers/index.ts +17 -0
  219. package/components/scratchpad/reducers/pretest.ts +34 -0
  220. package/components/scratchpad/reducers/records.ts +40 -0
  221. package/components/scratchpad/reducers/state.ts +10 -0
  222. package/components/scratchpad/reducers/ui.ts +152 -0
  223. package/components/scratchpad/scratchpad.page.styl +55 -0
  224. package/components/scratchpad/var.inc.styl +2 -0
  225. package/components/selectUser.tsx +16 -0
  226. package/components/signin/signInDialog.page.js +84 -0
  227. package/components/signin/signin_dialog.page.styl +57 -0
  228. package/components/smoothscroll/smoothscroll.page.js +44 -0
  229. package/components/socket/index.ts +68 -0
  230. package/components/star/star.page.styl +20 -0
  231. package/components/star/star.page.ts +58 -0
  232. package/components/sticky/sticky.page.js +66 -0
  233. package/components/tab/Tab.js +168 -0
  234. package/components/tab/tab.page.js +9 -0
  235. package/components/tab/tab.page.styl +105 -0
  236. package/components/tab/var.inc.styl +3 -0
  237. package/components/table/StyledTable.js +51 -0
  238. package/components/table/styledTable.page.js +8 -0
  239. package/components/table/table.page.styl +73 -0
  240. package/components/time/time.page.js +47 -0
  241. package/components/tooltip/Tooltip.js +49 -0
  242. package/components/tooltip/tooltip.page.js +29 -0
  243. package/components/tooltip/tooltip.page.styl +69 -0
  244. package/components/training/training.page.styl +25 -0
  245. package/components/upload.tsx +103 -0
  246. package/components/vote/vote.page.js +43 -0
  247. package/components/zipDownloader/index.ts +157 -0
  248. package/constant/domain.js +21 -0
  249. package/constant/message.js +5 -0
  250. package/constant/record.js +52 -0
  251. package/context.ts +11 -0
  252. package/entry.js +72 -0
  253. package/hydro.ts +112 -0
  254. package/index.ts +226 -0
  255. package/lazyload.ts +69 -0
  256. package/locales/en.yaml +71 -0
  257. package/locales/ko.yaml +823 -0
  258. package/locales/zh.yaml +1137 -0
  259. package/locales/zh_TW.yaml +1133 -0
  260. package/misc/Page.ts +49 -0
  261. package/misc/PageLoader.js +31 -0
  262. package/misc/float.styl +14 -0
  263. package/misc/grid.styl +1048 -0
  264. package/misc/immersive-background.jpg +0 -0
  265. package/misc/immersive-background@2x.jpg +0 -0
  266. package/misc/immersive.styl +23 -0
  267. package/misc/nothing.styl +13 -0
  268. package/misc/puzzled_twd2.svg +1 -0
  269. package/misc/section.styl +105 -0
  270. package/misc/slideout.styl +46 -0
  271. package/misc/structure.styl +158 -0
  272. package/misc/textalign.styl +11 -0
  273. package/misc/typography.styl +485 -0
  274. package/package.json +148 -0
  275. package/polyfill.ts +90 -0
  276. package/postcss.config.js +15 -0
  277. package/sentry.ts +26 -0
  278. package/service-worker.ts +265 -0
  279. package/setting.yaml +98 -0
  280. package/templates/about.html +14 -0
  281. package/templates/bsod.html +35 -0
  282. package/templates/components/comments_discussion.html +165 -0
  283. package/templates/components/comments_solution.html +171 -0
  284. package/templates/components/contest.html +12 -0
  285. package/templates/components/form.html +214 -0
  286. package/templates/components/home.html +20 -0
  287. package/templates/components/homework.html +8 -0
  288. package/templates/components/md_hint.html +39 -0
  289. package/templates/components/noscript_note.html +15 -0
  290. package/templates/components/nothing.html +6 -0
  291. package/templates/components/paginator.html +25 -0
  292. package/templates/components/problem.html +33 -0
  293. package/templates/components/record.html +21 -0
  294. package/templates/components/sidemenu.html +11 -0
  295. package/templates/components/user.html +49 -0
  296. package/templates/contest_balloon.html +48 -0
  297. package/templates/contest_clarification.html +103 -0
  298. package/templates/contest_detail.html +56 -0
  299. package/templates/contest_edit.html +259 -0
  300. package/templates/contest_main.html +146 -0
  301. package/templates/contest_manage.html +80 -0
  302. package/templates/contest_print.html +27 -0
  303. package/templates/contest_problemlist.html +231 -0
  304. package/templates/contest_scoreboard.html +46 -0
  305. package/templates/contest_scoreboard_download_html.html +71 -0
  306. package/templates/contest_user.html +47 -0
  307. package/templates/discussion_create.html +28 -0
  308. package/templates/discussion_detail.html +149 -0
  309. package/templates/discussion_edit.html +30 -0
  310. package/templates/discussion_main_or_node.html +47 -0
  311. package/templates/domain_base.html +26 -0
  312. package/templates/domain_create.html +55 -0
  313. package/templates/domain_dashboard.html +45 -0
  314. package/templates/domain_edit.html +6 -0
  315. package/templates/domain_group.html +51 -0
  316. package/templates/domain_join.html +47 -0
  317. package/templates/domain_join_applications.html +67 -0
  318. package/templates/domain_permission.html +66 -0
  319. package/templates/domain_role.html +71 -0
  320. package/templates/domain_user.html +86 -0
  321. package/templates/domain_user_raw.html +5 -0
  322. package/templates/error.html +25 -0
  323. package/templates/home_domain.html +64 -0
  324. package/templates/home_files.html +16 -0
  325. package/templates/home_messages.html +9 -0
  326. package/templates/home_security.html +224 -0
  327. package/templates/home_settings.html +21 -0
  328. package/templates/homework_detail.html +82 -0
  329. package/templates/homework_edit.html +138 -0
  330. package/templates/homework_files.html +24 -0
  331. package/templates/homework_main.html +76 -0
  332. package/templates/layout/basic.html +27 -0
  333. package/templates/layout/home_base.html +13 -0
  334. package/templates/layout/html5.html +74 -0
  335. package/templates/layout/immersive.html +22 -0
  336. package/templates/layout/mail.html +31 -0
  337. package/templates/layout/simple.html +4 -0
  338. package/templates/layout/wiki_base.html +16 -0
  339. package/templates/main.html +22 -0
  340. package/templates/manage_base.html +24 -0
  341. package/templates/manage_config.html +6 -0
  342. package/templates/manage_dashboard.html +27 -0
  343. package/templates/manage_script.html +56 -0
  344. package/templates/manage_setting.html +6 -0
  345. package/templates/manage_user_import.html +23 -0
  346. package/templates/manage_user_priv.html +76 -0
  347. package/templates/partials/category.html +19 -0
  348. package/templates/partials/contest.html +3 -0
  349. package/templates/partials/contest_balloon.html +37 -0
  350. package/templates/partials/contest_sidebar.html +150 -0
  351. package/templates/partials/contest_sidebar_management.html +56 -0
  352. package/templates/partials/contest_user.html +19 -0
  353. package/templates/partials/discussion_edit_form.html +45 -0
  354. package/templates/partials/discussion_list.html +50 -0
  355. package/templates/partials/discussion_nodes_widget.html +17 -0
  356. package/templates/partials/files.html +49 -0
  357. package/templates/partials/footer.html +108 -0
  358. package/templates/partials/hamburger.html +7 -0
  359. package/templates/partials/header_mobile.html +12 -0
  360. package/templates/partials/homepage/bulletin.html +7 -0
  361. package/templates/partials/homepage/contest.html +48 -0
  362. package/templates/partials/homepage/discussion.html +13 -0
  363. package/templates/partials/homepage/discussion_nodes.html +4 -0
  364. package/templates/partials/homepage/error.html +5 -0
  365. package/templates/partials/homepage/hitokoto.html +6 -0
  366. package/templates/partials/homepage/homework.html +45 -0
  367. package/templates/partials/homepage/problem_search.html +13 -0
  368. package/templates/partials/homepage/ranking.html +39 -0
  369. package/templates/partials/homepage/recent_problems.html +17 -0
  370. package/templates/partials/homepage/starred_problems.html +15 -0
  371. package/templates/partials/homepage/suggestion.html +34 -0
  372. package/templates/partials/homepage/training.html +50 -0
  373. package/templates/partials/homework.html +3 -0
  374. package/templates/partials/homework_default_penalty_rules.yaml +6 -0
  375. package/templates/partials/homework_sidebar.html +93 -0
  376. package/templates/partials/login_dialog.html +56 -0
  377. package/templates/partials/manage_user_priv.html +78 -0
  378. package/templates/partials/nav.html +138 -0
  379. package/templates/partials/problem-sidebar-information.html +25 -0
  380. package/templates/partials/problem.html +2 -0
  381. package/templates/partials/problem_category_dialog.html +43 -0
  382. package/templates/partials/problem_default.md +26 -0
  383. package/templates/partials/problem_description.html +33 -0
  384. package/templates/partials/problem_files.html +63 -0
  385. package/templates/partials/problem_list.html +68 -0
  386. package/templates/partials/problem_lucky.html +10 -0
  387. package/templates/partials/problem_sidebar.html +14 -0
  388. package/templates/partials/problem_sidebar_contest.html +43 -0
  389. package/templates/partials/problem_sidebar_homework.html +42 -0
  390. package/templates/partials/problem_sidebar_normal.html +152 -0
  391. package/templates/partials/problem_stat.html +3 -0
  392. package/templates/partials/scoreboard.html +79 -0
  393. package/templates/partials/setting.html +92 -0
  394. package/templates/partials/training_default.json +14 -0
  395. package/templates/partials/training_detail.html +153 -0
  396. package/templates/partials/user.html +2 -0
  397. package/templates/partials/user_detail/activity.html +18 -0
  398. package/templates/partials/user_detail/solution.html +29 -0
  399. package/templates/problem_config.html +39 -0
  400. package/templates/problem_detail.html +150 -0
  401. package/templates/problem_edit.html +111 -0
  402. package/templates/problem_files.html +91 -0
  403. package/templates/problem_hack.html +41 -0
  404. package/templates/problem_import.html +58 -0
  405. package/templates/problem_main.html +100 -0
  406. package/templates/problem_solution.html +55 -0
  407. package/templates/problem_statistics.html +96 -0
  408. package/templates/problem_submit.html +40 -0
  409. package/templates/ranking.html +81 -0
  410. package/templates/record_detail.html +134 -0
  411. package/templates/record_detail_status.html +93 -0
  412. package/templates/record_detail_summary.html +19 -0
  413. package/templates/record_main.html +142 -0
  414. package/templates/record_main_tr.html +35 -0
  415. package/templates/status.html +75 -0
  416. package/templates/training_detail.html +120 -0
  417. package/templates/training_edit.html +68 -0
  418. package/templates/training_files.html +64 -0
  419. package/templates/training_main.html +107 -0
  420. package/templates/user_changemail_mail.html +6 -0
  421. package/templates/user_changemail_mail_sent.html +9 -0
  422. package/templates/user_delete_pending.html +10 -0
  423. package/templates/user_detail.html +181 -0
  424. package/templates/user_login.html +46 -0
  425. package/templates/user_logout.html +13 -0
  426. package/templates/user_lostpass.html +27 -0
  427. package/templates/user_lostpass_mail.html +6 -0
  428. package/templates/user_lostpass_mail_sent.html +9 -0
  429. package/templates/user_lostpass_with_code.html +29 -0
  430. package/templates/user_register.html +22 -0
  431. package/templates/user_register_mail.html +6 -0
  432. package/templates/user_register_mail_sent.html +9 -0
  433. package/templates/user_register_with_code.html +35 -0
  434. package/templates/user_sudo.html +54 -0
  435. package/templates/user_sudo_redirect.html +18 -0
  436. package/templates/wiki_help.html +189 -0
  437. package/theme/bp6-compat.css +48 -0
  438. package/theme/dark.styl +397 -0
  439. package/theme/default.js +33 -0
  440. package/typed.d.ts +20 -0
  441. package/utils/base.ts +209 -0
  442. package/utils/base64.js +104 -0
  443. package/utils/db.ts +32 -0
  444. package/utils/index.ts +73 -0
  445. package/utils/loadReactRedux.ts +32 -0
  446. package/utils/mediaQuery.ts +13 -0
  447. package/utils/pjax.js +148 -0
  448. package/utils/slide.ts +57 -0
@@ -0,0 +1,18 @@
1
+ @import './var.inc.styl'
2
+
3
+ .scratchpad__panel-title
4
+ background: $primary-color
5
+ line-height: rem($panel-header-height)
6
+ padding: rem(0 5px)
7
+ font-size: rem($font-size-small)
8
+ color: #FFF
9
+
10
+ .splitpane-fill
11
+ display: flex
12
+ position: absolute
13
+ overflow: hidden
14
+ left: 0
15
+ width: 100%
16
+ top: 0
17
+ height: 100%
18
+ user-select: none
@@ -0,0 +1,15 @@
1
+ @import './var.inc.styl'
2
+
3
+ .scratchpad__panel-button
4
+ background: none
5
+ border: 0
6
+ line-height: rem($panel-header-height)
7
+ margin: 0
8
+ color: #FFF
9
+ padding: rem(0 5px)
10
+ cursor: pointer
11
+ font-size: rem($font-size-small)
12
+ outline: 0
13
+
14
+ &:hover
15
+ color: $tab-color
@@ -0,0 +1,19 @@
1
+ import classNames from 'classnames';
2
+ import PropTypes from 'prop-types';
3
+
4
+ export default function PanelButtonComponent(props) {
5
+ const {
6
+ className,
7
+ children,
8
+ ...rest
9
+ } = props;
10
+ const cn = classNames(className, 'scratchpad__panel-button');
11
+ return (
12
+ <button {...rest} className={cn}>{children}</button>
13
+ );
14
+ }
15
+
16
+ PanelButtonComponent.propTypes = {
17
+ className: PropTypes.string,
18
+ children: PropTypes.node,
19
+ };
@@ -0,0 +1,25 @@
1
+ import classNames from 'classnames';
2
+ import PropTypes from 'prop-types';
3
+ import React from 'react';
4
+
5
+ export default function PanelComponent(props) {
6
+ const {
7
+ title,
8
+ className,
9
+ children,
10
+ ...rest
11
+ } = props;
12
+ const cn = classNames(className, 'flex-col');
13
+ return (
14
+ <div {...rest} className={`${cn} splitpane-fill`}>
15
+ <div className="scratchpad__panel-title">{title}</div>
16
+ <div className="flex-col flex-fill">{children}</div>
17
+ </div>
18
+ );
19
+ }
20
+
21
+ PanelComponent.propTypes = {
22
+ title: PropTypes.node,
23
+ className: PropTypes.string,
24
+ children: PropTypes.node,
25
+ };
@@ -0,0 +1,137 @@
1
+ import type * as monaco from 'monaco-editor';
2
+ import React from 'react';
3
+ import { connect } from 'react-redux';
4
+ import { load } from 'vj/components/monaco/loader';
5
+ import { ctx } from 'vj/context';
6
+
7
+ interface ScratchpadOptions {
8
+ value?: string;
9
+ language?: string;
10
+ handleUpdateCode?: (str: string, event: monaco.editor.IModelContentChangedEvent) => void;
11
+ settings?: any;
12
+ pendingCommand?: string;
13
+ commandDone?: () => void;
14
+ }
15
+
16
+ export default connect((state: any) => ({
17
+ value: state.editor.code,
18
+ language: window.LANGS[state.editor.lang]?.monaco,
19
+ settings: state.ui.settings.config,
20
+ pendingCommand: state.ui.pendingCommand,
21
+ }), (dispatch) => ({
22
+ handleUpdateCode: (code: string) => {
23
+ dispatch({
24
+ type: 'SCRATCHPAD_EDITOR_UPDATE_CODE',
25
+ payload: code,
26
+ });
27
+ },
28
+ commandDone: () => {
29
+ dispatch({
30
+ type: 'SCRATCHPAD_TRIGGER_EDITOR_COMMAND',
31
+ payload: { command: '' },
32
+ });
33
+ },
34
+ }))(class MonacoEditor extends React.PureComponent<ScratchpadOptions> {
35
+ disposable: monaco.IDisposable[] = [];
36
+ __prevent_trigger_change_event = false;
37
+ model: monaco.editor.ITextModel;
38
+ editor: monaco.editor.IStandaloneCodeEditor;
39
+ containerElement: HTMLElement;
40
+
41
+ async componentDidMount() {
42
+ const value = this.props.value || '';
43
+ const { language } = this.props;
44
+ const { monaco, registerAction, customOptions } = await load([language]);
45
+ const uri = monaco.Uri.parse(`hydro:${UiContext.pdoc.pid || UiContext.pdoc.docId}.${language}`);
46
+ this.model = monaco.editor.getModel(uri) || monaco.editor.createModel(value, language, uri);
47
+ if (this.containerElement) {
48
+ const config: monaco.editor.IStandaloneEditorConstructionOptions = {
49
+ theme: 'vs-light',
50
+ fontFamily: UserContext.codeFontFamily,
51
+ ...customOptions,
52
+ lineNumbers: 'on',
53
+ glyphMargin: true,
54
+ lightbulb: { enabled: monaco.editor.ShowLightbulbIconMode.On },
55
+ model: this.model,
56
+ fontLigatures: '',
57
+ };
58
+ this.editor = monaco.editor.create(this.containerElement, config);
59
+ registerAction(this.editor, this.model);
60
+ this.disposable.push(
61
+ this.editor.onDidChangeModelContent((event) => {
62
+ if (!this.__prevent_trigger_change_event) {
63
+ this.props.handleUpdateCode?.(this.editor.getValue({ lineEnding: '\n', preserveBOM: false }), event);
64
+ }
65
+ }),
66
+ );
67
+ (window as any).editor = this.editor;
68
+ (window as any).monaco = monaco;
69
+ ctx.scratchpad.init(this.editor, monaco);
70
+ }
71
+ }
72
+
73
+ async componentDidUpdate(prevProps) {
74
+ const {
75
+ value, language,
76
+ } = this.props;
77
+ const { monaco } = await load([language]);
78
+ const { editor, model } = this;
79
+ const { LF } = monaco.editor.EndOfLinePreference;
80
+ if (model && editor && this.props.value != null && this.props.value !== model.getValue(LF, false)) {
81
+ this.__prevent_trigger_change_event = true;
82
+ editor.pushUndoStop();
83
+ model.pushEditOperations(
84
+ [],
85
+ [
86
+ {
87
+ range: model.getFullModelRange(),
88
+ text: value!,
89
+ },
90
+ ],
91
+ () => null,
92
+ );
93
+ editor.pushUndoStop();
94
+ this.__prevent_trigger_change_event = false;
95
+ }
96
+ if (model && editor && prevProps.language !== language) {
97
+ const val = model.getValue(LF, false);
98
+ model.dispose();
99
+ const uri = monaco.Uri.parse(`hydro:${UiContext.pdoc.pid || UiContext.pdoc.docId}.${language}`);
100
+ this.model = monaco.editor.getModel(uri) || monaco.editor.createModel(val, language, uri);
101
+ editor.setModel(this.model);
102
+ }
103
+ if (editor && this.props.settings) {
104
+ editor.updateOptions(this.props.settings);
105
+ }
106
+ if (this.props.pendingCommand) {
107
+ editor.focus();
108
+ editor.getAction(this.props.pendingCommand)?.run();
109
+ this.props.commandDone();
110
+ }
111
+ }
112
+
113
+ componentWillUnmount() {
114
+ if (this.editor) this.editor.dispose();
115
+ if (this.model) this.model.dispose();
116
+ this.disposable.map((i) => i.dispose());
117
+ }
118
+
119
+ assignRef = (component) => {
120
+ this.containerElement = component;
121
+ };
122
+
123
+ render() {
124
+ return (
125
+ <div
126
+ ref={this.assignRef}
127
+ style={{
128
+ height: '100%',
129
+ width: '100%',
130
+ }}
131
+ className="ScratchpadMonacoEditor"
132
+ >
133
+ <div className="loader-container"><div className="loader"></div></div>
134
+ </div>
135
+ );
136
+ }
137
+ });
@@ -0,0 +1,57 @@
1
+ import { Allotment } from 'allotment';
2
+ import { AnsiUp } from 'ansi_up';
3
+ import React from 'react';
4
+ import { connect } from 'react-redux';
5
+ import Icon from 'vj/components/react/IconComponent';
6
+ import { i18n } from 'vj/utils';
7
+ import DataInput from './DataInputComponent';
8
+ import Panel from './PanelComponent';
9
+
10
+ const AU = new AnsiUp();
11
+
12
+ const mapStateToProps = (state) => ({
13
+ input: state.pretest.input,
14
+ output: state.pretest.output,
15
+ rid: state.pretest.rid,
16
+ });
17
+
18
+ const mapDispatchToProps = (dispatch) => ({
19
+ handleDataChange(type, value) {
20
+ dispatch({
21
+ type: 'SCRATCHPAD_PRETEST_DATA_CHANGE',
22
+ payload: {
23
+ type,
24
+ value,
25
+ },
26
+ });
27
+ },
28
+ });
29
+
30
+ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadPretestContainer extends React.PureComponent {
31
+ render() {
32
+ return (
33
+ <Panel
34
+ title={(
35
+ <span>
36
+ <Icon name="edit" />
37
+ {' '}
38
+ {i18n('Pretest')}
39
+ </span>
40
+ )}
41
+ >
42
+ <Allotment>
43
+ <DataInput
44
+ title={i18n('Input')}
45
+ value={this.props.input}
46
+ onChange={(v) => this.props.handleDataChange('input', v)}
47
+ />
48
+ <DataInput
49
+ title={i18n('Output')}
50
+ value={AU.ansi_to_html(this.props.output)}
51
+ html
52
+ />
53
+ </Allotment>
54
+ </Panel>
55
+ );
56
+ }
57
+ });
@@ -0,0 +1,45 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ import { connect } from 'react-redux';
4
+ import Icon from 'vj/components/react/IconComponent';
5
+ import { i18n } from 'vj/utils';
6
+ import Panel from './PanelComponent';
7
+ import ScratchpadRecordsRow from './ScratchpadRecordsRowContainer';
8
+
9
+ const mapStateToProps = (state) => ({
10
+ rows: state.records.rows,
11
+ isLoading: state.ui.records.isLoading,
12
+ });
13
+
14
+ export default connect(mapStateToProps)(class ScratchpadRecordsContainer extends React.PureComponent {
15
+ render() {
16
+ const cn = classNames('data-table is--full-row scratchpad__records__table', {
17
+ loading: this.props.isLoading,
18
+ });
19
+ return (
20
+ <Panel
21
+ title={(
22
+ <span>
23
+ <Icon name="flag" />
24
+ {' '}
25
+ {i18n('Records')}
26
+ </span>
27
+ )}
28
+ >
29
+ <table className={cn}>
30
+ <colgroup>
31
+ <col className="col--detail" />
32
+ <col className="col--memory" />
33
+ <col className="col--time" />
34
+ <col className="col--at" />
35
+ </colgroup>
36
+ <tbody>
37
+ {this.props.rows.map((rowId) => (
38
+ <ScratchpadRecordsRow key={rowId} id={rowId} />
39
+ ))}
40
+ </tbody>
41
+ </table>
42
+ </Panel>
43
+ );
44
+ }
45
+ });
@@ -0,0 +1,83 @@
1
+ import classNames from 'classnames';
2
+ import _ from 'lodash';
3
+ import moment from 'moment';
4
+ import React from 'react';
5
+ import { connect } from 'react-redux';
6
+ import TimeAgo from 'timeago-react';
7
+ import { STATUS_CODES, STATUS_SCRATCHPAD_SHORT_TEXTS, STATUS_SCRATCHPAD_SHOW_DETAIL_FLAGS, STATUS_TEXTS } from 'vj/constant/record';
8
+ import {
9
+ emulateAnchorClick, i18n, mongoId, substitute,
10
+ } from 'vj/utils';
11
+
12
+ const shouldShowDetail = (data) => STATUS_SCRATCHPAD_SHOW_DETAIL_FLAGS[data.status] && data.testCases?.length;
13
+
14
+ const getRecordDetail = (data) => {
15
+ if (!shouldShowDetail(data)) {
16
+ return (
17
+ <span className={`record-status--text ${STATUS_CODES[data.status]}`}>
18
+ {STATUS_TEXTS[data.status]}
19
+ </span>
20
+ );
21
+ }
22
+ const stat = _.pick(
23
+ _.groupBy(data.testCases || [], 'status'),
24
+ _.keys(STATUS_SCRATCHPAD_SHORT_TEXTS),
25
+ );
26
+ return _.map(STATUS_SCRATCHPAD_SHORT_TEXTS, (text, status) => {
27
+ const count = (stat[status] && stat[status].length) || 0;
28
+ const cn = classNames('icol icol--stat', {
29
+ 'record-status--text': count > 0,
30
+ [STATUS_CODES[data.status]]: count > 0,
31
+ });
32
+ return (
33
+ <span key={text} className={cn}>
34
+ {text}: {count}
35
+ </span>
36
+ );
37
+ });
38
+ };
39
+
40
+ const mapStateToProps = (state) => ({
41
+ items: state.records.items,
42
+ });
43
+
44
+ const mergeProps = (stateProps, dispatchProps, ownProps) => ({
45
+ ...dispatchProps,
46
+ data: stateProps.items[ownProps.id],
47
+ });
48
+
49
+ export default connect(mapStateToProps, null, mergeProps)(class ScratchpadRecordsRowContainer extends React.PureComponent {
50
+ handleRowClick(ev, id) {
51
+ const url = substitute(
52
+ decodeURIComponent(UiContext.getRecordDetailUrl),
53
+ { rid: id },
54
+ );
55
+ emulateAnchorClick(ev, url, true);
56
+ }
57
+
58
+ render() {
59
+ const { data } = this.props;
60
+ const submitAt = mongoId(data._id).timestamp * 1000;
61
+ // Is pretest
62
+ return data.contest?.toString() === '000000000000000000000000' ? null : (
63
+ <tr onClick={(ev) => this.handleRowClick(ev, data._id)}>
64
+ <td className={`col--detail record-status--border ${STATUS_CODES[data.status]}`}>
65
+ <span className={`icon record-status--icon ${STATUS_CODES[data.status]}`}></span>
66
+ <span className="icol icol--pretest"></span>
67
+ {getRecordDetail(data)}
68
+ </td>
69
+ <td className="col--memory">
70
+ {shouldShowDetail(data) ? `${Math.ceil(data.memory / 1000)} MB` : '-'}
71
+ </td>
72
+ <td className="col--time">
73
+ {shouldShowDetail(data) ? `${(data.time / 1000).toFixed(1)}s` : '-'}
74
+ </td>
75
+ <td className="col--at">
76
+ <time data-tooltip={moment(submitAt).format('YYYY-MM-DD HH:mm:ss')}>
77
+ <TimeAgo datetime={submitAt} locale={i18n('timeago_locale')} />
78
+ </time>
79
+ </td>
80
+ </tr>
81
+ );
82
+ }
83
+ });
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import { useDispatch, useSelector } from 'react-redux';
3
+ import { i18n } from 'vj/utils';
4
+ import { RootState } from './reducers';
5
+
6
+ export default function ScratchpadSettings() {
7
+ const config = useSelector((state: RootState) => state.ui.settings.config);
8
+ const parsed = React.useMemo(() => {
9
+ const settings = { fontSize: 14, tabSize: 4 };
10
+ try {
11
+ Object.assign(settings, config);
12
+ } catch (e) { }
13
+ return settings;
14
+ }, [config]);
15
+ const dispatch = useDispatch();
16
+ function dispatcher(setting: string, numeric = false) {
17
+ return (ev) => {
18
+ const val = ev?.target?.value || ev;
19
+ dispatch({ type: 'SCRATCHPAD_SETTING_UPDATE', payload: { setting, value: numeric ? +val : val } });
20
+ };
21
+ }
22
+ function openThemeSelect() {
23
+ dispatch({ type: 'SCRATCHPAD_TRIGGER_EDITOR_COMMAND', payload: { command: 'hydro.changeEditorTheme' } });
24
+ }
25
+ // TODO update style
26
+ return <div>
27
+ <div className="row"><div className="medium-6 columns">
28
+ <label>
29
+ {i18n('Font size')}:
30
+ <div className="textbox-container">
31
+ <input type="number" step="1" value={parsed.fontSize} onChange={dispatcher('fontSize', true)} className="textbox" />
32
+ </div>
33
+ </label>
34
+ </div></div>
35
+ <div className="row"><div className="medium-6 columns">
36
+ <label>
37
+ {i18n('Tab size')}:
38
+ <div className="textbox-container">
39
+ <input type="number" step="1" value={parsed.tabSize} onChange={dispatcher('tabSize', true)} className="textbox" />
40
+ </div>
41
+ </label>
42
+ </div></div>
43
+ <div className="row"><div className="columns">
44
+ <p>{i18n('Theme')}: </p>
45
+ <button className="rounded primary button" onClick={openThemeSelect}>{i18n('Open theme select')}</button>
46
+ </div></div>
47
+ </div>;
48
+ }
@@ -0,0 +1,190 @@
1
+ import _ from 'lodash';
2
+ import PropTypes from 'prop-types';
3
+ import React from 'react';
4
+ import { connect } from 'react-redux';
5
+ import Icon from 'vj/components/react/IconComponent';
6
+ import { getAvailableLangs, i18n, request } from 'vj/utils';
7
+ import Toolbar, {
8
+ ToolbarButtonComponent as ToolbarButton,
9
+ ToolbarItemComponent as ToolbarItem,
10
+ ToolbarSplitComponent as ToolbarSplit,
11
+ } from './ToolbarComponent';
12
+
13
+ const mapStateToProps = (state) => ({
14
+ pretestVisible: state.ui.pretest.visible,
15
+ recordsVisible: state.ui.records.visible,
16
+ isPosting: state.ui.isPosting,
17
+ isRunning: state.pretest.isRunning,
18
+ pretestWaitSec: state.ui.pretestWaitSec,
19
+ submitWaitSec: state.ui.submitWaitSec,
20
+ editorLang: state.editor.lang,
21
+ editorCode: state.editor.code,
22
+ pretestInput: state.pretest.input,
23
+ });
24
+
25
+ const mapDispatchToProps = (dispatch) => ({
26
+ togglePanel(uiElement) {
27
+ dispatch({
28
+ type: 'SCRATCHPAD_UI_TOGGLE_VISIBILITY',
29
+ payload: { uiElement },
30
+ });
31
+ },
32
+ setEditorLanguage(lang) {
33
+ dispatch({
34
+ type: 'SCRATCHPAD_EDITOR_SET_LANG',
35
+ payload: lang,
36
+ });
37
+ },
38
+ postPretest(props) {
39
+ const req = request.post(UiContext.postSubmitUrl, {
40
+ lang: props.editorLang,
41
+ code: props.editorCode,
42
+ input: [props.pretestInput],
43
+ pretest: true,
44
+ });
45
+ dispatch({
46
+ type: 'SCRATCHPAD_POST_PRETEST',
47
+ payload: req,
48
+ });
49
+ },
50
+ postSubmit(props) {
51
+ const req = request.post(UiContext.postSubmitUrl, {
52
+ lang: props.editorLang,
53
+ code: props.editorCode,
54
+ });
55
+ dispatch({
56
+ type: 'SCRATCHPAD_POST_SUBMIT',
57
+ payload: req,
58
+ });
59
+ },
60
+ loadSubmissions() {
61
+ dispatch({
62
+ type: 'SCRATCHPAD_RECORDS_LOAD_SUBMISSIONS',
63
+ payload: request.get(UiContext.getSubmissionsUrl),
64
+ });
65
+ },
66
+ tick() {
67
+ dispatch({
68
+ type: 'SCRATCHPAD_WAITING_TICK',
69
+ });
70
+ },
71
+ });
72
+
73
+ const availableLangs = getAvailableLangs(UiContext.pdoc.config.langs);
74
+ const keys = Object.keys(availableLangs);
75
+
76
+ export default connect(mapStateToProps, mapDispatchToProps)(class ScratchpadToolbarContainer extends React.PureComponent {
77
+ static contextTypes = {
78
+ store: PropTypes.object,
79
+ };
80
+
81
+ constructor(props) {
82
+ super(props);
83
+ if (!availableLangs[this.props.editorLang]) {
84
+ // preference not allowed
85
+ const key = this.props.editorLang ? keys.filter((i) => availableLangs[i].pretest)
86
+ .find((i) => availableLangs[i].pretest.split('.')[0] === this.props.editorLang.split('.')[0]) : '';
87
+ this.props.setEditorLanguage(key || keys[0]);
88
+ }
89
+ }
90
+
91
+ componentDidMount() {
92
+ if (this.props.recordsVisible) this.props.loadSubmissions();
93
+ }
94
+
95
+ componentDidUpdate() {
96
+ if (this.props.pretestWaitSec > 0 || this.props.submitWaitSec > 0) {
97
+ setTimeout(() => this.props.tick(), 1000);
98
+ }
99
+ }
100
+
101
+ render() {
102
+ let canUsePretest = UiContext.pdoc.config?.type === 'default';
103
+ const langInfo = availableLangs[this.props.editorLang];
104
+ if (UiContext.pdoc.config?.type === 'remote_judge' && langInfo) {
105
+ if (langInfo.pretest) canUsePretest = true;
106
+ if (langInfo.validAs && !langInfo.hidden) canUsePretest = true;
107
+ }
108
+ if (langInfo?.pretest === false) canUsePretest = false;
109
+ return (
110
+ <Toolbar>
111
+ {canUsePretest && (
112
+ <ToolbarButton
113
+ disabled={this.props.isPosting || this.props.isRunning || !!this.props.pretestWaitSec}
114
+ className="scratchpad__toolbar__pretest"
115
+ onClick={() => this.props.postPretest(this.props)}
116
+ data-global-hotkey="f9"
117
+ data-tooltip={`${i18n('Pretest Your Code')} (F9)`}
118
+ >
119
+ <Icon name="debug" />
120
+ {' '}
121
+ {i18n('Run Pretest')}
122
+ {' '}
123
+ {this.props.pretestWaitSec ? `(${this.props.pretestWaitSec}s)` : '(F9)'}
124
+ </ToolbarButton>
125
+ )}
126
+ <ToolbarButton
127
+ disabled={this.props.isPosting || !!this.props.submitWaitSec}
128
+ className="scratchpad__toolbar__submit"
129
+ onClick={() => this.props.postSubmit(this.props)}
130
+ data-global-hotkey="f10"
131
+ data-tooltip={`${i18n('Submit Your Code')} (F10)`}
132
+ >
133
+ <Icon name="play" />
134
+ {' '}
135
+ {i18n('Submit Solution')}
136
+ {' '}
137
+ {this.props.submitWaitSec ? `(${this.props.submitWaitSec}s)` : '(F10)'}
138
+ </ToolbarButton>
139
+ <ToolbarButton
140
+ data-global-hotkey="alt+q"
141
+ data-tooltip={`${i18n('Quit Scratchpad')} (Alt+Q)`}
142
+ name="problem-sidebar__quit-scratchpad"
143
+ >
144
+ <Icon name="close" />
145
+ {' '}
146
+ {i18n('Exit')}
147
+ {' '}
148
+ (Alt+Q)
149
+ </ToolbarButton>
150
+ <ToolbarItem>
151
+ <select
152
+ className="select"
153
+ disabled={this.props.isPosting}
154
+ value={this.props.editorLang}
155
+ onChange={(ev) => this.props.setEditorLanguage(ev.target.value)}
156
+ >
157
+ {_.map(availableLangs, (val, key) => (
158
+ <option value={key} key={key}>{val.display}</option>
159
+ ))}
160
+ </select>
161
+ </ToolbarItem>
162
+ <ToolbarSplit />
163
+ {canUsePretest && (
164
+ <ToolbarButton
165
+ activated={this.props.pretestVisible}
166
+ onClick={() => this.props.togglePanel('pretest')}
167
+ data-global-hotkey="alt+p"
168
+ data-tooltip={`${i18n('Toggle Pretest Panel')} (Alt+P)`}
169
+ >
170
+ <Icon name="edit" />
171
+ {' '}
172
+ {i18n('Pretest')}
173
+ </ToolbarButton>
174
+ )}
175
+ {UiContext.canViewRecord && (
176
+ <ToolbarButton
177
+ activated={this.props.recordsVisible}
178
+ onClick={() => this.props.togglePanel('records')}
179
+ data-global-hotkey="alt+r"
180
+ data-tooltip={`${i18n('Toggle Records Panel')} (Alt+R)`}
181
+ >
182
+ <Icon name="flag" />
183
+ {' '}
184
+ {i18n('Records')}
185
+ </ToolbarButton>
186
+ )}
187
+ </Toolbar>
188
+ );
189
+ }
190
+ });
@@ -0,0 +1,24 @@
1
+ .scratchpad__tablist
2
+ user-select: none
3
+
4
+ div
5
+ display: flex
6
+ width: 50px
7
+ height: 50px
8
+ font-size: 28px
9
+ flex-direction: row
10
+ align-items: center
11
+ justify-content: center
12
+ margin: rem(8px) 0
13
+ fill: #666
14
+ color: #666
15
+ cursor: pointer
16
+ &:hover
17
+ fill: #000
18
+ color: #000
19
+
20
+ div.scratchpad__tab-active
21
+ border-left: 4px solid #000
22
+ fill: #000
23
+ color: #000
24
+ cursor: default