// ==UserScript== // @name 135编辑器进化🧬 // @namespace http://tampermonkey.net/ // @match https://www.135editor.com/beautify_editor.html // @icon https://www.135editor.com/img/vip/vip.png // @grant none // @version 1.1 // @author ec50n9 // @description 去除了135编辑器页面广告、vip样式限制、非会员只能开2个选项卡限制,并增加自制css编辑器,可直接编辑元素css。 // @downloadURL none // ==/UserScript== $(function () { // 解除模板会员限制 setInterval(() => { let lis = $('#editor-template-scroll li'); for (let i = 0, len = lis.length; i < len; i++) { lis[i].classList.remove('vip-style'); } // vip删除线 $('.vip-flag').css('text-decoration', 'line-through'); // 去除小红点 $('.user-unread-msgnum').hide(); // 文章管理器会员 articleManager.setVIP(true); }, 1000); window.style_click = window.show_role_vip_dialog = function () { }; // window.loged_user = 1; // 会员弹窗 $('#add_xiaoshi').hide(); // 顶部导航栏后两个按钮 $('.category-nav.editor-nav>.nav-item:nth-last-child(-n+2)').hide(); // 移除全局菜单中非功能设置按钮 $('#fixed-side-bar li:not(#function-settings), #fixed-bar-pack-up').hide(); // 颜色增强 const getComplementaryColor = (color = '') => { const colorPart = color.slice(1); const ind = parseInt(colorPart, 16); let iter = ((1 << 4 * colorPart.length) - 1 - ind).toString(16); while (iter.length < colorPart.length) { iter = '0' + iter; }; return '#' + iter; }; let origin_color_div = $('#color-choosen>div:first-child'); // 原始 let complementary_color_div = origin_color_div.clone(); // 互补 origin_color_div.before($('
原始色
')); origin_color_div.after(complementary_color_div); origin_color_div.after($('互补色
')); $('#color-plan-list .color-swatch').on('click', function () { let cur_color = $(this).attr('style').match(/background-color:\s?([^;]+)/)[1]; console.log(cur_color, getComplementaryColor(cur_color)); origin_color_div.children('input').css('color', getComplementaryColor(cur_color)) complementary_color_div.children('input').attr('value', getComplementaryColor(cur_color)); complementary_color_div.children('input').css({ 'color': cur_color, 'background-color': getComplementaryColor(cur_color) }); }); // 编辑增强 let ec_window = $(` `); $('body').append(ec_window); // 子控件 let ec_win_title = $('#ec-win-title'); let ec_win_style = $('#ec-win-style'); let ec_win_input_style = $('#ec-win-input-style'); let ec_win_add_style = $('#ec-win-add-style'); let ec_win_attr = $('#ec-win-attr'); let ec_win_html = $('#ec-win-html'); let ec_win_parent = $('#ec-win-parent'); let ec_win_write = $('#ec-win-write'); // 窗口拖拽 ec_win_title.mousedown(function (e) { var positionDiv = $(this).offset(); var distenceX = e.pageX - positionDiv.left; var distenceY = e.pageY - positionDiv.top; $(document).mousemove(function (e) { var x = e.pageX - distenceX; var y = e.pageY - distenceY; if (x < 0) { x = 0; } else if (x > $(document).width() - ec_window.outerWidth(true)) { x = $(document).width() - ec_window.outerWidth(true); } if (y < 0) { y = 0; } else if (y > $(document).height() - ec_window.outerHeight(true)) { y = $(document).height() - ec_window.outerHeight(true); } ec_window.css({ 'left': x + 'px', 'top': y + 'px' }); }); $(document).mouseup(function () { $(document).off('mousemove'); }); }); // 绑定事件 let reflesh_btn = $('