您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
给WordPress网站站长提供文章自动容灾备份的小脚本
当前为
// ==UserScript== // @name WordPress Post Backup // @namespace https://gitcafe.net // @version 0.1 // @description 给WordPress网站站长提供文章自动容灾备份的小脚本 // @author 云落 // @include */wp-admin/post* // @grant none // @charset UTF-8 // @run-at document-end // ==/UserScript== (function() { 'use strict'; $(document).ready(function() { function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) { return unescape(r[2]); } return null; } var postid = getUrlParam('post'); var TOKEN_KEY; if (postid) { TOKEN_KEY = postid; } else { TOKEN_KEY = 'newpost'; } $("#content").bind("input", function() { window.localStorage.setItem(TOKEN_KEY, this.value); }); jQuery(document).on("click", "#get_localstorage", function() { var c = window.localStorage.getItem(TOKEN_KEY); $("#content").val(c); }); jQuery(document).on("click", "#del_localstorage", function() { window.localStorage.removeItem(TOKEN_KEY); }); $("#wp-content-media-buttons").append(' <a class="button button-primary" id="get_localstorage" href="javascript:void(0);">↺ 一键恢复</a> <a class="button button-primary" id="del_localstorage" href="javascript:void(0);">♻ 一键清空</a>'); }); })();