// ==UserScript== // @name 图标替换辅助工具 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 辅助图标替换 // @author jiezi19971225 // @include http://localhost* // @include https://localhost* // @match http://*.xiaoman.cn/* // @match https://*.xiaoman.cn/* // @require https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.min.js // @require https://cdn.bootcdn.net/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js // @run-at document-idle // @grant GM_addStyle // @encoding utf-8 // @downloadURL https://update.greasyfork.icu/scripts/427245/%E5%9B%BE%E6%A0%87%E6%9B%BF%E6%8D%A2%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7.user.js // @updateURL https://update.greasyfork.icu/scripts/427245/%E5%9B%BE%E6%A0%87%E6%9B%BF%E6%8D%A2%E8%BE%85%E5%8A%A9%E5%B7%A5%E5%85%B7.meta.js // ==/UserScript== (function () { "use strict"; function toggleStyle(style, initActive) { var styleEle = GM_addStyle(style); var styleActive = !!initActive; if (!styleActive) { styleEle.remove(); } return function (state) { if (state === undefined) { styleActive = !styleActive; } else { styleActive = !!state; } if (!styleActive) { styleEle.remove(); } else { $("head").append(styleEle); } }; } GM_addStyle(` .icon-replace-helper-iconname{ width:40px; word-break:break-all; text-align:left; z-index:9; display:block; position:absolute; color: red !important; bottom:-28px; left: 0; font-size:12px; line-height:12px; } `); var toggleHighLightIconfontStyle = toggleStyle( ` .m-icon { outline:1px solid red !important; } `, true ); var toggleHighLightAmumuIconStyle = toggleStyle( ` .mm-icon { outline:1px solid blue !important; } `, true ); var showNameFlag = true; GM_addStyle(` .icon-replace-helper-controller{ padding:10px; z-index:10000; cursor:move; width:200px; position:absolute; right:50px; top:200px; background:#eee; border-radius:4px; border:1px solid #ccc; font-size:16px; } .icon-replace-helper-controller-header{ color: #0099CC; } .icon-replace-helper-controller-checkbox{ display:block; } .icon-replace-helper-tip{ position:absolute; background:#9FC; border-color:#F60; z-index:9999; opacity: 0.8; } `); function addControler() { var controller = $(`