// ==UserScript== // @name 「Z-Blog」- 前台编辑文章入口 // @namespace https://www.wdssmq.com/ // @version 0.2 // @author 沉冰浮水 // @description 配合主题以显示前台编辑入口 // @link https://greasyfork.org/zh-CN/scripts/25003 // ---------------------------- // @link https://afdian.net/@wdssmq // @link https://github.com/wdssmq/userscript // @link https://greasyfork.org/zh-CN/users/6865-wdssmq // ---------------------------- // @match *://*/post/*.html* // @match *://*/*.html // @match *://*/zb_system/admin/edit.php* // @grant none // @downloadURL none // ==/UserScript== /* jshint esversion:6 */ (function () { if (!window.jQuery) { return false; } let $ = window.jQuery; $(function () { // 添加编辑按钮 $(".js-edt") .each(function () { const id = $(this).data("id"); const type = $(this).data("type"); const act = type ? "PageEdt" : "ArticleEdt"; $(this).html( `[编辑]` ); }) .removeClass("is-hidden hidden"); // 清理评论失效网址 $(".cmt-tips").each(function () { const $this = $(this); const authName = $this.data("name"); $this.append( ` 查找编辑` ); }); $(".cmt-edit").css({ color: "#175199" }); // 设置文章为回收 $("#edtTitle").after( ' [设置为回收]' ); let editor_api = window.editor_api; $(".js-empty").click(function () { $("#edtTitle").val("回收"); $("#edtTag").val("回收"); let strMore = ""; if (typeof window.EDITORMD == "object") { strMore = "\n\n"; } else { strMore = '
'; } let oBody = "回收" + strMore; editor_api.editor.content.put(oBody); editor_api.editor.intro.put(""); }); }); })();