mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: remove emojify.js
This commit is contained in:
1 parent
84c38cb571
commit
5f527658f8
27 files changed
+57
-138
No files matched your search
@@ -45,6 +45,7 @@ module.exports = {
|
||||
UserContext: true,
|
||||
LOCALES: true,
|
||||
window: true,
|
||||
JQuery: true,
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
|
||||
@@ -211,7 +211,6 @@ export default function (env = {}) {
|
||||
new CopyWebpackPlugin({
|
||||
patterns: [
|
||||
{ from: root('static') },
|
||||
{ from: root(`${dirname(require.resolve('emojify.js/package.json'))}/dist/images/basic`), to: 'img/emoji/' },
|
||||
{ from: root(`${dirname(require.resolve('vditor/package.json'))}`), to: 'vditor/' },
|
||||
],
|
||||
}),
|
||||
|
||||
File renamed without changes.
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
|
||||
const datepickerPage = new AutoloadPage('datepickerPage', async () => {
|
||||
if ($('[data-pick-date]').length > 0) {
|
||||
if ($('[data-pick-date]').length) {
|
||||
await import('pickadate/lib/picker.date');
|
||||
$('[data-pick-date]').pickadate({
|
||||
format: 'yyyy-m-d',
|
||||
@@ -9,7 +9,7 @@ const datepickerPage = new AutoloadPage('datepickerPage', async () => {
|
||||
clear: false,
|
||||
});
|
||||
}
|
||||
if ($('[data-pick-time]').length > 0) {
|
||||
if ($('[data-pick-time]').length) {
|
||||
await import('pickadate/lib/picker.time');
|
||||
$('[data-pick-time]').pickatime({
|
||||
format: 'H:i',
|
||||
@@ -1,6 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import DOMAttachedObject from 'vj/components/DOMAttachedObject';
|
||||
|
||||
import zIndexManager from 'vj/utils/zIndexManager';
|
||||
|
||||
export default class DomDialog extends DOMAttachedObject {
|
||||
|
||||
File renamed without changes.
@@ -1,28 +0,0 @@
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
import delay from 'vj/utils/delay';
|
||||
import CmEditor from '.';
|
||||
|
||||
function runSubstitute($container) {
|
||||
$container.find('textarea[data-markdown]').get().forEach((element) => {
|
||||
CmEditor.getOrConstruct($(element));
|
||||
});
|
||||
$container.find('textarea[data-yaml]').get().forEach((element) => {
|
||||
CmEditor.getOrConstruct($(element), { language: 'yaml' });
|
||||
});
|
||||
$container.find('textarea[data-json]').get().forEach((element) => {
|
||||
CmEditor.getOrConstruct($(element), { language: 'json' });
|
||||
});
|
||||
$container.find('textarea[data-plain]').get().forEach((element) => {
|
||||
CmEditor.getOrConstruct($(element), { language: 'plain' });
|
||||
});
|
||||
}
|
||||
|
||||
const cmEditorPage = new AutoloadPage('cmEditorPage', () => {
|
||||
runSubstitute($('body'));
|
||||
$(document).on('vjContentNew', async (e) => {
|
||||
await delay(0);
|
||||
runSubstitute($(e.target));
|
||||
});
|
||||
});
|
||||
|
||||
export default cmEditorPage;
|
||||
@@ -0,0 +1,21 @@
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
import delay from 'vj/utils/delay';
|
||||
import CmEditor from '.';
|
||||
|
||||
function runSubstitute($container: JQuery<Document | HTMLElement>) {
|
||||
for (const language of ['markdown', 'yaml', 'json', 'plain']) {
|
||||
$container.find(`textarea[data-${language}]`).get().forEach((element) => {
|
||||
CmEditor.getOrConstruct($(element), { language });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const cmEditorPage = new AutoloadPage('cmEditorPage', () => {
|
||||
runSubstitute($('body'));
|
||||
$(document).on('vjContentNew', async (e) => {
|
||||
await delay(0);
|
||||
runSubstitute($(e.target));
|
||||
});
|
||||
});
|
||||
|
||||
export default cmEditorPage;
|
||||
File renamed without changes.
@@ -1,6 +0,0 @@
|
||||
.emoji
|
||||
width: 1em
|
||||
height: 1em
|
||||
display: inline-block
|
||||
background-size: contain
|
||||
vertical-align: baseline
|
||||
@@ -1,21 +0,0 @@
|
||||
import emojify from 'emojify.js';
|
||||
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
|
||||
function runEmojify($container) {
|
||||
if ($container.is('[data-emoji-enabled]')) {
|
||||
emojify.run($container[0]);
|
||||
return;
|
||||
}
|
||||
$container.find('[data-emoji-enabled]').get().forEach((element) => emojify.run(element));
|
||||
}
|
||||
|
||||
const emojifyPage = new AutoloadPage('emojifyPage', () => {
|
||||
emojify.setConfig({
|
||||
img_dir: `${UiContext.cdn_prefix}img/emoji`,
|
||||
});
|
||||
runEmojify($('body'));
|
||||
$(document).on('vjContentNew', (e) => runEmojify($(e.target)));
|
||||
});
|
||||
|
||||
export default emojifyPage;
|
||||
+4
-10
@@ -4,18 +4,12 @@ import { slideUp, slideDown } from 'vj/utils/slide';
|
||||
import responsiveCutoff from 'vj/breakpoints.json';
|
||||
|
||||
const footerPage = new AutoloadPage('footerPage', () => {
|
||||
if ($('.footer').length === 0) {
|
||||
return;
|
||||
}
|
||||
$('.footer__category.expandable > h1').click(async (ev) => {
|
||||
if (!isBelow(responsiveCutoff.mobile)) {
|
||||
return;
|
||||
}
|
||||
if (!$('.footer').length) return;
|
||||
$('.footer__category.expandable > h1').on('click', async (ev) => {
|
||||
if (!isBelow(responsiveCutoff.mobile)) return;
|
||||
const $category = $(ev.currentTarget).closest('.footer__category');
|
||||
const $list = $category.find('.footer__category__expander');
|
||||
if ($category.hasClass('animating')) {
|
||||
return;
|
||||
}
|
||||
if ($category.hasClass('animating')) return;
|
||||
$category.addClass('animating');
|
||||
if ($category.hasClass('expanded')) {
|
||||
$category.removeClass('expanded');
|
||||
+1
-5
@@ -5,11 +5,7 @@ const formPage = new AutoloadPage('formPage', () => {
|
||||
$(document).on('vjFormDisableUpdate', 'input, select, textarea', (ev) => {
|
||||
const $input = $(ev.currentTarget);
|
||||
const $formItem = $input.closest('.form__item');
|
||||
if ($input.prop('disabled')) {
|
||||
$formItem.addClass('is--disabled');
|
||||
} else {
|
||||
$formItem.removeClass('is--disabled');
|
||||
}
|
||||
$formItem[$input.prop('disabled') ? 'addClass' : 'removeClass']('is--disabled');
|
||||
});
|
||||
|
||||
const submitting = {};
|
||||
File renamed without changes.
+2
-8
@@ -1,17 +1,11 @@
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
import load from 'vj/components/wastyle/index';
|
||||
import Notification from 'vj/components/notification/index';
|
||||
import tpl from 'vj/utils/tpl';
|
||||
import i18n from 'vj/utils/i18n';
|
||||
|
||||
const highlighterPage = new AutoloadPage('highlighterPage', () => {
|
||||
Promise.all([
|
||||
import('./prismjs'),
|
||||
UserContext.formatCode ? load() : [true, null],
|
||||
]).then(([{ default: prismjs }, [success, format]]) => {
|
||||
if (!success) Notification.error(`Astyle load fail: ${format}`);
|
||||
import('./prismjs').then(({ default: prismjs }) => {
|
||||
function runHighlight($container) {
|
||||
prismjs.highlightBlocks($container, success ? format : null);
|
||||
prismjs.highlightBlocks($container);
|
||||
$container.find('pre code').get().forEach((code) => {
|
||||
const $code = $(code);
|
||||
const $root = $code.parent().parent();
|
||||
@@ -70,7 +70,7 @@ function addInvisibles(grammar) {
|
||||
for (const name in grammar) {
|
||||
if (Object.prototype.hasOwnProperty.call(grammar, name) && !invisibles[name]) {
|
||||
if (name === 'rest') addInvisibles(grammar.rest);
|
||||
else handlerInvisiblesToken(grammar, name); // eslint-disable-line no-use-before-define
|
||||
else handlerInvisiblesToken(grammar, name); // eslint-disable-line @typescript-eslint/no-use-before-define
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,19 +95,12 @@ Prism.hooks.add('before-highlight', (env) => {
|
||||
});
|
||||
|
||||
const prismjsApiWrap = {
|
||||
highlightBlocks: ($dom, format) => {
|
||||
highlightBlocks: ($dom) => {
|
||||
$dom.find('pre code').get().forEach((code) => {
|
||||
const $code = $(code);
|
||||
const $pre = $code.parent();
|
||||
$pre.addClass('syntax-hl');
|
||||
const language = ($(code).attr('class') || '').trim();
|
||||
const astyle = language.match(/astyle-([a-z]+)/);
|
||||
if (format && astyle && astyle[1]) {
|
||||
const [success, result] = format($code.text(), `${UserContext.astyleOptions.trim()} mode=${astyle[1]}`);
|
||||
code.original = $code.text();
|
||||
if (!success) Notification.error('Code format fail');
|
||||
else $code.text(result);
|
||||
}
|
||||
// try to map the language name
|
||||
const m = language.match(/language-([a-z]+)/);
|
||||
if (m && m[1]) {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"./public",
|
||||
],
|
||||
"compilerOptions": {
|
||||
"resolveJsonModule": true,
|
||||
"jsx": "react",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "ES2020",
|
||||
|
||||
@@ -23,7 +23,6 @@ problem_edit: Problem Edit
|
||||
problem_import: Import Problem
|
||||
problem_main: Problem Set
|
||||
problem_solution: Problem Solution
|
||||
problem_statistics: Problem Statistics
|
||||
problem_submit: Problem Submit
|
||||
problem_type.default: 'Type: Default'
|
||||
problem_type.fileio: 'Type: FileIO ({0})'
|
||||
|
||||
@@ -524,7 +524,6 @@ problem_edit: 문제 수정
|
||||
problem_import: 문제 가져오기
|
||||
problem_main: 문제
|
||||
problem_solution: 문제 해설
|
||||
problem_statistics: 문제 통계
|
||||
problem_submit: 제출
|
||||
problem-category-delim: '|'
|
||||
problem-subcategory-delim: 、
|
||||
|
||||
@@ -566,7 +566,6 @@ problem_edit: 编辑题目
|
||||
problem_import: 导入题目
|
||||
problem_main: 题库
|
||||
problem_solution: 题解
|
||||
problem_statistics: 题目统计
|
||||
problem_submit: 递交代码
|
||||
problem_type.default: 传统题
|
||||
problem_type.fileio: '文件IO ({0})'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.22.17",
|
||||
"version": "4.23.0",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
@@ -11,9 +11,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blockly/block-extension-tooltip": "^1.0.19",
|
||||
"@blueprintjs/core": "^3.50.4",
|
||||
"@blueprintjs/core": "^3.51.0",
|
||||
"@blueprintjs/icons": "^3.30.2",
|
||||
"@blueprintjs/select": "^3.18.6",
|
||||
"@blueprintjs/select": "^3.18.7",
|
||||
"@hydrooj/utils": "workspace:*",
|
||||
"@types/jquery": "^3.5.6",
|
||||
"@types/json-schema": "^7.0.9",
|
||||
@@ -31,10 +31,9 @@
|
||||
"css-loader": "^4.3.0",
|
||||
"diff-dom": "^4.2.2",
|
||||
"echarts": "^5.2.1",
|
||||
"emojify.js": "^1.1.0",
|
||||
"emojis-keywords": "2.0.0",
|
||||
"emojis-list": "2.1.0",
|
||||
"esbuild-loader": "^2.15.1",
|
||||
"esbuild-loader": "^2.16.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-airbnb": "^18.2.1",
|
||||
"eslint-import-resolver-webpack": "^0.13.1",
|
||||
@@ -59,9 +58,9 @@
|
||||
"jquery.transit": "^0.9.12",
|
||||
"mini-css-extract-plugin": "^1.6.2",
|
||||
"moment": "^2.29.1",
|
||||
"monaco-editor": "^0.27.0",
|
||||
"monaco-editor-webpack-plugin": "^4.1.2",
|
||||
"nanoid": "^3.1.28",
|
||||
"monaco-editor": "^0.29.0",
|
||||
"monaco-editor-webpack-plugin": "^4.2.0",
|
||||
"nanoid": "^3.1.29",
|
||||
"normalize.css": "^8.0.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"pickadate": "^3.6.4",
|
||||
@@ -101,7 +100,7 @@
|
||||
"webpackbar": "^5.0.0-3"
|
||||
},
|
||||
"dependencies": {
|
||||
"esbuild": "^0.12.29",
|
||||
"esbuild": "^0.13.4",
|
||||
"js-yaml": "^4.1.0",
|
||||
"jsesc": "^3.0.2",
|
||||
"katex": "^0.13.18",
|
||||
@@ -113,9 +112,9 @@
|
||||
"markdown-it-mark": "^3.0.1",
|
||||
"markdown-it-merge-cells": "^1.0.1",
|
||||
"markdown-it-table-of-contents": "^0.5.2",
|
||||
"mongodb": "^3.7.1",
|
||||
"mongodb": "^3.7.2",
|
||||
"nunjucks": "^3.2.3",
|
||||
"streamsaver": "^2.0.5",
|
||||
"xss": "^1.0.9"
|
||||
"xss": "^1.0.10"
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{% extends "layout/basic.html" %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _('Submission Statistics') }}</h1>
|
||||
</div>
|
||||
<div class="section__body">
|
||||
{{ _('Swx Template') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
{% set owner_udoc = udoc %}
|
||||
{% include "partials/problem_sidebar.html" %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user