仓库整理
This commit is contained in:
parent
92c807aa86
commit
ce7d9885cd
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +1,4 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
/bundle.min.js
|
|
||||||
/bundle.js
|
|
||||||
/.fleet
|
/.fleet
|
||||||
|
/src/dist/bundle.min.js
|
||||||
|
/src/dist/bundle.js
|
||||||
3
.idea/torncity-zhcn-translate.iml
generated
3
.idea/torncity-zhcn-translate.iml
generated
@ -4,6 +4,9 @@
|
|||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.fleet" />
|
<excludeFolder url="file://$MODULE_DIR$/.fleet" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/misc" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/src/dist" />
|
||||||
|
<excludePattern pattern="release.min.user.js" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
|||||||
5
build.js
5
build.js
@ -2,6 +2,7 @@
|
|||||||
* 此脚本用于加入userscript meta,
|
* 此脚本用于加入userscript meta,
|
||||||
* 并生成日期时间与版本号
|
* 并生成日期时间与版本号
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let startTime = Date.now();
|
let startTime = Date.now();
|
||||||
let fs = require('fs');
|
let fs = require('fs');
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ let metaData = `// ==UserScript==
|
|||||||
// @description 托恩,起飞!
|
// @description 托恩,起飞!
|
||||||
// @author Woohoo[2687093] Sabrina_Devil[2696209]
|
// @author Woohoo[2687093] Sabrina_Devil[2696209]
|
||||||
// @match https://www.torn.com/*
|
// @match https://www.torn.com/*
|
||||||
// @updateURL https://gitlab.com/JJins/wuhu-torn-helper/-/raw/dev/release.min.user.js
|
// @downloadURL https://gitlab.com/JJins/wuhu-torn-helper/-/raw/dev/release.min.user.js
|
||||||
// @grant GM_xmlhttpRequest
|
// @grant GM_xmlhttpRequest
|
||||||
// @grant unsafeWindow
|
// @grant unsafeWindow
|
||||||
// @connect ljs-lyt.com
|
// @connect ljs-lyt.com
|
||||||
@ -28,6 +29,6 @@ let metaData = `// ==UserScript==
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
`
|
`
|
||||||
|
|
||||||
const data = fs.readFileSync('./bundle.min.js', 'utf8');
|
const data = fs.readFileSync('./dist/bundle.min.js', 'utf8');
|
||||||
fs.writeFileSync('./release.min.user.js', metaData + data.replace('$$WUHU_DEV_VERSION$$', version), 'utf8');
|
fs.writeFileSync('./release.min.user.js', metaData + data.replace('$$WUHU_DEV_VERSION$$', version), 'utf8');
|
||||||
console.log(`版本 ${ version } 构建完成, build.js耗时${ Date.now() - startTime }ms`);
|
console.log(`版本 ${ version } 构建完成, build.js耗时${ Date.now() - startTime }ms`);
|
||||||
|
|||||||
@ -4,12 +4,8 @@
|
|||||||
"description": "芜湖助手",
|
"description": "芜湖助手",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"release": "rollup -c rollup-prod.config.js && node build.js # 发布",
|
"release": "rollup -c rollup-prod.config.js && node build.js",
|
||||||
"build": "rollup -c # 调试编译",
|
"watch": "rollup -c -w"
|
||||||
"rollup_watch": "rollup -c -w # 监控",
|
|
||||||
"minify": "uglifyjs misc/wuhu-torn-helper.js -o release.min.user.js -m # 弃用",
|
|
||||||
"serve": "# 弃用",
|
|
||||||
"compile": "tsc --outDir output # 弃用"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
|||||||
@ -4,9 +4,9 @@ import { string } from "rollup-plugin-string";
|
|||||||
import { uglify } from "rollup-plugin-uglify";
|
import { uglify } from "rollup-plugin-uglify";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: 'src/index.ts',
|
input: 'src/ts/index.ts',
|
||||||
output: {
|
output: {
|
||||||
file: 'bundle.min.js',
|
file: 'dist/bundle.min.js',
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
@ -4,9 +4,9 @@ import json from "@rollup/plugin-json";
|
|||||||
import { string } from "rollup-plugin-string";
|
import { string } from "rollup-plugin-string";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: 'src/index.ts',
|
input: 'src/ts/index.ts',
|
||||||
output: {
|
output: {
|
||||||
file: 'bundle.js',
|
file: 'dist/bundle.js',
|
||||||
format: 'iife',
|
format: 'iife',
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
@ -80,6 +80,11 @@ export class Common extends WuhuBase {
|
|||||||
// 现金变动提醒
|
// 现金变动提醒
|
||||||
if (WuhuConfig.get('CashChangeAlert')) CommonUtils.elementReady("#user-money").then(userMoney => {
|
if (WuhuConfig.get('CashChangeAlert')) CommonUtils.elementReady("#user-money").then(userMoney => {
|
||||||
new MutationObserver((mutations, observer) => {
|
new MutationObserver((mutations, observer) => {
|
||||||
|
if (!WuhuConfig.get('CashChangeAlert')) {
|
||||||
|
observer.disconnect();
|
||||||
|
new Alert('现金变动提醒已关闭', { sysNotify: true });
|
||||||
|
return;
|
||||||
|
}
|
||||||
Log.info("现金变动提醒", mutations);
|
Log.info("现金变动提醒", mutations);
|
||||||
mutations.forEach(item => {
|
mutations.forEach(item => {
|
||||||
if (item.attributeName === 'data-money') {
|
if (item.attributeName === 'data-money') {
|
||||||
@ -12,8 +12,8 @@ export default class Provider {
|
|||||||
constructor() {
|
constructor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 返回继承类的实例
|
||||||
public static getInstance<T extends typeof Provider>(this: T): InstanceType<T> {
|
public static getInstance<T extends typeof Provider>(this: T): InstanceType<T> {
|
||||||
// return this.instance ||= new this();
|
|
||||||
if (!this.instance) {
|
if (!this.instance) {
|
||||||
let startTime = performance.now();
|
let startTime = performance.now();
|
||||||
this.instance = new this();
|
this.instance = new this();
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user