您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
移除政治相关条幅或替换为社会主义核心价值观、今日诗词,替换政治相关 Logo 为原版 Logo,去除政治相关通知,让技术远离政治。
当前为
/******/ (() => { // webpackBootstrap /******/ "use strict"; var __webpack_exports__ = {}; ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/junit/Junit.ts function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Junit = /*#__PURE__*/function () { function Junit() { _classCallCheck(this, Junit); } _createClass(Junit, null, [{ key: "replace", value: function replace() { if (location.href === 'https://junit.org/junit5/') { $(this.selectors.junitAbout).prevAll().remove(); $(this.selectors.junitLogo).attr('src', this.junitLogoUrl); $(this.selectors.junitFavicon).attr('href', this.junitLogoUrl); } } }]); return Junit; }(); _defineProperty(Junit, "selectors", { junitAbout: '#about', junitLogo: 'img[src="/junit5/assets/img/junit5-logo.png"]', junitFavicon: 'link[rel="icon"]' }); _defineProperty(Junit, "junitLogoUrl", 'https://raw.iqiq.io/duanluan/tampermonkey-scripts/main/core-socialist-values/src/junit/imgs/junit5-logo.png'); ;// CONCATENATED MODULE: ./utils/src/gm/Store.ts function Store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Store_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Store_createClass(Constructor, protoProps, staticProps) { if (protoProps) Store_defineProperties(Constructor.prototype, protoProps); if (staticProps) Store_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } /** * 存储 */ var Store = /*#__PURE__*/function () { function Store() { Store_classCallCheck(this, Store); } Store_createClass(Store, null, [{ key: "get", value: /** * 获取 * @param key 键 */ function get(key) { // @ts-ignore return GM_getValue(key); } /** * 设置 * @param key 键 * @param value 值 */ }, { key: "set", value: function set(key, value) { // @ts-ignore GM_setValue(key, value); } }]); return Store; }(); ;// CONCATENATED MODULE: ./utils/src/gm/enum/HttpDataType.ts var HttpDataType; (function (HttpDataType) { HttpDataType["JSON"] = "JSON"; })(HttpDataType || (HttpDataType = {})); ;// CONCATENATED MODULE: ./utils/src/gm/Http.ts function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { Http_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function Http_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Http_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Http_createClass(Constructor, protoProps, staticProps) { if (protoProps) Http_defineProperties(Constructor.prototype, protoProps); if (staticProps) Http_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var Http = /*#__PURE__*/function () { function Http() { Http_classCallCheck(this, Http); } Http_createClass(Http, null, [{ key: "get", value: function get(option) { option['method'] = 'GET'; // 同步时返回 Promise if (option.synchronous) { return new Promise(function (resolve, reject) { // @ts-ignore GM_xmlhttpRequest(_objectSpread(_objectSpread({}, option), {}, { onload: function onload(response) { resolve(option.dataType === HttpDataType.JSON ? JSON.parse(response.responseText) : response.responseText); }, onerror: function onerror(error) { reject(error); } })); }); } else { var onload1 = function onload1(details) { var response; if (option.dataType === HttpDataType.JSON) { response = JSON.parse(details.responseText); } else { response = details.response; } option.onload(response); }; // @ts-ignore GM_xmlhttpRequest(_objectSpread(_objectSpread({}, option), {}, { onload: onload1 })); } } }]); return Http; }(); ;// CONCATENATED MODULE: ./utils/src/gm/MenuCmd.ts function MenuCmd_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function MenuCmd_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function MenuCmd_createClass(Constructor, protoProps, staticProps) { if (protoProps) MenuCmd_defineProperties(Constructor.prototype, protoProps); if (staticProps) MenuCmd_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } /** * 选项菜单 */ var MenuCmd = /*#__PURE__*/function () { function MenuCmd() { MenuCmd_classCallCheck(this, MenuCmd); } MenuCmd_createClass(MenuCmd, null, [{ key: "register", value: /** * 注册(不可用) * @param name 名称 * @param fn 点击菜单时执行的函数 */ function register(name, fn) { // @ts-ignore return GM_registerMenuCommand(name, fn); } /** * 注销 * @param menuCmdId 注册(不可用)时返回的 ID */ }, { key: "unregister", value: function unregister(menuCmdId) { // @ts-ignore GM_unregisterMenuCommand(menuCmdId); } }]); return MenuCmd; }(); ;// CONCATENATED MODULE: ./core-socialist-values/src/common/Options.ts function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function Options_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Options_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Options_createClass(Constructor, protoProps, staticProps) { if (protoProps) Options_defineProperties(Constructor.prototype, protoProps); if (staticProps) Options_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Options_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Options = /*#__PURE__*/function () { function Options() { Options_classCallCheck(this, Options); } Options_createClass(Options, null, [{ key: "registerBoolOption", value: /** * 选项 Key */ /** * 选项 * @private */ /** * 注册(不可用) bool 类型的选项 * @param option 选项 */ function registerBoolOption(option) { var _this = this; var val = option.value, valIsBool = typeof val === 'boolean'; if (!valIsBool) { return; } // 注册(不可用)选项 var currentMenuCmdId = MenuCmd.register((val ? '☑️ ' : '🔲 ') + option.label, function () { // 点击值取反 option.value = !option.value; Store.set(option.name, JSON.stringify(option)); // 取消注册(不可用) MenuCmd.unregister(currentMenuCmdId); // 重新注册(不可用) _this.registerBoolOption(option); // 刷新页面 window.location.reload(); }); // 保存选项 ID option.menuCmdId = currentMenuCmdId; Store.set(option.name, JSON.stringify(option)); } /** * 注册(不可用)所有选项 */ }, { key: "registerAll", value: function registerAll() { MenuCmd.register('更多设置', function () { window.open('https://gf.qytechs.cn/scripts/440854', '_blank'); }); var _iterator = _createForOfIteratorHelper(this.options), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var option = _step.value; // TODO 【调试】不保留选项的值,每次都从 Store 中获取 // Store.set(option.name, null); var storeOption = null; try { storeOption = JSON.parse(Store.get(option.name)); } catch (e) { // FIXME 一段时间后可删除 try catch console.warn('旧的选项值非 JSON 格式'); storeOption = option; } // 如果选项不存在 || 版本不一致 时重置选项 if (storeOption === null || !storeOption['version'] || storeOption['version'] < option.version) { Store.set(option.name, JSON.stringify(option)); storeOption = option; } this.registerBoolOption(storeOption); } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } /** * 在页面中加载选项 */ }, { key: "loadInGreasyfork", value: function loadInGreasyfork() { var _this2 = this; if (location.host !== 'gf.qytechs.cn' || location.href.indexOf('/scripts/440854') == -1) { return; } var selector = { scriptLinks: '#script-links', scriptOptions: '#script-options', scriptContent: '#script-content' }; var $body = $('body'), $scriptLinks = $(selector.scriptLinks), $scriptContent = $(selector.scriptContent); // 添加脚本设置的选项卡 $scriptLinks.children('li:eq(0)').after("<li><a href=\"javascript:;\" id=\"script-options\">\u811A\u672C\u8BBE\u7F6E</a></li>"); $body.on('click', selector.scriptOptions, function () { var $scriptOptions = $(selector.scriptOptions); // 点击脚本设置的菜单样式 var $currentLi = $scriptLinks.children('li.current'); $currentLi.html("<a href=\"".concat(location.href, "\">").concat($currentLi.text(), "</a>")); $currentLi.removeClass('current'); $scriptOptions.parent().addClass('current'); // 添加脚本设置的内容 var scriptContent = ''; var _iterator2 = _createForOfIteratorHelper(_this2.options), _step2; try { for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { var option = _step2.value; var storeOption = JSON.parse(Store.get(option.name)), optionName = storeOption.name, optionVal = storeOption.value; scriptContent += "<h3>".concat(option.label, "</h3>"); switch (optionName) { case Options.Keys.removeBar: scriptContent += "<label><input type=\"checkbox\" id=\"script-options-".concat(optionName, "\" ").concat(optionVal ? 'checked' : '', "> \u662F\u5426\u9690\u85CF\u6761\u5E45\uFF08\u52FE\u9009\u540E\u5C06\u9690\u85CF\u6761\u5E45\u800C\u4E0D\u662F\u66FF\u6362\u5176\u5185\u5BB9\uFF09</label>"); break; case Options.Keys.jinrishici: scriptContent += "<label><input type=\"checkbox\" id=\"script-options-".concat(optionName, "-enabled\" ").concat(optionVal ? 'checked' : '', "> \u542F\u7528<a href=\"https://www.jinrishici.com\" target = \"_blank\">\u4ECA\u65E5\u8BD7\u8BCD</a>\uFF08\u4ECD\u9700\u53D6\u6D88\u52FE\u9009\u201C\u662F\u5426\u9690\u85CF\u6761\u5E45\u201D\u624D\u80FD\u751F\u6548\uFF09</label>"); break; } } } catch (err) { _iterator2.e(err); } finally { _iterator2.f(); } $scriptContent.html(scriptContent); // region 添加脚本设置的事件 // 是否隐藏条幅 var optionSelector = '#script-options-' + Options.Keys.removeBar; $body.on('change', optionSelector, function () { var removeBarOption = JSON.parse(Store.get(Options.Keys.removeBar)); removeBarOption.value = !removeBarOption.value; // 重新注册(不可用)菜单 MenuCmd.unregister(removeBarOption.menuCmdId); _this2.registerBoolOption(removeBarOption); }); // 启用今日诗词 optionSelector = '#script-options-' + Options.Keys.jinrishici + '-enabled'; $body.on('change', optionSelector, function () { var jinrishiciOption = JSON.parse(Store.get(Options.Keys.jinrishici)); jinrishiciOption.value = !jinrishiciOption.value; // 重新注册(不可用)菜单 MenuCmd.unregister(jinrishiciOption.menuCmdId); _this2.registerBoolOption(jinrishiciOption); }); // endregion }); } }]); return Options; }(); Options_defineProperty(Options, "Keys", { removeBar: 'removeBar', jinrishici: 'jinrishici' }); Options_defineProperty(Options, "options", [{ label: '隐藏条幅', name: Options.Keys.removeBar, version: 1, value: false, menuCmdId: null }, { label: '今日诗词', name: Options.Keys.jinrishici, version: 1, value: false, menuCmdId: null, token: '' }]); ;// CONCATENATED MODULE: ./core-socialist-values/src/common/Bar.ts function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Bar_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Bar_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Bar = /*#__PURE__*/function () { function Bar() { Bar_classCallCheck(this, Bar); } Bar_createClass(Bar, null, [{ key: "replace", value: /** * 替换条幅的选择器 */ /** * 替换后的条幅去除空格换行后的文本 * @private */ /** * 是否启用今日诗词 * @private */ /** * 今日诗词内容 * @private */ /** * 替换条幅 * @param options { * barSelector: string, // 条幅选择器 * isObserveBar: boolean, // 是否监听条幅变化 * hideBarSelector: string, // 隐藏条幅选择器 * isObserveHideBar: boolean, // 是否监听隐藏条幅变化 * followUpObserveSelector?: string, // 后续监听选择器 * csvCallback?: Function // 替换后回调 * } */ function replace(options) { var _this = this; if (!$(options.barSelector).text().match(/ukraine|乌克兰|black|黑人/i)) { return; } // 如果移除横幅 if (JSON.parse(Store.get(Options.Keys.removeBar)).value) { // 隐藏横幅 $(options.hideBarSelector).hide(); if (options.isObserveHideBar) { var i = 0; // 隐藏条幅首次加载:监听条幅变化,变化后再次执行 var observer = new MutationObserver(function () { $(options.hideBarSelector).hide(); // 替换两次后结束监听 if (i >= 1) { observer.disconnect(); } i++; }); observer.observe($(options.hideBarSelector)[0], { childList: true, subtree: true }); } return; } this.storeJinrishiciVal = JSON.parse(Store.get(Options.Keys.jinrishici)).value; if (this.storeJinrishiciVal) { this.getJinrishici().then(function (data) { _this.jinrishiciContent = data; _this.replaceObserver(options); }); } else { this.replaceObserver(options); } } /** * 替换条幅监听 * @param options * @private */ }, { key: "replaceObserver", value: function replaceObserver(options) { var _this2 = this; // 首次替换横幅 this.replaceBar(options.barSelector, options.csvCallback, options.jinrishiciCallback); if (!options.isObserveBar) { return; } var i = 0; // 条幅首次加载:监听条幅变化,变化后再次执行 var observer = new MutationObserver(function () { _this2.replaceBar(options.barSelector, options.csvCallback, options.jinrishiciCallback); // 替换两次后结束监听 if (i >= 1) { observer.disconnect(); } i++; }); observer.observe($(options.barSelector)[0], { childList: true }); if (options.followUpObserveSelector) { // 后续变化 new MutationObserver(function () { _this2.replaceBar(options.barSelector, options.csvCallback, options.jinrishiciCallback); }).observe($(options.followUpObserveSelector)[0], { childList: true }); } } /** * 实际替换条幅 * @param selector 条幅选择器 * @param csvCallback 替换后回调 * @param jinrishiciCallback 替换为今日诗词后回调 * @private */ }, { key: "replaceBar", value: function replaceBar(selector, csvCallback, jinrishiciCallback) { if ($($(selector)[0]).text().replace(/\s+/g, "") === Bar.txt) { return; } if (this.storeJinrishiciVal) { $(selector).css({ 'minHeight': '30px', 'lineHeight': '30px' }); $(selector).html("\n <div class=\"csv_bar\">\n ".concat(this.jinrishiciContent, "\n </div>")); if (jinrishiciCallback) { jinrishiciCallback(); } return; } $(selector).css({ 'minHeight': '40px' }); $(selector).html("\n <div class=\"csv_bar\">\n <ul class='csv_bar_ul'><li>\u5BCC\u5F3A</li><li>\u6C11\u4E3B</li><li>\u6587\u660E</li><li>\u548C\u8C10</li><li>\u81EA\u7531</li><li>\u5E73\u7B49</li><li>\u516C\u6B63</li><li>\u6CD5\u6CBB</li><li>\u7231\u56FD</li><li>\u656C\u4E1A</li><li>\u8BDA\u4FE1</li><li>\u53CB\u5584</li></ul><br>\n <ul class='csv_bar_ul'><li>Prosperity</li><li>Democracy</li><li>Civility</li><li>Harmony</li><li>Freedom</li><li>Equality</li><li>Justice</li><li>Rule of law</li><li>Patriotism</li><li>Dedication</li><li>Integrity</li><li>Friendship</li>\n </ul>\n </div>"); // 避免出现多个导致样式添加失败 var $bar = $(this.replaceBarSelector.bar); if ($bar.length == 2) { $bar.eq(0).remove(); } var barUlSelector = this.replaceBarSelector.barUl; $(barUlSelector).css({ 'display': 'inline-block', 'listStyle': 'none', 'margin': 0, 'padding': 0, 'width': 'auto' }); $(barUlSelector + ' li').css({ 'color': '#DE2910', 'fontWeight': 'bold', 'fontFamily': 'KaiTi', 'float': 'left', 'paddingRight': '10px', 'min-width': '80px', 'textAlign': 'center' }); $(barUlSelector + ':first').css('verticalAlign', 'bottom'); $(barUlSelector + ':first li').css('fontSize', '18px'); $(barUlSelector + ':eq(1) li').css('fontSize', '13px'); if (csvCallback) { csvCallback(); } } /** * 获取今日诗词 * @private */ }, { key: "getJinrishici", value: function () { var _getJinrishici = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { var jinrishiciOption, response; return _regeneratorRuntime().wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: jinrishiciOption = JSON.parse(Store.get(Options.Keys.jinrishici)); if (jinrishiciOption.value) { _context.next = 3; break; } return _context.abrupt("return"); case 3: _context.next = 5; return Http.get({ url: 'https://v2.jinrishici.com/one.json', dataType: HttpDataType.JSON, // headers: { // 'X-User-Token': jinrishiciOption.token, // }, synchronous: true }); case 5: response = _context.sent; // @ts-ignore if (!response || response.status !== 'success') { console.error('今日诗词获取失败', response); } // // 存储 Token // if (jinrishiciOption.token !== response.data.token) { // jinrishiciOption.token = response.data.token; // Store.set(Options.Keys.jinrishici, JSON.stringify(jinrishiciOption)); // } // @ts-ignore return _context.abrupt("return", response.data.content + ' —— ' + response.data.origin.author + '《' + response.data.origin.title + '》'); case 8: case "end": return _context.stop(); } } }, _callee); })); function getJinrishici() { return _getJinrishici.apply(this, arguments); } return getJinrishici; }() }]); return Bar; }(); Bar_defineProperty(Bar, "replaceBarSelector", { bar: '.csv_bar', barUl: '.csv_bar .csv_bar_ul' }); Bar_defineProperty(Bar, "txt", '富强民主文明和谐自由平等公正法治爱国敬业诚信友善ProsperityDemocracyCivilityHarmonyFreedomEqualityJusticeRuleoflawPatriotismDedicationIntegrityFriendship'); Bar_defineProperty(Bar, "storeJinrishiciVal", false); Bar_defineProperty(Bar, "jinrishiciContent", ''); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/react/React.ts function React_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function React_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function React_createClass(Constructor, protoProps, staticProps) { if (protoProps) React_defineProperties(Constructor.prototype, protoProps); if (staticProps) React_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function React_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var React = /*#__PURE__*/function () { function React() { React_classCallCheck(this, React); } React_createClass(React, null, [{ key: "replace", value: function replace() { if (location.host === 'reactjs.org') { Bar.replace({ barSelector: this.selectors.bar, isObserveBar: true, hideBarSelector: this.selectors.hideBar, isObserveHideBar: false, followUpObserveSelector: this.selectors.followUpObserveElement }); } } }]); return React; }(); React_defineProperty(React, "selectors", { bar: '.css-lpiycv', hideBar: '.css-1loxuh3', followUpObserveElement: '#gatsby-focus-wrapper' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/angular/Angular.ts function Angular_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Angular_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Angular_createClass(Constructor, protoProps, staticProps) { if (protoProps) Angular_defineProperties(Constructor.prototype, protoProps); if (staticProps) Angular_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Angular_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Angular = /*#__PURE__*/function () { function Angular() { Angular_classCallCheck(this, Angular); } Angular_createClass(Angular, null, [{ key: "replace", value: function replace() { if (location.host === 'angular.io') { // 不存在是否关闭通知的本地存储时 if (!localStorage.getItem('aio-notification/war-ukraine')) { // 如果通知中存在关键词 var $bar = $(this.selectors.bar); if ($bar.length > 0 && $bar.text().toLowerCase().indexOf('ukraine') != -1) { // 点击关闭通知 $(this.selectors.dismissNotificationBtn)[0].click(); } } } } }]); return Angular; }(); Angular_defineProperty(Angular, "selectors", { bar: '.mat-toolbar-row.notification-container', dismissNotificationBtn: 'button[aria-label="Dismiss notification"]' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/codecept/Codecept.ts function Codecept_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Codecept_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Codecept_createClass(Constructor, protoProps, staticProps) { if (protoProps) Codecept_defineProperties(Constructor.prototype, protoProps); if (staticProps) Codecept_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Codecept_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Codecept = /*#__PURE__*/function () { function Codecept() { Codecept_classCallCheck(this, Codecept); } Codecept_createClass(Codecept, null, [{ key: "replace", value: function replace() { var _this = this; if (location.host === 'codecept.io') { Bar.replace({ barSelector: this.selectors.bar, isObserveBar: false, hideBarSelector: this.selectors.hideBar, isObserveHideBar: false, jinrishiciCallback: function jinrishiciCallback() { $(_this.selectors.bar).css('color', '#edf2f7'); } }); } } }]); return Codecept; }(); Codecept_defineProperty(Codecept, "selectors", { bar: '.sub-bar .message', hideBar: '.sub-bar' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/github/Github.ts function Github_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Github_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Github_createClass(Constructor, protoProps, staticProps) { if (protoProps) Github_defineProperties(Constructor.prototype, protoProps); if (staticProps) Github_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Github_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Github = /*#__PURE__*/function () { function Github() { Github_classCallCheck(this, Github); } Github_createClass(Github, null, [{ key: "replace", value: function replace() { if (location.href === 'https://github.com/') { var $notice = $(this.selectors.notice); if ($notice.length > 0 && $notice.text().toLowerCase().indexOf('ukraine') != -1) { $notice.remove(); } } } }]); return Github; }(); Github_defineProperty(Github, "selectors", { notice: '.border.js-notice' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/nest/Nest.ts function Nest_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Nest_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Nest_createClass(Constructor, protoProps, staticProps) { if (protoProps) Nest_defineProperties(Constructor.prototype, protoProps); if (staticProps) Nest_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Nest_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Nest_Codecept = /*#__PURE__*/function () { function Codecept() { Nest_classCallCheck(this, Codecept); } Nest_createClass(Codecept, null, [{ key: "replace", value: function replace() { var _this = this; if (location.host === 'docs.nestjs.com') { Bar.replace({ barSelector: this.selectors.bar, isObserveBar: false, hideBarSelector: this.selectors.bar, isObserveHideBar: false, csvCallback: function csvCallback() { $(_this.selectors.bar).css('padding', '0'); }, jinrishiciCallback: function jinrishiciCallback() { $(_this.selectors.bar).css('color', '#fff'); } }); } } }]); return Codecept; }(); Nest_defineProperty(Nest_Codecept, "selectors", { bar: '.top-bar' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/ember/Ember.ts function Ember_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Ember_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Ember_createClass(Constructor, protoProps, staticProps) { if (protoProps) Ember_defineProperties(Constructor.prototype, protoProps); if (staticProps) Ember_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Ember_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Ember = /*#__PURE__*/function () { function Ember() { Ember_classCallCheck(this, Ember); } Ember_createClass(Ember, null, [{ key: "replace", value: function replace() { var _this = this; if (location.host === 'emberjs.com') { Bar.replace({ barSelector: this.selectors.bar, isObserveBar: false, hideBarSelector: this.selectors.bar, isObserveHideBar: false, jinrishiciCallback: function jinrishiciCallback() { $(_this.selectors.bar).css('color', '#fff'); } }); $(this.selectors.bar).css({ 'backgroundColor': '#1c1e24', 'padding': 0 }); } } }]); return Ember; }(); Ember_defineProperty(Ember, "selectors", { bar: '.callout-banner' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/electron/Electron.ts function Electron_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Electron_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Electron_createClass(Constructor, protoProps, staticProps) { if (protoProps) Electron_defineProperties(Constructor.prototype, protoProps); if (staticProps) Electron_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Electron_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Electron = /*#__PURE__*/function () { function Electron() { Electron_classCallCheck(this, Electron); } Electron_createClass(Electron, null, [{ key: "replace", value: function replace() { if (location.host === 'www.electronjs.org') { Bar.replace({ barSelector: this.selectors.bar, isObserveBar: false, hideBarSelector: this.selectors.bar, isObserveHideBar: false, csvCallback: function csvCallback() { $(Bar.replaceBarSelector.barUl + ':eq(0)').css('height', '25px'); $(Bar.replaceBarSelector.barUl + ':eq(1)').css('height', '20px'); } }); $(this.selectors.bar).css({ 'padding': 0 }); } } }]); return Electron; }(); Electron_defineProperty(Electron, "selectors", { bar: '.announcement-banner' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/jenkins/Jenkins.ts function Jenkins_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Jenkins_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Jenkins_createClass(Constructor, protoProps, staticProps) { if (protoProps) Jenkins_defineProperties(Constructor.prototype, protoProps); if (staticProps) Jenkins_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Jenkins_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Jenkins_Angular = /*#__PURE__*/function () { function Angular() { Jenkins_classCallCheck(this, Angular); } Jenkins_createClass(Angular, null, [{ key: "replace", value: function replace() { if (location.host === 'www.jenkins.io') { // 替换图标 $(this.selectors.logo).replaceWith("<img src=\"/images/logos/jenkins/Jenkins.svg\">"); // 删除通知 $(this.selectors.pageTitle).nextAll("p").each(function (i, el) { var $el = $(el); if ($el.text().toLowerCase().indexOf('ukraine') != -1) { $el.remove(); } }); $(this.selectors.pageTitle).parent().append('<br><br><br>'); } } }]); return Angular; }(); Jenkins_defineProperty(Jenkins_Angular, "selectors", { logo: 'img[src="/images/logos/jenkins/Jenkins-stop-the-war.svg"]', pageTitle: '.page-title' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/svelte/Svelte.ts function Svelte_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Svelte_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Svelte_createClass(Constructor, protoProps, staticProps) { if (protoProps) Svelte_defineProperties(Constructor.prototype, protoProps); if (staticProps) Svelte_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Svelte_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Svelte = /*#__PURE__*/function () { function Svelte() { Svelte_classCallCheck(this, Svelte); } Svelte_createClass(Svelte, null, [{ key: "replace", value: function replace() { var _this = this; if (location.host === 'svelte.dev') { var $navSpot = $(this.selectors.navSpot); var i = 0; // 监听条幅变化,变化后再次执行 var observer = new MutationObserver(function () { if ($navSpot.length > 0) { // 替换 Logo $navSpot.attr('style', _this.svelteLogoStyle); // 替换两次后结束监听 if (i >= 1) { observer.disconnect(); } i++; } }); observer.observe($(this.selectors.observing)[0], { childList: true }); // 底部横幅 Bar.replace({ barSelector: this.selectors.bar, isObserveBar: true, hideBarSelector: this.selectors.bar, isObserveHideBar: true, csvCallback: function csvCallback() { $(_this.selectors.bar).css({ 'backgroundColor': '#1c1e24', 'paddingTop': '20px' }); } }); } } }]); return Svelte; }(); Svelte_defineProperty(Svelte, "selectors", { navSpot: '.nav-spot', bar: '.ukr', barHeight: ':root', barHeightAttrName: '--ukr-footer-height', observing: '#main' }); Svelte_defineProperty(Svelte, "svelteLogoStyle", 'background-image: url(https://svelte.dev/svelte-logo-horizontal.svg)'); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/sveltematerialui/SvelteMaterialUi.ts function SvelteMaterialUi_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function SvelteMaterialUi_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function SvelteMaterialUi_createClass(Constructor, protoProps, staticProps) { if (protoProps) SvelteMaterialUi_defineProperties(Constructor.prototype, protoProps); if (staticProps) SvelteMaterialUi_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function SvelteMaterialUi_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var SvelteMaterialUi = /*#__PURE__*/function () { function SvelteMaterialUi() { SvelteMaterialUi_classCallCheck(this, SvelteMaterialUi); } SvelteMaterialUi_createClass(SvelteMaterialUi, null, [{ key: "replace", value: function replace() { if (location.host === 'sveltematerialui.com') { $(this.selectors.bar).attr('class', ''); } } }]); return SvelteMaterialUi; }(); SvelteMaterialUi_defineProperty(SvelteMaterialUi, "selectors", { bar: '.ukraine' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/websites/syncthing/Syncthing.ts function Syncthing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function Syncthing_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function Syncthing_createClass(Constructor, protoProps, staticProps) { if (protoProps) Syncthing_defineProperties(Constructor.prototype, protoProps); if (staticProps) Syncthing_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function Syncthing_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var Syncthing = /*#__PURE__*/function () { function Syncthing() { Syncthing_classCallCheck(this, Syncthing); } Syncthing_createClass(Syncthing, null, [{ key: "replace", value: function replace() { var _this = this; if (location.host === 'syncthing.net') { Bar.replace({ barSelector: this.selectors.bar, isObserveBar: false, hideBarSelector: this.selectors.bar, isObserveHideBar: false, csvCallback: function csvCallback() { $(_this.selectors.bar).css('textAlign', 'center'); } }); } } }]); return Syncthing; }(); Syncthing_defineProperty(Syncthing, "selectors", { bar: '.alert' }); ;// CONCATENATED MODULE: ./core-socialist-values/src/main.ts // ==UserScript== // @name 技术远离政治 // @namespace http://tampermonkey.net/ // @version 1.3.0 // @description 移除政治相关条幅或替换为社会主义核心价值观、今日诗词,替换政治相关 Logo 为原版 Logo,去除政治相关通知,让技术远离政治。 // @author duanluan // @copyright 2022, duanluan (https://github.com/duanluan) // @license Apache-2.0; https://www.apache.org/licenses/LICENSE-2.0.txt // @match *://reactjs.org/* // @match *://angular.io/* // @match *://junit.org/* // @match *://codecept.io/* // @match *://github.com/* // @match *://docs.nestjs.com/* // @match *://emberjs.com/* // @match *://www.electronjs.org/* // @match *://www.jenkins.io/* // @match *://svelte.dev/* // @match *://sveltematerialui.com/* // @match *://syncthing.net/* // @match *://gf.qytechs.cn/* // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.slim.min.js // @grant GM_getValue // @grant GM_setValue // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_xmlhttpRequest // ==/UserScript== // ==OpenUserJS== // @author duanluan // ==/OpenUserJS== (function () { 'use strict'; Options.registerAll(); Options.loadInGreasyfork(); React.replace(); Angular.replace(); Junit.replace(); Codecept.replace(); Github.replace(); Nest_Codecept.replace(); Ember.replace(); Electron.replace(); Jenkins_Angular.replace(); Svelte.replace(); SvelteMaterialUi.replace(); Syncthing.replace(); })(); /******/ })() ;
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址