Greasy Fork

Greasy Fork is available in English.

[zblog] - 前台编辑文章入口

配合主题以显示前台编辑入口

当前为 2021-03-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        [zblog] - 前台编辑文章入口
// @namespace   https://www.wdssmq.com/
// @version     0.2
// @author      沉冰浮水
// @description 配合主题以显示前台编辑入口
// @link        http://greasyfork.icu/zh-CN/scripts/25003
// ----------------------------
// @link   https://afdian.net/@wdssmq
// @link   https://github.com/wdssmq/userscript
// @link   http://greasyfork.icu/zh-CN/users/6865-wdssmq
// ----------------------------
// @match       *://*/post/*.html
// @match       *://*/*.html
// @match       *://*/zb_system/admin/edit.php*
// @grant       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(
          `[<a title="编辑" rel="external" href="${window.bloghost}zb_system/cmd.php?act=${act}&id=${id}">编辑</a>]`
        );
      })
      .removeClass("is-hidden hidden");
    // if ($("#edtDateTime").length === 1) {
    // $('#edtDateTime').datetimepicker('setDate', (new Date()));
    // }
    $(".cmt-tips").each(function () {
      const $this = $(this);
      const authName = $this.data("name");
      $this.append(
        ` <a class="cmt-edit" title="查找编辑" rel="external" href="${window.bloghost}zb_users/plugin/cmt2rss/main.php?act=update&read_getWord=${authName}" target="_blank">查找编辑</a>`
      );
    });
    $(".cmt-edit").css({ color: "#175199" });
  });
})();