mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: auto mention when reply
This commit is contained in:
1 parent
9a1d39a693
commit
1ddde7d090
3 files changed
+7
-7
No files matched your search
@@ -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,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",
|
||||
|
||||
Reference in new issue
Block a user