/******/ (() => { // 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: ./core-socialist-values/src/common/Options.ts
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_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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__*/Options_createClass(function Options() {
Options_classCallCheck(this, Options);
});
Options_defineProperty(Options, "Keys", {
removeBar: 'removeBar'
});
;// CONCATENATED MODULE: ./core-socialist-values/src/common/Bar.ts
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:
/**
* 替换条幅
* @param options {
* barSelector: string, // 条幅选择器
* isObserveBar: boolean, // 是否监听条幅变化
* hideBarSelector: string, // 隐藏条幅选择器
* isObserveHideBar: boolean, // 是否监听隐藏条幅变化
* followUpObserveSelector?: string, // 后续监听选择器
* replaceCallback?: Function // 替换后回调
* }
*/
function replace(options) {
var _this = this;
if (!$(options.barSelector).text().match(/ukraine|乌克兰|black|黑人/i)) {
return;
} // 如果移除横幅
if (Store.get(Options.Keys.removeBar)) {
// 隐藏横幅
$(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.replaceBar(options.barSelector, options.replaceCallback);
console.log('replaceBar');
if (!options.isObserveBar) {
return;
}
var i = 0; // 条幅首次加载:监听条幅变化,变化后再次执行
var observer = new MutationObserver(function () {
_this.replaceBar(options.barSelector, options.replaceCallback); // 替换两次后结束监听
if (i >= 1) {
observer.disconnect();
}
i++;
});
observer.observe($(options.barSelector)[0], {
childList: true
});
if (options.followUpObserveSelector) {
// 后续变化
new MutationObserver(function () {
_this.replaceBar(options.barSelector, options.replaceCallback);
}).observe($(options.followUpObserveSelector)[0], {
childList: true
});
}
}
/**
* 替换后的条幅去除空格换行后的文本
* @private
*/
}, {
key: "replaceBar",
value: function replaceBar(selector, replaceCallback) {
if ($($(selector)[0]).text().replace(/\s+/g, "") === Bar.txt) {
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.replaceSelector.bar);
if ($bar.length == 2) {
$bar.eq(0).remove();
}
var barUlSelector = this.replaceSelector.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 (replaceCallback) {
replaceCallback();
}
}
}]);
return Bar;
}();
Bar_defineProperty(Bar, "txt", '富强民主文明和谐自由平等公正法治爱国敬业诚信友善ProsperityDemocracyCivilityHarmonyFreedomEqualityJusticeRuleoflawPatriotismDedicationIntegrityFriendship');
Bar_defineProperty(Bar, "replaceSelector", {
bar: '.csv_bar',
barUl: '.csv_bar .csv_bar_ul'
});
;// 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() {
if (location.host === 'codecept.io') {
Bar.replace({
barSelector: this.selectors.bar,
isObserveBar: false,
hideBarSelector: this.selectors.hideBar,
isObserveHideBar: false
});
}
}
}]);
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() {
if (location.host === 'docs.nestjs.com') {
Bar.replace({
barSelector: this.selectors.bar,
isObserveBar: false,
hideBarSelector: this.selectors.bar,
isObserveHideBar: false
});
$(this.selectors.bar).css('padding', '0');
}
}
}]);
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() {
if (location.host === 'emberjs.com') {
Bar.replace({
barSelector: this.selectors.bar,
isObserveBar: false,
hideBarSelector: this.selectors.bar,
isObserveHideBar: false
});
$(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,
replaceCallback: function replaceCallback() {
$(Bar.replaceSelector.barUl + ':eq(0)').css('height', '25px');
$(Bar.replaceSelector.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,
replaceCallback: function replaceCallback() {
$(_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: ./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/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,
replaceCallback: function replaceCallback() {
$(_this.selectors.bar).css('textAlign', 'center');
}
});
}
}
}]);
return Syncthing;
}();
Syncthing_defineProperty(Syncthing, "selectors", {
bar: '.alert'
});
;// CONCATENATED MODULE: ./core-socialist-values/src/main.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 _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); }
// ==UserScript==
// @name 技术远离政治
// @namespace http://tampermonkey.net/
// @version 1.2.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/*
// @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
// ==/UserScript==
// ==OpenUserJS==
// @author duanluan
// ==/OpenUserJS==
(function () {
'use strict';
var options = [{
label: '移除条幅',
name: Options.Keys.removeBar,
value: false
}];
function register(option) {
var val = Store.get(option.name);
var valIsBool = typeof val === 'boolean';
var menuCmdId = MenuCmd.register((_typeof(valIsBool) ? val ? '☑️ ' : '🔲 ' : '') + option.label, function () {
if (option.name === Options.Keys.removeBar) {
Store.set(option.name, !val);
} // 如果是布尔类型就重新注册(不可用)选项
if (valIsBool) {
MenuCmd.unregister(menuCmdId);
register(option);
} // 刷新页面
window.location.reload();
});
}
for (var _i = 0, _options = options; _i < _options.length; _i++) {
var option = _options[_i];
// 存储选项默认值
if (Store.get(option.name) === null) {
Store.set(option.name, option.value);
} // 注册(不可用)选项
var _iterator = _createForOfIteratorHelper(options),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _option = _step.value;
register(_option);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
}
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();
})();
/******/ })()
;