// ==UserScript== // @name 中国宝武学习系统-统一学习助手(网络自学+集中培训+自动考试) // @namespace https://tampermonkey.net/ // @version 1.1.0 // @description 右键菜单可自定义配色;右上角悬浮按钮,三种模式随意切换。 // @author 令狐不太冲 // @match *://learn.baowugroup.com/* // @grant GM_setValue // @grant GM_getValue // @grant GM_notification // @grant GM_xmlhttpRequest // @grant GM_registerMenuCommand // @grant window.close // @run-at document-end // @icon https://img.mp.sohu.com/q_70,c_zoom,w_640/upload/20170615/da385146ecfa4b26a0d61eb995f5477b_th.jpg // @license MIT // ==/UserScript== (function() { 'use strict'; const MODE_STORAGE_KEY = 'baowu_unified_mode'; const EXAM_CONFIG_KEY = 'baowu_exam_config'; const SETTINGS_KEY = 'baowu_ui_settings'; let currentMode = null; let modeSelector = null; let modeTriggerEl = null; let cleanupFunctions = []; // ======================== 全局配色设置 ======================== const DEFAULT_SETTINGS = { panelBg: '#121212', panelOpacity: 0.95, buttonColor: '#1890ff', buttonHoverColor: '#40a9ff', textColor: '#ffffff', accentColor: '#ff3333', triggerColor: '#1a1a2e' }; function loadSettings() { const saved = GM_getValue(SETTINGS_KEY); if (saved) { try { return Object.assign({}, DEFAULT_SETTINGS, JSON.parse(saved)); } catch (e) {} } return { ...DEFAULT_SETTINGS }; } function saveSettings(settings) { GM_setValue(SETTINGS_KEY, JSON.stringify(settings)); } let appSettings = loadSettings(); // 注册右键菜单 GM_registerMenuCommand('⚙️ 设置', openSettingsPanel); function openSettingsPanel() { const old = document.getElementById('baowu-settings-panel'); if (old) old.remove(); const settings = appSettings; const panel = document.createElement('div'); panel.id = 'baowu-settings-panel'; panel.innerHTML = `
请选择运行模式(选择后将自动记住)