ui: auto mention when reply

This commit is contained in:
undefined committed 2021-09-20 23:34:21 +08:00
1 parent 9a1d39a693
commit 1ddde7d090
3 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ import WebpackDevServer from 'webpack-dev-server';
import gulp from 'gulp';
import log from 'fancy-log';
import chalk from 'chalk';
import package from '../package.json';
import pkg from '../package.json';
import root from './utils/root';
import gulpConfig from './config/gulp';
import webpackConfig from './config/webpack';
@@ -78,7 +78,7 @@ async function main() {
await runGulp();
await runWebpack(argv.options);
if (fs.existsSync('public/hydro.js')) {
fs.copyFileSync('public/hydro.js', `public/hydro-${package.version}.js`);
fs.copyFileSync('public/hydro.js', `public/hydro-${pkg.version}.js`);
}
if (argv.options.production) {
fs.removeSync('public/vditor/dist/js/mathjax');
@@ -109,14 +109,14 @@ async function onCommentClickReplyComment(ev, options = {}) {
async function onCommentClickReplyReply(ev) {
const $evTarget = $(ev.currentTarget);
const $mediaBody = $evTarget.closest('.media__body');
const username = $mediaBody
.find('.user-profile-name').eq(0)
.text();
const uid = $mediaBody
.find('.user-profile-name')
.attr('href').split('/user/')[1];
$evTarget
.closest('.dczcomments__item')
.find('[name="dczcomments__op-reply-comment"]').eq(0)
.trigger('click', { initialText: `@${username.trim()}: ` });
.trigger('click', { initialText: `@[](/user/${uid.trim()}) ` });
}
async function onCommentClickEdit(mode, ev) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.22.1",
"version": "4.22.2",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",