油猴中文网回复的时候不够10个字符自动补全
// ==UserScript==
// @name 油猴中文网回复的时候不够10个字符自动补全
// @namespace npm/vite-plugin-monkey
// @description 很简单,思路就是失去焦点的时候我判断一下,少10个字符的时候我缺多少我补多少
// @version 0.0.0
// @author monkey
// @icon https://ts1.cn.mm.bing.net/th?id=OIP-C.hpjQBHE4wfYFA1nm4KhTDwAAAA&w=173&h=185&c=8&rs=1&qlt=90&o=6&dpr=1.3&pid=3.1&rm=2
// @match https://bbs.tampermonkey.net.cn/*
// @require https://cdn.jsdelivr.net/npm/react@18.2.0/umd/react.production.min.js
// @require https://cdn.jsdelivr.net/npm/react-dom@18.2.0/umd/react-dom.production.min.js
// ==/UserScript==
(function(require$$0$1, require$$0) {
"use strict";
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
const require$$0__default$1 = /* @__PURE__ */ _interopDefaultLegacy(require$$0$1);
const require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0);
var client = {};
var m$1 = require$$0__default.default;
{
client.createRoot = m$1.createRoot;
client.hydrateRoot = m$1.hydrateRoot;
}
var jsxRuntime = { exports: {} };
var reactJsxRuntime_production_min = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var f = require$$0__default$1.default, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
function q(c, a, g) {
var b, d = {}, e = null, h = null;
void 0 !== g && (e = "" + g);
void 0 !== a.key && (e = "" + a.key);
void 0 !== a.ref && (h = a.ref);
for (b in a)
m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
if (c && c.defaultProps)
for (b in a = c.defaultProps, a)
void 0 === d[b] && (d[b] = a[b]);
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
}
reactJsxRuntime_production_min.Fragment = l;
reactJsxRuntime_production_min.jsx = q;
reactJsxRuntime_production_min.jsxs = q;
(function(module) {
{
module.exports = reactJsxRuntime_production_min;
}
})(jsxRuntime);
const jsx = jsxRuntime.exports.jsx;
function App() {
require$$0$1.useState(0);
require$$0$1.useEffect(() => {
setInterval(() => {
if (document.getElementById("postmessage")) {
let postMessageTextArea = document.getElementById("postmessage");
postMessageTextArea.onblur = function() {
if (postMessageTextArea.value.length < 10) {
let str = "!!!!!!!!!!";
let inputValue = postMessageTextArea.value || "";
console.log(str.substring(0, 10 - inputValue.length));
postMessageTextArea.value = inputValue + str.substring(0, 10 - inputValue.length);
}
};
}
}, 2e3);
}, []);
return /* @__PURE__ */ jsx(require$$0$1.Fragment, {});
}
client.createRoot((() => {
const app = document.createElement("div");
document.body.append(app);
return app;
})()).render(/* @__PURE__ */ jsx(require$$0__default$1.default.Fragment, {
children: /* @__PURE__ */ jsx(App, {})
}));
})(React, ReactDOM);