GraphicDesign.StackExchange comment snippet adds username

Adds the OP's username in the [name] slot when pasting snippets for comments on GD.SE

当前为 2018-10-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name GraphicDesign.StackExchange comment snippet adds username
  3. // @namespace https://zachsaucier.com/
  4. // @version 0.1
  5. // @description Adds the OP's username in the [name] slot when pasting snippets for comments on GD.SE
  6. // @author Zach Saucier
  7. // @match https://graphicdesign.stackexchange.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. document.body.addEventListener("keyup", (e) => {
  15. let elem = e.target,
  16. opName = document.querySelector(".owner .user-details a").innerText;
  17. if(elem.name === "comment") {
  18. elem.value = elem.value.replace(/\[user\]/g, opName);
  19. }
  20. });
  21. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址