// ==UserScript== // @name processOn 一键生成历史版本 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 一键生成历史版本 // @author AT // @match https://www.processon.com/mindmap/* // @grant none // @downloadURL https://update.greasyfork.icu/scripts/391689/processOn%20%E4%B8%80%E9%94%AE%E7%94%9F%E6%88%90%E5%8E%86%E5%8F%B2%E7%89%88%E6%9C%AC.user.js // @updateURL https://update.greasyfork.icu/scripts/391689/processOn%20%E4%B8%80%E9%94%AE%E7%94%9F%E6%88%90%E5%8E%86%E5%8F%B2%E7%89%88%E6%9C%AC.meta.js // ==/UserScript== getLocalTime = () => { const date = new Date(); return 'AT-自动存储-' + date.toLocaleTimeString(); }; setCss = params => { params.length && params.map(item => { item.css('background', 'pink'); }); }; autoSaveHistory = () => { const more = $("div[tit$='down']"); // 更多按钮 const history = $("div[tp='history']"); // 历史版本 const historyAdd = $('#btn-history-add'); // 创建历史版本 const historyRemark = $('#history_remark'); // 版本标题输入框 const historySaveBtn = $('#btn-histoty-save'); // 版本标题输入框 const historyClose = $("span[class='mind-icons close']"); // 关闭历史版本 setCss([ more, history, historyAdd, historyRemark, historySaveBtn, historyClose ]); more.click(); history.click(); historyAdd.click(); historyRemark.val(getLocalTime()); historySaveBtn.click(); historyClose.click(); }; (function() { 'use strict'; // 删除多余元素 const saveTip = $('#savetip').parent('.header-item'); saveTip.remove(); setCss([ saveTip ]); // 找到元素改变背景颜色 const headerLeft = $('.header-left'); // 顶部左侧导航 headerLeft.append( '
', ); $('#atHistorySave').on('click', () => { autoSaveHistory(); }); })();