This commit is contained in:
Liwanyi 2023-04-07 16:53:18 +08:00
parent e623d6fd14
commit 4b51e156bb
38 changed files with 1961 additions and 144 deletions

View File

@ -3,10 +3,8 @@
* 并生成日期时间与版本号
*/
import rollupConfig from "./rollup-prod.config.js";
import { readFileSync, rmSync, writeFileSync } from "fs";
let startTime = Date.now();
import { readFileSync, writeFileSync } from "fs";
import { prodConfig } from "./rollup.config.js";
let date = new Date();
let version = process.env.npm_package_version;
@ -32,11 +30,11 @@ let metaData =
// ==/UserScript==
`
const data = readFileSync('./' + rollupConfig.output.file, 'utf8');
const data = readFileSync('./' + prodConfig.output.file, 'utf8');
writeFileSync(
'./release.min.user.js',
metaData + data.replace('$$WUHU_DEV_VERSION$$', version),
'utf8'
);
rmSync('./' + rollupConfig.output.file);
console.log(`版本 ${ version } 构建完成, build.mjs耗时${ Date.now() - startTime }ms`);
// rmSync('./' + prodConfig.output.file);
console.log(`版本 ${ version } 构建完成`);

6
css-module.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
// declare module "*.module.css" {
// const css: string;
// const classes: { [key: string]: string };
// export default classes;
// export { css };
// }

21
custom-injector.js Normal file
View File

@ -0,0 +1,21 @@
export const customInjector = (varName) => {
let rt = ((__var) => {
const inject = (ob) => {
if (document && document.head) {
ob?.disconnect();
const style = document.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML = __var;
document.head.appendChild(style);
}
};
if (document && document.head) {
inject();
} else {
new MutationObserver((_, ob) => {
inject(ob);
}).observe(document.documentElement, { childList: true });
}
}).toString();
return `(${ rt })(${ varName })`;
};

23
global.d.ts vendored
View File

@ -108,23 +108,16 @@ declare interface TornGetActionParams {
}
declare module "*.html" {
const value: string;
export default value;
const html: string;
export default html;
}
declare module "*.css" {
const value: string;
export default value;
declare module "*.module.css" {
const css: string;
// const classes: { [key: string]: string };
// export default classes;
export default css;
// export { css };
}
// declare module '*.vue' {
// import type { DefineComponent } from 'vue'
// const component: DefineComponent<{}, {}, any>
//
// export interface HTMLAttributes {
// vModel?: any;
// }
// export default component
// }
declare function GM_xmlhttpRequest(init: any): void;

1769
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
{
"name": "wuhu-torn-helper",
"version": "0.8.5",
"version": "0.8.6",
"description": "芜湖助手",
"scripts": {
"release": "cross-env NODE_ENV=production rollup -c rollup-prod.config.js && node build.mjs",
"release": "cross-env NODE_ENV=production rollup -c && node build.mjs",
"watch": "cross-env NODE_ENV=development rollup -c -w",
"rollup": "cross-env NODE_ENV=development rollup -c"
},
@ -19,11 +19,13 @@
"@vitejs/plugin-vue": "^4.0.0",
"@vue/tsconfig": "^0.1.3",
"cross-env": "^7.0.3",
"just-clone": "^6.2.0",
"npm": "^8.19.2",
"reflect-metadata": "^0.1.13",
"rollup": "^2.79.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-string-html": "^1.0.0",
"rollup-plugin-styles": "^4.0.0",
"rollup-plugin-typescript2": "^0.34.1",
"tslib": "^2.4.0",
"typescript": "^4.8.3",

File diff suppressed because one or more lines are too long

View File

@ -1,7 +0,0 @@
import terser from "@rollup/plugin-terser";
import rollupConfig from "./rollup.config.js";
rollupConfig.plugins.push(terser());
rollupConfig.output.file = 'dist/bundle.min.js';
rollupConfig.output.name = 'bundle.min.js';
export default rollupConfig;

View File

@ -10,14 +10,18 @@ import html from "rollup-plugin-string-html";
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import alias from "@rollup/plugin-alias";
import postcss from 'rollup-plugin-postcss';
import vue from "@vitejs/plugin-vue";
import styles from "rollup-plugin-styles";
import { customInjector } from "./custom-injector.js";
import terser from "@rollup/plugin-terser";
import clone from "just-clone";
let node_env = process.env.NODE_ENV;
let vuePath = node_env === 'production' ?
'vue/dist/vue.runtime.esm-browser.prod.js' :
'vue/dist/vue.runtime.esm-browser.js';
export default {
const devConfig = {
input: 'src/ts/index.ts',
output: {
file: 'dist/bundle.js',
@ -27,8 +31,6 @@ export default {
plugins: [
json(),
html({
// include: ["**/*.html", "src/static/css/*.css"],
// include: ["**/*.html", "**/*.css"],
include: ["**/*.html"],
minifier: {
includeAutoGeneratedTags: true,
@ -64,12 +66,38 @@ export default {
preferBuiltins: false,
}),
vue({ isProduction: node_env === 'production' }),
typescript2({
tsconfig: "tsconfig.json",
// clean: true,
// check: false,
// 自定义注入器注入vue部分css
styles({
// modules: true,
// namedExports: true,
exclude: /static\/css\/.+\.css/,
mode: [
"inject",
(varName) => customInjector(varName),
],
minimize: true
}),
// 非vue部分css逻辑代码中手动注入
styles({
include: /static\/css\/.+\.css/,
// modules: true,
// namedExports: true,
mode: [
"inject",
() => ``,
],
minimize: true
}),
typescript2({
tsconfig: "./tsconfig.json",
}),
postcss({ minimize: true }),
// typescript(),
],
};
const prodConfig = clone(devConfig);
prodConfig.plugins.push(terser());
prodConfig.output.file = 'dist/bundle.min.js';
prodConfig.output.name = 'bundle.min.js';
export default [devConfig, prodConfig];
export { prodConfig };

View File

@ -7,6 +7,7 @@
<h4>手机</h4>
<p>安卓 KIWI 等可以用油猴脚本的浏览器也可以点上面的链接安装👆</p>
<p>Torn PDA app 或 Alook 用户可打开<a href="//jjins.github.io/fyfuzhi/" target="_blank">这个网页</a>快捷复制粘贴。</p>
<p>Torn PDA 中Injection time 请选择 Start 达到最好效果。</p>
<h4>直接复制</h4>
<p>加载脚本然后直接复制粘贴到用户脚本处。</p>
<p>

View File

@ -13,8 +13,9 @@ import { Injectable } from "./container/Injectable";
@Injectable()
export default class App {
constructor(
private readonly tornHelper: WuHuTornHelper,
private readonly icon: ZhongIcon,
private readonly wuhuBase: WuhuBase,
private readonly tornHelper: WuHuTornHelper,
private readonly common: Common,
private readonly urlRouter: UrlRouter,
private readonly configWrapper: LocalConfigWrapper,
@ -22,9 +23,9 @@ export default class App {
) {
}
public run(): void {
public run() {
WuhuBase.conditionInterrupt();
this.wuhuBase.conditionInterrupt();
// 初始化
this.tornHelper.init();

View File

@ -16,19 +16,22 @@ export default class LocalConfigWrapper {
public get config(): Config {
const _this = this;
return new Proxy(this.Local, {
return new Proxy(_this.Local, {
get(target: Config, prop: string) {
return target[prop] ?? defaultConfig[prop];
},
set(target: Config, prop: string, value: any): boolean {
let config = target;
let preVal = config[prop];
if (preVal !== value) {
config[prop] = value;
_this.setLocal(config);
let msg = `[${ prop }]值变更 ${ preVal }->${ value }`;
_this.logger.info(msg);
if (isNotified(prop))
if (isNotified(prop)) {
_this.msgWrapper.create(msg);
}
}
return true;
}
})

View File

@ -110,7 +110,7 @@ export default class UrlRouter {
});
// 监听啤酒购买
globVars.responseHandlers.push(this.buyBeerHelper.responseHandler);
globVars.responseHandlers.push((...args: any[]) => this.buyBeerHelper.responseHandler.apply(this.buyBeerHelper, args));
}
// 快速crime TODO 重构、与翻译解藕

View File

@ -1,24 +1,15 @@
import IWHSettings from "../interface/IWHSettings";
import Log from "./Log";
import ClassName from "../container/ClassName";
import { Injectable } from "../container/Injectable";
@ClassName('WuhuBase')
@Injectable()
export default class WuhuBase {
/**
* localStorage wh_trans_settings (json)
*/
public static getLocal(): IWHSettings {
let localObject;
let localItem = localStorage.getItem('wh_trans_settings') || '{}';
try {
localObject = JSON.parse(localItem);
} catch (e) {
Log.error('解析localStorage对象出错', e);
localStorage.setItem('wh_trans_settings', '{}');
}
return localObject || {};
constructor() {
}
public static conditionInterrupt() {
public conditionInterrupt() {
let title: HTMLElement | { innerText: string } = (document.querySelector('#skip-to-content') ||
document.querySelector('[href*="#skip-to-content"]')) as HTMLElement || { innerText: '' };
let condition = (

View File

@ -1,6 +1,6 @@
import CommonUtils from "./utils/CommonUtils";
import Global from "./Global";
import COMMON_CSS from "../../static/css/common.css";
import COMMON_CSS from "../../static/css/common.module.css";
import globVars from "../globVars";
import { Injectable } from "../container/Injectable";
import ClassName from "../container/ClassName";
@ -15,6 +15,7 @@ export default class WuHuTornHelper {
private readonly global: Global,
private readonly logger: Logger,
private readonly infoUtils: InfoUtils,
private readonly commonUtils: CommonUtils,
) {
}
@ -147,7 +148,8 @@ export default class WuHuTornHelper {
}
})(XMLHttpRequest.prototype);
CommonUtils.addStyle(COMMON_CSS.replace('{{}}', performance.now().toString()));
let commonCssStr = COMMON_CSS.replace('{{}}', performance.now().toString());
this.commonUtils.styleInject(commonCssStr);
// 测试用
if ('Ok' !== localStorage['WHTEST']) {

View File

@ -115,10 +115,9 @@ export default class ZhongIcon {
// 更新按钮点击事件
(<MyHTMLElement>zhongNode.querySelector('#wh-update-btn')).onclick = e => {
(<HTMLButtonElement>e.target).blur();
const innerHtml = ZHONG_UPDATE_HTML;
// 直接复制的按钮
new Popup(innerHtml, '如何更新')
.getElement()
new Popup(ZHONG_UPDATE_HTML, '如何更新')
.element
.querySelector('button').onclick = async (e) => {
let target = e.target as HTMLButtonElement;
target.innerHTML = '加载中';
@ -170,7 +169,7 @@ export default class ZhongIcon {
}
document.body.append(zhongNode);
// 引入torn自带浮动提示
this.logger.info('引入torn自带浮动提示');
this.logger.info('引入torn浮动提示');
(window.initializeTooltip) && (window.initializeTooltip('.wh-container', 'white-tooltip'));
// 加载torn mini profile
this.logger.info('加载torn mini profile');
@ -185,7 +184,7 @@ export default class ZhongIcon {
}, 1000),
counter: 0
};
this.logger.info('图标加入文档树完成');
this.logger.info('图标加入文档树');
return this;
}

View File

@ -2,7 +2,7 @@ import CommonUtils from "../utils/CommonUtils";
import Alert from "../utils/Alert";
import Global from "../Global";
import Device from "../../enum/Device";
import ATTACK_HELPER_CSS from "../../../static/css/attack_helper.css";
import ATTACK_HELPER_CSS from "../../../static/css/attack_helper.module.css";
import ActionButtonUtils from "../utils/ActionButtonUtils";
import TornStyleBlock from "../utils/TornStyleBlock";
import TornStyleSwitch from "../utils/TornStyleSwitch";
@ -186,7 +186,7 @@ export default class AttackHelper {
break;
}
}
CommonUtils.addStyle(ATTACK_HELPER_CSS);
this.commonUtils.styleInject(ATTACK_HELPER_CSS);
CommonUtils.addStyle(`.wh-move-btn #defender div[class^="modal___"]{top: ${ css_top };}`);
document.body.classList.add('wh-move-btn');
break;
@ -258,7 +258,7 @@ export default class AttackHelper {
// .wh-move-btn #attacker div[class^="title___"]{height:0;}
// .wh-move-btn #attacker button{width:100%;margin:0;height:63px;white-space:normal;}
// `;
CommonUtils.addStyle(css_rule);
this.commonUtils.styleInject(css_rule);
document.body.classList.toggle('wh-move-btn');
btn.onclick = () => {
if (this.localConfigWrapper.config.quickFinishAtt !== 3) {

View File

@ -43,7 +43,7 @@ export default class ProfileHelper implements ResponseInject {
this.localConfigWrapper.config.HideProfileImg = hideImgSwitch.getInput().checked;
});
if (this.localConfigWrapper.config.ShowNameHistory) {
globVars.responseHandlers.push((url, body) => this.responseHandler(url, body));
globVars.responseHandlers.push((...args: any[]) => this.responseHandler.apply(this, args));
}
}

View File

@ -328,12 +328,11 @@ export default class TranslateNew extends Provider implements ResponseInject {
'Glass of Beer': {
itemName: '一杯啤酒',
itemInfo: '[译]Only savages drink beer straight out of the bottle. This glass of beer is obtained fresh from the keg, and provides the same level of drunken joy as you\'d get from a regular bottle of suds. Provides a moderate nerve increase when consumed.',
itemInfoContent: "\n" +
" <div class='m-bottom10'>\n" +
" <span class=\"bold\">一杯啤酒</span> 是酒类物品\n" +
" </div>\n" +
" Only savages drink beer straight out of the bottle. This glass of beer is obtained fresh from the keg, and provides the same level of drunken joy as you'd get from a regular bottle of suds. Provides a moderate nerve increase when consumed.\n" +
" <div class=\"t-green bold item-effect m-top10\">效果: 犯罪 + 2增幅CD + 1h。</div>",
itemInfoContent: "<div class='m-bottom10'>" +
"<span class=\"bold\">一杯啤酒</span> 是酒类物品" +
"</div>" +
"Only savages drink beer straight out of the bottle. This glass of beer is obtained fresh from the keg, and provides the same level of drunken joy as you'd get from a regular bottle of suds. Provides a moderate nerve increase when consumed." +
"<div class=\"t-green bold item-effect m-top10\">效果: 犯罪 + 2增幅CD + 1h。</div>",
},
};
let idMap = { 816: 'Glass of Beer' };

View File

@ -1,7 +1,7 @@
import XUNZHAOMUZHUANG_HTML from "../../../static/html/xunzhaomuzhuang/index.html";
import * as MUZHUANG_ID_LIST_JSON from "../../../static/json/muzhuang_id_list.json";
import CommonUtils from "../utils/CommonUtils";
import XUNZHAOMUZHUANG_CSS from "../../../static/css/xunzhaomuzhuang.css";
import XUNZHAOMUZHUANG_CSS from "../../../static/css/xunzhaomuzhuang.module.css";
import TornStyleBlock from "../utils/TornStyleBlock";
import MathUtils from "../utils/MathUtils";
import FetchUtils from "../utils/FetchUtils";
@ -32,7 +32,7 @@ export default class XZMZ {
}
public init() {
CommonUtils.addStyle(XUNZHAOMUZHUANG_CSS);
this.commonUtils.styleInject(XUNZHAOMUZHUANG_CSS);
document.body.classList.add('wh-hide-title');
document.title = document.title.replace('Items', '寻找木桩');
this.mainRoleContainer = document.querySelector('div[role="main"]');

View File

@ -1,5 +1,5 @@
import CommonUtils from "../utils/CommonUtils";
import QUICK_FLY_CSS from "../../../static/css/quick_fly.css";
import QUICK_FLY_CSS from "../../../static/css/quick_fly.module.css";
import QUICK_FLY_HTML from "../../../static/html/quick_fly.html";
import Alert from "../utils/Alert";
import TravelItem from "../action/TravelItem";
@ -15,6 +15,7 @@ export default class QuickFlyBtnHandler {
constructor(
private readonly logger: Logger,
private readonly travelItem: TravelItem,
private readonly commonUtils: CommonUtils,
) {
}
@ -63,7 +64,7 @@ export default class QuickFlyBtnHandler {
if (window.hasWHQuickFlyOpt) return;
window.hasWHQuickFlyOpt = true;
// TODO
CommonUtils.addStyle(QUICK_FLY_CSS);
this.commonUtils.styleInject(QUICK_FLY_CSS);
const node = document.createElement('div');
node.id = 'wh-quick-fly-opt';
node.innerHTML = QUICK_FLY_HTML;

View File

@ -1,13 +1,19 @@
import CommonUtils from "../utils/CommonUtils";
import QUICK_LINK_CSS from "../../../static/css/quick_link.css";
import QUICK_LINK_CSS from "../../../static/css/quick_link.module.css";
import Popup from "../utils/Popup";
import ClassName from "../../container/ClassName";
import { Injectable } from "../../container/Injectable";
@ClassName('QuickLinksHandler')
@Injectable()
export default class QuickLinksHandler {
private styleAdded: boolean = false;
private list = [];
constructor() {
constructor(
private readonly commonUtils: CommonUtils,
) {
let list = this.list;
// 生存手册
list.push({
@ -69,7 +75,7 @@ export default class QuickLinksHandler {
public handle(): void {
if (!this.styleAdded) {
CommonUtils.addStyle(QUICK_LINK_CSS);
this.commonUtils.styleInject(QUICK_LINK_CSS);
this.styleAdded = true;
}
const list = this.list;

View File

@ -1,10 +1,16 @@
import "reflect-metadata";
import Log from "../Log";
import ZhongIcon from "../ZhongIcon";
export default function EntryPoint(T: { main: () => void }) {
if (window.WHTRANS) throw '退出, 已运行次数' + window.WHTRANS;
if (window.WHTRANS) {
console.log('退出, 已运行次数' + window.WHTRANS)
} else {
window.WHTRANS = window.WHTRANS === undefined ? 1 : window.WHTRANS++;
let started = false;
const starter = () => {
console.log('starter init...');
let started = performance.now();
try {
T.main();
@ -15,4 +21,17 @@ export default function EntryPoint(T: { main: () => void }) {
Log.info(`芜湖脚本完成加载, 耗时${ runTime }ms`);
if (ZhongIcon.ZhongNode && ZhongIcon.ZhongNode.initTimer)
ZhongIcon.ZhongNode.initTimer.innerHTML = `加载时间 ${ runTime }ms`;
};
const evHandler = () => {
console.log('document.readyState: ' + document.readyState);
if (!started && (document.readyState === 'complete' || document.readyState === 'interactive')) {
document.removeEventListener('readystatechange', evHandler);
started = !started;
starter();
} else if (!(document.readyState === 'complete' || document.readyState === 'interactive')) {
document.addEventListener('readystatechange', evHandler);
}
};
evHandler();
}
}

View File

@ -223,6 +223,13 @@ export default class CommonUtils {
Log.info('CSS规则已添加', element);
}
public styleInject(rules: string): void {
const element = document.createElement("style");
element.setAttribute('type', 'text/css');
element.innerHTML = rules;
document.head.appendChild(element);
}
public static loading_gif_html(): string {
return LOADING_IMG_HTML;
}

View File

@ -23,12 +23,11 @@ export default class ItemHelper {
'Glass of Beer': {
itemName: '一杯啤酒',
itemInfo: '[译]Only savages drink beer straight out of the bottle. This glass of beer is obtained fresh from the keg, and provides the same level of drunken joy as you\'d get from a regular bottle of suds. Provides a moderate nerve increase when consumed.',
itemInfoContent: "\n" +
" <div class='m-bottom10'>\n" +
" <span class=\"bold\">一杯啤酒</span> 是酒类物品\n" +
" </div>\n" +
" Only savages drink beer straight out of the bottle. This glass of beer is obtained fresh from the keg, and provides the same level of drunken joy as you'd get from a regular bottle of suds. Provides a moderate nerve increase when consumed.\n" +
" <div class=\"t-green bold item-effect m-top10\">效果: 犯罪 + 2增幅CD + 1h。</div>",
itemInfoContent: "<div class='m-bottom10'>" +
"<span class=\"bold\">一杯啤酒</span> 是酒类物品" +
"</div>" +
"Only savages drink beer straight out of the bottle. This glass of beer is obtained fresh from the keg, and provides the same level of drunken joy as you'd get from a regular bottle of suds. Provides a moderate nerve increase when consumed." +
"<div class=\"t-green bold item-effect m-top10\">效果: 犯罪 + 2增幅CD + 1h。</div>",
},
};

View File

@ -1,6 +1,6 @@
import toThousands from "../utils/toThousands";
import CommonUtils from "../../class/utils/CommonUtils";
import CITY_FINDER_CSS from "../../../static/css/city_finder.css";
import CITY_FINDER_CSS from "../../../static/css/city_finder.module.css";
import TornStyleBlock from "../../class/utils/TornStyleBlock";
import ItemHelper from "../../class/utils/ItemHelper";
import { Container } from "../../container/Container";
@ -10,7 +10,7 @@ import { Container } from "../../container/Container";
* @param _base
*/
export default function cityFinder(_base: TornStyleBlock): void {
CommonUtils.addStyle(CITY_FINDER_CSS);
Container.factory(CommonUtils).styleInject(CITY_FINDER_CSS);
// 物品名与价格
let items: {
[k: number]: {
@ -18,43 +18,29 @@ export default function cityFinder(_base: TornStyleBlock): void {
price: number
}
} = null;
// const base = document.createElement('div');
// base.id = 'wh-city-finder';
// const container = document.createElement('div');
// container.id = 'wh-city-finder-cont';
const header = document.createElement('div');
// header.id = 'wh-city-finder-header';
header.innerHTML = '捡垃圾助手';
const info = document.createElement('div');
info.innerHTML = '已找到物品:';
// container.append(info);
// base.append(header);
// base.append(container);
_base.append(header, info);
document.body.classList.add('wh-city-finds');
// CommonUtils.COFetch('https://jjins.github.io/item_price_raw.json')
// .then(r => items = JSON.parse(r))
// .catch(err => {
// Log.error(err);
// items = undefined
// });
let itemHelper = Container.factory(ItemHelper);
CommonUtils.elementReady('div.leaflet-marker-pane').then(elem => {
// document.querySelector('.content-wrapper').prepend(base);
// 发现的物品id与map img node
const founds = [];
elem.querySelectorAll('img.map-user-item-icon').forEach(node => {
const item_id = node.src.split('/')[5];
const finder_item = document.createElement('span');
// finder_item.id = 'wh-city-finder-item' + item_id;
finder_item.classList.add('wh-city-finder-item');
finder_item.innerHTML = item_id;
founds.push({ 'id': item_id, 'node': finder_item, 'map_item': node });
// container.append(finder_item);
// _base.append(finder_item);
info.append(finder_item);
});
// 未发现物品 返回

View File

@ -3,7 +3,7 @@ import Log from "../../class/Log";
import Alert from "../../class/utils/Alert";
import ActionButtonUtils from "../../class/utils/ActionButtonUtils";
import FetchUtils from "../../class/utils/FetchUtils";
import DEPO_CSS from "../../../static/css/depo.css";
import DEPO_CSS from "../../../static/css/depo.module.css";
import TornStyleBlock from "../../class/utils/TornStyleBlock";
import { Container } from "../../container/Container";
import LocalConfigWrapper from "../../class/LocalConfigWrapper";
@ -13,6 +13,7 @@ const fetchUtils = Container.factory(FetchUtils);
export default function depoHelper() {
let actionButtonUtils: ActionButtonUtils = Container.factory(ActionButtonUtils);
let localConfigWrapper: LocalConfigWrapper = Container.factory(LocalConfigWrapper);
let commonUtils: CommonUtils = Container.factory(CommonUtils);
let href = window.location.href;
let channel: 'CMPY' | 'FAC';
const selector = { 'CMPY': "div#funds div.deposit", 'FAC': "div#armoury-donate div.cash" };
@ -53,7 +54,7 @@ export default function depoHelper() {
// 存钱框浮动
if (localConfigWrapper.config.floatDepo && channel) {
document.body.classList.add('wh-depo-helper');
CommonUtils.addStyle(DEPO_CSS);
commonUtils.styleInject(DEPO_CSS);
CommonUtils.elementReady(selector[channel]).then(node => {
const close_btn = document.createElement('button');
close_btn.addEventListener('click', () => {

View File

@ -4,7 +4,7 @@ import Device from "../../enum/Device";
import Alert from "../../class/utils/Alert";
import ActionButtonUtils from "../../class/utils/ActionButtonUtils";
import CommonUtils from "../../class/utils/CommonUtils";
import TRAVEL_ALARM_CSS from "../../../static/css/travel_alarm.css";
import TRAVEL_ALARM_CSS from "../../../static/css/travel_alarm.module.css";
import TRAVEL_ALARM_HTML from "../../../static/html/travel_alarm.html";
import TornStyleBlock from "../../class/utils/TornStyleBlock";
import QuickFlyBtnHandler from "../../class/handler/QuickFlyBtnHandler";
@ -111,7 +111,7 @@ export default class TravelHelper {
.replace('{{}}', dest_cn === '回城' ? dest_cn : '飞往' + dest_cn)
.replace('{{}}', wh_trv_alarm.enable ? 'checked ' : '')
.replace('{{}}', wh_trv_alarm.alert_time || 30);
CommonUtils.addStyle(TRAVEL_ALARM_CSS);
this.commonUtils.styleInject(TRAVEL_ALARM_CSS);
document.body.append(wh_trv_alarm_node);
// 报错dom
const error_node = wh_trv_alarm_node.querySelector('#wh-trv-error') as HTMLElement;

View File

@ -1,8 +1,8 @@
import "reflect-metadata";
import { Container } from "./container/Container";
import App from "./App";
import Logger from "./class/Logger";
import EntryPoint from "./class/provider/EntryPoint";
import "reflect-metadata";
@EntryPoint
class _ {

View File

@ -1,7 +1,3 @@
<!--<script setup lang="ts">-->
<!--import { itemNameDict } from "../ts/dictionary/translation";-->
<!--</script>-->
<template>
<div>
<div>