微信编辑器增强🧬

为135、96、365编辑器去除广告,免vip,增加css样式编辑面板等...

  1. // ==UserScript==
  2. // @name 微信编辑器增强🧬
  3. // @namespace http://tampermonkey.net/
  4. // @match *://www.135editor.com/*
  5. // @match *://bj.96weixin.com/*
  6. // @match *://www.365editor.com/*
  7. // @match *://mp.weixin.qq.com/*
  8. // @icon https://www.135editor.com/img/vip/vip.png
  9. // @require https://cdn.jsdelivr.net/npm/jscolor-picker@2.0.4/jscolor.min.js
  10. // @grant GM_addStyle
  11. // @version 2.0.1
  12. // @author ec50n9
  13. // @description 为135、96、365编辑器去除广告,免vip,增加css样式编辑面板等...
  14. // @license MIT
  15. // ==/UserScript==
  16. (() => {
  17. "use strict";
  18. function e(e, n, t, i) {
  19. let o,
  20. d,
  21. r,
  22. l,
  23. a,
  24. c = 0,
  25. s = 0,
  26. f = 0;
  27. switch (
  28. (n < 0 && (n = 0),
  29. n > 1 && (n = 1),
  30. t < 0 && (t = 0),
  31. t > 1 && (t = 1),
  32. (e %= 360) < 0 && (e += 360),
  33. (e /= 60),
  34. (o = Math.floor(e)),
  35. (d = e - o),
  36. (r = t * (1 - n)),
  37. (l = t * (1 - n * d)),
  38. (a = t * (1 - n * (1 - d))),
  39. o)
  40. ) {
  41. case 0:
  42. (c = t), (s = a), (f = r);
  43. break;
  44. case 1:
  45. (c = l), (s = t), (f = r);
  46. break;
  47. case 2:
  48. (c = r), (s = t), (f = a);
  49. break;
  50. case 3:
  51. (c = r), (s = l), (f = t);
  52. break;
  53. case 4:
  54. (c = a), (s = r), (f = t);
  55. break;
  56. case 5:
  57. (c = t), (s = r), (f = l);
  58. }
  59. return i && i < 1
  60. ? "rgba(" +
  61. Math.round(255 * c) +
  62. ", " +
  63. Math.round(255 * s) +
  64. ", " +
  65. Math.round(255 * f) +
  66. ", " +
  67. i +
  68. ")"
  69. : "rgb(" +
  70. Math.round(255 * c) +
  71. ", " +
  72. Math.round(255 * s) +
  73. ", " +
  74. Math.round(255 * f) +
  75. ")";
  76. }
  77. function n(e, n, t, i) {
  78. (e /= 255), (n /= 255), (t /= 255);
  79. const o = Math.max(e, n, t),
  80. d = o - Math.min(e, n, t);
  81. let r = o,
  82. l = 0 === r ? 0 : d / r,
  83. a = 0;
  84. return (
  85. e === r && (a = (60 * (n - t)) / d),
  86. n === r && (a = 120 + (60 * (t - e)) / d),
  87. t === r && (a = 240 + (60 * (e - n)) / d),
  88. 0 === d && (a = 0),
  89. a < 0 && (a += 360),
  90. (a = a / 2 / 180),
  91. (a = Number(a.toFixed(4))),
  92. (l = Number(l.toFixed(4))),
  93. (r = Number(r.toFixed(4))),
  94. [a, l, r, i]
  95. );
  96. }
  97. const t = function (e, n) {
  98. (n || $("head")).append($(`<style>${e}</style>`));
  99. },
  100. i = function (e, n) {
  101. const i = $("body"),
  102. o = $("#ueditor_0");
  103. if (
  104. (t(
  105. ".ective{outline: 1.5px dashed red !important; outline-offset: 2px; position: relative;}",
  106. o.contents().find("head")
  107. ),
  108. i.hasClass("running"))
  109. )
  110. if (
  111. (e.fadeOut(200),
  112. o.contents().find("body").unbind(),
  113. i.removeClass("running"),
  114. o.contents().find("body .ective").removeClass("ective"),
  115. n)
  116. )
  117. n(!1);
  118. else {
  119. const e = i.find("#ec-change");
  120. (e.length ? e : i)
  121. .css({ "background-color": "#e8b004" })
  122. .text("编辑进化");
  123. }
  124. else if (
  125. (e.fadeIn(200),
  126. o
  127. .contents()
  128. .find("body")
  129. .on(
  130. "click",
  131. (function (e) {
  132. const n = e.find("#ec_path_list"),
  133. t = e.find("#ec_win_style"),
  134. i = e.find("#ec_win_input_style"),
  135. o = e.find("#ec_win_add_style"),
  136. d = e.find("#ec_win_attr"),
  137. r = e.find("#ec_child_list"),
  138. l = e.find("#ec_win_html"),
  139. a = e.find("#ec_win_delete"),
  140. c = e.find("#ec_win_parent"),
  141. s = e.find("#ec_win_write");
  142. return function (e) {
  143. const f = $(e.target);
  144. $("#ueditor_0")
  145. .contents()
  146. .find("body .ective")
  147. .removeClass("ective"),
  148. f.addClass("ective"),
  149. n.html(""),
  150. t.html(""),
  151. d.html(""),
  152. l.val(""),
  153. o.unbind(),
  154. r.html(""),
  155. s.unbind(),
  156. c.unbind(),
  157. a.unbind(),
  158. f.each(function () {
  159. f
  160. .parents()
  161. .filter("body *")
  162. .each(function () {
  163. let e = $(
  164. `<li><a style="color:#ff793f;" href="javascript:;">${this.tagName}</a></li>`
  165. );
  166. n.prepend(e);
  167. let t = $(this);
  168. e.find("a").bind("click", function () {
  169. t.click();
  170. });
  171. }),
  172. n.append(`<li>[ ${this.tagName} ]</li>`),
  173. $.each(this.attributes, function () {
  174. if (this.specified)
  175. if ("style" === this.name) {
  176. let e = this.value.split(";");
  177. for (let n = 0; n < e.length; n++) {
  178. let i = e[n];
  179. if (i) {
  180. let e = i.split(":"),
  181. n = i.slice(i.indexOf(":") + 1).trim(),
  182. o = $(
  183. `<tr ec-attr="${e[0]}"><th>${
  184. e[0]
  185. }</th><td><input type="${
  186. (n.match(/^#[a-f0-9]{3,6}$/i), "text")
  187. }" value="${n}" style="border:2px solid #eee;padding:0 8px; border-radius:2px;"></td></tr>`
  188. );
  189. t.append(o);
  190. }
  191. }
  192. } else {
  193. let e = $(
  194. `<tr ec-attr="${this.name}"><th>${this.name}</th><td><input type="text" value="${this.value}" style="border:2px solid #eee;padding:0 8px; border-radius:2px;"></td></tr>`
  195. );
  196. d.append(e);
  197. }
  198. });
  199. });
  200. const p = function (e, n, t) {
  201. const i = $(
  202. '<ul style="list-style-type:circle; margin-left:2em;"></ul>'
  203. );
  204. n.children().each(function () {
  205. let e = $(
  206. `<li><a style="color:#ff793f;" href="javascript:;">${this.tagName}</a></li>`
  207. ),
  208. n = $(this);
  209. e.find("a").bind("click", function () {
  210. return n.click(), !1;
  211. }),
  212. i.append(e),
  213. p(i, n, e);
  214. }),
  215. i.html() &&
  216. (e.append(i),
  217. t &&
  218. t
  219. .css("list-style-type", "disc")
  220. .on("click", function () {
  221. i.slideToggle(200);
  222. }));
  223. };
  224. function u(e) {
  225. let n = t.find("tr"),
  226. i = "";
  227. for (let e = 0; e < n.length; e++) {
  228. let t = $(n[e]);
  229. t.find("input").val() &&
  230. (i =
  231. i +
  232. t.attr("ec-attr") +
  233. ":" +
  234. t.find("input").val() +
  235. ";");
  236. }
  237. e.attr("style", i);
  238. }
  239. return (
  240. p(r, f),
  241. l.val(f.html()),
  242. o.bind("click", function () {
  243. let e = (i.val() || "").toString();
  244. if (e) {
  245. let n = e.split(":");
  246. t.append(
  247. `<tr ec-attr="${n[0]}"><th>${
  248. n[0]
  249. }</th><td><input type="text" value="${
  250. n.length > 1 ? n[1].replace(";", "") : ""
  251. }" style="border:2px solid #eee;padding:0 8px; border-radius:2px;"></td></tr>`
  252. ),
  253. i.val("");
  254. }
  255. u(f);
  256. }),
  257. s.bind("click", function () {
  258. u(f);
  259. let e = d.find("tr");
  260. for (let n = 0; n < e.length; n++) {
  261. let t = $(e[n]);
  262. f.attr(t.attr("ec-attr"), t.find("input").val());
  263. }
  264. f.html((l.val() || "").toString());
  265. }),
  266. c.on("click", function () {
  267. f.parent().click();
  268. }),
  269. a.on("click", function () {
  270. let e = f.parent();
  271. f.remove(), e.click();
  272. }),
  273. !1
  274. );
  275. };
  276. })(e)
  277. ),
  278. i.addClass("running"),
  279. n)
  280. )
  281. n(!0);
  282. else {
  283. const e = i.find("#ec-change");
  284. (e.length ? e : i)
  285. .css({ "background-color": "#20a162" })
  286. .text("解除进化");
  287. }
  288. };
  289. console.log("--- inject ---"),
  290. GM_addStyle(
  291. '#ec_window {\n display: flex;\n flex-direction: column;\n position: fixed;\n top: 5%;\n left: 25%;\n width: 24em;\n max-height: 90%;\n background-color: #fff;\n box-shadow: rgba(9, 30, 66, 0.25) 0px 4px 8px -2px,\n rgba(9, 30, 66, 0.08) 0px 0px 0px 1px;\n border-radius: 1em;\n overflow: hidden;\n z-index: 999;\n font-family: PingFangSC-Regular, "Georgia Pro", Georgia, Times,\n "Times New Roman", sans-serif;\n}\n#ec_path_list {\n list-style: none;\n display: flex;\n flex-wrap: wrap;\n text-transform: lowercase;\n}\n#ec_path_list li:nth-child(n + 2)::before {\n content: ">";\n margin: 0 0.5em;\n}\n#ec_win_style th,\n#ec_win_attr th {\n width: 40%;\n border-width: 1px;\n font-weight: 500;\n}\n.header {\n position: relative;\n padding: 0.2rem 0;\n color: #000;\n font-weight: 700;\n background-color: #fff;\n cursor: move;\n user-select: none;\n}\n.header__title {\n text-align: center;\n}\n.header__btns-wrapper {\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-40%);\n}\n.header__btn {\n display: inline-block;\n width: 0.9em;\n height: 0.9em;\n margin-left: 0.5em;\n background-color: #fff;\n border: none;\n border-radius: 50%;\n cursor: pointer;\n}\n#ec_win_close {\n background-color: rgb(239, 68, 68);\n}\n#ec_win_mini {\n background-color: rgb(245, 158, 11);\n}\n.tab-wrapper {\n display: flex;\n flex-direction: row;\n}\n.tab {\n flex-grow: 1;\n color: rgb(107, 114, 128);\n font-size: 0.9rem;\n padding: 0.2rem 0;\n margin: 0.3rem;\n text-align: center;\n border-radius: 0.5rem;\n cursor: pointer;\n}\n.tab--active {\n color: #fff;\n font-weight: 700;\n background-color: rgb(16, 185, 129);\n box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;\n}\n#ec_panel_wrapper {\n display: flex;\n overflow: hidden;\n}\n#ec_panel_element {\n display: flex;\n width: 100%;\n flex-direction: column;\n margin: 1em;\n overflow: hidden;\n}\n#ec_win_html {\n width: 100%;\n resize: none;\n box-sizing: border-box;\n}\n\n#ec_panel_color,\n#ec_panel_template {\n width: 100%;\n margin: 2em;\n}\n\n#color_picker {\n width: 100%;\n display: flex;\n flex-direction: column;\n}\n#color_color {\n position: relative;\n width: 100%;\n height: 10em;\n background-color: rgb(255, 0, 0);\n}\n#color_sat {\n width: 100%;\n height: 100%;\n background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));\n}\n#color_val {\n width: 100%;\n height: 100%;\n background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));\n}\n#color_dragger {\n position: absolute;\n top: 0;\n left: 0;\n width: 1em;\n height: 1em;\n transform: translate(-50%, -50%);\n border-radius: 50%;\n background-color: #fff;\n border: 2px solid #000;\n}\n#color_h {\n position: relative;\n width: 100%;\n height: 1em;\n margin: 0.5em 0;\n background: -webkit-linear-gradient(\n left,\n #ff0000 0%,\n #ffff00 17%,\n #00ff00 33%,\n #00ffff 50%,\n #0000ff 67%,\n #ff00ff 83%,\n #ff0000 100%\n );\n}\n#color_alpha {\n position: relative;\n width: 100%;\n height: 1em;\n margin: 0.5em 0;\n background-image: url(https://s1.ax1x.com/2022/04/17/LN6aCR.png);\n}\n#color_h_dragger,\n#color_alpha_dragger {\n position: absolute;\n top: -10%;\n left: 100%;\n width: 0.5em;\n height: 120%;\n transform: translateX(-50%);\n background-color: #d1d5db;\n}\n#color_alpha_inner {\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0)\n linear-gradient(to right, rgba(255, 0, 0, 0), rgb(255, 0, 0)) repeat scroll\n 0% 0%;\n}\n#color_preview_wrapper {\n display: flex;\n flex-direction: row;\n align-items: center;\n width: 100%;\n margin: 1em 0;\n}\n#color_preview {\n width: 2em;\n height: 2em;\n background-color: rgb(0, 0, 0);\n border: 2px solid #eee;\n}\n#color_preview_text {\n flex-grow: 1;\n width: 1em;\n margin-left: 1em;\n border: 2px solid #eee;\n padding: 0.1em 0.5em;\n border-radius: 0.5em;\n}\n#color_copy {\n align-self: flex-end;\n padding: 0.2em 0.8em;\n border-radius: 0.4em;\n border: 2px solid #eee;\n color: #fff;\n background-color: #3b82f6;\n}\n'
  292. );
  293. let o = $(
  294. '<div id="ec_window">\n <div id="ec_header" class="header">\n <div class="header__title truncate">编辑面板</div>\n <div class="header__btns-wrapper">\n <div id="ec_win_close" class="header__btn"></div>\n <div id="ec_win_mini" class="header__btn"></div>\n </div>\n </div>\n <div id="ec_tabs" class="tab-wrapper">\n <div id="ec_tab_element" class="tab tab--active">元素</div>\n <div id="ec_tab_color" class="tab">色板</div>\n <div id="ec_tab_template" class="tab">模板</div>\n </div>\n <div id="ec_panel_wrapper">\n <div id="ec_panel_element" class="ec_panel">\n <div id="ec_path_list"></div>\n <div style="display:flex; flex-direction:column; overflow-y:scroll;">\n <h2 style="margin-top:1em; font-weight:600">当前元素样式</h2>\n <table id="ec_win_style"></table>\n <div style="display:flex; align-items:center; margin-top:.5em">\n <input id="ec_win_input_style" type="text" value="" placeholder="例: color: red;"\n style="flex-grow:1; border:2px solid #eee;padding:0 8px; border-radius:2px;">\n <button id="ec_win_add_style"\n style="min-width:5em; margin-left:1em; padding:.2em .8em; border-radius:.4em; border:2px solid #eee; color:#fff; background-color:#3B82F6;">添加样式</button>\n </div>\n <div style="display:none; margin-top:.8em; color:#999; font-size:.8em;">\n 每次只能添加<strong>一条</strong>样式。<br>\n 添加样式后需要点击下方<strong>写入</strong>才可生效。<br>\n 清空编辑框后点击<strong>写入</strong>即可删除该行样式。\n </div>\n <h2 style="margin-top:1em; font-weight:600">属性</h2>\n <table id="ec_win_attr"></table>\n <h2 style="margin-top:1em; font-weight:600">子元素</h2>\n <ul id="ec_child_list" style="margin:0;">\n </ul>\n <h2 style="margin-top:1em; font-weight:600">内容</h2>\n <div style="width:100%">\n <textarea id="ec_win_html" rows="5"\n style="width:100%; border:2px solid #eee; padding:0 8px; border-radius:2px;">元素文本</textarea>\n </div>\n </div>\n <div style="display:flex; flex-direction: row; align-items: center; justify-content: right;">\n <button id="ec_win_delete"\n style="align-self:flex-end; padding:.2em .8em; border-radius:.4em; border:2px solid #eee; color:#fff; background-color:#B91C1C;">删除元素</button>\n <button id="ec_win_parent"\n style="align-self:flex-end; padding:.2em .8em; border-radius:.4em; border:2px solid #eee; color:#fff; background-color:#F59E0B;">父容器</button>\n <button id="ec_win_write"\n style="align-self:flex-end; padding:.2em .8em; border-radius:.4em; border:2px solid #eee; color:#fff; background-color:#3B82F6;">更新写入</button>\n </div>\n </div>\n <div id="ec_panel_color" class="ec_panel">\n <h2>调色板</h2>\n <div id="color_picker">\n <div id="color_color">\n <div id="color_sat">\n <div id="color_val">\n <div id="color_dragger"></div>\n </div>\n </div>\n </div>\n <div id="color_h">\n <div id="color_h_dragger"></div>\n </div>\n <div id="color_alpha">\n <div id="color_alpha_inner">\n <div id="color_alpha_dragger"></div>\n </div>\n </div>\n <div id="color_preview_wrapper">\n <div id="color_preview"></div>\n <input id="color_preview_text" type="text" placeholder="点击色板以选择颜色值">\n </div>\n <button id="color_copy">复制颜色值</button>\n </div>\n </div>\n <div id="ec_panel_template" class="ec_panel">\n <h2>开发中。。。</h2>\n </div>\n </div>\n</div>'
  295. ).hide();
  296. const d = o.find("#ec_header"),
  297. r = (o.find("#ec_win_close"), o.find("#ec_win_mini")),
  298. l = o.find("#ec_tabs"),
  299. a = o.find("#ec_tab_element"),
  300. c = o.find("#ec_tab_color"),
  301. s = o.find("#ec_tab_template"),
  302. f = o.find("#ec_panel_wrapper"),
  303. p = o.find("#ec_panel_element"),
  304. u = o.find("#ec_panel_color").hide(),
  305. h = o.find("#ec_panel_template").hide();
  306. r.click(function () {
  307. l.toggle(), f.toggle();
  308. }),
  309. a.click(function () {
  310. console.log("gogo:", o.find(".tab--active")),
  311. o.find(".tab--active").removeClass("tab--active"),
  312. a.addClass("tab--active"),
  313. o.find(".ec_panel:not(#ec_panel_element)").hide(),
  314. p.show();
  315. }),
  316. c.click(function () {
  317. o.find(".tab--active").removeClass("tab--active"),
  318. c.addClass("tab--active"),
  319. o.find(".ec_panel:not(#ec_panel_color)").hide(),
  320. u.show();
  321. }),
  322. s.click(function () {
  323. o.find(".tab--active").removeClass("tab--active"),
  324. s.addClass("tab--active"),
  325. o.find(".ec_panel:not(#ec_panel_template)").hide(),
  326. h.show();
  327. }),
  328. (function (t) {
  329. const i = t.find("#color_color"),
  330. o = t.find("#color_dragger"),
  331. d = t.find("#color_h"),
  332. r = t.find("#color_h_dragger"),
  333. l = t.find("#color_alpha"),
  334. a = t.find("#color_alpha_dragger"),
  335. c = t.find("#color_preview"),
  336. s = t.find("#color_preview_text"),
  337. f = t.find("#color_copy");
  338. let p = 0,
  339. u = 0,
  340. h = 0,
  341. g = 1;
  342. function b() {
  343. const n = e(p, u, h, g);
  344. c.css("background-color", n), s.val(n);
  345. }
  346. function _(e, n) {
  347. e.mousedown(function (i) {
  348. let o = i.pageX - e.offset().left,
  349. d = i.pageY - e.offset().top;
  350. return (
  351. n(o, d),
  352. t.mousemove(function (t) {
  353. (o = t.pageX - e.offset().left),
  354. (d = t.pageY - e.offset().top),
  355. n(o, d);
  356. }),
  357. t.mouseup(function (e) {
  358. t.off("mousemove"), t.off("mouseup");
  359. }),
  360. t.mouseleave(function (e) {
  361. t.off("mousemove"), t.off("mouseup");
  362. }),
  363. !1
  364. );
  365. });
  366. }
  367. s.change(function () {
  368. const t = s.val().trim();
  369. let c;
  370. if (t.match(/^#[a-f0-9]{3,8}$/i)) {
  371. const {
  372. red: e,
  373. green: i,
  374. blue: o,
  375. alpha: d,
  376. } = (function (e) {
  377. let n = e.substring(1),
  378. t = 1;
  379. return (
  380. n.length < 6
  381. ? (n = (function (e, n) {
  382. let t = "";
  383. for (let n of e) t += i(n, 2);
  384. return t;
  385. })(n))
  386. : 8 == n.length &&
  387. ((t = ("0x" + n) & "0xff"),
  388. (t = Number(((t / 255) * 1).toFixed(2))),
  389. (n = n.substring(0, 6))),
  390. (n = "0x" + n),
  391. {
  392. red: n >> 16,
  393. green: (n >> 8) & "0xff",
  394. blue: "0xff" & n,
  395. alpha: t,
  396. }
  397. );
  398. function i(e, n) {
  399. let t = "";
  400. for (let i = 0; i < n; i++) t += e;
  401. return t;
  402. }
  403. })(t);
  404. (c = n(e, i, o, d)), b();
  405. } else if (t.match(/^rgba\(.+?\)$/i)) {
  406. const e = t
  407. .replace(/\s+/g, "")
  408. .match(/^rgba\(([0-9]+),([0-9]+),([0-9]+),([0-9.]+)\)$/i);
  409. c = n(e[1], e[2], e[3], e[4]);
  410. } else {
  411. if (!t.match(/^rgb\(.+?\)$/i)) return;
  412. {
  413. const e = t
  414. .replace(/\s+/g, "")
  415. .match(/^rgb\(([0-9]+),([0-9]+),([0-9]+)\)$/i);
  416. c = n(e[1], e[2], e[3], 1);
  417. }
  418. }
  419. (p = 360 * c[0]),
  420. (u = c[1]),
  421. (h = c[2]),
  422. (g = c[3]),
  423. i.css("background-color", e(p, 1, 1, 1)),
  424. o.css({
  425. left: u * i.width() + "px",
  426. top: i.height() - h * i.height(),
  427. }),
  428. r.css({ left: (p * d.width()) / 360 }),
  429. a.css({ left: g * l.width() }),
  430. b();
  431. }),
  432. f.click(function (e) {
  433. console.log("hello"), s.select(), document.execCommand("Copy");
  434. }),
  435. _(i, function (e, n) {
  436. e < 0 && (e = 0),
  437. e > i.width() && (e = i.width()),
  438. n < 0 && (n = 0),
  439. n > i.height() && (n = i.height()),
  440. o.css({ left: e + "px", top: n + "px" }),
  441. (u = e / i.width()),
  442. (h = (i.height() - n) / i.height()),
  443. b();
  444. }),
  445. _(d, function (n) {
  446. n < 0 && (n = 0),
  447. n > d.width() && (n = d.width()),
  448. r.css({ left: n + "px" }),
  449. (p = ~~((n / d.width()) * 360)),
  450. i.css("background-color", e(p, 1, 1, 1)),
  451. b();
  452. }),
  453. _(l, function (e) {
  454. e < 0 && (e = 0),
  455. e > l.width() && (e = l.width()),
  456. a.css({ left: e + "px" }),
  457. (g = Number((e / l.width()).toFixed(2))),
  458. b();
  459. });
  460. })(o),
  461. $(function () {
  462. $("body").append(o),
  463. (function (e, n) {
  464. e.mousedown(function (e) {
  465. var t = n.offset(),
  466. i = e.pageX - t.left,
  467. o = e.pageY - t.top;
  468. return (
  469. $(document).mousemove(function (e) {
  470. var t = e.pageX - i,
  471. d = e.pageY - o;
  472. t < 0
  473. ? (t = 0)
  474. : t > $(document).width() - n.outerWidth(!0) &&
  475. (t = $(document).width() - n.outerWidth(!0)),
  476. d < 0
  477. ? (d = 0)
  478. : d > $(document).height() - n.outerHeight(!0) &&
  479. (d = $(document).height() - n.outerHeight(!0)),
  480. n.css({ left: t + "px", top: d + "px" });
  481. }),
  482. $(document).mouseup(function () {
  483. $(document).off("mousemove");
  484. }),
  485. !1
  486. );
  487. });
  488. })(d, o),
  489. t("#ec-change{color:#fff; background-color:#e8b004;}"),
  490. (function (e) {
  491. const n = window.location.host;
  492. n.search(/www.135editor.com/) >= 0
  493. ? (function (e) {
  494. setInterval(() => {
  495. let e = $("#editor-template-scroll li");
  496. for (let n = 0, t = e.length; n < t; n++)
  497. e[n].classList.remove("vip-style");
  498. $(".vip-flag").remove(), $(".user-unread-msgnum").hide();
  499. try {
  500. articleManager.setVIP(!0);
  501. } catch (e) {}
  502. }, 1e3),
  503. (unsafeWindow.style_click =
  504. unsafeWindow.show_role_vip_dialog =
  505. function () {
  506. console.log("hey!");
  507. }),
  508. (style_click = show_role_vip_dialog = function () {}),
  509. $("#add_xiaoshi").hide(),
  510. $(
  511. ".category-nav.editor-nav>.nav-item:nth-last-child(-n+2)"
  512. ).hide(),
  513. $(
  514. "#fixed-side-bar li:not(#function-settings), #fixed-bar-pack-up"
  515. ).hide();
  516. let n = $(
  517. '<li style="margin-bottom: 20px;"><a href="javascript:;" id="ec-change" class="btn btn-default btn-xs" title="绑定监听器">编辑进化</a></li>'
  518. ).on("click", () => i(e));
  519. $("#operate-tool").prepend(n);
  520. let t = $(
  521. '<li><a href="javascript:;" class="btn btn-default btn-xs" title="打开色板">开关色板</a></li>'
  522. ).on("click", function () {
  523. $("#color-plan").fadeToggle(300);
  524. });
  525. $("#operate-tool").prepend(t);
  526. })(e)
  527. : n.search(/bj.96weixin.com/) >= 0
  528. ? (function (e) {
  529. setInterval(() => {
  530. $(".rich_media_content").attr("data-vip", 1);
  531. }, 1e3);
  532. let n = $(
  533. '<button type="button" id="ec-change" class="layui-btn layui-btn-primary">编辑进化</button>'
  534. ).on("click", () => i(e));
  535. $(".button-tools").prepend(n);
  536. })(e)
  537. : n.search(/www.365editor.com/) >= 0
  538. ? (function (e) {
  539. let n = $(
  540. '<li id="ec-change" data-act="import"><span>编辑进化</span></li>'
  541. ).on("click", () => i(e));
  542. $(".m-tools").prepend(n);
  543. })(e)
  544. : n.search(/mp.weixin.qq.com/) >= 0 &&
  545. (function (e) {
  546. t("#ec-change {\n border-radius: 4px;\n}\n");
  547. const n = $(
  548. '<div id="edui201" class="edui-box edui-separator edui-default"></div>'
  549. ),
  550. o = $(
  551. '<div id="ec-change" class="edui-box edui-splitbutton edui-for-inserttable edui-default">\n <div data-tooltip="编辑进化" id="edui202_state">\n <div class="edui-splitbutton-body edui-default">\n <div id="edui202_button_body" class="edui-box edui-button-body edui-default">\n <div class="edui-box edui-default" style="font-size: 1rem;">🧬</div>\n </div>\n <div class="edui-box edui-splitborder edui-default"></div>\n <div class="edui-box edui-arrow edui-default" onclick="$EDITORUI[&quot;edui202&quot;]._onArrowClick();"></div>\n </div>\n </div>\n</div>'
  552. ).on("click", () =>
  553. i(e, (e) => {
  554. e
  555. ? o.css({ "background-color": "#20a162" })
  556. : o.css({ "background-color": "#e8b004" });
  557. })
  558. );
  559. $("#js_toolbar_0").append(n).append(o);
  560. })(e);
  561. })(o);
  562. }),
  563. console.log("--- inject end ---");
  564. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址