您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Add a button to the Relationship to JRC Date field that sets it to today's date.
// ==UserScript== // @name Relationship to JRC Date: add Today button // @namespace https://github.com/nate-kean/ // @version 20251010 // @description Add a button to the Relationship to JRC Date field that sets it to today's date. // @author Nate Kean // @match https://jamesriver.fellowshiponego.com/members/edit/* // @match https://jamesriver.fellowshiponego.com/members/add* // @icon https://www.google.com/s2/favicons?sz=64&domain=fellowshiponego.com // @grant none // @license MIT // ==/UserScript== (async function() { document.head.insertAdjacentHTML("beforeend", ` <style id="nates-today-button-css"> #nates-today-button { float: right; font-weight: 600; border: none; font-size: 14px; } </style> `); function delay(ms) { return new Promise((resolve) => setTimeout(resolve, ms)); } function getDateString() { return new Intl.DateTimeFormat("en-US", { month: "2-digit", day: "2-digit", year: "numeric", }).format(new Date()); } while (true) { for (const formGroup of document.querySelectorAll(".form-group")) { if (formGroup.querySelector("label")?.textContent.trim() !== "Relationship to JRC Date") { continue; } const btn = document.createElement("button"); btn.id = "nates-today-button"; btn.textContent = "Today"; btn.type = "button"; btn.addEventListener("click", () => { formGroup.querySelector("input").value = getDateString(); }, { passive: true }); formGroup.prepend(btn); return; } await delay(100); } })();