UserStyles.org markdown

在论坛默认使用 Markdown 格式,添加格式帮助链接及 Markdown 工具栏

旧版: v1.4.8 - 2020-09-07 - remove greasyfork
新版: v1.4.9 - 2020-12-09 - Re-added greasyfork (fixes for the redesigned GF by darkred)

  • --- /tmp/diffy20250407-1511073-5ykycf 2025-04-07 17:12:12.156797262 +0000
  • +++ /tmp/diffy20250407-1511073-q3y8yn 2025-04-07 17:12:12.157797275 +0000
  • @@ -1,8 +1,8 @@
  • // ==UserScript==
  • -// @name Markdown toolbar for USO
  • -// @name:ru Markdown-тулбар для USO
  • -// @name:zh-CN UserStyles.org markdown
  • -// @author wOxxOm
  • +// @name Markdown toolbar for GF and USO
  • +// @name:ru Markdown-тулбар для GF и USO
  • +// @name:zh-CN GreasyFork+UserStyles.org markdown
  • +// @author wOxxOm, darkred
  • // @contributor JixunMoe
  • // @license MIT License
  • // @description Select Markdown format by default, add help links, add toolbar formatting buttons for markdown
  • @@ -10,11 +10,22 @@
  • // @description:zh-CN 在论坛默认使用 Markdown 格式,添加格式帮助链接及 Markdown 工具栏
  • // @icon https://raw.githubusercontent.com/dcurtis/markdown-mark/master/png/66x40-solid.png
  • // @namespace wOxxOm.scripts
  • -// @version 1.4.8
  • +// @version 1.4.9
  • +// @include https://gf.qytechs.cn/*discussions/*
  • +// @include https://gf.qytechs.cn/*forum/discussion/*
  • +// @include https://gf.qytechs.cn/*forum/post/discussion*
  • +// @include https://gf.qytechs.cn/*forum/vanilla/post/editdiscussion/*
  • +// @include https://gf.qytechs.cn/*forum/post/editdiscussion/*
  • +// @include https://gf.qytechs.cn/*scripts/*/versions/new*
  • +// @include https://gf.qytechs.cn/*script_versions/new*
  • +// @include https://gf.qytechs.cn/*forum/messages/*
  • +// @include https://gf.qytechs.cn/*forum/profile/*/*
  • +// @include https://gf.qytechs.cn/*forum/profile
  • // @include https://forum.userstyles.org/discussion/*
  • // @include https://forum.userstyles.org/post/discussion*
  • // @include https://forum.userstyles.org/messages/*
  • // @include https://forum.userstyles.org/messages/add*
  • +// @include https://gf.qytechs.cn/*/conversations/*
  • // @include https://forum.userstyles.org/*/editdiscussion/*
  • // @run-at document-start
  • // @grant GM_addStyle
  • @@ -22,7 +33,7 @@
  • /* jshint lastsemic:true, multistr:true, laxbreak:true, -W030, -W041, -W084 */
  • -var inForum = location.href.indexOf('/forum') > 0;
  • +var inForum = location.href.indexOf('/discussions') > 0;
  • window.addEventListener('DOMContentLoaded', function(e) {
  • if (inForum)
  • @@ -79,7 +90,8 @@
  • } else {
  • for (var wrapper=n; wrapper = wrapper.parentNode; )
  • - if (t = wrapper.querySelector('textarea[id*="additional-info"]')) {
  • + // if (t = wrapper.querySelector('textarea[id*="additional-info"]')) {
  • + if (t = wrapper.querySelector('textarea[id*="additional-info"], textarea[id*="conversation_messages_attributes_0_content"], textarea[id*="discussion_comments_attributes_0_text"], textarea[id*="comment_text"]')) {
  • n.parentNode.textAreaNode = t;
  • break;
  • }

QingJ © 2025

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